!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},m=(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}},f=(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()},T=[1800,3e3],S=(t,e={})=>{b(()=>{const n=C();let r,i=m("FCP");const o=f("paint",t=>{for(const e of t)"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime{i=m("FCP"),r=h(t,i,T,e.reportAllChanges),l(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},x=[.1,.25],L=t=>t.find(t=>1===t.node?.nodeType)||t[0];let M=0,D=1/0,_=0;const B=t=>{for(const e of t)e.interactionId&&(D=Math.min(D,e.interactionId),_=Math.max(_,e.interactionId),M=_?(_-D)/7+1:0)};let z;const A=()=>z?M:performance.interactionCount??0;let E=0;class P{l=[];h=new Map;m;p;v(){E=A(),this.l.length=0,this.h.clear()}M(){const t=Math.min(this.l.length-1,Math.floor((A()-E)/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})}))},N=[200,500];class k{m;u(t){this.m?.(t)}}const q=[2500,4e3],j=[800,1800],H=t=>{document.prerendering?b(()=>H(t)):"complete"!==document.readyState?addEventListener("load",()=>H(t),!0):setTimeout(t)},U="",O="1",F="0",Z="p",R="a",W="m",J="t",V="m",K="a",X="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;e"_cmp"===t.name);let r=null==n?void 0:n.description;if(!r)return;try{r=decodeURIComponent(r)}catch{}return r}catch{return}}();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())?F:e.includes(t.toUpperCase())?O:U}function h(t){return n.includes(t.replace("t","s").toUpperCase())}return{v:"3",con:{CMP:{[K]:u(K),[X]:u(X),[V]:u(V),[Y]:u(Y)}},region:r||"",cus:a,purposes:{[R]:h(R),[Z]:h(Z),[W]:h(W),[J]:h(J)},sale_of_data_region:"t"==o,display_banner:"t"==i,consent_id:c}}(t);return}(t)}function tt(){return function(t){const e=Q();if(!e||!e.purposes)return!0;const n=e.purposes[t];return"boolean"!=typeof n||n}(R)}function et(){return tt()}function nt(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var rt=0;function it(t){return"__private_"+rt+++"_"+t}function ot(t){return Object.entries(t).map(([t,e])=>({key:t,value:{stringValue:String(e)}}))}function st(t){if(Array.isArray(t))return{arrayValue:{values:t.map(t=>st(t))}};switch(typeof t){case"boolean":return{boolValue:Boolean(t)};case"number":return{doubleValue:Number(t)};default:return{stringValue:String(t)}}}const at=function(t,e,n){const r=[0];for(let i=0;i{switch(e.attributes={...nt(this,ut)[ut],...e.attributes},e.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:at,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:ot(null!=s?s:{}),startTimeUnixNano:o,timeUnixNano:o,count:1,sum:c,scale:u,zeroCount:d,positive:f,negative:m,min:c,max:c,zeroThreshold:0})}(t,e);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:ot(null!=s?s:{})})}(t,e);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:ot(null!=s?s:{})})}(t,e)}});const e=Object.values(t);0!==e.length&&(nt(this,ht)[ht]=[],await nt(this,ct)[ct].exportMetrics(e))}async exportLogs(){const t=nt(this,lt)[lt].map(t=>{const e={timeUnixNano:t.timeUnixNano,observedTimeUnixNano:t.timeUnixNano,attributes:(n={...nt(this,ut)[ut],...t.attributes},Object.entries(n).map(([t,e])=>({key:t,value:st(e)})))};var n;return t.body&&(e.body={stringValue:t.body}),e});0!==t.length&&(nt(this,lt)[lt]=[],await nt(this,ct)[ct].exportLogs(t))}}var mt=it("url"),ft=it("serviceName"),pt=it("logger"),gt=it("fetchFn");class vt{constructor(t,e,n){Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),nt(this,mt)[mt]=t.replace(/\/v1\/(logs|metrics|traces)\/?$/,""),nt(this,ft)[ft]=e,nt(this,pt)[pt]=null==n?void 0:n.logger,nt(this,gt)[gt]=null==n?void 0:n.fetchFn}async exportMetrics(t){await this.exportBatches("/v1/metrics",[...t],t=>({resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:nt(this,ft)[ft]}}]},scopeMetrics:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},metrics:t}]}]}))}async exportLogs(t){await this.exportBatches("/v1/logs",[...t],t=>({resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:nt(this,ft)[ft]}}]},scopeLogs:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},logRecords:t}]}]}))}async exportTo(t,e){var n;const r=JSON.stringify(t),i=(new TextEncoder).encode(r).length;if(i>65536)throw new wt(`Payload size ${i} exceeds 65536 bytes`);const o=await this.exporterFetch()(`${nt(this,mt)[mt]}${e}`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:r});if(null===(n=nt(this,pt)[pt])||void 0===n||n.log({status:o.status}),!o.ok){if(400===o.status){const t=await o.text();throw new yt(`Invalid OpenTelemetry Data: ${t}`)}if(429===o.status||503===o.status){const e=await o.text(),n=o.headers.get("Retry-After"),r=n?{seconds:Number(n)}:void 0;throw new yt("Server did not accept data",{errorData:e,retryAfter:r,body:t})}throw new yt(`Server responded with ${o.status}`)}}exporterFetch(){return nt(this,gt)[gt]||fetch}async exportBatches(t,e,n){let r=e.length;for(;e.length>0;)try{const i=e.slice(0,r);await this.exportTo(n(i),t),e.splice(0,r)}catch(t){if(!(t instanceof wt&&r>1))throw t;r=Math.ceil(r/2)}}}class yt extends Error{constructor(t,e){super(t),this.metadata=void 0,this.name="OpenTelemetryClientError",this.metadata=e}}class wt extends Error{constructor(...t){super(...t),this.name="PayloadTooLargeError"}}function Ct(){var t=["mJiZoti3ohfkCLfyDG","mJm5v1b0Agnc","mta1mtiWnvvAsLfqra","oti1nK50EvPwAa","otK3ndu2ofLQAuLgCG","mty2nZG5mdHZqxfNuhu","n1ftDhPLua","mta1mJGYngDACMDlAa","nZaZodG1ognHuvf1rG"];return(Ct=function(){return t})()}function bt(t,e){var n=Ct();return bt=function(e,r){var i=n[e-=370];if(void 0===bt.ucMRJN){bt.hxdXAC=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=this.sampleRate))try{await this.otelClient.exportLogs()}catch(t){this.stdout&&console.log(`[SHS] Otel export logs failure: ${t}`)}}scheduleErrorFlush(){this.errorFlushTimeoutId&&clearTimeout(this.errorFlushTimeoutId),this.errorFlushTimeoutId=window.setTimeout(()=>{this.flushOtelLogs().catch(()=>{})},this.errorFlushDelay)}}!function(t){const e=t();for(;;)try{if(118797===parseInt(_t(380))/1*(-parseInt(_t(392))/2)+-parseInt(_t(290))/3+parseInt(_t(268))/4*(parseInt(_t(405))/5)+-parseInt(_t(442))/6*(parseInt(_t(454))/7)+parseInt(_t(417))/8+-parseInt(_t(359))/9+parseInt(_t(374))/10*(parseInt(_t(336))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(Bt);const St=_t(450),xt=_t(276),Lt=_t(447),Mt=_t(451);function Dt(){return{document:document,navigator:typeof navigator!==_t(307)?{get webdriver(){return navigator[_t(419)]},get userAgent(){return navigator[_t(475)]},get languages(){return navigator[_t(411)]},get plugins(){return navigator[_t(429)]},sendBeacon:navigator[_t(337)]?.[_t(303)](navigator)}:{webdriver:void 0,userAgent:"",languages:[],plugins:[],sendBeacon:void 0},window:window,screen:screen,performance:typeof performance!==_t(307)?performance:void 0}}function _t(t,e){const n=Bt();return _t=function(e,r){let i=n[e-=268];if(void 0===_t.IZWTxY){_t.xJDpdT=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[_t(404)],n=t[_t(312)]((t,n)=>t+(n.s-e)**2,0)/(t[_t(404)]-1),r=Math[_t(282)](n);return{speed:e,jitter:r}}function At(t,e,n,r,i,o,s,a,c,u,h,l,d){const m=Math[_t(352)](1e3,t),f=Math[_t(352)](1e3,n),p=Math[_t(352)](1e3,o),g=Math[_t(352)](1e3,a),v=Math[_t(352)](1e3,s),y=Math[_t(352)](1e3,c),w=[];if(e[_t(404)]>=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[_t(404)]<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:T,jitter:S}=zt(w);let x=0,L=0;if(r[_t(404)]>1){const t=new Set(r[_t(407)](t=>Math[_t(270)](t.x/20)+","+Math[_t(270)](t.y/20)))[_t(347)];x=t>1?1:0,L=r[_t(312)]((t,e)=>t+e[_t(448)],0)/r[_t(404)]}const M=i[_t(312)]((t,e)=>(null===e[_t(298)]||t[_t(364)](e[_t(298)]),t),[]),{rhythmConsistency:D,jitter:_}=function(t){if(t[_t(404)]<2)return{rhythmConsistency:0,jitter:0};const e=t[_t(312)]((t,e)=>t+e,0)/t[_t(404)],n=t[_t(312)]((t,n)=>(t??0)+((n??0)-e)**2,0)/t[_t(404)],r=Math[_t(282)](n);return{rhythmConsistency:0===r?1:Math[_t(406)](0,1-r/e),jitter:r/e}}(M),B=M[_t(404)]>0?M[_t(312)]((t,e)=>t+e,0)/M[_t(404)]:0,z=[];if(u[_t(404)]>=3)for(let t=1;tu[t-1].p?_t(453):"up";z[_t(364)]({s:r,dir:i,t:u[t].t})}const{speed:A,jitter:E}=zt(z),P=function(t){if(t[_t(404)]<2)return 0;let e=0;for(let n=1;n=500&&t[r].t-n>=500&&(e++,n=t[r].t);return e}(z)),{speed:N,jitter:k}=zt(h),q=function(t){if(t[_t(404)]<2)return 0;let e=0;for(let n=1;n=500&&e++;return e}(h)),H=Math[_t(270)]((d-l)/1e3);return{ma:m,ca:f,ka:p,sa:g,ta:y,kba:v,t:Math[_t(352)](3600,H),nm:C?1:0,ms:Pt(b),mj:Pt(S),msp:Pt(T),vc:x,cp:Pt(L),rc:Pt(D),kj:Pt(_),ki:Pt(B),ss:Pt(A),sj:Pt(E),ssm:Pt(P),sp:I,ts:Pt(N),tj:Pt(k),tp:j,tsm:Pt(q)}}function Et(t,e){let n=0;return(...r)=>{const i=typeof performance!==_t(307)?performance[_t(441)]():Date[_t(441)]();i-n>=e&&(n=i,t(...r))}}function Pt(t){return Math[_t(346)](100*t)/100}function It(t){return{wd:t[_t(283)],ua:t[_t(349)],cf:t[_t(396)],be:t[_t(368)],nm:t[_t(296)],nc:t[_t(286)],ka:t[_t(319)],sa:t[_t(413)],ta:t[_t(311)],pt:t[_t(402)],mp:t[_t(428)],sd:t[_t(292)]}}class Nt{[_t(354)];[_t(366)];[_t(314)];[_t(446)];constructor(t,e,n=Dt()){const r={shopId:0,updateInterval:5e3,debug:!1,beaconEndpoint:Lt,beaconRetryLimit:3,maxSilenceMs:18e5,exportWithFetch:!1,logsSampleRate:1};this[_t(354)]={...r,...e},this[_t(314)]=n,this[_t(446)]=t,this[_t(366)]={startTime:Date[_t(441)](),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[_t(317)]();this[_t(366)][_t(455)]={lastSignals:i,lastProcessTime:0,lastSuccessfulSendTime:0,retryCount:0}}[_t(323)](){(async()=>{await this[_t(351)](),await this[_t(304)](!0),this[_t(314)][_t(456)][_t(466)](()=>{this[_t(370)]()},100);const t=()=>{const e=Date[_t(441)](),n=e-(this[_t(366)][_t(332)]||e),r=Math[_t(406)](0,this[_t(354)][_t(343)]-n),i=()=>{this[_t(314)][_t(456)][_t(318)]?this[_t(366)][_t(328)]=this[_t(314)][_t(456)][_t(318)](()=>{this[_t(304)]()[_t(383)](()=>this[_t(446)][_t(272)]())[_t(383)](()=>{t()})},{timeout:2e3}):this[_t(304)]()[_t(383)](()=>this[_t(446)][_t(272)]())[_t(383)](()=>{t()})};r>0?this[_t(314)][_t(456)][_t(466)](i,r):i()};t()})()[_t(277)](t=>{this[_t(446)][_t(305)](t,_t(323))})}[_t(408)](){this[_t(366)][_t(394)]&&this[_t(314)][_t(456)][_t(464)](this[_t(366)][_t(394)]),this[_t(366)][_t(328)]&&this[_t(314)][_t(456)][_t(427)]&&this[_t(314)][_t(456)][_t(427)](this[_t(366)][_t(328)]),this[_t(366)][_t(316)]&&(this[_t(314)][_t(449)][_t(284)](_t(385),this[_t(366)][_t(316)][_t(385)]),this[_t(314)][_t(449)][_t(284)](_t(287),this[_t(366)][_t(316)][_t(287)]),this[_t(314)][_t(449)][_t(284)](_t(412),this[_t(366)][_t(316)][_t(412)]),this[_t(314)][_t(449)][_t(284)](_t(271),this[_t(366)][_t(316)][_t(271)]),_t(382)in window&&this[_t(366)][_t(316)][_t(299)]&&this[_t(366)][_t(316)][_t(295)]&&this[_t(366)][_t(316)][_t(444)]&&(this[_t(314)][_t(449)][_t(284)](_t(299),this[_t(366)][_t(316)][_t(299)]),this[_t(314)][_t(449)][_t(284)](_t(295),this[_t(366)][_t(316)][_t(295)]),this[_t(314)][_t(449)][_t(284)](_t(444),this[_t(366)][_t(316)][_t(444)]))),this[_t(366)][_t(455)]?.[_t(434)]&&this[_t(314)][_t(456)][_t(464)](this[_t(366)][_t(455)][_t(434)]),this[_t(366)][_t(455)]=void 0}[_t(351)](){const t={wd:this[_t(314)][_t(302)][_t(419)]?1:0,ua:/bot|crawler|spider|scraper/i[_t(401)](this[_t(314)][_t(302)][_t(475)])?0:1,cv:this[_t(289)]()?1:0,br:this[_t(329)]()?1:0};return this[_t(366)][_t(469)]=t,this[_t(366)][_t(333)]=!0,t}[_t(289)](){try{const t=this[_t(314)][_t(449)][_t(470)](_t(269));t[_t(322)]=200,t[_t(474)]=50;const e=t[_t(400)]("2d");if(null===e)return!1;const n=e[_t(357)](0,0,200,0);n[_t(285)](0,_t(340)),n[_t(285)](1,_t(288)),e[_t(360)]=n,e[_t(422)](0,0,200,50),e[_t(360)]=_t(373),e[_t(356)]=_t(397),e[_t(425)](_t(281),33,30);const r=t[_t(387)]();return Boolean(r&&r[_t(404)]>50)}catch(t){return!1}}[_t(329)](){let t=0;this[_t(314)][_t(302)][_t(411)]&&this[_t(314)][_t(302)][_t(411)][_t(404)]>0&&t++,(this[_t(314)][_t(302)][_t(429)]&&this[_t(314)][_t(302)][_t(429)][_t(404)]>0||this[_t(314)][_t(302)][_t(475)][_t(421)](_t(432)))&&t++,this[_t(445)]()&&t++,typeof this[_t(314)][_t(456)][_t(438)]!==_t(307)&&t++;try{const e=(new Date)[_t(472)]();e>-840&&e<840&&t++}catch(t){}return t>=3}[_t(445)](){const t=this[_t(314)][_t(456)][_t(348)]||this[_t(314)][_t(449)][_t(294)][_t(379)],e=this[_t(314)][_t(456)][_t(476)]||this[_t(314)][_t(449)][_t(294)][_t(320)];if(!t||!e)return!1;if(t<=2||e<=2)return!1;const n=t/e;return n>=.2&&n<=5}[_t(435)](t,e){return n=>{try{t(n)}catch(t){this[_t(446)][_t(305)](t,_t(353)+e)}}}[_t(370)](){const t=Et(this[_t(435)](t=>{this[_t(366)][_t(391)]++,this[_t(366)][_t(420)][_t(404)]>=10&&this[_t(366)][_t(420)][_t(389)](),this[_t(366)][_t(420)][_t(364)]({x:t[_t(358)],y:t[_t(477)],t:t[_t(341)]})},_t(385)),100),e=this[_t(435)](t=>{this[_t(366)][_t(479)]++,requestAnimationFrame(()=>setTimeout(()=>{this[_t(366)][_t(388)][_t(404)]>=5&&this[_t(366)][_t(388)][_t(389)](),this[_t(366)][_t(388)][_t(364)]({x:t[_t(358)],y:t[_t(477)],t:t[_t(341)],pre:this[_t(350)](t)})},0))},_t(287)),n=this[_t(435)](t=>{this[_t(366)][_t(440)]++;const e=t[_t(403)];if([_t(369),_t(342),_t(436),_t(463)][_t(421)](e))return;const n=this[_t(366)][_t(393)][this[_t(366)][_t(393)][_t(404)]-1],r=t[_t(341)],i=n?r-n.t:null;this[_t(366)][_t(393)][_t(404)]>=10&&this[_t(366)][_t(393)][_t(389)](),this[_t(366)][_t(393)][_t(364)]({_0x1f6b93:e,t:r,int:i}),null!==i&&i<100?(this[_t(366)][_t(367)][_t(364)](i),this[_t(366)][_t(367)][_t(404)]>=5&&(this[_t(366)][_t(471)]++,this[_t(366)][_t(367)]=[])):this[_t(366)][_t(367)]=[]},_t(412)),r=Et(this[_t(435)](t=>{this[_t(366)][_t(309)]++;const e=t[_t(341)],n=window[_t(315)];this[_t(366)][_t(345)][_t(404)]>=10&&this[_t(366)][_t(345)][_t(389)](),this[_t(366)][_t(345)][_t(364)]({p:n,t:e})},_t(271)),200),i=this[_t(435)](t=>{t[_t(452)]&&0!==t[_t(452)][_t(404)]&&(this[_t(366)][_t(415)]++,this[_t(366)][_t(457)][_t(404)]>=10&&this[_t(366)][_t(457)][_t(389)](),this[_t(366)][_t(297)]={x:t[_t(452)][0][_t(358)],y:t[_t(452)][0][_t(477)],t:t[_t(341)],typ:_t(376),s:0,d:0})},_t(299)),o=Et(this[_t(435)](t=>{if(!t[_t(452)]||0===t[_t(452)][_t(404)])return;const e={x:t[_t(452)][0][_t(358)],y:t[_t(452)][0][_t(477)]};if(this[_t(366)][_t(297)]){const n=this[_t(462)](this[_t(366)][_t(297)],e);this[_t(366)][_t(457)][_t(404)]>=10&&this[_t(366)][_t(457)][_t(389)]();const r={x:t[_t(452)][0][_t(358)],y:t[_t(452)][0][_t(477)],t:t[_t(341)],typ:_t(338),d:n,s:n/(t[_t(341)]-this[_t(366)][_t(297)].t)};this[_t(366)][_t(457)][_t(364)](r),this[_t(366)][_t(297)]=r}else{const e={x:t[_t(452)][0][_t(358)],y:t[_t(452)][0][_t(477)],t:t[_t(341)],typ:_t(338),s:0,d:0};this[_t(366)][_t(297)]=e}},_t(295)),200),s=this[_t(435)](t=>{this[_t(366)][_t(297)]=null},_t(444));this[_t(314)][_t(449)][_t(437)](_t(385),t,{passive:!0}),this[_t(314)][_t(449)][_t(437)](_t(287),e,{passive:!0}),this[_t(314)][_t(449)][_t(437)](_t(412),n,{passive:!0}),this[_t(314)][_t(449)][_t(437)](_t(271),r,{passive:!0}),_t(382)in window&&(this[_t(314)][_t(449)][_t(437)](_t(299),i,{passive:!0}),this[_t(314)][_t(449)][_t(437)](_t(295),o,{passive:!0}),this[_t(314)][_t(449)][_t(437)](_t(444),s,{passive:!0})),this[_t(366)][_t(316)]={mousemove:t,click:e,keydown:n,scroll:r,touchstart:i,touchmove:o,touchend:s}}async[_t(304)](t=!1){this[_t(398)](t),await this[_t(468)](),this[_t(366)][_t(332)]=Date[_t(441)]()}[_t(398)](t=!1){const e=Date[_t(441)]();let n=Math[_t(270)]((e-this[_t(366)][_t(313)])/1e3);null!==this[_t(366)][_t(332)]&&(n=Math[_t(270)]((e-this[_t(366)][_t(332)])/1e3)),this[_t(366)][_t(395)]?(this[_t(366)][_t(395)][_t(344)]+=t?1:0,this[_t(366)][_t(395)][_t(399)]+=n):this[_t(366)][_t(395)]={pageCount:1,sessionStart:this[_t(366)][_t(313)],duration:0}}[_t(355)](t,e=!1){this[_t(446)][_t(384)](_t(390)+t,e)}[_t(317)](){try{if(this[_t(314)][_t(456)][_t(431)]){const e=this[_t(314)][_t(456)][_t(431)][_t(439)](Mt);if(e){const n=JSON[_t(465)](e);let r;return _t(283)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}[_t(375)](t){try{this[_t(314)][_t(456)][_t(431)]&&this[_t(314)][_t(456)][_t(431)][_t(371)](Mt,JSON[_t(461)](It(t)))}catch(t){}}[_t(350)](t){const e=t[_t(325)];if(!(e&&e instanceof Element&&e[_t(279)]))return 0;const n=e[_t(279)]();if(!n[_t(322)]||!n[_t(474)])return 0;const r=n[_t(381)]+n[_t(322)]/2,i=n[_t(423)]+n[_t(474)]/2,o=this[_t(462)]({x:t[_t(358)],y:t[_t(477)]},{x:r,y:i}),s=Math[_t(282)](n[_t(322)]**2+n[_t(474)]**2)/2;return s>0?Math[_t(406)](0,1-o/s):0}[_t(462)](t,e){return Math[_t(282)]((e.x-t.x)**2+(e.y-t.y)**2)}[_t(460)](t){if(t[_t(327)](_t(459))||t[_t(327)](_t(365)))return t;return""+(this[_t(314)][_t(456)][_t(310)][_t(363)]||this[_t(314)][_t(456)][_t(310)][_t(278)]+"//"+this[_t(314)][_t(456)][_t(310)][_t(293)])+t}async[_t(337)](t,e){if(!this[_t(366)][_t(455)])return;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,It(t),e),r=JSON[_t(461)](n),i=this[_t(460)](this[_t(354)][_t(330)]);if(this[_t(314)][_t(302)][_t(337)]&&!this[_t(354)][_t(386)])try{const t=new Blob([r],{type:_t(424)});if(this[_t(314)][_t(302)][_t(337)](i,t))return this[_t(366)][_t(455)][_t(443)]=0,void(this[_t(366)][_t(455)][_t(339)]=Date[_t(441)]())}catch(t){}try{const t=await fetch(i,{method:_t(430),headers:{"Content-Type":_t(424)},body:r,credentials:_t(467),keepalive:!0});if(!t.ok)throw new Error(_t(409)+t[_t(334)]);this[_t(366)][_t(455)][_t(443)]=0,this[_t(366)][_t(455)][_t(339)]=Date[_t(441)]()}catch(n){this[_t(414)](t,e)}}[_t(414)](t,e){if(!this[_t(366)][_t(455)]||this[_t(366)][_t(455)][_t(443)]>=this[_t(354)][_t(418)])return;const n=Math[_t(352)](1e3*2**this[_t(366)][_t(455)][_t(443)],3e4);this[_t(366)][_t(455)][_t(443)]++,this[_t(366)][_t(455)][_t(434)]=this[_t(314)][_t(456)][_t(466)](()=>{this[_t(366)][_t(455)]&&this[_t(337)](t,e)},n)}async[_t(468)](){if(!this[_t(366)][_t(455)])return;const t=At(this[_t(366)][_t(391)],this[_t(366)][_t(420)],this[_t(366)][_t(479)],this[_t(366)][_t(388)],this[_t(366)][_t(393)],this[_t(366)][_t(440)],this[_t(366)][_t(471)],this[_t(366)][_t(309)],this[_t(366)][_t(415)],this[_t(366)][_t(345)],this[_t(366)][_t(457)],this[_t(366)][_t(313)],Date[_t(441)]()),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[_t(296)]=!0),e.ca>0&&1===e.vc&&(i[_t(286)]=!0),e.ka>0&&(i[_t(319)]=!0),e.sa>0&&(i[_t(413)]=!0),e.ta>0&&(i[_t(311)]=!0),e.t>30&&(i[_t(402)]=!0),n&&(n[_t(344)]>1&&(i[_t(428)]=!0),n[_t(399)]>60&&(i[_t(292)]=!0)),r){const t=Object[_t(291)](i);for(const e of t)i[e]=i[e]||r[e]}return i}(this[_t(366)][_t(469)],t,this[_t(366)][_t(395)],this[_t(366)][_t(455)][_t(410)]),n=function(t,e){if(!e)return!0;const n=Object[_t(291)](t);for(const r of n)if(t[r]!==e[r])return!0;return!1}(e,this[_t(366)][_t(455)][_t(410)]),r=Date[_t(441)]()-this[_t(366)][_t(455)][_t(339)],i=r>=this[_t(354)][_t(362)];if(n||i){if(Date[_t(441)]()-this[_t(366)][_t(455)][_t(478)]<100)return void this[_t(355)](_t(300),!0);if(i&&!n&&this[_t(355)](_t(274)+Math[_t(346)](r/1e3)+_t(335),!0),n&&this[_t(354)][_t(273)]){if(this[_t(366)][_t(455)][_t(410)]){Object[_t(291)](e)[_t(416)](t=>{this[_t(366)][_t(455)][_t(410)][t],e[t]})}else this[_t(355)](_t(324));this[_t(366)][_t(395)]}this[_t(366)][_t(455)][_t(410)]=(o=e,{...o}),this[_t(366)][_t(455)][_t(478)]=Date[_t(441)](),this[_t(375)](e);const t=_t(n?473:326);await this[_t(337)](e,t)}else this[_t(354)][_t(273)];var o}}const kt=t=>{const e=/_shopify_s=([^;]*)/[_t(458)](t[_t(449)][_t(378)]);return e?e[1]:void 0},qt=(t,e)=>{const n=kt(t),r=/_shopify_y=([^;]*)/[_t(458)](t[_t(449)][_t(378)]),i=r?r[1]:void 0;return{libVersion:"2.0.1",shopId:e||"",hostname:t[_t(456)]?.[_t(310)]?.[_t(308)]||"",url:t[_t(456)]?.[_t(310)]?.[_t(321)]||"",referrer:t[_t(449)]?.[_t(275)]||"",baseURI:t[_t(449)]?.[_t(426)]||"",sessionToken:n||"",uniqueToken:i||""}},jt=(t,e=Dt(),n=new vt(St,xt))=>{const r=new dt({exporter:n,attributes:qt(e,t?.[_t(301)])}),i=kt(e),o=i?function(t){let e=0;for(let n=0,r=t.length;na[_t(323)]()):a[_t(323)](),a};class Ht{quietWindowStartCandidates=[];longAnimationFrameObserver=null;longAnimationFrames=[];constructor(){this.initializeLongAnimationFrameObserver()}getQuietWindowStartCandidates(){return[...this.quietWindowStartCandidates].sort((t,e)=>t.startTime-e.startTime)}getLongAnimationFrames(){if(!Ft()){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(Ft())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 Ut=null;function Ot(t){if(null===t||!Ft()&&!Boolean(window.ShopifyAnalytics?.performance?.getLongAnimationFrames))return Zt(),null;const e=Ut?Ut.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 Zt(),t;const r=Ut?Ut.getQuietWindowStartCandidates():[];let i=t;if(r.length>0)for(const e of r)if(e.startTime>=t){i=e.startTime;break}return Zt(),i}function Ft(){return PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")}function Zt(){Ut&&(Ut.destroy(),Ut=null)}function Rt(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 Wt=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"}),Jt=new RegExp(`^${window.location.origin}/((?:(?:[a-z]{2,3}|zh-hans|zh-hant)(?:-[a-zA-Z0-9]+)/)?cart/(add|change|update|clear))`),Vt=new RegExp("cart-performance:|add:|change:|clear:|note_update:");var Kt;function Xt({monorailRegion:t,schema:e,rawData:n}){const r=Date.now(),i={schema_id:e,payload:e===Kt.OnUnload?Yt(n):Gt(n),metadata:{event_created_at_ms:r,event_sent_at_ms:r}},o=Wt[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 Yt(t){const e=$t(t,["domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","firstPaint","visuallyReady","initiatorType","redirectCount","cartAjaxResourceTimings","cartPerformanceMetrics"]);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 Gt(t){const e=$t(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 $t(t,e){return e.reduce((e,n)=>{var r;return t[n]&&(e[(r=n,r.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`))]=t[n]||null),e},{})}!function(t){t.OnInteraction="perf_kit_on_interaction/3.2",t.OnUnload="perf_kit_on_unload/3.5"}(Kt||(Kt={}));const Qt="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function te(){let t="";try{const e=window.crypto,n=new Uint16Array(31);e.getRandomValues(n);let r=0;t=Qt.replace(/[x]/g,t=>{const e=n[r]%16;return r++,("x"===t?e:3&e|8).toString(16)}).toUpperCase()}catch(e){t=Qt.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 ee=!0,ne=!1,re=null,ie=null,oe=!1;class se{info;config;performanceMetrics;constructor(t){const e=/_shopify_s=([^;]*)/.exec(document.cookie),n=e?e[1]:void 0,r=/_shopify_y=([^;]*)/.exec(document.cookie),i=r?r[1]:void 0;this.config=t,this.info={perfKitInit:Date.now(),perfKitVersion:"3.0.4",url:window.location.href,referrer:document.referrer||void 0,microSessionId:te(),microSessionCount:0,sessionToken:n,uniqueToken:i},performance.setResourceTimingBufferSize(1e3),this.performanceMetrics=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 ae(t){re=new se(t),Ut||(Ut=new Ht),t.spaMode&&(window.PerfKit={navigate:()=>{ee?ee=!1:ne||(ue(),re=new se(t),ne=!0)},setPageType:e=>{t.storefrontData.pageType=e},setConsent:t=>{ie=t}}),t.shs&&!t.spaMode&&jt({debug:!1,shopId:t.storefrontData.shopId,exportWithFetch:t.shsExportWithFetch||!0,logsSampleRate:t.shsLogsSampleRate,...t.shsBeaconEndpoint&&{beaconEndpoint:t.shsBeaconEndpoint}})}const ce=new Set;function ue(){if(null!==re){if(he()&&ce.size>0){let t={};for(const e of ce)t={...t,...e};const e=t.firstContentfulPaint??null,n=Ot(e);null!==e&&null!==n&&(t.quietWindowStart=Math.round(n)),ce.clear(),re.info.microSessionCount+=1;const r=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))})}(re.config.resourceTimingSamplingRate),i=performance.getEntriesByType("resource").filter(t=>Jt.test(t.name)),o=performance.getEntriesByType("measure").filter(t=>Vt.test(t.name)).map(t=>{const e=t.toJSON();return e.name.startsWith("cart-performance:")||(e.name=`cart-performance:${e.name}`),e});Xt({monorailRegion:re.config.monorailRegion,schema:Kt.OnUnload,rawData:{...re.info,...re.config.storefrontData,...re.performanceMetrics,...t,resourceTiming:r,cartAjaxResourceTimings:i,cartPerformanceMetrics:o,paintTimingHidden:oe}})}}else console.debug("⛔️ Shopify/perf-kit is not initialized")}function he(){return null!==ie?ie:et()}((e,r={})=>{const o=s(r=Object.assign({},r),t),a=new WeakMap;o.t=t=>{if(t?.sources?.length){const e=L(t.sources),n=e?.node;if(n){const t=r.generateTarget?.(n)??i(n);a.set(e,t)}}},((e,n={})=>{const r=C();S(p(()=>{let i,o=m("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=f("layout-shift",c);d&&(i=h(e,o,x,n.reportAllChanges),r.onHidden(()=>{c(d.takeRecords()),i(!0)}),u(()=>{a.o=0,o=m("CLS",0),i=h(e,o,x,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=L(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;ce.add({cumulativeLayoutShift:n,cumulativeLayoutShiftTarget:e.largestShiftTarget})}),((t,n={})=>{const r=s(n=Object.assign({},n),k),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=m("LCP");const o=s(e,k),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&&(I(n),removeEventListener(t.type,o,{capture:!0}))};for(const t of["keydown","click","visibilitychange"])addEventListener(t,o,{capture:!0});u(n=>{i=m("LCP"),r=h(t,i,q,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;ce.add({largestContentfulPaint:Math.round(n),largestContentfulPaintTarget:e.target})}),((t,r={})=>{S(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;ce.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||(I(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),m={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})(m),Object.assign(t,{attribution:m})};f("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||z||(z=f("event",B,{type:"event",buffered:!0,durationThreshold:0}));let r,i=m("INP");const o=s(e,P),a=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=f("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=m("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===re)return void console.debug("⛔️ Shopify/perf-kit is not initialized");if(!he())return;re.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)}:{};Xt({monorailRegion:re.config.monorailRegion,schema:Kt.OnInteraction,rawData:{...re.info,...re.config.storefrontData,...re.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=m("TTFB"),i=h(t,r,j,n.reportAllChanges);H(()=>{const o=e();o&&(r.value=Math.max(o.responseStart-d(),0),r.entries=[o],i(!0),u(()=>{r=m("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;ce.add({timeToFirstByte:Math.round(e)})}),addEventListener("DOMContentLoaded",()=>{oe="hidden"===document.visibilityState}),addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&ue()}),function(){const{dataset:t}=document.currentScript;try{ae(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:Rt(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)}}()}();