!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 s(t,e){return o.get(t)||o.set(t,new e),o.get(t)}let a=-1;const c=()=>a,u=t=>{addEventListener("pageshow",e=>{e.persisted&&(a=e.timeStamp,t(e))},!0)},h=(t,e,n,r)=>{let i,o;return s=>{e.value>=0&&(s||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)))}},l=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},d=()=>{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||d()>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))}},C=()=>{if(g<0){const t=d(),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)}}},b=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},S=[1800,3e3],L=(t,e={})=>{b(()=>{const n=C();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=h(t,i,S,e.reportAllChanges),l(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},B=[.1,.25],x=t=>t.find(t=>1===t.node?.nodeType)||t[0];let T=0,M=1/0,D=0;const z=t=>{for(const e of t)e.interactionId&&(M=Math.min(M,e.interactionId),D=Math.max(D,e.interactionId),T=D?(D-M)/7+1:0)};let _;const A=()=>_?T:performance.interactionCount??0;let I=0;class P{l=[];h=new Map;m;p;v(){I=A(),this.l.length=0,this.h.clear()}M(){const t=Math.min(this.l.length-1,Math.floor((A()-I)/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 E=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})}))},N=[200,500];class q{m;u(t){this.m?.(t)}}const k=[2500,4e3],j=[800,1800],U=t=>{document.prerendering?b(()=>U(t)):"complete"!==document.readyState?addEventListener("load",()=>U(t),!0):setTimeout(t)},H="",O="1",K="0",Z="p",W="a",R="m",F="t",V="m",X="a",J="p",Y="s";function G(t){try{return decodeURIComponent(t)}catch(t){return""}}function $(t,e=!1){const n=function(){try{return document.cookie}catch{return!1}}()?document.cookie.split("; "):[];for(let e=0;et);if(r)try{sessionStorage.setItem("consentHeader",r)}catch{}return r}let nt;function rt(){var t,e;const n=null===(t=performance)||void 0===t||null===(e=t.getEntriesByType)||void 0===e?void 0:e.call(t,"resource");let r=nt;for(let t=n.length-1;t>=0;t--){let e=it(n[t]);if(e){r=e;break}}return nt=r,r}function it(t){var e,n;if(t)return null===(e=t.serverTiming)||void 0===e||null===(n=e.find(t=>"_cmp"==t.name))||void 0===n?void 0:n.description}const ot=window;function st(){const t=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?G(n):void 0}()||new URLSearchParams(window.location.search).get("_cs")||void 0||$("_tracking_consent")||Q();if(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,s]=e;let a,c;try{a=e[5]?JSON.parse(e.slice(5).join("_")):void 0}catch{}if(s){const t=s.replace(/\*/g,"/").replace(/-/g,"+"),e=Array.from(atob(t)).map(t=>t.charCodeAt(0).toString(16).padStart(2,"0")).join("");c=[8,13,18,23].reduce((t,e)=>t.slice(0,e)+"-"+t.slice(e),e)}function u(t){const e=n.split(".")[0];return e.includes(t.toLowerCase())?K:e.includes(t.toUpperCase())?O:H}function h(t){return n.includes(t.replace("t","s").toUpperCase())}return{v:"3",con:{CMP:{[X]:u(X),[J]:u(J),[V]:u(V),[Y]:u(Y)}},region:r||"",cus:a,purposes:{[W]:h(W),[Z]:h(Z),[R]:h(R),[F]:h(F)},sale_of_data_region:"t"==o,display_banner:"t"==i,consent_id:c}}(t);return}(t)}function at(){return function(t){const e=st();if(!e||!e.purposes)return!0;const n=e.purposes[t];return"boolean"!=typeof n||n}(W)}function ct(t,e){let n,r;try{var i,o,s,a;n=null===(i=performance)||void 0===i||null===(o=i.getEntriesByType("navigation")[0])||void 0===o||null===(s=o.serverTiming)||void 0===s||null===(a=s.find(t=>t.name==e))||void 0===a?void 0:a.description}catch{n=void 0}try{var c,u,h,l;r=null===(c=document.cookie)||void 0===c||null===(u=c.split(";"))||void 0===u||null===(h=u.find(e=>e.includes(t)))||void 0===h||null===(l=h.split("=")[1])||void 0===l?void 0:l.trim()}catch{r=void 0}return n||r}function ut(){return ct("_shopify_y","_y")}function ht(){return ct("_shopify_s","_s")}function lt(){return at()}function dt(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var ft=0;function mt(t){return"__private_"+ft+++"_"+t}function pt(t){return Object.entries(t).map(([t,e])=>({key:t,value:{stringValue:String(e)}}))}function gt(t){if(Array.isArray(t))return{arrayValue:{values:t.map(t=>gt(t))}};switch(typeof t){case"boolean":return{boolValue:Boolean(t)};case"number":return{doubleValue:Number(t)};default:return{stringValue:String(t)}}}const vt=function(t,e,n){const r=[0];for(let i=0;i{t.attributes={...dt(this,wt)[wt],...t.attributes}});const t=dt(this,Ct)[Ct];dt(this,Ct)[Ct]=[],await this.exportByKeepalive(t,(t,e)=>dt(this,yt)[yt].exportMetrics(this.aggregateMetrics(t),e))}async exportLogs(){const t=dt(this,bt)[bt];dt(this,bt)[bt]=[],await this.exportByKeepalive(t,(t,e)=>dt(this,yt)[yt].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:s,attributes:a}=e,c=null!==(n=e.bounds)&&void 0!==n?n:vt,u=new Array(c.length+1).fill(0);t[r]||={name:r,unit:o||"1",histogram:{aggregationTemporality:1,dataPoints:[]}};for(let t=0;t0?l:0,bucketCounts:r>0?[1]:[]};t[n].exponentialHistogram.dataPoints.push({attributes:pt(null!=s?s:{}),startTimeUnixNano:o,timeUnixNano:o,count:1,sum:c,scale:u,zeroCount:d,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:s}=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:pt(null!=s?s:{})})}(e,t);break;case"gauge":!function(t,e){const{name:n,value:r,unit:i,timeUnixNano:o,attributes:s}=e;t[n]||={name:n,unit:i||"1",gauge:{dataPoints:[]}},t[n].gauge.dataPoints.push({startTimeUnixNano:o,timeUnixNano:o,asDouble:r,attributes:pt(null!=s?s:{})})}(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={...dt(this,wt)[wt],...t.attributes},Object.entries(n).map(([t,e])=>({key:t,value:gt(e)})))};var n;return t.body&&(e.body={stringValue:t.body}),e})}}var Lt=mt("url"),Bt=mt("serviceName"),xt=mt("logger"),Tt=mt("fetchFn"),Mt=mt("maxPayloadSizeBytes");class Dt{constructor(t,e,n){var r;Object.defineProperty(this,Lt,{writable:!0,value:void 0}),Object.defineProperty(this,Bt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Tt,{writable:!0,value:void 0}),Object.defineProperty(this,Mt,{writable:!0,value:void 0}),dt(this,Lt)[Lt]=t.replace(/\/v1\/(logs|metrics|traces)\/?$/,""),dt(this,Bt)[Bt]=e,dt(this,xt)[xt]=null==n?void 0:n.logger,dt(this,Tt)[Tt]=null==n?void 0:n.fetchFn,dt(this,Mt)[Mt]=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:dt(this,Bt)[Bt]}}]},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:dt(this,Bt)[Bt]}}]},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>dt(this,Mt)[Mt])throw new _t(`Payload size ${o} exceeds ${dt(this,Mt)[Mt]} bytes`);const s=await this.exporterFetch()(`${dt(this,Lt)[Lt]}${e}`,{method:"POST",keepalive:n,headers:{"Content-Type":"application/json"},body:i});if(null===(r=dt(this,xt)[xt])||void 0===r||r.log({status:s.status}),!s.ok){if(400===s.status){const t=await s.text();throw new zt(`Invalid OpenTelemetry Data: ${t}`)}if(429===s.status||503===s.status){const e=await s.text(),n=s.headers.get("Retry-After"),r=n?{seconds:Number(n)}:void 0;throw new zt("Server did not accept data",{errorData:e,retryAfter:r,body:t})}if(401===s.status||403===s.status){const e=await s.text();throw new At(`Authentication failed: ${s.status} ${401===s.status?"Unauthorized":"Forbidden"}`,{errorData:e,body:t})}throw new zt(`Server responded with ${s.status}`)}}exporterFetch(){return dt(this,Tt)[Tt]||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 _t&&i>1))throw t;i=Math.ceil(i/2)}}}class zt extends Error{constructor(t,e){super(t),this.metadata=void 0,this.name="OpenTelemetryClientError",this.metadata=e}}class _t extends Error{constructor(...t){super(...t),this.name="PayloadTooLargeError"}}class At extends Error{constructor(t,e){super(t),this.name="AuthenticationFailedError",this.metadata=void 0,this.name="AuthenticationFailedError",this.metadata=e}}function It(t,e){var n=Pt();return It=function(e,r){var i=n[e-=127];if(void 0===It.hUeNgk){It.niKrzX=function(t){for(var e,n,r="",i="",o=0,s=0;n=t.charAt(s++);~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 a=0,c=r.length;a>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;t=this[Nt(295)]))try{await this[Nt(304)][Nt(299)]()}catch(t){this[Nt(297)]&&console[Nt(309)](Nt(283)+t)}}[Nt(305)](){this[Nt(286)]&&clearTimeout(this[Nt(286)]),this[Nt(286)]=window[Nt(302)](()=>{this[Nt(287)]()[Nt(298)](()=>{})},this[Nt(307)])}}function kt(t,e){const n=jt();return kt=function(e,r){let i=n[e-=259];if(void 0===kt.vUHZLB){kt.wmZhnR=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[Jt(413)],n=t[Jt(467)]((t,n)=>t+(n.s-e)**2,0)/(t[Jt(413)]-1),r=Math[Jt(438)](n);return{speed:e,jitter:r}}function Ft(t,e,n,r,i,o,s,a,c,u,h,l,d){const f=Math[Jt(417)](1e3,t),m=Math[Jt(417)](1e3,n),p=Math[Jt(417)](1e3,o),g=Math[Jt(417)](1e3,a),v=Math[Jt(417)](1e3,s),y=Math[Jt(417)](1e3,c),w=[];if(e[Jt(413)]>=3)for(let t=1;t5e-4){e=!0;break}n=r.s}else n=r.s;return e}(w),b=function(t){if(t[Jt(413)]<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:S,jitter:L}=Rt(w);let B=0,x=0;if(r[Jt(413)]>1){const t=new Set(r[Jt(424)](t=>Math[Jt(346)](t.x/20)+","+Math[Jt(346)](t.y/20)))[Jt(315)];B=t>1?1:0,x=r[Jt(467)]((t,e)=>t+e[Jt(337)],0)/r[Jt(413)]}const T=i[Jt(467)]((t,e)=>(null===e[Jt(371)]||t[Jt(505)](e[Jt(371)]),t),[]),{rhythmConsistency:M,jitter:D}=function(t){if(t[Jt(413)]<2)return{rhythmConsistency:0,jitter:0};const e=t[Jt(467)]((t,e)=>t+e,0)/t[Jt(413)],n=t[Jt(467)]((t,n)=>(t??0)+((n??0)-e)**2,0)/t[Jt(413)],r=Math[Jt(438)](n);return{rhythmConsistency:0===r?1:Math[Jt(444)](0,1-r/e),jitter:r/e}}(T),z=T[Jt(413)]>0?T[Jt(467)]((t,e)=>t+e,0)/T[Jt(413)]:0,_=[];if(u[Jt(413)]>=3)for(let t=1;tu[t-1].p?Jt(360):"up";_[Jt(505)]({s:r,dir:i,t:u[t].t})}const{speed:A,jitter:I}=Rt(_),P=function(t){if(t[Jt(413)]<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:N,jitter:q}=Rt(h),k=function(t){if(t[Jt(413)]<2)return 0;let e=0;for(let n=1;n=500&&e++;return e}(h)),U=Math[Jt(346)]((d-l)/1e3);return{ma:f,ca:m,ka:p,sa:g,ta:y,kba:v,t:Math[Jt(417)](3600,U),nm:C?1:0,ms:Xt(b),mj:Xt(L),msp:Xt(S),vc:B,cp:Xt(x),rc:Xt(M),kj:Xt(D),ki:Xt(z),ss:Xt(A),sj:Xt(I),ssm:Xt(P),sp:E,ts:Xt(N),tj:Xt(q),tp:j,tsm:Xt(k)}}function Vt(t,e){let n=0;return(...r)=>{const i=typeof performance!==Jt(307)?performance[Jt(328)]():Date[Jt(328)]();i-n>=e&&(n=i,t(...r))}}function Xt(t){return Math[Jt(481)](100*t)/100}function Jt(t,e){const n=Wt();return Jt=function(e,r){let i=n[e-=299];if(void 0===Jt.lHkKxU){Jt.KeXrop=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{await this[Jt(357)](),await this[Jt(412)](!0),this[Jt(409)][Jt(419)][Jt(305)](()=>{this[Jt(314)]()},100);const t=()=>{const e=Date[Jt(328)](),n=e-(this[Jt(310)][Jt(493)]||e),r=Math[Jt(444)](0,this[Jt(394)][Jt(304)]-n),i=()=>{this[Jt(409)][Jt(419)][Jt(343)]?this[Jt(310)][Jt(446)]=this[Jt(409)][Jt(419)][Jt(343)](()=>{this[Jt(412)]()[Jt(463)](()=>this[Jt(321)][Jt(509)]())[Jt(463)](()=>{t()})},{timeout:2e3}):this[Jt(412)]()[Jt(463)](()=>this[Jt(321)][Jt(509)]())[Jt(463)](()=>{t()})};r>0?this[Jt(409)][Jt(419)][Jt(305)](i,r):i()};t()})()[Jt(495)](t=>{this[Jt(321)][Jt(299)](t,Jt(490))})}[Jt(352)](){this[Jt(310)][Jt(335)]&&this[Jt(409)][Jt(419)][Jt(393)](this[Jt(310)][Jt(335)]),this[Jt(310)][Jt(446)]&&this[Jt(409)][Jt(419)][Jt(488)]&&this[Jt(409)][Jt(419)][Jt(488)](this[Jt(310)][Jt(446)]),this[Jt(310)][Jt(399)]&&(this[Jt(409)][Jt(308)][Jt(418)](Jt(408),this[Jt(310)][Jt(399)][Jt(408)]),this[Jt(409)][Jt(308)][Jt(418)](Jt(423),this[Jt(310)][Jt(399)][Jt(423)]),this[Jt(409)][Jt(308)][Jt(418)](Jt(311),this[Jt(310)][Jt(399)][Jt(311)]),this[Jt(409)][Jt(308)][Jt(418)](Jt(475),this[Jt(310)][Jt(399)][Jt(475)]),Jt(320)in window&&this[Jt(310)][Jt(399)][Jt(453)]&&this[Jt(310)][Jt(399)][Jt(381)]&&this[Jt(310)][Jt(399)][Jt(387)]&&(this[Jt(409)][Jt(308)][Jt(418)](Jt(453),this[Jt(310)][Jt(399)][Jt(453)]),this[Jt(409)][Jt(308)][Jt(418)](Jt(381),this[Jt(310)][Jt(399)][Jt(381)]),this[Jt(409)][Jt(308)][Jt(418)](Jt(387),this[Jt(310)][Jt(399)][Jt(387)]))),this[Jt(310)][Jt(375)]?.[Jt(306)]&&this[Jt(409)][Jt(419)][Jt(393)](this[Jt(310)][Jt(375)][Jt(306)]),this[Jt(310)][Jt(375)]=void 0}[Jt(303)](){return this[Jt(310)][Jt(375)]?.[Jt(372)]?Yt(this[Jt(310)][Jt(375)][Jt(372)]):null}[Jt(357)](){const t={wd:this[Jt(409)][Jt(441)][Jt(462)]?1:0,ua:/bot|crawler|spider|scraper/i[Jt(506)](this[Jt(409)][Jt(441)][Jt(502)])?0:1,cv:this[Jt(330)]()?1:0,br:this[Jt(313)]()?1:0};return this[Jt(310)][Jt(396)]=t,this[Jt(310)][Jt(386)]=!0,t}[Jt(330)](){try{const t=this[Jt(409)][Jt(308)][Jt(492)](Jt(368));t[Jt(474)]=200,t[Jt(426)]=50;const e=t[Jt(503)]("2d");if(null===e)return!1;const n=e[Jt(430)](0,0,200,0);n[Jt(362)](0,Jt(403)),n[Jt(362)](1,Jt(384)),e[Jt(322)]=n,e[Jt(486)](0,0,200,50),e[Jt(322)]=Jt(468),e[Jt(482)]=Jt(338),e[Jt(445)](Jt(333),33,30);const r=t[Jt(451)]();return Boolean(r&&r[Jt(413)]>50)}catch(t){return!1}}[Jt(313)](){let t=0;this[Jt(409)][Jt(441)][Jt(332)]&&this[Jt(409)][Jt(441)][Jt(332)][Jt(413)]>0&&t++,(this[Jt(409)][Jt(441)][Jt(319)]&&this[Jt(409)][Jt(441)][Jt(319)][Jt(413)]>0||this[Jt(409)][Jt(441)][Jt(502)][Jt(376)](Jt(456)))&&t++,this[Jt(329)]()&&t++,typeof this[Jt(409)][Jt(419)][Jt(416)]!==Jt(307)&&t++;try{const e=(new Date)[Jt(405)]();e>-840&&e<840&&t++}catch(t){}return t>=3}[Jt(329)](){const t=this[Jt(409)][Jt(419)][Jt(316)]||this[Jt(409)][Jt(308)][Jt(457)][Jt(353)],e=this[Jt(409)][Jt(419)][Jt(487)]||this[Jt(409)][Jt(308)][Jt(457)][Jt(348)];if(!t||!e)return!1;if(t<=2||e<=2)return!1;const n=t/e;return n>=.2&&n<=5}[Jt(466)](t,e){return n=>{try{t(n)}catch(t){this[Jt(321)][Jt(299)](t,Jt(504)+e)}}}[Jt(314)](){const t=Vt(this[Jt(466)](t=>{this[Jt(310)][Jt(378)]++,this[Jt(310)][Jt(317)][Jt(413)]>=10&&this[Jt(310)][Jt(317)][Jt(349)](),this[Jt(310)][Jt(317)][Jt(505)]({x:t[Jt(390)],y:t[Jt(406)],t:t[Jt(300)]})},Jt(408)),100),e=this[Jt(466)](t=>{this[Jt(310)][Jt(497)]++,requestAnimationFrame(()=>setTimeout(()=>{this[Jt(310)][Jt(351)][Jt(413)]>=5&&this[Jt(310)][Jt(351)][Jt(349)](),this[Jt(310)][Jt(351)][Jt(505)]({x:t[Jt(390)],y:t[Jt(406)],t:t[Jt(300)],pre:this[Jt(425)](t)})},0))},Jt(423)),n=this[Jt(466)](t=>{this[Jt(310)][Jt(433)]++;const e=t[Jt(344)];if([Jt(421),Jt(397),Jt(401),Jt(422)][Jt(376)](e))return;const n=this[Jt(310)][Jt(454)][this[Jt(310)][Jt(454)][Jt(413)]-1],r=t[Jt(300)],i=n?r-n.t:null;this[Jt(310)][Jt(454)][Jt(413)]>=10&&this[Jt(310)][Jt(454)][Jt(349)](),this[Jt(310)][Jt(454)][Jt(505)]({_0x1e8c57:e,t:r,int:i}),null!==i&&i<100?(this[Jt(310)][Jt(395)][Jt(505)](i),this[Jt(310)][Jt(395)][Jt(413)]>=5&&(this[Jt(310)][Jt(427)]++,this[Jt(310)][Jt(395)]=[])):this[Jt(310)][Jt(395)]=[]},Jt(311)),r=Vt(this[Jt(466)](t=>{this[Jt(310)][Jt(431)]++;const e=t[Jt(300)],n=window[Jt(428)];this[Jt(310)][Jt(507)][Jt(413)]>=10&&this[Jt(310)][Jt(507)][Jt(349)](),this[Jt(310)][Jt(507)][Jt(505)]({p:n,t:e})},Jt(475)),200),i=this[Jt(466)](t=>{t[Jt(400)]&&0!==t[Jt(400)][Jt(413)]&&(this[Jt(310)][Jt(407)]++,this[Jt(310)][Jt(336)][Jt(413)]>=10&&this[Jt(310)][Jt(336)][Jt(349)](),this[Jt(310)][Jt(334)]={x:t[Jt(400)][0][Jt(390)],y:t[Jt(400)][0][Jt(406)],t:t[Jt(300)],typ:Jt(437),s:0,d:0})},Jt(453)),o=Vt(this[Jt(466)](t=>{if(!t[Jt(400)]||0===t[Jt(400)][Jt(413)])return;const e={x:t[Jt(400)][0][Jt(390)],y:t[Jt(400)][0][Jt(406)]};if(this[Jt(310)][Jt(334)]){const n=this[Jt(404)](this[Jt(310)][Jt(334)],e);this[Jt(310)][Jt(336)][Jt(413)]>=10&&this[Jt(310)][Jt(336)][Jt(349)]();const r={x:t[Jt(400)][0][Jt(390)],y:t[Jt(400)][0][Jt(406)],t:t[Jt(300)],typ:Jt(359),d:n,s:n/(t[Jt(300)]-this[Jt(310)][Jt(334)].t)};this[Jt(310)][Jt(336)][Jt(505)](r),this[Jt(310)][Jt(334)]=r}else{const e={x:t[Jt(400)][0][Jt(390)],y:t[Jt(400)][0][Jt(406)],t:t[Jt(300)],typ:Jt(359),s:0,d:0};this[Jt(310)][Jt(334)]=e}},Jt(381)),200),s=this[Jt(466)](t=>{this[Jt(310)][Jt(334)]=null},Jt(387));this[Jt(409)][Jt(308)][Jt(415)](Jt(408),t,{passive:!0}),this[Jt(409)][Jt(308)][Jt(415)](Jt(423),e,{passive:!0}),this[Jt(409)][Jt(308)][Jt(415)](Jt(311),n,{passive:!0}),this[Jt(409)][Jt(308)][Jt(415)](Jt(475),r,{passive:!0}),Jt(320)in window&&(this[Jt(409)][Jt(308)][Jt(415)](Jt(453),i,{passive:!0}),this[Jt(409)][Jt(308)][Jt(415)](Jt(381),o,{passive:!0}),this[Jt(409)][Jt(308)][Jt(415)](Jt(387),s,{passive:!0})),this[Jt(310)][Jt(399)]={mousemove:t,click:e,keydown:n,scroll:r,touchstart:i,touchmove:o,touchend:s}}async[Jt(412)](t=!1){this[Jt(366)](t),await this[Jt(455)](),this[Jt(310)][Jt(493)]=Date[Jt(328)]()}[Jt(366)](t=!1){const e=Date[Jt(328)]();let n=Math[Jt(346)]((e-this[Jt(310)][Jt(439)])/1e3);null!==this[Jt(310)][Jt(493)]&&(n=Math[Jt(346)]((e-this[Jt(310)][Jt(493)])/1e3)),this[Jt(310)][Jt(452)]?(this[Jt(310)][Jt(452)][Jt(420)]+=t?1:0,this[Jt(310)][Jt(452)][Jt(312)]+=n):this[Jt(310)][Jt(452)]={pageCount:1,sessionStart:this[Jt(310)][Jt(439)],duration:0}}[Jt(325)](t,e=!1){this[Jt(321)][Jt(500)](Jt(465)+t,e)}[Jt(436)](){try{if(this[Jt(409)][Jt(419)][Jt(379)]){const e=this[Jt(409)][Jt(419)][Jt(379)][Jt(402)](Kt);if(e){const n=JSON[Jt(398)](e);let r;return Jt(470)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}[Jt(459)](t){try{this[Jt(409)][Jt(419)][Jt(379)]&&this[Jt(409)][Jt(419)][Jt(379)][Jt(461)](Kt,JSON[Jt(388)](Yt(t)))}catch(t){}}[Jt(425)](t){const e=t[Jt(442)];if(!(e&&e instanceof Element&&e[Jt(464)]))return 0;const n=e[Jt(464)]();if(!n[Jt(474)]||!n[Jt(426)])return 0;const r=n[Jt(476)]+n[Jt(474)]/2,i=n[Jt(501)]+n[Jt(426)]/2,o=this[Jt(404)]({x:t[Jt(390)],y:t[Jt(406)]},{x:r,y:i}),s=Math[Jt(438)](n[Jt(474)]**2+n[Jt(426)]**2)/2;return s>0?Math[Jt(444)](0,1-o/s):0}[Jt(404)](t,e){return Math[Jt(438)]((e.x-t.x)**2+(e.y-t.y)**2)}[Jt(494)](t){if(t[Jt(339)](Jt(327))||t[Jt(339)](Jt(458)))return t;return""+(this[Jt(409)][Jt(419)][Jt(323)][Jt(447)]||this[Jt(409)][Jt(419)][Jt(323)][Jt(491)]+"//"+this[Jt(409)][Jt(419)][Jt(323)][Jt(382)])+t}async[Jt(365)](t,e){if(!this[Jt(310)][Jt(375)])return;if(null===this[Jt(394)][Jt(374)])return void(this[Jt(310)][Jt(375)][Jt(324)]=Date[Jt(328)]());const n=function(t,e,n){return{v:t,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}}(1,Yt(t),e),r=JSON[Jt(388)](n),i=this[Jt(494)](this[Jt(394)][Jt(374)]);if(this[Jt(409)][Jt(441)][Jt(365)]&&!this[Jt(394)][Jt(361)])try{const t=new Blob([r],{type:Jt(383)});if(this[Jt(409)][Jt(441)][Jt(365)](i,t))return this[Jt(310)][Jt(375)][Jt(472)]=0,void(this[Jt(310)][Jt(375)][Jt(324)]=Date[Jt(328)]())}catch(t){}try{const t=await fetch(i,{method:Jt(354),headers:{"Content-Type":Jt(383)},body:r,credentials:Jt(318),keepalive:!0});if(!t.ok)throw new Error(Jt(392)+t[Jt(411)]);this[Jt(310)][Jt(375)][Jt(472)]=0,this[Jt(310)][Jt(375)][Jt(324)]=Date[Jt(328)]()}catch(n){this[Jt(460)](t,e)}}[Jt(460)](t,e){if(!this[Jt(310)][Jt(375)]||this[Jt(310)][Jt(375)][Jt(472)]>=this[Jt(394)][Jt(358)])return;const n=Math[Jt(417)](1e3*2**this[Jt(310)][Jt(375)][Jt(472)],3e4);this[Jt(310)][Jt(375)][Jt(472)]++,this[Jt(310)][Jt(375)][Jt(306)]=this[Jt(409)][Jt(419)][Jt(305)](()=>{this[Jt(310)][Jt(375)]&&this[Jt(365)](t,e)},n)}async[Jt(455)](){if(!this[Jt(310)][Jt(375)])return;const t=Ft(this[Jt(310)][Jt(378)],this[Jt(310)][Jt(317)],this[Jt(310)][Jt(497)],this[Jt(310)][Jt(351)],this[Jt(310)][Jt(454)],this[Jt(310)][Jt(433)],this[Jt(310)][Jt(427)],this[Jt(310)][Jt(431)],this[Jt(310)][Jt(407)],this[Jt(310)][Jt(507)],this[Jt(310)][Jt(336)],this[Jt(310)][Jt(439)],Date[Jt(328)]()),e=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[Jt(331)]=!0),e.ca>0&&1===e.vc&&(i[Jt(309)]=!0),e.ka>0&&(i[Jt(450)]=!0),e.sa>0&&(i[Jt(440)]=!0),e.ta>0&&(i[Jt(448)]=!0),e.t>30&&(i[Jt(496)]=!0),n&&(n[Jt(420)]>1&&(i[Jt(477)]=!0),n[Jt(312)]>60&&(i[Jt(326)]=!0)),r){const t=Object[Jt(389)](i);for(const e of t)i[e]=i[e]||r[e]}return i}(this[Jt(310)][Jt(396)],t,this[Jt(310)][Jt(452)],this[Jt(310)][Jt(375)][Jt(372)]),n=function(t,e){if(!e)return!0;const n=Object[Jt(389)](t);for(const r of n)if(t[r]!==e[r])return!0;return!1}(e,this[Jt(310)][Jt(375)][Jt(372)]),r=Date[Jt(328)]()-this[Jt(310)][Jt(375)][Jt(324)],i=r>=this[Jt(394)][Jt(342)];if(n||i){if(Date[Jt(328)]()-this[Jt(310)][Jt(375)][Jt(347)]<100)return void this[Jt(325)](Jt(443),!0);if(i&&!n&&this[Jt(325)](Jt(483)+Math[Jt(481)](r/1e3)+Jt(370),!0),n&&this[Jt(394)][Jt(356)]){if(this[Jt(310)][Jt(375)][Jt(372)]){Object[Jt(389)](e)[Jt(345)](t=>{this[Jt(310)][Jt(375)][Jt(372)][t],e[t]})}else this[Jt(325)](Jt(380));this[Jt(310)][Jt(452)]}if(this[Jt(310)][Jt(375)][Jt(372)]=(o=e,{...o}),this[Jt(310)][Jt(375)][Jt(347)]=Date[Jt(328)](),this[Jt(459)](e),this[Jt(394)][Jt(429)]&&n)try{this[Jt(394)][Jt(429)](Yt(e))}catch(t){this[Jt(321)][Jt(299)](t,Jt(449))}const t=Jt(n?350:435);await this[Jt(365)](e,t)}else this[Jt(394)][Jt(356)];var o}}const $t=(t,e)=>({libVersion:"2.3.0",shopId:e||"",hostname:t[Jt(419)]?.[Jt(323)]?.[Jt(478)]||"",url:t[Jt(419)]?.[Jt(323)]?.[Jt(341)]||"",referrer:t[Jt(308)]?.[Jt(355)]||"",baseURI:t[Jt(308)]?.[Jt(385)]||"",sessionToken:ht()||"",uniqueToken:ut()||""}),Qt=(t,e=Zt(),n=new Dt(Ut,Ht))=>{const r=new St({exporter:n,attributes:$t(e,t?.[Jt(340)])}),i=ht(),o=i?function(t){let e=0;for(let n=0,r=t[kt(261)];na[Jt(490)]()):a[Jt(490)](),a};class te{quietWindowStartCandidates=[];longAnimationFrameObserver=null;longAnimationFrames=[];constructor(){this.initializeLongAnimationFrameObserver()}getQuietWindowStartCandidates(){return[...this.quietWindowStartCandidates].sort((t,e)=>t.startTime-e.startTime)}getLongAnimationFrames(){if(!re()){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(re())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 ee=null;function ne(t){if(null===t||!re()&&!Boolean(window.ShopifyAnalytics?.performance?.getLongAnimationFrames))return ie(),null;const e=ee?ee.getLongAnimationFrames():[];let n=null;for(const r of e){if(r.startTime<=t&&r.endTime>t){n=r;break}if(r.startTime>=t){n=r;break}}if(!n||n.startTime-t>=250)return ie(),t;const r=ee?ee.getQuietWindowStartCandidates():[];let i=t;if(r.length>0)for(const e of r)if(e.startTime>=t){i=e.startTime;break}return ie(),i}function re(){return PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")}function ie(){ee&&(ee.destroy(),ee=null)}function oe(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 se=Object.freeze({shop_domain:`${window.location.origin}/.well-known/shopify/monorail/v1/produce`,global:"https://monorail-edge.shopifysvc.com/v1/produce",canada:"https://monorail-edge-ca.shopifycloud.com/v1/produce",staging:"https://monorail-edge-staging.shopifycloud.com/v1/produce"}),ae=new RegExp(`^${window.location.origin}/((?:(?:[a-z]{2,3}|zh-hans|zh-hant)(?:-[a-zA-Z0-9]+)/)?cart/(add|change|update|clear))`),ce=new RegExp("cart-performance:|add:|change:|clear:|note_update:");var ue;function he({monorailRegion:t,schema:e,rawData:n}){const r=Date.now(),i={schema_id:e,payload:e===ue.OnUnload?le(n):de(n),metadata:{event_created_at_ms:r,event_sent_at_ms:r}},o=se[t||""],s=JSON.stringify(i);if(!o)return void console.debug("📡 Monorail: ",JSON.stringify(i,null,2));try{const t=new window.Blob([s],{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(o,t))return}catch(t){}const a=new XMLHttpRequest;a.open("POST",o),a.setRequestHeader("Content-type","text/plain"),a.send(s)}function le(t){const e=fe(t,["domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","firstPaint","visuallyReady","initiatorType","redirectCount","cartAjaxResourceTimings","cartPerformanceMetrics","totalStylingDuration"]);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 de(t){const e=fe(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 fe(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(t){t.OnInteraction="perf_kit_on_interaction/3.2",t.OnUnload="perf_kit_on_unload/3.5"}(ue||(ue={}));const me="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function pe(){let t="";try{const e=window.crypto,n=new Uint16Array(31);e.getRandomValues(n);let r=0;t=me.replace(/[x]/g,t=>{const e=n[r]%16;return r++,("x"===t?e:3&e|8).toString(16)}).toUpperCase()}catch(e){t=me.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 ge=!0,ve=!1,ye=null,we=null,Ce=!1;class be{info;config;constructor(t){this.config=t,this.info={perfKitInit:Date.now(),perfKitVersion:"3.2.0",url:window.location.href,referrer:document.referrer||void 0,microSessionId:pe(),microSessionCount:0,sessionToken:ht(),uniqueToken:ut()},performance.setResourceTimingBufferSize(1e3)}get performanceMetrics(){return function(t){const e=performance.getEntriesByType("navigation");if(0===e.length)return{};const n=e[0];let r=!1;return(n.requestStart&&n.startTime&&n.requestStartt+864e5)&&(r=!0),{encodedBodySize:n.encodedBodySize,decodedBodySize:n.decodedBodySize,navigationStart:Math.round(n.startTime),navigationType:n.type,navigationBad:r,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:Math.round(n.domInteractive),domComplete:Math.round(n.domComplete),domContentLoadedEventStart:Math.round(n.domContentLoadedEventStart),domContentLoadedEventEnd:Math.round(n.domContentLoadedEventEnd),redirectCount:n.redirectCount,initiatorType:n.initiatorType,transferSize:n.transferSize}}(this.info.perfKitInit)}}function Se(t){ye=new be(t),ee||(ee=new te),t.spaMode&&(window.PerfKit={navigate:()=>{ge?ge=!1:ve||(Be(),ye=new be(t),ve=!0)},setPageType:e=>{t.storefrontData.pageType=e},setConsent:t=>{we=t}}),t.shs&&!t.spaMode&&Qt({debug:!1,shopId:t.storefrontData.shopId,exportWithFetch:t.shsExportWithFetch||!0,logsSampleRate:t.shsLogsSampleRate,...t.shsBeaconEndpoint&&{beaconEndpoint:t.shsBeaconEndpoint}})}const Le=new Set;function Be(){if(null!==ye){if(xe()&&Le.size>0){let t={};for(const e of Le)t={...t,...e};const e=t.firstContentfulPaint??null,n=ne(e);null!==e&&null!==n&&(t.quietWindowStart=Math.round(n));const r=function(){if(!PerformanceObserver.supportedEntryTypes.includes("long-animation-frame"))return null;const t=performance.getEntriesByType("long-animation-frame");let e=0;for(const n of t){e+=n.styleAndLayoutStart?n.startTime+n.duration-n.styleAndLayoutStart:0;for(const t of n.scripts)e+=t.forcedStyleAndLayoutDuration}return e}();null!==r&&(t.totalStylingDuration=Math.round(r)),Le.clear(),ye.info.microSessionCount+=1;const i=function(t){if(!(100*Math.random()>(t||10)))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))})}(ye.config.resourceTimingSamplingRate),o=performance.getEntriesByType("resource").filter(t=>ae.test(t.name)),s=performance.getEntriesByType("measure").filter(t=>ce.test(t.name)).map(t=>{const e=t.toJSON();return e.name.startsWith("cart-performance:")||(e.name=`cart-performance:${e.name}`),e});he({monorailRegion:ye.config.monorailRegion,schema:ue.OnUnload,rawData:{...ye.info,...ye.config.storefrontData,...ye.performanceMetrics,...t,resourceTiming:i,cartAjaxResourceTimings:o,cartPerformanceMetrics:s,paintTimingHidden:Ce}})}}else console.debug("⛔️ Shopify/perf-kit is not initialized")}function xe(){return null!==we?we:lt()}((e,r={})=>{const o=s(r=Object.assign({},r),t),a=new WeakMap;o.t=t=>{if(t?.sources?.length){const e=x(t.sources),n=e?.node;if(n){const t=r.generateTarget?.(n)??i(n);a.set(e,t)}}},((e,n={})=>{const r=C();L(p(()=>{let i,o=f("CLS",0);const a=s(n,t),c=t=>{for(const e of t)a.u(e);a.o>o.value&&(o.value=a.o,o.entries=a.i,i())},d=m("layout-shift",c);d&&(i=h(e,o,B,n.reportAllChanges),r.onHidden(()=>{c(d.takeRecords()),i(!0)}),u(()=>{a.o=0,o=f("CLS",0),i=h(e,o,B,n.reportAllChanges),l(()=>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=x(r.sources);t&&(e={largestShiftTarget:a.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;Le.add({cumulativeLayoutShift:n,cumulativeLayoutShiftTarget:e.largestShiftTarget})}),((t,n={})=>{const r=s(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={})=>{b(()=>{const n=C();let r,i=f("LCP");const o=s(e,q),a=t=>{e.reportAllChanges||(t=t.slice(-1));for(const e of t)o.u(e),e.startTime{a(c.takeRecords()),c.disconnect(),r(!0)}),o=t=>{t.isTrusted&&(E(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=h(t,i,k,e.reportAllChanges),l(()=>{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),s=i.url&&performance.getEntriesByType("resource").filter(t=>t.name===i.url)[0],a=Math.max(0,r.responseStart-e),c=Math.max(a,s?(s.requestStart||s.startTime)-e:0),u=Math.min(t.value,Math.max(c,s?s.responseEnd-e:0));n={target:o.get(i),timeToFirstByte:a,resourceLoadDelay:c-a,resourceLoadDuration:u-c,elementRenderDelay:t.value-u,navigationEntry:r,lcpEntry:i},i.url&&(n.url=i.url),s&&(n.lcpResourceEntry=s)}}return Object.assign(t,{attribution:n})})(n);t(r)},n)})(function(t){const{attribution:e,value:n}=t;Le.add({largestContentfulPaint:Math.round(n),largestContentfulPaintTarget:e.target})}),((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,s=Math.max(0,i.responseStart-e);r={timeToFirstByte:s,firstByteToFCP:t.value-s,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;Le.add({firstContentfulPaint:Math.round(e)})}),((t,e={})=>{const r=s(e=Object.assign({},e),P);let o=[],a=[],c=0;const l=new WeakMap,d=new WeakMap;let p=!1;const g=()=>{p||(E(v),p=!0)},v=()=>{const t=r.l.map(t=>l.get(t.entries[0])),e=a.length-50;a=a.filter((n,r)=>r>=e||t.includes(n));const n=new Set;for(const t of a){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=a.length-1;r>=0;r--){const i=a[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]},a.push(n)),(t.interactionId||"first-input"===t.entryType)&&l.set(t,n),g()},r.p=t=>{if(!d.get(t)){const n=t.entries[0].target;if(n){const r=e.generateTarget?.(n)??i(n);d.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=l.get(e),o=e.processingStart,s=Math.max(e.startTime+e.duration,o),a=Math.min(i.processingEnd,s),c=i.entries.sort((t,e)=>t.processingStart-e.processingStart),u=y(e.startTime,a),h=r.h.get(e.interactionId),f={interactionTarget:d.get(h),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:o-e.startTime,processingDuration:a-o,presentationDelay:s-a,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,s=0,a=0,c=0,u=0;for(const c of t.longAnimationFrameEntries){a=a+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=h)}}const h=t.longAnimationFrameEntries.at(-1),l=h?h.startTime+h.duration:0;l>=e+n+r&&(c=t.nextPaintTime-l),i&&o&&(t.longestScript={entry:i,subpart:o,intersectingDuration:u}),t.totalScriptDuration=s,t.totalStyleAndLayoutDuration=a,t.totalPaintDuration=c,t.totalUnattributedDuration=t.nextPaintTime-e-s-a-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=C();b(()=>{"interactionCount"in performance||_||(_=m("event",z,{type:"event",buffered:!0,durationThreshold:0}));let r,i=f("INP");const o=s(e,P),a=t=>{E(()=>{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",a,{durationThreshold:e.durationThreshold??40});r=h(t,i,N,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(c.takeRecords()),r(!0)}),u(()=>{o.v(),i=f("INP"),r=h(t,i,N,e.reportAllChanges)}))})})(e=>{const n=w(e);t(n)},e)})(function(t){const{attribution:e,value:n}=t;if(null===ye)return void console.debug("⛔️ Shopify/perf-kit is not initialized");if(navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome"))return;if(!xe())return;ye.info.microSessionCount+=1;const{inputDelay:r,processingDuration:i,presentationDelay:o,longestScript:s,interactionTarget:a}=e,c=s?.entry?{slowest_script:s.entry.sourceURL,slowest_script_duration:Math.round(s.entry.duration)}:{};he({monorailRegion:ye.config.monorailRegion,schema:ue.OnInteraction,rawData:{...ye.info,...ye.config.storefrontData,...ye.performanceMetrics,interactionToNextPaint:Math.round(n),interactionToNextPaintTarget:a,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=h(t,r,j,n.reportAllChanges);U(()=>{const o=e();o&&(r.value=Math.max(o.responseStart-d(),0),r.entries=[o],i(!0),u(()=>{r=f("TTFB",0),i=h(t,r,j,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),s=Math.max(n.connectStart-r,0),a=Math.max(n.connectEnd-r,0);e={waitingDuration:i,cacheDuration:o-i,dnsDuration:s-o,connectionDuration:a-s,requestDuration:t.value-a,navigationEntry:n}}return Object.assign(t,{attribution:e})})(e);t(n)},n)})(function(t){const{value:e}=t;Le.add({timeToFirstByte:Math.round(e)})}),addEventListener("DOMContentLoaded",()=>{Ce="hidden"===document.visibilityState}),addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&Be()}),function(){const{dataset:t}=document.currentScript;try{Se(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:oe(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:Number(t.shsLogsSampleRate)||1}}(t))}catch(t){console.error("🚫 Error initializing PerfKit:",t.message)}}()}();

search