(()=>{var K=Object.create;var D=Object.defineProperty,Q=Object.defineProperties,z=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertyNames,I=Object.getOwnPropertySymbols,J=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var j=(r,u,d)=>u in r?D(r,u,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[u]=d,E=(r,u)=>{for(var d in u||(u={}))M.call(u,d)&&j(r,d,u[d]);if(I)for(var d of I(u))W.call(u,d)&&j(r,d,u[d]);return r},C=(r,u)=>Q(r,$(u));var Y=(r,u)=>()=>{try{return u||r((u={exports:{}}).exports,u),u.exports}catch(d){throw u=0,d}};var tt=(r,u,d,x)=>{if(u&&typeof u=="object"||typeof u=="function")for(let A of Z(u))!M.call(r,A)&&A!==d&&D(r,A,{get:()=>u[A],enumerable:!(x=z(u,A))||x.enumerable});return r};var et=(r,u,d)=>(d=r!=null?K(J(r)):{},tt(u||!r||!r.__esModule?D(d,"default",{value:r,enumerable:!0}):d,r));var F=(r,u,d)=>new Promise((x,A)=>{var m=s=>{try{o(d.next(s))}catch(n){A(n)}},i=s=>{try{o(d.throw(s))}catch(n){A(n)}},o=s=>s.done?x(s.value):Promise.resolve(s.value).then(m,i);o((d=d.apply(r,u)).next())});var V=Y((At,R)=>{var T=(function(){var r=String.fromCharCode,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.",x={};function A(i,o){if(!x[i]){x[i]={};for(var s=0;s>>8,s[n*2+1]=_%256}return s},decompressFromUint8Array:function(i){if(i==null)return m.decompress(i);for(var o=new Array(i.length/2),s=0,n=o.length;s>1}else{for(a=1,n=0;n>1}y--,y==0&&(y=Math.pow(2,p),p++),delete f[g]}else for(a=_[g],n=0;n>1;y--,y==0&&(y=Math.pow(2,p),p++),_[v]=O++,g=String(b)}if(g!==""){if(Object.prototype.hasOwnProperty.call(f,g)){if(g.charCodeAt(0)<256){for(n=0;n>1}else{for(a=1,n=0;n>1}y--,y==0&&(y=Math.pow(2,p),p++),delete f[g]}else for(a=_[g],n=0;n>1;y--,y==0&&(y=Math.pow(2,p),p++)}for(a=2,n=0;n>1;for(;;)if(e=e<<1,t==o-1){l.push(s(e));break}else t++;return l.join("")},decompress:function(i){return i==null?"":i==""?null:m._decompress(i.length,32768,function(o){return i.charCodeAt(o)})},_decompress:function(i,o,s){var n=[],a,_=4,f=4,b=3,v="",g=[],y,O,p,l,e,t,h,c={val:s(0),position:o,index:1};for(y=0;y<3;y+=1)n[y]=y;for(p=0,e=Math.pow(2,2),t=1;t!=e;)l=c.val&c.position,c.position>>=1,c.position==0&&(c.position=o,c.val=s(c.index++)),p|=(l>0?1:0)*t,t<<=1;switch(a=p){case 0:for(p=0,e=Math.pow(2,8),t=1;t!=e;)l=c.val&c.position,c.position>>=1,c.position==0&&(c.position=o,c.val=s(c.index++)),p|=(l>0?1:0)*t,t<<=1;h=r(p);break;case 1:for(p=0,e=Math.pow(2,16),t=1;t!=e;)l=c.val&c.position,c.position>>=1,c.position==0&&(c.position=o,c.val=s(c.index++)),p|=(l>0?1:0)*t,t<<=1;h=r(p);break;case 2:return""}for(n[3]=h,O=h,g.push(h);;){if(c.index>i)return"";for(p=0,e=Math.pow(2,b),t=1;t!=e;)l=c.val&c.position,c.position>>=1,c.position==0&&(c.position=o,c.val=s(c.index++)),p|=(l>0?1:0)*t,t<<=1;switch(h=p){case 0:for(p=0,e=Math.pow(2,8),t=1;t!=e;)l=c.val&c.position,c.position>>=1,c.position==0&&(c.position=o,c.val=s(c.index++)),p|=(l>0?1:0)*t,t<<=1;n[f++]=r(p),h=f-1,_--;break;case 1:for(p=0,e=Math.pow(2,16),t=1;t!=e;)l=c.val&c.position,c.position>>=1,c.position==0&&(c.position=o,c.val=s(c.index++)),p|=(l>0?1:0)*t,t<<=1;n[f++]=r(p),h=f-1,_--;break;case 2:return g.join("")}if(_==0&&(_=Math.pow(2,b),b++),n[h])v=n[h];else if(h===f)v=O+O.charAt(0);else return null;g.push(v),n[f++]=O+v.charAt(0),_--,O=v,_==0&&(_=Math.pow(2,b),b++)}}};return m})();typeof define=="function"&&define.amd?define(function(){return T}):typeof R!="undefined"&&R!=null?R.exports=T:typeof angular!="undefined"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return T})});var B="WebPixel::Render";var L=r=>shopify.extend(B,r);var w;w={APP_URL:"https://api.bogos.io",COLLECT_URL:"https://collect.bogos.io/collect"};var q=()=>w;var N=()=>{var r,u,d;return(d=(u=(r=globalThis.crypto)==null?void 0:r.randomUUID)==null?void 0:u.call(r))!=null?d:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,12)}`},P=r=>{if(r===0)return!0;if(typeof r=="number"||typeof r=="boolean")return!1;if(r===null||typeof r=="undefined")return!0;if(typeof r.length!="undefined")return r.length===0;let u=0;for(let d in r)r.hasOwnProperty(d)&&u++;return u===0};var G=et(V());var H=(r,u="base64")=>u==="uri"?G.compressToEncodedURIComponent(JSON.stringify(r)):G.compressToBase64(JSON.stringify(r)),S=(A,m,...i)=>F(null,[A,m,...i],function*(r,u,d={},x){var n;let o=C(E({},d),{shop:r,time:Date.now(),key:"bogos-collect-sessions"});Array.isArray(u)&&(u=u.map(a=>a!=null&&a.event_id?a:C(E({},a),{event_id:N()})));let s=q().COLLECT_URL;if(P(s)){console.warn("BOGOS track: missing url");return}return yield fetch(s,{method:"POST",headers:C(E({"Content-Type":"application/json"},d),{authorization:`Bearer ${H(o)}`}),body:JSON.stringify({shop:r,data:H(u,"uri")}),keepalive:(n=x==null?void 0:x.keepalive)!=null?n:!1})});var rt=3e3;L(({analytics:r,init:u,settings:d})=>{let{shop:x}=u.data,A=[],m=null,i=_=>{if(A.length===0)return;let f=[...A];A.length=0,m&&(clearTimeout(m),m=null),a(x.myshopifyDomain,f,_)},o=()=>{m||(m=setTimeout(()=>i(),rt))},s=_=>{A.push(_),o()},n=_=>{let{collect_url:f}=d,{shop:b}=u.data,v=_.customData;b.myshopifyDomain!==v.payload.shop||!f||S(b.myshopifyDomain,v.data,v.payload).then()},a=(_,f,b)=>{let{product_bundles_data:v}=d!=null?d:{},g=JSON.parse(v!=null?v:"[]"),y=f.reduce((t,h)=>{let c=g==null?void 0:g.find(X=>{var k,U;return((k=X.product_id)==null?void 0:k.toString())===((U=h.product_id)==null?void 0:U.toString())});return c&&t.push(C(E({},h),{bundle_id:c.bundle_id})),t},[]),O=[],p=[],l={shop:_,type:"classic_bundle",belongs:"bundle"};y.forEach(t=>{t.event_name==="bogos:product_bundle_sessions_view"&&p.push(C(E({},l),{time:t.time,obj_id:t.bundle_id,name:"session_view",event_id:t.id})),t.event_name==="bogos:product_bundle_added_to_cart"&&O.push(C(E({},l),{time:t.time,obj_id:t.bundle_id,name:"add_to_cart",event_id:t.id}))});let e=[...O,...p];P(e)||S(_,e,{},b).then()};r.subscribe("bogos_view",_=>{n(_)}),r.subscribe("bogos_atc",_=>{n(_)}),r.subscribe("product_added_to_cart",_=>{var f;s({id:_.id,event_name:"bogos:product_bundle_added_to_cart",product_id:`${(f=_.data.cartLine)==null?void 0:f.merchandise.product.id}`,time:_.timestamp})}),r.subscribe("product_viewed",_=>{var f,b;s({id:_.id,event_name:"bogos:product_bundle_sessions_view",product_id:`${(b=(f=_.data.productVariant)==null?void 0:f.product)==null?void 0:b.id}`,time:_.timestamp})}),r.subscribe("bogos:onload",()=>{i({keepalive:!0})})});})();