!function(){"use strict";class t{t;o=0;i=[];u(t){if(t.hadRecentInput)return;const e=this.i[0],n=this.i.at(-1);this.o&&e&&n&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),this.t?.(t)}}const e=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart{if("loading"===document.readyState)return"loading";{const n=e();if(n){if(t{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},i=t=>{let e="";try{for(;9!==t?.nodeType;){const n=t,i=n.id?"#"+n.id:[r(n),...Array.from(n.classList).sort()].join(".");if(e.length+i.length>99)return e||i;if(e=e?i+">"+e:i,n.id)break;t=n.parentNode}}catch{}return e},o=new WeakMap;function a(t,e){return o.get(t)||o.set(t,new e),o.get(t)}let s=-1;const c=()=>s,u=t=>{addEventListener("pageshow",e=>{e.persisted&&(s=e.timeStamp,t(e))},!0)},l=(t,e,n,r)=>{let i,o;return a=>{e.value>=0&&(a||r)&&(o=e.value-(i??0),(o||void 0===i)&&(i=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},d=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},h=()=>{const t=e();return t?.activationStart??0},f=(t,n=-1)=>{const r=e();let i="navigate";return c()>=0?i="back-forward-cache":r&&(document.prerendering||h()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:n,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},m=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(t=>{Promise.resolve().then(()=>{e(t.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}},p=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let g=-1;const v=new Set,y=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,w=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of v)t();isFinite(g)||(g="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",w,!0))}},S=()=>{if(g<0){const t=h(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(e=>"hidden"===e.name&&e.startTime>t)[0]?.startTime;g=e??y(),addEventListener("visibilitychange",w,!0),addEventListener("prerenderingchange",w,!0),u(()=>{setTimeout(()=>{g=y()})})}return{get firstHiddenTime(){return g},onHidden(t){v.add(t)}}},C=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},b=[1800,3e3],L=(t,e={})=>{C(()=>{const n=S();let r,i=f("FCP");const o=m("paint",t=>{for(const e of t)"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime{i=f("FCP"),r=l(t,i,b,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},x=[.1,.25],z=t=>t.find(t=>1===t.node?.nodeType)||t[0];let B=0,M=1/0,D=0;const T=t=>{for(const e of t)e.interactionId&&(M=Math.min(M,e.interactionId),D=Math.max(D,e.interactionId),B=D?(D-M)/7+1:0)};let _;const A=()=>_?B:performance.interactionCount??0;let P=0;class N{l=[];h=new Map;m;p;v(){P=A(),this.l.length=0,this.h.clear()}M(){const t=Math.min(this.l.length-1,Math.floor((A()-P)/50));return this.l[t]}u(t){if(this.m?.(t),!t.interactionId&&"first-input"!==t.entryType)return;const e=this.l.at(-1);let n=this.h.get(t.interactionId);if(n||this.l.length<10||t.duration>e.T){if(n?t.duration>n.T?(n.entries=[t],n.T=t.duration):t.duration===n.T&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],T:t.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort((t,e)=>e.T-t.T),this.l.length>10){const t=this.l.splice(10);for(const e of t)this.h.delete(e.id)}this.p?.(n)}}}const I=t=>{const e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=p(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e(()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})}))},k=[200,500];class q{m;u(t){this.m?.(t)}}const U=[2500,4e3],E=[800,1800],j=t=>{document.prerendering?C(()=>j(t)):"complete"!==document.readyState?addEventListener("load",()=>j(t),!0):setTimeout(t)},H=()=>"undefined"==typeof window;function K(t,...e){if(0===e.length)return t;const n=e[0];return t[n]||(t[n]={}),K(t[n],...e.slice(1))}function O(t){try{return decodeURIComponent(t)}catch(t){return""}}function W(){if(!H())return window}function F(){var t,e;return!H()&&Boolean(null===(t=W())||void 0===t||null===(e=t.Shopify)||void 0===e?void 0:e.theme)}function R(){var t;return!H()&&Boolean(null===(t=W())||void 0===t?void 0:t.__CUSTOMER_ACCOUNT__)}function Z(){try{return"undefined"!=typeof PerformanceServerTiming}catch{return!1}}const J="",X="1",V="0",G="p",Y="a",$="m",Q="t",tt="m",et="a",nt="p",rt="s";function it(t){const e=function(){try{return document.cookie}catch{return!1}}()?document.cookie.split("; "):[];for(let n=0;n{});console.log("Monorail event from consent API:",r,n)}catch(t){}}}function at(){var t,e;return H()?{}:(null===(t=window.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.config)||{}}ot.instance=void 0;const st=/^https?:\/\/([^/]+)(\/api\/(?:unstable|2\d{3}-\d{2})\/graphql\.json(?=$|\?))?/;function ct(t,e){if("fetch"!==t.initiatorType)return!1;const n=t.name.match(st);if(!n)return!1;const[,r,i]=n;return r===e||!!i&&!(null==r||!r.endsWith(`.${e}`))}const ut="_cmp",lt="consentHeader";function dt(t=ut){let e;if(e=gt()&&ht(()=>function(t=ut){var e,n;if(H())return;const r=null===(e=performance)||void 0===e||null===(n=e.getEntriesByType)||void 0===n?void 0:n.call(e,"resource"),i=window.location.host;let o=mt[t];for(let e=r.length-1;e>=0;e--){const n=r[e];if(!ct(n,i))continue;const a=pt(n,t);if(a){o=a;break}}return mt[t]=o,o}(t))||ht(()=>ft(t)),!e){if(t!==ut)return;let e;try{e=sessionStorage.getItem(lt)}catch{}return e||void 0}try{e=decodeURIComponent(e)}catch{}return e}function ht(t){try{return t()}catch{return}}function ft(t=ut){var e,n;if(!vt()&&!function(){try{const t=performance.getEntriesByType("navigation")[0].serverTiming;return!!t&&0!=t.length}catch{return!1}}()){const t=new ot;let e="failed_to_fetch";try{e=navigator.userAgent}catch{}t.produce("navigationServerTiming",JSON.stringify({failed:!0,userAgent:e,apiSupported:Z()})),function(){if(vt())return;K(W(),"Shopify","customerPrivacy").serverTimingSupportVerified=!0}()}const r=null===(e=performance)||void 0===e||null===(n=e.getEntriesByType)||void 0===n?void 0:n.call(e,"navigation");if(!r)return;const i=r.map(e=>pt(e,t)).find(t=>t);return i&&t===ut&&function(t){if(!H()){try{t=decodeURIComponent(t)}catch{}try{sessionStorage.setItem(lt,t)}catch{}}}(i),i}const mt={};function pt(t,e=ut){var n,r;if(t)return null===(n=t.serverTiming)||void 0===n||null===(r=n.find(t=>t.name==e))||void 0===r?void 0:r.description}function gt(){return!H()&&(function(){var t,e;const n=W();return!0===(null==n||null===(t=n.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.backendConsentEnabled)||!0===at().asyncVisitorState}()||!F()&&!R()&&!function(){if(H())return!1;try{return null!==document.querySelector('meta[name="serialized-trackingConsent"]')}catch{return!1}}())}function vt(){var t,e;const n=W();return null==n||null===(t=n.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.serverTimingSupportVerified}function yt(){if(!H()){var t,e;const n=(null===(t=window.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.injectedConsent)||at().injectedConsent;return n?O(n):void 0}}function wt(){var t;return null===(t=function(){var t;if(!H())return null===(t=window.Shopify)||void 0===t?void 0:t.customerPrivacy}())||void 0===t?void 0:t.consentStatus}function St(){let t;if(t=H()?yt():function(){var t,e;const n=null===(t=window.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.cachedConsent;return n?O(n):void 0}()||yt()||new URLSearchParams(window.location.search).get("_cs")||void 0||it("_tracking_consent")||dt(),void 0!==t)return function(t){if("%"==t.slice(0,1))try{t=decodeURIComponent(t)}catch{}const e=t.slice(0,1);if("{"==e)return function(t){var e;let n;try{n=JSON.parse(t)}catch{return}if("2.1"!==n.v)return;if(null===(e=n.con)||void 0===e||!e.CMP)return;return n}(t);if("3"==e)return function(t){const e=t.slice(1).split("_"),[n,r,i,o,a]=e;let s,c;try{s=e[5]?JSON.parse(e.slice(5).join("_")):void 0}catch{}if(a){const t=a.replace(/\*/g,"/").replace(/-/g,"+"),e=atob(t);let n="";for(let t=0;tt.slice(0,e)+"-"+t.slice(e),n)}function u(t){const e=n.split(".")[0];return e.includes(t.toLowerCase())?V:e.includes(t.toUpperCase())?X:J}function l(t){return n.includes(t.replace("t","s").toUpperCase())}return{v:"3",con:{CMP:{[et]:u(et),[nt]:u(nt),[tt]:u(tt),[rt]:u(rt)}},region:r||"",cus:s,purposes:{[Y]:l(Y),[G]:l(G),[$]:l($),[Q]:l(Q)},sale_of_data_region:"t"==o,display_banner:"t"==i,consent_id:c}}(t);return}(t)}function Ct(t){const e=function(){try{let t=St();if(!t)return;return t}catch{return}}();if(!e||!e.purposes)return!0;const n=e.purposes[t];return"boolean"!=typeof n||n}function bt(){return Ct(Y)}const Lt=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/;function xt(t,e){if("string"!=typeof t)return;if(!function(t){return!!t&&Lt.test(t.trim().toLowerCase())}(t))return;const n=t.trim();if("00000000-0000-0000-0000-000000000000"===n)return;if("00000000-0000-0000-5000-000000000000"===n)return;return Number.isFinite(NaN)&&Date.now()>NaN?void 0:n}const zt="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";function Bt(t){return zt.replace(/[xy]/g,e=>{const n=t();return("x"===e?n:3&n|8).toString(16)})}function Mt(){const t="undefined"!=typeof crypto?crypto:void 0;if("function"==typeof(null==t?void 0:t.randomUUID))return t.randomUUID();if("function"==typeof(null==t?void 0:t.getRandomValues)){const e=t.getRandomValues(new Uint8Array(36));let n=0;return Bt(()=>e[n++]%16)}return Bt(()=>16*Math.random()|0)}function Dt(t,e){const n=W();if(!n)return;const r=K(n,"Shopify","customerPrivacy","cachedToken");if(e){const n="_shopify_s"===t?18e5:31536e6;r[t]=e,r[t+"_expires_at"]=Date.now()+n}else delete r[t],delete r[t+"_expires_at"]}function Tt(t){if(!H())try{var e,n;return null===(e=document.querySelector(`meta[name="${t}"]`))||void 0===e||null===(n=e.getAttribute("content"))||void 0===n?void 0:n.trim()}catch{return}}function _t(t){const e=Tt(t);if(e)try{const t=JSON.parse(e);return"string"==typeof t?t.trim():void 0}catch{return}}function At(t){return void 0!==t&&Date.now()>t}function Pt(t,e){const n=xt(_t(e));if(n&&!At(function(t){const e=_t(`${t}Expiration`);if(!e)return;const n=Number(e);return Number.isFinite(n)?n:void 0}(e)))return n;const r=xt(Tt(t));return r&&!At(function(t){if(!H())try{var e,n;const r=null===(e=document.querySelector(`meta[name="${t}"]`))||void 0===e||null===(n=e.getAttribute("data-expiration"))||void 0===n?void 0:n.trim();if(!r)return;const i=Number(r);return Number.isFinite(i)?i:void 0}catch{return}}(t))?r:void 0}function Nt(){return Pt("shopify-y","serialized-shopifyY")}function It(){return Pt("shopify-s","serialized-shopifyS")}class kt{constructor(){if(this.endpoint="https://otlp-http-production.shopifysvc.com/v1/metrics",this.serviceName="consent-tracking-api",this.scopeName="consent-tracking-api-opentelemetry",kt.instance)return kt.instance;kt.instance=this}increment(t,e={}){if(!H()&&t)try{const n=this.buildMetricBody(t,e);if(window.location.host.endsWith("spin.dev"))return void console.log("OpenTelemetry metric from consent API:",n);if("function"!=typeof fetch)return;return fetch(this.endpoint,{headers:{accept:"*/*","content-type":"application/json; charset=utf-8"},body:JSON.stringify(n),method:"POST",mode:"cors",credentials:"omit"}).catch(()=>{})}catch(t){}}buildMetricBody(t,e){const n=1e6*Date.now();return{resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeMetrics:[{scope:{name:this.scopeName,version:"1.0.0",attributes:[]},metrics:[{name:t,unit:"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[{asDouble:1,startTimeUnixNano:n,timeUnixNano:n,attributes:qt(e)}]}}]}]}]}}}function qt(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return null==r||e.push({key:n,value:Ut(r)}),e},[])}function Ut(t){return"string"==typeof t?{stringValue:t}:"boolean"==typeof t?{boolValue:t}:isFinite(t)?Math.floor(t)===t?{intValue:t}:{doubleValue:t}:{stringValue:String(t)}}kt.instance=void 0;const Et=new kt;function jt(t,e){try{const n=function(){try{return window.location.href.includes("debug_token_source_instrumentation_force")}catch{return!1}}();if(!n&&Math.random()>=.01)return;const r={token:"_shopify_y"===t?"unique":"visit",source:e,forced:n,sample_rate:.01};n&&console.log("consent_tracking_api_tracking_token_read",r),Et.increment("consent_tracking_api_tracking_token_read",r)}catch{}}function Ht(){const t=document.querySelector('[data-serialized-id="app-base-path"]');if(R()||t){var e;const n=document.querySelector('[data-serialized-id="preview-mode-data"]');if("/"!==JSON.parse((null==t?void 0:t.textContent)||"null")||!1!==(null===(e=JSON.parse((null==n?void 0:n.textContent)||"null"))||void 0===e?void 0:e.inPreviewMode))return;return new URL("/customer/api/unstable/graphql",window.location.origin).href}const{protocol:n,host:r}=function(){const t=at().consentDomain||window.location.host;return{protocol:/^(localhost|127\.0\.0\.1)(:|$)/.test(t)?"http:":"https:",host:t}}();return`${n}//${r}/api/unstable/graphql.json`}async function Kt(t){try{var e;if(n=.01,!(Math.random()0}catch{}!function(t,e,n){(new ot).produce("persistOutcome",JSON.stringify({ok:t,status:e,graphqlErrors:n,sampleRate:.01}))}(!(null==t||!t.ok),null!==(e=null==t?void 0:t.status)&&void 0!==e?e:null,r)}catch{}var n}const Ot={};function Wt(t){const e=function(t){try{var e,n;const o=null===(e=performance)||void 0===e||null===(n=e.getEntriesByType)||void 0===n?void 0:n.call(e,"resource");if(!o)return;const a=window.location.host;for(let e=o.length-1;e>=0;e--){var r,i;const n=o[e];if(!ct(n,a))continue;const s=null===(r=n.serverTiming)||void 0===r||null===(i=r.find(e=>e.name===t))||void 0===i?void 0:i.description;if(s)return s}return}catch{return}}(t);return e&&(Ot[t]=e),e}function Ft(t){if(gt()){const e=Wt(t);if(e)return{value:e,source:"resource"};const n=Ot[t];if(n)return{value:n,source:"cache"}}const e=function(t){try{var e,n,r,i;return null===(e=performance)||void 0===e||null===(n=e.getEntriesByType("navigation")[0])||void 0===n||null===(r=n.serverTiming)||void 0===r||null===(i=r.find(e=>e.name==t))||void 0===i?void 0:i.description}catch{return}}(t);return e?{value:e,source:"navigation"}:{value:void 0,source:null}}function Rt(t,e,{generateFallback:n=!1,tag:r="unknown"}={}){if(n&&H())throw new Error("Token generateFallback is not supported in Node.js environments, just browsers.");if(!bt()&&!Ct($))return;const i=function(t){var e,n,r,i,o,a;const s=W();if(!s)return;const c=null===(e=s.Shopify)||void 0===e||null===(n=e.customerPrivacy)||void 0===n||null===(r=n.cachedToken)||void 0===r?void 0:r[t],u=null===(i=s.Shopify)||void 0===i||null===(o=i.customerPrivacy)||void 0===o||null===(a=o.cachedToken)||void 0===a?void 0:a[t+"_expires_at"];return!c||!u||u<(new Date).getTime()?void 0:xt(c)}(t);if(i)return jt(t,"window_cache"),i;const o=W();if(function(t){if(!t)return!1;try{const e=Object(t);return Reflect.has(e,"trackingUnique")||Reflect.has(e,"trackingVisit")}catch{return!1}}(null==o?void 0:o.ShopPay)){const e=function(t){const e=W();if(!e||!e.ShopPay)return;const n={_shopify_y:"trackingUnique",_shopify_s:"trackingVisit"}[t];if(!n)return;return xt(e.ShopPay[n])}(t);return jt(t,"shop_pay"),e}const a=e();if(a)return jt(t,"meta"),a;const s=function(t){const e=t.replace("_shopify",""),n=Ft(e),r=Number(Ft(`${e}e`).value);if(!r||Date.now()/1e3e.trim().startsWith(`${t}=`)))||void 0===r||null===(i=r.split("=")[1])||void 0===i?void 0:i.trim()}catch{return}}(t));if(c)return jt(t,"cookie"),c;jt(t,"missing");try{if(!n)return;if(!0===at().asyncConsent&&"loaded"!==wt())return;!function(t,e=!1,n="unknown"){var r,i;Et.increment("consent_tracking_api_tracking_token_missing");const o=W();(new ot).produce("trackingTokenMissing",JSON.stringify({token:t,hasTrekkie:!(null==o||!o.ShopifyAnalytics),hasTheme:!(null==o||null===(r=o.Shopify)||void 0===r||!r.theme),domain:null==o||null===(i=o.location)||void 0===i?void 0:i.hostname,fallbackRequested:e,tag:n}))}(t,n,r);const e=Zt()?void 0:Mt(),i=Jt()?void 0:Mt();return e&&Dt("_shopify_y",e),i&&Dt("_shopify_s",i),function(t,e){if(!H())try{const n=xt(t),r=xt(e);if(!n&&!r)return;const i=Ht();if(!i)return;const o=new URLSearchParams,a={"content-type":"application/json"};n&&(o.set("_y",n),a["X-Shopify-UniqueToken"]=n),r&&(o.set("_s",r),a["X-Shopify-VisitToken"]=r);const s=`${i}?${o.toString()}`;let c;try{c=fetch(s,{headers:a,body:JSON.stringify({query:"query { consentManagement { cookies(visitorConsent:{}) { cookieDomain } } }",variables:{}}),method:"POST",mode:"cors",credentials:"include"})}catch(t){c=Promise.reject(t)}c.then(t=>Kt(t),()=>Kt(void 0))}catch{}}(e,i),"_shopify_y"===t?e:i}catch{}}function Zt({generateFallback:t=!1,tag:e="unknown"}={}){return Rt("_shopify_y",Nt,{generateFallback:t,tag:e})}function Jt({generateFallback:t=!1,tag:e="unknown"}={}){return Rt("_shopify_s",It,{generateFallback:t,tag:e})}function Xt(){return bt()}function Vt(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}!function(){try{var t,e,n,r,i;if(H()||F())return;if("function"!=typeof(null===(t=performance)||void 0===t?void 0:t.setResourceTimingBufferSize))return;if((null!==(e=null===(n=(r=performance).getEntriesByType)||void 0===n||null===(i=n.call(r,"resource"))||void 0===i?void 0:i.length)&&void 0!==e?e:0)>=1e3)return;performance.setResourceTimingBufferSize(1e3)}catch{}}();var Gt=0;function Yt(t){return"__private_"+Gt+++"_"+t}function $t(t){return Object.entries(t).map(([t,e])=>({key:t,value:{stringValue:String(e)}}))}function Qt(t){if(Array.isArray(t))return{arrayValue:{values:t.map(t=>Qt(t))}};switch(typeof t){case"boolean":return{boolValue:Boolean(t)};case"number":return{doubleValue:Number(t)};default:return{stringValue:String(t)}}}const te=function(t,e,n){const r=[0];for(let i=0;i{t.attributes={...Vt(this,ne)[ne],...t.attributes}});const t=Vt(this,re)[re];Vt(this,re)[re]=[],await this.exportByKeepalive(t,(t,e)=>Vt(this,ee)[ee].exportMetrics(this.aggregateMetrics(t),e))}async exportLogs(){const t=Vt(this,ie)[ie];Vt(this,ie)[ie]=[],await this.exportByKeepalive(t,(t,e)=>Vt(this,ee)[ee].exportLogs(this.formatLogs(t),e))}aggregateMetrics(t){const e={};return t.forEach(t=>{switch(t.type){case"histogram":!function(t,e){var n;const{name:r,value:i,unit:o,timeUnixNano:a,attributes:s}=e,c=null!==(n=e.bounds)&&void 0!==n?n:te,u=new Array(c.length+1).fill(0);t[r]||={name:r,unit:o||"1",histogram:{aggregationTemporality:1,dataPoints:[]}};for(let t=0;t0?d:0,bucketCounts:r>0?[1]:[]};t[n].exponentialHistogram.dataPoints.push({attributes:$t(null!=a?a:{}),startTimeUnixNano:o,timeUnixNano:o,count:1,sum:c,scale:u,zeroCount:h,positive:m,negative:f,min:c,max:c,zeroThreshold:0})}(e,t);break;case"counter":!function(t,e){const{name:n,value:r,unit:i,timeUnixNano:o,attributes:a}=e;t[n]||={name:n,unit:i||"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}},t[n].sum.dataPoints.push({startTimeUnixNano:o,timeUnixNano:o,asDouble:r,attributes:$t(null!=a?a:{})})}(e,t);break;case"gauge":!function(t,e){const{name:n,value:r,unit:i,timeUnixNano:o,attributes:a}=e;t[n]||={name:n,unit:i||"1",gauge:{dataPoints:[]}},t[n].gauge.dataPoints.push({startTimeUnixNano:o,timeUnixNano:o,asDouble:r,attributes:$t(null!=a?a:{})})}(e,t)}}),Object.values(e)}async exportByKeepalive(t,e){if(0===t.length)return;const n=[],r=[];t.forEach(t=>{var e;null===(e=t.requiresKeepalive)||void 0===e||e?n.push(t):r.push(t)});const i=[n.length>0?e(n,{keepalive:!0}):void 0,r.length>0?e(r,{keepalive:!1}):void 0].filter(t=>void 0!==t);await Promise.all(i)}formatLogs(t){return t.map(t=>{const e={timeUnixNano:t.timeUnixNano,observedTimeUnixNano:t.timeUnixNano,attributes:(n={...Vt(this,ne)[ne],...t.attributes},Object.entries(n).map(([t,e])=>({key:t,value:Qt(e)})))};var n;return t.body&&(e.body={stringValue:t.body}),e})}}var ae=Yt("url"),se=Yt("serviceName"),ce=Yt("logger"),ue=Yt("fetchFn"),le=Yt("maxPayloadSizeBytes");class de{constructor(t,e,n){var r;Object.defineProperty(this,ae,{writable:!0,value:void 0}),Object.defineProperty(this,se,{writable:!0,value:void 0}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),Object.defineProperty(this,ue,{writable:!0,value:void 0}),Object.defineProperty(this,le,{writable:!0,value:void 0}),Vt(this,ae)[ae]=t.replace(/\/v1\/(logs|metrics|traces)\/?$/,""),Vt(this,se)[se]=e,Vt(this,ce)[ce]=null==n?void 0:n.logger,Vt(this,ue)[ue]=null==n?void 0:n.fetchFn,Vt(this,le)[le]=null!==(r=null==n?void 0:n.maxPayloadSizeBytes)&&void 0!==r?r:51200}async exportMetrics(t,e){var n;const r=null===(n=null==e?void 0:e.keepalive)||void 0===n||n;await this.exportBatches("/v1/metrics",[...t],t=>({resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:Vt(this,se)[se]}}]},scopeMetrics:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},metrics:t}]}]}),r)}async exportLogs(t,e){var n;const r=null===(n=null==e?void 0:e.keepalive)||void 0===n||n;await this.exportBatches("/v1/logs",[...t],t=>({resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:Vt(this,se)[se]}}]},scopeLogs:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},logRecords:t}]}]}),r)}async exportTo(t,e,n){var r;const i=JSON.stringify(t),o=(new TextEncoder).encode(i).length;if(o>Vt(this,le)[le])throw new fe(`Payload size ${o} exceeds ${Vt(this,le)[le]} bytes`);const a=await this.exporterFetch()(`${Vt(this,ae)[ae]}${e}`,{method:"POST",keepalive:n,headers:{"Content-Type":"application/json"},body:i});if(null===(r=Vt(this,ce)[ce])||void 0===r||r.log({status:a.status}),!a.ok){if(400===a.status){const t=await a.text();throw new he(`Invalid OpenTelemetry Data: ${t}`)}if(429===a.status||503===a.status){const e=await a.text(),n=a.headers.get("Retry-After"),r=n?{seconds:Number(n)}:void 0;throw new he("Server did not accept data",{errorData:e,retryAfter:r,body:t})}if(401===a.status||403===a.status){const e=await a.text();throw new me(`Authentication failed: ${a.status} ${401===a.status?"Unauthorized":"Forbidden"}`,{errorData:e,body:t})}throw new he(`Server responded with ${a.status}`)}}exporterFetch(){return Vt(this,ue)[ue]||fetch}async exportBatches(t,e,n,r){let i=e.length;for(;e.length>0;)try{const o=e.slice(0,i);await this.exportTo(n(o),t,r),e.splice(0,i)}catch(t){if(!(t instanceof fe&&i>1))throw t;i=Math.ceil(i/2)}}}class he extends Error{constructor(t,e){super(t),this.metadata=void 0,this.name="OpenTelemetryClientError",this.metadata=e}}class fe extends Error{constructor(...t){super(...t),this.name="PayloadTooLargeError"}}class me extends Error{constructor(t,e){super(t),this.name="AuthenticationFailedError",this.metadata=void 0,this.name="AuthenticationFailedError",this.metadata=e}}var pe="2.5.1";function ge(t,e){const n=ve();return ge=function(e,r){let i=n[e-=213];if(void 0===ge.GBGRdE){ge.yMcSZU=function(t){let e="",n="";for(let n,r,i=0,o=0;r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?e+=String.fromCharCode(255&n>>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;t>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;t0&&n++,(t[we(285)][we(271)]&&t[we(285)][we(271)][we(248)]>0||typeof e===we(242)&&e[we(277)](we(280)))&&n++,function(t){const e=t[we(260)][we(263)]||t[we(272)][we(259)][we(241)],n=t[we(260)][we(279)]||t[we(272)][we(259)][we(249)];if(!e||!n||e<=2||n<=2)return!1;const r=e/n;return r>=.2&&r<=5}(t)&&n++,typeof t[we(260)][we(284)]!==we(267)&&n++;try{const t=(new Date)[we(246)]();t>-840&&t<840&&n++}catch{return n>=3?1:0}return n>=3?1:0}catch{return 0}}function Ce(t){const e=function(t){try{return t[we(285)][we(250)]?1:0}catch{return 0}}(t),[n,r]=function(t){try{const e=t[we(285)][we(265)];try{return[e,String(e)]}catch{return[e,void 0]}}catch{return[void 0,void 0]}}(t),i=function(t){return void 0!==t&&/bot|crawler|spider|scraper/i[we(283)](t)?0:1}(r),o=function(t){try{const e=t[we(272)][we(252)](we(254));e[we(278)]=200,e[we(258)]=50;const n=e[we(257)]("2d");if(null===n)return 0;const r=n[we(261)](0,0,200,0);r[we(275)](0,we(243)),r[we(275)](1,we(255)),n[we(281)]=r,n[we(276)](0,0,200,50),n[we(281)]=we(245),n[we(268)]=we(282),n[we(240)](we(266),33,30);const i=e[we(247)]();return i&&i[we(248)]>50?1:0}catch{return 0}}(t);return{wd:e,ua:i,cv:o,br:Se(t,n)}}function be(t,e){var n=Le();return be=function(e,r){var i=n[e-=311];if(void 0===be.AhKtOf){be.EZsVDQ=function(t){for(var e,n,r="",i="",o=0,a=0;n=t.charAt(a++);~n&&(e=o%4?64*e+n:n,o++%4)?r+=String.fromCharCode(255&e>>(-2*o&6)):0)n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(n);for(var s=0,c=r.length;s>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;t=this[xe(313)]))try{await this[xe(326)][xe(329)]()}catch(t){this[xe(314)]&&console[xe(331)](xe(336)+t)}}[xe(319)](){this[xe(320)]&&clearTimeout(this[xe(320)]),this[xe(320)]=window[xe(315)](()=>{this[xe(330)]()[xe(317)](()=>{})},this[xe(338)])}}function Me(){const t=["mZy0nJG5nLzcBfDtua","mtK5nty2ve5Pr2vA","BgvUz3rO","nMLUr0nUqW","ntq4nteWChfeEeDy","ntC0oty1CLPXrNPS","y2HHCKnVzgvbDa","mMfuAg5hzq","otGWntuYExL5qMTf","nJC1mJKWshH5Ee9I","mtbLvwTvwey","nefJALzrCq","mtyXnZiYA29Ozg1b","ywjZ"];return(Me=function(){return t})()}function De(t,e){const n=Me();return De=function(e,r){let i=n[e-=484];if(void 0===De.ArOGoN){De.pZXbud=function(t){let e="",n="";for(let n,r,i=0,o=0;r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?e+=String.fromCharCode(255&n>>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;tt+e.s,0)/t[Re(581)],n=t[Re(534)]((t,n)=>t+(n.s-e)**2,0)/(t[Re(581)]-1),r=Math[Re(585)](n);return{speed:e,jitter:r}}function Ue(t,e,n,r,i,o,a,s,c,u,l,d,h){const f=Math[Re(462)](1e3,t),m=Math[Re(462)](1e3,n),p=Math[Re(462)](1e3,o),g=Math[Re(462)](1e3,s),v=Math[Re(462)](1e3,a),y=Math[Re(462)](1e3,c),w=[];if(e[Re(581)]>=3)for(let t=1;t5e-4){e=!0;break}n=r.s}else n=r.s;return e}(w),C=function(t){if(t[Re(581)]<3)return 0;let e=0,n=0;for(let r=1;r2*Math.PI-Math.PI/12)&&e++,n++}return n>0?e/n:0}(e),{speed:b,jitter:L}=qe(w);let x=0,z=0;if(r[Re(581)]>1){const t=new Set(r[Re(422)](t=>Math[Re(391)](t.x/20)+","+Math[Re(391)](t.y/20)))[Re(598)];x=t>1?1:0,z=r[Re(534)]((t,e)=>t+e[Re(615)],0)/r[Re(581)]}const B=i[Re(534)]((t,e)=>(null===e[Re(569)]||t[Re(500)](e[Re(569)]),t),[]),{rhythmConsistency:M,jitter:D}=function(t){if(t[Re(581)]<2)return{rhythmConsistency:0,jitter:0};const e=t[Re(534)]((t,e)=>t+e,0)/t[Re(581)],n=t[Re(534)]((t,n)=>(t??0)+((n??0)-e)**2,0)/t[Re(581)],r=Math[Re(585)](n);return{rhythmConsistency:0===r?1:Math[Re(447)](0,1-r/e),jitter:r/e}}(B),T=B[Re(581)]>0?B[Re(534)]((t,e)=>t+e,0)/B[Re(581)]:0,_=[];if(u[Re(581)]>=3)for(let t=1;tu[t-1].p?Re(493):"up";_[Re(500)]({s:r,dir:i,t:u[t].t})}const{speed:A,jitter:P}=qe(_),N=function(t){if(t[Re(581)]<2)return 0;let e=0;for(let n=1;n=500&&t[r].t-n>=500&&(e++,n=t[r].t);return e}(_)),{speed:k,jitter:q}=qe(l),U=function(t){if(t[Re(581)]<2)return 0;let e=0;for(let n=1;n=500&&e++;return e}(l)),j=Math[Re(391)]((h-d)/1e3);return{ma:f,ca:m,ka:p,sa:g,ta:y,kba:v,t:Math[Re(462)](3600,j),nm:S?1:0,ms:je(C),mj:je(L),msp:je(b),vc:x,cp:je(z),rc:je(M),kj:je(D),ki:je(T),ss:je(A),sj:je(P),ssm:je(N),sp:I,ts:je(k),tj:je(q),tp:E,tsm:je(U)}}function Ee(t,e){let n=0;return(...r)=>{const i=typeof performance!==Re(410)?performance[Re(584)]():Date[Re(584)]();i-n>=e&&(n=i,t(...r))}}function je(t){return Math[Re(458)](100*t)/100}function He(t){return{wd:t[Re(568)],ua:t[Re(461)],cf:t[Re(576)],be:t[Re(621)],nm:t[Re(406)],nc:t[Re(437)],ka:t[Re(479)],sa:t[Re(452)],ta:t[Re(398)],pt:t[Re(482)],mp:t[Re(446)],sd:t[Re(519)]}}class Ke{[Re(567)];[Re(439)];[Re(545)];[Re(594)];[Re(469)];[Re(610)]=!1;constructor(t,e,n=Ie()){const r={shopId:0,updateInterval:5e3,debug:!1,beaconEndpoint:Ae,beaconRetryLimit:3,maxSilenceMs:18e5,exportWithFetch:!1,logsSampleRate:1,candidateSignalsEnabled:!1,candidateActivePageFlushEnabled:!0,candidateUpdateInterval:5e3,candidateSampleRate:100};this[Re(567)]={...r,...e},this[Re(545)]=n,this[Re(594)]=t,this[Re(439)]={startTime:Date[Re(584)](),lastUpdateTime:null,environmentChecked:!1,sessionData:null,mouseActivity:0,clickActivity:0,keyActivity:0,keyboardBurstActivity:0,scrollActivity:0,touchActivity:0,mousePositions:[],clickPositions:[],keyEvents:[],scrollEvents:[],keyboardBursts:[],touchEvents:[],lastTouchEvent:null};const i=this[Re(627)]();this[Re(439)][Re(538)]={lastSignals:i,lastProcessTime:0,lastSuccessfulSendTime:0,retryCount:0},this[Re(469)]=(this[Re(567)][Re(523)],this[Re(567)][Re(403)],this[Re(545)][Re(464)],this[Re(545)][Re(454)],this[Re(567)][Re(480)],this[Re(567)][Re(438)],null)}[Re(532)](){(async()=>{const t=this[Re(432)]();this[Re(456)](t),await Promise[Re(392)](),await this[Re(400)](!0),this[Re(567)][Re(548)]&&this[Re(469)]?.[Re(562)](),this[Re(545)][Re(454)][Re(524)](()=>{this[Re(429)]()},100);const e=()=>{const t=Date[Re(584)](),n=t-(this[Re(439)][Re(565)]||t),r=Math[Re(447)](0,this[Re(567)][Re(397)]-n),i=()=>{this[Re(545)][Re(454)][Re(418)]?this[Re(439)][Re(550)]=this[Re(545)][Re(454)][Re(418)](()=>{this[Re(400)]()[Re(529)](()=>this[Re(594)][Re(440)]())[Re(529)](()=>{e()})},{timeout:2e3}):this[Re(400)]()[Re(529)](()=>this[Re(594)][Re(440)]())[Re(529)](()=>{e()})};r>0?this[Re(545)][Re(454)][Re(524)](i,r):i()};e()})()[Re(436)](t=>{this[Re(594)][Re(539)](t,Re(532))})}[Re(547)](){try{this[Re(469)]?.[Re(547)]()}catch(t){this[Re(594)][Re(539)](t,Re(476))}this[Re(439)][Re(433)]&&this[Re(545)][Re(454)][Re(628)](this[Re(439)][Re(433)]),this[Re(439)][Re(550)]&&this[Re(545)][Re(454)][Re(570)]&&this[Re(545)][Re(454)][Re(570)](this[Re(439)][Re(550)]),this[Re(439)][Re(496)]&&(this[Re(545)][Re(464)][Re(499)](Re(586),this[Re(439)][Re(496)][Re(586)]),this[Re(545)][Re(464)][Re(499)](Re(506),this[Re(439)][Re(496)][Re(506)]),this[Re(545)][Re(464)][Re(499)](Re(394),this[Re(439)][Re(496)][Re(394)]),this[Re(545)][Re(464)][Re(499)](Re(543),this[Re(439)][Re(496)][Re(543)]),Re(487)in window&&this[Re(439)][Re(496)][Re(488)]&&this[Re(439)][Re(496)][Re(405)]&&this[Re(439)][Re(496)][Re(625)]&&(this[Re(545)][Re(464)][Re(499)](Re(488),this[Re(439)][Re(496)][Re(488)]),this[Re(545)][Re(464)][Re(499)](Re(405),this[Re(439)][Re(496)][Re(405)]),this[Re(545)][Re(464)][Re(499)](Re(625),this[Re(439)][Re(496)][Re(625)]))),this[Re(439)][Re(538)]?.[Re(602)]&&this[Re(545)][Re(454)][Re(628)](this[Re(439)][Re(538)][Re(602)]),this[Re(439)][Re(538)]=void 0}[Re(557)](){return this[Re(439)][Re(538)]?.[Re(622)]?He(this[Re(439)][Re(538)][Re(622)]):null}[Re(555)](){return this[Re(469)]?.[Re(557)]()??null}[Re(620)](){return this[Re(469)]?.[Re(428)]()??null}[Re(432)](){const t={v1:Ce(this[Re(545)])};return this[Re(439)][Re(404)]=t.v1,this[Re(439)][Re(535)]=!0,t[Re(552)]}[Re(494)](t,e){return n=>{try{t(n)}catch(t){this[Re(594)][Re(539)](t,Re(521)+e)}}}[Re(429)](){const t=Ee(this[Re(494)](t=>{this[Re(439)][Re(574)]++,this[Re(439)][Re(597)][Re(581)]>=10&&this[Re(439)][Re(597)][Re(530)](),this[Re(439)][Re(597)][Re(500)]({x:t[Re(423)],y:t[Re(540)],t:t[Re(626)]})},Re(586)),100),e=this[Re(494)](t=>{this[Re(439)][Re(525)]++,requestAnimationFrame(()=>setTimeout(()=>{this[Re(439)][Re(401)][Re(581)]>=5&&this[Re(439)][Re(401)][Re(530)](),this[Re(439)][Re(401)][Re(500)]({x:t[Re(423)],y:t[Re(540)],t:t[Re(626)],pre:this[Re(402)](t)})},0))},Re(506)),n=this[Re(494)](t=>{this[Re(439)][Re(607)]++;const e=t[Re(415)];if([Re(442),Re(554),Re(623),Re(599)][Re(427)](e))return;const n=this[Re(439)][Re(449)][this[Re(439)][Re(449)][Re(581)]-1],r=t[Re(626)],i=n?r-n.t:null;this[Re(439)][Re(449)][Re(581)]>=10&&this[Re(439)][Re(449)][Re(530)](),this[Re(439)][Re(449)][Re(500)]({_0x444376:e,t:r,int:i}),null!==i&&i<100?(this[Re(439)][Re(546)][Re(500)](i),this[Re(439)][Re(546)][Re(581)]>=5&&(this[Re(439)][Re(486)]++,this[Re(439)][Re(546)]=[])):this[Re(439)][Re(546)]=[]},Re(394)),r=Ee(this[Re(494)](t=>{this[Re(439)][Re(533)]++;const e=t[Re(626)],n=window[Re(472)];this[Re(439)][Re(485)][Re(581)]>=10&&this[Re(439)][Re(485)][Re(530)](),this[Re(439)][Re(485)][Re(500)]({p:n,t:e})},Re(543)),200),i=this[Re(494)](t=>{t[Re(522)]&&0!==t[Re(522)][Re(581)]&&(this[Re(439)][Re(544)]++,this[Re(439)][Re(455)][Re(581)]>=10&&this[Re(439)][Re(455)][Re(530)](),this[Re(439)][Re(468)]={x:t[Re(522)][0][Re(423)],y:t[Re(522)][0][Re(540)],t:t[Re(626)],typ:Re(517),s:0,d:0})},Re(488)),o=Ee(this[Re(494)](t=>{if(!t[Re(522)]||0===t[Re(522)][Re(581)])return;const e={x:t[Re(522)][0][Re(423)],y:t[Re(522)][0][Re(540)]};if(this[Re(439)][Re(468)]){const n=this[Re(513)](this[Re(439)][Re(468)],e);this[Re(439)][Re(455)][Re(581)]>=10&&this[Re(439)][Re(455)][Re(530)]();const r={x:t[Re(522)][0][Re(423)],y:t[Re(522)][0][Re(540)],t:t[Re(626)],typ:Re(571),d:n,s:n/(t[Re(626)]-this[Re(439)][Re(468)].t)};this[Re(439)][Re(455)][Re(500)](r),this[Re(439)][Re(468)]=r}else{const e={x:t[Re(522)][0][Re(423)],y:t[Re(522)][0][Re(540)],t:t[Re(626)],typ:Re(571),s:0,d:0};this[Re(439)][Re(468)]=e}},Re(405)),200),a=this[Re(494)](t=>{this[Re(439)][Re(468)]=null},Re(625));this[Re(545)][Re(464)][Re(618)](Re(586),t,{passive:!0}),this[Re(545)][Re(464)][Re(618)](Re(506),e,{passive:!0}),this[Re(545)][Re(464)][Re(618)](Re(394),n,{passive:!0}),this[Re(545)][Re(464)][Re(618)](Re(543),r,{passive:!0}),Re(487)in window&&(this[Re(545)][Re(464)][Re(618)](Re(488),i,{passive:!0}),this[Re(545)][Re(464)][Re(618)](Re(405),o,{passive:!0}),this[Re(545)][Re(464)][Re(618)](Re(625),a,{passive:!0})),this[Re(439)][Re(496)]={mousemove:t,click:e,keydown:n,scroll:r,touchstart:i,touchmove:o,touchend:a}}async[Re(400)](t=!1){this[Re(518)](t),await this[Re(566)]({includeCandidateSignals:!t}),this[Re(439)][Re(565)]=Date[Re(584)]()}[Re(518)](t=!1){const e=Date[Re(584)]();let n=Math[Re(391)]((e-this[Re(439)][Re(435)])/1e3);null!==this[Re(439)][Re(565)]&&(n=Math[Re(391)]((e-this[Re(439)][Re(565)])/1e3)),this[Re(439)][Re(590)]?(this[Re(439)][Re(590)][Re(619)]+=t?1:0,this[Re(439)][Re(590)][Re(509)]+=n):this[Re(439)][Re(590)]={pageCount:1,sessionStart:this[Re(439)][Re(435)],duration:0}}[Re(510)](t,e=!1){this[Re(594)][Re(606)](Re(451)+t,e)}[Re(627)](){try{if(this[Re(545)][Re(454)][Re(528)]){const e=this[Re(545)][Re(454)][Re(528)][Re(516)](Pe);if(e){const n=JSON[Re(611)](e);let r;return Re(568)in n?r=n:r={webdriver_detected:(t=n).wd,bot_user_agent:t.ua,canvas_fingerprint_normal:t.cf,browser_environment_normal:t.be,natural_mouse_activity:t.nm,natural_click_patterns:t.nc,keyboard_activity:t.ka,scroll_activity:t.sa,touch_activity:t.ta,significant_page_time:t.pt,multiple_pages_visited:t.mp,session_duration_reasonable:t.sd},r}}}catch(t){}var t;return null}[Re(465)](t){try{this[Re(545)][Re(454)][Re(528)]&&this[Re(545)][Re(454)][Re(528)][Re(531)](Pe,JSON[Re(591)](He(t)))}catch(t){}}[Re(402)](t){const e=t[Re(417)];if(!(e&&e instanceof Element&&e[Re(596)]))return 0;const n=e[Re(596)]();if(!n[Re(595)]||!n[Re(421)])return 0;const r=n[Re(474)]+n[Re(595)]/2,i=n[Re(453)]+n[Re(421)]/2,o=this[Re(513)]({x:t[Re(423)],y:t[Re(540)]},{x:r,y:i}),a=Math[Re(585)](n[Re(595)]**2+n[Re(421)]**2)/2;return a>0?Math[Re(447)](0,1-o/a):0}[Re(513)](t,e){return Math[Re(585)]((e.x-t.x)**2+(e.y-t.y)**2)}[Re(604)](t){if(t[Re(589)](Re(445))||t[Re(589)](Re(553)))return t;return""+(this[Re(545)][Re(454)][Re(467)][Re(582)]||this[Re(545)][Re(454)][Re(467)][Re(395)]+"//"+this[Re(545)][Re(454)][Re(467)][Re(412)])+t}[Re(456)](t){try{this[Re(469)]?.[Re(517)](t)}catch(t){this[Re(594)][Re(539)](t,Re(490))}}[Re(536)](t){if(void 0!==t)return this[Re(545)][Re(464)],this[Re(545)][Re(559)],this[Re(520)][Re(463)](this),void this[Re(424)][Re(463)](this)}[Re(520)](){this[Re(610)]||(this[Re(610)]=!0,this[Re(594)][Re(606)](Re(409),!0))}[Re(424)](t){this[Re(594)][Re(539)](t,Re(477))}[Re(471)](){try{return this[Re(620)]()??void 0}catch(t){return void this[Re(594)][Re(539)](t,Re(503))}}[Re(564)](t){const e=this[Re(439)][Re(538)]?.[Re(622)];return!!e&&(null!==this[Re(567)][Re(475)]&&(this[Re(592)](e,Re(612),{candidateSignals:t,updateSilenceClock:!1,allowRetry:!1,transport:Re(414),candidateQueueTracking:Re(527)})[Re(436)](t=>{this[Re(594)][Re(539)](t,Re(396))}),!0))}[Re(393)](t){return!(!this[Re(439)][Re(538)]||null===this[Re(567)][Re(475)])&&(this[Re(566)]({lifecycleCandidateSignals:t})[Re(436)](t=>{this[Re(594)][Re(539)](t,Re(501))}),!0)}async[Re(592)](t,e,n={}){if(!this[Re(439)][Re(538)])return;const r=n[Re(444)]??!0,i=n[Re(492)]??!0,o=n[Re(613)]??Re(399);if(null===this[Re(567)][Re(475)])return void(r&&(this[Re(439)][Re(538)][Re(577)]=Date[Re(584)]()));let a;!1!==n[Re(470)]&&(void 0===n[Re(549)]?a=this[Re(471)]():this[Re(469)]&&(a=n[Re(549)]));const s=this[Re(536)](a),c=void 0===a?void 0:(f=a,this[Re(594)],{pack:f}),u=c?.[Re(609)],l=function(t,e,n,r,i,o){const a=void 0!==r,s=a&&void 0!==i;let c=1;return s?c=3:a&&(c=2),{v:c,s:{wd:e.wd,ua:e.ua,cf:e.cf,be:e.be,nm:e.nm,nc:e.nc,ka:e.ka,sa:e.sa,ta:e.ta,pt:e.pt,mp:e.mp,sd:e.sd},r:n,...void 0!==r&&{c:r},...s&&{t:i.t,...void 0!==i.e&&{e:i.e},w:i.w,...void 0!==o&&{_0x178449:o}},l:pe}}(0,He(t),e,u,void 0===u?void 0:s,void 0===u?void 0:c?.[Re(600)]),d=JSON[Re(591)](l),h=this[Re(604)](this[Re(567)][Re(475)]);var f;void 0!==a&&o===Re(399)&&this[Re(469)]?.[Re(419)](a);const m=n[Re(563)]??Re(573);if(m!==Re(414)&&this[Re(545)][Re(416)][Re(592)]&&(m===Re(411)||!this[Re(567)][Re(514)]))try{const t=new Blob([d],{type:Re(498)});if(this[Re(545)][Re(416)][Re(592)](h,t))return i&&(this[Re(439)][Re(538)][Re(495)]=0),void(r&&(this[Re(439)][Re(538)][Re(577)]=Date[Re(584)]()))}catch(t){}try{const t=await fetch(h,{method:Re(407),headers:{"Content-Type":Re(498)},body:d,credentials:Re(507),keepalive:!0});if(!t.ok)throw new Error(Re(561)+t[Re(614)]);void 0!==a&&o===Re(527)&&this[Re(469)]?.[Re(419)](a),i&&(this[Re(439)][Re(538)][Re(495)]=0),r&&(this[Re(439)][Re(538)][Re(577)]=Date[Re(584)]())}catch(n){i?this[Re(558)](t,e,a):void 0!==a&&o===Re(399)&&this[Re(469)]?.[Re(489)](a)}}[Re(558)](t,e,n){if(!this[Re(439)][Re(538)]||this[Re(439)][Re(538)][Re(495)]>=this[Re(567)][Re(617)])return void(void 0!==n&&this[Re(469)]?.[Re(489)](n));const r=Math[Re(462)](1e3*2**this[Re(439)][Re(538)][Re(495)],3e4);this[Re(439)][Re(538)][Re(495)]++,this[Re(439)][Re(538)][Re(602)]=this[Re(545)][Re(454)][Re(524)](()=>{this[Re(439)][Re(538)]&&this[Re(592)](t,e)},r)}async[Re(566)](t={}){if(!this[Re(439)][Re(538)])return;const e=Ue(this[Re(439)][Re(574)],this[Re(439)][Re(597)],this[Re(439)][Re(525)],this[Re(439)][Re(401)],this[Re(439)][Re(449)],this[Re(439)][Re(607)],this[Re(439)][Re(486)],this[Re(439)][Re(533)],this[Re(439)][Re(544)],this[Re(439)][Re(485)],this[Re(439)][Re(455)],this[Re(439)][Re(435)],Date[Re(584)]()),n=function(t,e,n,r){const i={webdriver_detected:1===t?.wd||!1,bot_user_agent:0===t?.ua||!1,browser_environment_normal:1===t?.br||!1,canvas_fingerprint_normal:1===t?.cv||!1,natural_mouse_activity:!1,natural_click_patterns:!1,keyboard_activity:!1,scroll_activity:!1,touch_activity:!1,significant_page_time:!1,multiple_pages_visited:!1,session_duration_reasonable:!1};if(e.ma>0&&1===e.nm&&(i[Re(406)]=!0),e.ca>0&&1===e.vc&&(i[Re(437)]=!0),e.ka>0&&(i[Re(479)]=!0),e.sa>0&&(i[Re(452)]=!0),e.ta>0&&(i[Re(398)]=!0),e.t>30&&(i[Re(482)]=!0),n&&(n[Re(619)]>1&&(i[Re(446)]=!0),n[Re(509)]>60&&(i[Re(519)]=!0)),r){const t=Object[Re(603)](i);for(const e of t)i[e]=i[e]||r[e]}return i}(this[Re(439)][Re(404)],e,this[Re(439)][Re(590)],this[Re(439)][Re(538)][Re(622)]),r=function(t,e){if(!e)return!0;const n=Object[Re(603)](t);for(const r of n)if(t[r]!==e[r])return!0;return!1}(n,this[Re(439)][Re(538)][Re(622)]),i=Date[Re(584)]()-this[Re(439)][Re(538)][Re(577)],o=i>=this[Re(567)][Re(434)],a=void 0!==t[Re(575)];if(r||o||a){const e=Date[Re(584)]()-this[Re(439)][Re(538)][Re(572)];if(!a&&e<100)return void this[Re(510)](Re(443),!0);if(o&&!r&&this[Re(510)](Re(457)+Math[Re(458)](i/1e3)+Re(624),!0),r&&this[Re(567)][Re(491)]){if(this[Re(439)][Re(538)][Re(622)]){Object[Re(603)](n)[Re(512)](t=>{this[Re(439)][Re(538)][Re(622)][t],n[t]})}else this[Re(510)](Re(425));this[Re(439)][Re(590)]}if(this[Re(439)][Re(538)][Re(622)]=(s=n,{...s}),this[Re(439)][Re(538)][Re(572)]=Date[Re(584)](),this[Re(465)](n),this[Re(567)][Re(426)]&&r)try{this[Re(567)][Re(426)](He(n))}catch(t){this[Re(594)][Re(539)](t,Re(556))}let c=Re(552);r?c=Re(593):o&&(c=Re(505));const u=!r&&!o;await this[Re(592)](n,c,{candidateSignals:t[Re(575)],includeCandidateSignals:t[Re(470)],updateSilenceClock:!u,allowRetry:!u,transport:Re(u?411:573)})}else this[Re(567)][Re(491)];var s}}const Oe=(t,e)=>({libVersion:pe,shopId:e||"",hostname:t[Re(454)]?.[Re(467)]?.[Re(578)]||"",url:t[Re(454)]?.[Re(467)]?.[Re(481)]||"",referrer:t[Re(464)]?.[Re(580)]||"",baseURI:t[Re(464)]?.[Re(450)]||"",sessionToken:Jt()||"",uniqueToken:Zt()||""});function We(t,e){return e>=100||!(e<=0)&&function(t){try{const e=t[Re(454)][Re(528)]?.[Re(516)](Ne);if(null!==e&&/^\d{1,2}$/[Re(551)](e)){const t=Number(e);if(t<100)return t}}catch{}const e=Math[Re(391)](100*Math[Re(515)]());try{t[Re(454)][Re(528)]?.[Re(531)](Ne,String(e))}catch{}return e}(t){const r=Jt(),i=(t?.[Re(523)]??!1)&&We(e,t?.[Re(587)]??100);let o;r?o=function(t){let e=0;for(let n=0,r=t[De(484)];nd[Re(532)]()):d[Re(532)](),d};function Re(t,e){const n=ke();return Re=function(e,r){let i=n[e-=391];if(void 0===Re.aeaUbg){Re.fgDofN=function(t){let e="",n="";for(let n,r,i=0,o=0;r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?e+=String.fromCharCode(255&n>>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;tt.startTime-e.startTime)}getLongAnimationFrames(){if(!Ge()){const t=function(){const{getLongAnimationFrames:t}=window.ShopifyAnalytics?.performance||{};if(!t)return[];return t(!0)}();this.longAnimationFrames=[];for(const e of t)this.handleAnimationFrame(e.startTime,e.endTime)}return[...this.longAnimationFrames].sort((t,e)=>t.startTime-e.startTime)}destroy(){this.cleanup(),this.quietWindowStartCandidates=[],this.longAnimationFrames=[]}initializeLongAnimationFrameObserver(){if(Ge())try{this.longAnimationFrameObserver=new PerformanceObserver(t=>{const e=t.getEntries();for(const t of e)this.handleAnimationFrame(t.startTime,t.startTime+t.duration)}),this.longAnimationFrameObserver.observe({type:"long-animation-frame",buffered:!0})}catch(t){}}handleAnimationFrame(t,e){if(this.longAnimationFrames.push({startTime:t,endTime:e}),this.quietWindowStartCandidates.length>0){t-this.quietWindowStartCandidates[this.quietWindowStartCandidates.length-1].startTime<250&&this.quietWindowStartCandidates.pop()}this.quietWindowStartCandidates.push({startTime:e})}cleanup(){this.longAnimationFrameObserver&&(this.longAnimationFrameObserver.disconnect(),this.longAnimationFrameObserver=null)}}let Je=null;function Xe(){Je||(Je=new Ze)}function Ve(t,e=0){if(null===t||!Ge()&&!Boolean(window.ShopifyAnalytics?.performance?.getLongAnimationFrames))return Ye(),null;const n=(Je?Je.getLongAnimationFrames():[]).map(t=>({startTime:t.startTime-e,endTime:t.endTime-e}));let r=null;for(const e of n){if(e.startTime<=t&&e.endTime>t){r=e;break}if(e.startTime>=t){r=e;break}}if(!r||r.startTime-t>=250)return Ye(),t;const i=(Je?Je.getQuietWindowStartCandidates():[]).map(t=>({startTime:t.startTime-e}));let o=t;if(i.length>0)for(const e of i)if(e.startTime>=t){o=e.startTime;break}return Ye(),o}function Ge(){return PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")}function Ye(){Je&&(Je.destroy(),Je=null)}function $e(){return PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")}function Qe(t){return performance.getEntriesByType("long-animation-frame").filter(e=>e.startTime+e.duration>t)}let tn=null,en=!1;function nn(){tn=null,en=!1}const rn=Object.freeze({shop_domain:`${window.location.origin}/.well-known/shopify/monorail`,global:"https://monorail-edge.shopifysvc.com",canada:"https://monorail-edge-ca.shopifycloud.com",staging:"https://monorail-edge-staging.shopifycloud.com"}),on=new RegExp(`^${window.location.origin}/((?:(?:[a-z]{2,3}|zh-hans|zh-hant)(?:-[a-zA-Z0-9]+)/)?cart/(add|change|update|clear))`),an=new RegExp("cart-performance:|add:|change:|clear:|note_update:");var sn;function cn({monorailRegion:t,schema:e,rawData:n}){const r=Date.now(),i={schema_id:e,payload:e===sn.OnUnload?ln(n):dn(n),metadata:{event_created_at_ms:r,event_sent_at_ms:r}},o=rn[t||""],a=JSON.stringify(i);if(!o)return void console.debug("📡 Monorail: ",JSON.stringify(i,null,2));const s=e===sn.OnUnload;s&&en||function(t,e,n){const r=tn?.result.activated?null:tn,i=r?.interactions??[];return r?.controller.abort(),tn=un(t,e?i:[...i,n],e?n:r?.onUnload??null),null!==tn||(tn=r&&un(t,r.interactions,r.onUnload),!1)}(o,s,a)||s&&tn?.onUnload||(!function(t,e){try{const n=new window.Blob([e],{type:"text/plain"});if("function"==typeof window.navigator.sendBeacon&&"function"==typeof window.Blob&&!function(){const{userAgent:t}=window.navigator;return-1!==t.lastIndexOf("iPhone; CPU iPhone OS 12_")||-1!==t.lastIndexOf("iPad; CPU OS 12_")}()&&window.navigator.sendBeacon(t,n))return}catch(t){}const n=new XMLHttpRequest;n.open("POST",t),n.setRequestHeader("Content-type","text/plain"),n.send(e)}(`${o}/v1/produce`,a),s&&(en=!0))}function un(t,e,n){if("function"!=typeof window.fetchLater)return null;const r=null===n?e:[...e,n];try{const i=new AbortController;return{controller:i,result:window.fetchLater(`${t}/unstable/produce_batch`,{method:"POST",body:`{"events":[${r.join(",")}]}`,headers:{"Content-Type":"text/plain"},credentials:"include",signal:i.signal}),interactions:e,onUnload:n}}catch(t){return null}}function ln(t){const e=hn(t,["domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","activationStart","firstPaint","visuallyReady","initiatorType","redirectCount","cartAjaxResourceTimings","cartPerformanceMetrics","totalStylingDuration","totalStyleDuration","totalForcedStyleDuration","totalLayoutDuration","totalForcedLayoutDuration","speculations","originalMicroSessionId"]);return{perf_kit_init:t.perfKitInit,perf_kit_version:t.perfKitVersion,url:t.url,page_type:t.pageType,shop_id:t.shopId,application:t.application,storefront_id:t.storefrontId,theme_instance_id:t.themeInstanceId,theme_name:t.themeName,theme_version:t.themeVersion,session_token:t.sessionToken,unique_token:t.uniqueToken,micro_session_id:t.microSessionId,micro_session_count:t.microSessionCount,cumulative_layout_shift:t.cumulativeLayoutShift,cumulative_layout_shift_target:t.cumulativeLayoutShiftTarget,first_contentful_paint:t.firstContentfulPaint,largest_contentful_paint:t.largestContentfulPaint,largest_contentful_paint_target:t.largestContentfulPaintTarget,time_to_first_byte:t.timeToFirstByte,quiet_window_start:t.quietWindowStart,seo_bot:t.seoBot,humanness_score:t.humannessScore,ja3_fingerprint:t.ja3Fingerprint,navigation_start:t.navigationStart,navigation_type:t.navigationType,navigation_bad:t.navigationBad,encoded_body_size:t.encodedBodySize,decoded_body_size:t.decodedBodySize,transfer_size:t.transferSize,first_interim_response_start:t.firstInterimResponseStart,final_response_headers_start:t.finalResponseHeadersStart,response_start:t.responseStart,response_end:t.responseEnd,worker_start:t.workerStart,connect_start:t.connectStart,connect_end:t.connectEnd,domain_lookup_start:t.domainLookupStart,domain_lookup_end:t.domainLookupEnd,fetch_start:t.fetchStart,redirect_start:t.redirectStart,redirect_end:t.redirectEnd,request_start:t.requestStart,secure_connection_start:t.secureConnectionStart,next_hop_protocol:t.nextHopProtocol,server_timing:t.serverTiming,paint_timing_hidden:t.paintTimingHidden,referrer:t.referrer,render_region:t.renderRegion,resource_timing:t.resourceTiming,treatment_ids:t.treatmentIds,other_metrics:JSON.stringify(e)}}function dn(t){const e=hn(t,["longAnimationFrame"]);return{url:t.url,page_type:t.pageType,shop_id:t.shopId,application:t.application,storefront_id:t.storefrontId,theme_instance_id:t.themeInstanceId,session_token:t.sessionToken,unique_token:t.uniqueToken,micro_session_id:t.microSessionId,micro_session_count:t.microSessionCount,interaction_to_next_paint:t.interactionToNextPaint,interaction_to_next_paint_target:t.interactionToNextPaintTarget,seo_bot:t.seoBot,humanness_score:t.humannessScore,ja3_fingerprint:t.ja3Fingerprint,referrer:t.referrer,worker_start:t.workerStart,next_hop_protocol:t.nextHopProtocol,navigation_bad:t.navigationBad,treatment_ids:t.treatmentIds,other_interaction_metrics:JSON.stringify(e)}}function hn(t,e){return e.reduce((e,n)=>{var r;return null!=t[n]&&(e[(r=n,r.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`))]=t[n]),e},{})}function fn(t,e){return t?Math.max(0,Math.round(t-e)):0}!function(t){t.OnInteraction="perf_kit_on_interaction/3.2",t.OnUnload="perf_kit_on_unload/3.5"}(sn||(sn={}));function mn(t){if(void 0===t||""===t.trim())return;const e=Number(t);return Number.isFinite(e)?e:void 0}function pn(t){return!Number.isFinite(t)||t<=0?0:Math.min(100,Math.floor(t))}function gn(t){if(!t)return;const e=[];for(const n of t.split(",")){const t=Number(n);isNaN(t)||e.push(t)}return e.length>0?e:void 0}const vn="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function yn(){let t="";try{const e=window.crypto,n=new Uint16Array(31);e.getRandomValues(n);let r=0;t=vn.replace(/[x]/g,t=>{const e=n[r]%16;return r++,("x"===t?e:3&e|8).toString(16)}).toUpperCase()}catch(e){t=vn.replace(/[x]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}).toUpperCase()}return`${function(){let t=0,e=0;t=(new Date).getTime()>>>0;try{e=performance.now()>>>0}catch(t){e=0}return Math.abs(t+e).toString(16).toLowerCase().padStart(8,"0")}()}-${t}`}let wn=null,Sn=!1,Cn=null,bn=null,Ln=null;let xn=!1;class zn{info;config;sampled;onUnloadCounted;cachedQuietWindowStart;isBackForwardCacheRestore;lifecycleStart;originalMicroSessionId;constructor(t,e={}){this.config=t,this.isBackForwardCacheRestore=e.isBackForwardCacheRestore??!1,this.lifecycleStart=e.startTime??0,this.originalMicroSessionId=e.originalMicroSessionId;const n="storefront-renderer"===(r=t.storefrontData.application)||"hydrogen"===r;var r;this.info={perfKitInit:Date.now(),perfKitVersion:"3.10.1",url:window.location.href,referrer:document.referrer||void 0,microSessionId:yn(),microSessionCount:0,get sessionToken(){return Jt({generateFallback:n})},get uniqueToken(){return Zt({generateFallback:n})}},this.sampled=100*Math.random()<=(t.resourceTimingSamplingRate??10),this.onUnloadCounted=!1,this.cachedQuietWindowStart=void 0,performance.setResourceTimingBufferSize(1e3)}get performanceMetrics(){return this.isBackForwardCacheRestore?{}:function(t){const e=performance.getEntriesByType("navigation");if(0===e.length)return{};const n=e[0],r=n.activationStart||0,i=function(t,e){return!e&&(t.requestStart>0&&t.startTime>0&&t.requestStart0&&t.startTime>0&&t.responseStart0&&t.fetchStart>0&&t.responseStart0&&t.fetchStart0&&t.responseEnd>e+864e5}(n,t);return{encodedBodySize:n.encodedBodySize,decodedBodySize:n.decodedBodySize,navigationStart:Math.round(n.startTime),navigationType:n.type,navigationBad:i,firstInterimResponseStart:Math.round(n.firstInterimResponseStart),finalResponseHeadersStart:Math.round(n.finalResponseHeadersStart),responseStart:Math.round(n.responseStart),responseEnd:Math.round(n.responseEnd),workerStart:Math.round(n.workerStart),connectStart:Math.round(n.connectStart),connectEnd:Math.round(n.connectEnd),domainLookupStart:Math.round(n.domainLookupStart),domainLookupEnd:Math.round(n.domainLookupEnd),fetchStart:Math.round(n.fetchStart),redirectStart:Math.round(n.redirectStart),redirectEnd:Math.round(n.redirectEnd),requestStart:Math.round(n.requestStart),secureConnectionStart:Math.round(n.secureConnectionStart),nextHopProtocol:n.nextHopProtocol,serverTiming:JSON.stringify(n.serverTiming),domInteractive:fn(n.domInteractive,r),domComplete:fn(n.domComplete,r),domContentLoadedEventStart:fn(n.domContentLoadedEventStart,r),domContentLoadedEventEnd:fn(n.domContentLoadedEventEnd,r),activationStart:Math.round(r),redirectCount:n.redirectCount,initiatorType:n.initiatorType,transferSize:n.transferSize}}(this.info.perfKitInit)}get bfCacheMetadata(){if(!this.isBackForwardCacheRestore)return{};const t=performance.getEntriesByType("navigation");return{navigationType:"back_forward_cache",originalMicroSessionId:this.originalMicroSessionId,nextHopProtocol:t.length>0?t[0].nextHopProtocol:void 0}}}const Bn=new Set;function Mn(){if(null!==bn){if(!_n()&&Dn()&&Bn.size>0){let t={};for(const e of Bn)t={...t,...e};const e=t.firstContentfulPaint??null;if(null!==e&&void 0===bn.cachedQuietWindowStart){const t=performance.getEntriesByType("navigation")[0]?.activationStart||0,n=bn.isBackForwardCacheRestore?bn.lifecycleStart:t;bn.cachedQuietWindowStart=Ve(e,n)}void 0!==bn.cachedQuietWindowStart&&null!==bn.cachedQuietWindowStart&&(t.quietWindowStart=Math.round(bn.cachedQuietWindowStart));const n=function(t=0){if(!$e())return null;const e=Qe(t);let n=0;for(const t of e){n+=t.styleAndLayoutStart?t.startTime+t.duration-t.styleAndLayoutStart:0;for(const e of t.scripts)n+=e.forcedStyleAndLayoutDuration}return n}(bn.lifecycleStart);null!==n&&(t.totalStylingDuration=Math.round(n));const r=function(t=0){if(!$e())return null;const e=Qe(t);if(0===e.length)return null;if("number"!=typeof e[0].styleDuration)return null;let n=0,r=0,i=0,o=0;for(const t of e){const e=t;n+=e.styleDuration??0,i+=e.layoutDuration??0;for(const e of t.scripts){const t=e;r+=t.forcedStyleDuration??0,o+=t.forcedLayoutDuration??0}}return{totalStyleDuration:n,totalForcedStyleDuration:r,totalLayoutDuration:i,totalForcedLayoutDuration:o}}(bn.lifecycleStart);null!==r&&(t.totalStyleDuration=Math.round(r.totalStyleDuration),t.totalForcedStyleDuration=Math.round(r.totalForcedStyleDuration),t.totalLayoutDuration=Math.round(r.totalLayoutDuration),t.totalForcedLayoutDuration=Math.round(r.totalForcedLayoutDuration)),bn.onUnloadCounted||(bn.info.microSessionCount+=1,bn.onUnloadCounted=!0);const i=bn.isBackForwardCacheRestore?void 0:function(t){if(t)return performance.getEntriesByType("resource").map(t=>{const e=Object.entries(t.toJSON()).map(([t,e])=>"number"==typeof e?[t,Math.round(e)]:[t,e]);return JSON.stringify(Object.fromEntries(e))})}(bn.sampled),o=bn.isBackForwardCacheRestore?void 0:function(t){if("function"!=typeof performance.getSpeculations)return;const e=performance.getSpeculations().preloads??[];let n=0,r=0,i=0;const o=[];for(const a of e){const e=Boolean(a.earlyhint??a.earlyHints);e&&(i+=1),null==a.used?(r+=1,t&&o.push({url:a.url.slice(-20),as:a.as,crossorigin:a.crossorigin??null,early_hint:e})):n+=1}return{used_preloads:n,unused_preloads:r,unused_preload_details:o,early_hint_preloads:i}}(bn.sampled),a=function(t=0){return performance.getEntriesByType("resource").filter(e=>(e.startTime||0)>=t&&on.test(e.name))}(bn.lifecycleStart),s=function(t=0){return performance.getEntriesByType("measure").filter(e=>(e.startTime||0)>=t&&an.test(e.name)).map(t=>{const e=t.toJSON();return e.name.startsWith("cart-performance:")||(e.name=`cart-performance:${e.name}`),e})}(bn.lifecycleStart);cn({monorailRegion:bn.config.monorailRegion,schema:sn.OnUnload,rawData:{...bn.info,...bn.config.storefrontData,...bn.performanceMetrics,...bn.bfCacheMetadata,...t,resourceTiming:i,cartAjaxResourceTimings:a,cartPerformanceMetrics:s,paintTimingHidden:xn,speculations:o}})}}else console.debug("⛔️ Shopify/perf-kit is not initialized")}function Dn(){return null!==Ln?Ln:Xt()}addEventListener("pageshow",t=>{if(!t.persisted||null===wn||null===bn)return;Bn.clear(),nn(),Ye();const e=new zn(wn,{isBackForwardCacheRestore:!0,startTime:t.timeStamp,originalMicroSessionId:bn.originalMicroSessionId??bn.info.microSessionId});bn=e,Sn=!1,Cn=window.location.pathname,xn=!1,setTimeout(()=>{bn===e&&(xn="hidden"===document.visibilityState)}),Xe()},{capture:!0}),((e,r={})=>{const o=a(r=Object.assign({},r),t),s=new WeakMap;o.t=t=>{if(t?.sources?.length){const e=z(t.sources),n=e?.node;if(n){const t=r.generateTarget?.(n)??i(n);s.set(e,t)}}},((e,n={})=>{const r=S();L(p(()=>{let i,o=f("CLS",0);const s=a(n,t),c=t=>{for(const e of t)s.u(e);s.o>o.value&&(o.value=s.o,o.entries=s.i,i())},h=m("layout-shift",c);h&&(i=l(e,o,x,n.reportAllChanges),r.onHidden(()=>{c(h.takeRecords()),i(!0)}),u(()=>{s.o=0,o=f("CLS",0),i=l(e,o,x,n.reportAllChanges),d(()=>i())}),setTimeout(i))}))})(t=>{const r=(t=>{let e={};if(t.entries.length){const r=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(r?.sources?.length){const t=z(r.sources);t&&(e={largestShiftTarget:s.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:n(r.startTime)})}}return Object.assign(t,{attribution:e})})(t);e(r)},r)})(function(t){const{attribution:e,value:n}=t;Bn.add({cumulativeLayoutShift:n,cumulativeLayoutShiftTarget:e.largestShiftTarget})},{reportAllChanges:!0}),((t,n={})=>{const r=a(n=Object.assign({},n),q),o=new WeakMap;r.m=t=>{const e=t.element;if(e){const r=n.generateTarget?.(e)??i(e);o.set(t,r)}},((t,e={})=>{C(()=>{const n=S();let r,i=f("LCP");const o=a(e,q),s=t=>{e.reportAllChanges||(t=t.slice(-1));for(const e of t)o.u(e),e.startTime{s(c.takeRecords()),c.disconnect(),r(!0)}),o=t=>{t.isTrusted&&(I(n),removeEventListener(t.type,o,{capture:!0}))};for(const t of["keydown","click","visibilitychange"])addEventListener(t,o,{capture:!0});u(n=>{i=f("LCP"),r=l(t,i,U,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(n=>{const r=(t=>{let n={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){const r=e();if(r){const e=r.activationStart||0,i=t.entries.at(-1),a=i.url&&performance.getEntriesByType("resource").filter(t=>t.name===i.url)[0],s=Math.max(0,r.responseStart-e),c=Math.max(s,a?(a.requestStart||a.startTime)-e:0),u=Math.min(t.value,Math.max(c,a?a.responseEnd-e:0));n={target:o.get(i),timeToFirstByte:s,resourceLoadDelay:c-s,resourceLoadDuration:u-c,elementRenderDelay:t.value-u,navigationEntry:r,lcpEntry:i},i.url&&(n.url=i.url),a&&(n.lcpResourceEntry=a)}}return Object.assign(t,{attribution:n})})(n);t(r)},n)})(function(t){const{attribution:e,value:n}=t;Bn.add({largestContentfulPaint:Math.round(n),largestContentfulPaintTarget:e.target})},{reportAllChanges:!0}),((t,r={})=>{L(r=>{const i=(t=>{let r={timeToFirstByte:0,firstByteToFCP:t.value,loadState:n(c())};if(t.entries.length){const i=e(),o=t.entries.at(-1);if(i){const e=i.activationStart||0,a=Math.max(0,i.responseStart-e);r={timeToFirstByte:a,firstByteToFCP:t.value-a,loadState:n(t.entries[0].startTime),navigationEntry:i,fcpEntry:o}}}return Object.assign(t,{attribution:r})})(r);t(i)},r)})(function(t){const{value:e}=t;Bn.add({firstContentfulPaint:Math.round(e)})}),((t,e={})=>{const r=a(e=Object.assign({},e),N);let o=[],s=[],c=0;const d=new WeakMap,h=new WeakMap;let p=!1;const g=()=>{p||(I(v),p=!0)},v=()=>{const t=r.l.map(t=>d.get(t.entries[0])),e=s.length-50;s=s.filter((n,r)=>r>=e||t.includes(n));const n=new Set;for(const t of s){const e=y(t.startTime,t.processingEnd);for(const t of e)n.add(t)}const i=o.length-1-50;o=o.filter((t,e)=>t.startTime>c&&e>i||n.has(t)),p=!1};r.m=t=>{const e=t.startTime+t.duration;let n;c=Math.max(c,t.processingEnd);for(let r=s.length-1;r>=0;r--){const i=s[r];if(Math.abs(e-i.renderTime)<=8){n=i,n.startTime=Math.min(t.startTime,n.startTime),n.processingStart=Math.min(t.processingStart,n.processingStart),n.processingEnd=Math.max(t.processingEnd,n.processingEnd),n.entries.push(t);break}}n||(n={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:e,entries:[t]},s.push(n)),(t.interactionId||"first-input"===t.entryType)&&d.set(t,n),g()},r.p=t=>{if(!h.get(t)){const n=t.entries[0].target;if(n){const r=e.generateTarget?.(n)??i(n);h.set(t,r)}}};const y=(t,e)=>{const n=[];for(const r of o)if(!(r.startTime+r.duratione)break;n.push(r)}return n},w=t=>{const e=t.entries[0],i=d.get(e),o=e.processingStart,a=Math.max(e.startTime+e.duration,o),s=Math.min(i.processingEnd,a),c=i.entries.sort((t,e)=>t.processingStart-e.processingStart),u=y(e.startTime,s),l=r.h.get(e.interactionId),f={interactionTarget:h.get(l),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:a,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:o-e.startTime,processingDuration:s-o,presentationDelay:a-s,loadState:n(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{if(!t.longAnimationFrameEntries?.length)return;const e=t.interactionTime,n=t.inputDelay,r=t.processingDuration;let i,o,a=0,s=0,c=0,u=0;for(const c of t.longAnimationFrameEntries){s=s+c.startTime+c.duration-c.styleAndLayoutStart;for(const t of c.scripts){const c=t.startTime+t.duration;if(cu&&(o=t.startTime=e+n+r?"presentation-delay":"processing-duration",i=t,u=l)}}const l=t.longAnimationFrameEntries.at(-1),d=l?l.startTime+l.duration:0;d>=e+n+r&&(c=t.nextPaintTime-d),i&&o&&(t.longestScript={entry:i,subpart:o,intersectingDuration:u}),t.totalScriptDuration=a,t.totalStyleAndLayoutDuration=s,t.totalPaintDuration=c,t.totalUnattributedDuration=t.nextPaintTime-e-a-s-c})(f),Object.assign(t,{attribution:f})};m("long-animation-frame",t=>{o=o.concat(t),g()}),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=S();C(()=>{"interactionCount"in performance||_||(_=m("event",T,{type:"event",buffered:!0,durationThreshold:0}));let r,i=f("INP");const o=a(e,N),s=t=>{I(()=>{for(const e of t)o.u(e);const e=o.M();e&&e.T!==i.value&&(i.value=e.T,i.entries=e.entries,r())})},c=m("event",s,{durationThreshold:e.durationThreshold??40});r=l(t,i,k,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),r(!0)}),u(()=>{o.v(),i=f("INP"),r=l(t,i,k,e.reportAllChanges)}))})})(e=>{const n=w(e);t(n)},e)})(function(t){const{attribution:e,value:n}=t;if(null===bn)return void console.debug("⛔️ Shopify/perf-kit is not initialized");if(function(){const t=navigator.userAgent;if(!t.includes("Safari")||t.includes("Chrome"))return!1;const e=/Version\/(\d+)(?:\.(\d+))?/.exec(t);if(null===e)return!0;const n=Number(e[1]),r=Number(e[2]||0);return n<26||26===n&&r<4}())return;if(_n())return;if(!Dn())return;bn.info.microSessionCount+=1;const{inputDelay:r,processingDuration:i,presentationDelay:o,longestScript:a,interactionTarget:s}=e,c=a?.entry?{slowest_script:a.entry.sourceURL,slowest_script_duration:Math.round(a.entry.duration)}:{};cn({monorailRegion:bn.config.monorailRegion,schema:sn.OnInteraction,rawData:{...bn.info,...bn.config.storefrontData,...bn.performanceMetrics,...bn.bfCacheMetadata,interactionToNextPaint:Math.round(n),interactionToNextPaintTarget:s,longAnimationFrame:{input_delay:Math.round(r),processing_duration:Math.round(i),presentation_delay:Math.round(o),...c}}})},{reportAllChanges:!0}),((t,n={})=>{((t,n={})=>{let r=f("TTFB"),i=l(t,r,E,n.reportAllChanges);j(()=>{const o=e();o&&(r.value=Math.max(o.responseStart-h(),0),r.entries=[o],i(!0),u(()=>{r=f("TTFB",0),i=l(t,r,E,n.reportAllChanges),i(!0)}))})})(e=>{const n=(t=>{let e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){const n=t.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),o=Math.max(n.domainLookupStart-r,0),a=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);e={waitingDuration:i,cacheDuration:o-i,dnsDuration:a-o,connectionDuration:s-a,requestDuration:t.value-s,navigationEntry:n}}return Object.assign(t,{attribution:e})})(e);t(n)},n)})(function(t){if(bn?.isBackForwardCacheRestore)return;const{value:e}=t;Bn.add({timeToFirstByte:Math.round(e)})}),addEventListener("DOMContentLoaded",()=>{xn="hidden"===document.visibilityState}),addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&Mn()}),addEventListener("pagehide",()=>{Mn()});const Tn=/bot|crawl|headless|curl|wget|python|spider|libwww-pearl|newrelic|datadog|sitebulb|site24x7/i;function _n(){return!!Tn.test(navigator.userAgent)||!!(navigator.webdriver||document.__webdriver_evaluate||document.__selenium_evaluate||document.__webdriver_script_fn||document.__webdriver_script_func||document.__webdriver_script_function||document.$cdc_asdjflasutopfhvcZLmcfl_||document.$wdc_||window._Selenium_IDE_Recorder||window._phantom||window.__nightmare||window.callPhantom||window._phantom||window.__playwright__binding__||window.__pwInitScripts)}!function(){const{dataset:t}=document.currentScript;try{!function(t){if(wn=t,bn=new zn(t),Ln=null,Sn=!1,Cn=window.location.pathname,Bn.clear(),nn(),Xe(),t.spaMode&&void 0===window.PerfKit&&(window.PerfKit={navigate:()=>{if(!wn?.spaMode||!bn)return;const t=window.location.href,e=window.location.pathname;Cn!==e?(Cn=e,Sn?bn.info.url=t:(Mn(),bn=new zn(wn),Bn.clear(),nn(),Sn=!0)):bn.info.url=t},setPageType:t=>{wn?.spaMode&&(wn.storefrontData.pageType=t)},setConsent:t=>{Ln=t}},document.addEventListener("shopify:page:view",t=>{window.PerfKit.navigate(),t.page?.url&&bn&&(bn.info.url=t.page.url),t.page?.template&&window.PerfKit.setPageType(t.page.template)},!0)),t.shs&&!t.spaMode){const e=t.shsCandidateSampleRate??0;Fe({debug:!1,shopId:t.storefrontData.shopId,exportWithFetch:t.shsExportWithFetch||!0,logsSampleRate:t.shsLogsSampleRate,candidateSignalsEnabled:e>0,candidateSampleRate:e,...!1===t.shsCandidateActivePageFlush&&{candidateActivePageFlushEnabled:!1},...e>0&&void 0!==t.shsCandidateMask&&{candidateMask:t.shsCandidateMask},...t.shsBeaconEndpoint&&{beaconEndpoint:t.shsBeaconEndpoint}})}}(function(t){if(!t.application)throw new Error("Application is missing");if(!["storefront-renderer","hydrogen","shop-web"].includes(t.application.toLowerCase()))throw new Error("Invalid application type");if("shop-web"!==t.application.toLowerCase()){if(!t.shopId)throw new Error("shopId is missing");if(!t.themeInstanceId&&!t.storefrontId)throw new Error("Either `themeInstanceId` or `storefrontId` must be defined");for(const e of["shopId","themeInstanceId","storefrontId"])if(t[e]&&isNaN(Number(t[e])))throw new Error(`Invalid ${e}`)}if(t.humannessScore&&isNaN(Number(t.humannessScore)))throw new Error("Invalid humannessScore");if(t.monorailRegion&&!["shop_domain","global","staging","canada"].includes(t.monorailRegion.toLowerCase()))throw new Error("Invalid monorail region");if(t.resourceTimingSamplingRate&&(isNaN(Number(t.resourceTimingSamplingRate))||Number(t.resourceTimingSamplingRate)<10||Number(t.resourceTimingSamplingRate)>100))throw new Error("Invalid resource timing sampling rate");return{storefrontData:{application:t.application.toLowerCase(),shopId:Number(t.shopId)||0,renderRegion:t.renderRegion,pageType:t.pageType,seoBot:"true"===t.seoBot,humannessScore:Number(t.humannessScore)||void 0,ja3Fingerprint:t.ja3Fingerprint,themeInstanceId:Number(t.themeInstanceId)||void 0,storefrontId:Number(t.storefrontId)||void 0,themeName:t.themeName||void 0,themeVersion:t.themeVersion||void 0,treatmentIds:gn(t.treatmentIds)},monorailRegion:t.monorailRegion,resourceTimingSamplingRate:Number(t.resourceTimingSamplingRate)||void 0,spaMode:"true"===t.spaMode,shs:"true"===t.shs,shsBeaconEndpoint:t.shsBeaconEndpoint||void 0,shsExportWithFetch:"true"===t.shsExportWithFetch,shsLogsSampleRate:mn(t.shsLogsSampleRate),shsCandidateSampleRate:pn(Number(t.shsCandidateSampleRate)),shsCandidateMask:t.shsCandidateMask,shsCandidateActivePageFlush:void 0===t.shsCandidateActivePageFlush?void 0:"false"!==t.shsCandidateActivePageFlush}}(t))}catch(t){console.error("🚫 Error initializing PerfKit:",t.message)}}()}();
not sure where to start?
take 30 seconds to find your personalised meal plan.













