(()=>{var e={856:function(e,t,n){var o,r,i;!function(s,a){"use strict";r=[n(652)],void 0===(i="function"==typeof(o=function(e){var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,o=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(e){return!!e.match(n)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),o=n.match(/ (\(.+\)$)/);n=o?n.replace(o[0],""):n;var r=this.extractLocation(o?o[1]:n),i=o&&n||void 0,s=["eval",""].indexOf(r[0])>-1?void 0:r[0];return new e({functionName:i,fileName:s,lineNumber:r[1],columnNumber:r[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(o)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,o=t.match(n),r=o&&o[1]?o[1]:void 0,i=this.extractLocation(t.replace(n,""));return new e({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,o=t.message.split("\n"),r=[],i=2,s=o.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(n=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:s,args:a,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:t})}),this)}}})?o.apply(t,r):o)||(e.exports=i)}()},652:function(e,t){var n,o,r;!function(i,s){"use strict";o=[],void 0===(r="function"==typeof(n=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],r=["fileName","functionName","source"],i=n.concat(o,r,["args"],["evalOrigin"]);function s(t){if(t)for(var n=0;n0?2===a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,u):this[a[0]]=a[1]:3===a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=u?u.replace(a[1],a[2]):i:this[a[0]]=u?a[1].call(this,u,a[2]):i:4===a.length&&(this[a[0]]=u?a[3].call(this,u.replace(a[1],a[2])):i):this[a]=u||i;d+=2}},G=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var o=0;o2&&(e[d]="iPad",e[f]=g),e},this.getEngine=function(){var e={};return e[p]=i,e[h]=i,X.call(e,o,y.engine),e},this.getOS=function(){var e={};return e[p]=i,e[h]=i,X.call(e,o,y.os),x&&!e[p]&&w&&"Unknown"!=w.platform&&(e[p]=w.platform.replace(/chrome os/i,z).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===l&&e.length>350?W(e,350):e,this},this.setUA(o),this};Z.VERSION="1.0.36",Z.BROWSER=F([p,h,u]),Z.CPU=F([b]),Z.DEVICE=F([d,m,f,w,v,y,g,x,E]),Z.ENGINE=Z.OS=F([p,h]),typeof t!==a?(e.exports&&(t=e.exports=Z),t.UAParser=Z):n.amdO?(o=function(){return Z}.call(t,n,t,e))===i||(e.exports=o):typeof r!==a&&(r.UAParser=Z);var Q=typeof r!==a&&(r.jQuery||r.Zepto);if(Q&&!Q.ua){var ee=new Z;Q.ua=ee.getResult(),Q.ua.get=function(){return ee.getUA()},Q.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)Q.ua[n]=t[n]}}}("object"==typeof window?window:this)}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e="webPixelsManager",t="production",o="0.0.451",r="modern",i="e1e4af48w7bc3dc76p7af67f21m159db03b",s="be1e4af48w7bc3dc76p7af67f21m159db03bm.js",a="loggedConversion2",c="WebPixel::Render",l="product_added_to_cart",u="product_removed_from_cart",d="payment_info_submitted";function p(){return window}let f,m="OFF";function h(e,t,n){const{jQuery:o}=p();o&&o(e).bind?o(e).bind(t,n):e.addEventListener&&e.addEventListener(t,n)}function b(e,t){"ON"===m&&console&&console.warn&&console.warn(`[pixel_shop_events_listener] Error in ${e}: ${t.message}`)}function w(e){h(window,"load",(()=>{for(const t of document.forms)e(t)}))}function v(e,t,n){if(t.length!==n.length)throw Error("Payload body and response have different number of items");t.forEach(((t,o)=>{let r=1;try{r=parseInt(n[o].quantity,10)||1}catch(i){b("handleBulkItemCartAddResponse",i)}y(e,t,r)}))}function g(e,t,n,o,r){const i=((null==(a=null==(c=p())?void 0:c.ShopifyAnalytics)?void 0:a.meta)||{}).currency,s={id:String("add"===r?t.id:t.variant_id),image:{src:t.image},price:{amount:t.price/("add"===r?100:1),currencyCode:i},product:{id:String(t.product_id),title:t.title,vendor:t.vendor,type:t.product_type,untranslatedTitle:t.untranslated_product_title,url:t.url},sku:t.sku,title:t.variant_title,untranslatedTitle:t.untranslated_variant_title};var a,c;e(o,{cartLine:{cost:{totalAmount:{amount:s.price.amount*n,currencyCode:i}},merchandise:s,quantity:n}})}function y(e,t,n,o="add"){g(e,t,n,l,o)}function x(e,t){const n=t.items_added,o=t.items_removed;n.forEach((t=>{y(e,t,null==t?void 0:t.quantity,"change")})),o.forEach((t=>{!function(e,t,n,o){g(e,t,n,u,"change")}(e,t,null==t?void 0:t.quantity)}))}function E(e){if(!e)return 1;try{return JSON.parse(e).quantity||1}catch(t){if(e instanceof FormData){if(e.has("quantity"))return Number(e.get("quantity"))}else{const t=e.split("&");for(const e of t){const t=e.split("=");if("quantity"===t[0])return Number(t[1])}}}return 1}class _{static handleXhrOpen(){}static handleXhrDone(e){try{const t=document.createElement("a");t.href=e.url;const n=t.pathname?t.pathname:e.url;_.ADD_TO_CART_REGEX.test(n)?_.parsePayloadResponse(e,(t=>{const n=Object.keys(t);if(1===n.length&&"items"===n[0]){const n=t.items;let r;try{r=JSON.parse(e.body).items}catch(o){r=function(e,t){const n=new Array(t);for(let o=0;o{x(e.publish,t)}))}catch(t){b("handleXhrDone",t)}}static parseBlobToJson(e,t){const n=new FileReader;n.addEventListener("loadend",(()=>{t(JSON.parse(String.fromCharCode(...new Uint8Array(n.result))))})),n.readAsArrayBuffer(e)}static parsePayloadResponse(e,t){e.xhr.response instanceof Blob?_.parseBlobToJson(e.xhr.response,t):e.xhr.responseText&&t(JSON.parse(e.xhr.responseText))}constructor(e,t,n,o,r){this.oldOnReadyStateChange=void 0,this.xhr=void 0,this.url=void 0,this.method=void 0,this.body=void 0,this.publish=void 0,this.xhr=e,this.url=t,this.method=n,this.body=o,this.publish=r}onReadyStateChange(){this.xhr.readyState===XMLHttpRequest.DONE&&_.handleXhrDone({method:this.method,url:this.url,body:this.body,xhr:this.xhr,publish:this.publish}),this.oldOnReadyStateChange&&this.oldOnReadyStateChange.call(this.xhr,new Event("oldOnReadyStateChange"))}}function k(e,t){const n=e.fetch;function o(e){b("handleFetchRequest",e)}"function"==typeof n&&(e.fetch=function(...e){return n.apply(this,Array.prototype.slice.call(e)).then((e=>{if(!e.ok)return e;const n=document.createElement("a");n.href=e.url;const r=n.pathname?n.pathname:e.url;try{if(_.ADD_TO_CART_REGEX.test(r)){try{const n=arguments[1].body instanceof FormData?function(e){const t={};return e.forEach(((e,n)=>{S(n,e,t)})),t}(arguments[1].body):JSON.parse(arguments[1].body);if(Object.keys(n).includes("items"))return function(e,n){e.clone().json().then((e=>{const o=n.items,r=e.items;return v(t,r,o),e})).catch(o)}(e,n),e}catch(i){o(i)}!function(e,n){const r=E(n);e.clone().json().then((e=>y(t,e,r))).catch(o)}(e,arguments[1].body)}else _.CHANGE_TO_CART_REGEX.test(r)&&function(e){e.clone().json().then((e=>{x(t,e)})).catch(o)}(e)}catch(i){o(i)}return e}))})}function S(e,t,n){const[o,...r]=e.split(".").filter((e=>e));if(o&&r.length>0)return n[o]=n[o]||{},void S(r.join("."),t,n[o]);const i=/(\w+)?\[(\d+)?\](.+)?/.exec(e);if(i){const[e,o,r,s=""]=i;if(o)return n[o]=n[o]||[],void S(e.replace(o,""),t,n[o]);if(r){const e=s&&"["===s[0]?[]:{};return n[r]=n[r]||e,void S(s,t,n[r])}n.push(t)}else n[e]=t}function C(e,t){!function(e,t){const n=e.prototype.open,o=e.prototype.send;e.prototype.open=function(e,t){this._url=t,this._method=e,_.handleXhrOpen(),n.apply(this,arguments)},e.prototype.send=function(e){if(!(e instanceof Document)){const n=new _(this,this._url,this._method,e||"",t);this.addEventListener?this.addEventListener("readystatechange",n.onReadyStateChange.bind(n),!1):(n.oldOnReadyStateChange=this.onreadystatechange,this.onreadystatechange=n.onReadyStateChange)}o.call(this,e)}}(XMLHttpRequest,e),k(p(),e),w((n=>{const o=n.getAttribute("action");o&&o.indexOf("/cart/add")>=0&&h(n,"submit",(n=>{!function(e,t,n){const o=t||window.event;if(o.defaultPrevented||o.isDefaultPrevented&&o.isDefaultPrevented())return;const r=o.currentTarget||o.srcElement;if(r&&r instanceof Element&&(r.getAttribute("action")||r.getAttribute("href")))try{const t=function(e){let t;const n=e.querySelector('[name="id"]');return n instanceof HTMLSelectElement&&n.options?t=n.options[n.selectedIndex]:(n instanceof HTMLOptionElement||n instanceof HTMLInputElement)&&(t=n),t}(r);if(!t)return;const o=t.value,i=function(e){const t=e.querySelector('[name="quantity"]');return t instanceof HTMLInputElement?Number(t.value):1}(r),s=function(e,t){var n;const[o]=(null==(n=t.productVariants)?void 0:n.filter((t=>t.id===e)))||[];if(!o)throw new Error("Product variant not found");return o}(o,n),a={cost:{totalAmount:{amount:s.price.amount*i,currencyCode:s.price.currencyCode}},merchandise:s,quantity:i};e(l,{cartLine:a})}catch(i){b("handleSubmitCartAdd",i)}}(e,n,t)}))}))}function A(e,t,n){var o;null!=n&&n.logLevel&&(o=n.logLevel,m=o),C(e,t),function(e,t){w((n=>{const o=n.querySelector('[name="previous_step"]');o&&o instanceof HTMLInputElement&&"payment_method"===o.value&&h(document.body,"submit",(n=>{!function(e,t,n){const o=t||window.event,r=o.target||o.srcElement;if(r&&r instanceof HTMLFormElement&&r.getAttribute("action")&&null!==r.getAttribute("data-payment-form"))try{const t=n.checkout;if(!t)throw new Error("Checkout data not found");e(d,{checkout:t})}catch(i){b("handleSubmitToPaymentAdd",i)}}(e,n,t)}))}))}(e,t)}var I;_.ADD_TO_CART_REGEX=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/cart\/add(?:\.js|\.json)?$/,_.CHANGE_TO_CART_REGEX=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/cart\/change(?:\.js|\.json)?$/,(I=f||(f={})).TRACKING_ACCEPTED="trackingConsentAccepted",I.TRACKING_DECLINED="trackingConsentDeclined",I.MARKETING_ACCEPTED="firstPartyMarketingConsentAccepted",I.SALE_OF_DATA_ACCEPTED="thirdPartyMarketingConsentAccepted",I.ANALYTICS_ACCEPTED="analyticsConsentAccepted",I.PREFERENCES_ACCEPTED="preferencesConsentAccepted",I.MARKETING_DECLINED="firstPartyMarketingConsentDeclined",I.SALE_OF_DATA_DECLINED="thirdPartyMarketingConsentDeclined",I.ANALYTICS_DECLINED="analyticsConsentDeclined",I.PREFERENCES_DECLINED="preferencesConsentDeclined",I.CONSENT_COLLECTED="visitorConsentCollected",I.CONSENT_TRACKING_API_LOADED="consentTrackingApiLoaded";const T="2.1";let O,N,P,R,L,D,M;var $,j,U,V,B,z,q;(q=O||(O={})).ACCEPTED="yes",q.DECLINED="no",q.NO_INTERACTION="no_interaction",q.NO_VALUE="",(z=N||(N={})).NO_VALUE="",z.ACCEPTED="1",z.DECLINED="0",(B=P||(P={})).GDPR="GDPR",B.CCPA="CCPA",B.NO_VALUE="",(V=R||(R={})).PREFERENCES="p",V.ANALYTICS="a",V.MARKETING="m",V.SALE_OF_DATA="t",(U=L||(L={})).MARKETING="m",U.ANALYTICS="a",U.PREFERENCES="p",U.SALE_OF_DATA="s",(j=D||(D={})).MARKETING="marketing",j.ANALYTICS="analytics",j.PREFERENCES="preferences",j.SALE_OF_DATA="sale_of_data",j.EMAIL="email",($=M||(M={})).HEADLESS_STOREFRONT="headlessStorefront",$.ROOT_DOMAIN="rootDomain",$.CHECKOUT_ROOT_DOMAIN="checkoutRootDomain",$.STOREFRONT_ROOT_DOMAIN="storefrontRootDomain",$.STOREFRONT_ACCESS_TOKEN="storefrontAccessToken";const F=["v","con","reg"];let H={};function K(e,t=null){return e in H||function(e){const t=document.cookie?document.cookie.split("; "):[];H[e]=void 0;for(let n=0;ne.trim())).map((e=>e.split("=").map((e=>e.trim()))));if(o=Object.fromEntries(e),o.purposes){const e=o.purposes.split(/(true|false)/).filter(Boolean),t={};for(let n=0;ne===n[t]))}(Object.keys(t).filter((e=>"region"!==e&&"lim"!==e)),F))return e;var t}();if(!e)return;return e}catch{return}}const G="_cmp_a",Y="shopify-cmp-metadata";function J(e){const t=K(G,Y);if(!t)return!0;const n=t.purposes[e];return"boolean"!=typeof n||n}function Z(){return J(R.ANALYTICS)}function Q(){return J(R.MARKETING)}function ee(){return!!function(e=null){return null===e&&(e=X()),void 0===e}()||Q()&&Z()}function te(){return J(R.SALE_OF_DATA)}const ne="sh",oe="shu",re=["page_viewed","collection_viewed","product_viewed","product_variant_viewed","search_submitted","product_added_to_cart","checkout_started","checkout_completed","payment_info_submitted","checkout_contact_step_started","checkout_contact_info_submitted","checkout_address_info_submitted","checkout_shipping_step_started","checkout_shipping_info_submitted","checkout_payment_step_started","session_started"],ie="wpm",se="trekkie";let ae,ce;function le(e){return`${e||ne}-${function(){const e="xxxx-4xxx-xxxx-xxxxxxxxxxxx";let t="";try{const n=window.crypto,o=new Uint16Array(31);n.getRandomValues(o);let r=0;t=e.replace(/[x]/g,(e=>{const t=o[r];if("number"!=typeof t)throw new Error(`Event ID service: Invalid random number at index "${r}".`);const n=t%16;return r++,("x"===e?n:3&n|8).toString(16)})).toUpperCase()}catch(n){t=e.replace(/[x]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})).toUpperCase()}return`${function(){let e=0,t=0;e=(new Date).getTime()>>>0;try{t=performance.now()>>>0}catch(n){t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}()}-${t}`}()}`}function ue(){window.Shopify=window.Shopify||{},window.Shopify.evids||(ae={},ce={[ie]:{},[se]:{}},window.Shopify.evids=(...e)=>function(e,t){if(!function(e){return re.includes(e)}(e)||(null==t?void 0:t.analyticsFramework)!==se&&(null==t?void 0:t.analyticsFramework)!==ie)return le(oe);const n="string"==typeof(o=t.cacheKey)&&o?o:"default";var o;const r=function(e,t,n){var o;const r=ce[t],i=null!=(o=r[e])?o:r[e]={},s=i[n];return i[n]="number"==typeof s?s+1:0}(e,t.analyticsFramework,n);return function(e,t,n){var o,r;const i=null!=(o=ae[e])?o:ae[e]={},s=null!=(r=i[n])?r:[];let a=s[t];return a||(a=le(),s.push(a)),i[n]=s,a}(e,r,n)}(...e))}const de=new Set;function pe(e){return de.has(e)}function fe(e){const t={};for(const o of e.split(/ *; */)){const[e="",r=""]=o.split("=");try{t[decodeURIComponent(e)]=decodeURIComponent(r)}catch(n){continue}}return t}function me(e){if(e<=0||e>100)throw new Error("Invalid sampling percent");return 100*Math.random()<=e}var he=n(856),be=n.n(he);class we extends Error{constructor(...e){super(...e),this.message="Excessive Stacktrace: May indicate infinite loop forming"}}var ve=n(332);class ge extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,ge)}}const ye={production:"https://notify.bugsnag.com",test:"https://localhost"},xe={severity:"error",context:"",unhandled:!0,library:"browser"},Ee={notify:(e,n)=>{try{var a;if(null!=n&&null!=(a=n.options)&&a.sampleRate&&!me(n.options.sampleRate))return;const d={...xe,...n};let p={errorClass:null==e?void 0:e.name,message:null==e?void 0:e.message,stacktrace:[],type:"browserjs"};try{p=function(e){if("string"!=typeof((null==(t=e)?void 0:t.stack)||(null==t?void 0:t.stacktrace)||(null==t?void 0:t["opera#sourceloc"]))||t.stack===`${t.name}: ${t.message}`)throw new Error("Error incompatible with error-stack-parser");var t;const n=be().parse(e).reduce(((e,t)=>{const n=function({functionName:e,lineNumber:t,columnNumber:n}){const o=/^global code$/i.test((r=e)||"")?"global code":r;var r;return{file:`https://cdn.shopify.com/cdn/wpm/${s}`,method:o,lineNumber:t,columnNumber:n}}(t);try{return"{}"===JSON.stringify(n)?e:e.concat(n)}catch(o){return e}}),[]);return{errorClass:null==e?void 0:e.name,message:null==e?void 0:e.message,stacktrace:n,type:"browserjs"}}(e)}catch(l){try{p=function(e,t){let n="";const o={lineNumber:"1",columnNumber:"1",method:t.context,file:`https://cdn.shopify.com/cdn/wpm/${s}`};if(e.stackTrace||e.stack||e.description){n=e.stack.split("\n")[0];const t=e.stack.match(/([0-9]+):([0-9]+)/);if(t&&t.length>2&&(o.lineNumber=t[1],o.columnNumber=t[2],parseInt(o.lineNumber,10)>1e5))throw new we}return{errorClass:(null==e?void 0:e.name)||n,message:(null==e?void 0:e.message)||n,stacktrace:[o],type:"browserjs"}}(e,d)}catch(u){if(u instanceof we)return}}const f=function(n,{userAgent:s,context:a,severity:c,unhandled:l,library:u,hashVersionSandbox:d,sandboxUrl:p,pixelId:f,pixelType:m,runtimeContext:h,shopId:b,initConfig:w,notes:v}){var g,y;const{device:x,os:E,browser:_,engine:k}=function(t){try{return new ve.UAParser(t).getResult()}catch(e){return{ua:"",browser:{name:"",version:"",major:""},engine:{name:"",version:""},os:{name:"",version:""},device:{model:"",type:"",vendor:""},cpu:{architecture:""}}}}(s||(null==(g=self.navigator)?void 0:g.userAgent));return{payloadVersion:5,notifier:{name:"web-pixel-manager",version:o,url:"-"},events:[{exceptions:[n],context:a,severity:c,unhandled:l,app:{version:o},device:{manufacturer:x.vendor,model:x.model,osName:E.name,osVersion:E.version,browserName:_.name,browserVersion:_.version},metaData:{app:{library:u,browserTarget:r,env:t,hashVersion:i,hashVersionSandbox:d||"N/A",sandboxUrl:p||"N/A"},device:{userAgent:s||(null==(y=self.navigator)?void 0:y.userAgent),renderingEngineName:k.name,renderingEngineVersion:k.version},request:{shopId:b,shopUrl:self.location.href,pixelId:f,pixelType:m,runtimeContext:h},"Additional Notes":{initConfig:JSON.stringify(w),notes:v}}}]}}(p,d),m=ye[t];var c;if(!m)return void(null==(c=console)||c.log(`[${t}]`,"Bugsnag notify:",f));fetch(m,{method:"POST",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":"bcbc9f6762da195561967577c2d74ff8","Bugsnag-Payload-Version":"5"},body:JSON.stringify(f)}).catch((()=>{}))}catch(d){}}};function _e(e){const t={};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=n.replace(/[A-Z]/g,(e=>`_${e}`)).toLowerCase(),r=e[n];t[o]=null!==r&&"object"==typeof r?_e(r):r}return t}function ke(e){return e.replace(/\/$/,"")}const Se={},Ce={"pixel:register":{start:{name:"pixel:register:started",params:{pixelId:"",source:""}},end:{name:"pixel:register:completed",params:{pixelId:"",source:""}}},"page:session":{start:{name:"start",params:Se},end:{name:"page:unload",params:Se}},completed:{start:{name:"start",params:Se},end:{name:"pixels:resolved",params:Se}}};function Ae(e,t=Se){const n=Ie(e,"end",t),o=function(e,t){try{const n=Te(e,"start",t),o=Te(e,"end",t),r=function(e,t){return Oe(e,t)}(e,t),i=self.performance.measure(r,n,o);return{...i,duration:Math.round(i.duration),startTime:Math.round(i.startTime)}}catch(n){return null}}(e,t);return{mark:n,measurement:o}}function Ie(e,t,n){try{const o=Te(e,t,n);return self.performance.mark(o),{name:o,params:n}}catch(o){return{name:null,params:n}}}function Te(e,t,n){return Oe(Ce[e][t].name,n)}function Oe(e,t={}){const n=["wpm",e];return Object.keys(t).forEach((e=>{const o=t[e];o&&n.push(o)})),n.join(":")}const Ne={test:"edge_test_click/1.0",load:"web_pixels_manager_load/3.1",init:"web_pixels_manager_init/3.2",register:"web_pixels_manager_pixel_register/3.6",subscriberEventEmit:"web_pixels_manager_subscriber_event_emit/3.4",eventPublish:"web_pixels_manager_event_publish/1.6",consentAccepted:"web_pixels_manager_consent_accepted/1.2",unload:"web_pixels_manager_unload/1.2",visitor:"web_pixels_manager_visitor/1.0",subscriberEventEmitDom:"web_pixels_manager_subscriber_event_emit_dom/1.0"};function Pe(e,t){return{schemaId:Ne[e],payload:t}}let Re="";function Le(e=""){Re=ke(e)}const De="/unstable/produce_batch",Me=500;let $e="wellKnown";const je=new Array;let Ue;function Ve(e,t=!1){const n={schema_id:e.schemaId,payload:_e(e.payload),metadata:{event_created_at_ms:qe()}};je.push(n),t?ze():void 0===Ue&&(Ue=setTimeout(ze,Me))}function Be(e,t,n=!1){Ve(Pe(e,t),n)}function ze({skipXhr:e}={skipXhr:!1}){if(Ue=void 0,0===je.length)return;const t=[...je];je.length=0,function(e,t){if(0===e.length)return!1;const n={metadata:{event_sent_at_ms:qe()},events:e};!function(e,t){const n=`${{global:"https://monorail-edge.shopifysvc.com",wellKnown:`${Re}/.well-known/shopify/monorail`,staging:"https://monorail-edge-staging.shopifycloud.com",test:"https://localhost"}[$e]}${De}`;try{if(self.navigator.sendBeacon.bind(self.navigator)(n,e))return!0}catch(o){}if(!t){const t=new XMLHttpRequest;try{t.open("POST",n,!0),t.setRequestHeader("Content-Type","text/plain"),t.send(e)}catch(r){Ee.notify(r,{context:"v0/utilities/monorail/sendRequest",unhandled:!1})}}}(JSON.stringify(n),t)}(t,e)}function qe(){return(new Date).getTime()}let Fe=!1;const He=["analytics","preferences","marketing","sale_of_data"];function Ke(e,t){return e?!t||Object.keys(e).every((n=>!e[n]||t[n])):ee()}function We(e){if(e)return He.reduce(((t,n)=>(t[n]=e.includes(n.toUpperCase()),t)),{})}function Xe(e){return new Promise(((t,n)=>{const o={analytics:Z(),marketing:Q(),preferences:J(R.PREFERENCES),sale_of_data:te()};if(Ke(e,o))return void t(!0);const r=n=>{H={},function(e,t){const n=e.detail;return Ke(t,{analytics:!0===(null==n?void 0:n.analyticsAllowed),marketing:!0===(null==n?void 0:n.marketingAllowed),preferences:!0===(null==n?void 0:n.preferencesAllowed),sale_of_data:!0===(null==n?void 0:n.saleOfDataAllowed)})}(n,e)&&(document.removeEventListener(f.CONSENT_COLLECTED,r),t(!0))};document.addEventListener(f.CONSENT_COLLECTED,r)}))}const Ge=new Set;class Ye extends Error{constructor(e){super(e),this.name="VisitorError"}}const Je={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Ze;const Qe=new Uint8Array(16);function et(){if(!Ze&&(Ze="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ze))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ze(Qe)}const tt=[];for(let n=0;n<256;++n)tt.push((n+256).toString(16).slice(1));const nt=function(e,t,n){if(Je.randomUUID&&!t&&!e)return Je.randomUUID();const o=(e=e||{}).random||(e.rng||et)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return function(e,t=0){return tt[e[t+0]]+tt[e[t+1]]+tt[e[t+2]]+tt[e[t+3]]+"-"+tt[e[t+4]]+tt[e[t+5]]+"-"+tt[e[t+6]]+tt[e[t+7]]+"-"+tt[e[t+8]]+tt[e[t+9]]+"-"+tt[e[t+10]]+tt[e[t+11]]+tt[e[t+12]]+tt[e[t+13]]+tt[e[t+14]]+tt[e[t+15]]}(o)};let ot;function rt(){return ot||(ot=function(){let e;try{var t,n;e=null!=(t=window.Shopify)&&t.evids?null==(n=window.Shopify)?void 0:n.evids("session_started",{analyticsFramework:"wpm"}):nt()}catch(o){e=nt()}return e}()),ot}function it(e,t,n,o={}){try{const r=e=>{try{t(e)}catch(n){Ee.notify(n,{context:"v0/createDomEventsListener/createEventListener/handler",unhandled:!1,options:{sampleRate:o.sampleRate||50}})}};self.addEventListener(e,r,n)}catch(r){Ee.notify(r,{context:"v0/createDomEventsListener/createEventListener",unhandled:!1})}}function st(e,t){return t.reduce(((t,n)=>(t[n]=function(e,t){var n;return t in e&&"string"==typeof e[t]?e[t]:null!=(n=e.getAttribute(t))?n:null}(e,n),t)),{})}const at=[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement],ct=["id","name","tagName","type","value"];function lt(e){return st(e,ct)}const ut=["id","href","name","tagName","type","value"],dt={capture:!0,passive:!0},pt=["action","id"];function ft(e){const t=function(){let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};self.addEventListener("test",n,t),self.removeEventListener("test",n,t)}catch(t){e=!1}return!e||dt}();!function(e,t){it("blur",(t=>{const n=null==t?void 0:t.target;if(!(n instanceof HTMLInputElement||n instanceof HTMLSelectElement||n instanceof HTMLTextAreaElement))return;const o=lt(n);e.publishDomEvent("input_blurred",{element:o})}),t)}(e,t),function(e,t){it("change",(t=>{const n=null==t?void 0:t.target;if(!(n instanceof HTMLInputElement||n instanceof HTMLSelectElement||n instanceof HTMLTextAreaElement))return;const o={element:lt(n)};e.publishDomEvent("input_changed",o)}),t)}(e,t),function(e,t){it("click",(t=>{const n=null==t?void 0:t.target;if(!(n instanceof Element))return;const o=function(e){return st(e,ut)}(n);e.publishDomEvent("clicked",{element:o})}),t)}(e,t),function(e,t){it("focus",(t=>{const n=null==t?void 0:t.target;if(!(n instanceof HTMLInputElement||n instanceof HTMLSelectElement||n instanceof HTMLTextAreaElement))return;const o=lt(n);e.publishDomEvent("input_focused",{element:o})}),t)}(e,t),function(e,t){it("submit",(t=>{const n=null==t?void 0:t.target;n instanceof HTMLFormElement&&e.publishDomEvent("form_submitted",{element:{...st(n,pt),elements:Array.from(n.elements).filter((e=>at.some((t=>e instanceof t)))).map((e=>lt(e)))}})}),t)}(e,t)}class mt extends Set{constructor(e,t){if(super(),this.maxSize=void 0,this.keep=void 0,Number.isFinite(e)&&!Number.isInteger(e)||e<=0)throw new Error("Invalid maxSize specified");this.maxSize=e,this.keep=t}push(e){if("oldest"===this.keep)this.sizethis.maxSize))for(const t of this)if(this.delete(t),this.size<=this.maxSize)break;return this}}const ht=(e,t,n)=>!0;class bt{constructor({bufferSize:e=50,replayKeep:t="oldest",subscribeAllKey:n,eligibility:o}={}){this.channelSubscribers=new Map,this.replayQueue=void 0,this.bufferSize=void 0,this.replayKeep=void 0,this.subscribeAllKey=void 0,this.eligibility=void 0,this.bufferSize=e,this.replayKeep=t,this.subscribeAllKey=n,this.replayQueue=new mt(e,t),this.eligibility=null!=o?o:ht}publish(e,t,n={}){var o;if(this.subscribeAllKey&&e===this.subscribeAllKey)throw new Error(`Cannot publish to ${String(e)}`);this.replayQueue.push({name:e,payload:t,options:n});const r=(o,r)=>{this.eligibility(n,o,e)&&r.call({},{...t})};var i;return null==(o=this.channelSubscribers.get(e))||o.forEach(r),this.subscribeAllKey&&(null==(i=this.channelSubscribers.get(this.subscribeAllKey))||i.forEach(r)),!0}subscribe(e,t,n={}){const o=this.channelSubscribers.get(e)||new Map;return this.channelSubscribers.set(e,o.set(t,n)),this.replayQueue.forEach((({name:o,payload:r,options:i})=>{(e===o||this.subscribeAllKey&&e===this.subscribeAllKey)&&this.eligibility(i,n,o)&&t.call({},{...r})})),()=>o.delete(t)}}let wt=function(e){return e.Custom="custom",e.Dom="dom",e.Standard="standard",e}({}),vt=function(e){return e.Meta="meta",e}({});const gt={all_events:vt.Meta,all_standard_events:vt.Meta,all_custom_events:vt.Meta,all_dom_events:vt.Meta,checkout_address_info_submitted:wt.Standard,checkout_completed:wt.Standard,checkout_started:wt.Standard,payment_info_submitted:wt.Standard,collection_viewed:wt.Standard,checkout_contact_info_submitted:wt.Standard,page_viewed:wt.Standard,product_added_to_cart:wt.Standard,product_removed_from_cart:wt.Standard,product_viewed:wt.Standard,product_variant_viewed:wt.Standard,search_submitted:wt.Standard,cart_viewed:wt.Standard,checkout_shipping_info_submitted:wt.Standard,input_changed:wt.Dom,input_blurred:wt.Dom,input_focused:wt.Dom,form_submitted:wt.Dom,clicked:wt.Dom,custom_event:wt.Custom};function yt(e){var t;return function(e){return e in gt}(e)&&null!=(t=gt[e])?t:wt.Custom}function xt(e){return yt(e)===wt.Standard}function Et(e){return yt(e)===wt.Dom}function _t(){return/checkouts\/(.+)\/(thank_you|thank-you|post_purchase)$/.test(self.location.pathname)}let kt=function(e){return e.Shopify="shopify",e.StorefrontRenderer="storefront-renderer",e.CheckoutOne="checkout-one",e.CheckoutOneSdk="checkout-one-sdk",e.Unknown="unknown",e}({}),St=function(e){return e.WebPixelExtension="web-pixel-extension",e.CheckoutOneSdk="checkout-one-sdk",e.Unknown="unknown",e}({});const Ct={string:"[object String]",number:"[object Number]",boolean:"[object Boolean]",undefined:"[object Undefined]",null:"[object Null]",object:"[object Object]"},At=[Ct.string,Ct.number,Ct.boolean,Ct.undefined,Ct.null];function It(e){let t=null,n=null;function o(e){return Object.prototype.toString.call(e)===Ct.object}return void 0===e||o(e)?{isValid:function e(r,i){if(Array.isArray(r))return r.every((t=>e(t,i)));if(o(r))return Object.keys(r).every((t=>e(r[t],t)));const s=At.includes(Object.prototype.toString.call(r));return s||(n=i,t=`Key: ${n}; ${r} must be one of the following types: ${At.join(", ")}`),s}(e,"root"),error:t,errorKey:n}:(n="root",t=`Key: ${n}; ${e} must be an object`,{isValid:!1,error:t,errorKey:n})}let Tt=function(e){return e.App="APP",e.Custom="CUSTOM",e}({}),Ot=function(e){return e.Strict="STRICT",e.Lax="LAX",e.Open="OPEN",e}({});function Nt(e){return"shopify-custom-pixel"===e.id?"shopify-pixel":e.type===Tt.Custom?"-1":e.apiClientId?`${e.apiClientId}`:void 0}function Pt(){return{document:{location:{href:window.location.href,hash:window.location.hash,host:window.location.host,hostname:window.location.hostname,origin:window.location.origin,pathname:window.location.pathname,port:window.location.port,protocol:window.location.protocol,search:window.location.search},referrer:document.referrer,characterSet:document.characterSet,title:document.title},navigator:{language:navigator.language,cookieEnabled:navigator.cookieEnabled,languages:navigator.languages,userAgent:navigator.userAgent},window:{innerHeight:window.innerHeight,innerWidth:window.innerWidth,outerHeight:window.outerHeight,outerWidth:window.outerWidth,pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,location:{href:window.location.href,hash:window.location.hash,host:window.location.host,hostname:window.location.hostname,origin:window.location.origin,pathname:window.location.pathname,port:window.location.port,protocol:window.location.protocol,search:window.location.search},origin:window.origin,screen:{height:window.screen.height,width:window.screen.width},screenX:window.screenX,screenY:window.screenY,scrollX:window.scrollX,scrollY:window.scrollY}}}const Rt=e=>{var t;return{...e,clientId:null!=(t=fe(document.cookie)._shopify_y)?t:"",timestamp:(new Date).toISOString(),context:Pt(),id:"string"==typeof e.id&&e.id.length>0?e.id:nt()}};const Lt=(e,t,n)=>{const{pixelRuntimeConfig:o}=t||{},{apiClientId:r,restrictions:i}=o||{},{allowedEvents:s,disallowedEvents:a}=i||{},{sendTo:c}=e||{},l=c&&String(c)===String(r),u=c&&!l,d=!s||s.includes(n),p=a&&a.includes(n);return Boolean(d&&!p&&!u||l)},Dt="all_standard_events",Mt="all_custom_events",$t="all_dom_events";class jt extends Error{constructor(e){super(e),this.name="PublishDomEventError"}}function Ut(e){const t=new bt({bufferSize:Number.POSITIVE_INFINITY,subscribeAllKey:Dt,eligibility:Lt}),n=new bt({bufferSize:1e3,subscribeAllKey:Mt,eligibility:Lt}),i=new bt({bufferSize:1e3,replayKeep:"newest",subscribeAllKey:$t,eligibility:Lt});e.initData;let s=!1;return{publish(n,i,c){var l,u,d,p,f;if("string"!=typeof n)throw new Error("Expected event name to be a string, but got "+typeof n);if(!xt(n))return!1;if("checkout_completed"===n&&_t()&&-1!==document.cookie.indexOf(`${a}=1`))return!1;const m=It(i);if(!m.isValid)return console.error(m.error),!1;const h=function(e,t,n){let o;const r={analyticsFramework:"wpm"};try{var i,s;"product_added_to_cart"===e&&"cartLine"in n&&(r.cacheKey=function({cartLine:e}={cartLine:null}){const t=null==e?void 0:e.merchandise.product.id,n=null==e?void 0:e.merchandise.id;if(t&&n)return`${t}-${n}`}(n)),o=null==(i=window.Shopify)||null==(s=i.evids)?void 0:s.call(i,e,r)}catch{}return Rt({id:o,name:e,data:n,type:wt.Standard})}(n,0,i),b=null==(l=h.data)||null==(u=l.checkout)?void 0:u.token;return Be("eventPublish",{version:o,bundleTarget:r,pageUrl:self.location.href,shopId:e.shopId,surface:e.surface||kt.Unknown,eventName:h.name,eventType:"standard",extensionId:null==c||null==(d=c.extension)?void 0:d.extensionId,extensionAppId:null==c||null==(p=c.extension)?void 0:p.appId,extensionType:null==c||null==(f=c.extension)?void 0:f.type,userCanBeTracked:ee().toString(),shopPrefs:"unknown",eventId:h.id,checkoutToken:b,serverEventId:null==c?void 0:c.eventId}),function(e){"checkout_completed"===e&&function(){if(_t()){const e=self.location.pathname.split("/").slice(0,-1).join("/"),t=new Date;t.setMonth(t.getMonth()+2),document.cookie=`${a}=1; expires=${t}; path=${e}`}}()}(n),s||(s=!0,w=e.shopId,v=e.surface||kt.Unknown,Ge.add((()=>function(e,t){Fe||(Fe=!0,Be("consentAccepted",{version:o,bundleTarget:r,shopId:e,surface:t,shopPrefs:"unknown"}))}(w,v)))),t.publish(n,h);var w,v},publishCustomEvent(t,i,s){var a,c,l;if("string"!=typeof t)throw new Error("Expected event name to be a string, but got "+typeof t);if(!function(e){return yt(e)===wt.Custom}(t))return!1;const u=It(i);if(!u.isValid)return console.error(u.error),!1;const d=function(e,t,n=null){return Rt({name:e,customData:n,type:wt.Custom})}(t,0,i);return Be("eventPublish",{version:o,bundleTarget:r,pageUrl:self.location.href,shopId:e.shopId,surface:e.surface||kt.Unknown,eventName:d.name,eventType:"custom",extensionId:null==s||null==(a=s.extension)?void 0:a.extensionId,extensionAppId:null==s||null==(c=s.extension)?void 0:c.appId,extensionType:null==s||null==(l=s.extension)?void 0:l.type,eventId:d.id}),n.publish(t,d,s)},publishDomEvent(e,t,n){if("string"!=typeof e){const t=JSON.stringify(e);throw new jt(`Expected event name "${t}" to be a string, but got ${typeof e}`)}if(!Et(e))throw new jt(`Event name "${e}" is not a supported DOM Event`);const o=It(t);if(!o.isValid)throw new jt(`Input Validation Error: ${o.error}`);const r=function(e,t){return Rt({name:e,data:t,type:wt.Dom})}(e,t);return i.publish(e,r)},subscribe(s,a,c={}){const l=t=>{var n,i,s,l,u,d,p,f;if(e.surface===kt.CheckoutOneSdk&&c.scope!==St.CheckoutOneSdk)return;const m={configuration:null==(n=c.pixelRuntimeConfig)?void 0:n.configuration,eventPayloadVersion:c.schemaVersion||(null==(i=c.pixelRuntimeConfig)?void 0:i.eventPayloadVersion)||"unknown",id:(null==(s=c.pixelRuntimeConfig)?void 0:s.id)||"unknown",type:(null==(l=c.pixelRuntimeConfig)?void 0:l.type)||"unknown",runtimeContext:(null==(u=c.pixelRuntimeConfig)?void 0:u.runtimeContext)||"unknown",restrictions:null==(d=c.pixelRuntimeConfig)?void 0:d.restrictions,scriptVersion:(null==(p=c.pixelRuntimeConfig)?void 0:p.scriptVersion)||"unknown",apiClientId:null==(f=c.pixelRuntimeConfig)?void 0:f.apiClientId};a.call(t,t);const h=yt(t.name),b={version:o,bundleTarget:r,pageUrl:self.location.href,shopId:c.shopId,surface:c.surface,pixelId:m.id,pixelAppId:Nt(m),pixelSource:m.type,pixelRuntimeContext:m.runtimeContext,pixelScriptVersion:m.scriptVersion,pixelConfiguration:m.configuration,pixelEventSchemaVersion:m.eventPayloadVersion,eventName:t.name,eventId:t.id};if(h!==wt.Dom){let e;var w,v;xt(t.name)&&(e=null==t||null==(w=t.data)||null==(v=w.checkout)?void 0:v.token),Be("subscriberEventEmit",{...b,eventType:h,checkoutToken:e})}else me(1)&&Be("subscriberEventEmitDom",b)};if("all_events"===s){const e=t.subscribe(Dt,l,c),o=n.subscribe(Mt,l,c),r=i.subscribe($t,l,c);return()=>{const t=e(),n=o(),i=r();return t&&n&&i}}return s===Mt?n.subscribe(Mt,l,c):s===Dt||xt(s)?t.subscribe(s,l,c):s===$t||Et(s)?i.subscribe(s,l,c):n.subscribe(s,l,c)}}}const Vt=["31014027265","28638674945","44186959873"];const Bt=Symbol.for("RemoteUi::Retain"),zt=Symbol.for("RemoteUi::Release"),qt=Symbol.for("RemoteUi::RetainedBy");class Ft{constructor(){this.memoryManaged=new Set}add(e){this.memoryManaged.add(e),e[qt].add(this),e[Bt]()}release(){for(const e of this.memoryManaged)e[qt].delete(this),e[zt]();this.memoryManaged.clear()}}function Ht(e){return Boolean(e&&e[Bt]&&e[zt])}function Kt(e,{deep:t=!0}={}){return Wt(e,t,new Map)}function Wt(e,t,n){const o=n.get(e);if(null!=o)return o;const r=Ht(e);if(r&&e[Bt](),n.set(e,r),t){if(Array.isArray(e)){const o=e.reduce(((e,o)=>Wt(o,t,n)||e),r);return n.set(e,o),o}if(Xt(e)){const o=Object.keys(e).reduce(((o,r)=>Wt(e[r],t,n)||o),r);return n.set(e,o),o}}return n.set(e,r),r}function Xt(e){if(null==e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}const Gt="_@f";function Yt(e){const t=new Map,n=new Map,o=new Map;return{encode:function o(r,i=new Map){if(null==r)return[r];const s=i.get(r);if(s)return s;if("object"==typeof r){if(Array.isArray(r)){i.set(r,[void 0]);const e=[],t=[r.map((t=>{const[n,r=[]]=o(t,i);return e.push(...r),n})),e];return i.set(r,t),t}if(Xt(r)){i.set(r,[void 0]);const e=[],t=[Object.keys(r).reduce(((t,n)=>{const[s,a=[]]=o(r[n],i);return e.push(...a),{...t,[n]:s}}),{}),e];return i.set(r,t),t}}if("function"==typeof r){if(t.has(r)){const e=t.get(r),n=[{[Gt]:e}];return i.set(r,n),n}const o=e.uuid();t.set(r,o),n.set(o,r);const s=[{[Gt]:o}];return i.set(r,s),s}const a=[r];return i.set(r,a),a},decode:r,async call(e,t){const o=new Ft,i=n.get(e);if(null==i)throw new Error("You attempted to call a function that was already released.");try{const e=Ht(i)?[o,...i[qt]]:[o];return await i(...r(t,e))}finally{o.release()}},release(e){const o=n.get(e);o&&(n.delete(e),t.delete(o))},terminate(){t.clear(),n.clear(),o.clear()}};function r(t,n){if("object"==typeof t){if(null==t)return t;if(t instanceof ArrayBuffer)return t;if(Array.isArray(t))return t.map((e=>r(e,n)));if(Gt in t){const r=t[Gt];if(o.has(r))return o.get(r);let i=0,s=!1;const a=()=>{i-=1,0===i&&(s=!0,o.delete(r),e.release(r))},c=()=>{i+=1},l=new Set(n),u=(...t)=>{if(s)throw new Error("You attempted to call a function that was already released.");if(!o.has(r))throw new Error("You attempted to call a function that was already revoked.");return e.call(r,t)};Object.defineProperties(u,{[zt]:{value:a,writable:!1},[Bt]:{value:c,writable:!1},[qt]:{value:l,writable:!1}});for(const e of l)e.add(u);return o.set(r,u),u}return Object.keys(t).reduce(((e,o)=>({...e,[o]:r(t[o],n)})),{})}return t}}const Jt=0,Zt=1,Qt=2,en=3,tn=5,nn=6;function on(){return`${rn()}-${rn()}-${rn()}-${rn()}`}function rn(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}const sn=new Map;function an(){var e,t;const n=(null==(e=self)||null==(t=e.location)?void 0:t.hostname)||"",o=sn.get(n);if(o)return o;const r=n.split("."),i=[];return r.reverse().reduce(((e,t)=>{const n=""===e?t:`${t}.${e}`;return function(e){document.cookie=`wpm-domain-test=1; path=/; domain=${e}`}(n),document.cookie.split(";").find((e=>e.includes("wpm-domain-test")))||i.push(n),function(e){document.cookie=`wpm-domain-test=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=${e}`}(n),n}),""),sn.set(n,i),i}let cn,ln;function un(){if(void 0!==cn)return cn;try{return window.localStorage.setItem("local-storage-test","test"),window.localStorage.removeItem("local-storage-test"),cn=!0,!0}catch(e){return cn=!1,!1}}function dn(){if(void 0!==ln)return ln;try{return window.sessionStorage.setItem("session-storage-test","test"),window.sessionStorage.removeItem("session-storage-test"),ln=!0,!0}catch(e){return ln=!1,!1}}function pn({eventBus:e,webPixelConfig:t,shopId:n,surface:o,initData:r,forRPC:i=!1}){let s={};try{s=t.configuration?JSON.parse(t.configuration):{}}catch(m){}return{analytics:{subscribe:(r,s,a)=>(i&&Kt(s),e.subscribe(r,s,{...a,pixelRuntimeConfig:t,shopId:n,surface:o,scope:St.WebPixelExtension}))},browser:{cookie:{get:async e=>{if(!e)return document.cookie;let t="";const n=document.cookie.split("; ");for(const o of n){const[n,r=""]=o.split("=");if(n===e){t=r;break}}return t},set:async(e,t)=>{if(t){const n=`${e}=${t}`;document.cookie=n}else document.cookie=e;return document.cookie}},sendBeacon:async(e,t="")=>{if(e.includes(self.location.origin)&&!e.match(/\/\.well-known\/shopify\/monorail\/unstable\/produce_batch/))return!1;const n=new window.Blob([t],{type:"text/plain"});return window.navigator.sendBeacon(e,n)},localStorage:{setItem:async(e,t)=>un()?window.localStorage.setItem(e,t):Promise.resolve(),getItem:async e=>un()?window.localStorage.getItem(e):Promise.resolve(null),key:async e=>un()?window.localStorage.key(e):Promise.resolve(null),removeItem:async e=>un()?window.localStorage.removeItem(e):Promise.resolve(),clear:async()=>un()?window.localStorage.clear():Promise.resolve(),length:async()=>un()?window.localStorage.length:Promise.resolve(0)},sessionStorage:{setItem:async(e,t)=>dn()?window.sessionStorage.setItem(e,t):Promise.resolve(),getItem:async e=>dn()?window.sessionStorage.getItem(e):Promise.resolve(null),key:async e=>dn()?window.sessionStorage.key(e):Promise.resolve(null),removeItem:async e=>dn()?window.sessionStorage.removeItem(e):Promise.resolve(),clear:async()=>dn()?window.sessionStorage.clear():Promise.resolve(),length:async()=>dn()?window.sessionStorage.length:Promise.resolve(0)}},settings:s,init:(a=r,{context:Pt(),data:{customer:(f=null==a?void 0:a.customer,f?{email:f.email,firstName:f.firstName,id:f.id,lastName:f.lastName,phone:f.phone,ordersCount:f.ordersCount}:null),cart:(c=null==a?void 0:a.cart,c?{id:null==c?void 0:c.id,cost:{totalAmount:{amount:null==c||null==(l=c.cost)||null==(u=l.totalAmount)?void 0:u.amount,currencyCode:null==c||null==(d=c.cost)||null==(p=d.totalAmount)?void 0:p.currencyCode}},lines:null==c?void 0:c.lines,totalQuantity:null==c?void 0:c.totalQuantity}:null)}}),_pixelInfo:{...t,surface:o}};var a,c,l,u,d,p,f}const fn="remote-ui::ready";async function mn({sandboxId:e,webPixelConfig:t,storefrontBaseUrl:n}){const{search:o}=self.location,s=t.id,a=[ke(n),"/wpm",`@${i}`,`/web-pixel-${s}`,`@${t.scriptVersion}`,"/sandbox",`/${r}`,/\.(js|json|xml)$/.test(self.location.pathname)?"":self.location.pathname,o];if(n.match(/spin\.dev\/?/)){const e=o.length?"&":"?";a.push(`${o}${e}fast_storefront_renderer=1`)}return function(e,{terminate:t=!0,targetOrigin:n="*"}={}){var o;if("undefined"==typeof window)throw new Error("You can only run fromIframe() in a browser context, but no window was found.");const r=new WeakMap;let i;function s(t){t.source===e.contentWindow&&t.data===fn&&(window.removeEventListener("message",s),i())}null===(o=e.contentWindow)||void 0===o||o.postMessage(fn,n);const a=new Promise((e=>{i=e,window.addEventListener("message",s)}));return{async postMessage(t,o){var r;await a,null===(r=e.contentWindow)||void 0===r||r.postMessage(t,n,o)},addEventListener(t,n){const o=t=>{t.source===e.contentWindow&&n(t)};r.set(n,o),self.addEventListener(t,o)},removeEventListener(e,t){const n=r.get(t);null!=n&&(r.delete(t),self.removeEventListener(e,n))},terminate(){window.removeEventListener("message",s),t&&e.remove()}}}(await async function({id:e,src:t,privileges:n}){const o=document.querySelector(`iframe#${e}`);if(o&&"IFRAME"===o.tagName)return o;const r=document.createElement("iframe");if(!t){const e=new ge("src or srcdoc must be provided");throw Ee.notify(e,{context:"v0/createIframe",unhandled:!1,severity:"warning"}),e}if(r.setAttribute("src",t),r.setAttribute("id",e),r.setAttribute("name",e),r.setAttribute("sandbox",n.join(" ")),r.setAttribute("tabIndex","-1"),r.setAttribute("aria-hidden","true"),!function(e){return"sandbox"in e}(r)){const e=new ge("browser does not support the sandbox attribute on IFrames");throw Ee.notify(e,{context:"v0/createIframe",unhandled:!1,severity:"warning"}),e}return r.setAttribute("style","display:none; height:0; width:0; visibility: hidden;"),await function(e){return new Promise(((t,n)=>{const o=()=>{try{let n=document.querySelector("#WebPixelsManagerSandboxContainer");null==n&&(n=document.createElement("div"),n.setAttribute("id","WebPixelsManagerSandboxContainer"),document.body.appendChild(n)),document.querySelector(`#${e.id}`)||n.appendChild(e),t(e)}catch(o){n(o)}};if(document.body)o();else{const e=()=>{"loading"!==document.readyState&&(o(),document.removeEventListener("readystatechange",e))};document.addEventListener("readystatechange",e)}}))}(r),r}({id:e,src:a.join(""),privileges:["allow-scripts","allow-forms"]}))}let hn;const bn=()=>(hn||(hn={localStorageItems:{...self.localStorage},sessionStorageItems:{...self.sessionStorage}}),hn);class wn extends Error{constructor(...e){super(...e),this.name="SandboxAlreadyCreatedError",this.message="Sandbox already created."}}async function vn({webPixelConfig:e,eventBus:t,shopId:n,storefrontBaseUrl:o,surface:s,initData:a}){const c=`web-pixel-sandbox-${e.type}-${e.id}-${e.runtimeContext}-${i}`;if(e.runtimeContext===Ot.Lax&&document.getElementById(c)){const t=new wn;return Ee.notify(t,{pixelId:e.id,pixelType:e.type,runtimeContext:e.runtimeContext,shopId:n,context:"v0/createWebPixelSandbox/alreadyCreatedError",userAgent:self.navigator.userAgent,hashVersionSandbox:i,sandboxUrl:self.location.href||"unknown",options:{sampleRate:15}}),!1}let l,u;switch(e.runtimeContext){case Ot.Strict:[l,u]=await async function({sandboxId:e,webPixelConfig:t,storefrontBaseUrl:n}){const o=t.id,s=[ke(n),"/wpm",`@${i}`,`/web-pixel-${o}`,`@${t.scriptVersion}`,"/sandbox",`/worker.${r}.js`];n.match(/spin\.dev\/?/)&&s.push("?fast_storefront_renderer=1");const a=s.join(""),c=new Worker(a,{name:e,type:"classic",credentials:"omit"}),l=new Promise(((e,t)=>{const n=()=>{c.removeEventListener("error",n),t(new Error(`Failed to load web worker for pixel ${o} with url ${a}}`))};c.addEventListener("error",n)}));return[c,l]}({sandboxId:c,webPixelConfig:e,storefrontBaseUrl:o});break;case Ot.Lax:l=await mn({sandboxId:c,webPixelConfig:e,storefrontBaseUrl:o});break;default:throw new Error(`Unsupported runtime context: ${e.runtimeContext}`)}const d=function(e,{uuid:t=on,createEncoder:n=Yt,callable:o}={}){let r=!1,i=e;const s=new Map,a=new Map,c=function(e,t){let n;if(null==t){if("function"!=typeof Proxy)throw new Error("You must pass an array of callable methods in environments without Proxies.");const t=new Map;n=new Proxy({},{get(n,o){if(t.has(o))return t.get(o);const r=e(o);return t.set(o,r),r}})}else{n={};for(const o of t)Object.defineProperty(n,o,{value:e(o),writable:!1,configurable:!0,enumerable:!0})}return n}(p,o),l=n({uuid:t,release(e){u(en,[e])},call(e,n,o){const r=t(),i=f(r,o),[s,a]=l.encode(n);return u(tn,[r,e,s],a),i}});return i.addEventListener("message",d),{call:c,replace(e){const t=i;i=e,t.removeEventListener("message",d),e.addEventListener("message",d)},expose(e){for(const t of Object.keys(e)){const n=e[t];"function"==typeof n?s.set(t,n):s.delete(t)}},callable(...e){if(null!=o)for(const t of e)Object.defineProperty(c,t,{value:p(t),writable:!1,configurable:!0,enumerable:!0})},terminate(){u(Qt,void 0),m(),i.terminate&&i.terminate()}};function u(e,t,n){r||i.postMessage(t?[e,t]:[e],n)}async function d(e){const{data:t}=e;if(null!=t&&Array.isArray(t))switch(t[0]){case Qt:m();break;case Jt:{const e=new Ft,[o,r,i]=t[1],a=s.get(r);try{if(null==a)throw new Error(`No '${r}' method is exposed on this endpoint`);const[t,n]=l.encode(await a(...l.decode(i,[e])));u(Zt,[o,void 0,t],n)}catch(n){const{name:e,message:t,stack:r}=n;throw u(Zt,[o,{name:e,message:t,stack:r}]),n}finally{e.release()}break}case Zt:{const[e]=t[1];a.get(e)(...t[1]),a.delete(e);break}case en:{const[e]=t[1];l.release(e);break}case nn:{const[e]=t[1];a.get(e)(...t[1]),a.delete(e);break}case tn:{const[e,o,r]=t[1];try{const t=await l.call(o,r),[n,i]=l.encode(t);u(nn,[e,void 0,n],i)}catch(n){const{name:t,message:o,stack:r}=n;throw u(nn,[e,{name:t,message:o,stack:r}]),n}break}}}function p(e){return(...n)=>{if(r)return Promise.reject(new Error("You attempted to call a function on a terminated web worker."));if("string"!=typeof e&&"number"!=typeof e)return Promise.reject(new Error(`Can’t call a symbol method on a remote endpoint: ${e.toString()}`));const o=t(),i=f(o),[s,a]=l.encode(n);return u(Jt,[o,e,s],a),i}}function f(e,t){return new Promise(((n,o)=>{a.set(e,((e,r,i)=>{if(null==r)n(i&&l.decode(i,t));else{const e=new Error;Object.assign(e,r),o(e)}}))}))}function m(){var e;r=!0,s.clear(),a.clear(),null===(e=l.terminate)||void 0===e||e.call(l),i.removeEventListener("message",d)}}(l,{callable:["initialize"]}),p=pn({eventBus:t,webPixelConfig:e,shopId:n,surface:s,initData:a,forRPC:!0}),f={self:{origin:{get:async()=>self.origin}},document:{referrer:{get:async()=>document.referrer}}},m=Pt();let h={status:"unknown",hashVersion:"unknown",sandboxUrl:"unknown"};const b=e.runtimeContext===Ot.Lax?bn():{localStorageItems:{},sessionStorageItems:{}};try{const t=[d.call.initialize({pageTitle:self.document.title,webPixelConfig:e,shopId:n,webPixelApi:p,internalApi:f,cookie:self.document.cookie,cookieRestrictedDomains:an(),origin:self.origin,referrer:self.document.referrer,...b}).then((e=>{h=e}))];u&&t.push(u),await Promise.race(t)}catch(w){return!1}if(i!==h.hashVersion){const t=new Error(`The main bundle hash (${i}) does not match the sandbox hash (${h.hashVersion})`);Ee.notify(t,{severity:"warning",pixelId:e.id,pixelType:e.type,runtimeContext:e.runtimeContext,context:"v0/createSandbox/hashMismatch",shopId:n,userAgent:m.navigator.userAgent||self.navigator.userAgent,hashVersionSandbox:h.hashVersion,sandboxUrl:h.sandboxUrl})}return!0}const gn=()=>{let e,t;return{promise:new Promise(((...n)=>{[e,t]=n})),resolve:e,reject:t}};class yn extends Error{constructor(...e){super(...e),this.name="InvalidExtensionPointError",this.message="Invalid Extension Point"}}class xn extends Error{constructor(...e){super(...e),this.name="PixelError"}}const En=new Map;async function _n(t){var n;let s=!1;const{webPixelConfig:a,eventBus:l,shopId:u,surface:d}=t,p=a.id,f=a.type.toLowerCase();if(a.runtimeContext===Ot.Open&&!pe("5de24938"))return!1;var m,h;switch(a.restrictions||(a.restrictions=function(e,t){if(!e)return{};const n=function(e){return Vt.includes(String(e))}(e),o=t!==kt.StorefrontRenderer;return n&&o?{allowedEvents:[],preventLoadingBeforeEvent:`shopify:app:pixels:load:${e}`}:n?{allowedEvents:[]}:{}}(String(a.apiClientId),d)),await Promise.all([Xe(We(a.privacyPurposes)),(m=(e,t)=>l.subscribe(e,t,{pixelRuntimeConfig:{apiClientId:"PIXEL-LOADER"}}),h=null==(n=a.restrictions)?void 0:n.preventLoadingBeforeEvent,new Promise(((e,t)=>{void 0===h?e(!0):m(h,(()=>{e(!0)}))})))]),Ie("pixel:register","start",{pixelId:p,source:f}),a.runtimeContext){case Ot.Lax:case Ot.Strict:s=await vn(t);break;case Ot.Open:try{s=await async function({webPixelConfig:t,eventBus:n,shopId:o,storefrontBaseUrl:s,surface:a,initData:l}){var u;const{promise:d,resolve:p,reject:f}=gn(),{id:m,type:h}=t,b=`${m}-${h}`.toLowerCase();En.set(b,(()=>({webPixelApi:pn({eventBus:n,webPixelConfig:t,shopId:o,surface:a,initData:l,forRPC:!0}),resolve:p,reject:f})));const w=s.match(/spin\.dev\/?/),v=[ke(s),`/wpm@${i}`,`/${t.type.toLocaleLowerCase()}`,`/web-pixel-${m}@${t.scriptVersion}`,`/pixel.${r}.js`,w?"?fast_storefront_renderer=1":""].join("");if(!("createShopifyExtend"in(null!=(u=self[e])?u:{}))){const t=(e,t)=>{const n=En.get(`${e}-${t}`.toLowerCase());if(!n)return f(new Error(`No openPixelFn found for ${e}-${t}.`)),null;const{resolve:o,reject:r,webPixelApi:i}=n();return i||r(new Error(`No api found for pixel ${e}-${t}.`)),Object.freeze({extend:(e,t)=>{e!==c&&r(new yn);try{t.call(i,i),o(!0)}catch(n){r(new xn(n))}}})};Object.defineProperty(self,e,{value:{},enumerable:!0,writable:!1,configurable:!1}),Object.defineProperty(self[e],"createShopifyExtend",{value:t,enumerable:!0,writable:!1,configurable:!1})}var g;return await(g=v,new Promise(((e,t)=>{try{const n=document.createElement("script");n.src=g,n.async=!0,n.onload=()=>{e()},n.onerror=()=>{o(),t(new Error(`Failed to load script: ${g}`))};const o=()=>{n.onload=null,n.onerror=null,n.remove()};document.head.appendChild(n)}catch(n){t(n)}}))),d}(t)}catch(v){s=!1}break;default:throw new Error(`Invalid runtimeContext: ${a.runtimeContext}`)}const b=Nt(a),{measurement:w}=Ae("pixel:register",{pixelId:p,source:f});return Be("register",{version:o,pageUrl:self.location.href,shopId:u,surface:d,pixelId:p,pixelAppId:b,pixelSource:a.type,pixelRuntimeContext:a.runtimeContext,pixelScriptVersion:a.scriptVersion,pixelConfiguration:null==a?void 0:a.configuration,pixelEventSchemaVersion:a.eventPayloadVersion,status:"registered",userCanBeTracked:ee().toString(),shopPrefs:"unknown",bundleTarget:r,errorMsg:"N/A",duration:null==w?void 0:w.duration,startTime:null==w?void 0:w.startTime,sessionId:rt()}),s}const kn=function(){const e=null!=(t=self.Shopify)&&t.Checkout?kt.Shopify:null!=(n=self.Shopify)&&null!=(i=n.analytics)&&i.replayQueue?kt.StorefrontRenderer:kt.CheckoutOne;var t,n,i;const s=self.location.href,a=Pe("load",{version:o,bundleTarget:r,pageUrl:s,status:"loading",surface:e}),c={publish:()=>!1,publishCustomEvent:()=>!1,publishDomEvent:()=>!1,visitor:()=>!1,subscribe:()=>()=>!1};try{const e=rt();return a.payload.status="loaded",Ve(a),{init(t){if(null!==self.location.href.match(/\/wpm@(.+)\/sandbox/))return c;const{shopId:n,surface:i=kt.Unknown,initData:a,enabledBetaFlags:l}=t;let{webPixelsConfigList:u}=t||{};ue();const d=self.location.origin;Le(d),function(e=[]){(Array.isArray(e)?e:[e]).forEach((e=>de.add(e)))}(l);const p=ee().toString(),f=Pe("unload",{version:o,bundleTarget:r,pageUrl:s,shopId:n,surface:i,isCompleted:"false",runtimeErrorCaught:"false",userCanBeTracked:p,sessionId:e});var m;m=f,window.addEventListener("pagehide",(()=>{var e,t;m.payload.pageDuration=null==(e=Ae("page:session"))||null==(t=e.measurement)?void 0:t.duration,Ve(m),ze({skipXhr:!0})}));const h=Ut(t),b={severity:"warning",context:"v0/createWebPixelsManager/init",unhandled:!1,shopId:n,initConfig:t},w=Pe("init",{version:o,bundleTarget:r,pageUrl:s,shopId:n,surface:i,status:"initializing",userCanBeTracked:p});try{var v,g;if(self.Shopify&&!0===self.Shopify.designMode)return self.console&&console.log("[WebPixelsManager] Prevented from executing in the Theme Editor"),c;if(/^web-pixel-sandbox/.test(self.name)){const e=new ge("WebPixelsManager: browser library is being run in a sandbox");throw b.library="browser",Ee.notify(e,b),e}if(!n){const e=new ge("WebPixelsManager: shopId is required");throw Ee.notify(e,b),e}if(!d){const e=new ge("WebPixelsManager: storefrontBaseUrl is required");throw Ee.notify(e,b),e}if(!function(e){try{return new URL(e),!0}catch(t){return function(e){const t=new RegExp("^(https?:\\/\\/)((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)*[a-z]{1,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return Boolean(t.test(e))}(e)}}(d)){const e=new ge(`WebPixelsManager: storefrontBaseUrl is not a valid absolute URL: ${d}`);throw Ee.notify(e,b),e}i===kt.CheckoutOneSdk&&(u=[]);const e=u.reduce(((e,t)=>{var o,r;t.type=t.type.toUpperCase(),t.runtimeContext=null==(o=t.runtimeContext)?void 0:o.toUpperCase();const s=_n({webPixelConfig:t,eventBus:h,shopId:n,storefrontBaseUrl:d,surface:i,initData:a});return null!=(r=t.restrictions)&&r.preventLoadingBeforeEvent?e.waiting.push(s):e.ready.push(s),e}),{ready:[],waiting:[]});Promise.all(e.ready).then((()=>function(e){const{measurement:t}=Ae("completed");e.payload.isCompleted="true",e.payload.runTimeDuration=null==t?void 0:t.duration,e.payload.startTime=null==t?void 0:t.startTime}(f))).catch((e=>{self.console&&console.error("[Web Pixels]",e)})),Promise.all(e.waiting).catch((()=>{})),i!==kt.CheckoutOne&&i!==kt.CheckoutOneSdk&&(A(h.publish,a),pe("d04dc9f4")&&ft(h)),w.payload.status="initialized",Ve(w);const t=(y={shopId:n,surface:i,pageUrl:s,clientId:null!=(v=fe(document.cookie)._shopify_y)?v:"",version:o,customerId:null==a||null==(g=a.customer)?void 0:g.id},{visitor:(e,t)=>function(e,t,n){const o=function(e,t){return e&&(e.email||e.phone)?null!=e&&e.email&&"string"!=typeof e.email?{valid:!1,error:"Email must be of type string"}:null!=e&&e.phone&&"string"!=typeof e.phone?{valid:!1,error:"Phone must be of type string"}:null!=t&&t.appId&&"string"!=typeof t.appId?{valid:!1,error:"appId must be of type string"}:null!=t&&t.apiClientId&&"string"!=typeof t.apiClientId?{valid:!1,error:"apiClientId must be of type string"}:{valid:!0}:{valid:!1,error:"Visitor must have one of phone or email"}}(t,n);if(!o.valid)throw new Ye(o.error||"Invalid input payload to visitorApi");const r={...e,...t,apiClientId:(null==n?void 0:n.appId)||(null==n?void 0:n.apiClientId)};return Xe({analytics:!0,marketing:!0,preferences:!1,sale_of_data:!1}).then((()=>Be("visitor",r))).catch((()=>Ee.notify("visitor error",{severity:"error",context:`v0/visitor-${e.surface}`,unhandled:!1,shopId:e.shopId}))),!0}(y,e,t)});return{publish:(e,t,n={})=>h.publish(e,t,n),publishCustomEvent:(e,t,n={})=>h.publishCustomEvent(e,t,n),publishDomEvent:(e,t,n={})=>h.publishDomEvent(e,t,n),subscribe:(e,t,o)=>h.subscribe(e,t,{...o,shopId:n,surface:i,scope:i===kt.CheckoutOneSdk?St.CheckoutOneSdk:void 0}),visitor:(e,n)=>t.visitor(e,n)}}catch(x){return x instanceof ge||Ee.notify(x,{context:"v0/init",shopId:n,initConfig:t}),self.console&&console.error(x),w.payload.status="failed",w.payload.errorMsg=null==x?void 0:x.message,Ve(w),f.payload.runtimeErrorCaught="true",c}var y}}}catch(l){return l instanceof ge||Ee.notify(l,{context:"v0/createWebPixelsManager"}),self.console&&console.error(l),a.payload.status="manager-create-error",a.payload.errorMsg=null==l?void 0:l.message,Ve(a,!0),{init:()=>c}}}();self[e]=kn})()})();