(()=>{var e={11:(e,t,r)=>{"use strict";var n=r(9058),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i("Can't set "+o(e)+" as a prototype")}},74:(e,t,r)=>{"use strict";var n=r(1399),o=r(5201),i=TypeError,s=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(o(e)&&!s(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},78:(e,t,r)=>{"use strict";var n=r(1834);e.exports=function(e,t,r){for(var o,i,s=r?e:e.iterator,a=e.next;!(o=n(a,s)).done;)if(void 0!==(i=t(o.value)))return i}},164:(e,t,r)=>{"use strict";var n=r(9544),o=r(8078),i=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||s[i]===e)}},229:(e,t,r)=>{"use strict";var n=r(543),o=r(1578),i=RangeError;e.exports=function(e,t,r,s){var a=n(e),c=o(r),u=c<0?a+c:c;if(u>=a||u<0)throw new i("Incorrect index");for(var d=new t(a),l=0;l{"use strict";var t=TypeError;e.exports=function(e){var r=e&&e.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new t("Incorrect `alphabet` option")}},352:(e,t,r)=>{"use strict";var n=r(1834),o=r(6895),i=r(960),s=r(7636),a=r(3649),c=r(3842),u=a(function(){var e=this.iterator,t=i(n(this.next,e));if(!(this.done=!!t.done))return c(e,this.mapper,[t.value,this.counter++],!0)});e.exports=function(e){return i(this),o(e),new u(s(this),{mapper:e})}},380:(e,t,r)=>{"use strict";var n=r(1399),o=r(1536),i=r(2661),s=r(960),a=r(3094),c=TypeError,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,l="enumerable",p="configurable",h="writable";t.f=n?i?function(e,t,r){if(s(e),t=a(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=d(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:l in r?r[l]:n[l],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(s(e),t=a(t),s(r),o)try{return u(e,t,r)}catch(n){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},459:(e,t,r)=>{"use strict";var n=r(3013),o=r(8280).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},482:e=>{"use strict";e.exports={}},543:(e,t,r)=>{"use strict";var n=r(1105);e.exports=function(e){return n(e.length)}},621:(e,t,r)=>{"use strict";var n=r(4202);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},654:(e,t,r)=>{"use strict";var n=r(8482),o=r(6591);e.exports=function(e){return n(o(e))}},663:(e,t,r)=>{"use strict";r(6202)},679:(e,t,r)=>{"use strict";var n=r(4202),o=r(380),i=r(4952),s=r(4980);e.exports=function(e,t,r,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:t;if(n(r)&&i(r,u,a),a.global)c?e[t]=r:s(t,r);else{try{a.unsafe?e[t]&&(c=!0):delete e[t]}catch(d){}c?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},728:(e,t,r)=>{"use strict";var n=r(6947);e.exports=n({}.isPrototypeOf)},764:(e,t,r)=>{"use strict";var n=r(1311),o=r(4202),i=r(7759),s=r(9544)("toStringTag"),a=Object,c="Arguments"===i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(r){}}(t=a(e),s))?r:c?i(t):"Object"===(n=i(t))&&o(t.callee)?"Arguments":n}},821:(e,t,r)=>{"use strict";var n=r(543);e.exports=function(e,t,r){for(var o=0,i=arguments.length>2?r:n(t),s=new e(i);i>o;)s[o]=t[o++];return s}},960:(e,t,r)=>{"use strict";var n=r(621),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not an object")}},977:(e,t,r)=>{"use strict";var n=r(9731),o=r(2307);o&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return o(this,arguments.length?arguments[0]:void 0,!0)}})},1105:(e,t,r)=>{"use strict";var n=r(1578),o=Math.min;e.exports=function(e){var t=n(e);return t>0?o(t,9007199254740991):0}},1120:(e,t,r)=>{"use strict";var n=r(6947),o=r(5201),i=r(4202),s=r(7759),a=r(8144),c=n([].push);e.exports=function(e){if(i(e))return e;if(o(e)){for(var t=e.length,r=[],n=0;n{"use strict";var n=r(8809),o=r(6212).findLast,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)})},1249:(e,t,r)=>{"use strict";var n=r(5833),o=r(9634),i=n.Set,s=n.add;e.exports=function(e){var t=new i;return o(e,function(e){s(t,e)}),t}},1256:(e,t,r)=>{"use strict";r(5873)},1311:(e,t,r)=>{"use strict";var n={};n[r(9544)("toStringTag")]="z",e.exports="[object z]"===String(n)},1381:(e,t,r)=>{"use strict";var n=r(4862),o=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=n("Set");try{(new t)[e](o(0));try{return(new t)[e](o(-1)),!1}catch(r){return!0}}catch(i){return!1}}},1399:(e,t,r)=>{"use strict";var n=r(4492);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},1482:(e,t,r)=>{"use strict";var n=r(9731),o=r(6002),i=r(6947),s=r(7477),a=r(5183),c=r(4997),u=r(323),d=c.i2c,l=c.i2cUrl,p=o.Uint8Array,h=i("".charAt);p&&n({target:"Uint8Array",proto:!0,forced:!0},{toBase64:function(){for(var e,t=a(this),r=arguments.length?s(arguments[0]):void 0,n="base64"===u(r)?d:l,o="",i=0,c=t.length,p=function(t){return h(n,e>>6*t&63)};i+2{"use strict";var n=r(1399),o=r(4492),i=r(3552);e.exports=!n&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},1548:(e,t,r)=>{"use strict";var n=r(728),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new o("Incorrect invocation")}},1554:function(e,t,r){var n;!function(o,i){"use strict";var s="function",a="undefined",c="object",u="string",d="major",l="model",p="name",h="type",f="vendor",m="version",v="architecture",g="console",y="mobile",b="tablet",w="smarttv",_="wearable",I="embedded",x="Amazon",E="Apple",k="ASUS",S="BlackBerry",T="Browser",C="Chrome",A="Firefox",P="Google",O="Huawei",R="LG",N="Microsoft",j="Motorola",M="Opera",U="Samsung",D="Sharp",$="Sony",L="Xiaomi",q="Zebra",V="Facebook",B="Chromium OS",H="Mac OS",F=function(e){for(var t={},r=0;r0?2===a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,d):this[a[0]]=a[1]:3===a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=d?d.replace(a[1],a[2]):i:this[a[0]]=d?a[1].call(this,d,a[2]):i:4===a.length&&(this[a[0]]=d?a[3].call(this,d.replace(a[1],a[2])):i):this[a]=d||i;l+=2}},J=function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n2&&(e[l]="iPad",e[h]=b),e},this.getEngine=function(){var e={};return e[p]=i,e[m]=i,Y.call(e,n,w.engine),e},this.getOS=function(){var e={};return e[p]=i,e[m]=i,Y.call(e,n,w.os),_&&!e[p]&&g&&"Unknown"!=g.platform&&(e[p]=g.platform.replace(/chrome os/i,B).replace(/macos/i,H)),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 n},this.setUA=function(e){return n=typeof e===u&&e.length>500?K(e,500):e,this},this.setUA(n),this};Q.VERSION="1.0.37",Q.BROWSER=F([p,m,d]),Q.CPU=F([v]),Q.DEVICE=F([l,f,h,g,y,w,b,_,I]),Q.ENGINE=Q.OS=F([p,m]),typeof t!==a?(e.exports&&(t=e.exports=Q),t.UAParser=Q):r.amdO?(n=function(){return Q}.call(t,r,t,e))===i||(e.exports=n):typeof o!==a&&(o.UAParser=Q);var Z=typeof o!==a&&(o.jQuery||o.Zepto);if(Z&&!Z.ua){var ee=new Q;Z.ua=ee.getResult(),Z.ua.get=function(){return ee.getUA()},Z.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var r in t)Z.ua[r]=t[r]}}}("object"==typeof window?window:this)},1576:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},1578:(e,t,r)=>{"use strict";var n=r(5912);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},1613:(e,t,r)=>{"use strict";var n=r(9731),o=r(9639);n({target:"Set",proto:!0,real:!0,forced:!r(1381)("union")},{union:o})},1639:(e,t,r)=>{"use strict";var n=r(6999),o=r(1834),i=r(960),s=r(2544),a=r(164),c=r(543),u=r(728),d=r(9580),l=r(7768),p=r(8042),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,r){var v,g,y,b,w,_,I,x=r&&r.that,E=!(!r||!r.AS_ENTRIES),k=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),T=!(!r||!r.INTERRUPTED),C=n(t,x),A=function(e){return v&&p(v,"normal",e),new f(!0,e)},P=function(e){return E?(i(e),T?C(e[0],e[1],A):C(e[0],e[1])):T?C(e,A):C(e)};if(k)v=e.iterator;else if(S)v=e;else{if(!(g=l(e)))throw new h(s(e)+" is not iterable");if(a(g)){for(y=0,b=c(e);b>y;y++)if((w=P(e[y]))&&u(m,w))return w;return new f(!1)}v=d(e,g)}for(_=k?e.next:v.next;!(I=o(_,v)).done;){try{w=P(I.value)}catch(O){p(v,"throw",O)}if("object"==typeof w&&w&&u(m,w))return w}return new f(!1)}},1649:(e,t,r)=>{"use strict";var n=r(679),o=r(6947),i=r(8144),s=r(2451),a=URLSearchParams,c=a.prototype,u=o(c.getAll),d=o(c.has),l=new a("a=1");!l.has("a",2)&&l.has("a",void 0)||n(c,"has",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return d(this,e);var n=u(this,e);s(t,1);for(var o=i(r),a=0;a{"use strict";var n=r(8575),o=r(5833).has,i=r(9151),s=r(3868),a=r(9634),c=r(78),u=r(8042);e.exports=function(e){var t=n(this),r=s(e);if(i(t)<=r.size)return!1!==a(t,function(e){if(r.includes(e))return!1},!0);var d=r.getIterator();return!1!==c(d,function(e){if(o(t,e))return u(d,"normal",!1)})}},1777:(e,t,r)=>{"use strict";var n=r(1578),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},1799:(e,t,r)=>{"use strict";var n=r(4492),o=r(4202),i=/#|\.prototype\./,s=function(e,t){var r=c[a(e)];return r===d||r!==u&&(o(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",d=s.POLYFILL="P";e.exports=s},1815:(e,t,r)=>{"use strict";var n=r(1399),o=r(380),i=r(3929);e.exports=function(e,t,r){n?o.f(e,t,i(0,r)):e[t]=r}},1834:(e,t,r)=>{"use strict";var n=r(5121),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},1884:(e,t,r)=>{"use strict";r(2561)},1994:(e,t,r)=>{"use strict";var n=r(5599),o=r(8809),i=o.aTypedArray,s=o.exportTypedArrayMethod,a=o.getTypedArrayConstructor;s("toReversed",function(){return n(i(this),a(this))})},1995:(e,t,r)=>{"use strict";var n=r(6668),o=r(4450),i=r(6710),s=r(380);e.exports=function(e,t,r){for(var a=o(t),c=s.f,u=i.f,d=0;d{"use strict";var n=r(7759),o=r(6947);e.exports=function(e){if("Function"===n(e))return o(e)}},2275:(e,t,r)=>{"use strict";var n=r(8575),o=r(5833),i=r(9151),s=r(3868),a=r(9634),c=r(78),u=o.Set,d=o.add,l=o.has;e.exports=function(e){var t=n(this),r=s(e),o=new u;return i(t)>r.size?c(r.getIterator(),function(e){l(t,e)&&d(o,e)}):a(t,function(e){r.includes(e)&&d(o,e)}),o}},2307:(e,t,r)=>{"use strict";var n=r(6002),o=r(6947),i=r(6671),s=r(9593),a=r(9611),c=r(9411),u=r(2568),d=r(4789),l=n.structuredClone,p=n.ArrayBuffer,h=n.DataView,f=n.TypeError,m=Math.min,v=p.prototype,g=h.prototype,y=o(v.slice),b=i(v,"resizable","get"),w=i(v,"maxByteLength","get"),_=o(g.getInt8),I=o(g.setInt8);e.exports=(d||u)&&function(e,t,r){var n,o=c(e),i=void 0===t?o:s(t),v=!b||!b(e);if(a(e))throw new f("ArrayBuffer is detached");if(d&&(e=l(e,{transfer:[e]}),o===i&&(r||v)))return e;if(o>=i&&(!r||v))n=y(e,0,i);else{var g=r&&!v&&w?{maxByteLength:w(e)}:void 0;n=new p(i,g);for(var x=new h(e),E=new h(n),k=m(i,o),S=0;S{"use strict";var n=r(9731),o=r(1834),i=r(6895),s=r(960),a=r(7636),c=r(3649),u=r(3842),d=r(4192),l=c(function(){for(var e,t,r=this.iterator,n=this.predicate,i=this.next;;){if(e=s(o(i,r)),this.done=!!e.done)return;if(t=e.value,u(r,n,[t,this.counter++],!0))return t}});n({target:"Iterator",proto:!0,real:!0,forced:d},{filter:function(e){return s(this),i(e),new l(a(this),{predicate:e})}})},2389:(e,t,r)=>{"use strict";var n=r(6002),o=r(7759);e.exports="process"===o(n.process)},2451:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e{"use strict";r(4204)},2544:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(r){return"Object"}}},2561:(e,t,r)=>{"use strict";var n=r(9731),o=r(6115);n({target:"Set",proto:!0,real:!0,forced:!r(1381)("symmetricDifference")},{symmetricDifference:o})},2568:(e,t,r)=>{"use strict";var n,o,i,s,a=r(6002),c=r(4235),u=r(4789),d=a.structuredClone,l=a.ArrayBuffer,p=a.MessageChannel,h=!1;if(u)h=function(e){d(e,{transfer:[e]})};else if(l)try{p||(n=c("worker_threads"))&&(p=n.MessageChannel),p&&(o=new p,i=new l(2),s=function(e){o.port1.postMessage(null,[e])},2===i.byteLength&&(s(i),0===i.byteLength&&(h=s)))}catch(f){}e.exports=h},2578:(e,t,r)=>{"use strict";var n=r(8575),o=r(5833).has,i=r(9151),s=r(3868),a=r(78),c=r(8042);e.exports=function(e){var t=n(this),r=s(e);if(i(t){"use strict";var n=r(1399),o=r(4492);e.exports=n&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},2690:(e,t,r)=>{"use strict";var n=r(6947),o=Error,i=n("".replace),s=String(new o("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,c=a.test(s);e.exports=function(e,t){if(c&&"string"==typeof e&&!o.prepareStackTrace)for(;t--;)e=i(e,a,"");return e}},2796:(e,t,r)=>{"use strict";var n=r(9731),o=r(6002),i=r(6947),s=r(5183),a=o.Uint8Array,c=i(1..toString);a&&n({target:"Uint8Array",proto:!0,forced:!0},{toHex:function(){s(this);for(var e="",t=0,r=this.length;t{"use strict";var n,o,i,s=r(2903),a=r(6002),c=r(621),u=r(6426),d=r(6668),l=r(5408),p=r(7258),h=r(482),f="Object already initialized",m=a.TypeError,v=a.WeakMap;if(s||l.state){var g=l.state||(l.state=new v);g.get=g.get,g.has=g.has,g.set=g.set,n=function(e,t){if(g.has(e))throw new m(f);return t.facade=e,g.set(e,t),t},o=function(e){return g.get(e)||{}},i=function(e){return g.has(e)}}else{var y=p("state");h[y]=!0,n=function(e,t){if(d(e,y))throw new m(f);return t.facade=e,u(e,y,t),t},o=function(e){return d(e,y)?e[y]:{}},i=function(e){return d(e,y)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}},2903:(e,t,r)=>{"use strict";var n=r(6002),o=r(4202),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},3004:(e,t,r)=>{"use strict";var n,o,i,s=r(4492),a=r(4202),c=r(621),u=r(5979),d=r(9972),l=r(679),p=r(9544),h=r(4192),f=p("iterator"),m=!1;[].keys&&("next"in(i=[].keys())?(o=d(d(i)))!==Object.prototype&&(n=o):m=!0),!c(n)||s(function(){var e={};return n[f].call(e)!==e})?n={}:h&&(n=u(n)),a(n[f])||l(n,f,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},3013:(e,t,r)=>{"use strict";var n=r(6947),o=r(6668),i=r(654),s=r(5972).indexOf,a=r(482),c=n([].push);e.exports=function(e,t){var r,n=i(e),u=0,d=[];for(r in n)!o(a,r)&&o(n,r)&&c(d,r);for(;t.length>u;)o(n,r=t[u++])&&(~s(d,r)||c(d,r));return d}},3094:(e,t,r)=>{"use strict";var n=r(5308),o=r(3578);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},3154:(e,t,r)=>{"use strict";var n=r(679),o=r(6947),i=r(8144),s=r(2451),a=URLSearchParams,c=a.prototype,u=o(c.append),d=o(c.delete),l=o(c.forEach),p=o([].push),h=new a("a=1&a=2&b=3");h.delete("a",1),h.delete("b",void 0),h+""!="a=2"&&n(c,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return d(this,e);var n=[];l(this,function(e,t){p(n,{key:t,value:e})}),s(t,1);for(var o,a=i(e),c=i(r),h=0,f=0,m=!1,v=n.length;h{"use strict";var n=r(6671),o=r(621),i=r(6591),s=r(11);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(a){}return function(r,n){return i(r),s(n),o(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},3382:(e,t,r)=>{"use strict";var n=r(4492);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},3481:(e,t,r)=>{"use strict";r(6432)},3506:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},3552:(e,t,r)=>{"use strict";var n=r(6002),o=r(621),i=n.document,s=o(i)&&o(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},3578:(e,t,r)=>{"use strict";var n=r(4862),o=r(4202),i=r(728),s=r(4455),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,a(e))}},3649:(e,t,r)=>{"use strict";var n=r(1834),o=r(5979),i=r(6426),s=r(9746),a=r(9544),c=r(2820),u=r(7751),d=r(3004).IteratorPrototype,l=r(7214),p=r(8042),h=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",v=c.set,g=function(e){var t=c.getterFor(e?m:f);return s(o(d),{next:function(){var r=t(this);if(e)return r.nextHandler();try{var n=r.done?void 0:r.nextHandler();return l(n,r.done)}catch(o){throw r.done=!0,o}},return:function(){var r=t(this),o=r.iterator;if(r.done=!0,e){var i=u(o,"return");return i?n(i,o):l(void 0,!0)}if(r.inner)try{p(r.inner.iterator,"normal")}catch(s){return p(o,"throw",s)}return p(o,"normal"),l(void 0,!0)}})},y=g(!0),b=g(!1);i(b,h,"Iterator Helper"),e.exports=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?m:f,n.nextHandler=e,n.counter=0,n.done=!1,v(this,n)};return r.prototype=t?y:b,r}},3841:(e,t,r)=>{"use strict";var n=r(8575),o=r(5833),i=r(1249),s=r(9151),a=r(3868),c=r(9634),u=r(78),d=o.has,l=o.remove;e.exports=function(e){var t=n(this),r=a(e),o=i(t);return s(t)<=r.size?c(t,function(e){r.includes(e)&&l(o,e)}):u(r.getIterator(),function(e){d(t,e)&&l(o,e)}),o}},3842:(e,t,r)=>{"use strict";var n=r(960),o=r(8042);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(s){o(e,"throw",s)}}},3868:(e,t,r)=>{"use strict";var n=r(6895),o=r(960),i=r(1834),s=r(1578),a=r(7636),c="Invalid size",u=RangeError,d=TypeError,l=Math.max,p=function(e,t){this.set=e,this.size=l(t,0),this.has=n(e.has),this.keys=n(e.keys)};p.prototype={getIterator:function(){return a(o(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){o(e);var t=+e.size;if(t!=t)throw new d(c);var r=s(t);if(r<0)throw new u(c);return new p(e,r)}},3875:(e,t,r)=>{"use strict";var n=r(6947),o=0,i=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++o+i,36)}},3912:(e,t,r)=>{"use strict";var n=r(5121),o=Function.prototype,i=o.apply,s=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(i):function(){return s.apply(i,arguments)})},3929:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},4183:(e,t,r)=>{"use strict";var n=r(6947),o=r(4202),i=r(5408),s=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),e.exports=i.inspectSource},4192:e=>{"use strict";e.exports=!1},4202:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},4204:(e,t,r)=>{"use strict";var n=r(9731),o=r(1700);n({target:"Set",proto:!0,real:!0,forced:!r(1381)("isDisjointFrom")},{isDisjointFrom:o})},4235:(e,t,r)=>{"use strict";var n=r(2389);e.exports=function(e){try{if(n)return Function('return require("'+e+'")')()}catch(t){}}},4435:(e,t,r)=>{"use strict";var n=r(8575),o=r(9151),i=r(9634),s=r(3868);e.exports=function(e){var t=n(this),r=s(e);return!(o(t)>r.size)&&!1!==i(t,function(e){if(!r.includes(e))return!1},!0)}},4450:(e,t,r)=>{"use strict";var n=r(4862),o=r(6947),i=r(459),s=r(3506),a=r(960),c=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(a(e)),r=s.f;return r?c(t,r(e)):t}},4455:(e,t,r)=>{"use strict";var n=r(9750);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},4456:(e,t,r)=>{"use strict";var n=r(5408);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},4492:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(t){return!0}}},4495:(e,t,r)=>{"use strict";var n=r(1834),o=r(960),i=r(7636),s=r(7768);e.exports=function(e,t){t&&"string"==typeof e||o(e);var r=s(e);return i(o(void 0!==r?n(r,e):e))}},4555:(e,t,r)=>{"use strict";var n=r(6947),o=r(6668),i=SyntaxError,s=parseInt,a=String.fromCharCode,c=n("".charAt),u=n("".slice),d=n(/./.exec),l={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},p=/^[\da-f]{4}$/i,h=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var r=!0,n="";t{"use strict";var n=r(1399),o=r(6668),i=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,u=a&&(!n||n&&s(i,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},4765:(e,t,r)=>{"use strict";var n=r(8809),o=r(6947),i=r(6895),s=r(821),a=n.aTypedArray,c=n.getTypedArrayConstructor,u=n.exportTypedArrayMethod,d=o(n.TypedArrayPrototype.sort);u("toSorted",function(e){void 0!==e&&i(e);var t=a(this),r=s(c(t),t);return d(r,e)})},4789:(e,t,r)=>{"use strict";var n=r(6002),o=r(4492),i=r(8963),s=r(5165),a=r(9129),c=r(2389),u=n.structuredClone;e.exports=!!u&&!o(function(){if(a&&i>92||c&&i>94||s&&i>97)return!1;var e=new ArrayBuffer(8),t=u(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength})},4827:(e,t,r)=>{"use strict";var n=r(3013),o=r(8280);e.exports=Object.keys||function(e){return n(e,o)}},4862:(e,t,r)=>{"use strict";var n=r(6002),o=r(4202);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},4952:(e,t,r)=>{"use strict";var n=r(6947),o=r(4492),i=r(4202),s=r(6668),a=r(1399),c=r(4737).CONFIGURABLE,u=r(4183),d=r(2820),l=d.enforce,p=d.get,h=String,f=Object.defineProperty,m=n("".slice),v=n("".replace),g=n([].join),y=a&&!o(function(){return 8!==f(function(){},"length",{value:8}).length}),b=String(String).split("String"),w=e.exports=function(e,t,r){"Symbol("===m(h(t),0,7)&&(t="["+v(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!s(e,"name")||c&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&s(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(o){}var n=l(e);return s(n,"source")||(n.source=g(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w(function(){return i(this)&&p(this).source||u(this)},"toString")},4980:(e,t,r)=>{"use strict";var n=r(6002),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},4997:e=>{"use strict";var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=t+"+/",n=t+"-_",o=function(e){for(var t={},r=0;r<64;r++)t[e.charAt(r)]=r;return t};e.exports={i2c:r,c2i:o(r),i2cUrl:n,c2iUrl:o(n)}},5121:(e,t,r)=>{"use strict";var n=r(4492);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},5165:(e,t,r)=>{"use strict";var n=r(9129),o=r(2389);e.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},5178:(e,t,r)=>{"use strict";var n=r(229),o=r(8809),i=r(7054),s=r(1578),a=r(9755),c=o.aTypedArray,u=o.getTypedArrayConstructor,d=o.exportTypedArrayMethod,l=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();d("with",{with:function(e,t){var r=c(this),o=s(e),d=i(r)?a(t):+t;return n(r,u(r),o,d)}}.with,!l)},5183:(e,t,r)=>{"use strict";var n=r(764),o=TypeError;e.exports=function(e){if("Uint8Array"===n(e))return e;throw new o("Argument is not an Uint8Array")}},5201:(e,t,r)=>{"use strict";var n=r(7759);e.exports=Array.isArray||function(e){return"Array"===n(e)}},5251:(e,t,r)=>{"use strict";var n=r(4952),o=r(380);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),o.f(e,t,r)}},5308:(e,t,r)=>{"use strict";var n=r(1834),o=r(621),i=r(3578),s=r(7751),a=r(5621),c=r(9544),u=TypeError,d=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,c=s(e,d);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!o(r)||i(r))return r;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},5379:(e,t,r)=>{"use strict";var n=r(6947);e.exports=n([].slice)},5408:(e,t,r)=>{"use strict";var n=r(4192),o=r(6002),i=r(4980),s="__core-js_shared__",a=e.exports=o[s]||i(s,{});(a.versions||(a.versions=[])).push({version:"3.37.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5495:(e,t,r)=>{"use strict";var n=r(8809),o=r(543),i=r(1578),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",function(e){var t=s(this),r=o(t),n=i(e),a=n>=0?n:r+n;return a<0||a>=r?void 0:t[a]})},5527:(e,t,r)=>{"use strict";var n=r(9731),o=r(3841);n({target:"Set",proto:!0,real:!0,forced:!r(1381)("difference")},{difference:o})},5599:(e,t,r)=>{"use strict";var n=r(543);e.exports=function(e,t){for(var r=n(e),o=new t(r),i=0;i{"use strict";var n=r(1834),o=r(4202),i=r(621),s=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&o(r=e.toString)&&!i(a=n(r,e)))return a;if(o(r=e.valueOf)&&!i(a=n(r,e)))return a;if("string"!==t&&o(r=e.toString)&&!i(a=n(r,e)))return a;throw new s("Can't convert object to primitive value")}},5833:(e,t,r)=>{"use strict";var n=r(6947),o=Set.prototype;e.exports={Set,add:n(o.add),has:n(o.has),remove:n(o.delete),proto:o}},5864:(e,t,r)=>{"use strict";var n=r(9731),o=r(1639),i=r(6895),s=r(960),a=r(7636);n({target:"Iterator",proto:!0,real:!0},{every:function(e){s(this),i(e);var t=a(this),r=0;return!o(t,function(t,n){if(!e(t,r++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},5873:(e,t,r)=>{"use strict";var n=r(9731),o=r(4492),i=r(2275);n({target:"Set",proto:!0,real:!0,forced:!r(1381)("intersection")||o(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:i})},5912:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},5972:(e,t,r)=>{"use strict";var n=r(654),o=r(1777),i=r(543),s=function(e){return function(t,r,s){var a=n(t),c=i(a);if(0===c)return!e&&-1;var u,d=o(s,c);if(e&&r!=r){for(;c>d;)if((u=a[d++])!=u)return!0}else for(;c>d;d++)if((e||d in a)&&a[d]===r)return e||d||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},5979:(e,t,r)=>{"use strict";var n,o=r(960),i=r(8220),s=r(8280),a=r(482),c=r(9936),u=r(3552),d=r(7258),l="prototype",p="script",h=d("IE_PROTO"),f=function(){},m=function(e){return"<"+p+">"+e+""},v=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{n=new ActiveXObject("htmlfile")}catch(i){}var e,t,r;g="undefined"!=typeof document?document.domain&&n?v(n):(t=u("iframe"),r="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):v(n);for(var o=s.length;o--;)delete g[l][s[o]];return g()};a[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[l]=o(e),r=new f,f[l]=null,r[h]=e):r=g(),void 0===t?r:i.f(r,t)}},5993:(e,t,r)=>{"use strict";var n=r(9731),o=r(4862),i=r(3912),s=r(1834),a=r(6947),c=r(4492),u=r(4202),d=r(3578),l=r(5379),p=r(1120),h=r(9750),f=String,m=o("JSON","stringify"),v=a(/./.exec),g=a("".charAt),y=a("".charCodeAt),b=a("".replace),w=a(1..toString),_=/[\uD800-\uDFFF]/g,I=/^[\uD800-\uDBFF]$/,x=/^[\uDC00-\uDFFF]$/,E=!h||c(function(){var e=o("Symbol")("stringify detection");return"[null]"!==m([e])||"{}"!==m({a:e})||"{}"!==m(Object(e))}),k=c(function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")}),S=function(e,t){var r=l(arguments),n=p(t);if(u(n)||void 0!==e&&!d(e))return r[1]=function(e,t){if(u(n)&&(t=s(n,this,f(e),t)),!d(t))return t},i(m,null,r)},T=function(e,t,r){var n=g(r,t-1),o=g(r,t+1);return v(I,e)&&!v(x,o)||v(x,e)&&!v(I,n)?"\\u"+w(y(e,0),16):e};m&&n({target:"JSON",stat:!0,arity:3,forced:E||k},{stringify:function(e,t,r){var n=l(arguments),o=i(E?S:m,null,n);return k&&"string"==typeof o?b(o,_,T):o}})},6002:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},6115:(e,t,r)=>{"use strict";var n=r(8575),o=r(5833),i=r(1249),s=r(3868),a=r(78),c=o.add,u=o.has,d=o.remove;e.exports=function(e){var t=n(this),r=s(e).getIterator(),o=i(t);return a(r,function(e){u(t,e)?d(o,e):c(o,e)}),o}},6202:(e,t,r)=>{"use strict";var n=r(9731),o=r(2578);n({target:"Set",proto:!0,real:!0,forced:!r(1381)("isSupersetOf")},{isSupersetOf:o})},6212:(e,t,r)=>{"use strict";var n=r(6999),o=r(8482),i=r(7282),s=r(543),a=function(e){var t=1===e;return function(r,a,c){for(var u,d=i(r),l=o(d),p=s(l),h=n(a,c);p-- >0;)if(h(u=l[p],p,d))switch(e){case 0:return u;case 1:return p}return t?-1:void 0}};e.exports={findLast:a(0),findLastIndex:a(1)}},6364:(e,t,r)=>{"use strict";var n=r(9731),o=r(6002),i=r(4862),s=r(3929),a=r(380).f,c=r(6668),u=r(1548),d=r(8404),l=r(9760),p=r(8505),h=r(2690),f=r(1399),m=r(4192),v="DOMException",g=i("Error"),y=i(v),b=function(){u(this,w);var e=arguments.length,t=l(e<1?void 0:arguments[0]),r=l(e<2?void 0:arguments[1],"Error"),n=new y(t,r),o=new g(t);return o.name=v,a(n,"stack",s(1,h(o.stack,1))),d(n,this,b),n},w=b.prototype=y.prototype,_="stack"in new g(v),I="stack"in new y(1,2),x=y&&f&&Object.getOwnPropertyDescriptor(o,v),E=!(!x||x.writable&&x.configurable),k=_&&!E&&!I;n({global:!0,constructor:!0,forced:m||k},{DOMException:k?b:y});var S=i(v),T=S.prototype;if(T.constructor!==S)for(var C in m||a(T,"constructor",s(1,S)),p)if(c(p,C)){var A=p[C],P=A.s;c(S,P)||a(S,P,s(6,A.c))}},6426:(e,t,r)=>{"use strict";var n=r(1399),o=r(380),i=r(3929);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},6432:(e,t,r)=>{"use strict";var n=r(1399),o=r(5251),i=r(9611),s=ArrayBuffer.prototype;n&&!("detached"in s)&&o(s,"detached",{configurable:!0,get:function(){return i(this)}})},6456:(e,t,r)=>{"use strict";r(7777)},6507:function(e,t){var r,n,o;!function(){"use strict";n=[],void 0===(o="function"==typeof(r=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],n=["columnNumber","lineNumber"],o=["fileName","functionName","source"],i=r.concat(n,o,["args"],["evalOrigin"]);function s(t){if(t)for(var r=0;r{"use strict";var n=r(7104),o=TypeError;e.exports=function(e){if(n(e))throw new o("Can't call method on "+e);return e}},6668:(e,t,r)=>{"use strict";var n=r(6947),o=r(7282),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},6671:(e,t,r)=>{"use strict";var n=r(6947),o=r(6895);e.exports=function(e,t,r){try{return n(o(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(i){}}},6710:(e,t,r)=>{"use strict";var n=r(1399),o=r(1834),i=r(8590),s=r(3929),a=r(654),c=r(3094),u=r(6668),d=r(1536),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=a(e),t=c(t),d)try{return l(e,t)}catch(r){}if(u(e,t))return s(!o(i.f,e,t),e[t])}},6718:function(e,t,r){var n,o,i;!function(){"use strict";o=[r(6507)],void 0===(i="function"==typeof(n=function(e){var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,n=/^(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(r))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(r)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;var o=this.extractLocation(n?n[1]:r),i=n&&r||void 0,s=["eval",""].indexOf(o[0])>-1?void 0:o[0];return new e({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2],source:t})},this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter(function(e){return!e.match(n)},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 r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new e({functionName:o,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 r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,s=n.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(r=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new e({functionName:s,args:a,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})},this)}}})?n.apply(t,o):n)||(e.exports=i)}()},6895:(e,t,r)=>{"use strict";var n=r(4202),o=r(2544),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not a function")}},6947:(e,t,r)=>{"use strict";var n=r(5121),o=Function.prototype,i=o.call,s=n&&o.bind.bind(i,i);e.exports=n?s:function(e){return function(){return i.apply(e,arguments)}}},6999:(e,t,r)=>{"use strict";var n=r(2265),o=r(6895),i=r(5121),s=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?s(e,t):function(){return e.apply(t,arguments)}}},7054:(e,t,r)=>{"use strict";var n=r(764);e.exports=function(e){var t=n(e);return"BigInt64Array"===t||"BigUint64Array"===t}},7104:e=>{"use strict";e.exports=function(e){return null==e}},7214:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},7258:(e,t,r)=>{"use strict";var n=r(4456),o=r(3875),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},7271:(e,t,r)=>{"use strict";var n=r(8809),o=r(6212).findLastIndex,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)})},7282:(e,t,r)=>{"use strict";var n=r(6591),o=Object;e.exports=function(e){return o(n(e))}},7477:(e,t,r)=>{"use strict";var n=r(621),o=String,i=TypeError;e.exports=function(e){if(void 0===e||n(e))return e;throw new i(o(e)+" is not an object or undefined")}},7636:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},7697:(e,t,r)=>{"use strict";var n=r(9731),o=r(7282),i=r(543),s=r(74),a=r(1576);n({target:"Array",proto:!0,arity:1,forced:r(4492)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=o(this),r=i(t),n=arguments.length;a(r+n);for(var c=0;c{"use strict";var n=r(6895),o=r(7104);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},7759:(e,t,r)=>{"use strict";var n=r(6947),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},7768:(e,t,r)=>{"use strict";var n=r(764),o=r(7751),i=r(7104),s=r(8078),a=r(9544)("iterator");e.exports=function(e){if(!i(e))return o(e,a)||o(e,"@@iterator")||s[n(e)]}},7777:(e,t,r)=>{"use strict";var n=r(9731),o=r(4435);n({target:"Set",proto:!0,real:!0,forced:!r(1381)("isSubsetOf")},{isSubsetOf:o})},7872:(e,t,r)=>{"use strict";var n=r(9731),o=r(1639),i=r(6895),s=r(960),a=r(7636);n({target:"Iterator",proto:!0,real:!0},{forEach:function(e){s(this),i(e);var t=a(this),r=0;o(t,function(t){e(t,r++)},{IS_RECORD:!0})}})},7960:(e,t,r)=>{"use strict";var n=r(9731),o=r(1639),i=r(6895),s=r(960),a=r(7636);n({target:"Iterator",proto:!0,real:!0},{find:function(e){s(this),i(e);var t=a(this),r=0;return o(t,function(t,n){if(e(t,r++))return n(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},8003:e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8006:(e,t,r)=>{"use strict";r(1613)},8042:(e,t,r)=>{"use strict";var n=r(1834),o=r(960),i=r(7751);e.exports=function(e,t,r){var s,a;o(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw r;return r}s=n(s,e)}catch(c){a=!0,s=c}if("throw"===t)throw r;if(a)throw s;return o(s),r}},8078:e=>{"use strict";e.exports={}},8142:(e,t,r)=>{"use strict";r(5527)},8144:(e,t,r)=>{"use strict";var n=r(764),o=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},8220:(e,t,r)=>{"use strict";var n=r(1399),o=r(2661),i=r(380),s=r(960),a=r(654),c=r(4827);t.f=n&&!o?Object.defineProperties:function(e,t){s(e);for(var r,n=a(t),o=c(t),u=o.length,d=0;u>d;)i.f(e,r=o[d++],n[r]);return e}},8239:(e,t,r)=>{"use strict";var n=r(9731),o=r(1639),i=r(6895),s=r(960),a=r(7636);n({target:"Iterator",proto:!0,real:!0},{some:function(e){s(this),i(e);var t=a(this),r=0;return o(t,function(t,n){if(e(t,r++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},8280:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8404:(e,t,r)=>{"use strict";var n=r(4202),o=r(621),i=r(3192);e.exports=function(e,t,r){var s,a;return i&&n(s=t.constructor)&&s!==r&&o(a=s.prototype)&&a!==r.prototype&&i(e,a),e}},8482:(e,t,r)=>{"use strict";var n=r(6947),o=r(4492),i=r(7759),s=Object,a=n("".split);e.exports=o(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?a(e,""):s(e)}:s},8505:e=>{"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8575:(e,t,r)=>{"use strict";var n=r(5833).has;e.exports=function(e){return n(e),e}},8590:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},8596:(e,t,r)=>{"use strict";var n=r(9731),o=r(1399),i=r(6002),s=r(4862),a=r(6947),c=r(1834),u=r(4202),d=r(621),l=r(5201),p=r(6668),h=r(8144),f=r(543),m=r(1815),v=r(4492),g=r(4555),y=r(9750),b=i.JSON,w=i.Number,_=i.SyntaxError,I=b&&b.parse,x=s("Object","keys"),E=Object.getOwnPropertyDescriptor,k=a("".charAt),S=a("".slice),T=a(/./.exec),C=a([].push),A=/^\d$/,P=/^[1-9]$/,O=/^(?:-|\d)$/,R=/^[\t\n\r ]$/,N=function(e,t,r,n){var o,i,s,a,u,h=e[t],m=n&&h===n.value,v=m&&"string"==typeof n.source?{source:n.source}:{};if(d(h)){var g=l(h),y=m?n.nodes:g?[]:{};if(g)for(o=y.length,s=f(h),a=0;a{"use strict";var n=r(9731),o=r(6002),i=r(1548),s=r(960),a=r(4202),c=r(9972),u=r(5251),d=r(1815),l=r(4492),p=r(6668),h=r(9544),f=r(3004).IteratorPrototype,m=r(1399),v=r(4192),g="constructor",y="Iterator",b=h("toStringTag"),w=TypeError,_=o[y],I=v||!a(_)||_.prototype!==f||!l(function(){_({})}),x=function(){if(i(this,f),c(this)===f)throw new w("Abstract class Iterator not directly constructable")},E=function(e,t){m?u(f,e,{configurable:!0,get:function(){return t},set:function(t){if(s(this),this===f)throw new w("You can't redefine this property");p(this,e)?this[e]=t:d(this,e,t)}}):f[e]=t};p(f,b)||E(b,y),!I&&p(f,g)&&f[g]!==Object||E(g,x),x.prototype=f,n({global:!0,constructor:!0,forced:I},{Iterator:x})},8657:(e,t,r)=>{"use strict";var n=r(9731),o=r(2307);o&&n({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return o(this,arguments.length?arguments[0]:void 0,!1)}})},8809:(e,t,r)=>{"use strict";var n,o,i,s=r(9202),a=r(1399),c=r(6002),u=r(4202),d=r(621),l=r(6668),p=r(764),h=r(2544),f=r(6426),m=r(679),v=r(5251),g=r(728),y=r(9972),b=r(3192),w=r(9544),_=r(3875),I=r(2820),x=I.enforce,E=I.get,k=c.Int8Array,S=k&&k.prototype,T=c.Uint8ClampedArray,C=T&&T.prototype,A=k&&y(k),P=S&&y(S),O=Object.prototype,R=c.TypeError,N=w("toStringTag"),j=_("TYPED_ARRAY_TAG"),M="TypedArrayConstructor",U=s&&!!b&&"Opera"!==p(c.opera),D=!1,$={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},L={BigInt64Array:8,BigUint64Array:8},q=function(e){var t=y(e);if(d(t)){var r=E(t);return r&&l(r,M)?r[M]:q(t)}},V=function(e){if(!d(e))return!1;var t=p(e);return l($,t)||l(L,t)};for(n in $)(i=(o=c[n])&&o.prototype)?x(i)[M]=o:U=!1;for(n in L)(i=(o=c[n])&&o.prototype)&&(x(i)[M]=o);if((!U||!u(A)||A===Function.prototype)&&(A=function(){throw new R("Incorrect invocation")},U))for(n in $)c[n]&&b(c[n],A);if((!U||!P||P===O)&&(P=A.prototype,U))for(n in $)c[n]&&b(c[n].prototype,P);if(U&&y(C)!==P&&b(C,P),a&&!l(P,N))for(n in D=!0,v(P,N,{configurable:!0,get:function(){return d(this)?this[j]:void 0}}),$)c[n]&&f(c[n],j,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:U,TYPED_ARRAY_TAG:D&&j,aTypedArray:function(e){if(V(e))return e;throw new R("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!b||g(A,e)))return e;throw new R(h(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(a){if(r)for(var o in $){var i=c[o];if(i&&l(i.prototype,e))try{delete i.prototype[e]}catch(s){try{i.prototype[e]=t}catch(u){}}}P[e]&&!r||m(P,e,r?t:U&&S[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,o;if(a){if(b){if(r)for(n in $)if((o=c[n])&&l(o,e))try{delete o[e]}catch(i){}if(A[e]&&!r)return;try{return m(A,e,r?t:U&&A[e]||t)}catch(i){}}for(n in $)!(o=c[n])||o[e]&&!r||m(o,e,t)}},getTypedArrayConstructor:q,isView:function(e){if(!d(e))return!1;var t=p(e);return"DataView"===t||l($,t)||l(L,t)},isTypedArray:V,TypedArray:A,TypedArrayPrototype:P}},8888:(e,t,r)=>{"use strict";r(977)},8963:(e,t,r)=>{"use strict";var n,o,i=r(6002),s=r(8003),a=i.process,c=i.Deno,u=a&&a.versions||c&&c.version,d=u&&u.v8;d&&(o=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},9041:(e,t,r)=>{"use strict";var n=r(9731),o=r(352);n({target:"Iterator",proto:!0,real:!0,forced:r(4192)},{map:o})},9058:(e,t,r)=>{"use strict";var n=r(621);e.exports=function(e){return n(e)||null===e}},9129:e=>{"use strict";e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},9151:(e,t,r)=>{"use strict";var n=r(6671),o=r(5833);e.exports=n(o.proto,"size","get")||function(e){return e.size}},9202:e=>{"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},9335:(e,t,r)=>{"use strict";var n=r(9731),o=r(1834),i=r(6895),s=r(960),a=r(7636),c=r(4495),u=r(3649),d=r(8042),l=r(4192),p=u(function(){for(var e,t,r=this.iterator,n=this.mapper;;){if(t=this.inner)try{if(!(e=s(o(t.next,t.iterator))).done)return e.value;this.inner=null}catch(i){d(r,"throw",i)}if(e=s(o(this.next,r)),this.done=!!e.done)return;try{this.inner=c(n(e.value,this.counter++),!1)}catch(i){d(r,"throw",i)}}});n({target:"Iterator",proto:!0,real:!0,forced:l},{flatMap:function(e){return s(this),i(e),new p(a(this),{mapper:e,inner:null})}})},9411:(e,t,r)=>{"use strict";var n=r(6671),o=r(7759),i=TypeError;e.exports=n(ArrayBuffer.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==o(e))throw new i("ArrayBuffer expected");return e.byteLength}},9544:(e,t,r)=>{"use strict";var n=r(6002),o=r(4456),i=r(6668),s=r(3875),a=r(9750),c=r(4455),u=n.Symbol,d=o("wks"),l=c?u.for||u:u&&u.withoutSetter||s;e.exports=function(e){return i(d,e)||(d[e]=a&&i(u,e)?u[e]:l("Symbol."+e)),d[e]}},9580:(e,t,r)=>{"use strict";var n=r(1834),o=r(6895),i=r(960),s=r(2544),a=r(7768),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(o(r))return i(n(r,e));throw new c(s(e)+" is not iterable")}},9593:(e,t,r)=>{"use strict";var n=r(1578),o=r(1105),i=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=o(t);if(t!==r)throw new i("Wrong length or index");return r}},9604:(e,t,r)=>{"use strict";var n=r(1399),o=r(6947),i=r(5251),s=URLSearchParams.prototype,a=o(s.forEach);n&&!("size"in s)&&i(s,"size",{get:function(){var e=0;return a(this,function(){e++}),e},configurable:!0,enumerable:!0})},9611:(e,t,r)=>{"use strict";var n=r(6947),o=r(9411),i=n(ArrayBuffer.prototype.slice);e.exports=function(e){if(0!==o(e))return!1;try{return i(e,0,0),!1}catch(t){return!0}}},9612:(e,t,r)=>{"use strict";r(8657)},9634:(e,t,r)=>{"use strict";var n=r(6947),o=r(78),i=r(5833),s=i.Set,a=i.proto,c=n(a.forEach),u=n(a.keys),d=u(new s).next;e.exports=function(e,t,r){return r?o({iterator:u(e),next:d},t):c(e,t)}},9639:(e,t,r)=>{"use strict";var n=r(8575),o=r(5833).add,i=r(1249),s=r(3868),a=r(78);e.exports=function(e){var t=n(this),r=s(e).getIterator(),c=i(t);return a(r,function(e){o(c,e)}),c}},9641:(e,t,r)=>{"use strict";var n=r(9731),o=r(1639),i=r(6895),s=r(960),a=r(7636),c=TypeError;n({target:"Iterator",proto:!0,real:!0},{reduce:function(e){s(this),i(e);var t=a(this),r=arguments.length<2,n=r?void 0:arguments[1],u=0;if(o(t,function(t){r?(r=!1,n=t):n=e(n,t,u),u++},{IS_RECORD:!0}),r)throw new c("Reduce of empty iterator with no initial value");return n}})},9731:(e,t,r)=>{"use strict";var n=r(6002),o=r(6710).f,i=r(6426),s=r(679),a=r(4980),c=r(1995),u=r(1799);e.exports=function(e,t){var r,d,l,p,h,f=e.target,m=e.global,v=e.stat;if(r=m?n:v?n[f]||a(f,{}):n[f]&&n[f].prototype)for(d in t){if(p=t[d],l=e.dontCallGetSet?(h=o(r,d))&&h.value:r[d],!u(m?d:f+(v?".":"#")+d,e.forced)&&void 0!==l){if(typeof p==typeof l)continue;c(p,l)}(e.sham||l&&l.sham)&&i(p,"sham",!0),s(r,d,p,e)}}},9746:(e,t,r)=>{"use strict";var n=r(679);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},9750:(e,t,r)=>{"use strict";var n=r(8963),o=r(4492),i=r(6002).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},9755:(e,t,r)=>{"use strict";var n=r(5308),o=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw new o("Can't convert number to bigint");return BigInt(t)}},9760:(e,t,r)=>{"use strict";var n=r(8144);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},9936:(e,t,r)=>{"use strict";var n=r(4862);e.exports=n("document","documentElement")},9972:(e,t,r)=>{"use strict";var n=r(6668),o=r(4202),i=r(7282),s=r(7258),a=r(3382),c=s("IE_PROTO"),u=Object,d=u.prototype;e.exports=a?u.getPrototypeOf:function(e){var t=i(e);if(n(t,c))return t[c];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof u?d:null}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(){const e="xxxx-4xxx-xxxx-xxxxxxxxxxxx";let t="";try{const r=window.crypto,n=new Uint16Array(31);r.getRandomValues(n);let o=0;t=e.replace(/[x]/g,e=>{const t=n[o];if("number"!=typeof t)throw new Error(`Event ID service: Invalid random number at index "${o}".`);const r=t%16;return o++,("x"===e?r:3&r|8).toString(16)}).toUpperCase()}catch{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{t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}()}-${t}`}const t=["page_viewed","collection_viewed","product_viewed","search_submitted","product_added_to_cart","product_added_to_cart_next","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"],n="wpm",o="trekkie",i="trekkie-next",s="trekkie-parity";let a,c;function u(t){return`${t||"sh"}-${e()}`}r(5993);const d=()=>"undefined"==typeof window;function l(e,t){if(null===e)return"null";if(Array.isArray(e))return`[${e.map(e=>l(e,!0)).join(",")}]`;if("object"==typeof e){let r=[];for(const t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&r.push(`${t}:${l(e[t],!0)}`);const n=r.join(",");return t?`{${n}}`:n}return"string"==typeof e?JSON.stringify(e):`${e}`}function p(e,...t){if(0===t.length)return e;const r=t[0];return e[r]||(e[r]={}),p(e[r],...t.slice(1))}function h(e){try{return decodeURIComponent(e)}catch(t){return""}}function f(){if(!d())return window}function m(){return!d()&&Boolean(f()?.Shopify?.theme)}r(7697),r(8643),r(9041),r(6364),r(9641),r(8596);class v extends TypeError{constructor(e){super(e),this.name="ConsentValidationError",Object.setPrototypeOf(this,v.prototype)}}const g="visitorConsentCollected",y="p",b="a",w="m",_="t",I="m",x="a",E="p",k="s";r(7960),r(8239),r(5495),r(1125),r(7271),r(1994),r(4765),r(5178),r(3481),r(8888),r(9612),r(1482),r(2796);const S=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/,T="00000000-0000-0000-5000-000000000000";function C(e,t){if("string"!=typeof e)return;if(!function(e){return!!e&&S.test(e.trim().toLowerCase())}(e))return;const r=e.trim();if("00000000-0000-0000-0000-000000000000"===r)return;if(r===T)return;const n=null==t||"string"==typeof t&&""===t.trim()?NaN:Number(t);return Number.isFinite(n)&&Date.now()>n?void 0:r}function A(e){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=e();return("x"===t?r:3&r|8).toString(16)})}function P(){const e="undefined"!=typeof crypto?crypto:void 0;if("function"==typeof e?.randomUUID)return e.randomUUID();if("function"==typeof e?.getRandomValues){const t=e.getRandomValues(new Uint8Array(36));let r=0;return A(()=>t[r++]%16)}return A(()=>16*Math.random()|0)}const O="_shopify_cmp";function R(){try{return document.cookie}catch{return!1}}function N(){return function(e){const t=R()?document.cookie.split("; "):[];for(let r=0;rfunction(e,t=L){if(e)return e.serverTiming?.find(e=>e.name==t)?.description}(t,e)),n=r.find(e=>e);return n&&e===L&&V(n),n}(e)}catch{return}}(),!t){if(e!==L)return;let t;try{t=sessionStorage.getItem(q)}catch{}return t||void 0}try{t=decodeURIComponent(t)}catch{}return t}let H;function F(){if(!d()){const e=window.Shopify?.customerPrivacy?.injectedConsent||$().injectedConsent;return e?h(e):void 0}}function z(){try{let e=function(){let e;if(e=d()?F():function(){const e=window.Shopify?.customerPrivacy?.cachedConsent;return e?h(e):void 0}()||F()||new URLSearchParams(window.location.search).get("_cs")||N()||B(),void 0!==e)return K(e)}();if(!e)return;return e}catch{return}}function W(e=null){return null===e&&(e=z()),void 0===e}function K(e){if("%"==e.slice(0,1))try{e=decodeURIComponent(e)}catch{}const t=e.slice(0,1);return"{"==t?function(e){let t;try{t=JSON.parse(e)}catch{return}if("2.1"===t.v&&t.con?.CMP)return t}(e):"3"==t?function(e){const{base:t}=D(e),r=(e=t).slice(1).split("_"),[n,o,i,s,a]=r;let c,u;try{c=r[5]?JSON.parse(r.slice(5).join("_")):void 0}catch{}if(a){const e=a.replace(/\*/g,"/").replace(/-/g,"+"),t=atob(e);let r="";for(let n=0;ne.slice(0,t)+"-"+e.slice(t),r)}function d(e){const t=n.split(".")[0];return t.includes(e.toLowerCase())?"0":t.includes(e.toUpperCase())?"1":""}function l(e){return n.includes(e.replace("t","s").toUpperCase())}return{v:"3",con:{CMP:{[x]:d("a"),[E]:d("p"),[I]:d("m"),[k]:d("s")}},region:o||"",cus:c,purposes:{[b]:l(b),[y]:l(y),[w]:l(w),[_]:l(_)},sale_of_data_region:"t"==s,display_banner:"t"==i,consent_id:u}}(e):void 0}function Y(e){const t=z();if(!t||!t.purposes)return!0;const r=t.purposes[e];return"boolean"!=typeof r||r}function J(){return Y(y)}function X(){return Y(b)}function G(){return Y(w)}function Q(){return Y(_)}r(3154),r(1649),r(9604);class Z{constructor(){if(this.endpoint="https://otlp-http-production.shopifysvc.com/v1/metrics",this.serviceName="consent-tracking-api",this.scopeName="consent-tracking-api-opentelemetry",Z.instance)return Z.instance;Z.instance=this}increment(e,t={},r=.01){if(!d()&&e)try{if(!Number.isFinite(r)||r<=0||r>1)return;if(!X())return;if(Math.random()>=r)return;const n=this.buildMetricBody(e,t);if(window.location.host.endsWith("spin.dev"))return void console.log("OpenTelemetry metric from consent API:",n);if("function"!=typeof fetch)return;return fetch(this.endpoint,{headers:{accept:"*/*","content-type":"application/json; charset=utf-8"},body:JSON.stringify(n),method:"POST",mode:"cors",credentials:"omit"}).catch(()=>{})}catch(n){}}buildMetricBody(e,t){const r=1e6*Date.now();return{resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeMetrics:[{scope:{name:this.scopeName,version:"1.1.1",attributes:[]},metrics:[{name:e,unit:"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[{asDouble:1,startTimeUnixNano:r,timeUnixNano:r,attributes:ee(t)}]}}]}]}]}}}function ee(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return null==n||t.push({key:r,value:te(n)}),t},[])}function te(e){return"string"==typeof e?{stringValue:e}:"boolean"==typeof e?{boolValue:e}:isFinite(e)?Math.floor(e)===e?{intValue:e}:{doubleValue:e}:{stringValue:String(e)}}function re(){return H??=new Z}Z.instance=void 0;class ne{constructor(){if(ne.instance)return ne.instance;ne.instance=this}produce(e,t){if(!d())try{const r={schema_id:"customer_privacy_api_events/2.0",payload:{shop_domain:window.location.host,method_name:e,call_details:t||null}},n={accept:"*/*","accept-language":"en-GB,en-US;q=0.9,en;q=0.8","content-type":"application/json; charset=utf-8","x-monorail-edge-event-created-at-ms":String(Date.now()),"x-monorail-edge-event-sent-at-ms":String(Date.now())};if(!window.location.host.endsWith("spin.dev"))return fetch("https://monorail-edge.shopifysvc.com/v1/produce",{headers:n,body:JSON.stringify(r),method:"POST",mode:"cors",credentials:"omit"}).catch(()=>{});console.log("Monorail event from consent API:",n,r)}catch(r){}}}function oe(){if(document.prerendering)return!0;let e;try{e=performance.getEntriesByType("navigation")[0]}catch{}return"navigational-prefetch"===e?.deliveryType||e?.activationStart>0||"hidden"===document.visibilityState}function ie(){const e=N();if(e)return D(e).comment}function se(){const e=document.querySelector('meta[name="request-id"]');return e?.getAttribute("content")??void 0}function ae(){try{const e=document.querySelector("script[data-shop-id]");return e?.getAttribute("data-shop-id")??void 0}catch(e){return}}ne.instance=void 0,r(5864),r(7872),r(8142),r(1256),r(2513),r(6456),r(663),r(1884),r(8006);var ce=(e=>(e.AdvancedDom="advanced-dom",e.Custom="custom",e.Dom="dom",e.Meta="meta",e.Standard="standard",e))(ce||{});const ue={all_events:ce.Meta,all_standard_events:ce.Meta,all_custom_events:ce.Meta,all_dom_events:ce.Meta,checkout_address_info_submitted:ce.Standard,checkout_completed:ce.Standard,checkout_started:ce.Standard,payment_info_submitted:ce.Standard,collection_viewed:ce.Standard,checkout_contact_info_submitted:ce.Standard,page_viewed:ce.Standard,product_added_to_cart:ce.Standard,product_removed_from_cart:ce.Standard,product_viewed:ce.Standard,search_submitted:ce.Standard,cart_viewed:ce.Standard,checkout_shipping_info_submitted:ce.Standard,alert_displayed:ce.Standard,ui_extension_errored:ce.Standard,input_changed:ce.Dom,input_blurred:ce.Dom,input_focused:ce.Dom,form_submitted:ce.Dom,clicked:ce.Dom,advanced_dom_mouse_moved:ce.AdvancedDom,advanced_dom_window_resized:ce.AdvancedDom,advanced_dom_scrolled:ce.AdvancedDom,advanced_dom_clipboard:ce.AdvancedDom,advanced_dom_selection_changed:ce.AdvancedDom,advanced_dom_available:ce.AdvancedDom,advanced_dom_changed:ce.AdvancedDom,advanced_dom_clicked:ce.AdvancedDom,advanced_dom_form_submitted:ce.AdvancedDom,advanced_dom_input_changed:ce.AdvancedDom,advanced_dom_input_blurred:ce.AdvancedDom,advanced_dom_input_focused:ce.AdvancedDom};function de(e){return function(e){return e in ue}(e)?ue[e]:ce.Custom}function le(e){return de(e)===ce.Standard}function pe(e){return de(e)===ce.Custom}function he(e){return de(e)===ce.Dom}function fe(e){return de(e)===ce.AdvancedDom}class me extends Error{constructor(e,t={}){super(e),this.severity=t.severity||"error",this.groupingHash=t.groupingHash??("Error"===this.name?void 0:this.name)}}var ve=(e=>(e.Shopify="shopify",e.StorefrontRenderer="storefront-renderer",e.CheckoutOne="checkout-one",e.CheckoutOneSdk="checkout-one-sdk",e.CheckoutOneShopApp="checkout-one-shop-app",e.CheckoutOneNativeShopApp="checkout-one-native-shop-app",e.CheckoutOneSdkShopApp="checkout-one-sdk-shop-app",e.CheckoutKit="checkout-kit",e.CheckoutKitShopApp="checkout-kit-shop-app",e.CustomerAccount="customer-account",e.Unknown="unknown",e.NotAvailable="n/a",e))(ve||{}),ge=(e=>(e.App="APP",e.Custom="CUSTOM",e))(ge||{}),ye=(e=>(e.Strict="STRICT",e.Lax="LAX",e.Open="OPEN",e))(ye||{}),be=(e=>(e.AdvancedDomEvents="advanced_dom_events",e))(be||{}),we=(e=>(e.Modern="modern",e.Legacy="legacy",e.Bot="bot",e.Unknown="unknown",e.NotAvailable="n/a",e))(we||{});const _e="product_added_to_cart",Ie="Added Product",xe="cart_link_id";function Ee(e,t,r){const{jQuery:n}=window;if(n&&n(e).bind){const o=e=>{e&&r(e)};n(e).bind(t,o)}else e.addEventListener&&e.addEventListener(t,r)}function ke(e){window.addEventListener("load",()=>{for(const t of document.forms)e(t)})}function Se(){return window.ShopifyAnalytics?.meta||{}}function Te(e,t){for(const r of t.variants)if(String(r.id)===String(e))return r;return null}function Ce(e,t){for(const r of t){const t=Te(e,r);if(t)return{product:r,variant:t}}return{}}function Ae(e,t){const[r]=t.productVariants?.filter(t=>t.id===e)||[];return r||function(e){let t,r;const n=Se();let o={currency:n.currency,variant_id:e};if(n.products){const o=n.products;({product:t,variant:r}=Ce(e,o))}else n.product&&(t=n.product,r=Te(e,t));return t&&(o={...o,product_id:t.id,product_gid:t.gid,product_vendor:t.vendor,collection_title:null,untranslated_product_title:t.untranslated_product_title},r&&(o={...o,variant_id:e,variant_price:r.price/100,product_title:r.name,variant_sku:r.sku,variant_title:r.public_title,untranslated_variant_title:r.untranslated_variant_title})),{id:String(o.variant_id),image:{src:""},price:{amount:o.variant_price,currencyCode:o.currency},product:{id:String(o.product_id),title:o.product_title,vendor:o.product_vendor,type:o.product_type,untranslatedTitle:o.untranslated_product_title||o.product_title,url:o.url},sku:o.variant_sku,title:o.variant_title,untranslatedTitle:o.untranslated_variant_title||o.variant_title}}(e)}function Pe(e){try{return e instanceof FormData?function(e){const t={};return e.forEach((e,r)=>{Oe(r,e,t)}),t}(e):e instanceof URLSearchParams?function(e){return Object.fromEntries(e.entries())}(e):JSON.parse(e)}catch{return{}}}function Oe(e,t,r){const[n,...o]=e.split(".").filter(e=>e);if(n&&o.length>0)return r[n]=r[n]||{},void Oe(o.join("."),t,r[n]);const i=/(\w+)?\[(\d+)?\](.+)?/.exec(e);if(i){const[e,n,o,s=""]=i;if(n)return r[n]=r[n]||[],void Oe(e.replace(n,""),t,r[n]);if(o){const e=s&&"["===s[0]?[]:{};return r[o]=r[o]||e,void Oe(s,t,r[o])}r.push(t)}else r[e]=t}function Re(e){let t=e.toLowerCase();return t=t.replace(/\/+$/,""),t=t.replace(/\/\/+/g,"/"),t=t.split("?")[0]||t,t}function Ne(e){if(!e)return 1;try{return JSON.parse(e).quantity||1}catch{if(e instanceof FormData||e instanceof URLSearchParams){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}function je(e){return null!=e&&"object"==typeof e&&("merchandise"in e&&null!=e.merchandise?.id||"variant_id"in e&&null!=e.variant_id||"id"in e&&null!=e.id)}function Me(e){if(!je(e))return null;if("remote"in e&&"boolean"==typeof e.remote)return e.remote;let t=null;if("merchandise"in e?t=e.merchandise?.id:"variant_id"in e?t=e.variant_id:"id"in e&&(t=e.id),t){const e=function(e){let t=null,r=null;const n=Se();return n.products?({product:t,variant:r}=Ce(e,n.products)):n.product&&(r=Te(e,n.product),r&&(t=n.product)),r?t??null:null}(String(t));if(e&&"remote"in e&&"boolean"==typeof e.remote)return e.remote}return null}function Ue(e){if(e)try{const{pathname:t}=new URL(e,"https://shopify.com"),r=t.match(/\/products\/([^/]+)\/?$/)?.[1];return r?decodeURIComponent(r):void 0}catch{return}}let De;function $e(e,t){const r=e.merchandise?.product.title||void 0,n=e.merchandise?.title||void 0,o=r&&n?`${r} - ${n}`:r||n||"",i=Me(e.merchandise);return e?{productId:e.merchandise?.product?.id,productHandle:t||Ue(e.merchandise?.product?.url),variantId:e.merchandise?.id,name:o,sku:e.merchandise?.sku,category:e.merchandise?.product?.type,brand:e.merchandise?.product?.vendor,variant:e.merchandise?.title,price:e.merchandise?.price?.amount,quantity:e.quantity,currency:e.merchandise?.price?.currencyCode,cartToken:Ve(document.cookie).cart||void 0,remote:i}:{}}function Le(e,t,r,n){const o=$e(e,r);window.ShopifyAnalytics&&window.ShopifyAnalytics.lib&&"function"==typeof window.ShopifyAnalytics.lib.track&&window.ShopifyAnalytics.lib.track(Ie,{...o},void 0,void 0,{addApiSource:t,shopifyEmitted:!0})}function qe(e,t,r){if(De)try{De($e(e,r),t)}catch{}}function Ve(e){const t={};for(const r of e.split(/ *; */)){const[e,n]=r.split("=");if(void 0!==e)try{t[decodeURIComponent(e)]=decodeURIComponent(n||"")}catch{continue}}return t}function Be(e){if(!e.extensions?.cart_changelog||"function"!=typeof window.ShopifyAnalytics?.lib?.track)return;const t=function(e){try{return JSON.parse(atob(e))}catch{return{}}}(e.extensions.cart_changelog);t.items_added&&Array.isArray(t.items_added)&&function(e){const t=[];return e.forEach(e=>{const r={productId:e.product_id,variantId:e.variant_id,name:e.title,sku:e.sku,category:e.product_type,brand:e.vendor,variant:e.variant_title,price:e.price,quantity:e.quantity,currency:window.ShopifyAnalytics.meta.currency,cartToken:Ve(document.cookie).cart||void 0};t.push(r)}),t}(t.items_added).forEach(e=>{window.ShopifyAnalytics.lib.track(Ie,e,void 0,void 0,{addApiSource:"storefrontApi",shopifyEmitted:!0})})}function He(e,t,r,n){if(t.length!==r.length)throw new me("Payload body and response have different number of items");t.forEach((t,o)=>{let i=1;try{const e=r[o]?.quantity;i=e?Number(e):1}catch{}ze(e,t,i,n)})}function Fe(e,t,r,n,o){let i;if(function(e){return e&&"object"==typeof e&&"merchandise"in e&&"cost"in e&&"quantity"in e}(t))i=t;else{const e=Se().currency,n={id:o.includes("add")?String(t.id):String(t.variant_id),image:{src:t.image},price:{amount:t.presentment_price,currencyCode:e},product:{id:String(t.product_id),title:t.product_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};i={cost:{totalAmount:{amount:n.price.amount*r,currencyCode:e}},merchandise:n,quantity:Number(r)}}if(Xe(t,"fetch")||e(n,{cartLine:i}),n===_e){const e={...i,merchandise:{...i.merchandise||{},remote:t?.remote??null}};o.includes("change")||o.includes("update")||o.includes("permalink")?Le(e,o,t?.handle):o.startsWith("add-")&&je(t)&&qe(e,o,t?.handle)}}function ze(e,t,r,n){Fe(e,t,r,_e,n)}function We(e,t,r){const n=t.items,o=t.items_changelog?.added;o&&Array.isArray(o)&&o.map(e=>{const t=n.find(t=>String(t.variant_id)===String(e.variant_id));return t?{variant_id:t.variant_id,view_key:t.key,image:t.image,presentment_price:t.presentment_price,product_id:t.product_id,vendor:t.vendor,product_type:t.product_type,untranslated_product_title:t.product_title,url:t.url,handle:t.handle,sku:t.sku,product_title:t.product_title,variant_title:t.variant_title,untranslated_variant_title:t.variant_title,quantity:e.quantity,remote:t.remote}:null}).filter(e=>null!==e).forEach(t=>{ze(e,t,t.quantity,r)})}function Ke(e,t,r){const n=t.items_added,o=t.items_removed;n.forEach(t=>{ze(e,t,t?.quantity,r)}),o.forEach(t=>{!function(e,t,r,n){Fe(e,t,r,"product_removed_from_cart",n)}(e,t,t?.quantity,r)})}function Ye(e,t,r,n){try{const o=function(e){const t=[];if(e.id)t.push({id:e.id,quantity:Number(e.quantity)||1});else if(e.items)for(const r of e.items)r.id&&t.push({id:r.id,quantity:Number(e.quantity)||1});return t}(t);if(0===o.length)return!1;!function(e,t,r,n){for(const o of t){const t=o.id.toString(),i=o.quantity,s=Ae(t,r),a={cost:{totalAmount:{amount:s.price.amount*i,currencyCode:s.price.currencyCode}},merchandise:s,quantity:Number(i)};e(_e,{cartLine:a}),Le(a,n)}}(e,o,r,n)}catch{return!1}return!0}function Je(e){}function Xe(e,t){if(!Se().remoteProductsEnabled)return!1;if(!je(e))return!0;const r=Me(e);switch(t){case"fetch":case"form":return!0===r;default:return t}}const Ge=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/+cart\/+add(?:\.js|\.json)?\/*$/,Qe=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/+cart\/+change(?:\.js|\.json)?\/*$/,Ze=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/+cart\/+update(?:\.js|\.json)?\/*$/,et=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/api\/(\d{4}-\d{2}|unstable)\/graphql\.json(\?.*)?$/;class tt{static handleXhrOpen(){}static handleXhrDone(e){if(!(e.xhr.status>=400))try{const t=document.createElement("a");t.href=e.url;const r=t.pathname?t.pathname:e.url;t.href=e.xhr.responseURL;const n=t.pathname?t.pathname:e.xhr.responseURL;let o=!1;if(r.match(Ge)&&function(e,t){return Re(e)!==Re(t)}(r,n)){const t=Pe(e.body);o=Ye(e.publish,t,e.initData,"add-xhr-redirect")}if(o)return;r.match(Ge)?tt.parsePayloadResponse(e,t=>{const r=Object.keys(t).find(e=>"items"===e);if(r){const n=t[r];let o;try{o=JSON.parse(e.body).items}catch{o=function(e,t){const r=new Array(t);for(let n=0;n{Ke(e.publish,t,"change-xhr")}):r.match(Ze)?tt.parsePayloadResponse(e,t=>{We(e.publish,t,"update-xhr")}):r.match(et)&&tt.parsePayloadResponse(e,e=>{Be(e)})}catch{}}static parseBlobToJson(e,t){const r=new FileReader;r.addEventListener("loadend",()=>{t(JSON.parse(String.fromCharCode(...new Uint8Array(r.result))))}),r.readAsArrayBuffer(e)}static parsePayloadResponse(e,t){e.xhr.response instanceof Blob?tt.parseBlobToJson(e.xhr.response,t):e.xhr.responseText&&t(JSON.parse(e.xhr.responseText))}constructor(e,t,r,n,o,i){this.xhr=e,this.url=t,this.method=r,this.body=n,this.publish=o,this.initData=i}onReadyStateChange(){4===this.xhr.readyState&&tt.handleXhrDone({method:this.method,url:this.url,body:this.body,xhr:this.xhr,publish:this.publish,initData:this.initData}),this.oldOnReadyStateChange&&this.oldOnReadyStateChange.call(this.xhr,new Event("oldOnReadyStateChange"))}}function rt(e,t){(function(e,t,r){if(void 0===e?.prototype?.open)return;const n=e.prototype.open,o=e.prototype.send;Reflect.defineProperty(e.prototype,"open",{value(e,t){this._url=t,this._method=e,n.apply(this,arguments)}}),Reflect.defineProperty(e.prototype,"send",{value(e){if(!(e instanceof Document)){const n=new tt(this,this._url,this._method,e||"",t,r);this.addEventListener?this.addEventListener("readystatechange",n.onReadyStateChange.bind(n),!1):(n.oldOnReadyStateChange=this.onreadystatechange,this.onreadystatechange=n.onReadyStateChange)}o.call(this,e)}})})(window.XMLHttpRequest,e,t),function(e,t,r){const n=e.fetch;if("function"!=typeof n)return;const o=function(e,t,r){return function(...n){return e.apply(this,Array.prototype.slice.call(n)).then(e=>{if(!e.ok)return e;const n=document.createElement("a");n.href=e.url;const o=n.pathname?n.pathname:e.url;let i,s=!1;if(o.match(Ge)&&arguments[1]?.body&&e.redirected&&(i=Pe(arguments[1].body),s=Ye(t,i,r,"add-fetch-redirect")),s)return e;try{if(o.match(Ge)){try{if(i=i||Pe(arguments[1].body),Object.keys(i).includes("items"))return function(e,t,r){t.clone().json().then(t=>{const n=r.items,o=t.items;return He(e,o,n||[],"add-fetch-bulk"),t}).catch(Je)}(t,e,i),e}catch(a){}!function(e,t,r){const n=Ne(r);t.clone().json().then(t=>ze(e,t,n,"add-fetch")).catch(Je)}(t,e,arguments[1].body)}else o.match(Qe)?function(e,t){t.clone().json().then(t=>{Ke(e,t,"change-fetch")}).catch(Je)}(t,e):o.match(Ze)?function(e,t){t.clone().json().then(t=>{We(e,t,"update-fetch")}).catch(Je)}(t,e):o.match(et)&&function(e){e.ok&&e.clone().json().then(e=>{Be(e)}).catch(Je)}(e)}catch{}return e})}}(n,t,r);Reflect.defineProperty(e,"fetch",{value:o})}(window,e,t),ke(r=>{const n=r.getAttribute("action");n&&n.indexOf("/cart/add")>=0&&Ee(r,"submit",r=>{!function(e,t,r){const n=t||window.event;if(!n||n.defaultPrevented||n.isDefaultPrevented&&n.isDefaultPrevented())return;const o=n.currentTarget||n.srcElement;if(o&&o instanceof Element&&(o.getAttribute("action")||o.getAttribute("href")))try{const t=function(e){let t;const r=e.querySelector('[name="id"]')||e instanceof HTMLFormElement&&e.elements.namedItem("id");return r instanceof HTMLSelectElement&&r.options?t=r.options[r.selectedIndex]:(r instanceof HTMLOptionElement||r instanceof HTMLInputElement)&&(t=r),t}(o);if(!t)return;const n=t.value,i=function(e){const t=e.querySelector('[name="quantity"]');return t instanceof HTMLInputElement?Number(t.value):1}(o),s=Ae(n,r),a={cost:{totalAmount:{amount:s.price.amount*i,currencyCode:s.price.currencyCode}},merchandise:s,quantity:Number(i)};if(qe(a,"add-form"),Xe(s,"form"))return;e(_e,{cartLine:a})}catch{}}(e,r,t)})})}function nt(e,t,{publishShadowTrekkieAddToCart:r}={}){(function(e){De=e})(r),rt(e,t),function(e,t){ke(r=>{const n=r.querySelector('[name="previous_step"]');n&&n instanceof HTMLInputElement&&"payment_method"===n.value&&Ee(document.body,"submit",r=>{!function(e,t,r){const n=t||window.event;if(!n)return;const o=n.target||n.srcElement;if(o&&o instanceof HTMLFormElement&&o.getAttribute("action")&&null!==o.getAttribute("data-payment-form"))try{const t=r.checkout;if(!t)throw new me("Checkout data not found");e("payment_info_submitted",{checkout:t})}catch{}}(e,r,t)})})}(e,t)}function ot(){if(!d())return window.Shopify?.customerPrivacy}function it(e,t){if(!d())try{document.dispatchEvent(new CustomEvent(e,{detail:t||{}}))}catch(r){console.error(`[Shopify Customer Privacy] Error in event listener for "${e}":`,r)}}r(2341);function st(e,t){const r=f();if(!r)return;const n=p(r,"Shopify","customerPrivacy","cachedToken");if(t){const r="_shopify_s"===e?18e5:31536e6;n[e]=t,n[e+"_expires_at"]=Date.now()+r}else delete n[e],delete n[e+"_expires_at"]}const at="Shopify-Storefront-Consent-Management";function ct(e){return""===e?void 0:e}function ut(e){const t=e.granular_consent;return{query:`query { consentManagement { cookies(${l({visitorConsent:{marketing:ct(t.marketing),analytics:ct(t.analytics),preferences:ct(t.preferences),saleOfData:ct(t.sale_of_data),...t.metafields&&{metafields:t.metafields}},...t.email&&{visitorEmail:t.email},origReferrer:ct(e.referrer),landingPage:ct(e.landing_page)})}) { trackingConsentCookie cookieDomain landingPageCookie origReferrerCookie shopifyUnique shopifyVisit } customerAccountUrl } }`,variables:{}}}let dt;function lt(e,t,r,n={}){const o=$().consentDomain||t.granular_consent.checkoutRootDomain||window.location.host,i=()=>function(e,t,r,n){const o=t.granular_consent;let i="",s={};if(o.customerAccountRequestInfo)i=o.customerAccountRequestInfo.url,s=o.customerAccountRequestInfo.headers;else{const t=$(),n=o.storefrontAccessToken||t.storefrontAccessToken;i=`${/^(localhost|127\.0\.0\.1)(:|$)/.test(e)?"http:":"https:"}//${e}/api/unstable/graphql.json`;const a=o.isExtensionToken?"Shopify-Storefront-Extension-Token":"x-shopify-storefront-access-token";s=n?{[a]:n}:{},r&&(s={...s,...r()})}const a={headers:{"content-type":"application/json",...!0===$().asyncConsent&&new URL(i).origin===window.location.origin&&{[at]:"1"},...s,..."undefined"!=typeof __CtaTestEnv__&&"true"===__CtaTestEnv__?{"x-test-payload":JSON.stringify(t)}:{}},body:JSON.stringify(ut(t)),method:"POST"};let c;try{c=fetch(i,a)}catch(u){c=Promise.reject(u)}return c.then(e=>{try{n?.(e)}catch{}if(e.ok)return e.json();{const t=new Error("Server error");throw t.cause={status:e.status},t}})}(o,t,n.getVisitorTokenHeaders,n.onResponse).then(e=>{const o=e?.data?.consentManagement;if(!o){const t=(e?.errors??[]).map(e=>e?.message).filter(Boolean).join("; ");throw new Error(t?`GraphQL error: ${t}`:"GraphQL response missing consentManagement")}const i=o.cookies.cookieDomain,s=o.cookies.trackingConsentCookie,a=o.cookies.shopifyUnique,c=o.cookies.shopifyVisit;if(!0===$().asyncConsent&&s&&!function(e){try{return void 0!==K(h(e))}catch{return!1}}(s))throw new Error("Consent response contains unreadable consent");var u,l,m;if(s&&(u=s,p(window,"Shopify","customerPrivacy").cachedConsent=u,!0!==$().asyncConsent&&V(s)),st("_shopify_y",a),st("_shopify_s",c),!0===$().asyncConsent)e.errors?.length||!s||W()||function(){if(d()||!function(){const e=R();return!!e&&e.split(";").some(e=>U.includes(e.split("=")[0].trim()))}())return;const e=window.location.hostname.split("."),t=["",...e.map((t,r)=>e.slice(r).join("."))];for(const r of U)for(const e of t)try{M(r,e,-1,"")}catch{}}();else if(t.granular_consent.headlessStorefront&&!function(){const e=f();return!0===e?.Shopify?.customerPrivacy?.backendConsentEnabled||!0===$().asyncVisitorState}()){const e=31536e6,r=t.granular_consent,n=i||r.checkoutRootDomain||window.location.hostname,o=r.storefrontRootDomain||i||window.location.hostname;M(O,n,e,s),o!==n&&M(O,o,e,s)}return!1!==n.emitEvents&&(l=t,m={[y]:J(),[b]:X(),[w]:G(),[_]:Q()},void 0!==l.granular_consent&&function(e){!function(){const e=ot();e&&(e.consentStatus="loaded")}();const t=e[w],r=e[_],n=e[b],o=e[y];!0===t?it("firstPartyMarketingConsentAccepted"):!1===t&&it("firstPartyMarketingConsentDeclined"),!0===r?it("thirdPartyMarketingConsentAccepted"):!1===r&&it("thirdPartyMarketingConsentDeclined"),!0===n?it("analyticsConsentAccepted"):!1===n&&it("analyticsConsentDeclined"),!0===o?it("preferencesConsentAccepted"):!1===o&&it("preferencesConsentDeclined");const i=function(e){return{marketingAllowed:e[w],saleOfDataAllowed:e[_],analyticsAllowed:e[b],preferencesAllowed:e[y],firstPartyMarketingAllowed:e[w],thirdPartyMarketingAllowed:e[_]}}(e);it(g,i);const s=[n,o,t,r];s.every(e=>!0===e)&&it("trackingConsentAccepted"),s.every(e=>!1===e)&&it("trackingConsentDeclined")}(m)),void 0!==r&&r(null,e),e}).catch(e=>{const t="Error while setting storefront API consent: "+e.message,n=e.cause?.status,o={error:t};if(void 0!==n&&(o.statusCode=n),void 0===r)throw o;r(o)});if(!0!==$().asyncConsent)return i();const s=dt=dt?dt.then(i,i):i(),a=()=>{dt===s&&(dt=void 0)};return s.then(a,a),s}const pt=["marketing","analytics","preferences","sale_of_data"],ht=[...pt,"email","rootDomain","checkoutRootDomain","storefrontRootDomain","storefrontAccessToken","headlessStorefront","isExtensionToken","metafields","customerAccountRequestInfo"],ft=pt.map(e=>`"${e}"`).join(", "),mt="https://shopify.dev/docs/api/customer-privacy";function vt(){try{if(""===document.referrer)return!0;const e=document.createElement("a");return e.href=document.referrer,window.location.hostname!=e.hostname}catch{return!0}}function gt(){return!!W()||G()&&X()}const yt=new Set;function bt(e){return yt.has(e)}function wt(e,t){return Boolean(e.enabledFlags?.includes(t))}const _t="6b3fd603",It="72f1cbdd",xt="b13923a8",Et="fcb309c6";function kt(e){if(!d())try{return document.querySelector(`meta[name="${e}"]`)?.getAttribute("content")?.trim()}catch{return}}function St(e){const t=kt(e);if(t)try{const e=JSON.parse(t);return"string"==typeof e?e.trim():void 0}catch{return}}function Tt(e){return void 0!==e&&Date.now()>e}function Ct(e,t){const r=C(St(t));if(r&&!Tt(function(e){const t=St(`${e}Expiration`);if(!t)return;const r=Number(t);return Number.isFinite(r)?r:void 0}(t)))return r;const n=C(kt(e));return n&&!Tt(function(e){if(!d())try{const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("data-expiration")?.trim();if(!t)return;const r=Number(t);return Number.isFinite(r)?r:void 0}catch{return}}(e))?n:void 0}function At(e,t){try{re().increment("consent_tracking_api_tracking_token_read",{token:e,source:t})}catch{}}function Pt(e){try{return performance?.getEntriesByType("navigation")[0]?.serverTiming?.find(t=>t.name==e)?.description}catch{return}}async function Ot(e){try{if(Math.random()>.01)return;let t=null;if(e)try{const r=await e.json();t=Array.isArray(r?.errors)&&r.errors.length>0}catch{}re().increment("consent_tracking_api_persist",{ok:String(!!e?.ok),status:String(e?.status??"none"),graphql_errors:String(t)},1)}catch{}}function Rt(e,t,r){if(!0===$().asyncConsent&&"loaded"!==ot()?.consentStatus)return;re().increment("consent_tracking_api_tracking_token_missing");const n=t?void 0:P(),o=r?void 0:P();return n&&st("_shopify_y",n),o&&st("_shopify_s",o),function(e,t){if(!d())try{const n=C(e),o=C(t);if(!n&&!o)return;const i=function(){const e=document.querySelector('[data-serialized-id="app-base-path"]');if(!d()&&Boolean(f()?.__CUSTOMER_ACCOUNT__)||e){const t=document.querySelector('[data-serialized-id="preview-mode-data"]');if("/"!==JSON.parse(e?.textContent||"null")||!1!==JSON.parse(t?.textContent||"null")?.inPreviewMode)return;return new URL("/customer/api/unstable/graphql",window.location.origin).href}const{protocol:t,host:r}=function(){const e=$().consentDomain||window.location.host;return{protocol:/^(localhost|127\.0\.0\.1)(:|$)/.test(e)?"http:":"https:",host:e}}();return`${t}//${r}/api/unstable/graphql.json`}();if(!i)return;const s=new URLSearchParams,a={"content-type":"application/json"};n&&(s.set("_y",n),a["X-Shopify-UniqueToken"]=n),o&&(s.set("_s",o),a["X-Shopify-VisitToken"]=o);const c=`${i}?${s.toString()}`;let u;try{u=fetch(c,{headers:a,body:JSON.stringify({query:"query { consentManagement { cookies(visitorConsent:{}) { cookieDomain } } }",variables:{}}),method:"POST",mode:"cors",credentials:"include"})}catch(r){u=Promise.reject(r)}u.then(e=>Ot(e),()=>Ot(void 0))}catch{}}(n,o),"_shopify_y"===e?n:o}function Nt(e){if(!X()&&!G())return;const t=function(e){const t=f();if(!t)return;const r=t.Shopify?.customerPrivacy?.cachedToken?.[e],n=t.Shopify?.customerPrivacy?.cachedToken?.[e+"_expires_at"];return!r||!n||n<(new Date).getTime()?void 0:C(r)}(e);if(t)return At(e,"window_cache"),t;if(function(){const e=f();if(!e?.ShopPay)return!1;try{const t=Object(e.ShopPay);return Reflect.has(t,"trackingUnique")||Reflect.has(t,"trackingVisit")}catch{return!1}}()){const t=function(e){const t=f();if(!t||!t.ShopPay)return;const r={_shopify_y:"trackingUnique",_shopify_s:"trackingVisit"}[e];return r?C(t.ShopPay[r]):void 0}(e);return At(e,"shop_pay"),t}const r="_shopify_y"===(n=e)?Ct("shopify-y","serialized-shopifyY"):"_shopify_s"===n?Ct("shopify-s","serialized-shopifyS"):void 0;var n;if(r)return At(e,"meta"),r;const o=function(e){const t=e.replace("_shopify",""),r=Pt(t),n=Number(Pt(`${t}e`));if(!n||Date.now()/1e3t.trim().startsWith(`${e}=`))?.split("=")[1]?.trim();return C(t)}catch{return}}(e);if(i)return At(e,"cookie"),i;At(e,"missing")}function jt(){return Ut("_shopify_y")}function Mt(){return Ut("_shopify_s")}function Ut(e){if(d())throw new Error("Token generateFallback is not supported in Node.js environments, just browsers.");const t=Nt(e);if(t)return t;if((X()||G())&&!function(){const e=f();return!(!e||!Reflect.has(e,"ShopPay"))}())try{return Rt(e,Nt("_shopify_y"),Nt("_shopify_s"))}catch{return}}class Dt{constructor(e){this.maxSize=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}has(e){return this.cache.has(e)}set(e,t){if(this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}return this.cache.set(e,t),this}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}}const $t=e=>"number"==typeof e?new Dt(e):new Map,Lt=(...e)=>JSON.stringify(e);function qt(e,{cache:t,cacheKey:r}={}){function n(...t){const o=n.cache,i=(r??Lt).apply(this,t);if(o.has(i))return o.get(i);{const r=e(...t);return o.set(i,r),r}}return n.cache=t??$t(),n}const Vt=qt((e="")=>{const t=e.indexOf("=");return-1===t?[e.trim(),void 0]:[e.slice(0,t).trim(),e.slice(t+1).trim()]},{cache:$t(100),cacheKey:(e="")=>e}),Bt=qt((e="")=>e.split(";").reduce((e,t)=>{const[r,n]=Vt(t);if(r)try{e[decodeURIComponent(r)]=decodeURIComponent(n??"")}catch{e[r]=n??""}return e},Object.create(null)),{cache:$t(50),cacheKey:(e="")=>e}),Ht="_shopify_y",Ft=()=>{try{return document.cookie}catch{return}},zt=e=>{try{document.cookie=e}catch{}},Wt=e=>{try{if(e===Ht||"_shopify_s"===e)return e===Ht?jt():Mt()}catch{}try{const t=Ft();return"string"==typeof t?Bt(t)[e]:void 0}catch{return}},Kt=Symbol.for("web-pixels-manager.trekkie-shim");function Yt(e){return"object"==typeof e&&null!==e&&!0===e[Kt]}const Jt=new Set(["appName","uniqToken","visitToken","microSessionId","microSessionCount","isPersistentCookie"]),Xt=new Set(["ga is not defined","Can't find variable: ga"]),Gt=new Set(["trekkie","ready"]);function Qt(){}function Zt(e){return"object"==typeof e&&null!==e}function er(e,t,r,n=!0){return Reflect.defineProperty(e,t,{value:r,writable:!0,configurable:!0,enumerable:n})}function tr(){return"persistent"===(Wt("_shopify_m")??"persistent")}function rr(e){return Zt(e)&&Yt(e.trekkie)}function nr(e,t){if("function"==typeof e)try{e()}catch(r){if(r instanceof Error&&Xt.has(r.message))return;t(r,{context:"trekkieShim/ready"})}}const or=["page","track","trackForm","trackLink"];function ir(){}function sr({callback:e,onError:t,configuration:r,consent:n,createMissingStub:o=!1,onStubResolved:i}){try{const s=window.ShopifyAnalytics?.lib??window.trekkie,a=bt(xt),c=a&&o&&null==s,u=c?function(e){const t=[];for(const r of or)Reflect.set(t,r,ir);try{Reflect.set(window,"trekkie",t)}catch{}if(window.trekkie===t)return t;e(new Error("Failed to create the trekkie stub on window."),{context:"trekkieShim/createStub"})}(t):s,d=a&&o&&!function(e){return Zt(e)&&e.trekkie===e&&"function"==typeof e.load}(u);if(a&&o&&!rr(u))try{i?.(function(e,t){return e?"wpm":t?"placeholder":"page"}(c,d))}catch{}if(a&&rr(u))return;d&&null!=u&&null==window.ShopifyAnalytics?.lib&&function(e,t){try{const t=window.ShopifyAnalytics??{};Reflect.set(t,"lib",e),window.ShopifyAnalytics||Reflect.set(window,"ShopifyAnalytics",t)}catch{}window.ShopifyAnalytics?.lib!==e&&t(new Error("Failed to alias ShopifyAnalytics.lib to the stub."),{context:"trekkieShim/aliasLib"})}(u,t);const l=a?function(e){const t=function(e){try{return function({stub:e,configuration:t,consent:r,onError:n,awaitsSnippet:o=!1}){if(!Zt(e))return;const i=e.trekkie;if(Yt(i))return;if(Zt(i)&&i!==e&&Zt(i.defaultAttributes))return;const s=i===e,a={},c=e=>{if(!Zt(e)||!Zt(e.Trekkie))return;const{appName:t,defaultAttributes:r}=e.Trekkie;if(Zt(r))for(const n of Object.keys(r))Jt.has(n)||(a[n]=r[n]);"string"==typeof t&&(a.appName=t)};let u=T,d=0;const l=()=>{u=r.trackingTokens.getUniqueToken()||T,a.uniqToken=u,a.visitToken=r.trackingTokens.getVisitToken()||T};c(e.config);const p={shopId:t.shopId,themeId:t.themeId,isMerchantRequest:!!t.isMerchantRequest||null};for(const y of Object.keys(p))void 0===a[y]&&void 0!==p[y]&&(a[y]=p[y]);l(),a.microSessionId=t.pageId,a.microSessionCount=d,a.isPersistentCookie=tr(),r.onConsentCollected(l);const h=e=>nr(e,n);let f=!1;const m={defaultAttributes:a,get state(){return f||=r.analyticsProcessingAllowed(),f?"initialized":"awaiting-consent"},options:{},ready:h};er(m,Kt,!0,!1);const v={trekkie:m,ready:h,user:()=>({traits:()=>({uniqToken:u})}),identify:Qt,destroy:Qt,handleConsentCollectedBinded:Qt,addConsentCollectedListener:Qt,removeConsentCollectedListener:Qt,navigationInfo:{navigationType:t.navigationType,navigationApi:t.navigationApi},...s&&{integrations:[m]}},g=Object.keys(v).filter(t=>o&&Gt.has(t)?!Reflect.defineProperty(e,t,{value:v[t],writable:!1,configurable:!0,enumerable:!0}):!er(e,t,v[t]));return function(e,t){const r=Object.getOwnPropertyDescriptor(e,"config");if(r&&(!r.configurable||r.get))return!1;let n=r?.value;return Reflect.defineProperty(e,"config",{configurable:!0,enumerable:!0,get:()=>n,set:e=>{n=e,t(e)}})}(e,c)||g.push("config"),g.length>0&&n(new Error(`Failed to install trekkie shim properties: ${g.join(", ")}`),{context:"trekkieShim/installProperties/define"}),{defaultAttributes:a,incrementMicroSessionCount:()=>(d+=1,a.microSessionCount=d,d)}}(e)}catch(t){return void e.onError(t,{context:"trekkieShim/installProperties"})}}(e);return r=e.stub,n=e.onError,Array.isArray(r)&&r.forEach(e=>{Array.isArray(e)&&"ready"===e[0]&&nr(e[1],n)}),t&&e.awaitsSnippet&&Array.isArray(e.stub)&&function(e,t){const r=Array.prototype.push;Reflect.defineProperty(e,"push",{value:(...n)=>{const o=n.filter(e=>!Array.isArray(e)||"ready"!==e[0]||(nr(e[1],t),!1));return r.apply(e,o)},writable:!0,configurable:!0,enumerable:!1})||t(new Error("Failed to install the trekkie stub push interceptor."),{context:"trekkieShim/installStubPush"})}(e.stub,e.onError),t;var r,n}({stub:u,configuration:r,consent:n,onError:t,awaitsSnippet:d}):void 0,p=l?t=>e({...t,microSessionCount:l.incrementMicroSessionCount()}):e,h=function(e){let t=window.__TREKKIE_SHIM_QUEUE;const r=null==t;if(r)try{window.__TREKKIE_SHIM_QUEUE=[],t=window.__TREKKIE_SHIM_QUEUE}catch{}if(Array.isArray(t))return t;e(new Error(`__TREKKIE_SHIM_QUEUE is ${null===t?"null":typeof t}, expected an array.`),{context:r?"trekkieShim/queueRecoveryFailed":"trekkieShim/queueUnavailable"})}(t);if(!h)return;const f=({from:e,method:r,args:n,pageContext:o},i,s)=>{try{p({from:`${e} -> ${i}`,method:r,args:n,...void 0!==o&&{pageContext:o}})}catch(a){t(a,{context:`${s}/${r}`})}};for(;h.length>0;){const e=h.shift();if(!e)break;f(e,"wpm-replay-queue","trekkieShim/replay")}const m=(...e)=>(e.forEach(e=>f(e,"wpm-replay-queue-push","trekkieShim/push")),e.length);Reflect.defineProperty(h,"push",{value:m,writable:!0,configurable:!0})||t(new Error("Failed to install trekkie shim push interceptor: __TREKKIE_SHIM_QUEUE is not extensible."),{context:"trekkieShim/installPush"}),new Promise((e,t)=>{const r=window.__TREKKIE_SHIM_QUEUE;if(!r)return void t(new Error("__TREKKIE_SHIM_QUEUE is not defined on the window object."));let n=!1;const o=setTimeout(()=>{n||(n=!0,t(new Error("Trekkie did not become ready within 30000ms.")))},3e4),i=()=>{n||(n=!0,clearTimeout(o),e(window.trekkie))};if(r.ready)return void i();let s=!1;Reflect.defineProperty(r,"ready",{get:()=>s,set(e){s=e,i()},configurable:!0})||i()}).catch(()=>{})}catch(s){t(s,{context:"trekkieShim"})}}let ar=function(e){return e.Product="product",e.Collection="collection",e}({});const cr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let ur;const dr=new Uint8Array(16);function lr(){if(!ur&&(ur="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ur))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ur(dr)}const pr=[];for(let r=0;r<256;++r)pr.push((r+256).toString(16).slice(1));const hr=function(e,t,r){if(cr.randomUUID&&!t&&!e)return cr.randomUUID();const n=(e=e||{}).random||(e.rng||lr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return pr[e[t+0]]+pr[e[t+1]]+pr[e[t+2]]+pr[e[t+3]]+"-"+pr[e[t+4]]+pr[e[t+5]]+"-"+pr[e[t+6]]+pr[e[t+7]]+"-"+pr[e[t+8]]+pr[e[t+9]]+"-"+pr[e[t+10]]+pr[e[t+11]]+pr[e[t+12]]+pr[e[t+13]]+pr[e[t+14]]+pr[e[t+15]]}(n)},fr=/\/products\/([a-z0-9]+(?:-[a-z0-9]+)*)-([a-zA-Z0-9+/=_-]+?)-([a-f0-9]{8})-remote(?:[?#/]|$)/;function mr(e){try{const[t=""]=e.split(/[?#]/,1),r=fr.exec(t),n=r?.[2];if(!n)return;const o=atob(n.replace(/-/g,"+").replace(/_/g,"/")).split(":");if(o.length<5||"v1"!==o[0])return;const[,i,s,a]=o;return{handle:r?.[1]||void 0,productId:i||void 0,remoteShopId:s||void 0,adResponseId:a||void 0}}catch{return}}const vr=/^\d{1,19}$/;function gr(e){return void 0!==e&&function(e){return vr.test(String(e))}(e)&&!/^0+$/.test(String(e))}function yr(e){const t=e.searchParams.get("variant");return t&&t.length>0?t:null}const br=/\/products\/([^/?#]+)/,wr='predictive-search, predictive-search-component, [data-predictive-search]:not(body):not(html), .predictive-search, form[action$="/search"]',_r=new Set(["r","e"]),Ir="search",xr="recommendations";function Er(e){const t=br.exec(e)?.[1];if(!t)return null;try{return{handle:decodeURIComponent(t)}}catch{return{handle:t}}}function kr(e){const t=e.getAttribute("href")?.trim();if(t)try{return new URL(t,e.baseURI)}catch{return}}function Sr(e){if(e?.origin!==window.location.origin)return;const t=e.searchParams.get("pr_rec_pid")?.trim();return gr(t)?t:void 0}function Tr(e){if(e?.origin!==window.location.origin)return!1;const t=e.searchParams.get("_ss")?.trim();return _r.has(t??"")}function Cr(e){return e instanceof HTMLAnchorElement&&Tr(kr(e))}function Ar(e,t){const r=function(e){if(!e?.length)return()=>null;const t=new Map;return r=>{if(0===t.size)for(const n of e)n.handle&&!t.has(n.handle)&&t.set(n.handle,n);return t.get(r)??null}}(e),n=new Map,o=new Map;return(e,i=e)=>{const s=kr(e),a=s?.pathname??function(e){try{return new URL(e.href).pathname}catch{return(e.getAttribute("href")??"").trim()}}(e),c=Er(a);if(!c)return null;const u=function(e,t){return t===ar.Product&&Er(window.location.pathname)?.handle===e}(c.handle,t),d=!u&&Tr(s);if(function(e,t=Cr(e)){return!!e.closest("header")&&!t&&!e.closest(wr)}(e,d))return null;const l=r(c.handle),p=mr(a),h=p?.productId&&p.remoteShopId?p:void 0,f=u?void 0:Sr(s),m=h?.productId??l?.id,v=void 0===m||m===f?f:void 0,g=function(e,t,r=function(e){return void 0!==function(e){return e instanceof HTMLAnchorElement?Sr(kr(e)):void 0}(e)}(e),n=Cr(e)){return r?xr:n?Ir:e.closest("product-recommendations, [data-product-recommendations], .product-recommendations")?xr:e.closest(wr)?Ir:function(e){return e===ar.Collection?"collection":"searchresults"===e?Ir:"other"}(t)}(e,t,void 0!==v,d),y=(s?yr(s)??void 0:void 0)??l?.variants?.[0]?.id,b=i.getBoundingClientRect(),w={width:window.innerWidth,height:window.innerHeight},_=`${c.handle}:${g}`,I=n.get(_);if(I){const e=I.productId??v;return e!==I.productId&&(I.productId=e),{...I,variantId:y,rect:b,viewport:w}}const x=(o.get(g)??0)+1;o.set(g,x);const E={handle:c.handle,productHandle:p?.handle??c.handle,productId:h?.productId??l?.id??v,variantId:y,remoteShopId:h?.remoteShopId??l?.remoteShopId,isCollective:l?.isCollective,adResponseId:p?.adResponseId,impressionId:hr(),placement:g,position:x,rect:b,viewport:w};return n.set(_,E),E}}function Pr(){return!bt("229bb729")}function Or(){return!bt("add5c673")}function Rr(){return!bt("11ef6017")}function Nr(){return Pr()||Or()||Rr()}class jr extends me{constructor(e,t){super(t instanceof Error?t.message:String(t),{groupingHash:e}),this.cause=void 0,this.name=e,this.cause=t}}function Mr(e,t){try{return e()}catch(r){return t}}const Ur=new Set;function Dr(){document.removeEventListener("visibilitychange",Dr);for(const e of Ur)e();Ur.clear()}function $r(){return new Promise(e=>{Ur.add(e),"visible"===document.visibilityState?(document.addEventListener("visibilitychange",Dr),requestAnimationFrame(()=>setTimeout(()=>{Ur.delete(e),e()}))):Dr()})}const Lr='a[href*="/products/"]',qr=Mr(()=>{if("undefined"==typeof Element)return()=>{};const e=Element.prototype.matches;return"function"==typeof e?(t,r)=>e.call(t,r):()=>{}},()=>{});function Vr(e){return Mr(()=>e.nodeType===Node.ELEMENT_NODE,!1)}function Br(e,t){const r=Mr(()=>qr(e,t),void 0);return"boolean"==typeof r?r:t===Lr&&function(e){return Mr(()=>"undefined"!=typeof HTMLAnchorElement&&e instanceof HTMLAnchorElement&&(e.getAttribute("href")??"").includes("/products/"),!1)}(e)}function Hr(e){return!(!Vr(e)||!Br(e,Lr)&&null===e.querySelector(Lr))}function Fr(e){let t=!1;const{onProductFound:r,onProductRemoved:n,onError:o}=e;function i(e,t){if(Vr(e)){Br(e,Lr)&&e instanceof HTMLAnchorElement&&t(e);for(const r of Array.from(e.querySelectorAll(Lr)))r instanceof HTMLAnchorElement&&t(r)}}let s=[],a=[],c=null;const u=new MutationObserver(e=>{if(!t)try{let u=!1;for(const t of e){for(const e of Array.from(t.addedNodes))Hr(e)&&(s.push(e),u=!0);for(const e of Array.from(t.removedNodes))Hr(e)&&(a.push(e),u=!0)}u&&(c||(c=$r().then(()=>{c=null,function(){if(t)return s=[],void(a=[]);const e=s,c=a;s=[],a=[];for(const t of c)try{i(t,e=>{e.isConnected||n(e)})}catch(u){o?.(new jr("ProductScannerError",u))}for(const t of e)try{i(t,e=>{e.isConnected&&r(e)})}catch(u){o?.(new jr("ProductScannerError",u))}}()})))}catch(u){o?.(new jr("ProductScannerError",u))}}),d="function"==typeof requestIdleCallback&&"function"==typeof cancelIdleCallback,l=d?requestIdleCallback:requestAnimationFrame,p=d?cancelIdleCallback:cancelAnimationFrame,h=l(()=>{if(!t)try{i(document.documentElement,r)}catch(e){o?.(new jr("ProductScannerError",e))}});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{t||(t=!0,p(h),u.disconnect(),s=[],a=[],c=null)}}class zr extends me{constructor(){super("The wait time must be above zero."),this.name="InvalidThrottlingWaitTimeError"}}class Wr extends me{constructor(){super("The throttle function requires at least one of leading or trailing to be true, otherwise, its callback will never be called."),this.name="InvalidThrottleOptionsError"}}function Kr(e,t,r={}){return Yr(e,t,r)}function Yr(e,t,{leading:r=!0,trailing:n=!0,debounceMode:o=!1}={}){if(t<=0)throw new zr;if(!r&&!n)throw new Wr;let i,s,a,c=null,u=0;function d(){u=!1===r?0:(new Date).valueOf(),c=null,i&&(s=e.apply(a,i)),a=null,i=null}return Object.assign(function(...l){const p=(new Date).valueOf();u||!1!==r||(u=p),o&&(u=p,c&&(clearTimeout(c),c=null));const h=t-(p-u);return a=this,i=l,h<=0||h>t?(c&&(clearTimeout(c),c=null),u=p,i&&(s=e.apply(a,i)),a=null,i=null):c||!1===n||(c=setTimeout(d,h)),s},{cancel:function(){c&&(clearTimeout(c),c=null),i=null,a=null,u=0}})}let Jr;const Xr=()=>(void 0===Jr&&(Jr=function(){let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};self.addEventListener("test",r,t),self.removeEventListener("test",r,t)}catch(t){return!1}return e}()),Jr),Gr={capture:!0,passive:!0};function Qr(e,t,r,n){const o=n.addEventListenerOptions?{...Gr,...n.addEventListenerOptions}:Gr;try{const i=function(e,{sampleRate:t,throttleDelay:r,onError:n}){const o=r=>{$r().then(()=>e(r)).catch(e=>{const r=/Maximum call stack size exceeded/i.test(e?.message||"");n(e,{context:"listenTo/handler",type:r?"metric":"error",unhandled:!1,options:{sampleRate:t??.5}})})};return"number"==typeof r?Kr(o,r):o}(r,n);return e.addEventListener(t,i,Xr()?o:o.capture),()=>{e.removeEventListener(t,i,Xr()?o:o.capture)}}catch(i){n.onError(i,{context:"listenTo",unhandled:!1})}return()=>{}}function Zr(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var en=0;function tn(e){return"__private_"+en+++"_"+e}var rn=tn("observer"),nn=tn("watchesByElement"),on=tn("lastEntryByElement"),sn=tn("disposed"),an=tn("onIntersect"),cn=tn("armDwell"),un=tn("clearTimer"),dn=tn("removeWatch");class ln{constructor(){if(Object.defineProperty(this,dn,{value:mn}),Object.defineProperty(this,un,{value:fn}),Object.defineProperty(this,cn,{value:hn}),Object.defineProperty(this,an,{value:pn}),Object.defineProperty(this,rn,{writable:!0,value:void 0}),Object.defineProperty(this,nn,{writable:!0,value:new Map}),Object.defineProperty(this,on,{writable:!0,value:new Map}),Object.defineProperty(this,sn,{writable:!0,value:!1}),"function"!=typeof IntersectionObserver)return Zr(this,rn)[rn]=null,void(Zr(this,sn)[sn]=!0);Zr(this,rn)[rn]=new IntersectionObserver(e=>Zr(this,an)[an](e),{threshold:.5})}watch(e,t){if(Zr(this,sn)[sn])return()=>{};const r={...t,el:e,durationMs:t.durationMs??1e3,timer:null,satisfied:!1};let n=Zr(this,nn)[nn].get(e);n||(n=new Set,Zr(this,nn)[nn].set(e,n),Zr(this,rn)[rn]?.observe(e)),n.add(r);const o=Zr(this,on)[on].get(e);return o&&o.intersectionRatio>=.5&&Zr(this,cn)[cn](r,o),()=>{Zr(this,un)[un](r),r.satisfied||Zr(this,dn)[dn](r)}}dispose(){if(!Zr(this,sn)[sn]){Zr(this,sn)[sn]=!0;for(const e of Zr(this,nn)[nn].values())for(const t of e)Zr(this,un)[un](t);Zr(this,nn)[nn].clear(),Zr(this,on)[on].clear(),Zr(this,rn)[rn]?.disconnect()}}}function pn(e){if(!Zr(this,sn)[sn])for(const t of e){const e=Zr(this,nn)[nn].get(t.target);if(e)if(Zr(this,on)[on].set(t.target,t),t.intersectionRatio<.5)for(const t of e)Zr(this,un)[un](t);else for(const r of[...e])Zr(this,cn)[cn](r,t)}}function hn(e,t){if(e.satisfied||null!=e.timer)return;let r=!0;try{r=!e.shouldStartDwell||e.shouldStartDwell(t)}catch(n){return e.onError?.(new jr("VisibilityObserverError",n)),void Zr(this,dn)[dn](e)}r?e.timer=setTimeout(()=>{if(e.timer=null,!e.satisfied){e.satisfied=!0;try{e.onSatisfied()}catch(n){e.onError?.(new jr("VisibilityObserverError",n))}finally{Zr(this,dn)[dn](e)}}},e.durationMs):Zr(this,dn)[dn](e)}function fn(e){null!=e.timer&&(clearTimeout(e.timer),e.timer=null)}function mn(e){const t=Zr(this,nn)[nn].get(e.el);t&&(t.delete(e),0===t.size&&(Zr(this,nn)[nn].delete(e.el),Zr(this,on)[on].delete(e.el),Zr(this,rn)[rn]?.unobserve(e.el)))}function vn({context:e,products:t,onEvent:r,onHoverEvent:n,onError:o}){try{const i=Pr(),s=Or(),a=Rr()&&Boolean(n);if(!i&&!s&&!a)return()=>{};const c=i||a?new ln:null,u=Ar(t,e.pageType),d=new Map,l=new Map;let p=!1;const h=c&&i?function({visibility:e,context:t,emit:r,onError:n}){const o=new Set;return{track(i,s){const a=`${s.handle}:${s.placement}`;return o.has(a)?()=>{}:e.watch(i,{onError:n,shouldStartDwell:e=>e.boundingClientRect.width>=10&&e.boundingClientRect.height>=10,onSatisfied:()=>{o.has(a)||(o.add(a),r({interaction:"impression",event:{pageUrl:window.location.href,pageType:t.pageType,productId:s.productId,productHandle:s.productHandle,variantId:s.variantId,remoteShopId:s.remoteShopId,isCollective:s.isCollective,adResponseId:s.adResponseId,impressionId:s.impressionId,placement:s.placement,position:s.position,rect:s.rect,collectionId:t.collectionId,totalProducts:t.totalProducts},viewport:s.viewport}))}})}}}({visibility:c,context:e,emit:r,onError:o}):null,f=s?function({context:e,emit:t,onError:r}){const n=e=>{r?.(new jr("ClickTrackerError",e))};return{track(r,o){let i=!1;const s=r=>n=>{n instanceof MouseEvent&&!i&&n.isTrusted&&n.button===r&&t({interaction:"click",event:{pageUrl:window.location.href,pageType:e.pageType,productId:o.productId,productHandle:o.productHandle,variantId:o.variantId,remoteShopId:o.remoteShopId,isCollective:o.isCollective,adResponseId:o.adResponseId,impressionId:o.impressionId,placement:o.placement,position:o.position,rect:o.rect,collectionId:e.collectionId,totalProducts:e.totalProducts},viewport:o.viewport})},a=[Qr(r,"click",s(0),{onError:n}),Qr(r,"auxclick",s(1),{onError:n})];return()=>{i=!0;for(const t of a)try{t()}catch(e){n(e)}}}}}({context:e,emit:r,onError:o}):null,m=c&&a&&n?function({visibility:e,context:t,emit:r,onError:n}){const o=e=>{n?.(new jr("HoverTrackerError",e))};let i=!1;const s=e=>{i||(i=!0,o(e))},a="function"==typeof window.matchMedia?window.matchMedia("(any-hover: none)"):null,c=new Set;let u=null,d=null,l=null,p=!1;function h(){null!=l&&(clearTimeout(l),l=null)}function f(){d&&(d.cancel(),d=null)}function m(){h(),u=null,f()}function v(e,t,r){const n=e=>{try{r(e)}catch(t){o(t)}};try{e.addEventListener(t,n,{passive:!0})}catch(i){s(i);try{e.removeEventListener(t,n)}catch(a){s(a)}return}return()=>{try{e.removeEventListener(t,n)}catch(i){s(i)}}}function g(n,i){u={el:n,impressionId:i.impressionId},d={el:n,impressionId:i.impressionId,cancel:e.watch(n,{onError:o,durationMs:3e3,shouldStartDwell:e=>e.boundingClientRect.width>=10&&e.boundingClientRect.height>=10,onSatisfied:()=>{u?.el===n&&u.impressionId===i.impressionId&&null==l&&(d=null,r({event:{pageUrl:window.location.href,pageType:t.pageType,productId:i.productId,productHandle:i.productHandle,variantId:i.variantId,remoteShopId:i.remoteShopId,isCollective:i.isCollective,impressionId:i.impressionId,placement:i.placement,position:i.position,rect:i.rect,collectionId:t.collectionId,adResponseId:i.adResponseId,totalProducts:t.totalProducts},viewport:i.viewport}))}})}}const y=v(document,"visibilitychange",()=>{"visible"!==document.visibilityState&&m()});return{track(e,t){let r=!0;if(!y)return()=>{};const n=v(e,"mouseenter",n=>{if(n instanceof MouseEvent&&!r&&!p&&n.isTrusted&&!a?.matches&&"visible"===document.visibilityState){if(u?.impressionId===t.impressionId){const r=null!=l;if(h(),d?.el===e)return;return f(),void((r||u.el!==e)&&g(e,t))}h(),f(),g(e,t)}});if(!n)return()=>{};const o=v(e,"mouseleave",n=>{n instanceof MouseEvent&&(r||p||n.isTrusted&&function(e){const{relatedTarget:t}=e;if(t instanceof Element)for(const r of c)if(r===t||r.contains(t))return r}(n)!==e&&u?.el===e&&(f(),function(e,t){h(),l=setTimeout(()=>{l=null,u?.el===e&&u.impressionId===t&&(u=null,f())},250)}(e,t.impressionId)))});return o?(c.add(e),r=!1,()=>{r=!0,c.delete(e),d?.el===e&&f(),u?.el===e&&m(),n(),o()}):(r=!0,n(),()=>{})},dispose(){p||(p=!0,c.clear(),m(),y?.())}}}({visibility:c,context:e,emit:n,onError:o}):null,v=(e,t,r)=>{let n=!1;return()=>{n||(n=!0,r.anchors.delete(e),r.anchors.size>0||(l.get(t)===r&&l.delete(t),r.dispose()))}},g=(e,t,r)=>{if(!m)return()=>{};const n=l.get(t);if(n)return n.anchors.add(e),v(e,t,n);const o={anchors:new Set([e]),dispose:m.track(t,r)};return l.set(t,o),v(e,t,o)},y=Fr({onProductFound:e=>{if(p)return;const t=Mr(()=>r.closest(".card-wrapper, .product-card-wrapper, .product-card, .grid__item, [data-product-card]")??r.closest("[data-product-id]")??r,r=e);var r;const n=d.get(e);if(n){if(n.wrapper===t)return;d.delete(e),n.dispose()}const i=u(e,t);if(!i)return;const s=[];h&&s.push(h.track(t,i)),f&&s.push(f.track(e,i)),m&&s.push(g(e,t,i)),d.set(e,{wrapper:t,dispose:gn(s,o)})},onProductRemoved:e=>{if(p)return;const t=d.get(e);t&&(d.delete(e),t.dispose())},onError:o});return()=>{if(!p){p=!0,y();for(const{dispose:e}of d.values())e();d.clear(),l.clear(),c?.dispose(),m?.dispose()}}}catch(i){return o?.(new jr("ProductInteractionProducerError",i)),()=>{}}}function gn(e,t){return()=>{for(const n of e)try{n()}catch(r){t?.(new jr("ProductInteractionProducerError",r))}}}function yn(e){return e!==ar.Product||bt("d5e4cc6b")?e!==ar.Collection||bt("b5872a1d")?void 0:ar.Collection:ar.Product}function bn(e){return e.replace(/\/$/,"")}function wn(e){return e.pageType===ar.Product?Boolean(e.resourceId):e.pageType===ar.Collection&&(Boolean(e.resourceId)||function(e){if(!e)return!1;try{const t=bn(new URL(e).pathname);return"/collections/all"===t||/^\/[a-z]{2,3}(?:-[a-z]{2,4})?\/collections\/all$/.test(t)}catch{return!1}}(e.pageUrl))}class _n extends me{constructor(e,t){super(t instanceof Error?t.message:String(t),{groupingHash:e}),this.cause=void 0,this.name=e,this.cause=t}}const In=[5e3,1e4,3e4,6e4];function xn(e){return e===ar.Product&&!bt("22fc6a6b")}class En extends me{constructor(e,t){super(t instanceof Error?t.message:String(t),{groupingHash:e}),this.cause=void 0,this.name=e,this.cause=t}}const kn=["/cart/add","/cart/add.js"];function Sn(e){return(e instanceof HTMLInputElement||e instanceof HTMLSelectElement)&&"quantity"===e.name}function Tn(e){const t=e.form?.getAttribute("action");if(!t)return!1;try{const{pathname:e}=new URL(t,window.location.origin);return kn.some(t=>e.endsWith(t))}catch{return!1}}function Cn(e){return Number.isInteger(e)&&e>=1}function An(e,t){const r=e.target;if(!Sn(r))return;if(!Tn(r))return;const n=Number(r.value);Cn(n)?t.scheduleEmit(r,n):t.cancelPending()}function Pn({publish:e,debounceMs:t}){let r=!1,n=null;const o=function(e,t){return Yr(e,t,{leading:!1,trailing:!0,debounceMode:!0})}((t,r,o)=>{t!==n&&(e({interaction:"quantity",event:{pageUrl:o,quantity:t,variantId:r}}),n=t)},t);function i(){o.cancel()}return{scheduleEmit:function(e,t){r||o(t,function(e){const t=e.form?.querySelector('[name="id"]');return t?.value?t.value:new URLSearchParams(window.location.search).get("variant")||void 0}(e),window.location.href)},cancelPending:i,dispose:function(){r||(r=!0,i())}}}function On(e){return e.pageType===ar.Product&&Boolean(e.resourceId)&&!bt("80a63488")}class Rn extends me{constructor(e,t){super(t instanceof Error?t.message:String(t),{groupingHash:e}),this.cause=void 0,this.name=e,this.cause=t}}function Nn({pageType:e,resourceId:t,pageUrl:r,products:n,emit:o,onError:i}){const s=function({pageType:e,resourceId:t,products:r}){if(e===ar.Product)return r?.find(e=>e.id===t)?.remoteShopId}({pageType:e,resourceId:t,products:n}),a=function({pageType:e,resourceId:t,pageUrl:r,products:n}){if(e!==ar.Product)return;const o=n?.find(e=>e.id===t)?.handle;if(o)return o;let i;try{i=new URL(r).pathname}catch{return}return mr(i)?.handle??Er(i)?.handle}({pageType:e,resourceId:t,pageUrl:r,products:n});if(Nr()&&vn({context:{pageType:e,collectionId:e===ar.Collection?t:void 0,totalProducts:n?.length},products:n,onEvent:e=>{o("log:buyer-behavior:product-interaction",e)},...Rr()?{onHoverEvent:e=>{o("log:buyer-behavior:product-hover",e)}}:{},onError:e=>{i(e,{context:"features/buyer-behavior/productInteractionProducer",severity:"warning",unhandled:!1})}}),wn({pageType:yn(e),resourceId:t,pageUrl:r})){const c=function({pageType:e,resourceId:t,pageUrl:r,products:n}){if(e!==ar.Product)return;const o=n?.find(e=>e.id===t);if(!o)return;const{variants:i}=o,s=i?.[0]?.id;let a=null;try{a=yr(new URL(r))}catch{}return a?Array.isArray(i)?i.some(e=>e.id===a)?a:s:a:s}({pageType:e,resourceId:t,pageUrl:r,products:n}),u=function({pageType:e,pageUrl:t}){if(e===ar.Product)try{return mr(new URL(t).pathname)?.adResponseId}catch{return}}({pageType:e,pageUrl:r});!function(e,{onError:t}){let r=!1,n=0,o=0,i=null;function s(){if(r)return;a();const t=In[n];if(void 0===t)return;const c=Math.max(0,t-o);i=setTimeout(()=>{return i=null,o=r=t,n++,e({event:{pageUrl:window.location.href,dwellMilliseconds:r}}),void(n>=In.length?u():s());var r},c)}function a(){null!==i&&(clearTimeout(i),i=null)}const c=Qr(document,"visibilitychange",function(){"visible"!==document.visibilityState?(a(),o=0):!r&&n{t(new _n("PageDwellListenerError",e))}});function u(){r||(r=!0,a(),c())}"visible"===document.visibilityState&&s()}(({event:e})=>o("log:buyer-behavior:page-dwell",{event:{...e,productHandle:a,remoteShopId:s,variantId:c,adResponseId:u}}),{onError:e=>{i(e,{context:"features/buyer-behavior/pageDwellListener",severity:"warning",unhandled:!1})}})}xn(e)&&t&&function(e,{onError:t}){const r=e=>{t(new En("ProductQuantityChangeListenerError",e))},n=Pn({publish:e,debounceMs:500});Qr(document,"input",e=>An(e,n),{onError:r}),Qr(document,"change",e=>An(e,n),{onError:r}),Qr(document,"quantity-selector:update",e=>function(e,t){const r=e.detail?.quantity;if("number"!=typeof r||!Cn(r))return;const n=Sn(o=e.target)?o:o instanceof Element?o.querySelector('[name="quantity"]'):null;var o;n&&Tn(n)&&t.scheduleEmit(n,r)}(e,n),{onError:r})}(({interaction:e,event:t})=>o("log:buyer-behavior:product-quantity-change",{interaction:e,event:{...t,productHandle:a,remoteShopId:s}}),{onError:e=>{i(e,{context:"features/buyer-behavior/productQuantityChangeListener",severity:"warning",unhandled:!1})}}),On({pageType:e,resourceId:t})&&function(e,t){const r=e=>{t.onError(new Rn("ProductVariantChangeListenerError",e))},n=function(e){const t=window.location.pathname;let r=yr(new URL(window.location.href));return function(n=window.location.href){const o=new URL(n,window.location.href);if(o.pathname!==t)return;const i=yr(o);null!==i?i!==r&&(e({event:{variantId:i,pageUrl:o.href}}),r=i):r=null}}(e),o=function(){const e=window.navigation;if(e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener)return e}();o?function(e,t,r){let n=!1;const o=e=>{try{if(n)return;if(!e.destination.sameDocument)return;if("replace"!==e.navigationType)return;t(e.destination.url)}catch(o){r(o)}};e.addEventListener("navigate",o)}(o,n,r):function(e,t){let r=!1;const n=history.replaceState;function o(o,i,s){n.call(this,o,i,s);try{if(r)return;if(null==s)return;e()}catch(a){t(a)}}history.replaceState=o}(n,r)}(({event:e})=>o("log:buyer-behavior:product-variant-change",{event:{...e,productHandle:a,remoteShopId:s}}),{onError:e=>{i(e,{context:"features/buyer-behavior/productVariantChangeListener",severity:"warning",unhandled:!1})}})}const jn="webPixelsManager",Mn="production",Un="modern",Dn="f882002ew93f4c027p0c16e2cama50b1ec1",$n="bf882002ew93f4c027p0c16e2cama50b1ec1m.js",Ln="1.10.3",qn="isPixelHelperSession";function Vn(){return G()}function Bn(){return X()}function Hn(){return J()}function Fn(){return Q()}const zn=()=>{let e,t;return{promise:new Promise((...r)=>{[e,t]=r}),resolve:e,reject:t}},Wn=qt(e=>{if(!e)return 0;let t=5381;for(let r=0;r>>0},{cacheKey:e=>e}),Kn=(e,t)=>Math.random()<=t;function Yn(e){return Jn(Kn,e)}function Jn(e,{rate:t=1}={}){return Xn(t),{includes:(r,n=t)=>(n!==t&&Xn(n),e(r,n))}}function Xn(e){if(e<=0||e>1)throw new me("Invalid sampling rate",{groupingHash:"Utilities:Sample:InvalidSamplingRate"})}const Gn=[/Googlebot/i,/Storebot-Google/i,/bingbot/i,/Baiduspider/i,/YandexBot/i,/DuckDuckBot/i,/Slurp/i,/facebookexternalhit/i,/Twitterbot/i,/LinkedInBot/i,/Applebot/i,/AdsBot-Google/i,/Mediapartners-Google/i,/APIs-Google/i,/bytedance/i,/PetalBot/i,/SemrushBot/i,/AhrefsBot/i,/MJ12bot/i,/DotBot/i,/Acunetix/i,/PerplexityBot/i,/Perplexity-User/i],Qn=qt(e=>!!e&&Gn.some(t=>e.match(t)),{cacheKey:e=>e??"unknown",cache:$t(100)});var Zn=r(1554),eo=r(6718),to=r.n(eo);class ro extends Error{constructor(...e){super(...e),this.message="Excessive Stacktrace: May indicate infinite loop forming"}}const no=(e,t)=>{const r=function(e){if(t=e,"string"!=typeof(t?.stack||t?.stacktrace||t?.["opera#sourceloc"])||t.stack===`${t.name}: ${t.message}`)return null;var t;try{const t=to().parse(e).reduce((e,t)=>{const r=function({functionName:e,lineNumber:t,columnNumber:r}){const n=/^global code$/i.test((o=e)||"")?"global code":o;var o;return{file:`https://cdn.shopify.com/cdn/wpm/${$n}`,method:n,lineNumber:t,columnNumber:r}}(t);try{return"{}"===JSON.stringify(r)?e:e.concat(r)}catch(n){return e}},[]);return{errorClass:e?.name,message:e?.message,stacktrace:t,type:"browserjs"}}catch(r){return null}}(e);if(r)return r;const n=function(e,t){let r="";const n={lineNumber:"1",columnNumber:"1",method:t,file:`https://cdn.shopify.com/cdn/wpm/${$n}`},o=e.stackTrace||e.stack||e.description;try{if(o){r=e.stack.split("\n")[0];const t=e.stack.match(/([0-9]+):([0-9]+)/);if(t&&t.length>2&&(n.lineNumber=t[1],n.columnNumber=t[2],parseInt(n.lineNumber,10)>1e5))throw new ro}return{errorClass:e?.name||r,message:e?.message||r,stacktrace:[n],type:"browserjs"}}catch(i){return null}}(e,t);return n||{errorClass:e?.name,message:e?.message,stacktrace:[],type:"browserjs"}},oo=["number","boolean","symbol"],io=(e,{context:t})=>{const r="v1/"+(t?`${t}/`:"");return null==e||oo.includes(typeof e)||Array.isArray(e)?`${r}UnknownError`:"string"==typeof e?`${r}${e}`:"groupingHash"in e&&"string"==typeof e.groupingHash?`${r}${e.groupingHash}`:`${r}${"Error"!==e.name&&e.name?e.name:e.message}`};class so extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,so)}}const ao={severity:"error",context:"",unhandled:!0,library:"browser",surface:ve.Unknown},co=Yn(),uo=function({sampler:e=co}={}){const t={metadata:{shopId:-1,surface:ve.NotAvailable,browserTarget:we.NotAvailable,shopDomain:"n/a"},notify:(r,n)=>{try{if("metric"===n?.type||!0===r?.metric)return;const o=n?.userAgent||self.navigator?.userAgent;if(Qn(o))return;const i=n?.options?.sampleRate;if(void 0!==i&&!e.includes(io(r,n??{}),i))return;const s={...ao,...n,...t.metadata,shopUrl:self.location.href};if(s.browserTarget===we.NotAvailable||s.browserTarget===we.Unknown||s.surface===ve.NotAvailable||s.surface===ve.Unknown||!lo(s.shopUrl))return void(console?.error&&console.error(r));const a=function(e,t){const{userAgent:r,context:n,severity:o,unhandled:i,library:s,hashVersionSandbox:a,sandboxUrl:c,pixelId:u,pixelType:d,runtimeContext:l,shopId:p,initConfig:h,notes:f,surface:m,shopDomain:v,browserTarget:g,shopUrl:y}=t,{device:b,os:w,browser:_,engine:I}=function(t){try{return new Zn.UAParser(t).getResult()}catch(e){return{ua:"",browser:{name:"",version:"",major:""},engine:{name:"",version:""},os:{name:"",version:""},device:{model:"",type:"",vendor:""},cpu:{architecture:""}}}}(r||self.navigator?.userAgent),x=no(e,n);return{payload_version:5,notifier:{name:"web-pixel-manager",version:Dn,url:"-"},events:[{exceptions:[x],context:n?`v1/${n}`:void 0,severity:o,unhandled:i,app:{version:Dn},device:{manufacturer:b.vendor,model:b.model,osName:w.name,osVersion:w.version,browserName:_.name,browserVersion:_.version},request:{url:y,referrer:self.document?.referrer},metaData:{app:{surface:m,library:s,build_target:Un,env:Mn,hash_version_sandbox:a||"N/A",sandbox_url:c||"N/A"},device:{user_agent:r||self.navigator?.userAgent,rendering_engine_name:I.name,rendering_engine_version:I.version,browser_target:g||"N/A",deploy_phase:Mn},request:{shop_id:p,shop_domain:v||"N/A",shop_url:y,pixel_id:u,pixel_type:d,runtime_context:l},"Additional Notes":{init_config:JSON.stringify(h),notes:f},error_source:{shop_id:p},custom:{slice_name:"signals",slice_id:"S-27053f",observe_grouping_key:io(e,t)}}}]}}(r,s);fetch("https://error-analytics-production.shopifysvc.com",{method:"POST",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":"bcbc9f6762da195561967577c2d74ff8","Bugsnag-Payload-Version":"5"},body:JSON.stringify(a)}).catch(()=>{})}catch(o){}}};return t}(),lo=e=>{try{const t=new URL(e);return Boolean(t.protocol.startsWith("http")&&t.host)}catch{return!1}},po=new Set,ho=e=>(po.add(e),()=>{po.delete(e)});function fo(e){po.forEach(t=>{try{t(e)}catch(r){uo.notify(r,{context:"onConsentCollected/callEachCallback",unhandled:!1})}})}function mo(e){fo(e)}let vo=!1;const go=["analytics","preferences","marketing","sale_of_data"];function yo(e,t){return e?!t||Object.keys(e).every(r=>!e[r]||t[r]):gt()}function bo(e){const{promise:t,resolve:r}=zn(),n={analytics:Bn(),marketing:Vn(),preferences:Hn(),sale_of_data:Fn()};if(yo(e,n))return r(!0),t;const o=ho(t=>{const n=t.detail;yo(e,{analytics:!0===n?.analyticsAllowed,marketing:!0===n?.marketingAllowed,preferences:!0===n?.preferencesAllowed,sale_of_data:!0===n?.saleOfDataAllowed})&&(o(),r(!0))});return t}function wo(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var _o=0;function Io(e){return"__private_"+_o+++"_"+e}function xo(e){return Object.entries(e).map(([e,t])=>({key:e,value:{stringValue:String(t)}}))}function Eo(e){if(Array.isArray(e))return{arrayValue:{values:e.map(e=>Eo(e))}};switch(typeof e){case"boolean":return{boolValue:Boolean(e)};case"number":return{doubleValue:Number(e)};default:return{stringValue:String(e)}}}const ko=function(){const e=[0];for(let t=0;t<12;t++){const r=Math.floor(5*2**t);e.push(r)}return e}();var So=Io("exporter"),To=Io("attributes"),Co=Io("metrics"),Ao=Io("logs");class Po{constructor({exporter:e,attributes:t}){Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,To,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:[]}),Object.defineProperty(this,Ao,{writable:!0,value:[]}),wo(this,So)[So]=e,wo(this,To)[To]=null!=t?t:{}}addAttributes(e){wo(this,To)[To]={...wo(this,To)[To],...e}}histogram({name:e,value:t,unit:r,bounds:n,attributes:o,scale:i,requiresKeepalive:s}){const a=1e6*Date.now();n?wo(this,Co)[Co].push({name:e,type:"histogram",value:t,unit:r,timeUnixNano:a,attributes:o,bounds:n,requiresKeepalive:s}):wo(this,Co)[Co].push({name:e,type:"exponential_histogram",value:t,unit:r,timeUnixNano:a,attributes:o,scale:i,requiresKeepalive:s})}counter({name:e,value:t,unit:r,attributes:n,requiresKeepalive:o}){const i=1e6*Date.now();wo(this,Co)[Co].push({name:e,type:"counter",value:t,unit:r,timeUnixNano:i,attributes:n,requiresKeepalive:o})}gauge({name:e,value:t,unit:r,attributes:n,requiresKeepalive:o}){const i=1e6*Date.now();wo(this,Co)[Co].push({name:e,type:"gauge",value:t,unit:r,timeUnixNano:i,attributes:n,requiresKeepalive:o})}log({body:e,attributes:t,requiresKeepalive:r}){const n=1e6*Date.now();wo(this,Ao)[Ao].push({timeUnixNano:n,body:e,attributes:t,requiresKeepalive:r})}async exportMetrics(){wo(this,Co)[Co].forEach(e=>{e.attributes={...wo(this,To)[To],...e.attributes}});const e=wo(this,Co)[Co];wo(this,Co)[Co]=[],await this.exportByKeepalive(e,(e,t)=>wo(this,So)[So].exportMetrics(this.aggregateMetrics(e),t))}async exportLogs(){const e=wo(this,Ao)[Ao];wo(this,Ao)[Ao]=[],await this.exportByKeepalive(e,(e,t)=>wo(this,So)[So].exportLogs(this.formatLogs(e),t))}aggregateMetrics(e){const t={};return e.forEach(e=>{switch(e.type){case"histogram":!function(e,t){var r;const{name:n,value:o,unit:i,timeUnixNano:s,attributes:a}=t,c=null!==(r=t.bounds)&&void 0!==r?r:ko,u=new Array(c.length+1).fill(0);e[n]||={name:n,unit:i||"1",histogram:{aggregationTemporality:1,dataPoints:[]}};for(let d=0;d0?l:0,bucketCounts:n>0?[1]:[]};e[r].exponentialHistogram.dataPoints.push({attributes:xo(null!=s?s:{}),startTimeUnixNano:i,timeUnixNano:i,count:1,sum:c,scale:u,zeroCount:p,positive:h,negative:{offset:0,bucketCounts:[]},min:c,max:c,zeroThreshold:0})}(t,e);break;case"counter":!function(e,t){const{name:r,value:n,unit:o,timeUnixNano:i,attributes:s}=t;e[r]||={name:r,unit:o||"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}},e[r].sum.dataPoints.push({startTimeUnixNano:i,timeUnixNano:i,asDouble:n,attributes:xo(null!=s?s:{})})}(t,e);break;case"gauge":!function(e,t){const{name:r,value:n,unit:o,timeUnixNano:i,attributes:s}=t;e[r]||={name:r,unit:o||"1",gauge:{dataPoints:[]}},e[r].gauge.dataPoints.push({startTimeUnixNano:i,timeUnixNano:i,asDouble:n,attributes:xo(null!=s?s:{})})}(t,e)}}),Object.values(t)}async exportByKeepalive(e,t){if(0===e.length)return;const r=[],n=[];e.forEach(e=>{var t;null===(t=e.requiresKeepalive)||void 0===t||t?r.push(e):n.push(e)});const o=[r.length>0?t(r,{keepalive:!0}):void 0,n.length>0?t(n,{keepalive:!1}):void 0].filter(e=>void 0!==e);await Promise.all(o)}formatLogs(e){return e.map(e=>{const t={timeUnixNano:e.timeUnixNano,observedTimeUnixNano:e.timeUnixNano,attributes:(r={...wo(this,To)[To],...e.attributes},Object.entries(r).map(([e,t])=>({key:e,value:Eo(t)})))};var r;return e.body&&(t.body={stringValue:e.body}),t})}}var Oo=Io("url"),Ro=Io("serviceName"),No=Io("logger"),jo=Io("fetchFn"),Mo=Io("maxPayloadSizeBytes");class Uo{constructor(e,t,r){var n;Object.defineProperty(this,Oo,{writable:!0,value:void 0}),Object.defineProperty(this,Ro,{writable:!0,value:void 0}),Object.defineProperty(this,No,{writable:!0,value:void 0}),Object.defineProperty(this,jo,{writable:!0,value:void 0}),Object.defineProperty(this,Mo,{writable:!0,value:void 0}),wo(this,Oo)[Oo]=e.replace(/\/v1\/(logs|metrics|traces)\/?$/,""),wo(this,Ro)[Ro]=t,wo(this,No)[No]=null==r?void 0:r.logger,wo(this,jo)[jo]=null==r?void 0:r.fetchFn,wo(this,Mo)[Mo]=null!==(n=null==r?void 0:r.maxPayloadSizeBytes)&&void 0!==n?n:51200}async exportMetrics(e,t){var r;const n=null===(r=null==t?void 0:t.keepalive)||void 0===r||r;await this.exportBatches("/v1/metrics",[...e],e=>({resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:wo(this,Ro)[Ro]}}]},scopeMetrics:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},metrics:e}]}]}),n)}async exportLogs(e,t){var r;const n=null===(r=null==t?void 0:t.keepalive)||void 0===r||r;await this.exportBatches("/v1/logs",[...e],e=>({resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:wo(this,Ro)[Ro]}}]},scopeLogs:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},logRecords:e}]}]}),n)}async exportTo(e,t,r){var n;const o=JSON.stringify(e),i=(new TextEncoder).encode(o).length;if(i>wo(this,Mo)[Mo])throw new $o(`Payload size ${i} exceeds ${wo(this,Mo)[Mo]} bytes`);const s=await this.exporterFetch()(`${wo(this,Oo)[Oo]}${t}`,{method:"POST",keepalive:r,headers:{"Content-Type":"application/json"},body:o});if(null===(n=wo(this,No)[No])||void 0===n||n.log({status:s.status}),!s.ok){if(400===s.status){const e=await s.text();throw new Do(`Invalid OpenTelemetry Data: ${e}`)}if(429===s.status||503===s.status){const t=await s.text(),r=s.headers.get("Retry-After"),n=r?{seconds:Number(r)}:void 0;throw new Do("Server did not accept data",{errorData:t,retryAfter:n,body:e})}if(401===s.status||403===s.status){const t=await s.text();throw new Lo(`Authentication failed: ${s.status} ${401===s.status?"Unauthorized":"Forbidden"}`,{errorData:t,body:e})}throw new Do(`Server responded with ${s.status}`)}}exporterFetch(){return wo(this,jo)[jo]||fetch}async exportBatches(e,t,r,n){let o=t.length;for(;t.length>0;)try{const i=t.slice(0,o);await this.exportTo(r(i),e,n),t.splice(0,o)}catch(i){if(!(i instanceof $o&&o>1))throw i;o=Math.ceil(o/2)}}}class Do extends Error{constructor(e,t){super(e),this.metadata=void 0,this.name="OpenTelemetryClientError",this.metadata=t}}class $o extends Error{constructor(...e){super(...e),this.name="PayloadTooLargeError"}}class Lo extends Error{constructor(e,t){super(e),this.name="AuthenticationFailedError",this.metadata=void 0,this.name="AuthenticationFailedError",this.metadata=t}}let qo=function(e){return e.Histogram="histogram",e.Counter="counter",e.Gauge="gauge",e.ExponentialHistogram="exponential_histogram",e}({});var Vo=tn("client"),Bo=tn("metrics"),Ho=tn("prefix"),Fo=tn("defaultAttributes");class zo{constructor({client:e,metrics:t,prefix:r,defaultAttributes:n}){Object.defineProperty(this,Vo,{writable:!0,value:void 0}),Object.defineProperty(this,Bo,{writable:!0,value:void 0}),Object.defineProperty(this,Ho,{writable:!0,value:void 0}),Object.defineProperty(this,Fo,{writable:!0,value:void 0}),Zr(this,Vo)[Vo]=e,Zr(this,Bo)[Bo]=t,Zr(this,Ho)[Ho]=r??"",Zr(this,Fo)[Fo]=n??{}}record(e,t,...r){const n=Zr(this,Bo)[Bo][e],o=String(e),i=r[0]??{},s={name:Zr(this,Ho)[Ho]?`${Zr(this,Ho)[Ho]}_${o}`:o,value:t,unit:n.unit,attributes:{...Zr(this,Fo)[Fo],...i}},a=n.type;switch(a){case qo.Counter:case qo.Gauge:Zr(this,Vo)[Vo][a](s);break;case qo.Histogram:Zr(this,Vo)[Vo].histogram({...s,bounds:n.bounds});break;case qo.ExponentialHistogram:Zr(this,Vo)[Vo].histogram({...s,scale:n.scale});break;default:throw new me(`Unknown metric type: ${a}`)}Zr(this,Vo)[Vo].exportMetrics().catch(()=>{})}log(e,t){Zr(this,Vo)[Vo].log({body:e,attributes:{...Zr(this,Fo)[Fo],...t}}),Zr(this,Vo)[Vo].exportLogs().catch(()=>{})}}var Wo=tn("client");class Ko{constructor({client:e,throttleDelay:t}){Object.defineProperty(this,Wo,{writable:!0,value:void 0}),Zr(this,Wo)[Wo]=t?function(e,t){return{counter:e.counter.bind(e),gauge:e.gauge.bind(e),histogram:e.histogram.bind(e),log:e.log.bind(e),exportMetrics:Kr(()=>e.exportMetrics().catch(()=>{}),t),exportLogs:Kr(()=>e.exportLogs().catch(()=>{}),t)}}(e,t):e}createClient(e){return new zo({...e,client:Zr(this,Wo)[Wo]})}}var Yo=tn("prefix");class Jo{constructor(e="OpenTelemetry"){Object.defineProperty(this,Yo,{writable:!0,value:void 0}),Zr(this,Yo)[Yo]=e}exportMetrics(e){return console.log(`[${Zr(this,Yo)[Yo]}] Metrics:`,e),Promise.resolve()}exportLogs(e){return console.log(`[${Zr(this,Yo)[Yo]}] Logs:`,e),Promise.resolve()}}const Xo={feature_usage:{unit:"1",type:qo.Counter}},Go=["platform","platformVersion","architecture","model","uaFullVersion","bitness","fullVersionList","wow64"];var Qo=tn("attrs"),Zo=tn("prefetchStarted"),ei=tn("buildBaseAttributes"),ti=tn("requestHighEntropyValues");class ri{constructor(){Object.defineProperty(this,ti,{value:oi}),Object.defineProperty(this,ei,{value:ni}),Object.defineProperty(this,Qo,{writable:!0,value:void 0}),Object.defineProperty(this,Zo,{writable:!0,value:!1})}prefetch(){Zr(this,Zo)[Zo]||(Zr(this,Qo)[Qo]??=Zr(this,ei)[ei](),Zr(this,Qo)[Qo]&&(Zr(this,Zo)[Zo]=!0,Zr(this,ti)[ti]()))}getAttributes(){return this.prefetch(),Zr(this,Qo)[Qo]}}function ni(){return Mr(()=>{const e=self.navigator,t=self.screen;return{tzo:(new Date).getTimezoneOffset(),mtp:e.maxTouchPoints,sw:t.width,sh:t.height,scd:t.colorDepth}})}function oi(){const e=Mr(()=>self.navigator.userAgentData);e?.getHighEntropyValues&&Mr(()=>e.getHighEntropyValues(Go).then(e=>{const t=Mr(()=>JSON.stringify(e));void 0!==t&&Zr(this,Qo)[Qo]&&(Zr(this,Qo)[Qo].uahe=t)}).catch(()=>{}))}const ii={},si={"pixel:register":{start:{name:"pixel:register:started",params:{pixelId:"",source:""}},end:{name:"pixel:register:completed",params:{pixelId:"",source:""}}},"page:session":{start:{name:"start",params:ii},end:{name:"page:unload",params:ii}},completed:{start:{name:"start",params:ii},end:{name:"pixels:resolved",params:ii}}};function ai(e,t=ii){const r=ui(e,"end",t),n=function(e,t){try{const r=di(e,"start",t),n=di(e,"end",t),o=function(e,t){return li(e,t)}(e,t),i=self.performance.measure(o,r,n);return{...i,duration:Math.round(i.duration),startTime:Math.round(i.startTime)}}catch(r){return null}}(e,t);return{mark:r,measurement:n}}function ci(){const[e]=window.performance?.getEntriesByType("navigation")||[];return e&&function(e){return"type"in e}(e)?e:void 0}function ui(e,t,r){try{const n=di(e,t,r);return self.performance.mark(n),{name:n,params:r}}catch(n){return{name:null,params:r}}}function di(e,t,r){return li(si[e][t].name,r)}function li(e,t={}){const r=["wpm",e];return Object.keys(t).forEach(e=>{const n=t[e];n&&r.push(n)}),r.join(":")}const pi={test:"edge_test_click/1.0",load:"web_pixels_manager_load/3.3",init:"web_pixels_manager_init/3.2",register:"web_pixels_manager_pixel_register/3.8",subscriberEventEmit:"web_pixels_manager_subscriber_event_emit/4.1",eventPublish:"web_pixels_manager_event_publish/1.7",unload:"web_pixels_manager_unload/1.2",visitor:"web_pixels_manager_visitor/1.0",subscriberEventEmitDom:"web_pixels_manager_subscriber_event_emit_dom/2.0",subscriberEventEmitPrivacy:"web_pixels_manager_subscriber_event_emit_privacy/1.0",helperLoad:"web_pixels_helper_load/1.0",helperWindowButtonClick:"web_pixels_helper_window_button_click/1.0",buyerEventSample:"web_pixels_manager_buyer_event_sample/1.0",webPixelsStorefrontCustomerTracking:"web_pixels_manager_storefront_customer_tracking/1.0",webPixelsManagerSubscriberEventBlocked:"web_pixels_manager_subscriber_event_blocked/1.1"};function hi(e,t){return{schemaId:pi[e],payload:t}}let fi;function mi(e,{flush:t=!1,credentials:r=!1}={}){fi?.produce(e.schemaId,e.payload,{flush:t,credentials:r})}function vi(e,t,r=!1){mi(hi(e,t),{flush:r})}function gi(){return{events:[],timeoutId:void 0,flushCount:0,lastFlushTime:void 0}}var yi=tn("delayStrategy"),bi=tn("onError"),wi=tn("maxBatchBytes"),_i=tn("batches"),Ii=tn("hiddenFlushScheduled"),xi=tn("onPageHide"),Ei=tn("onVisibilityChange"),ki=tn("scheduleHiddenFlush"),Si=tn("getBatch"),Ti=tn("flushAll"),Ci=tn("flushBatch"),Ai=tn("sendChunked"),Pi=tn("clearBatchTimeout");class Oi{constructor(e,t=[]){Object.defineProperty(this,Pi,{value:Di}),Object.defineProperty(this,Ai,{value:Ui}),Object.defineProperty(this,Ci,{value:Mi}),Object.defineProperty(this,Ti,{value:ji}),Object.defineProperty(this,Si,{value:Ni}),Object.defineProperty(this,ki,{value:Ri}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:new Map}),Object.defineProperty(this,Ii,{writable:!0,value:!1}),Object.defineProperty(this,xi,{writable:!0,value:()=>{Zr(this,Ti)[Ti](!0)}}),Object.defineProperty(this,Ei,{writable:!0,value:()=>{"hidden"===document.visibilityState&&Zr(this,Ti)[Ti](!1)}}),Zr(this,yi)[yi]=e.delayStrategy??((e,t)=>t>=50?0:50),Zr(this,bi)[bi]=e.onError,Zr(this,wi)[wi]=e.maxBatchBytes??2e4;for(const r of t)Zr(this,_i)[_i].set(r,gi());window.addEventListener("pagehide",Zr(this,xi)[xi]),document.addEventListener("visibilitychange",Zr(this,Ei)[Ei])}destroy(){window.removeEventListener("pagehide",Zr(this,xi)[xi]),document.removeEventListener("visibilitychange",Zr(this,Ei)[Ei]),Zr(this,Ii)[Ii]=!1;for(const e of Zr(this,_i)[_i].values())Zr(this,Pi)[Pi](e)}flush(){Zr(this,Ti)[Ti](!1)}get pendingEvents(){const e=[];for(const t of Zr(this,_i)[_i].values())e.push(...t.events);return e}reportError(e){Zr(this,bi)[bi]?.(e)}enqueue(e,t,r){const n=Zr(this,Si)[Si](r);if(n.events.push(e),t)this.flush();else if("hidden"===document.visibilityState)Zr(this,ki)[ki]();else if(void 0===n.timeoutId){const e=void 0===n.lastFlushTime?1/0:(new Date).valueOf()-n.lastFlushTime,t=Zr(this,yi)[yi](n.flushCount,e);n.timeoutId=setTimeout(()=>Zr(this,Ci)[Ci](r,n,!1),t)}}}function Ri(){Zr(this,Ii)[Ii]||("function"==typeof queueMicrotask?(Zr(this,Ii)[Ii]=!0,queueMicrotask(()=>{Zr(this,Ii)[Ii]&&(Zr(this,Ii)[Ii]=!1,this.flush())})):this.flush())}function Ni(e){let t=Zr(this,_i)[_i].get(e);return t||(t={events:[],timeoutId:void 0,flushCount:0,lastFlushTime:void 0},Zr(this,_i)[_i].set(e,t)),t}function ji(e){for(const[t,r]of Zr(this,_i)[_i])Zr(this,Ci)[Ci](t,r,e)}function Mi(e,t,r){Zr(this,Pi)[Pi](t),0!==t.events.length&&(t.flushCount++,t.lastFlushTime=(new Date).valueOf(),Zr(this,Ai)[Ai](t.events.splice(0),{isFinal:r,batch:e}))}function Ui(e,t){let r;try{r=this.serialize(e)}catch(s){return void this.reportError(s)}if(n=r,o=Zr(this,wi)[wi],3*n.length<=o||!(new Blob([n]).size>o)||1===e.length){try{this.send(r,t)}catch(s){this.reportError(s)}return}var n,o;const i=Math.ceil(e.length/2);Zr(this,Ai)[Ai](e.slice(0,i),t),Zr(this,Ai)[Ai](e.slice(i),t)}function Di(e){void 0!==e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=void 0)}function $i(){throw new Error("fetch is unavailable")}const Li=Mr(()=>{const e="undefined"==typeof window?void 0:window.fetch;return"function"==typeof e?e.bind(window):$i},$i),qi=Mr(()=>{const e="undefined"==typeof window?void 0:window.navigator.sendBeacon;return"function"==typeof e?e.bind(window.navigator):()=>!1},()=>!1);function Vi(e){return e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()}function Bi(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function Hi(e,{visited:t=new WeakMap,preserveKeys:r}={}){if(!Bi(e))return e;const n=new Set(r),o=t.get(e);if(o)return o;const i={};t.set(e,i);for(const[s,a]of Object.entries(e)){const e=n.has(s)?s:Vi(s);Array.isArray(a)?i[e]=a.map(e=>Hi(e,{visited:t})):Bi(a)?i[e]=Hi(a,{visited:t}):i[e]=a}return i}function Fi(e,t){return function(e){if("function"!=typeof e)return e;try{return e()}catch{return}}(t)}const zi=["include","omit"];var Wi=tn("endpoint"),Ki=tn("sendWithCredentials"),Yi=tn("sendWithoutCredentials");class Ji extends Oi{constructor(e){super(e,zi),Object.defineProperty(this,Yi,{value:Gi}),Object.defineProperty(this,Ki,{value:Xi}),Object.defineProperty(this,Wi,{writable:!0,value:void 0}),Zr(this,Wi)[Wi]=e.endpoint}setEndpoint(e){Zr(this,Wi)[Wi]=e}produce(e,t,{flush:r,convertEventCase:n=!0,preserveEventCase:o=[],credentials:i=!0}={}){const s=t,a=n?Hi(s,{preserveKeys:o}):s;Zr(this,Wi)[Wi]?this.enqueue({schema_id:e,payload:a,metadata:{event_created_at_ms:(new Date).getTime()}},r,i?"include":"omit"):console.log("[MonorailClient]",e,a)}serialize(e){const t={events:e,metadata:{event_sent_at_ms:(new Date).getTime()}};return JSON.stringify(t,Fi)}send(e,{isFinal:t,batch:r}){const n=Zr(this,Wi)[Wi];n&&("omit"!==r||t||"hidden"===document.visibilityState?Zr(this,Ki)[Ki](n,e,t):Zr(this,Yi)[Yi](n,e))}}function Xi(e,t,r){if(Mr(()=>qi(e,t),!1)||r)return;const n=new XMLHttpRequest;n.open("POST",e,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(t)}function Gi(e,t){new Promise(r=>{r(Li(e,{method:"POST",headers:{"Content-Type":"text/plain"},body:t,credentials:"omit",mode:"no-cors",keepalive:!0}))}).catch(()=>Zr(this,Ki)[Ki](e,t,!1)).catch(e=>this.reportError(e))}function Qi({storefrontBaseUrl:e,region:t,endpoint:r}){return r||`${function(e,t){const r={global:"https://monorail-edge.shopifysvc.com",wellKnown:`${e}/.well-known/shopify/monorail`,staging:"https://monorail-edge-staging.shopifysvc.com",test:"https://localhost"},n=t||"wellKnown";return n in r?r[n]:r.wellKnown}(bn(e),t)}/unstable/produce_batch`}function Zi(e){const t=[0];for(const r of e){let e=Number.parseInt(r,16);for(let r=0;r0;)t.push(e%10),e=Math.floor(e/10)}return t.reverse().join("")}function es(){return`${(new Date).getTime().toString()}${Math.floor(1e6*Math.random()).toString().padStart(6,"0")}`}function ts(e){return void 0===e?{lowid:es(),highid:es()}:{lowid:String(e)}}function rs(e){const t=e.replace(/-/g,"");if(!/^[0-9a-f]{32}$/i.test(t))throw new Error("Invalid UUID format");return{highid:Zi(t.slice(0,16)),lowid:Zi(t.slice(16))}}const ns="production",os=[ns,"test"];var is=tn("endpoint"),ss=tn("sendXhr"),as=tn("sendToDestination");class cs extends Oi{constructor(e){super(e,os),Object.defineProperty(this,as,{value:ds}),Object.defineProperty(this,ss,{value:us}),Object.defineProperty(this,is,{writable:!0,value:void 0}),Zr(this,is)[is]=e.endpoint}produce(e,{flush:t,destination:r}={}){this.enqueue(e,t,r??ns)}serialize(e){const t=(new Date).toISOString(),r={events:e.map(e=>e.client?.message?{...e,client:{...e.client,message:{...e.client.message,sentAt:t}}}:e)};return JSON.stringify(r)}send(e,{isFinal:t,batch:r}){const n=Zr(this,is)[is];void 0===r||r===ns?Mr(()=>qi(n,e),!1)||t||Zr(this,ss)[ss](n,e):Zr(this,as)[as](n,e,r,t)}}function us(e,t,r){const n=new XMLHttpRequest;n.open("POST",e,!0),n.setRequestHeader("Content-Type","text/plain"),r&&n.setRequestHeader("X-Event-Destination",r),n.send(t)}function ds(e,t,r,n){const o=o=>{if(n)this.reportError(o);else try{Zr(this,ss)[ss](e,t,r)}catch(i){this.reportError(i)}};let i;try{i=Li(e,{method:"POST",headers:{"Content-Type":"text/plain","X-Event-Destination":r},body:t,keepalive:!0})}catch(s){return void o(s)}i.then(e=>{e.ok||this.reportError(new Error(`FEC rejected a ${r} batch: ${e.status}`))}).catch(o)}const ls=[["analyticsProcessingAllowed","USER_CONSENT_TYPE_ANALYTICS"],["marketingAllowed","USER_CONSENT_TYPE_MARKETING"],["preferencesProcessingAllowed","USER_CONSENT_TYPE_PREFERENCES"],["saleOfDataAllowed","USER_CONSENT_TYPE_SALE_OF_DATA"]];function ps(e){return ls.filter(([t])=>e[t]).map(([,e])=>({consentType:e}))}function hs(e){switch(e){case ve.CheckoutOneShopApp:case ve.CheckoutOneNativeShopApp:case ve.CheckoutOneSdkShopApp:case ve.CheckoutKitShopApp:return"shop-pay";case ve.Shopify:case ve.StorefrontRenderer:case ve.CheckoutOne:case ve.CheckoutOneSdk:case ve.CheckoutKit:case ve.CustomerAccount:return"storefront";case ve.Unknown:case ve.NotAvailable:default:return"unspecified"}}const fs={"shop-pay":"EVENT_APP_SHOP_PAY",storefront:"EVENT_APP_STOREFRONT",unspecified:"EVENT_APP_UNSPECIFIED"},ms={"shop-pay":"DATA_ORIGINATOR_SHOPIFY",storefront:"DATA_ORIGINATOR_MERCHANT",unspecified:"DATA_ORIGINATOR_UNSPECIFIED"};function vs(e){return ms[hs(e)]}function gs(e){return`${bn(e)}/.well-known/shopify/fec/produce`}var ys=tn("proto"),bs=tn("context");class ws{constructor({storefrontBaseUrl:e,frontendEventCollectorEndpoint:t,onError:r,...n}){Object.defineProperty(this,ys,{writable:!0,value:void 0}),Object.defineProperty(this,bs,{writable:!0,value:void 0}),Zr(this,ys)[ys]=new cs({endpoint:t||gs(e),onError:r}),Zr(this,bs)[bs]=n}produce(e,t={}){const{consent:r}=Zr(this,bs)[bs],n=r.trackingTokens.getUniqueToken(),{canonicalContext:o,clientMessageCreatedAt:i,clientMessageId:s,destination:a,pageContext:c,source:u,tags:d,userContext:l}=t,p=o?.page,h="apiClientId"in t?t.apiClientId:Zr(this,bs)[bs].apiClientId,f=l&&"customerId"in l?l.customerId:Zr(this,bs)[bs].customerId,m={source:u??(v=Zr(this,bs)[bs].surface,fs[hs(v)]),eventClass:"EVENT_CLASS_EVENT",dataOriginator:vs(Zr(this,bs)[bs].surface),user:{type:"USER_TYPE_BUYER",...n&&{domainScopedBrowserId:{value:n}},...l?.email&&{email:{address:l.email}},...l?.phone&&{phone:{number:l.phone}},...void 0!==f&&{customer:{id:ts(f)}}},shop:{id:ts(Zr(this,bs)[bs].shopId)},...void 0!==d&&{tags:d},session:{clientSessionToken:r.trackingTokens.getVisitToken()},...Zr(this,bs)[bs].httpRequestId&&{server:{request:{httpRequestId:Zr(this,bs)[bs].httpRequestId}}},...void 0!==h&&{apiClient:{id:ts(h)}},userConsents:ps({analyticsProcessingAllowed:r.analyticsProcessingAllowed(),marketingAllowed:r.marketingAllowed(),preferencesProcessingAllowed:r.preferencesProcessingAllowed(),saleOfDataAllowed:r.saleOfDataAllowed()}),...void 0!==p&&{page:{source:"SOURCE_CLIENT_BROWSER",url:!0===p?c?.url??window.location.href:p.url,...Zr(this,bs)[bs].pageReferrer&&{referrer:Zr(this,bs)[bs].pageReferrer}}},client:{message:{id:void 0===s?ts():rs(s),...void 0!==i&&{createdAt:i}},browser:{href:c?.url??Zr(this,bs)[bs].pageUrl},tokens:{pageViewToken:Zr(this,bs)[bs].pageId},...void 0!==o?.view&&{view:o.view}},payload:e};var v;Zr(this,ys)[ys].produce(m,{destination:a})}}function _s(e,t,r,n=!0){try{const o={...n?Object.getOwnPropertyDescriptor(e,t):{},...r};return Object.defineProperty(e,t,o)}catch(o){return e}}const Is="_shopify_test";function xs(e){zt(`${Is}=1; path=/; domain=${e}`)}function Es(e){zt(`${Is}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=${e}`)}function ks(){return window?.location?.hostname||""}const Ss=qt(()=>{const e=[];for(const r of(t=ks())?t.split(".").reverse().reduce((e,t)=>{const r=e[e.length-1];return e.push(r?`${t}.${r}`:t),e},[]):[])xs(r),Wt(Is)||e.push(r),Es(r);var t;return e},{cacheKey:()=>ks()});function Ts(e,t){return t.reduce((t,r)=>(r in e&&(t[r]=e[r]),t),{})}const Cs={uniqueToken:"_shopify_y",visitToken:"_shopify_s"},As={uniqueToken:()=>jt(),visitToken:()=>Mt()};class Ps{constructor({onError:e}={}){this.trackingTokens=void 0,this.analyticsProcessingAllowed=Bn,this.marketingAllowed=Vn,this.preferencesProcessingAllowed=Hn,this.saleOfDataAllowed=Fn,this.onConsentCollected=ho,this.trackingTokens=function(e,{onError:t}={}){function r(r,n){for(const i of e){let e;try{e=i.read(r,n)}catch(o){t?.(o);continue}if("string"==typeof e)return e}return n??""}return{getUniqueToken:e=>r("uniqueToken",e),getVisitToken:e=>r("visitToken",e),dispose:()=>{for(const n of e)try{n.dispose?.()}catch(r){t?.(r)}}}}([{read:e=>As[e]()||void 0},{read:e=>Wt(Cs[e])||void 0}],{onError:e})}}class Os extends Set{constructor(e,t){if(super(),Number.isFinite(e)&&!Number.isInteger(e)||e<=0)throw new Error("Invalid maxSize specified");this.maxSize=e,this.keep=t}add(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 Rs=Symbol("eventBusReplay");class Ns{constructor({bufferSize:e=50,replayKeep:t="oldest",subscribeAllKey:r,onSubscriberError:n}={}){this.channelSubscribers=new Map,this.bufferSize=e,this.replayKeep=t,this.subscribeAllKey=r,this.replayQueue=new Os(e,t),this.onSubscriberError=n,this.middlewareChain=e=>e()}use(...e){return e.forEach(e=>this.useMiddleware(e)),this}publish(e,t,r={}){if(this.subscribeAllKey&&e===this.subscribeAllKey)throw new Error(`Cannot publish to ${String(e)}`);this.replayQueue.add({name:e,payload:t,options:r});const n=(n,o)=>{this.processEvent(e,t,o,r,n)};return[this.channelSubscribers.get(e),this.subscribeAllKey?this.channelSubscribers.get(this.subscribeAllKey):void 0].filter(e=>!!e).forEach(e=>e.forEach(n)),!0}subscribe(e,t,r={}){const n=this.channelSubscribers.get(e)||new Map;return this.channelSubscribers.set(e,n.set(t,r)),this.replayQueue.forEach(({name:n,payload:o,options:i})=>{(e===n||this.subscribeAllKey&&e===this.subscribeAllKey)&&this.processEvent(n,o,t,{...i,[Rs]:!0},r)}),()=>n.delete(t)}processEvent(e,t,r,n={},o={}){const i=(e=t)=>{r.call({},e)};try{this.middlewareChain(i,e,t,n,o)}catch(s){this.onSubscriberError?this.onSubscriberError(s):console?.error(`Error in subscriber for event ${e}:`,s)}}useMiddleware(e){const t=this.middlewareChain;this.middlewareChain=(r,n,o,...i)=>{t((t=o)=>{let s=!1;e((e=t)=>{s||(s=!0,r(e))},n,t,...i),s=!0},n,o,...i)}}}var js=(e=>(e.Standard="standard",e.Advanced="advanced",e))(js||{});const Ms="remote-ui::ready";function Us(e,{terminate:t=!0,targetOrigin:r="*"}={}){var n;if("undefined"==typeof window)throw new Error("You can only run fromIframe() in a browser context, but no window was found.");const o=new WeakMap;let i;function s(t){t.source===e.contentWindow&&t.data===Ms&&(window.removeEventListener("message",s),i())}null===(n=e.contentWindow)||void 0===n||n.postMessage(Ms,r);const a=new Promise(e=>{i=e,window.addEventListener("message",s)});return{async postMessage(t,n){var o;await a,null===(o=e.contentWindow)||void 0===o||o.postMessage(t,r,n)},addEventListener(t,r){const n=t=>{t.source===e.contentWindow&&r(t)};o.set(r,n),self.addEventListener(t,n)},removeEventListener(e,t){const r=o.get(t);null!=r&&(o.delete(t),self.removeEventListener(e,r))},terminate(){window.removeEventListener("message",s),t&&e.remove()}}}const Ds=Symbol.for("RemoteUi::Retain"),$s=Symbol.for("RemoteUi::Release"),Ls=Symbol.for("RemoteUi::RetainedBy");class qs{constructor(){this.memoryManaged=new Set}add(e){this.memoryManaged.add(e),e[Ls].add(this),e[Ds]()}release(){for(const e of this.memoryManaged)e[Ls].delete(this),e[$s]();this.memoryManaged.clear()}}function Vs(e){return Boolean(e&&e[Ds]&&e[$s])}function Bs(e,{deep:t=!0}={}){return Hs(e,t,new Map)}function Hs(e,t,r){const n=r.get(e);if(null!=n)return n;const o=Vs(e);if(o&&e[Ds](),r.set(e,o),t){if(Array.isArray(e)){const n=e.reduce((e,n)=>Hs(n,t,r)||e,o);return r.set(e,n),n}if(Ws(e)){const n=Object.keys(e).reduce((n,o)=>Hs(e[o],t,r)||n,o);return r.set(e,n),n}}return r.set(e,o),o}function Fs(e,{deep:t=!0}={}){return zs(e,t,new Map)}function zs(e,t,r){const n=r.get(e);if(null!=n)return n;const o=Vs(e);if(o&&e[$s](),r.set(e,o),t){if(Array.isArray(e)){const n=e.reduce((e,n)=>zs(n,t,r)||e,o);return r.set(e,n),n}if(Ws(e)){const n=Object.keys(e).reduce((n,o)=>zs(e[o],t,r)||n,o);return r.set(e,n),n}}return o}function Ws(e){if(null==e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}const Ks="_@f",Ys=Object.create(null);function Js(e){try{return Object.fromEntries(e)}catch(t){const r={};for(let n=0;n{const[r,o=[]]=n(t,i);return e.push(...o),r}),e];return i.set(o,t),t}if(Ws(o)){i.set(o,[void 0]);const e=[],t=[Js(Object.keys(o).map(t=>{const[r,s=[]]=n(o[t],i);return e.push(...s),[t,r]})),e];return i.set(o,t),t}}if("function"==typeof o){if(t.has(o)){const e=t.get(o),r=[{[Ks]:e}];return i.set(o,r),r}const n=e.uuid();t.set(o,n),r.set(n,o);const s=[{[Ks]:n}];return i.set(o,s),s}const a=[o];return i.set(o,a),a},decode:o,async call(e,t){const n=new qs,i=r.get(e);if(null==i)throw new Error("You attempted to call a function that was already released.");try{const e=Vs(i)?[n,...i[Ls]]:[n];return await i(...o(t,e))}finally{n.release()}},release(e){const n=r.get(e);n&&(r.delete(e),t.delete(n))},terminate(){t.clear(),r.clear(),n.clear()}};function o(t,r){if("object"==typeof t){if(null==t)return t;if(Array.isArray(t))return t.map(e=>o(e,r));if(Ks in t){const o=t[Ks];if(n.has(o))return n.get(o);let i=0,s=!1;const a=()=>{i-=1,0===i&&(s=!0,n.delete(o),e.release(o))},c=()=>{i+=1},u=new Set(r),d=(...t)=>{if(s)throw new Error("You attempted to call a function that was already released.");if(!n.has(o))throw new Error("You attempted to call a function that was already revoked.");return e.call(o,t)};Object.defineProperties(d,{[$s]:{value:a,writable:!1},[Ds]:{value:c,writable:!1},[Ls]:{value:u,writable:!1}});for(const e of u)e.add(d);return n.set(o,d),d}if(Ws(t))return Js(Object.keys(t).map(e=>[e,o(t[e],r)]))}return t}}Ys.enumerable=!0,Ys.writable=!0,Ys.configurable=!0;class Gs extends Error{constructor(e){const{callId:t,error:r,result:n}=e;super(`No resolver found for call ID: ${t}${r?` Error: ${String(r)}`:""}${null==n?"":` Result: ${JSON.stringify(n)}`}`),this.callId=void 0,this.error=void 0,this.result=void 0,this.groupingHash="RemoteUI::MissingResolverError",this.name="MissingResolverError",this.callId=t,this.error=r,this.result=n}}function Qs(e,{uuid:t=Zs,createEncoder:r=Xs,callable:n}={}){let o=!1,i=e;const s=new Map,a=new Map,c=function(e,t){let r;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;r=new Proxy({},{get(r,n){if(t.has(n))return t.get(n);const o=e(n);return t.set(n,o),o}})}else{r={};for(const n of t)Object.defineProperty(r,n,{value:e(n),writable:!1,configurable:!0,enumerable:!0})}return r}(p,n),u=r({uuid:t,release(e){d(3,[e])},call(e,r,n){const o=t(),i=h(o,n),[s,a]=u.encode(r);return d(5,[o,e,s],a),i}});return i.addEventListener("message",l),{call:c,replace(e){const t=i;i=e,t.removeEventListener("message",l),e.addEventListener("message",l)},expose(e){for(const t of Object.keys(e)){const r=e[t];"function"==typeof r?s.set(t,r):s.delete(t)}},callable(...e){if(null!=n)for(const t of e)Object.defineProperty(c,t,{value:p(t),writable:!1,configurable:!0,enumerable:!0})},terminate(){d(2,void 0),f(),i.terminate&&i.terminate()}};function d(e,t,r){o||i.postMessage(t?[e,t]:[e],r)}async function l(e){if(o)return;const{data:t}=e;var r;if(r=t,Array.isArray(r)&&"number"==typeof r[0]&&(null==r[1]||Array.isArray(r[1])))switch(t[0]){case 2:f();break;case 0:{const e=new qs,[r,o,i]=t[1],a=s.get(o);try{if(null==a)throw new Error(`No '${o}' method is exposed on this endpoint`);const[t,n]=u.encode(await a(...u.decode(i,[e])));d(1,[r,void 0,t],n)}catch(n){const{name:e,message:t,stack:o}=n;throw d(1,[r,{name:e,message:t,stack:o}]),n}finally{e.release()}break}case 1:{const[e,r,n]=t[1],o=a.get(e);if(null==o)throw new Gs({callId:e,error:r,result:n});o(...t[1]),a.delete(e);break}case 3:{const[e]=t[1];u.release(e);break}case 6:{const[e,r,n]=t[1],o=a.get(e);if(null==o)throw new Gs({callId:e,error:r,result:n});o(...t[1]),a.delete(e);break}case 5:{const[e,r,o]=t[1];try{const t=await u.call(r,o),[n,i]=u.encode(t);d(6,[e,void 0,n],i)}catch(n){const{name:t,message:r,stack:o}=n;throw d(6,[e,{name:t,message:r,stack:o}]),n}break}}}function p(e){return(...r)=>{if(o)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 n=t(),i=h(n),[s,a]=u.encode(r);return d(0,[n,e,s],a),i}}function h(e,t){return new Promise((r,n)=>{a.set(e,(e,o,i)=>{if(null==o)r(i&&u.decode(i,t));else{const e=new Error;Object.assign(e,o),n(e)}})})}function f(){var e;o=!0,s.clear(),a.clear(),null===(e=u.terminate)||void 0===e||e.call(u),i.removeEventListener("message",l)}}function Zs(){return`${ea()}-${ea()}-${ea()}-${ea()}`}function ea(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}const ta=(e,t,{important:r=!1}={})=>Object.keys(t).forEach(n=>{const o=t[n],[i="",s=(r?"important":void 0)]=Array.isArray(o)?o:[o];e.style.setProperty(n,i,s)}),ra="web-pixels-helper-sandbox-handle",na={height:"26px",width:"21px",top:"12px",left:"12px"},oa={height:"100%",width:"100%",top:"0px",left:"0px"};const ia=25;function sa(e){return e instanceof HTMLElement||e instanceof SVGElement}function aa({id:e,tagName:t,attributes:r,dataset:n,styles:o}){const i=document.querySelector(`${t}#${e}`);if(i)return[i,!1];const s=((e,t)=>{const r=document.createElement(e);return Object.keys(t).forEach(e=>{const n=t[e];void 0!==n&&r.setAttribute(e,n)}),r})(t,{...r,id:e});return n&&Object.keys(n).forEach(e=>{s.dataset[e]=n[e]}),ta(s,o.props,o.options),[s,!0]}async function ca({containerSpec:e,iframeSpec:t}){await(document.body?Promise.resolve():new Promise(e=>{if("loading"!==document.readyState)return void e();const t=()=>{"loading"!==document.readyState&&(document.removeEventListener("readystatechange",t),e())};document.addEventListener("readystatechange",t)}));const[r,n]=aa({id:e.id,tagName:e.tagName,styles:{props:e.styles,options:{important:!0}},attributes:{tabIndex:"-1",...e.attributes},dataset:e.dataset});n&&document.body.appendChild(r);const o=t.attributes||{},[i,s]=aa({id:t.id,tagName:"iframe",styles:{props:t.styles,options:{important:!0}},attributes:{tabIndex:"-1",...o,name:t.id,src:t.src}});if(s){if(t.privileges){if(!function(e){return"sandbox"in e}(i))throw new so("browser does not support the sandbox attribute on IFrames");i.setAttribute("sandbox",t.privileges.join(" "))}r.appendChild(i)}return{container:r,iframe:i}}async function ua({state:e,extensionsBaseUrl:t,onHelperReady:r}){const n=await async function({extensionsBaseUrl:e,height:t=216,position:r=null}){const n=`${e}/web-pixels-helper/h${Dn}m.html`;return ca({containerSpec:{id:"web-pixels-helper-sandbox-container",tagName:"dialog",attributes:{popover:"manual"},styles:{...r?{top:`${r.y}px`,left:`${r.x}px`,right:"auto",bottom:"auto"}:{top:"max(0px, calc(100% - 770px))",bottom:"auto",right:"30px",left:"auto"},width:"393px",height:`${t}px`,position:"fixed",border:"0",opacity:"0",margin:"0",padding:"0",background:"transparent",overflow:"hidden",visibility:"hidden",transform:"translate(0px, 0px)","border-radius":"16px","box-shadow":"rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 5px 8px 0px, rgba(0, 0, 0, 0.12) 0px 1px 14px 0px",transition:"opacity 200ms ease-in-out, height 300ms ease-in-out, top 300ms ease-in-out, box-shadow 300ms",display:"block","pointer-events":"auto"},dataset:{shopifyPrivacy:"exclude"}},iframeSpec:{id:"web-pixels-helper-sandbox-iframe",src:n,styles:{border:"none",background:"#fff",clip:"initial",display:"inline",margin:"0",opacity:"1",padding:"0",visibility:"visible",width:"100%",height:"100%","border-radius":"16px"}}})}({extensionsBaseUrl:t,height:e.height,position:e.position}),o=Qs(Us(n.iframe),{callable:["initializeHelper","logConsentGranted","logPixelRegister","logSubscribe","logEvent"]}),i=da({state:e,reference:n,onHelperReady:r});return o.expose({...i}),function(e,t){if(e.querySelector(`#${ra}`))return;const r=document.createElement("div");r.setAttribute("id",ra),ta(r,{display:"block",position:"absolute",cursor:"grab",background:"transparent",...na},{important:!0}),e.appendChild(r),r.addEventListener("mousedown",function({container:e,handle:t,onMove:r},n){function o(t){t.preventDefault();const o=ia,i=self.innerHeight-ia,s=ia,a=self.innerWidth-ia;if(t.clientYi||t.clientXa)return;r&&r(t.clientX-ia,t.clientY-ia),n[1]=n[3]-t.clientX,n[2]=n[4]-t.clientY,n[3]=t.clientX,n[4]=t.clientY;const c=new DOMMatrix(getComputedStyle(e).transform),u=c.e,d=c.f,l=u-n[1],p=d-n[2];ta(e,{transform:`translate(${l}px, ${p}px)`},{important:!0})}function i(e){ta(t,na,{important:!0}),self.removeEventListener("mouseup",i),self.removeEventListener("mousemove",o)}return e=>{e.preventDefault(),n[3]=e.clientX,n[4]=e.clientY,self.addEventListener("mouseup",i),self.addEventListener("mousemove",o),ta(t,oa,{important:!0})}}({container:e,handle:r,onMove:t},{1:0,2:0,3:0,4:0}))}(n.container,(t,r)=>{e.setPosition({x:t,y:r})}),o}const da=({state:e,reference:t,onHelperReady:r})=>({async setHelperReady(){t.container.showPopover(),ta(t.container,{visibility:"visible",opacity:"1"},{important:!0}),r()},setHeight:({height:r})=>new Promise((n,o)=>{try{ta(t.container,{height:`${r}px`},{important:!0}),e.setHeight(r),n(!0)}catch(i){n(!1)}}),async proceedWithoutConsent(){try{const{success:e}=await function(e,t){if(d())throw new Error("setTrackingConsent is not supported in Node.js environments. This function requires browser APIs (XHR, cookies, window) and can only be called client-side.");if(re().increment("consent_tracking_api_calls_total",{method_name:"setTrackingConsent",api_version:"v1.10"}),function(e){if("boolean"!=typeof e&&"object"!=typeof e)throw new v(`setTrackingConsent received an invalid argument of type "${typeof e}". Expected an object with consent keys. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${mt} for documentation.`);if("object"==typeof e){const t=Object.keys(e);if(0===t.length)throw new v(`The submitted consent object is empty. Expected at least one consent key: ${ft}. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${mt} for documentation.`);for(const e of t)if(!ht.includes(e))throw new v(`The submitted consent object contains an invalid key: "${e}". Valid keys are: ${ft}. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${mt} for documentation.`)}}(e),void 0!==t&&"function"!=typeof t)throw new v(`setTrackingConsent received an invalid callback of type "${typeof t}". The second argument must be a function if provided. Example: setTrackingConsent({ analytics: true }, (error, result) => { ... }). See ${mt} for documentation.`);const r=function(e){if(!e)return null;try{return vt()?document.referrer:""}catch{return""}}(e.analytics),n=function(e){if(!e)return null;if(!vt())return"/";try{return window.location.pathname+window.location.search}catch{return"/"}}(e.analytics);return lt(0,{granular_consent:e,...null!==r&&{referrer:r},...null!==n&&{landing_page:n}},t)}(go.reduce((e,t)=>(e[t]=!0,e),{}));return Boolean(e)}catch(e){return!1}},async setClipboard({text:e}){try{return self.navigator.clipboard.writeText(e),!0}catch(t){return!1}},async reportTelemetry(e){vi("helperWindowButtonClick",e)}}),la=new Set,pa="webPixelDebug";class ha extends me{constructor(e){super(`Helper state is invalid.\n\nState: ${JSON.stringify(e)}`),this.name="InvalidHelperStateError"}}class fa extends me{constructor(e,t){super(`Helper's selected pixel is invalid.\n\nPixel: ${JSON.stringify(t)}\n\nState: ${JSON.stringify(e)}`),this.name="InvalidPixelHelperError"}}const ma=[ge.Custom,ge.App];function va(e){try{sessionStorage.setItem(pa,JSON.stringify(e))}catch{t="Session storage is not available. The Pixel Helper experience may be degraded.",la.has(t)||(la.add(t),"console"in self&&console.warn(t))}var t}function ga(){Mr(()=>sessionStorage.removeItem(pa))}const ya=(e,t)=>({version:Dn,pageUrl:self.location.href,surface:e.surface??ve.Unknown,status:t,bundleTarget:Un,shopId:e.shopId}),ba=function(){const e=new Os(1e3,"newest");let t=null;return{message(r,n){const o=()=>t?.call[r](n);if(t)try{o()}catch(i){uo.notify(i,{context:"createWebPixelsHelper/message/endpoint-call",unhandled:!1,severity:"warning"})}else e?.add(o)},async init(r){const n=(()=>{try{return(e=>{const t=new URL(window.location.href),r=t.searchParams.get(pa),n=Mr(()=>r?JSON.parse(atob(r)):null,null);r&&(t.searchParams.delete(pa),self.history.replaceState(null,"",t.toString()));const o=Mr(()=>JSON.parse(sessionStorage.getItem(pa)??"null"),null);if(!n&&!o)return null;const i={position:null,height:216,...n??o};if(!function(e){return!(!e||!e.pixel||"string"!=typeof e.pixel.type||"string"!=typeof e.pixel.id||e.pixel.name&&"string"!=typeof e.pixel.name||"number"!=typeof e.height)}(i))throw ga(),new ha(i);const s=e.find(e=>e.type===i.pixel.type&&e.id===i.pixel.id);if(!s||!ma.includes(s.type)||s.id.match(/shopify/i))throw ga(),new fa(i,i.pixel);return i.pixel={...i.pixel,name:i.pixel.name||s?.name||""},va(i),{get pixel(){return i.pixel},get height(){return i.height},get position(){return i.position},setHeight(e){i.height=e,va(i)},setPosition(e){i.position=e,va(i)}}})(r.webPixelsConfigList)}catch(e){uo.notify(e,{context:"createWebPixelsHelper/init/state",unhandled:!1,severity:"warning",options:{sampleRate:.001}}),vi("helperLoad",ya(r,"helper-read-error"))}return null})();if(!n)return;let o=!1;const{shopId:i,surface:s=ve.Unknown}=r,a=hi("helperLoad",{version:Dn,pageUrl:self.location.href,surface:s,status:"loaded",bundleTarget:Un,shopId:i});await ua({state:n,extensionsBaseUrl:r.extensionsBaseUrl,onHelperReady:()=>{o||(mi(a),o=!0)}}).then(o=>{if(!o)return;t=o;const i=n.pixel;this.message("initializeHelper",{pixelUid:{id:i.id,type:i.type},pixelName:i.name??"",config:r,isCollapsed:n.height<=216,loggerLevel:Mr(()=>"true"===self.localStorage.getItem("pixel-helper-advanced")?js.Advanced:js.Standard,js.Standard)}),e.forEach(e=>e()),e.clear()}).catch(e=>{uo.notify(e,{context:"createWebPixelsHelper/init/createHelperSandbox",unhandled:!1,severity:"warning"}),vi("helperLoad",ya(r,"helper-create-error"))})}}}();function wa(e){return"shopify-custom-pixel"===e.id?"shopify-pixel":e.type===ge.Custom?"-1":e.apiClientId?`${e.apiClientId}`:void 0}const _a="[object Undefined]",Ia="[object Null]",xa=["[object String]","[object Number]","[object Boolean]",_a,Ia],Ea=e=>null===e?Ia:void 0===e?_a:Object.prototype.toString.call(e);function ka(e){let t=null,r=null;function n(e){return"[object Object]"===Ea(e)}return void 0===e||n(e)?{isValid:function e(o,i="root"){if(Array.isArray(o))return o.every((t,r)=>e(t,`${i}[${r}]`));if(n(o))return Object.keys(o).every(t=>e(o[t],`${i}.${t}`));const s=Ea(o),a=xa.includes(s);return a||(r=i,t=`Value of type "${s}" at "${r}" must be one of the following types: ${xa.join(", ")}.`),a}(e,"root"),error:t,errorKey:r}:(r="root",t=`Value of type "${Ea(e)}" at "${r}" must be an object.`,{isValid:!1,error:t,errorKey:r})}const Sa=["page_viewed","product_viewed","collection_viewed","cart_viewed","clicked","form_submitted","input_blurred","input_focused","input_changed","advanced_dom_clicked","advanced_dom_scrolled","advanced_dom_window_resized"],Ta=Jn((e,t)=>!!e&&Wn(e.toLowerCase())/4294967296<=t,{rate:.01});function Ca(e,t,r,n,o=Ta){try{if(!Sa.includes(e.name))return;const i=n();i&&o.includes(i)&&vi("buyerEventSample",{shopId:t,eventType:e.type,eventName:e.name,surface:r,eventPayloadJson:JSON.stringify(e),sessionToken:i})}catch(i){uo.notify(i,{severity:"warning",unhandled:!1,context:"logBuyerEvent",options:{sampleRate:.2}})}}const Aa=new Set(["innerHeight","innerWidth","scrollX","scrollY","pageXOffset","pageYOffset"]);let Pa={},Oa=!1,Ra=!0;function Na(){Pa.innerHeight=Mr(()=>window.innerHeight,0),Pa.innerWidth=Mr(()=>window.innerWidth,0);const e=Mr(()=>window.scrollX,0),t=Mr(()=>window.scrollY,0);Pa.scrollX=e,Pa.pageXOffset=e,Pa.scrollY=t,Pa.pageYOffset=t,Ra=!1}function ja(){Ra=!0}const Ma=new Proxy(window,{get:(e,t)=>(Oa||(Oa=!0,Na(),window.addEventListener("resize",ja,{passive:!0}),window.addEventListener("scroll",ja,{passive:!0}),window.addEventListener("orientationchange",ja,{passive:!0})),Aa.has(t)?(Ra&&Na(),Pa[t]):Mr(()=>Reflect.get(e,t)))});function Ua(){const e=Ma.location,t=Ma.screen,r={href:Mr(()=>e?.href)??"",hash:Mr(()=>e?.hash)??"",host:Mr(()=>e?.host)??"",hostname:Mr(()=>e?.hostname)??"",origin:Mr(()=>e?.origin)??"",pathname:Mr(()=>e?.pathname)??"",port:Mr(()=>e?.port)??"",protocol:Mr(()=>e?.protocol)??"",search:Mr(()=>e?.search)??""};return{document:{location:r,referrer:Mr(()=>document?.referrer)??"",characterSet:Mr(()=>document?.characterSet)??"",title:Mr(()=>document?.title)??""},navigator:{language:Mr(()=>navigator?.language)??"",cookieEnabled:Mr(()=>navigator?.cookieEnabled)??!1,languages:Mr(()=>navigator?.languages)??[],userAgent:Mr(()=>navigator?.userAgent)??""},window:{innerHeight:Ma.innerHeight??0,innerWidth:Ma.innerWidth??0,outerHeight:Ma.outerHeight??0,outerWidth:Ma.outerWidth??0,pageXOffset:Ma.pageXOffset??0,pageYOffset:Ma.pageYOffset??0,location:r,origin:Ma.origin??"",screen:{height:Mr(()=>t?.height)??0,width:Mr(()=>t?.width)??0},screenX:Ma.screenX??0,screenY:Ma.screenY??0,scrollX:Ma.scrollX??0,scrollY:Ma.scrollY??0}}}var Da=tn("getClientId"),$a=tn("sequenceIndices"),La=tn("buildEvent"),qa=tn("getNextSequenceIndex");class Va{constructor(e){Object.defineProperty(this,qa,{value:Ha}),Object.defineProperty(this,La,{value:Ba}),Object.defineProperty(this,Da,{writable:!0,value:void 0}),Object.defineProperty(this,$a,{writable:!0,value:new Map}),Zr(this,Da)[Da]=e}createEvent(e,t,r={}){const n=function(e,t,r){if("checkout_completed"===e&&r.eventId)return r.eventId;const n={analyticsFramework:"wpm"};try{return"product_added_to_cart"===e&&"cartLine"in t&&(n.cacheKey=function({cartLine:e}={cartLine:null}){const t=e?.merchandise.product.id,r=e?.merchandise.id;if(t&&r)return`${t}-${r}`}(t)),window.Shopify?.evids?.(e,n)}catch{return}}(e,t,r);return Zr(this,La)[La]({id:n,name:e,data:t,type:de(e)})}createCustomEvent(e,t=null){return Zr(this,La)[La]({name:e,customData:t,type:ce.Custom})}}function Ba(e){const t=Zr(this,Da)[Da];return{...e,get clientId(){return t()},timestamp:(new Date).toISOString(),context:Ua(),id:"string"==typeof e.id&&e.id.length>0?e.id:hr(),seq:Zr(this,qa)[qa](e.name)}}function Ha(e){const t=(Zr(this,$a)[$a].get(e)??0)+1;return Zr(this,$a)[$a].set(e,t),t}const Fa="wpmLoggedConversion1",za=["thank_you","thank-you","post_purchase","post-purchase"];class Wa extends me{constructor(e){super(`Duplicate conversion event blocked for checkout token: "${e}"`),this.name="ExcludedConversionError"}}class Ka extends me{constructor(){super("Checkout token unavailable from payload"),this.name="MissingCheckoutTokenError"}}class Ya extends me{constructor(){super("Failed to extract valid checkout token from pathname"),this.name="MissingPathnameCheckoutTokenError"}}function Ja(e){const t={},r=(new Date).getTime();for(const[n,o]of Object.entries(e))if("number"==typeof o){const e=new Date(o);e.setMonth(e.getMonth()+2),r{const{pixelRuntimeConfig:i}=o||{},{apiClientId:s,restrictions:a}=i||{},{allowedEvents:c,disallowedEvents:u}=a||{},{sendTo:d}=n||{},l=d&&String(d)===String(s),p=d&&!l,h=!c||c.includes(t),f=u&&u.includes(t);Boolean(h&&!f&&!p||l)&&e()},Qa=(e,t,r,n,o)=>{if(!fe(t))return void e();const{pixelRuntimeConfig:i}=o||{},{capabilities:s,type:a}=i||{},c=s?.includes(be.AdvancedDomEvents);c&&a===ge.App&&e()};class Za extends me{constructor(e){super(`Circular reference detected at "${e}" while applying protected customer data filtering. Event payload contains cyclic structures which are not supported.`),this.name="ProtectedCustomerDataTransformError"}}function ec(e,t,r){if("function"==typeof t){const n=t(e,r.context);return r.onTransformed?.(e,n,r.path),n}if(null==t||"object"!=typeof t)return r.onTransformed?.(e,t,r.path),t;if(null==e)return r.onTransformed?.(e,e,r.path),e;if("object"!=typeof e)return r.onTransformed?.(e,e,r.path),e;if(r.ancestors.has(e))throw new Za(r.path);const n=function(e,t,r){return e.get(t)?.get(r)}(r.cache,e,t);if(void 0!==n)return n;let o;return r.ancestors.add(e),o=Array.isArray(e)?function(e,t,r){let n=e;for(let o=0;o{const t=e?.protectedCustomerApprovalScopes??[];return{protectedCustomerApprovalScopes:{read_customer_address:t.includes("read_customer_address"),read_customer_email:t.includes("read_customer_email"),read_customer_name:t.includes("read_customer_name"),read_customer_personal_data:t.includes("read_customer_personal_data"),read_customer_phone:t.includes("read_customer_phone")}}},{cache:new WeakMap,cacheKey:e=>e}),rc=(e,t,r)=>r?.protectedCustomerApprovalScopes?function(e,t,r){return ec(e,t,{context:r,ancestors:new WeakSet,cache:new WeakMap,path:"$",onTransformed:void 0})}(e,t,tc(r)):e,nc=(e,t=null)=>(r,n)=>n.protectedCustomerApprovalScopes[e]?r:t,oc={data:{checkout:{email:nc("read_customer_email"),phone:nc("read_customer_phone"),smsMarketingPhone:nc("read_customer_phone"),billingAddress:{firstName:nc("read_customer_name"),lastName:nc("read_customer_name"),phone:nc("read_customer_phone"),address1:nc("read_customer_address"),address2:nc("read_customer_address"),city:nc("read_customer_address"),province:nc("read_customer_address"),provinceCode:nc("read_customer_address"),zip:nc("read_customer_address")},shippingAddress:{firstName:nc("read_customer_name"),lastName:nc("read_customer_name"),phone:nc("read_customer_phone"),address1:nc("read_customer_address"),address2:nc("read_customer_address"),city:nc("read_customer_address"),province:nc("read_customer_address"),provinceCode:nc("read_customer_address"),zip:nc("read_customer_address")},order:{customer:{id:nc("read_customer_personal_data"),isFirstOrder:nc("read_customer_personal_data")}}}}},ic={checkout_address_info_submitted:oc,checkout_completed:oc,checkout_contact_info_submitted:oc,checkout_shipping_info_submitted:oc,checkout_started:oc,payment_info_submitted:oc};class sc extends me{constructor(e,t){super(`Failed to apply protected customer data filtering for event: ${e}. ${t.message}`),this.name="ProtectedCustomerDataError"}}const ac=["share_all_events"],cc=e=>(t,r,n,o,i)=>{const s=i?.pixelRuntimeConfig;if(!s)return void t();const{dataSharingAdjustments:a,dataSharingState:c}=s;if(wt(s,"9a3ed68a")||s.type===ge.Custom&&(!bt(It)||wt(s,"368e946e")))return void t();const{dataSharingControls:u}=a??{};((e,t)=>Boolean(t)&&"unrestricted"!==t&&!1===e?.includes("share_all_events"))(u,c)?function(e){return e?.filter(e=>!ac.includes(e))??[]}(u).length>0?t():e.emit("log:event-bus:publish:blocked",{pixel:s,event:{name:r,id:n.id}}):t()},uc="all_standard_events",dc="all_custom_events",lc="all_dom_events";class pc extends me{constructor(e,t="PublishEventError"){super(e,{groupingHash:`EventBus:${t}`}),this.name=t}}const hc=Yn({rate:.01});function fc(e,{domEventSampler:t=hc}={}){const{shopId:r,surface:n,emit:o,consent:i}=e,s=new Va(()=>i.trackingTokens.getUniqueToken()),a=(({logError:e})=>function(t,r){if("checkout_completed"!==t)return!1;let n=r&&"checkout"in r?r?.checkout?.token:null;if(n&&"string"==typeof n||(e(new Ka,{severity:"info",unhandled:!1,context:"isExcludedDuplicateConversion"}),n=function(){try{const e=new URL(window.location.href),t=Xa.exec(e.pathname);if(!t)return null;const[,r,n,o,i]=t;return n??null}catch(e){return null}}()),!n||"string"!=typeof n)return e(new Ya,{severity:"info",unhandled:!1,context:"isExcludedDuplicateConversion"}),!1;if(!function(){try{const e=new URL(window.location.href).pathname.split("/").filter(Boolean);return e.includes("checkouts")&&e.some(e=>za.includes(e))}catch(e){return!1}}())return!1;const o=function(){try{const e=localStorage.getItem(Fa);if(!e)return{};const t=JSON.parse(e);return"object"!=typeof t||null===t?{}:Ja(t)}catch(e){return{}}}();return n in o?(e(new Wa(n),{severity:"info",unhandled:!1,context:"isExcludedDuplicateConversion"}),!0):(function(e,t){t[e]=(new Date).getTime(),function(e){try{const t=Ja(e);localStorage.setItem(Fa,JSON.stringify(t))}catch(t){}}(t)}(n,o),!1)})(e),c=new Ns({bufferSize:Number.POSITIVE_INFINITY,subscribeAllKey:uc}).use(Ga,cc(e),(e=>(t,r,n,o,i)=>{const s=i?.pixelRuntimeConfig,{dataSharingAdjustments:a}=s||{},c=ic[r]??null;if(c&&(s?.type!==ge.Custom||bt(It)))try{t(rc(n,c,a))}catch(u){e.logError(new sc(r,u instanceof Error?u:new Error(String(u))),{context:"eventBus/middleware/protected-customer-data",unhandled:!1,severity:"error",pixelId:s?.id})}else t()})(e)),u=new Ns({bufferSize:1e3,subscribeAllKey:dc}).use(Ga,cc(e)),d=new Ns({bufferSize:1e3,replayKeep:"newest",subscribeAllKey:lc}).use(Ga),l=new Ns({bufferSize:1e3,replayKeep:"newest"}).use(Ga,Qa);return{publish(e,t,p){if(!bt(_t)&&n!==ve.CustomerAccount)return function(e,t,u){if("string"!=typeof e)throw new pc("Expected event name to be a string, but got "+typeof e,"LegacyPublishStandardEventError");if(!le(e))return!1;const d=ka(t);if(!d.isValid)return console.error(d.error),!1;const l=s.createEvent(e,t,u),p=l.data?.checkout?.token;return Ca(l,r,n,()=>i.trackingTokens.getVisitToken()),vi("eventPublish",{version:Dn,bundleTarget:Un,pageUrl:self.location.href,shopId:r,surface:n,eventName:l.name,eventType:l.type,extensionId:u?.extension?.extensionId,extensionAppId:u?.extension?.appId,extensionType:u?.extension?.type,userCanBeTracked:gt().toString(),eventId:l.id,checkoutToken:p,checkoutCompletedPageType:u?.checkoutCompletedPageType}),o("log:event-bus:publish",{event:l,options:u}),!a(e,l.data)&&c.publish(l.name,l)}(e,t,p);if("string"!=typeof e){const t=JSON.stringify(e);throw new pc(`Expected event name "${t}" to be a string, but got ${typeof e}`,"PublishEventError")}if(de(e)===ce.Meta)return!1;const h=ka(t);if(!h.isValid){if(he(e)||fe(e)){const r=new pc(`Input Validation Error for event ${e}: ${h.error}\nPayload: ${JSON.stringify(t)}`,"PublishAdvancedDomEventError");return uo.notify(r,{type:"metric",context:"publish/invalidPayload"}),!1}return console.error(h.error),!1}let f;if(f=pe(e)?s.createCustomEvent(e,t):s.createEvent(e,t,p),pe(e)||le(e)){let t={version:Dn,bundleTarget:Un,pageUrl:self.location.href,shopId:r,surface:n,eventName:f.name,eventType:f.type,extensionId:p?.extension?.extensionId,extensionAppId:p?.extension?.appId,extensionType:p?.extension?.type,eventId:f.id};if(le(e)){const e=f.data?.checkout?.token;Ca(f,r,n,()=>i.trackingTokens.getVisitToken()),t={...t,userCanBeTracked:gt().toString(),checkoutToken:e,checkoutCompletedPageType:p?.checkoutCompletedPageType}}vi("eventPublish",t)}else Ca(f,r,n,()=>i.trackingTokens.getVisitToken());return o("log:event-bus:publish",{event:f,options:p}),!a(e,f.data)&&(le(e)?c.publish(e,f):he(e)?d.publish(e,f):fe(e)?l.publish(e,f):u.publish(e,f,p))},publishCustomEvent(e,t,o){if(bt(_t))return this.publish(e,t,o);if("string"!=typeof e)throw new pc("Expected event name to be a string, but got "+typeof e,"PublishCustomEventError");if(!pe(e))return!1;const i=ka(t);if(!i.isValid)return console.error(i.error),!1;const a=s.createCustomEvent(e,t);return vi("eventPublish",{version:Dn,bundleTarget:Un,pageUrl:self.location.href,shopId:r,surface:n,eventName:a.name,eventType:"custom",extensionId:o?.extension?.extensionId,extensionAppId:o?.extension?.appId,extensionType:o?.extension?.type,eventId:a.id}),u.publish(e,a,o)},publishDomEvent(e,t,o){if(bt(_t))return this.publish(e,t,o);if("string"!=typeof e){const t=JSON.stringify(e);throw new pc(`Expected event name "${t}" to be a string, but got ${typeof e}`,"PublishDomEventError")}if(!he(e)&&!fe(e))throw new pc(`Event name "${e}" is not a supported DOM Event`,"PublishDomEventError");const a=ka(t);if(!a.isValid){const t=new pc(`Input Validation Error for event ${e}: ${a.error}`,"PublishDomEventError");return uo.notify(t,{type:"metric",context:"publishDomEvent/invalidPayload"}),!1}const c=s.createEvent(e,t,o);return Ca(c,r,n,()=>i.trackingTokens.getVisitToken()),fe(e)?l.publish(e,c):d.publish(e,c)},subscribe(e,r,n={}){const o=hr(),i=async i=>{await $r();const s={configuration:n.pixelRuntimeConfig?.configuration,eventPayloadVersion:n.schemaVersion||n.pixelRuntimeConfig?.eventPayloadVersion||"unknown",id:n.pixelRuntimeConfig?.id||"unknown",type:n.pixelRuntimeConfig?.type||"unknown",runtimeContext:n.pixelRuntimeConfig?.runtimeContext||"unknown",restrictions:n.pixelRuntimeConfig?.restrictions,scriptVersion:n.pixelRuntimeConfig?.scriptVersion||"unknown",apiClientId:n.pixelRuntimeConfig?.apiClientId,name:n.pixelRuntimeConfig?.name},a={pixelUid:{id:s.id,type:s.type},event:i,eventNameAsSubscribed:e,subscriptionId:o,status:"SUCCESS"};let c;try{await r.call(i,i),ba.message("logEvent",a)}catch(h){c=h,ba.message("logEvent",{...a,status:"FAIL",error:c})}const u=de(i.name),d={version:Dn,bundleTarget:Un,pageUrl:self.location.href,shopId:n.shopId,surface:n.surface,pixelName:s.name,pixelId:s.id,pixelAppId:wa(s),pixelSource:s.type,pixelRuntimeContext:s.runtimeContext,pixelScriptVersion:s.scriptVersion,pixelConfiguration:s.configuration,pixelEventSchemaVersion:s.eventPayloadVersion,eventName:i.name,eventId:i.id},l=c?"FAILURE":"SUCCESS",p=c?String(c):void 0;if([ce.Dom,ce.AdvancedDom].includes(u))t.includes(s.id)&&vi("subscriberEventEmitDom",{...d,status:l,errorMessage:p});else{let e;le(i.name)&&(e=i?.data?.checkout?.token),vi("subscriberEventEmit",{...d,eventType:u,checkoutToken:e||void 0,status:l,errorMessage:p})}};if(fe(e))return l.subscribe(e,i,n);if("all_events"===e){const e=c.subscribe(uc,i,n),t=u.subscribe(dc,i,n),r=d.subscribe(lc,i,n);return()=>{const n=e(),o=t(),i=r();return n&&o&&i}}return e===dc?u.subscribe(dc,i,n):e===uc||le(e)?c.subscribe(e,i,n):e===lc||he(e)?d.subscribe(e,i,n):u.subscribe(e,i,n)}}}const mc=["31014027265","28638674945","44186959873"],vc={capture:!0},gc=Object.values(ve),yc=[ve.NotAvailable,ve.Unknown,ve.StorefrontRenderer],bc=[ve.CheckoutOneShopApp,ve.CheckoutOneNativeShopApp,ve.CheckoutOneSdkShopApp,ve.CheckoutKitShopApp],wc=[ve.CheckoutOne,ve.CheckoutOneSdk,ve.CheckoutKit,...bc];let _c=function(e){return e.WebPixelExtension="web-pixel-extension",e.Unknown="unknown",e}({}),Ic=function(e){return e.Storefront="storefront",e.Checkout="checkout",e.Unknown="unknown",e}({}),xc=function(e){return e.Custom="custom",e.All="all",e}({});const Ec=new Set;function kc(e){Ec.add(e)}window.addEventListener("pagehide",({persisted:e})=>{e||(Ec.forEach(e=>{Mr(e)}),Ec.clear())},{capture:!0});const Sc={customer:{id:nc("read_customer_personal_data",""),email:nc("read_customer_email"),firstName:nc("read_customer_name"),lastName:nc("read_customer_name"),ordersCount:nc("read_customer_personal_data"),phone:nc("read_customer_phone")}};class Tc extends me{constructor(e){super(`Failed to apply protected customer data filtering to init data. ${e.message}`),this.name="ProtectedCustomerDataInitError"}}function Cc(e,t,r){const{consent:n}=e,o={context:Ua(),data:{customer:(a=t.customer,a?{email:a.email,firstName:a.firstName,id:a.id,lastName:a.lastName,phone:a.phone,ordersCount:a.ordersCount}:null),cart:(s=t.cart,s?{id:s?.id,cost:{totalAmount:{amount:s?.cost?.totalAmount?.amount,currencyCode:s?.cost?.totalAmount?.currencyCode}},lines:s?.lines,totalQuantity:s?.totalQuantity,attributes:s?.attributes}:null),shop:t.shop,purchasingCompany:(i=t.purchasingCompany,i?{company:i.company,location:i.location}:null)},customerPrivacy:{analyticsProcessingAllowed:n.analyticsProcessingAllowed(),marketingAllowed:n.marketingAllowed(),preferencesProcessingAllowed:n.preferencesProcessingAllowed(),saleOfDataAllowed:n.saleOfDataAllowed()}};var i,s,a;const c=function(e,t){const{dataSharingAdjustments:r}=t;if(t.type===ge.Custom&&!bt(It))return e;try{return rc(e,Sc,r)}catch(n){return uo.notify(new Tc(n instanceof Error?n:new Error(String(n))),{context:"createRegisterInit/filterProtectedCustomerData",unhandled:!1,severity:"error",pixelId:t.id}),{...e,customer:e.customer?{...e.customer,id:"",email:null,firstName:null,lastName:null,ordersCount:null,phone:null}:null}}}(o.data,r);return{...o,data:c}}function Ac(e,{eventBus:t,customerPrivacyEventBus:r,webPixelConfig:n,initData:o,forRPC:i=!1}){const{shopId:s,surface:a}=e;let c={};try{c=n.configuration?JSON.parse(n.configuration):{}}catch(d){}const u=function(e){return e===ve.Shopify||wc.includes(e)?Ic.Checkout:e===ve.StorefrontRenderer?Ic.Storefront:Ic.Unknown}(a);return{analytics:{subscribe(e,r,o){i&&Bs(r);const c=t.subscribe(e,r,{...o,pixelRuntimeConfig:n,shopId:s,surface:a,scope:_c.WebPixelExtension});return kc(()=>{c(),i&&Mr(()=>Fs(r))}),c}},browser:{cookie:{get:async e=>e?Wt(e)??"":Ft()??"",set:async(e,t)=>{if(t){const r=`${e}=${t}`;document.cookie=r}else document.cookie=e;return Ft()??""}},sendBeacon:async(e,t="")=>{if(e.includes(self.location.origin)&&!e.match(/\/\.well-known\/shopify\/monorail\/unstable\/produce_batch/))return!1;const r=new window.Blob([t],{type:"text/plain"});return Mr(()=>window.navigator.sendBeacon(e,r),!1)},localStorage:{setItem:async(e,t)=>{Mr(()=>window.localStorage.setItem(e,t))},getItem:async e=>Mr(()=>window.localStorage.getItem(e),null),key:async e=>Mr(()=>window.localStorage.key(e),null),removeItem:async e=>{Mr(()=>window.localStorage.removeItem(e))},clear:async()=>{Mr(()=>window.localStorage.clear())},length:async()=>Mr(()=>window.localStorage.length,0)},sessionStorage:{setItem:async(e,t)=>{Mr(()=>window.sessionStorage.setItem(e,t))},getItem:async e=>Mr(()=>window.sessionStorage.getItem(e),null),key:async e=>Mr(()=>window.sessionStorage.key(e),null),removeItem:async e=>{Mr(()=>window.sessionStorage.removeItem(e))},clear:async()=>{Mr(()=>window.sessionStorage.clear())},length:async()=>Mr(()=>window.sessionStorage.length,0)}},settings:c,init:Cc(e,o,n),_pixelInfo:{...n,surface:a,surfaceNext:u},customerPrivacy:{subscribe(e,t,o){i&&Bs(t);const c=r.subscribe(e,t,{...o,pixelRuntimeConfig:n,shopId:s,surface:a,scope:_c.WebPixelExtension});return kc(()=>{c(),i&&Mr(()=>Fs(t))}),c}}}}let Pc,Oc=function(e){return e.Wpm="wpm",e.WebPixels="web-pixels",e}({});class Rc extends Error{constructor(e,t){super(e),this.url=void 0,this.name="WebWorkerTopLevelError",this.url=t}}class Nc extends Error{constructor(...e){super(...e),this.name="SandboxAlreadyCreatedError",this.message="Sandbox already created."}}class jc extends Error{constructor(e,t){super(e),this.name="PixelInitializationError",this.stack=t}}class Mc extends me{constructor(...e){super(...e),this.name="InvalidExtensionPointError",this.message="Invalid Extension Point"}}const Uc=new Map;const Dc={active:"",pagehide:" [page lifecycle: pagehide]",hidden:" [page lifecycle: hidden]","already-hidden":" [page lifecycle: already hidden]"};async function $c(e,t){let r=!1,n=null;const{webPixelConfig:o,eventBus:i}=t,{shopId:s,surface:a}=e,c=o.id,u=o.type.toLowerCase(),d=Oc.WebPixels;var l,p;switch(o.restrictions||(o.restrictions=function(e,t){const r={};return mc.includes(String(e))&&(r.allowedEvents=[],t!==ve.StorefrontRenderer&&(r.preventLoadingBeforeEvent=`shopify:app:pixels:load:${e}`)),r}(String(o.apiClientId),a)),await Promise.all([(async()=>{await bo(function(e){if(e)return go.reduce((t,r)=>(t[r]=e.includes(r.toUpperCase()),t),{})}(o.privacyPurposes)),ba.message("logConsentGranted",{pixelUid:{id:c,type:o.type}})})(),(l=(e,t)=>i.subscribe(e,t,{pixelRuntimeConfig:{apiClientId:"PIXEL-LOADER"}}),p=o.restrictions?.preventLoadingBeforeEvent,new Promise((e,t)=>{void 0===p?e(!0):l(p,()=>{e(!0)})}))]),ui("pixel:register","start",{pixelId:c,source:u}),o.runtimeContext){case ye.Lax:case ye.Strict:try{r=await async function(e,{webPixelConfig:t,eventBus:r,customerPrivacyEventBus:n,initData:o,cookieRestrictedDomains:i,pixelPath:s}){const{shopId:a,storefrontBaseUrl:c}=e,u=`web-pixel-sandbox-${t.type}-${t.id}-${t.runtimeContext}-${Dn}`;if(t.runtimeContext===ye.Lax&&document.getElementById(u)){const e=new Nc;throw uo.notify(e,{type:"metric",pixelId:t.id,pixelType:t.type,runtimeContext:t.runtimeContext,shopId:a,context:"createWebPixelSandbox/alreadyCreatedError",userAgent:self.navigator.userAgent,hashVersionSandbox:Dn,sandboxUrl:self.location.href||"unknown",options:{sampleRate:.15}}),e}let d,l;switch(t.runtimeContext){case ye.Strict:[d,l]=await async function({sandboxId:e,webPixelConfig:t,storefrontBaseUrl:r,pixelPath:n=Oc.Wpm}){const o=t.id,i=[bn(r),`/${n}`,`@${Dn}`,`/web-pixel-${o}`,`@${t.scriptVersion}`,"/sandbox",`/worker.${Un}.js`].join(""),s=new Worker(i,{name:e,type:"classic",credentials:"omit"}),a=new Promise((e,t)=>{const r=e=>{s.removeEventListener("error",r),t(e?.filename&&e?.lineno&&e?.message?new Rc(e.message,i):new me(`Failed to load web worker for pixel ${o} with url ${i}}`,{groupingHash:"WebPixelCreateWebWorkerSandbox:WebWorkerLoadError"}))};s.addEventListener("error",r)});return[s,a]}({sandboxId:u,webPixelConfig:t,storefrontBaseUrl:c,pixelPath:s});break;case ye.Lax:[d,l]=await async function({sandboxId:e,webPixelConfig:t,storefrontBaseUrl:r,pixelPath:n=Oc.Wpm}){const{search:o}=self.location,i=t.id,s=t.type.toLowerCase(),a=[bn(r),`/${n}`,`@${Dn}`,`/${s}`,`/web-pixel-${i}`,`@${t.scriptVersion}`,"/sandbox",`/${Un}`,/\.(js|json|xml)$/.test(self.location.pathname)?"":self.location.pathname,o].join(""),{iframe:c}=await ca({containerSpec:{id:"web-pixels-manager-sandbox-container",tagName:"div",styles:{height:"0",width:"0",position:"fixed",visibility:"hidden",overflow:"hidden","z-index":"-100",margin:"0",padding:"0",border:"0"},attributes:{"aria-hidden":"true"},dataset:{shopifyPrivacy:"exclude"}},iframeSpec:{id:e,src:a,privileges:["allow-scripts","allow-forms"],styles:{height:"0",width:"0",visibility:"hidden"},attributes:{"aria-hidden":"true"}}}),{promise:u,reject:d}=zn();let l;const p=()=>{l=setTimeout(()=>{d(new me(`Failed to load iframe for pixel ${i} with url ${a}`,{groupingHash:"WebPixelCreateIframeSandbox:IframeLoadError"}))},1e3)};c.addEventListener("load",p);const h=Us(c);return h.addEventListener("message",e=>{"remote-ui::ready"===e.data&&(clearTimeout(l),c.removeEventListener("load",p))}),[h,u]}({sandboxId:u,webPixelConfig:t,storefrontBaseUrl:c,pixelPath:s});break;default:throw new me(`Unsupported runtime context: ${t.runtimeContext}`,{groupingHash:"WebPixelCreateSandbox:UnsupportedRuntimeContext"})}const p=Qs(d,{callable:["initialize"]}),h=Ac(e,{eventBus:r,customerPrivacyEventBus:n,webPixelConfig:t,initData:o,forRPC:!0}),f=Ua();let m={status:"unknown",hashVersion:"unknown",sandboxUrl:"unknown"};const v=t.runtimeContext===ye.Lax?(Pc||(Pc={localStorageItems:{...self.localStorage},sessionStorageItems:{...self.sessionStorage}}),Pc):{localStorageItems:{},sessionStorageItems:{}},g=[p.call.initialize({pageTitle:self.document.title,webPixelConfig:t,shopId:a,webPixelApi:h,cookieRestrictedDomains:i,cookie:Ft()??"",origin:self.origin,referrer:self.document.referrer,...v}).then(e=>{m=e}).catch(e=>{throw new jc(e.toString(),e.stack??"")})];if(l&&g.push(l),await Promise.race(g),Dn!==m.hashVersion){const e=new me(`The main bundle hash (${Dn}) does not match the sandbox hash (${m.hashVersion})`,{groupingHash:"WebPixelCreateSandbox:HashMismatch"});throw uo.notify(e,{type:"metric",severity:"warning",pixelId:t.id,pixelType:t.type,runtimeContext:t.runtimeContext,context:"createSandbox/hashMismatch",shopId:a,userAgent:f.navigator.userAgent||self.navigator.userAgent,hashVersionSandbox:m.hashVersion,sandboxUrl:m.sandboxUrl}),e}return!0}(e,{...t,pixelPath:d})}catch(g){n=g,r=!1}break;case ye.Open:try{r=await async function(e,{webPixelConfig:t,eventBus:r,customerPrivacyEventBus:n,initData:o,pixelPath:i=Oc.Wpm}){const{storefrontBaseUrl:s}=e,{promise:a,resolve:c,reject:u}=zn(),{id:d,type:l,integrityHash:p}=t,h=`${d}-${l}`.toLowerCase();Uc.set(h,()=>({webPixelApi:Ac(e,{eventBus:r,customerPrivacyEventBus:n,webPixelConfig:t,initData:o,forRPC:!0}),resolve:c,reject:u}));const f=[bn(s),`/${i}@${Dn}`,`/${t.type.toLocaleLowerCase()}`,`/web-pixel-${d}@${t.scriptVersion}`,"~2",`/pixel.${Un}.js`].join("");if(!self[jn]){const e=new me(`${jn} was not found on the global scope. ${jn}.createShopifyExtend() was not exposed to the window.`,{groupingHash:"WebPixelOpen:GlobalObjectMissing",severity:"warning"});return uo.notify(e,{type:"metric",context:"createWebPixelOpen/globalObjectMissing",severity:"warning",unhandled:!1}),u(e),a}if(!("createShopifyExtend"in self[jn])){const e=(e,t)=>{let r;try{r=document.currentScript?.dataset||{}}catch(g){r={},uo.notify(g,{type:"metric",context:"createWebPixel/createWebPixelOpen/createShopifyExtend",unhandled:!1})}let{pixelId:n,pixelType:o}=r;if(n&&o||(n=e,o=t),!n||!o)return u(new me("No pixelId or pixelType found in script tag or params.",{groupingHash:"WebPixelOpen:NoPixelIdOrType"})),null;const i=`${n}-${o}`.toLowerCase(),s=Uc.get(i);if(!s)return u(new me(`No openPixelFn found for ${i}.`,{groupingHash:"WebPixelOpen:NoOpenPixelFn"})),null;const{resolve:a,reject:c,webPixelApi:d}=s();return d||c(new me(`No api found for pixel ${i}.`,{groupingHash:"WebPixelOpen:NoApiFound"})),Object.freeze({extend:(e,t)=>{"WebPixel::Render"!==e&&c(new Mc(`Invalid extension point: ${e}`,{groupingHash:"WebPixelOpen:InvalidExtensionPoint"}));try{t.call(d,d),a(!0)}catch(g){c(new me(g,{groupingHash:"WebPixelOpen:PixelCallbackError"}))}}})};_s(self[jn],"createShopifyExtend",{value:e,enumerable:!1,writable:!1,configurable:!1})}var m,v;return await(m=f,v=e=>{e.dataset.pixelId=d,e.dataset.pixelType=l,p?(e.integrity=p,e.crossOrigin="anonymous"):uo.notify(new me(`Missing integrityHash for SRI-enabled open pixel of type ${l} with id ${d} and src ${f}`,{groupingHash:"WebPixelOpen:MissingIntegrityHash"}),{type:"metric",context:"createWebPixelOpen/loadScript",severity:"warning",unhandled:!1})},new Promise((e,t)=>{try{const r=document.createElement("script");r.src=m,r.async=!0,r.onload=()=>{e()},r.onerror=()=>{n(),t(new me(`Failed to load script: ${m}`,{groupingHash:"WebPixelOpen:LoadScriptError"}))};const n=()=>{r.onload=null,r.onerror=null,r.remove()};v&&v(r);const o=document.head??document.body??document.documentElement;if(!o)return n(),void t(new me(`No DOM insertion target (head/body/documentElement) available to load script: ${m}`));o.appendChild(r)}catch(g){t(g)}})),a}(e,{...t,pixelPath:d})}catch(g){n=g,r=!1}break;default:{const e=new me(`Invalid runtimeContext: ${o.runtimeContext}`,{groupingHash:"WebPixel:InvalidRuntimeContext"});throw ba.message("logPixelRegister",{pixelUid:{id:c,type:o.type},status:"FAIL",errorType:"PixelRegistrationError",error:e}),e}}const h=wa(o),{measurement:f}=ai("pixel:register",{pixelId:c,source:u});n&&!r?ba.message("logPixelRegister",{pixelUid:{id:c,type:o.type},status:"FAIL",errorType:n instanceof jc?"PixelInitializationError":"PixelRegistrationError",error:n}):r&&ba.message("logPixelRegister",{pixelUid:{id:c,type:o.type},status:"SUCCESS"});const m={version:Dn,pageUrl:self.location.href,shopId:s,surface:a,pixelId:c,pixelAppId:h,pixelSource:o.type,pixelRuntimeContext:o.runtimeContext,pixelScriptVersion:o.scriptVersion,pixelConfiguration:o?.configuration,pixelEventSchemaVersion:o.eventPayloadVersion,pixelName:o.name,userCanBeTracked:gt().toString(),bundleTarget:Un,duration:f?.duration,startTime:f?.startTime,sessionId:e.sessionId};if(!n)return vi("register",{...m,status:"registered",errorMsg:void 0}),r;const v=n.message;return function(e=250){return"hidden"===document.visibilityState?Promise.resolve("already-hidden"):new Promise(t=>{const r=()=>i("pagehide"),n=()=>{"hidden"===document.visibilityState&&i("hidden")},o=setTimeout(()=>i("active"),e);function i(e){clearTimeout(o),window.removeEventListener("pagehide",r,vc),document.removeEventListener("visibilitychange",n,vc),t(e)}window.addEventListener("pagehide",r,vc),document.addEventListener("visibilitychange",n,vc)})}().then(e=>{vi("register",{...m,status:"failed",errorMsg:v+Dc[e]},"active"!==e)}).catch(()=>{}),r}const Lc=new RegExp(["password","pass","pw","ssn","sin","social","security","cc","card","creditcard","cvv","cvc","cvn","billing","license","health","secret","unique"].map(e=>`^(.*[^a-z])?${e}([^a-z].*)?$`).join("|"),"i"),qc=function(e,{cache:t,cacheKey:r}={}){if("function"!=typeof queueMicrotask)return e;const n=t??$t();let o=!1;const i=qt(e,{cache:n,cacheKey:r});return function(...e){return o||(queueMicrotask(()=>{n.clear(),o=!1}),o=!0),i(...e)}}(function(e){return!!sa(e)&&null!==e.closest('script, iframe, [data-shopify-privacy="exclude"]')},{cacheKey:e=>e}),Vc=["id","name","type"],Bc=(e,t)=>("value"in t&&"string"==typeof t.value&&(e=>{if(!sa(e))return!1;if("redact"===e.dataset?.shopifyPrivacy)return!0;for(const t of Vc){const r=e.getAttribute(t);if("string"==typeof r&&Lc.test(r))return!0}return!1})(e)&&(t.value="******"),t);function Hc(e,t,r){if(t in e)try{const r=e[t],n=typeof r;if("string"===n||"number"===n||"boolean"===n)return r}catch(n){uo.notify(n,{context:"createDomEventsListener/getElementAttributes/getElementAttribute",type:"metric"})}return e.getAttribute(t)??r}function Fc(e,t,r){const n={};for(const o of t){const t=Hc(e,o,r?.[o]);void 0!==t&&(n[o]=t)}return Bc(e,n),n}const zc={id:null,href:null,name:null,tagName:null,type:null,value:null},Wc=Object.keys(zc);function Kc(e){return Fc(e,Wc,zc)}const Yc=["screenX","screenY","pageX","pageY","clientX","clientY","offsetX","offsetY","movementX","movementY"],Jc=Yc.reduce((e,t)=>(e[t]=0,e),{});let Xc=0,Gc=new WeakMap;function Qc(e){if(!e)return-1;let t=Gc.get(e);return void 0===t&&(t=Xc++,Gc.set(e,t)),t}let Zc=new WeakMap;const eu={parentSerializationId:-1,prevSiblingSerializationId:-1};function tu(e){if(!e)return eu;let t=Zc.get(e);if(void 0===t){let r=e.previousSibling;for(;r&&qc(r);)r=r.previousSibling;t={parentSerializationId:Qc(e.parentNode),prevSiblingSerializationId:Qc(r)},ru(e,t)}return t}function ru(e,t){Zc.set(e,t)}function nu(e){Zc.delete(e)}function ou(e){const t=e.nodeType;if(t===Node.ELEMENT_NODE){const r=e,n={},o=r.attributes;if(o)for(let e=0;e"function"!=typeof e).map(({name:e})=>e),cu=["id","name","tagName","type","value"];function uu(e){return Fc(e,cu)}const du=(e,t)=>(r,{eventPrefix:n,onError:o})=>Qr(window,e,i=>{try{const e=i?.target;if(!(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)||qc(e))return;n?r(`${n}${t}`,{node:ou(e)}):r(t,{element:uu(e)})}catch(s){o?.(s,{context:`createInputListenerFactory/${e}/${t}`,type:"error",unhandled:!1})}},{onError:o}),lu=du("blur","input_blurred"),pu=du("focus","input_focused"),hu=du("change","input_changed"),fu=["action","id"],mu=[lu,hu,(e,{eventPrefix:t,onError:r})=>Qr(window,"click",r=>{const n=r?.target;if(!(n instanceof Element)||qc(n))return;const o=t?iu(r,n):function(e,t){return{element:Kc(t),...Jc,...Ts(e,Yc)}}(r,n);e(`${t??""}clicked`,o)},{onError:r,throttleDelay:50}),pu,(e,{eventPrefix:t,onError:r})=>{let n=!1;return Qr(window,"submit",o=>{const i=o?.target;i instanceof HTMLFormElement&&!qc(i)&&(t?e(`${t}form_submitted`,{node:ou(i)}):(au.length>0&&!n&&(n=!0,r(new Error(`Invalid DOM constructor globals: ${au.join(", ")}`),{context:"createSubmitListener/invalidInputTypes",type:"metric",unhandled:!1})),e("form_submitted",{element:{...Fc(i,fu),elements:Array.from(i.elements).filter(e=>function(e){return su.some(({type:t,tagName:r})=>"function"==typeof t?e instanceof t:e?.tagName===r)}(e)&&!qc(e)).map(e=>uu(e))}})))},{onError:r})}],vu=(e,t)=>{const r=mu.map(r=>{try{return r(e,t)}catch(n){return t?.onError?.(n,{context:"createDomEventsListener"}),()=>{}}});return()=>{r.forEach(e=>e())}};function gu(e,t,{onError:r}){return Qr(document,e,r=>{if(!(r instanceof Event&&r.type===e))return;const n=r.target;if(!(n instanceof Element)||qc(n))return;const o=ou(n);t("advanced_dom_clipboard",{node:o,action:r.type??"copy"})},{onError:r,throttleDelay:100})}const yu=(e,t)=>{const r=[],n=e.length;for(let o=0;o{const t=tu(e);return{node:ou(e),children:bu(e),parentSerializationId:t.parentSerializationId,prevSiblingSerializationId:t.prevSiblingSerializationId}},_u=[(e,{onError:t})=>{let r=null;return Qr(window,"mousemove",t=>{if(!(t instanceof MouseEvent))return;const n=t?.target;if(!(n instanceof Element)||qc(n))return;const o=iu(t,n);o.movementX=r?t.screenX-r.screenX:0,o.movementY=r?t.screenY-r.screenY:0,e("advanced_dom_mouse_moved",o),r=t},{onError:t,throttleDelay:50})},(e,{onError:t})=>Qr(window,"resize",t=>{const r=t.view;r&&e("advanced_dom_window_resized",{innerHeight:r.innerHeight,innerWidth:r.innerWidth})},{onError:t,throttleDelay:100}),(e,{onError:t})=>Qr(window,"scroll",t=>{if(!(t instanceof Event))return;const r=t?.target;let n;if(r instanceof Document)n=r.scrollingElement??document.documentElement;else{if(!(r instanceof Element))return;n=r}qc(n)||e("advanced_dom_scrolled",{node:ou(n)})},{onError:t,throttleDelay:100}),(e,t)=>{const r=[gu("cut",e,t),gu("paste",e,t),gu("copy",e,t)];return()=>{r.forEach(e=>e())}},(e,{onError:t})=>Qr(document,"selectionchange",t=>{const r=document.activeElement;r instanceof Element&&!qc(r)&&e("advanced_dom_selection_changed",{node:ou(r)})},{onError:t,throttleDelay:250}),(e,{onError:t})=>{const r=()=>{e("advanced_dom_available",{root:wu(document)})};return"loading"!==document.readyState?(r(),()=>{}):Qr(window,"DOMContentLoaded",r,{onError:t})},(e,{onError:t})=>{const r=new MutationObserver(r=>{$r().then(()=>{r.forEach(t=>{if(qc(t.target))return;const r=yu(Array.from(t.addedNodes).filter(e=>e.parentNode),wu),n=function(e){if(0===e.removedNodes.length)return[];if(qc(e.target))return e.removedNodes.forEach(e=>nu(e)),[];const t=Array.from(e.removedNodes).filter(e=>{const{parentSerializationId:t}=tu(e);return-1!==t||(nu(e),!1)});return yu(t,e=>{const t=ou(e);return nu(e),t})}(t),o=[];if("attributes"===t.type){const{target:e,attributeName:r}=t;r&&e instanceof HTMLElement&&t.oldValue!==e.getAttribute(r)&&o.push(ou(t.target))}if("characterData"===t.type){const{target:e}=t;e instanceof Text&&t.oldValue!==e.data&&o.push(ou(e))}0===r.length&&0===n.length&&0===o.length||e("advanced_dom_changed",{addedFragments:r,removedNodes:n,modifiedNodes:o})})}).catch(e=>{t?.(e,{context:"createDomChangeListener/observer",unhandled:!1})})}),n=()=>{r.observe(document.documentElement,{attributes:!0,attributeOldValue:!0,childList:!0,subtree:!0,characterData:!0,characterDataOldValue:!0})};if("loading"!==document.readyState)return n(),()=>{r.disconnect()};const o=Qr(window,"DOMContentLoaded",n,{onError:t});return()=>{o(),r.disconnect()}}];class Iu extends Error{constructor(...e){super(...e),this.name="VisitorError"}}const xu={publish:()=>!1,publishCustomEvent:()=>!1,publishDomEvent:()=>!1,visitor:()=>!1,subscribe:()=>()=>!1};function Eu(e){return"internal"===e?.eventType}const ku=(e,t,r)=>{const n=(e.gates??[]).filter(e=>!e.isOpen);if(0===n.length)return void e.register(t);const o={remaining:n.length},i=[],s=()=>{if(o.remaining--,0===o.remaining){i.forEach(e=>e());try{e.register(t)}catch(n){r&&r(n)}}};for(const a of n)i.push(a.onOpen(s))};function Su(){try{return self.document.referrer}catch{return""}}var Tu=tn("referrer"),Cu=tn("pageContext"),Au=tn("getPageContext");class Pu{constructor(e,{onError:t,bufferSize:r,replayKeep:n,registrationStrategy:o=ku}={}){Object.defineProperty(this,Au,{value:Ou}),this.eventBus=void 0,Object.defineProperty(this,Tu,{writable:!0,value:Su()}),Object.defineProperty(this,Cu,{writable:!0,value:void 0}),this.eventBus=new Ns({subscribeAllKey:"*",onSubscriberError:t,bufferSize:r,replayKeep:n}),this.eventBus.use((e,t,r,n)=>{Reflect.get(n,Rs)?e({...r,replayed:!0}):e()});const i=this.eventBus.subscribe.bind(this.eventBus);e.forEach(e=>{try{o(e,i,t)}catch(r){t?t(r):console?.error("Error registering event hub adapter:",r)}})}emit(e,t){this.eventBus.publish(e,{id:hr(),name:e,timestamp:(new Date).valueOf(),pageContext:Zr(this,Au)[Au](),payload:t})}}function Ou(){const e=self.location.href;return Zr(this,Cu)[Cu]?.url!==e&&(Zr(this,Cu)[Cu]={url:e,referrer:Zr(this,Tu)[Tu]}),Zr(this,Cu)[Cu]}function Ru(e,t){return e.gates=[...e.gates??[],...t],e}var Nu=tn("open"),ju=tn("callbacks");class Mu{constructor(e,t){Object.defineProperty(this,Nu,{writable:!0,value:void 0}),Object.defineProperty(this,ju,{writable:!0,value:new Set}),Zr(this,Nu)[Nu]=e(),Zr(this,Nu)[Nu]||t(()=>{!Zr(this,Nu)[Nu]&&e()&&(Zr(this,Nu)[Nu]=!0,Zr(this,ju)[ju].forEach(e=>e()),Zr(this,ju)[ju].clear())})}get isOpen(){return Zr(this,Nu)[Nu]}onOpen(e){return Zr(this,Nu)[Nu]?(e(),()=>{}):(Zr(this,ju)[ju].add(e),()=>{Zr(this,ju)[ju].delete(e)})}}class Uu extends Mu{constructor(e,t){super(t??(()=>e.analyticsProcessingAllowed()||e.marketingAllowed()),t=>e.onConsentCollected(t))}}var Du=tn("consent"),$u=tn("notify"),Lu=tn("snapshot"),qu=tn("check"),Vu=tn("read"),Bu=tn("matchesSnapshot");class Hu{constructor(e,t){Object.defineProperty(this,Bu,{value:Wu}),Object.defineProperty(this,Vu,{value:zu}),Object.defineProperty(this,qu,{value:Fu}),Object.defineProperty(this,Du,{writable:!0,value:void 0}),Object.defineProperty(this,$u,{writable:!0,value:void 0}),Object.defineProperty(this,Lu,{writable:!0,value:void 0}),Zr(this,Du)[Du]=e,Zr(this,$u)[$u]=t,Zr(this,Lu)[Lu]=Zr(this,Vu)[Vu]()}register(e){Zr(this,Du)[Du].onConsentCollected(()=>{Zr(this,Lu)[Lu]=Zr(this,Vu)[Vu]()}),e("*",()=>Zr(this,qu)[qu]())}}function Fu(){const e=Zr(this,Vu)[Vu]();Zr(this,Bu)[Bu](e)||(Zr(this,$u)[$u](new CustomEvent(g,{detail:e})),Zr(this,Lu)[Lu]=e)}function zu(){const e=Zr(this,Du)[Du].marketingAllowed(),t=Zr(this,Du)[Du].saleOfDataAllowed();return{analyticsAllowed:Zr(this,Du)[Du].analyticsProcessingAllowed(),marketingAllowed:e,preferencesAllowed:Zr(this,Du)[Du].preferencesProcessingAllowed(),saleOfDataAllowed:t,firstPartyMarketingAllowed:e,thirdPartyMarketingAllowed:t}}function Wu(e){return e.analyticsAllowed===Zr(this,Lu)[Lu].analyticsAllowed&&e.marketingAllowed===Zr(this,Lu)[Lu].marketingAllowed&&e.preferencesAllowed===Zr(this,Lu)[Lu].preferencesAllowed&&e.saleOfDataAllowed===Zr(this,Lu)[Lu].saleOfDataAllowed}var Ku=tn("monorailClient"),Yu=tn("options"),Ju=tn("produce");class Xu{constructor(e,t){Object.defineProperty(this,Ju,{value:Gu}),Object.defineProperty(this,Ku,{writable:!0,value:void 0}),Object.defineProperty(this,Yu,{writable:!0,value:void 0}),Zr(this,Ku)[Ku]=e,Zr(this,Yu)[Yu]=t}register(e){e("log:visitor:reported",({payload:{event:e}})=>{Zr(this,Ju)[Ju](e)})}}function Gu(e){Zr(this,Ku)[Ku].produce("web_pixels_manager_visitor/1.0",{email:e.email,phone:e.phone,customerId:e.customerId,apiClientId:e.apiClientId,clientId:Zr(this,Yu)[Yu].consent.trackingTokens.getUniqueToken(),shopId:Zr(this,Yu)[Yu].shopId,version:Dn,pageUrl:Zr(this,Yu)[Yu].pageUrl,surface:Zr(this,Yu)[Yu].surface})}var Qu=tn("collector"),Zu=tn("options"),ed=tn("produce");class td{constructor(e,t){Object.defineProperty(this,ed,{value:rd}),Object.defineProperty(this,Qu,{writable:!0,value:void 0}),Object.defineProperty(this,Zu,{writable:!0,value:void 0}),Zr(this,Qu)[Qu]=e,Zr(this,Zu)[Zu]=t}register(e){e("log:visitor:reported",({payload:{event:e}})=>{Zr(this,ed)[ed](e)})}}function rd(e){const t={"@type":"type.googleapis.com/shopify.buyer_activity.WebPixelsManagerVisitorApiEvent",version:Dn,surface:Zr(this,Zu)[Zu].surface};Zr(this,Qu)[Qu].produce(t,{apiClientId:e.apiClientId,userContext:{email:e.email,phone:e.phone,customerId:e.customerId}})}function nd(e,t){return Boolean(t&&t!==String(e))}const od="storefront_product_interaction_event_test/1.5",id={impression:{local:"product_viewable_impression",remote:"remote_product_viewable_impression"},click:{local:"product_clicked",remote:"remote_product_clicked"}};function sd(e,t){return id[e][t?"remote":"local"]}function ad(e){return e?"remote_product_hovered":"product_hovered"}function cd(e,t){return e.top>=0&&e.top+e.height/2{Zr(this,fd)[fd](e,t,r,n)})}}function vd(e,t,r,n){if((Zr(this,hd)[hd].routeToCollector??dd)(Zr(this,hd)[hd],r).accepted)return;const o=nd(Zr(this,hd)[hd].shopId,r.remoteShopId),i=sd(t,o),{consent:s}=Zr(this,hd)[hd];Zr(this,pd)[pd].produce(od,{eventId:e,source:"EVENT_APP_STOREFRONT",shopId:Zr(this,hd)[hd].shopId,eventName:i,pageUrl:Zr(this,hd)[hd].pageUrl,pageId:Zr(this,hd)[hd].pageId,requestId:Zr(this,hd)[hd].requestId,pageType:r.pageType,productId:r.productId,productHandle:r.productHandle,variantId:r.variantId,apiClientId:Zr(this,hd)[hd].apiClientId,themeId:Zr(this,hd)[hd].themeId,themeStoreId:Zr(this,hd)[hd].themeStoreId,themePublished:Zr(this,hd)[hd].themePublished,remoteShopId:r.remoteShopId,origin:ud(o,r.isCollective),impressionId:r.impressionId,placement:r.placement,position:r.position,aboveFold:cd(r.rect,n),collectionId:r.collectionId,analyticsAllowed:s.analyticsProcessingAllowed(),marketingAllowed:s.marketingAllowed(),preferencesAllowed:s.preferencesProcessingAllowed(),saleOfDataAllowed:s.saleOfDataAllowed(),visitToken:s.trackingTokens.getVisitToken(),uniqueToken:s.trackingTokens.getUniqueToken()},{credentials:!1}),Zr(this,hd)[hd].onEmission?.({eventName:i,schemaId:od})}const gd="type.googleapis.com/shopify.buyer_activity.interactions.ProductVariantChangedEvent",yd="type.googleapis.com/shopify.buyer_activity.interactions.ProductQuantityChangedEvent";function bd({shopId:e,productId:t,variantId:r,collectionId:n,commerceSource:o,quantity:i}){return{productId:ts(t),commerceSource:o,shop:{id:ts(e)},...void 0!==r&&{variantId:ts(r)},...n&&{collectionId:ts(n)},...void 0!==i&&{quantity:i}}}function wd({shopId:e,collectionId:t}){return{...t&&{collectionId:ts(t)},shop:{id:ts(e)}}}function _d({placement:e,index:t,totalItems:r,aboveFold:n}){return{...void 0!==e&&{placement:e},...void 0!==t&&{index:t},...void 0!==r&&{totalItems:r},...void 0!==n&&{aboveFold:n}}}function Id({adResponseId:e,publisherShopId:t,advertiserShopId:r}){return{...e&&{adResponseId:e},shopRelationship:{advertiserShopId:ts(r),publisherShopId:ts(t)}}}function xd(e){return void 0===e?void 0:ts(e)}function Ed(e,t){return Td(e,t)}function kd(e,t){return Td(e,t)}function Sd(e,t){return Td(e,t)}function Td(e,t){const r=nd(e.shopId,t.remoteShopId),n=Ad[ud(r,t.isCollective)];return{product:bd({shopId:r?t.remoteShopId:e.shopId,productId:t.productId,variantId:t.variantId,collectionId:t.collectionId,commerceSource:n}),position:_d({placement:t.placement,index:t.position,totalItems:t.totalProducts,aboveFold:t.aboveFold}),impressionId:t.impressionId}}function Cd(e,t,r){return{...e,advertising:Id({adResponseId:r.adResponseId,publisherShopId:t.shopId,advertiserShopId:r.remoteShopId})}}const Ad={ORIGIN_ORGANIC:"COMMERCE_SOURCE_ORGANIC",ORIGIN_PRODUCT_NETWORK:"COMMERCE_SOURCE_REMOTE",ORIGIN_COLLECTIVE:"COMMERCE_SOURCE_COLLECTIVE"};var Pd=tn("collector"),Od=tn("options"),Rd=tn("produceProductInteraction"),Nd=tn("produceHover"),jd=tn("buildCanonicalContext");class Md{constructor(e,t){Object.defineProperty(this,jd,{value:$d}),Object.defineProperty(this,Nd,{value:Dd}),Object.defineProperty(this,Rd,{value:Ud}),Object.defineProperty(this,Pd,{writable:!0,value:void 0}),Object.defineProperty(this,Od,{writable:!0,value:void 0}),Zr(this,Pd)[Pd]=e,Zr(this,Od)[Od]=t}register(e){e("log:buyer-behavior:product-interaction",({id:e,payload:{interaction:t,event:r,viewport:n}})=>{const o=sd(t,nd(Zr(this,Od)[Od].shopId,r.remoteShopId)),i=ld(Zr(this,Od)[Od],r);i.accepted?Zr(this,Rd)[Rd](e,o,t,r,n,i):Zr(this,Od)[Od].onValidationError?.({eventName:o,reason:i.reason})}),Zr(this,Od)[Od].hoversEnabled&&e("log:buyer-behavior:product-hover",({id:e,payload:{event:t,viewport:r}})=>{const n=ad(nd(Zr(this,Od)[Od].shopId,t.remoteShopId)),o=ld(Zr(this,Od)[Od],t);o.accepted?Zr(this,Nd)[Nd](e,n,t,r,o):Zr(this,Od)[Od].onValidationError?.({eventName:n,reason:o.reason})})}}function Ud(e,t,r,n,o,i){const s={...n,aboveFold:cd(n.rect,o)};let a;var c,u;a="impression"===r?i.remote?Cd(Ed(c=Zr(this,Od)[Od],u={...s,remoteShopId:i.remoteShopId,adResponseId:i.adResponseId}),c,u):Ed(Zr(this,Od)[Od],s):i.remote?function(e,t){return Cd(kd(e,t),e,t)}(Zr(this,Od)[Od],{...s,remoteShopId:i.remoteShopId,adResponseId:i.adResponseId}):kd(Zr(this,Od)[Od],s),Zr(this,Pd)[Pd].produce({"@type":"impression"===r?"type.googleapis.com/shopify.buyer_activity.interactions.ProductImpressionEvent":"type.googleapis.com/shopify.buyer_activity.interactions.ProductClickedEvent",...a},{clientMessageId:e,canonicalContext:Zr(this,jd)[jd](n)}),Zr(this,Od)[Od].onEmission?.({eventName:t})}function Dd(e,t,r,n,o){const i={...r,aboveFold:cd(r.rect,n)},s=o.remote?Cd(Sd(a=Zr(this,Od)[Od],c={...i,remoteShopId:o.remoteShopId,adResponseId:o.adResponseId}),a,c):Sd(Zr(this,Od)[Od],i);var a,c;Zr(this,Pd)[Pd].produce({"@type":"type.googleapis.com/shopify.buyer_activity.interactions.ProductHoveredEvent",...s},{clientMessageId:e,canonicalContext:Zr(this,jd)[jd](r)}),Zr(this,Od)[Od].onEmission?.({eventName:t})}function $d({pageType:e,pageUrl:t}){return{page:void 0===t||{url:t},...e&&{view:{name:e}}}}function Ld({themeId:e,themeStoreId:t,themePublished:r}){if(void 0!==e||void 0!==t||void 0!==r)return{...void 0!==e&&{themeId:ts(e)},...void 0!==t&&{themeStoreId:String(t)},...void 0!==r&&{themePublished:r}}}const qd={collection:"PLACEMENT_TYPE_COLLECTION",search:"PLACEMENT_TYPE_SEARCH",recommendations:"PLACEMENT_TYPE_RECOMMENDATIONS",other:"PLACEMENT_TYPE_OTHER"};function Vd({shopId:e,themeId:t,themeStoreId:r,themePublished:n,pageUrl:o},i){const s=function(e,t,r){if("search"===e){if(t===Fd){const e=function(e){if(e)try{const t=new URL(e).searchParams.get("q")?.trim();return t||void 0}catch{return}}(r);return{searchType:"SEARCH_TYPE_SEARCH_PAGE",...void 0!==e&&{searchQuery:e}}}return{searchType:"SEARCH_TYPE_TYPEAHEAD"}}}(i.placement,i.pageType,o),a=void 0===t?void 0:Ld({themeId:t,themeStoreId:r,themePublished:n});return{...void 0!==i.pageType&&{pageContext:{pageType:i.pageType}},...void 0!==a&&{themeContext:a},product:Hd({shopId:e,productId:i.productId,variantId:i.variantId}),...i.collectionId&&{collection:{shopId:ts(e),collectionId:ts(i.collectionId)}},placementContext:{placement:(c=i.placement,qd[c]??"PLACEMENT_TYPE_UNSPECIFIED"),...void 0!==i.position&&{position:i.position},...void 0!==i.totalProducts&&{totalProducts:i.totalProducts},...void 0!==i.aboveFold&&{aboveFold:i.aboveFold}},...void 0!==s&&{searchContext:s},origin:ud(nd(e,i.remoteShopId),i.isCollective),...void 0!==i.impressionId&&{impressionId:i.impressionId}};var c}function Bd(e,t){return{...Vd(e,t),product:Hd({shopId:t.remoteShopId,productId:t.productId,variantId:t.variantId}),adContext:{responseId:t.adResponseId,publisherShopId:ts(e.shopId),advertiserShopId:ts(t.remoteShopId)}}}function Hd({shopId:e,productId:t,variantId:r}){return{shopId:ts(e),...void 0!==t&&{productId:ts(t)},...void 0!==r&&{variantId:ts(r)}}}const Fd="searchresults";var zd=tn("collector"),Wd=tn("options"),Kd=tn("produceOrganic"),Yd=tn("produceRemote"),Jd=tn("produceImpression"),Xd=tn("produceClick"),Gd=tn("produceHover"),Qd=tn("produceRemoteHover");class Zd{constructor(e,t){Object.defineProperty(this,Qd,{value:il}),Object.defineProperty(this,Gd,{value:ol}),Object.defineProperty(this,Xd,{value:nl}),Object.defineProperty(this,Jd,{value:rl}),Object.defineProperty(this,Yd,{value:tl}),Object.defineProperty(this,Kd,{value:el}),Object.defineProperty(this,zd,{writable:!0,value:void 0}),Object.defineProperty(this,Wd,{writable:!0,value:void 0}),Zr(this,zd)[zd]=e,Zr(this,Wd)[Wd]=t}register(e){e("log:buyer-behavior:product-interaction",({id:e,payload:{interaction:t,event:r,viewport:n}})=>{const o=sd(t,nd(Zr(this,Wd)[Wd].shopId,r.remoteShopId)),i=dd(Zr(this,Wd)[Wd],r);i.accepted?i.remote?Zr(this,Yd)[Yd](e,o,t,r,n,i):Zr(this,Kd)[Kd](e,o,t,r,n):Zr(this,Wd)[Wd].onValidationError?.({eventName:o,reason:i.reason})}),Zr(this,Wd)[Wd].hoversEnabled&&e("log:buyer-behavior:product-hover",({id:e,payload:{event:t,viewport:r}})=>{const n=ad(nd(Zr(this,Wd)[Wd].shopId,t.remoteShopId)),o=dd(Zr(this,Wd)[Wd],t);o.accepted?(o.remote?Zr(this,Qd)[Qd](e,t,r,o):Zr(this,Gd)[Gd](e,t,r),Zr(this,Wd)[Wd].onEmission?.({eventName:n})):Zr(this,Wd)[Wd].onValidationError?.({eventName:n,reason:o.reason})})}}function el(e,t,r,n,o){"impression"===r?Zr(this,Jd)[Jd](e,n,o):Zr(this,Xd)[Xd](e,n,o),Zr(this,Wd)[Wd].onEmission?.({eventName:t})}function tl(e,t,r,n,o,{remoteShopId:i,adResponseId:s}){const a=Bd(Zr(this,Wd)[Wd],{...n,remoteShopId:i,adResponseId:s,aboveFold:cd(n.rect,o)});"impression"===r?Zr(this,zd)[zd].produce({"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontRemoteProductViewableImpressionEvent",...a},{clientMessageId:e}):Zr(this,zd)[zd].produce({"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontRemoteProductClickedEvent",...a},{clientMessageId:e}),Zr(this,Wd)[Wd].onEmission?.({eventName:t})}function rl(e,t,r){const n={"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontProductViewableImpressionEvent",...Vd(Zr(this,Wd)[Wd],{...t,aboveFold:cd(t.rect,r)})};Zr(this,zd)[zd].produce(n,{clientMessageId:e})}function nl(e,t,r){const n={"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontProductClickedEvent",...Vd(Zr(this,Wd)[Wd],{...t,aboveFold:cd(t.rect,r)})};Zr(this,zd)[zd].produce(n,{clientMessageId:e})}function ol(e,t,r){const n={"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontProductHoveredEvent",...Vd(Zr(this,Wd)[Wd],{...t,aboveFold:cd(t.rect,r)})};Zr(this,zd)[zd].produce(n,{clientMessageId:e})}function il(e,t,r,{remoteShopId:n,adResponseId:o}){const i=Bd(Zr(this,Wd)[Wd],{...t,remoteShopId:n,adResponseId:o,aboveFold:cd(t.rect,r)});Zr(this,zd)[zd].produce({"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontRemoteProductHoveredEvent",...i},{clientMessageId:e})}var sl=tn("monorailClient"),al=tn("options"),cl=tn("produce");class ul{constructor(e,t){Object.defineProperty(this,cl,{value:dl}),Object.defineProperty(this,sl,{writable:!0,value:void 0}),Object.defineProperty(this,al,{writable:!0,value:void 0}),Zr(this,sl)[sl]=e,Zr(this,al)[al]=t}register(e){e("log:buyer-behavior:product-hover",({id:e,payload:{event:t,viewport:r}})=>{Zr(this,cl)[cl](e,t,r)})}}function dl(e,t,r){if((Zr(this,al)[al].routeToCollector??dd)(Zr(this,al)[al],t).accepted)return;const n=nd(Zr(this,al)[al].shopId,t.remoteShopId),o=ad(n),{consent:i}=Zr(this,al)[al];Zr(this,sl)[sl].produce(od,{eventId:e,source:"EVENT_APP_STOREFRONT",shopId:Zr(this,al)[al].shopId,eventName:o,pageUrl:Zr(this,al)[al].pageUrl,pageId:Zr(this,al)[al].pageId,requestId:Zr(this,al)[al].requestId,pageType:t.pageType,productId:t.productId,productHandle:t.productHandle,variantId:t.variantId,apiClientId:Zr(this,al)[al].apiClientId,themeId:Zr(this,al)[al].themeId,themeStoreId:Zr(this,al)[al].themeStoreId,themePublished:Zr(this,al)[al].themePublished,remoteShopId:t.remoteShopId,origin:ud(n,t.isCollective),impressionId:t.impressionId,placement:t.placement,position:t.position,aboveFold:cd(t.rect,r),collectionId:t.collectionId,analyticsAllowed:i.analyticsProcessingAllowed(),marketingAllowed:i.marketingAllowed(),preferencesAllowed:i.preferencesProcessingAllowed(),saleOfDataAllowed:i.saleOfDataAllowed(),visitToken:i.trackingTokens.getVisitToken(),uniqueToken:i.trackingTokens.getUniqueToken()},{credentials:!1}),Zr(this,al)[al].onEmission?.({eventName:o,schemaId:od})}const ll="storefront_product_interaction_event_test/1.5";function pl(e,t){const{shopId:r,themeId:n,themePublished:o,pageType:i,resourceId:s}=e;if(void 0===n||void 0===o)return{accepted:!1,reason:"missing-theme-context"};if(!Number.isInteger(t.dwellMilliseconds)||t.dwellMilliseconds<=0)return{accepted:!1,reason:"invalid-dwell-duration"};if(i===ar.Product){const{variantId:e,remoteShopId:i}=t;return gr(s)?gr(e)?nd(r,i)?gr(i)?{accepted:!0,themeId:n,themePublished:o,variant:"remote-product",productId:s,variantId:e,remoteShopId:i}:{accepted:!1,reason:"invalid-remote-shop-id"}:{accepted:!0,themeId:n,themePublished:o,variant:"product",productId:s,variantId:e}:{accepted:!1,reason:"invalid-variant-id"}:{accepted:!1,reason:"invalid-product-id"}}return s&&!gr(s)?{accepted:!1,reason:"invalid-collection-id"}:{accepted:!0,themeId:n,themePublished:o,variant:"collection"}}function hl(e,t){const{shopId:r,pageType:n,resourceId:o}=e;if(!Number.isInteger(t.dwellMilliseconds)||t.dwellMilliseconds<=0)return{accepted:!1,reason:"invalid-dwell-duration"};if(n===ar.Product){const{variantId:e,remoteShopId:n}=t;return gr(o)?gr(e)?nd(r,n)?gr(n)?{accepted:!0,variant:"remote-product",productId:o,variantId:e,remoteShopId:n}:{accepted:!1,reason:"invalid-remote-shop-id"}:{accepted:!0,variant:"product",productId:o,variantId:e}:{accepted:!1,reason:"invalid-variant-id"}:{accepted:!1,reason:"invalid-product-id"}}return o&&!gr(o)?{accepted:!1,reason:"invalid-collection-id"}:{accepted:!0,variant:"collection"}}const fl={[ar.Product]:"product_page_dwelled",[ar.Collection]:"collection_page_dwelled"};var ml=tn("monorailClient"),vl=tn("options"),gl=tn("handle");class yl{constructor(e,t){Object.defineProperty(this,gl,{value:bl}),Object.defineProperty(this,ml,{writable:!0,value:void 0}),Object.defineProperty(this,vl,{writable:!0,value:void 0}),Zr(this,ml)[ml]=e,Zr(this,vl)[vl]=t}register(e){e("log:buyer-behavior:page-dwell",({id:e,payload:{event:t}})=>{Zr(this,gl)[gl](e,t)})}}function bl(e,t){if((Zr(this,vl)[vl].routeToCollector??pl)(Zr(this,vl)[vl],t).accepted)return;const{consent:r,pageType:n,resourceId:o}=Zr(this,vl)[vl],i=n===ar.Product&&nd(Zr(this,vl)[vl].shopId,t.remoteShopId)?"remote_product_page_dwelled":fl[n];Zr(this,ml)[ml].produce(ll,{eventId:e,source:"EVENT_APP_STOREFRONT",shopId:Zr(this,vl)[vl].shopId,eventName:i,pageUrl:Zr(this,vl)[vl].pageUrl,pageId:Zr(this,vl)[vl].pageId,requestId:Zr(this,vl)[vl].requestId,pageType:n,productId:n===ar.Product?o:void 0,productHandle:t.productHandle,variantId:t.variantId,collectionId:n===ar.Collection?o:void 0,remoteShopId:t.remoteShopId,apiClientId:Zr(this,vl)[vl].apiClientId,themeId:Zr(this,vl)[vl].themeId,themeStoreId:Zr(this,vl)[vl].themeStoreId,themePublished:Zr(this,vl)[vl].themePublished,dwellMilliseconds:t.dwellMilliseconds,analyticsAllowed:r.analyticsProcessingAllowed(),marketingAllowed:r.marketingAllowed(),preferencesAllowed:r.preferencesProcessingAllowed(),saleOfDataAllowed:r.saleOfDataAllowed(),visitToken:r.trackingTokens.getVisitToken(),uniqueToken:r.trackingTokens.getUniqueToken()},{credentials:!1}),Zr(this,vl)[vl].onEmission?.({eventName:i,schemaId:ll})}function wl(e,t){return{pageContext:{pageType:e.pageType},themeContext:xl(e),product:{shopId:ts(e.shopId),productId:ts(t.productId),variantId:ts(t.variantId)},dwellTimeMs:t.dwellMilliseconds}}function _l(e,t){return{pageContext:{pageType:e.pageType},themeContext:xl(e),collection:{shopId:ts(e.shopId),...t.collectionId&&{collectionId:ts(t.collectionId)}},dwellTimeMs:t.dwellMilliseconds}}function Il(e,t){const r=wl(e,t);return{...r,product:{...r.product,shopId:ts(t.remoteShopId)},adContext:{publisherShopId:ts(e.shopId),advertiserShopId:ts(t.remoteShopId),...void 0!==t.adResponseId&&{responseId:t.adResponseId}}}}function xl({themeId:e,themeStoreId:t,themePublished:r}){return{themeId:ts(e),...void 0!==t&&{themeStoreId:String(t)},themePublished:r}}var El=tn("collector"),kl=tn("options"),Sl=tn("handle"),Tl=tn("eventName"),Cl=tn("produce");class Al{constructor(e,t){Object.defineProperty(this,Cl,{value:Rl}),Object.defineProperty(this,Tl,{value:Ol}),Object.defineProperty(this,Sl,{value:Pl}),Object.defineProperty(this,El,{writable:!0,value:void 0}),Object.defineProperty(this,kl,{writable:!0,value:void 0}),Zr(this,El)[El]=e,Zr(this,kl)[kl]=t}register(e){e("log:buyer-behavior:page-dwell",({id:e,payload:{event:t}})=>{Zr(this,Sl)[Sl](e,t)})}}function Pl(e,t){const r=nd(Zr(this,kl)[kl].shopId,t.remoteShopId),n=Zr(this,Tl)[Tl](r),o=pl(Zr(this,kl)[kl],t);if(!o.accepted)return void Zr(this,kl)[kl].onValidationError?.({eventName:n,reason:o.reason});const i={shopId:Zr(this,kl)[kl].shopId,themeId:o.themeId,themeStoreId:Zr(this,kl)[kl].themeStoreId,themePublished:o.themePublished,pageType:Zr(this,kl)[kl].pageType},{dwellMilliseconds:s}=t;"product"===o.variant?Zr(this,Cl)[Cl](e,n,{"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontProductPageDwelledEvent",...wl(i,{productId:o.productId,variantId:o.variantId,dwellMilliseconds:s})}):"remote-product"===o.variant?Zr(this,Cl)[Cl](e,n,{"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontRemoteProductPageDwelledEvent",...Il(i,{productId:o.productId,variantId:o.variantId,remoteShopId:o.remoteShopId,adResponseId:t.adResponseId,dwellMilliseconds:s})}):Zr(this,Cl)[Cl](e,n,{"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontCollectionPageDwelledEvent",..._l(i,{collectionId:Zr(this,kl)[kl].resourceId,dwellMilliseconds:s})})}function Ol(e){return Zr(this,kl)[kl].pageType===ar.Product?e?"remote_product_page_dwelled":"product_page_dwelled":"collection_page_dwelled"}function Rl(e,t,r){Zr(this,El)[El].produce(r,{clientMessageId:e}),Zr(this,kl)[kl].onEmission?.({eventName:t})}function Nl(e){return{dwellTimeMs:String(e.dwellMilliseconds)}}var jl=tn("collector"),Ml=tn("options"),Ul=tn("handle"),Dl=tn("eventName");class $l{constructor(e,t){Object.defineProperty(this,Dl,{value:ql}),Object.defineProperty(this,Ul,{value:Ll}),Object.defineProperty(this,jl,{writable:!0,value:void 0}),Object.defineProperty(this,Ml,{writable:!0,value:void 0}),Zr(this,jl)[jl]=e,Zr(this,Ml)[Ml]=t}register(e){e("log:buyer-behavior:page-dwell",({id:e,payload:{event:t}})=>{Zr(this,Ul)[Ul](e,t)})}}function Ll(e,t){const r=nd(Zr(this,Ml)[Ml].shopId,t.remoteShopId),n=Zr(this,Dl)[Dl](r),o=hl(Zr(this,Ml)[Ml],t);if(!o.accepted)return void Zr(this,Ml)[Ml].onValidationError?.({eventName:n,reason:o.reason});const i={shopId:Zr(this,Ml)[Ml].shopId},{dwellMilliseconds:s}=t;let a;a="product"===o.variant?function(e,t){return{products:[bd({shopId:e.shopId,productId:t.productId,variantId:t.variantId,commerceSource:"COMMERCE_SOURCE_ORGANIC"})],...Nl(t)}}(i,{productId:o.productId,variantId:o.variantId,dwellMilliseconds:s}):"remote-product"===o.variant?function(e){return{products:[bd({shopId:e.remoteShopId,productId:e.productId,variantId:e.variantId,commerceSource:"COMMERCE_SOURCE_REMOTE"})],...Nl(e)}}({productId:o.productId,variantId:o.variantId,remoteShopId:o.remoteShopId,dwellMilliseconds:s}):function(e,t){return{collection:wd({shopId:e.shopId,collectionId:t.collectionId}),...Nl(t)}}(i,{collectionId:Zr(this,Ml)[Ml].resourceId,dwellMilliseconds:s}),Zr(this,jl)[jl].produce({"@type":"type.googleapis.com/shopify.buyer_activity.interactions.PageDwelledEvent",...a},{clientMessageId:e,canonicalContext:{page:void 0===t.pageUrl||{url:t.pageUrl},view:{name:Zr(this,Ml)[Ml].pageType}}}),Zr(this,Ml)[Ml].onEmission?.({eventName:n})}function ql(e){return Zr(this,Ml)[Ml].pageType===ar.Product?e?"remote_product_page_dwelled":"product_page_dwelled":"collection_page_dwelled"}const Vl="storefront_product_interaction_event_test/1.5",Bl="product_quantity_changed",Hl="remote_product_quantity_changed";function Fl({shopId:e,productId:t,pageUrl:r,themeId:n,themePublished:o},i){const{quantity:s,remoteShopId:a,variantId:c}=i;if(void 0===n||void 0===o)return{accepted:!1,reason:"missing-theme-context"};if(!gr(t))return{accepted:!1,reason:"invalid-product-id"};if(!Number.isInteger(s)||s<=0)return{accepted:!1,reason:"invalid-quantity"};if(void 0!==c&&!gr(c))return{accepted:!1,reason:"invalid-variant-id"};if(!nd(e,a))return{accepted:!0,remote:!1};if(!gr(a))return{accepted:!1,reason:"invalid-remote-shop-id"};const u=mr(r)?.adResponseId;return u?{accepted:!0,remote:!0,remoteShopId:a,adResponseId:u}:{accepted:!1,reason:"missing-ad-response-id"}}function zl({shopId:e,productId:t},r){const{quantity:n,remoteShopId:o,variantId:i}=r;return gr(t)?!Number.isInteger(n)||n<=0?{accepted:!1,reason:"invalid-quantity"}:void 0===i||gr(i)?nd(e,o)?gr(o)?{accepted:!0,remote:!0,remoteShopId:o}:{accepted:!1,reason:"invalid-remote-shop-id"}:{accepted:!0,remote:!1}:{accepted:!1,reason:"invalid-variant-id"}:{accepted:!1,reason:"invalid-product-id"}}var Wl=tn("monorailClient"),Kl=tn("options"),Yl=tn("handle");class Jl{constructor(e,t){Object.defineProperty(this,Yl,{value:Xl}),Object.defineProperty(this,Wl,{writable:!0,value:void 0}),Object.defineProperty(this,Kl,{writable:!0,value:void 0}),Zr(this,Wl)[Wl]=e,Zr(this,Kl)[Kl]=t}register(e){e("log:buyer-behavior:product-quantity-change",({id:e,payload:{interaction:t,event:r}})=>{"quantity"===t&&Zr(this,Yl)[Yl](e,r)})}}function Xl(e,t){if((Zr(this,Kl)[Kl].routeToCollector??Fl)(Zr(this,Kl)[Kl],t).accepted)return;const r=nd(Zr(this,Kl)[Kl].shopId,t.remoteShopId)?Hl:Bl,{consent:n}=Zr(this,Kl)[Kl];Zr(this,Wl)[Wl].produce(Vl,{eventId:e,source:"EVENT_APP_STOREFRONT",shopId:Zr(this,Kl)[Kl].shopId,eventName:r,pageUrl:Zr(this,Kl)[Kl].pageUrl,pageId:Zr(this,Kl)[Kl].pageId,requestId:Zr(this,Kl)[Kl].requestId,pageType:ar.Product,productId:Zr(this,Kl)[Kl].productId,productHandle:t.productHandle,variantId:t.variantId,remoteShopId:t.remoteShopId,apiClientId:Zr(this,Kl)[Kl].apiClientId,themeId:Zr(this,Kl)[Kl].themeId,themeStoreId:Zr(this,Kl)[Kl].themeStoreId,themePublished:Zr(this,Kl)[Kl].themePublished,quantity:t.quantity,analyticsAllowed:n.analyticsProcessingAllowed(),marketingAllowed:n.marketingAllowed(),preferencesAllowed:n.preferencesProcessingAllowed(),saleOfDataAllowed:n.saleOfDataAllowed(),visitToken:n.trackingTokens.getVisitToken(),uniqueToken:n.trackingTokens.getUniqueToken()},{credentials:!1}),Zr(this,Kl)[Kl].onEmission?.({eventName:r,schemaId:Vl})}function Gl({shopId:e,productId:t,pageType:r,themeId:n,themeStoreId:o,themePublished:i},{quantity:s,variantId:a}){return{...void 0!==r&&{pageContext:{pageType:r}},...void 0!==n&&{themeContext:{themeId:ts(n),...void 0!==o&&{themeStoreId:String(o)},...void 0!==i&&{themePublished:i}}},product:Zl({shopId:e,productId:t,variantId:a}),quantity:s}}function Ql(e,t){return{...Gl(e,t),product:Zl({shopId:t.remoteShopId,productId:e.productId,variantId:t.variantId}),adContext:{responseId:t.adResponseId,publisherShopId:ts(e.shopId),advertiserShopId:ts(t.remoteShopId)}}}function Zl({shopId:e,productId:t,variantId:r}){return{shopId:ts(e),productId:ts(t),...void 0!==r&&{variantId:ts(r)}}}var ep=tn("collector"),tp=tn("options"),rp=tn("produce"),np=tn("produceRemote");class op{constructor(e,t){Object.defineProperty(this,np,{value:sp}),Object.defineProperty(this,rp,{value:ip}),Object.defineProperty(this,ep,{writable:!0,value:void 0}),Object.defineProperty(this,tp,{writable:!0,value:void 0}),Zr(this,ep)[ep]=e,Zr(this,tp)[tp]=t}register(e){e("log:buyer-behavior:product-quantity-change",({id:e,payload:{interaction:t,event:r}})=>{if("quantity"!==t)return;const n=nd(Zr(this,tp)[tp].shopId,r.remoteShopId)?Hl:Bl,o=Fl(Zr(this,tp)[tp],r);o.accepted?o.remote?Zr(this,np)[np](e,n,r,o):Zr(this,rp)[rp](e,n,r):Zr(this,tp)[tp].onValidationError?.({eventName:n,reason:o.reason})})}}function ip(e,t,r){const n={"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontProductQuantityChangedEvent",...Gl(Zr(this,tp)[tp],r)};Zr(this,ep)[ep].produce(n,{clientMessageId:e}),Zr(this,tp)[tp].onEmission?.({eventName:t})}function sp(e,t,r,{remoteShopId:n,adResponseId:o}){const i={"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontRemoteProductQuantityChangedEvent",...Ql(Zr(this,tp)[tp],{...r,remoteShopId:n,adResponseId:o})};Zr(this,ep)[ep].produce(i,{clientMessageId:e}),Zr(this,tp)[tp].onEmission?.({eventName:t})}function ap(e,t){return{product:bd({shopId:e.shopId,productId:e.productId,variantId:t.variantId,commerceSource:"COMMERCE_SOURCE_ORGANIC"}),selectedQuantity:t.quantity}}var cp=tn("collector"),up=tn("options"),dp=tn("produceOrganic"),lp=tn("produceRemote");class pp{constructor(e,t){Object.defineProperty(this,lp,{value:fp}),Object.defineProperty(this,dp,{value:hp}),Object.defineProperty(this,cp,{writable:!0,value:void 0}),Object.defineProperty(this,up,{writable:!0,value:void 0}),Zr(this,cp)[cp]=e,Zr(this,up)[up]=t}register(e){e("log:buyer-behavior:product-quantity-change",({id:e,payload:{interaction:t,event:r}})=>{if("quantity"!==t)return;const n=nd(Zr(this,up)[up].shopId,r.remoteShopId)?Hl:Bl,o=zl(Zr(this,up)[up],r);o.accepted?o.remote?Zr(this,lp)[lp](e,n,r,o):Zr(this,dp)[dp](e,n,r):Zr(this,up)[up].onValidationError?.({eventName:n,reason:o.reason})})}}function hp(e,t,r){Zr(this,cp)[cp].produce({"@type":yd,...ap(Zr(this,up)[up],r)},{clientMessageId:e,canonicalContext:{page:void 0===r.pageUrl||{url:r.pageUrl},...Zr(this,up)[up].pageType&&{view:{name:Zr(this,up)[up].pageType}}}}),Zr(this,up)[up].onEmission?.({eventName:t})}function fp(e,t,r,{remoteShopId:n}){var o,i;Zr(this,cp)[cp].produce({"@type":yd,...(o=Zr(this,up)[up],i={...r,remoteShopId:n},{...ap(o,i),product:bd({shopId:i.remoteShopId,productId:o.productId,variantId:i.variantId,commerceSource:"COMMERCE_SOURCE_REMOTE"})})},{clientMessageId:e,canonicalContext:{page:void 0===r.pageUrl||{url:r.pageUrl},...Zr(this,up)[up].pageType&&{view:{name:Zr(this,up)[up].pageType}}}}),Zr(this,up)[up].onEmission?.({eventName:t})}const mp="storefront_product_interaction_event_test/1.5",vp="product_variant_changed",gp="remote_product_variant_changed";function yp({shopId:e,resourceId:t,pageUrl:r,themeId:n,themePublished:o},i){if(void 0===n||void 0===o)return{accepted:!1,reason:"missing-theme-context"};if(!gr(t))return{accepted:!1,reason:"invalid-product-id"};if(!gr(i.variantId))return{accepted:!1,reason:"invalid-variant-id"};const{remoteShopId:s}=i;if(!nd(e,s))return{accepted:!0,remote:!1};if(!gr(s))return{accepted:!1,reason:"invalid-remote-shop-id"};const a=mr(r)?.adResponseId;return a?{accepted:!0,remote:!0,remoteShopId:s,adResponseId:a}:{accepted:!1,reason:"missing-ad-response-id"}}function bp({shopId:e,resourceId:t},r){if(!gr(t))return{accepted:!1,reason:"invalid-product-id"};if(!gr(r.variantId))return{accepted:!1,reason:"invalid-variant-id"};const{remoteShopId:n}=r;return nd(e,n)?gr(n)?{accepted:!0,remote:!0,remoteShopId:n}:{accepted:!1,reason:"invalid-remote-shop-id"}:{accepted:!0,remote:!1}}var wp=tn("monorailClient"),_p=tn("options"),Ip=tn("handle");class xp{constructor(e,t){Object.defineProperty(this,Ip,{value:Ep}),Object.defineProperty(this,wp,{writable:!0,value:void 0}),Object.defineProperty(this,_p,{writable:!0,value:void 0}),Zr(this,wp)[wp]=e,Zr(this,_p)[_p]=t}register(e){e("log:buyer-behavior:product-variant-change",({id:e,payload:{event:t}})=>{Zr(this,Ip)[Ip](e,t)})}}function Ep(e,t){if((Zr(this,_p)[_p].routeToCollector??yp)(Zr(this,_p)[_p],t).accepted)return;const r=nd(Zr(this,_p)[_p].shopId,t.remoteShopId)?gp:vp,{consent:n}=Zr(this,_p)[_p];Zr(this,wp)[wp].produce(mp,{eventId:e,source:"EVENT_APP_STOREFRONT",shopId:Zr(this,_p)[_p].shopId,eventName:r,pageUrl:Zr(this,_p)[_p].pageUrl,pageId:Zr(this,_p)[_p].pageId,requestId:Zr(this,_p)[_p].requestId,pageType:ar.Product,productId:Zr(this,_p)[_p].resourceId,productHandle:t.productHandle,variantId:t.variantId,remoteShopId:t.remoteShopId,apiClientId:Zr(this,_p)[_p].apiClientId,themeId:Zr(this,_p)[_p].themeId,themeStoreId:Zr(this,_p)[_p].themeStoreId,themePublished:Zr(this,_p)[_p].themePublished,analyticsAllowed:n.analyticsProcessingAllowed(),marketingAllowed:n.marketingAllowed(),preferencesAllowed:n.preferencesProcessingAllowed(),saleOfDataAllowed:n.saleOfDataAllowed(),visitToken:n.trackingTokens.getVisitToken(),uniqueToken:n.trackingTokens.getUniqueToken()},{credentials:!1}),Zr(this,_p)[_p].onEmission?.({eventName:r,schemaId:mp})}function kp(e,t){return{products:[bd({shopId:e.shopId,productId:e.resourceId,variantId:t.variantId,commerceSource:"COMMERCE_SOURCE_ORGANIC"})],selectedVariantId:xd(t.variantId)}}var Sp=tn("collector"),Tp=tn("options"),Cp=tn("produceOrganic"),Ap=tn("produceRemote");class Pp{constructor(e,t){Object.defineProperty(this,Ap,{value:Rp}),Object.defineProperty(this,Cp,{value:Op}),Object.defineProperty(this,Sp,{writable:!0,value:void 0}),Object.defineProperty(this,Tp,{writable:!0,value:void 0}),Zr(this,Sp)[Sp]=e,Zr(this,Tp)[Tp]=t}register(e){e("log:buyer-behavior:product-variant-change",({id:e,payload:{event:t}})=>{const r=nd(Zr(this,Tp)[Tp].shopId,t.remoteShopId)?gp:vp,n=bp(Zr(this,Tp)[Tp],t);n.accepted?n.remote?Zr(this,Ap)[Ap](e,r,t,n):Zr(this,Cp)[Cp](e,r,t):Zr(this,Tp)[Tp].onValidationError?.({eventName:r,reason:n.reason})})}}function Op(e,t,r){Zr(this,Sp)[Sp].produce({"@type":gd,...kp(Zr(this,Tp)[Tp],r)},{clientMessageId:e,canonicalContext:{page:void 0===r.pageUrl||{url:r.pageUrl},view:{name:ar.Product}}}),Zr(this,Tp)[Tp].onEmission?.({eventName:t})}function Rp(e,t,r,{remoteShopId:n}){var o,i;Zr(this,Sp)[Sp].produce({"@type":gd,...(o=Zr(this,Tp)[Tp],i={...r,remoteShopId:n},{...kp(o,i),products:[bd({shopId:i.remoteShopId,productId:o.resourceId,variantId:i.variantId,commerceSource:"COMMERCE_SOURCE_REMOTE"})]})},{clientMessageId:e,canonicalContext:{page:void 0===r.pageUrl||{url:r.pageUrl},view:{name:ar.Product}}}),Zr(this,Tp)[Tp].onEmission?.({eventName:t})}function Np({shopId:e,resourceId:t,themeId:r,themeStoreId:n,themePublished:o},i){const s=Ld({themeId:r,themeStoreId:n,themePublished:o});return{pageContext:{pageType:ar.Product},...void 0!==s&&{themeContext:s},product:{shopId:ts(e),productId:ts(t),variantId:ts(i.variantId)}}}var jp=tn("collector"),Mp=tn("options"),Up=tn("produceOrganic"),Dp=tn("produceRemote");class $p{constructor(e,t){Object.defineProperty(this,Dp,{value:qp}),Object.defineProperty(this,Up,{value:Lp}),Object.defineProperty(this,jp,{writable:!0,value:void 0}),Object.defineProperty(this,Mp,{writable:!0,value:void 0}),Zr(this,jp)[jp]=e,Zr(this,Mp)[Mp]=t}register(e){e("log:buyer-behavior:product-variant-change",({id:e,payload:{event:t}})=>{const r=nd(Zr(this,Mp)[Mp].shopId,t.remoteShopId)?gp:vp,n=yp(Zr(this,Mp)[Mp],t);n.accepted?n.remote?Zr(this,Dp)[Dp](e,r,t,n):Zr(this,Up)[Up](e,r,t):Zr(this,Mp)[Mp].onValidationError?.({eventName:r,reason:n.reason})})}}function Lp(e,t,r){const n={"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontProductVariantChangedEvent",...Np(Zr(this,Mp)[Mp],r)};Zr(this,jp)[jp].produce(n,{clientMessageId:e}),Zr(this,Mp)[Mp].onEmission?.({eventName:t})}function qp(e,t,r,{remoteShopId:n,adResponseId:o}){const i={"@type":"type.googleapis.com/shopify.buyer_activity.interactions.StorefrontRemoteProductVariantChangedEvent",...(s=Zr(this,Mp)[Mp],a={...r,remoteShopId:n,adResponseId:o},{...Np(s,a),product:{shopId:ts(a.remoteShopId),productId:ts(s.resourceId),variantId:ts(a.variantId)},adContext:{responseId:a.adResponseId,publisherShopId:ts(s.shopId),advertiserShopId:ts(a.remoteShopId)}})};var s,a;Zr(this,jp)[jp].produce(i,{clientMessageId:e}),Zr(this,Mp)[Mp].onEmission?.({eventName:t})}var Vp=tn("monorailClient"),Bp=tn("configuration");class Hp{constructor(e,t){Object.defineProperty(this,Vp,{writable:!0,value:void 0}),Object.defineProperty(this,Bp,{writable:!0,value:void 0}),Zr(this,Vp)[Vp]=e,Zr(this,Bp)[Bp]=t}register(e){Zr(this,Bp)[Bp].surface===ve.CustomerAccount&&e("log:event-bus:publish",({payload:{event:e}})=>{if("page_viewed"===e.name){const{context:t}=e,{consent:r}=Zr(this,Bp)[Bp],n=r.analyticsProcessingAllowed(),o=r.marketingAllowed(),i=r.preferencesProcessingAllowed(),s=r.saleOfDataAllowed(),a=!(o&&n),c={eventName:"page_rendered",shopifyEmitted:!0,eventTime:new Date(e.timestamp).valueOf(),eventId:e.id,uniqueToken:e.clientId,userAgent:t.navigator.userAgent,acceptLanguage:t.navigator.language,referrer:t.document.referrer,eventSourceUrl:t.document.location.href,source:`wpm-${Zr(this,Bp)[Bp].surface}`,shopId:Zr(this,Bp)[Bp].shopId,isMerchantRequest:Zr(this,Bp)[Bp].isMerchantRequest,apiClientId:Zr(this,Bp)[Bp].apiClientId,customerId:Zr(this,Bp)[Bp].customerId,analyticsAllowed:n,marketingAllowed:o,preferencesAllowed:i,saleOfDataAllowed:s,facebookCapiEnabled:Zr(this,Bp)[Bp].firstPartyTracking.facebookCapiEnabled,deprecatedVisitToken:r.trackingTokens.getVisitToken()};Zr(this,Vp)[Vp].produce("storefront_customer_tracking/4.27",{...c,emittedToV5:!0,ccpaEnforced:!s,gdprEnforced:a,isPersistentCookie:"persistent"===(Wt("_shopify_m")??"persistent")});const{browserContext:u}=Zr(this,Bp)[Bp];Zr(this,Vp)[Vp].produce("storefront_customer_tracking/5.11",{...c,tiCv:Ln,...u&&{attributes:()=>{const e=u.getAttributes();return e&&JSON.stringify(e)},attributesVersion:2}})}})}}r(9335);const Fp=["checkout_completed","checkout_started","payment_info_submitted","checkout_shipping_info_submitted","checkout_contact_info_submitted","checkout_address_info_submitted"],zp=new Set([...Fp,"page_viewed","product_viewed","collection_viewed","product_added_to_cart","search_submitted"]),Wp={page_viewed:"page_rendered",product_viewed:"product_page_rendered",collection_viewed:"collection_page_rendered"},Kp=e=>Wp[e]||e,Yp=(e,t)=>{const r=e?.product?.title,n=e?.title,o=r&&n?`${r} - ${n}`:r;return{variant_id:e?.id||void 0,product_id:e?.product?.id||void 0,handle:Ue(e?.product?.url),name:o||void 0,price:e?.price?.amount??void 0,sku:e?.sku||void 0,brand:e?.product?.vendor||void 0,variant:e?.title||void 0,category:e?.product?.type||void 0,quantity:t||void 0}},Jp=e=>{try{return e.map(e=>JSON.stringify(e))}catch(t){return console.warn("Failed to serialize product objects for tracking:",t),[]}};var Xp=tn("client"),Gp=tn("surface"),Qp=tn("sessionId");class Zp{constructor(e,{surface:t,sessionId:r}){Object.defineProperty(this,Xp,{writable:!0,value:void 0}),Object.defineProperty(this,Gp,{writable:!0,value:void 0}),Object.defineProperty(this,Qp,{writable:!0,value:void 0}),Zr(this,Xp)[Xp]=e,Zr(this,Gp)[Gp]=t,Zr(this,Qp)[Qp]=r}register(e){e("log:event-bus:publish",({payload:{event:e}})=>{if(!(e=>zp.has(e.name))(e))return;const{context:t}=e,r={eventTime:new Date(e.timestamp).valueOf(),eventId:e.id,uniqueToken:e.clientId,eventSourceUrl:t.document.location.href,surface:Zr(this,Gp)[Gp],userAgent:t.navigator.userAgent,sessionId:Zr(this,Qp)[Qp],referrer:t.document.referrer};if((e=>Fp.includes(e.name))(e)){const{checkout:t}=e.data;Zr(this,Xp)[Xp].track({...r,eventName:e.name,checkoutToken:t.token||void 0,orderId:t.order?.id||void 0,subtotalValue:t.subtotalPrice?.amount,totalValue:t.totalPrice?.amount,currency:t.currencyCode||void 0,email:t.email||void 0,phone:t.shippingAddress?.phone||void 0,billingAddressCity:t.shippingAddress?.city||void 0,billingAddressCountry:t.shippingAddress?.country||void 0,billingAddressRegion:t.shippingAddress?.province||void 0,products:Jp(t.lineItems.flatMap(({variant:e,quantity:t})=>e?[Yp(e,t)]:[]))})}else if("product_viewed"===e.name){const{productVariant:t}=e.data;Zr(this,Xp)[Xp].track({...r,eventName:Kp(e.name),productId:t.product?.id||void 0,productTitle:t.product?.title||void 0,totalValue:t.price?.amount||void 0,currency:t.price?.currencyCode||void 0})}else if("collection_viewed"===e.name){const{collection:t}=e.data;Zr(this,Xp)[Xp].track({...r,eventName:Kp(e.name),collectionName:t?.title||void 0,currency:t?.productVariants?.find(e=>e?.price?.currencyCode)?.price?.currencyCode||void 0})}else if("product_added_to_cart"===e.name){const{cartLine:t}=e.data,{merchandise:n}=t||{},o=Jp([Yp(n,t?.quantity)]);Zr(this,Xp)[Xp].track({...r,eventName:e.name,products:o,totalValue:t?.cost?.totalAmount?.amount||void 0,currency:t?.cost?.totalAmount?.currencyCode||void 0})}else if("page_viewed"===e.name)Zr(this,Xp)[Xp].track({...r,eventName:Kp(e.name),referrer:t.document.referrer});else if("search_submitted"===e.name){const{searchResult:n}=e.data;Zr(this,Xp)[Xp].track({...r,eventName:e.name,searchString:n?.query||"",referrer:t.document.referrer})}})}}var eh=tn("sendEvent"),th=tn("configuration");class rh{constructor(e,t){Object.defineProperty(this,eh,{writable:!0,value:void 0}),Object.defineProperty(this,th,{writable:!0,value:void 0}),Zr(this,eh)[eh]=e,Zr(this,th)[th]=t}track(e){try{const{consent:t}=Zr(this,th)[th],r={...e,shopId:Zr(this,th)[th].shopId,source:this.constructSource(e.surface),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),preferencesAllowed:t.preferencesProcessingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),assetVersionId:Dn,facebookCapiEnabled:!1,shopifyEmitted:!0};Zr(this,eh)[eh](hi("webPixelsStorefrontCustomerTracking",r),{credentials:!1})}catch(t){}}constructSource(e){return`wpm-${e}`}}const nh="__shopify_agent_context_events";class oh{persist(e){const t=Mr(()=>sessionStorage.getItem(nh),null),r=Mr(()=>t?JSON.parse(t):[],[]),n=Array.isArray(r)?r:[];n.length>=50&&n.shift(),n.push(e),Mr(()=>sessionStorage.setItem(nh,JSON.stringify(n)))}}const ih=new Set(["page_viewed","product_viewed","collection_viewed","product_added_to_cart","search_submitted"]);var sh=tn("client"),ah=tn("extractDetail");class ch{constructor({client:e}){Object.defineProperty(this,ah,{value:uh}),Object.defineProperty(this,sh,{writable:!0,value:void 0}),Zr(this,sh)[sh]=e}register(e){e("log:event-bus:publish",({payload:{event:e}})=>{if(!(e=>ih.has(e.name))(e))return;const t=Zr(this,ah)[ah](e);t&&Zr(this,sh)[sh].persist(t)})}}function uh(e){const t=e.context.document.location.href,r=new Date(e.timestamp).valueOf();switch(e.name){case"page_viewed":return{type:"page_viewed",url:t,referrer:e.context.document.referrer,timestamp:r};case"product_viewed":{const{productVariant:n}=e.data;return{type:"product_viewed",title:n.product?.title||"",productId:n.product?.id||"",price:n.price?.amount||0,currency:n.price?.currencyCode||"",url:t,timestamp:r}}case"collection_viewed":{const{collection:n}=e.data;return{type:"collection_viewed",title:n?.title||"",currency:n?.productVariants?.find(e=>e?.price?.currencyCode)?.price?.currencyCode||"",url:t,timestamp:r}}case"product_added_to_cart":{const{cartLine:n}=e.data,{merchandise:o}=n||{};return{type:"product_added_to_cart",productTitle:o?.product?.title||"",variantTitle:o?.title||"",price:o?.price?.amount||0,currency:o?.price?.currencyCode||"",quantity:n?.quantity||0,sku:o?.sku||"",url:t,timestamp:r}}case"search_submitted":{const{searchResult:n}=e.data;return{type:"search_submitted",query:n?.query||"",url:t,timestamp:r}}default:return null}}const dh=new WeakMap;function lh(t){const r=dh.get(t);if(r)return r;const n=e();return dh.set(t,n),n}function ph(e){if(null==e)return{};switch(typeof e){case"string":return{string:e};case"boolean":return{boolean:e};case"bigint":return{int:e.toString()};case"number":return function(e){return Number.isInteger(e)?{int:e.toString()}:Number.isNaN(e)?{double:"NaN"}:e===1/0?{double:"Infinity"}:e===-1/0?{double:"-Infinity"}:{double:e}}(e);case"object":return function(e){try{return{string:JSON.stringify(e)}}catch{return{}}}(e);default:return{string:String(e)}}}function hh(e,t){return Array.isArray(t)?{key:e,array:{value:t.map(e=>ph(e))}}:null==t?{key:e}:{key:e,value:ph(t)}}function fh(e,{eventId:t,monorailMetadata:r}){return[hh("advertiser_shop_id",e.advertiserShopId),hh("ad_response_id",e.adResponseId),hh("position",e.position),hh("above_fold",e.aboveFold),hh("viewport_width",e.viewportWidth),hh("viewport_height",e.viewportHeight),hh("x_pos",e.xPos),hh("y_pos",e.yPos),hh("session_id",e.sessionId),hh("publisher_shop_id",e.publisherShopId),hh("placement",e.placement),hh("event_data",e.eventData),hh("theme_id",e.themeId),hh("theme_store_id",e.themeStoreId),hh("theme_published",e.themePublished),hh("original_event_id",t),hh("original_schema_id",e.originalSchemaId),hh("monorail_metadata",r),hh("client_surface","web-pixels-manager")]}function mh(e){return"string"==typeof e?e:void 0}function vh(e){if(!e&&0!==e)return;const t=Number(e);return Number.isNaN(t)?void 0:t}function gh(e){return"number"==typeof e&&Number.isFinite(e)}function yh(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}function bh(e){return yh(e)?e:void 0}function wh(e,t){if(!Array.isArray(e)||0===e.length)return;const r=e.filter(t);return r.length===e.length?r:void 0}function _h(e){return Array.isArray(e)?e.filter(yh):[]}function Ih(e){const t=e.toLowerCase();if(t.startsWith("monorail://")&&t.length>11)return t.slice(11)}const xh=new Map([["trekkie_storefront_remote_ad_rendered","BUYER_EVENT_TYPE_AD_RENDERED"],["trekkie_storefront_remote_ad_impression","BUYER_EVENT_TYPE_AD_IMPRESSION"],["trekkie_storefront_remote_ad_click","BUYER_EVENT_TYPE_AD_CLICKED"]]);function Eh({method:e,args:[t,r]}){if("track"!==e)return;const n=mh(t);if(!n)return;const o=Ih(n);if(!o)return;const i=function(e){const[t]=e.split("/");if(t)return xh.get(t)}(o);return i?{schemaId:o,buyerAdEventName:i,properties:bh(r)??{}}:void 0}function kh(e){return"string"==typeof e?e:gh(e)?String(e):void 0}function Sh(e,t,r){return kh(e[t])||kh(e[r])}function Th(e,t,r){return vh(e[t])??vh(e[r])}function Ch(e,t,r){const n=e[t];if("boolean"==typeof n)return n;const o=e[r];return"boolean"==typeof o?o:void 0}function Ah(e,t,r){return e[t]??e[r]}function Ph(e,t){return{shopId:Th(e,"shopId","shop_id"),publisherShopId:Th(e,"publisherShopId","publisher_shop_id"),eventId:Sh(e,"eventId","event_id"),originalSchemaId:t,advertiserShopId:Th(e,"advertiserShopId","advertiser_shop_id"),adResponseId:Sh(e,"adResponseId","ad_response_id"),position:Th(e,"position","position"),aboveFold:Ch(e,"aboveFold","above_fold"),viewportWidth:Th(e,"viewportWidth","viewport_width"),viewportHeight:Th(e,"viewportHeight","viewport_height"),xPos:Th(e,"xPos","x_pos"),yPos:Th(e,"yPos","y_pos"),sessionId:Sh(e,"sessionId","session_id"),placement:Sh(e,"placement","placement"),eventData:Ah(e,"eventData","event_data"),themeId:Th(e,"themeId","theme_id"),themeStoreId:Th(e,"themeStoreId","theme_store_id"),themePublished:Ch(e,"themePublished","theme_published"),monorailMetadata:Ah(e,"s2sMetadata","s2s_metadata")}}function Oh(e){return kh(e.eventId)}function Rh(e,t){return e.shopId??e.publisherShopId??t}var Nh=tn("collector"),jh=tn("options"),Mh=tn("produce");class Uh{constructor(e,t){Object.defineProperty(this,Mh,{value:Dh}),Object.defineProperty(this,Nh,{writable:!0,value:void 0}),Object.defineProperty(this,jh,{writable:!0,value:void 0}),Zr(this,Nh)[Nh]=e,Zr(this,jh)[jh]=t}register(e){e("log:trekkie:track",e=>{const t=Eh(e.payload);t&&Zr(this,Mh)[Mh](t,{clientMessageId:e.id,generatedEventId:lh(e.payload)})})}}function Dh({buyerAdEventName:e,schemaId:t,properties:r},{clientMessageId:n,generatedEventId:o}){const{apiClientId:i,consent:s,navigationApi:a,navigationType:c,shopId:u}=Zr(this,jh)[jh],d=function(e){return gr(e)?e:void 0}(u);if(void 0===d)return void Zr(this,jh)[jh].onValidationError?.({eventName:e,reason:"invalid-shop-id"});const l=Ph(r,t),p=function(e){return e??580111}(i);Zr(this,Nh)[Nh].produce(function({eventName:e,consent:t,shopId:r,apiClientId:n,shopifyY:o}){return{"@type":"type.googleapis.com/shopify.event.BuyerEvent",actor:"ACTOR_BUYER",eventProducer:"EVENT_PRODUCER_RAW_SOURCE",eventType:e,shopId:ts(r),apiClient:{id:ts(n)},buyerConsents:ps(t),buyer:{userIdentities:[{shopifyYCookie:{shopifyY:o}}]}}}({eventName:e,consent:{analyticsProcessingAllowed:s.analyticsProcessingAllowed(),marketingAllowed:s.marketingAllowed(),preferencesProcessingAllowed:s.preferencesProcessingAllowed(),saleOfDataAllowed:s.saleOfDataAllowed()},shopId:d,apiClientId:p,shopifyY:s.trackingTokens.getUniqueToken()}),{apiClientId:p,tags:fh(l,{eventId:Oh(r)??o,monorailMetadata:l.monorailMetadata??{navigationType:c,navigationApi:a}}),clientMessageId:n,clientMessageCreatedAt:(new Date).toISOString(),canonicalContext:{page:!0}}),Zr(this,jh)[jh].onEmission?.({eventName:e})}var $h=tn("monorailClient"),Lh=tn("options"),qh=tn("produce");class Vh{constructor(e,t){Object.defineProperty(this,qh,{value:Bh}),Object.defineProperty(this,$h,{writable:!0,value:void 0}),Object.defineProperty(this,Lh,{writable:!0,value:void 0}),Zr(this,$h)[$h]=e,Zr(this,Lh)[Lh]=t}register(e){e("log:trekkie:track",e=>{const t=Eh(e.payload);t&&Zr(this,qh)[qh](t,lh(e.payload))})}}function Bh({buyerAdEventName:e,schemaId:t,properties:r},n){const{consent:o}=Zr(this,Lh)[Lh],i=o.analyticsProcessingAllowed(),s=o.marketingAllowed(),a=!(s&&i),c=Ph(r,t);Zr(this,$h)[$h].produce("storefront_customer_tracking_parity/1.0",{shopId:Rh(c,Zr(this,Lh)[Lh].shopId),eventId:c.eventId||n,eventName:e,eventTime:(new Date).getTime(),eventSourceUrl:Zr(this,Lh)[Lh].pageUrl||self.location?.href||"",uniqueToken:o.trackingTokens.getUniqueToken()||T,source:`wpm-${Zr(this,Lh)[Lh].surface}`,shopifyEmitted:!0,assetVersionId:Dn,ccpaEnforced:!o.saleOfDataAllowed(),gdprEnforced:a,gdprEnforcedAsString:String(a),isPersistentCookie:"persistent"===(Wt("_shopify_m")??"persistent"),analyticsAllowed:i,marketingAllowed:s,preferencesAllowed:o.preferencesProcessingAllowed(),saleOfDataAllowed:o.saleOfDataAllowed(),deprecatedVisitToken:o.trackingTokens.getVisitToken(),sessionId:Zr(this,Lh)[Lh].sessionId,pageId:Zr(this,Lh)[Lh].pageId,userAgent:self.navigator?.userAgent,apiClientId:Zr(this,Lh)[Lh].apiClientId,isMerchantRequest:Zr(this,Lh)[Lh].isMerchantRequest,navigationType:Zr(this,Lh)[Lh].navigationType,navigationApi:Zr(this,Lh)[Lh].navigationApi}),Zr(this,Lh)[Lh].onProduce?.(e)}var Hh=tn("monorailClient"),Fh=tn("options");class zh{constructor(e,t){Object.defineProperty(this,Hh,{writable:!0,value:void 0}),Object.defineProperty(this,Fh,{writable:!0,value:void 0}),Zr(this,Hh)[Hh]=e,Zr(this,Fh)[Fh]=t}register(e){e("log:event-bus:publish:blocked",({payload:e})=>{const{pixel:t,event:r}=e;t.type===ge.App&&Zr(this,Hh)[Hh].produce("web_pixels_manager_subscriber_event_blocked/1.1",{eventId:r.id,apiClientId:t.apiClientId?.toString(),shopId:Zr(this,Fh)[Fh].shopId,pixelId:t.id,pixelSource:t.type,surface:Zr(this,Fh)[Fh].surface,eventName:r.name,eventType:de(r.name),dataSharingState:t.dataSharingState??"unknown",bundleTarget:Un,pageUrl:Zr(this,Fh)[Fh].pageUrl},{credentials:!1})})}}var Wh=tn("client");class Kh{constructor(e){Object.defineProperty(this,Wh,{writable:!0,value:void 0}),Zr(this,Wh)[Wh]=e}register(e){e("log:event-bus:publish:blocked",({payload:{pixel:e,event:t}})=>{Zr(this,Wh)[Wh].record("feature_usage",1,{feature:"pixel_event_blocked",pixel_type:e.type,event_type:de(t.name),data_sharing_state:e.dataSharingState??"unknown"})})}}const Yh="storefront_customer_tracking_parity/1.2",Jh="storefront_customer_tracking/5.11",Xh=[[/^[ _]?checkout[ _]?one[ _]?page[ _]?view[ _]?$/i,"page_rendered"],[/^[ _]?viewed[ _]?product[ _]?$/i,"product_page_rendered"],[/^[ _]?viewed[ _]?product[ _]?category[ _]?$/i,"collection_page_rendered"],[/^[ _]?added[ _]?product[ _]?$/i,"product_added_to_cart"],[/^[ _]?completed[ _]?order[ _]?$/i,"checkout_completed"],[/^[ _]?started[ _]?order[ _]?remote[ _]?$/i,"remote_checkout_started"],[/^[ _]?started[ _]?order[ _]?$/i,"checkout_started"],[/^[ _]?performed[ _]?search[ _]?$/i,"search_submitted"],[/^[ _]?added[ _]?payment[ _]?remote[ _]?$/i,"remote_payment_info_submitted"],[/^[ _]?added[ _]?payment[ _]?$/i,"payment_info_submitted"],[/^[ _]?checkout[ _]?[ _]?contact[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,"remote_checkout_contact_info_submitted"],[/^[ _]?checkout[ _]?[ _]?contact[ _]?info[ _]?submitted[ _]?$/i,"checkout_contact_info_submitted"],[/^[ _]?checkout[ _]?[ _]?address[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,"remote_checkout_address_info_submitted"],[/^[ _]?checkout[ _]?[ _]?address[ _]?info[ _]?submitted[ _]?$/i,"checkout_address_info_submitted"],[/^[ _]?checkout[ _]?[ _]?shipping[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,"remote_checkout_shipping_info_submitted"],[/^[ _]?checkout[ _]?[ _]?shipping[ _]?info[ _]?submitted[ _]?$/i,"checkout_shipping_info_submitted"]],Gh="custom_storefront_customer_tracking/1.6",Qh=new Set([6167201,12875497473]),Zh=new Set(["page_rendered","payment_info_submitted","checkout_contact_info_submitted","checkout_address_info_submitted","checkout_shipping_info_submitted","checkout_started","checkout_completed"]);let ef=function(e){return e.Block="block",e.Filter="filter",e.Allow="allow",e}({});function tf(e){const t=self.ShopifyAnalytics?.meta;if(!t?.remoteProductsEnabled)return ef.Allow;if(!e){const e=t.product;return e?void 0===e.id?ef.Block:!0===e.remote?ef.Filter:ef.Allow:ef.Allow}return void 0===e.productId?ef.Block:function(e,t){return"boolean"==typeof e.remote?e.remote:!!e.variantId&&Boolean(function(e,t){return e.products?function(e,t){for(const r of t)if(r.variants)for(const t of r.variants)if(String(t.id)===e)return r}(t,e.products):e.product?.variants&&e.product.variants.some(e=>String(e.id)===t)?e.product:void 0}(t,e.variantId)?.remote)}(e,t)?ef.Filter:ef.Allow}const rf={page_rendered:"page_viewed",remote_page_rendered:"page_viewed",product_page_rendered:"product_viewed",remote_product_page_rendered:"product_viewed",product_added_to_cart:"product_added_to_cart",remote_product_added_to_cart:"product_added_to_cart",checkout_started:"checkout_started",remote_checkout_started:"checkout_started",checkout_completed:"checkout_completed",search_submitted:"search_submitted",payment_info_submitted:"payment_info_submitted",remote_payment_info_submitted:"payment_info_submitted",collection_page_rendered:"collection_viewed",checkout_contact_info_submitted:"checkout_contact_info_submitted",remote_checkout_contact_info_submitted:"checkout_contact_info_submitted",checkout_address_info_submitted:"checkout_address_info_submitted",remote_checkout_address_info_submitted:"checkout_address_info_submitted",checkout_shipping_info_submitted:"checkout_shipping_info_submitted",remote_checkout_shipping_info_submitted:"checkout_shipping_info_submitted"};function nf(){return self.Shopify?.evids}function of(e){if(e.productId&&e.variantId)return`${e.productId}-${e.variantId}`}const sf=/^https?:\/\//,af=qt(function(){const e=self.document?.getElementsByTagName("link");if(e)for(const t of Array.from(e)){if("canonical"!==t.getAttribute("rel"))continue;const e=t.getAttribute("href");if(e&&sf.test(e)&&!(e.replace(sf,"").length<=5))return e}},{cache:$t(1),cacheKey:()=>self.location?.href??""});function cf(e){return"string"==typeof e&&e||"USD"}function uf(e){return e.map(e=>JSON.stringify({variant_id:vh(e.variantId)??null,product_id:vh(e.productId)??null,product_gid:e.productGid,handle:mh(e.productHandle),name:e.name,price:vh(e.price)??0,sku:e.sku,brand:e.brand,variant:e.variant,category:e.category,available:"boolean"==typeof e.available?e.available:void 0,quantity:vh(e.quantity||0)??null}))}function df(e){return{totalValue:vh(e.price)??0,currency:cf(e.currency)}}function lf(e){return{totalValue:vh(e.total)??0,subtotalValue:vh(e.subtotalAfterMerchandiseDiscounts)??0,currency:cf(e.currency)}}function pf(e){return vh(e.subtotalAfterMerchandiseDiscounts)??0}function hf(e){return{billingAddressCity:mh(e?.city),billingAddressCountry:mh(e?.country),billingAddressRegion:mh(e?.province)}}function ff(e,t){const r=mh(e);return{referrer:t?.referrer??self.document?.referrer,canonicalUrl:af()??"",pageType:"searchresults"===r?"search":r}}const mf={page_rendered:"z",product_page_rendered:"x",collection_page_rendered:"c",search_submitted:"b"};function vf(t,r){try{if(!mf[t]||"storefront-renderer"!==r)return;const n=ci()?.serverTiming?.find(e=>"requestID"===e.name)?.description;if(!n)return;return function(e,t){try{const r=gf(e,t);return r?window.sessionStorage.getItem(r):null}catch{return null}}(n,t)?e().toUpperCase():(function(e,t){try{const r=gf(e,t);if(!r)return;window.sessionStorage.setItem(r,(new Date).getTime().toString())}catch{}}(n,t),n)}catch{return}}function gf(e,t){const r=mf[t];if(r)return`wpm-ri-${e}-${r}`}function yf(e){return"string"==typeof e?e:gh(e)?String(e):void 0}function bf(e){const t=bh(e);if(t)return{url:mh(t.url),referrer:mh(t.referrer)}}function wf(e){return{productId:yf(e.productId),variantId:yf(e.variantId),remote:"boolean"==typeof e.remote?e.remote:void 0}}function _f(e,t,r){return e===ef.Block?null:e===ef.Filter?r:t}var If=tn("monorailClient"),xf=tn("configuration"),Ef=tn("resolveTrackFlags"),kf=tn("resolveEventName"),Sf=tn("produce");class Tf{constructor(e,t){Object.defineProperty(this,Sf,{value:Pf}),Object.defineProperty(this,kf,{value:Af}),Object.defineProperty(this,Ef,{value:Cf}),Object.defineProperty(this,If,{writable:!0,value:void 0}),Object.defineProperty(this,xf,{writable:!0,value:void 0}),Zr(this,If)[If]=e,Zr(this,xf)[xf]=t}register(e){e("log:trekkie:track",({replayed:e,payload:{method:t,pageContext:r,args:[n,o,i,s,a]}})=>{const c=bh(o)??{},u=bh(a)??{},d=Zr(this,kf)[kf](t,n,c);if(!d)return;if("checkout_completed"===d&&!s)return;const l=Zr(this,Ef)[Ef](t,c,u);Zr(this,Sf)[Sf](d,c,{injectedEventId:mh(i),trackFlags:l,emittedAsync:!0===e,pageContext:bf(r),shadow:!1})}),e("log:trekkie:shadow-add-to-cart",({replayed:e,payload:{properties:t,addApiSource:r,pageContext:n}})=>{const o=bh(t)??{},i=Zr(this,kf)[kf]("track","Added Product",o);i&&Zr(this,Sf)[Sf](i,o,{injectedEventId:void 0,trackFlags:{addToCartApiSource:r,shopifyEmitted:!0},emittedAsync:!0===e,pageContext:bf(n),shadow:!0})})}}function Cf(e,t,r){return"page"===e?"shopifyEmitted"in t?{shopifyEmitted:Boolean(t.shopifyEmitted)}:{}:{addToCartApiSource:mh(r.addApiSource),shopifyEmitted:"boolean"==typeof r.shopifyEmitted?r.shopifyEmitted:void 0}}function Af(e,t,r){let n;if("page"===e)n="page_rendered";else{const e=mh(t);if(!e)return null;n=function(e){for(const[t,r]of Xh)if(t.test(e))return r}(e)}if(!n)return null;switch(n){case"page_rendered":return _f(tf(),n,"remote_page_rendered");case"product_page_rendered":return _f(tf(wf(r)),n,"remote_product_page_rendered");case"product_added_to_cart":return _f(tf(wf(r)),n,"remote_product_added_to_cart");default:return n}}function Pf(t,r,{injectedEventId:n,trackFlags:o,emittedAsync:i,pageContext:s,shadow:a}){const c=(u=t,void 0!==(d=Zr(this,xf)[xf].apiClientId)&&Qh.has(d)&&Zh.has(u));var u,d;if(c&&!bt("7b21cf0b")&&!bt(xt))return;const l=a?function(t){const r=nf()?.("product_added_to_cart",{analyticsFramework:"trekkie-next",cacheKey:of(t)});return r||e()}(r):function(t,r,n){const o=function(e,t,r){const n=rf[e];if(!n)return;if("checkout_completed"===n&&r)return r;const o=nf();return o?o(n,"product_added_to_cart"===n?{analyticsFramework:"trekkie-parity",cacheKey:of(t)}:{analyticsFramework:"trekkie-parity"}):void 0}(t,r,n);return o||e()}(t,r,n),p=function(e,t,r){switch(e){case"page_rendered":case"remote_page_rendered":return ff(t.pageType,r);case"product_page_rendered":case"remote_product_page_rendered":return{...ff("product",r),...df(t),products:uf([{...t,quantity:1}])};case"product_added_to_cart":case"remote_product_added_to_cart":return{...df(t),products:uf([t]),cartToken:mh(t.cartToken)};case"payment_info_submitted":case"remote_payment_info_submitted":case"checkout_shipping_info_submitted":case"remote_checkout_shipping_info_submitted":return lf(t);case"search_submitted":return{...ff("search",r),searchString:mh(t.query)??""};case"checkout_started":case"remote_checkout_started":return{...lf(t),products:uf(_h(t.products))};case"checkout_completed":{const e=bh(t.customerEventData),r=bh(e?.customer),n=bh(e?.address),o={...lf(t),...hf(n),products:uf(_h(t.products)),firstName:mh(r?.firstName),lastName:mh(r?.lastName),email:mh(r?.emailAddress),phone:mh(r?.phoneNumber),billingAddressZipcode:mh(n?.zip)};return t.orderId&&(o.orderId=String(t.orderId)),o}case"collection_page_rendered":return{...ff("collection",r),collectionId:vh(t.collectionId),collectionName:mh(t.collectionName),currency:cf(t.currency)};case"checkout_contact_info_submitted":case"remote_checkout_contact_info_submitted":return{email:mh(t.email),phone:mh(t.phone),subtotalValue:pf(t)};case"checkout_address_info_submitted":case"remote_checkout_address_info_submitted":return{...hf(t),phone:mh(t.phone),subtotalValue:pf(t)};default:return e}}(t,r,s),h=wh(r.rolloutIds,gh)??Zr(this,xf)[xf].rolloutIds,f=wh(r.rolloutTreatmentIds,gh)??Zr(this,xf)[xf].rolloutTreatmentIds,m=Wt("shop_analytics"),v=Zr(this,xf)[xf].eventMetadataId??mh(bh(window.ShopifyAnalytics?.lib?.trekkie?.defaultAttributes)?.eventMetadataId),{consent:g}=Zr(this,xf)[xf],y=!(g.marketingAllowed()&&g.analyticsProcessingAllowed()),b={eventId:l,eventTime:(new Date).getTime(),eventSourceUrl:s?.url||self.location?.href||"",uniqueToken:g.trackingTokens.getUniqueToken()||T,userAgent:self.navigator?.userAgent,eventName:t,eventMetadataId:v,shopId:Zr(this,xf)[xf].shopId,source:a?"wpm-shop-events-listener":(w=Zr(this,xf)[xf].surface,bc.includes(w)?`wpm-${ve.CheckoutOneShopApp}`:w===ve.CheckoutKit?`wpm-${ve.CheckoutOne}`:`wpm-${w}`),facebookCapiEnabled:Zr(this,xf)[xf].firstPartyTracking.facebookCapiEnabled,assetVersionId:Dn,analyticsAllowed:g.analyticsProcessingAllowed(),marketingAllowed:g.marketingAllowed(),preferencesAllowed:g.preferencesProcessingAllowed(),saleOfDataAllowed:g.saleOfDataAllowed(),deprecatedVisitToken:g.trackingTokens.getVisitToken()||T,sessionId:Zr(this,xf)[xf].sessionId,pageId:Zr(this,xf)[xf].pageId,apiClientId:Zr(this,xf)[xf].apiClientId??580111,...Zr(this,xf)[xf].checkoutToken&&{checkoutToken:Zr(this,xf)[xf].checkoutToken},customerId:Zr(this,xf)[xf].customerId,...m&&{shopAnalyticsToken:m},addToCartApiSource:o.addToCartApiSource,shopifyEmitted:o.shopifyEmitted,requestId:vf(t,Zr(this,xf)[xf].surface),...h&&{rolloutIds:h},...f&&{rolloutTreatmentIds:f},navigationType:Zr(this,xf)[xf].navigationType,navigationApi:Zr(this,xf)[xf].navigationApi,...Zr(this,xf)[xf].isMerchantRequest&&{isMerchantRequest:!0},...i&&{emittedAsync:!0},...p};var w;const _={ccpaEnforced:!g.saleOfDataAllowed(),gdprEnforced:y,gdprEnforcedAsString:String(y),isPersistentCookie:"persistent"===(Wt("_shopify_m")??"persistent")};let I;if(a)I=Yh,Zr(this,If)[If].produce(I,{...b,..._,emittedToV5:!1});else if(c)I=Gh,Zr(this,If)[If].produce(I,{...b,..._,hydrogenSubchannelId:""},{preserveEventCase:["hydrogenSubchannelId"]});else if(bt("4c64608a")){const{browserContext:e}=Zr(this,xf)[xf];I=Jh,Zr(this,If)[If].produce(I,{...b,tiCv:Ln,...e&&{attributes:()=>{const t=e.getAttributes();return t&&JSON.stringify(t)},attributesVersion:2}})}else I=Yh,Zr(this,If)[If].produce(I,{...b,..._,emittedToV5:!0});Zr(this,xf)[xf].onProduce?.(t,I,{shadow:a})}var Of=tn("monorailClient"),Rf=tn("configuration");class Nf{constructor(e,t){Object.defineProperty(this,Of,{writable:!0,value:void 0}),Object.defineProperty(this,Rf,{writable:!0,value:void 0}),Zr(this,Of)[Of]=e,Zr(this,Rf)[Rf]=t}register(e){e("log:trekkie:track",({payload:e,payload:{method:t,args:[r,n,,o],microSessionCount:i}})=>{if("track"!==t)return;const s=mh(r);if(!s)return;const a=Ih(s);if(!a)return;if(Zr(this,Rf)[Rf].onEventReceived?.(a),!bt(xt))return;const{navigationType:c,navigationApi:u,consent:d,pageId:l}=Zr(this,Rf)[Rf],p=bh(window.ShopifyAnalytics?.lib?.trekkie?.defaultAttributes),h={event:s,eventId:lh(e),s2sMetadata:{navigationType:c,navigationApi:u},..."boolean"==typeof o&&{emitConversionEvent:o},...bh(n),...p&&{...p,uniqToken:d.trackingTokens.getUniqueToken()||T,visitToken:d.trackingTokens.getVisitToken()||T,microSessionId:l,..."number"==typeof i&&{microSessionCount:i},isPersistentCookie:tr()},eventType:"track"};Zr(this,Of)[Of].produce(a,h,{convertEventCase:!1})})}}var jf=tn("client"),Mf=tn("options");class Uf{constructor(e,t){Object.defineProperty(this,jf,{writable:!0,value:void 0}),Object.defineProperty(this,Mf,{writable:!0,value:void 0}),Zr(this,jf)[jf]=e,Zr(this,Mf)[Mf]=t}register(e){e("log:trekkie:track",({payload:{method:e,args:t}})=>{if("track"!==e&&"page"!==e)return;const r="page"===e?"Page Viewed":t[0];if("string"!=typeof r)return;const{consent:n}=Zr(this,Mf)[Mf];Zr(this,jf)[jf].record("feature_usage",1,{feature:"event_emission",event_name:r,user_can_be_tracked:n.analyticsProcessingAllowed()||n.marketingAllowed()})})}}const Df={[Yh]:"storefront_customer_tracking_parity",[Jh]:"storefront_customer_tracking_v5",[Gh]:"custom_storefront_customer_tracking"};function $f(e){return{requestId:Lf(e.requestId,128),navigationType:(t=e.navigationType,"unknown"===t||"error"===t?void 0:Lf(t,64)),trekkieState:qf()};var t}function Lf(e,t){return"string"==typeof e&&e.length>0&&e.length<=t?e:void 0}function qf(){try{const e=self.ShopifyAnalytics?.lib?.trekkie;if(Yt(e))return"shim";const t=e?.state;return"awaiting-consent"===t||"initialized"===t?t:void 0}catch(e){return}}let Vf;const Bf={credentials:!0};function Hf(e,t){const r=new Set(t);return new Set(e).size===r.size&&(e?.every(e=>r.has(e))??!0)}const Ff=Object.values(we),zf=e=>{const t=e.trim().toLowerCase();return r=t,Ff.includes(r)?t:we.NotAvailable;var r},Wf=e=>{if(!e)return-1;const t=e.trim();if(!/^\d+$/.test(t))return-1;const r=window.parseInt(t,10);return window.isNaN(r)||r<=0?-1:r};function Kf(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(t){return[]}}const Yf=e=>{if(e)try{const t=JSON.parse(e);if(!Array.isArray(t))return;const r=t.filter(e=>"number"==typeof e);if(0===r.length||r.length!==t.length)return;return r}catch{return}};function Jf(e,t){const r={rolloutIds:Yf(t?.rolloutIds),rolloutTreatmentIds:Yf(t?.rolloutTreatmentIds)};if(!e.includes(Et))return r;const n=function(){try{const e=document.querySelector('script#shopify-rollouts[type="application/json"]');if(!e)return;const t=JSON.parse(e.textContent||"");if(!yh(t))return;const{rolloutIds:r,rolloutTreatmentIds:n}=t;if(!(Array.isArray(r)&&r.every(gh)&&Array.isArray(n)&&n.every(gh)))return;return{rolloutIds:r,rolloutTreatmentIds:n}}catch{return}}();return{...n??r,rolloutSources:{inline:void 0!==t?.rolloutIds||void 0!==t?.rolloutTreatmentIds?r:void 0,tag:n}}}function Xf(){try{const e=window.performance,t="function"==typeof e?.getEntriesByType?ci():void 0;if(t?.type)return{navigationType:t.type,navigationApi:"PerformanceNavigationTiming"};const r=e?.navigation;if(void 0!==r)return{navigationType:{0:"navigate",1:"reload",2:"back_forward"}[r.type]??"unknown",navigationApi:"performance.navigation"}}catch(e){return{navigationType:"error",navigationApi:"error"}}return{navigationType:"unknown",navigationApi:"unknown"}}function Gf(e){if(e)return e;try{return ci()?.serverTiming?.find(({name:e})=>"requestID"===e)?.description||void 0}catch{return}}const Qf=qt(()=>{try{const e=window.Shopify?.evids;return e?e("session_started",{analyticsFramework:"wpm"}):hr()}catch{return hr()}}),Zf=()=>{const e=(()=>{try{return document.currentScript?.dataset}catch{return null}})(),t=(e=>{const t=e.trim().toLowerCase();return r=t,gc.includes(r)?t:window.Shopify?.Checkout?ve.Shopify:window.Shopify?.analytics?.replayQueue?ve.StorefrontRenderer:window.CardFields?ve.CheckoutOne:ve.Unknown;var r})(e?.surface??""),r=(e=>{if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}})(e?.enabledBetaFlags);return{browserTarget:zf(e?.browserTarget??""),surface:t,enabledBetaFlags:r,isMerchantRequest:"true"===e?.isMerchantRequest,firstPartyTracking:{facebookCapiEnabled:"true"===e?.facebookCapiEnabled},hashVersion:e?.hashVersion??"",shopId:Wf(e?.shopId),apiClientId:Number(e?.apiClientId)||void 0,pageId:e?.pageId??hr(),sessionId:Qf(),pageType:e?.pageType,resourceId:e?.resourceId,requestId:Gf(e?.requestId),...Xf(),themeId:Number(e?.themeId)||void 0,themeStoreId:Number(e?.themeStoreId)||void 0,themePublished:void 0===e?.themePublished?void 0:"true"===e.themePublished,storefrontBaseUrl:(window.location.origin||e?.storefrontBaseUrl)??"",monorailEndpoint:e?.monorailEndpoint||"",frontendEventCollectorEndpoint:e?.frontendEventCollectorEndpoint||"",extensionBaseUrl:e?.extensionBaseUrl??"",shopDomain:e?.shopDomain??window.Shopify?.shop??"",checkoutToken:e?.checkoutToken||void 0,customerId:Number(e?.customerId)||void 0,...Jf(r,e),eventMetadataId:e?.eventMetadataId||void 0,events:Kf(e?.events),features:{domEvents:"false"!==e?.domEvents&&yc.includes(t),advancedDomEvents:"false"!==e?.advancedDomEvents,storefrontEvents:"false"!==e?.storefrontEvents&&yc.includes(t),cartPermalink:"false"!==e?.cartPermalink&&[...yc,...wc,ve.Shopify].includes(t),trekkieShim:"true"===e?.trekkieShim,agentContext:"true"===e?.agentContext,pixelHelper:"true"===e?.pixelHelper},scope:{publish:e?.publish===xc.All?xc.All:xc.Custom}}};try{!function(){if(X()){const e=function(){if(d())return!0;if(!m())return!0;const e=ie(),t=se();return!(!oe()||!e)||!(!e||!t)&&e===t}();re().increment("consent_tracking_api_attestation",{result:e},.01),Math.random()<.01&&(new ne).produce("attestation",JSON.stringify({result:e,cookieID:ie(),metaID:se(),prefetched:oe(),isSFR:m(),domain:window.Shopify?.shop,shopId:ae()}))}}()}catch{}try{window.Shopify=window.Shopify||{},!window.Shopify.evids&&(a={},c={[n]:{},[o]:{},[i]:{},[s]:{}},window.Shopify.evids=(...e)=>function(e,r){if(!function(e){return t.includes(e)}(e)||(null==r?void 0:r.analyticsFramework)!==o&&"wpm"!==(null==r?void 0:r.analyticsFramework)&&(null==r?void 0:r.analyticsFramework)!==i&&(null==r?void 0:r.analyticsFramework)!==s)return u("shu");const n=function(e){return"string"==typeof e&&e?e:"default"}(r.cacheKey),d=function(e,t,r){const n=c[t],o=n[e]??(n[e]={}),i=o[r];return o[r]="number"==typeof i?i+1:0}(e,r.analyticsFramework,n);return function(e,t,r){const n=a[e]??(a[e]={}),o=n[r]??[];let i=o[t];return i||(i=u(),o.push(i)),n[r]=o,i}(e,d,n)}(...e)),function({configuration:e,eventHub:t}){const r=window.location.href,n=Mr(()=>document?.referrer)??"";uo.metadata=Ts(e,["shopId","surface","browserTarget","shopDomain"]);try{(({storefrontBaseUrl:e})=>{if(!e)throw new so("storefrontBaseUrl is required.");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)}}(e))throw new so(`storefrontBaseUrl is not a valid absolute URL: "${e}"`)})(e),function(e=[]){(Array.isArray(e)?e:[e]).forEach(e=>yt.add(e))}(e.enabledBetaFlags);const o=function(e,t){return e.createClient({metrics:Xo,prefix:"web_pixels_manager",defaultAttributes:{surface:t.surface}})}(new Ko({throttleDelay:1e3,client:new Po({exporter:"https://otlp-http-production.shopifysvc.com"?new Uo("https://otlp-http-production.shopifysvc.com","web-pixels-manager"):new Jo("WPM OTel")})}),e);if(bt(Et)){const t=e.rolloutSources;let r;t?.tag?!t.inline||Hf(t.tag.rolloutIds,t.inline.rolloutIds)&&Hf(t.tag.rolloutTreatmentIds,t.inline.rolloutTreatmentIds)||(r="rollouts_tag_mismatch"):r="rollouts_tag_unusable";const n=Yn({rate:.1});r&&n.includes("rollout_diagnostic")&&o.record("feature_usage",10,{feature:"rollout_diagnostic",diagnostic:r})}!function(){if(!vo)try{document.addEventListener(g,fo),vo=!0}catch(e){uo.notify(e,{context:"onConsentCollected/createOnConsentCollectedListener",unhandled:!1})}}();const i=new Ji({endpoint:Qi({storefrontBaseUrl:e.storefrontBaseUrl,endpoint:e.monorailEndpoint}),onError:e=>{uo.notify(e,{context:"utilities/monorail/sendRequest",unhandled:!1,type:"metric"})}});fi=i;const s=new Set,a=new Ps({onError:e=>{const t=e instanceof Error?`${e.name}:${e.message}`:String(e);s.has(t)||(s.add(t),uo.notify(e,{context:"foundation/consent/trackingTokens",severity:"warning",unhandled:!1}))}}),c=new ri,u=()=>a.analyticsProcessingAllowed()||a.marketingAllowed(),d=()=>{u()&&c.prefetch()};d(),ho(d);const l={getAttributes:()=>u()?c.getAttributes():void 0},p=new ws({storefrontBaseUrl:e.storefrontBaseUrl,frontendEventCollectorEndpoint:e.frontendEventCollectorEndpoint,onError:e=>{uo.notify(e,{context:"foundation/frontend-event-collector/send",unhandled:!1,type:"metric"})},shopId:e.shopId,apiClientId:e.apiClientId,customerId:e.customerId,pageUrl:r,pageReferrer:n,pageId:e.pageId,httpRequestId:e.requestId,surface:e.surface,consent:a}),h=t??((e,{monorailClient:t,collectorClient:r,featureUsageClient:n,onError:o,pageUrl:i,consent:s,browserContext:a})=>{const c=new Hu(s,mo),u=new Uu(s),d=new Uu(s,()=>s.analyticsProcessingAllowed()&&s.marketingAllowed()),l=new Uu(s,()=>s.analyticsProcessingAllowed()),p=i??"",h=({eventName:e})=>{n.record("feature_usage",1,{feature:"collector_emission",event_name:e,status:"emitted"})},f=({eventName:e,reason:t})=>{n.record("feature_usage",1,{feature:"collector_emission",event_name:e,status:"skipped",reason:t})},m=[Ru(new Hp(t,{...e,consent:s,browserContext:a}),[u])];if(m.push(Ru(new Xu(t,{shopId:e.shopId,surface:e.surface,pageUrl:p,consent:s}),[d]),Ru(new td(r,{surface:e.surface}),[d])),bt("f12a06f7")&&m.push(Ru(new Zp(new rh(mi,{...e,consent:s}),{surface:e.surface,sessionId:e.sessionId}),[u])),e.features.agentContext){const e=new oh;m.push(Ru(new ch({client:e}),[u]))}e.features.storefrontEvents&&m.push(...function({configuration:e,monorailClient:t,collectorClient:r,consent:n,pageUrl:o,onMonorailEmission:i,onCollectorEmission:s,onCollectorValidationError:a}){const c=[],u=bt("85f2c4d9"),d=u?ld:dd,l=u?hl:pl,p=u?zl:Fl,h=u?bp:yp;Nr()&&(c.push(new md(t,{...e,pageUrl:o,consent:n,routeToCollector:d,onEmission:i})),c.push(u?new Md(r,{...e,pageUrl:o,hoversEnabled:Rr(),onEmission:s,onValidationError:a}):new Zd(r,{...e,pageUrl:o,hoversEnabled:Rr(),onEmission:s,onValidationError:a})),Rr()&&c.push(new ul(t,{...e,pageUrl:o,consent:n,routeToCollector:d,onEmission:i})));const f={pageType:yn(e.pageType),resourceId:e.resourceId,pageUrl:o};wn(f)&&(c.push(new yl(t,{...e,...f,consent:n,routeToCollector:l,onEmission:i})),c.push(u?new $l(r,{...e,...f,onEmission:s,onValidationError:a}):new Al(r,{...e,...f,onEmission:s,onValidationError:a}))),e.resourceId&&xn(e.pageType)&&(c.push(new Jl(t,{...e,productId:e.resourceId,pageUrl:o,consent:n,routeToCollector:p,onEmission:i})),c.push(u?new pp(r,{shopId:e.shopId,productId:e.resourceId,pageType:e.pageType,themeId:e.themeId,themeStoreId:e.themeStoreId,themePublished:e.themePublished,pageUrl:o,onEmission:s,onValidationError:a}):new op(r,{shopId:e.shopId,productId:e.resourceId,pageType:e.pageType,themeId:e.themeId,themeStoreId:e.themeStoreId,themePublished:e.themePublished,pageUrl:o,onEmission:s,onValidationError:a})));const m={pageType:e.pageType,resourceId:e.resourceId};return On(m)&&(c.push(new xp(t,{...e,resourceId:m.resourceId,pageUrl:o,consent:n,routeToCollector:h,onEmission:i})),c.push(u?new Pp(r,{shopId:e.shopId,resourceId:m.resourceId,themeId:e.themeId,themeStoreId:e.themeStoreId,themePublished:e.themePublished,pageUrl:o,onEmission:s,onValidationError:a}):new $p(r,{shopId:e.shopId,resourceId:m.resourceId,themeId:e.themeId,themeStoreId:e.themeStoreId,themePublished:e.themePublished,pageUrl:o,onEmission:s,onValidationError:a}))),c}({configuration:e,monorailClient:t,collectorClient:r,consent:s,pageUrl:p,onMonorailEmission:e=>{n.record("feature_usage",1,{feature:"monorail_emission",schema_id:e.schemaId,event_name:e.eventName})},onCollectorEmission:h,onCollectorValidationError:f}).map(e=>Ru(e,[u])));const v={shopId:e.shopId,surface:e.surface,pageUrl:p};return m.push(new zh(t,v)),Yn({rate:.1}).includes("pixel_event_blocked")&&m.push(new Kh(n)),m.push(Ru(new Tf(t,{...e,consent:s,browserContext:a,onProduce:(e,t,r)=>{n.record("feature_usage",1,{feature:"monorail_emission",schema_id:r.shadow?"storefront_customer_tracking_parity_shadow":Df[t],event_name:e})}}),[u]),Ru(new Nf(t,{consent:s,pageId:e.pageId,navigationType:e.navigationType,navigationApi:e.navigationApi,onEventReceived:t=>{n.record("feature_usage",1,{feature:"monorail_forwarding"}),n.log("monorail_forwarding",{schema_id:t,shop_id:e.shopId,shop_domain:e.shopDomain,api_client_id:e.apiClientId,page_url:i})}}),[l])),e.features.trekkieShim&&m.push(bt(xt)?Ru(new Uh(r,{...e,consent:s,onEmission:h,onValidationError:f}),[l]):Ru(new Vh(t,{...e,pageUrl:i,consent:s,onProduce:e=>{n.record("feature_usage",1,{feature:"monorail_emission",schema_id:"storefront_customer_tracking_parity",event_name:e})}}),[l])),m.push(new Uf(n,{consent:s}),c),new Pu(m,{onError:o,bufferSize:500,replayKeep:"newest"})})(e,{pageUrl:r,monorailClient:i,collectorClient:p,featureUsageClient:o,consent:a,browserContext:l,onError:e=>{uo.notify(e,{context:"createWebPixelsManager/eventHub",severity:"warning",unhandled:!1})}}),f=h.emit.bind(h),{shopId:m,surface:v,storefrontBaseUrl:y,extensionBaseUrl:b,browserTarget:w,features:_,scope:I}=e,x={shopId:m,sessionId:e.sessionId,surface:v,browserTarget:w,pageUrl:r,storefrontBaseUrl:y,extensionBaseUrl:b,addMonorailEvent:mi,logError:uo.notify,userConsent:bo,consent:a,emit:f};if(self[jn]){const e=new me(`WebPixelsManager: ${jn} global object is already defined`,{groupingHash:"WebPixelsManager:GlobalObjectAlreadyDefined",severity:"info"});return uo.notify(e,{type:"metric",context:"createWebPixelsManager",severity:"info",unhandled:!1}),self[jn]}_.trekkieShim&&sr({configuration:e,consent:a,callback:e=>{f("log:trekkie:track",e)},createMissingStub:v===ve.StorefrontRenderer,onStubResolved:e=>{Yn({rate:.01}).includes("trekkie_shim_stub")&&o.record("feature_usage",100,{feature:"trekkie_shim_stub",origin:e})},onError:(e,t)=>{uo.notify(e,{...t,severity:"warning",unhandled:!1,options:{sampleRate:.01}})}});const E=hi("load",{version:Dn,bundleTarget:Un,pageUrl:r,status:"loading",surface:v,shopId:m,visitToken:a.trackingTokens.getVisitToken()||void 0}),{sessionId:k}=e,S={init(t){if(function(){const e=`\\/(${Oc.Wpm}|${Oc.WebPixels})@(.+)\\/sandbox`;return null!==self.location.href.match(new RegExp(e))}())return xu;const{initData:n,isMerchantRequest:o,monorailRegion:s,webPixelsConfigList:c}=t,u={...t,...e,monorailEndpoint:e.monorailEndpoint||t.monorailEndpoint};if(Vf)return uo.notify(new me(`WebPixelsManager: ${jn} is being initialized multiple times`,{groupingHash:"WebPixelsManager:MultipleInitialization",severity:"info"}),{type:"metric",context:"createWebPixelsManager/init",severity:"info",unhandled:!1,initConfig:u}),Vf;const d=Ss();o&&Mr(()=>self.sessionStorage.setItem("isMerchantSession","true")),_.pixelHelper&&Mr(()=>self.sessionStorage.setItem(qn,"true")),i.setEndpoint(Qi({storefrontBaseUrl:y,region:s,endpoint:e.monorailEndpoint})),(Mr(()=>"true"===self.sessionStorage.getItem(qn),!1)||v===ve.CustomerAccount)&&ba.init(u);const l=gt().toString(),p=hi("unload",{version:Dn,bundleTarget:Un,pageUrl:r,shopId:m,surface:v,isCompleted:"false",runtimeErrorCaught:"false",userCanBeTracked:l,sessionId:k});var h;h=p,window.addEventListener("pagehide",()=>{h.payload.pageDuration=ai("page:session")?.measurement?.duration,mi(h,{flush:!0})});const b=fc(x),w=function(){const e=new Ns({bufferSize:1e3,subscribeAllKey:"all_customer_privacy_events"});return e.use(Ga),{publish(t,r,n){if("string"!=typeof t)throw new me("Expected event name to be a string, but got "+typeof t,{groupingHash:"CustomerPrivacyEventBus:PublishEventNameNotString"});if(t!==g)throw new me(`Expected event name to be a ${g}, but got "${t}".`,{groupingHash:"CustomerPrivacyEventBus:PublishEventNameNotSupported"});return e.publish(t,r,n)},subscribe(t,r,n={}){if(t!==g)throw new me(`Event name "${t}" is not supported in the CustomerPrivacyEventBus.`,{groupingHash:"CustomerPrivacyEventBus:SubscribeEventNameNotSupported"});return e.subscribe(t,e=>{const t={configuration:n.pixelRuntimeConfig?.configuration,eventPayloadVersion:n.schemaVersion||n.pixelRuntimeConfig?.eventPayloadVersion||"unknown",id:n.pixelRuntimeConfig?.id||"unknown",type:n.pixelRuntimeConfig?.type||"unknown",runtimeContext:n.pixelRuntimeConfig?.runtimeContext||"unknown",restrictions:n.pixelRuntimeConfig?.restrictions,scriptVersion:n.pixelRuntimeConfig?.scriptVersion||"unknown",apiClientId:n.pixelRuntimeConfig?.apiClientId};r.call(e,e),vi("subscriberEventEmitPrivacy",{version:Dn,bundleTarget:Un,pageUrl:self.location.href,shopId:n.shopId,surface:n.surface,pixelId:t.id,pixelAppId:wa(t),pixelSource:t.type,pixelRuntimeContext:t.runtimeContext,pixelScriptVersion:t.scriptVersion,pixelConfiguration:t.configuration,pixelEventSchemaVersion:t.eventPayloadVersion,eventName:g,eventId:hr()})},n)}}}(),E={context:"createWebPixelsManager/init",severity:"warning",unhandled:!1,initConfig:u},S=hi("init",{version:Dn,bundleTarget:Un,pageUrl:r,shopId:m,surface:v,status:"initializing",userCanBeTracked:l});try{if(window.Shopify&&!0===window.Shopify.designMode)return window.console&&console.log("[WebPixelsManager] Prevented from executing in the Theme Editor"),xu;if(/^web-pixel-sandbox/.test(self.name)){const e=new so("WebPixelsManager: browser library is being run in a sandbox");throw uo.notify(e,{...E,type:"metric",library:"browser"}),e}const t=c.reduce((e,t)=>{t.type=t.type.toUpperCase(),t.runtimeContext=t.runtimeContext?.toUpperCase();const r=$c(x,{webPixelConfig:t,eventBus:b,customerPrivacyEventBus:w,initData:n,cookieRestrictedDomains:d});return t.restrictions?.preventLoadingBeforeEvent?e.waiting.push(r):e.ready.push(r),e},{ready:[],waiting:[]});Promise.all(t.ready).then(()=>function(e){const{measurement:t}=ai("completed");e.payload.isCompleted="true",e.payload.runTimeDuration=t?.duration,e.payload.startTime=t?.startTime}(p)).catch(e=>{window.console&&console.error("[Web Pixels]",e)}),Promise.all(t.waiting).catch(()=>{}),a.onConsentCollected(e=>{e&&e.detail&&w.publish(g,{customerPrivacy:{analyticsProcessingAllowed:e.detail.analyticsAllowed,marketingAllowed:e.detail.marketingAllowed,preferencesProcessingAllowed:e.detail.preferencesAllowed,saleOfDataAllowed:e.detail.saleOfDataAllowed}})});const o=(v===ve.CustomerAccount?b.publish:b.publishDomEvent).bind(b),i={onError:uo.notify.bind(uo)};if(_.storefrontEvents){try{nt(b.publish.bind(b),n,{publishShadowTrekkieAddToCart:_.trekkieShim&&bt("08197dfb")?(e,t)=>{f("log:trekkie:shadow-add-to-cart",{properties:{...e},addApiSource:t,pageContext:{url:self.location.href,referrer:self.document.referrer}})}:void 0})}catch(A){uo.notify(A,{context:"createWebPixelsManager/createShopEventsListener"})}Nn({pageType:e.pageType,resourceId:e.resourceId,pageUrl:r,products:n?.products,emit:f,onError:uo.notify})}_.cartPermalink&&function(e,{cart:t}){try{if(!window.localStorage)return;const r=new URLSearchParams(window.location.search).get(xe);if(!r)return;if(r===window.localStorage.getItem(xe))return;window.localStorage.setItem(xe,r),t?.lines.forEach(t=>{Fe(e,t,t.quantity,_e,"permalink")})}catch{}}(b.publish.bind(b),n),_.domEvents&&vu(o,i),_.advancedDomEvents&&c.some(({capabilities:e})=>(e||[]).includes(be.AdvancedDomEvents))&&(T=o,C=i,_u.map(e=>{try{return e(T,C)}catch(A){return C?.onError?.(A,{context:"createAdvancedDomEventsListener"}),()=>{}}}),vu(o,{...i,eventPrefix:"advanced_dom_"})),S.payload.status="initialized",mi(S);const s=function(e,{eventBus:t,customerId:r,scope:n}){const o=function({emit:e},t){return{visitor:(r={},n)=>{const o=function(e={},t){if(!e||"object"!=typeof e)return"Visitor info must be of type object";const{email:r,phone:n}=e;return r||n?r&&"string"!=typeof r?"Email must be of type string":n&&"string"!=typeof n?"Phone must be of type string":t?.appId&&"string"!=typeof t.appId?"appId must be of type string":t?.apiClientId&&"string"!=typeof t.apiClientId?"apiClientId must be of type string":null:"Visitor must have one of phone or email"}(r,n);if(o)throw new Iu(o);return e("log:visitor:reported",{event:{email:r.email,phone:r.phone,customerId:t.customerId,apiClientId:n?.appId||n?.apiClientId}}),!0}}}(e,{customerId:r}),{shopId:i,surface:s}=e,a=(e,r,o)=>!(s===ve.CustomerAccount&&!pe(e)&&n.publish!==xc.All)&&t.publish(e,r,o);return{publish:(e,t,r)=>!Eu(r)&&a(e,t,r),publishCustomEvent:(e,r,n={})=>!Eu(n)&&(s===ve.CustomerAccount?a(e,r,n):t.publishCustomEvent(e,r,n)),publishDomEvent:(e,r,n={})=>!Eu(n)&&(s===ve.CustomerAccount?a(e,r,n):t.publishDomEvent(e,r,n)),subscribe:(e,r,n)=>t.subscribe(e,r,{...n,shopId:i,surface:s}),visitor:(e,t)=>o.visitor(e,t)}}(x,{eventBus:b,customerId:n?.customer?.id,scope:I});return Vf=s,e.events.forEach(([e,t,r])=>{try{Eu(r)?s.publish(e,t,r):v===ve.CustomerAccount||le(e)?b.publish(e,t,r):b.publishCustomEvent(e,t,r)}catch(A){uo.notify(A,{context:"createWebPixelsManager/init/replayEvents",severity:"warning",unhandled:!1,initConfig:u})}}),Vf}catch(A){return A instanceof so||uo.notify(A,{context:"init",initConfig:u}),window.console&&console.error(A),S.payload.status="failed",S.payload.errorMsg=A?.message,mi(S),p.payload.runtimeErrorCaught="true",xu}var T,C}};return _s(self,jn,{value:S,writable:!1,configurable:!1,enumerable:!1},!1),E.payload.status="loaded",E.payload.visitToken=a.trackingTokens.getVisitToken()||void 0,Object.assign(E.payload,$f(e)),mi(E,Bf),S}catch(o){const t="string"==typeof o?.message?o.message:void 0,n=o instanceof so||"WebPixelsHandledError"===o.name;return uo.notify(o,{context:"createWebPixelsManager",severity:n?"warning":"error",unhandled:!n}),window.console&&console.error(o),mi(hi("load",{version:Dn,bundleTarget:Un,pageUrl:r,status:"manager-create-error",surface:e.surface,errorMsg:t,failureReason:"manager_create_failed",shopId:e.shopId,visitToken:Wt("_shopify_s"),...$f(e)}),{...Bf,flush:!0}),{init:()=>xu}}}({configuration:Zf()})}catch(em){uo.notify(em,{context:"entry-browser",severity:"error",unhandled:!1})}})()})();