!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}([function(e,t,n){"use strict";n.d(t,"h",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"e",(function(){return c})),n.d(t,"j",(function(){return s})),n.d(t,"g",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"f",(function(){return d})),n.d(t,"i",(function(){return l})),n.d(t,"k",(function(){return p})),n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return m}));var o=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{u(o.next(e))}catch(e){r(e)}}function s(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}u((o=o.apply(e,t||[])).next())}))};function i(e){return void 0===e}function r(e){return"function"==typeof e}function c(e){return null===e}const s=(e,t={})=>{if(Number.isFinite(+e))return t;try{return JSON.parse(e)}catch(e){}return t};function u(e){const t=function(){return o(this,void 0,void 0,(function*(){}))}.constructor;return!("object"!=typeof e||c(e)||Array.isArray(e)||e instanceof t||"function"===e.constructor||"[object Object]"!==Object.prototype.toString.call(e))}function a(e,t,n){if(c(e)||i(e))return n;const o=(null!=t?t:"").replace(/\[([^[\]]*)]/g,".$1.").split(".").filter((e=>""!==e)).reduce(((e,t)=>e&&e[t]),e);return i(o)?n:o}function d(e){return"number"==typeof e&&Number.isFinite(e)}function l(e){return"string"==typeof e&&e.length>0}const p=(e,t="",n)=>{const o=t&&t.length>0?t.split("."):[];let r=e;return o.slice(0,o.length-1).forEach((e=>{let t=r[e];(c(t)||i(t))&&(t={}),r[e]=t,r=r[e]})),r[o.pop()]=n,e};function f(e,t){let n;return(...o)=>{clearTimeout(n),n=setTimeout((()=>{e(...o)}),t)}}const m=e=>{var t,n,o;return null!==(o=null===(n=null===(t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))||void 0===t?void 0:t.map((e=>e.toLowerCase())))||void 0===n?void 0:n.join("_"))&&void 0!==o?o:e}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(5);const i=["info","debug","error","log","group","groupEnd"].reduce(((e,t)=>(e[t]=(...e)=>{o.h||window.console[t](...e)},e)),{})},,,function(e,t,n){"use strict";(function(e){n.d(t,"h",(function(){return a})),n.d(t,"a",(function(){return l})),n.d(t,"f",(function(){return m})),n.d(t,"j",(function(){return w})),n.d(t,"e",(function(){return y})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return _})),n.d(t,"d",(function(){return O})),n.d(t,"i",(function(){return E})),n.d(t,"g",(function(){return S})),n.d(t,"k",(function(){return j}));var o,i,r,c,s=n(2),u=n(6);const a="production"===(null===(o=null==e?void 0:{USER_FEATURES_API:"https://app.getmodemagic.com/api/features",APP_URL:"https://app.getmodemagic.com",NODE_ENV:"production"})||void 0===o?void 0:o.NODE_ENV),d="test"===(null===(i=null==e?void 0:{USER_FEATURES_API:"https://app.getmodemagic.com/api/features",APP_URL:"https://app.getmodemagic.com",NODE_ENV:"production"})||void 0===i?void 0:i.NODE_ENV),l=null!==(c=null===(r=null==e?void 0:{USER_FEATURES_API:"https://app.getmodemagic.com/api/features",APP_URL:"https://app.getmodemagic.com",NODE_ENV:"production"})||void 0===r?void 0:r.NODE_ENV)&&void 0!==c?c:"development",p=["ase","art","bmp","blp","cd5","cit","cpt","cr2","cut","dds","dib","djvu","egt","exif","gif","gpl","grf","icns","ico","iff","jng","jpeg","jpg","jfif","jp2","jps","lbm","max","miff","mng","msp","nef","nitf","ota","pbm","pc1","pc2","pc3","pcf","pcx","pdn","pgm","PI1","PI2","PI3","pict","pct","pnm","pns","ppm","psb","psd","pdd","psp","px","pxm","pxr","qfx","raw","rle","sct","sgi","rgb","int","bw","tga","tiff","tif","vtf","xbm","xcf","xpm","3dv","amf","ai","awg","cgm","cdr","cmx","dxf","e2d","egt","eps","fs","gbr","odg","svg","stl","vrml","x3d","sxd","v2d","vnd","wmf","emf","art","xar","png","webp","jxr","hdp","wdp","cur","ecw","iff","lbm","liff","nrrd","pam","pcx","pgf","sgi","rgb","rgba","bw","int","inta","sid","ras","sun","tga","heic","heif"],f=new Set(p),m=new RegExp(`((.${p.join("|.")})+)$`,"i"),h=new RegExp(`((?:_(?:x|X)?)(?:(?:\\d{1,4}(?:x|X)\\d{0,4}|(?:x|X)\\d{1,4})|(?:${["pico","icon","thumb","small","compact","medium","large","grande","original","master"].join("|")})))?(_crop_(?:${["center","top","right","bottom","left"].join("|")}))?(@[23]x)?(.(?:${["progressive"].join("|")}))?$`),g=(()=>{let e=[];return t=>{let n=t.replace(/\.([^.]+?)$/,"");e=n.split(".");let o=-1;for(let t=0;t0?o:void 0).join("."),n}})(),w=(()=>{const e={};return t=>{const n=e[t];if("string"==typeof n)return n;let o=t;o=o.replace(/\?v=.*/g,"");const i=g(o).match(h);if(i){const{index:e=0}=i,t=o.slice(0,e),n=o.slice(e+i[0].length);o=`${t}${n}`}return e[t]=o,o}})(),v=(()=>{const e={};return t=>{let n=e[t];return"string"==typeof n||(n=g(t),e[t]=n),n}})();function y(e,t){return t.find((t=>function(e,t){return v(e)===v(t)}(e,t)))||""}const b=(()=>{const e=new Map([]);return(t,n)=>{var o;if(e.has(t))return e.get(t);const i=w(t),r=i.match(m);if(!t.startsWith("/")&&Array.isArray(r)&&r.length>0){const o=function(e){var t,n;return null===(n=null===(t=e.split("/").pop())||void 0===t?void 0:t.split("?"))||void 0===n?void 0:n[0]}(i);if("string"==typeof o){const i=`${n}/${o}`;e.set(t,i)}}return null!==(o=e.get(t))&&void 0!==o?o:t}})();function _(e,t="/cdn"){return`${e}${t}`}function O(){const{store:e}=Object(u.b)(),t=window.location.pathname;return t.match(/^\/(?:[a-z]{2})?$/)?"home":t.match(/\/products\/.+?$/)?"product":t.match(/\/pages\/.+?$/)?"page":t.includes("collection")||t.includes("search")?"collection":"venustahome"===e&&t.includes("campaign")?"home":"_not_supported_"}const E=window.modeMagicPreviewSettings||window.modeMagicSettings||{},S=(e,{areaCheck:t}={areaCheck:!0})=>{if(!(e=>{const t=e=>{const{visibility:t,display:n,opacity:o}=getComputedStyle(e);return!(document.hidden||"hidden"===t||"none"===n||0==+o)};let n=e,o=t(n);for(;o&&n.parentElement;)n=n.parentElement,o=t(n);return o})(e))return!1;const{top:n,left:o,bottom:i,right:r}=e.getBoundingClientRect(),c={x:0,y:0},s={x:window.innerWidth||document.documentElement.clientWidth,y:window.innerHeight||document.documentElement.clientHeight},u=(e,t)=>{const n=c[e],o=s[e];return to?o:t},a=u("y",i)-u("y",n),d=u("x",r)-u("x",o);return t?a*d>0:a>0||d>0},j=e=>{let{logs:t}=null!=e?e:{};t||({logs:t}=null==e?void 0:e.constructor);let n=["",""];return t&&(n=[Object.keys(t).reduce(((e,n)=>`${e}${n}: ${t[n]}; `),""),"background-color: rgb(76, 136, 255);color:white;","color: rgb(76, 136, 255)"]),a||d?e:new Proxy(e,{get(t,o,i){const r=Reflect.get(t,o,i);return"function"==typeof r?function(...t){var i,c;const u=`%c[${null!==(i=null==e?void 0:e.name)&&void 0!==i?i:null===(c=null==e?void 0:e.constructor)||void 0===c?void 0:c.name}]%c[${o.toString()}]%c: `;s.a.group(u,...n),t.length>0&&s.a.debug("Called with: ",...t);const a=r.apply(this,t);return s.a.debug("Returning",a),s.a.groupEnd(),a}:r}})}}).call(this,n(19))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var o=n(0),i=n(13);const r={SHOPIFY:"shopify",BIGCOMMERCE:"bigcommerce",UNKNOWN:"--unknown--"},c=()=>{var e,t,n;const c={cart:null,platform:r.UNKNOWN,product:"",store:"",currency:{active_currency_code:"",active_currency_id:1},settings:{store_hash:"",secure_host:"",cdn_url:"",secure_base_url:"",channel_id:1},customer:null,dumps:{},urls:{home:""}};if("undefined"!=typeof window){if(void 0===window.__store_context__&&(window.__store_context__={}),Object.assign(window.__store_context__,Object.assign(Object.assign({},c),window.__store_context__)),Object(o.g)(window.Shopify)){const o=Object(i.a)(),c=window.Shopify.shop.split(".")[0];Object.assign(window.__store_context__,{platform:r.SHOPIFY,store:c,dumps:{},currency:{active_currency_code:null!==(t=null===(e=window.Shopify.currency)||void 0===e?void 0:e.active)&&void 0!==t?t:"USD",active_currency_id:1},settings:{secure_base_url:`https://${window.Shopify.shop}`,secure_host:window.Shopify.shop,cdn_url:window.Shopify.cdnHost,store_hash:c,channel_id:1},cart:null,urls:{home:null===(n=window.Shopify.routes)||void 0===n?void 0:n.root},product:o.product})}return window.__store_context__}return c}},function(e,t,n){"use strict";n.d(t,"d",(function(){return m})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return g})),n.d(t,"a",(function(){return _}));const o="__SECRET_INTERNALS_DO_NOT_USE__";var i=n(15),r=n(5),c=n(2),s=n(9),u=n(0),a=n(14),d=n(17),l=n(6),p=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i{c.a.debug("MM:Clearing impressions cache"),e.impressionsCache=new Set,e.viewsCache=new Set,e.stats=w})),e.addOrderCompletionListener()}addOrderCompletionListener(){window.addEventListener("message",(e=>{const{data:t}=e,{messageType:n,messageData:{actionType:o}={}}=t,i=Object(u.c)(t,"messageAuth.source",null),r=Object(u.c)(t,"messageData.payload.order",null),{id:c,line_items:s=[],cart_token:d="",email:l="",customer:p,customer_locale:m=""}=null!=r?r:{},{id:h=-1}=null!=p?p:{};"MODEMAGIC_CONVERSION_EVENT"!==n||"ORDER_CREATE"!==o||Object(u.e)(i)||!f.has(i)||Object(u.h)(c)||Object(a.b)({email:l,orderId:c,customerId:h,cartToken:d,customerLocale:m,source:null!=i?i:void 0,lineItems:s})}))}flushQueue(){var e,t,n;const o=b.getInstance(),i=o.eventQueue.get(y);if(Object(u.e)(i)||Object(u.h)(i)){const e=null!==(t=o.eventQueue.get(v))&&void 0!==t?t:[];Array.isArray(e)&&e.length>0&&(o.eventQueue.set(v,[]),o.eventQueue.set(y,{events:e,queued:(new Date).getTime(),counter:1}))}else{const t=(new Date).getTime();if(!(t-i.queued>o.queWaitTime)){if(-1!==o.retryQueTimeout)return;const e=o.queWaitTime-(t-i.queued)+1e3;return void(o.retryQueTimeout=window.setTimeout((()=>{o.retryQueTimeout=-1,o.flushQueue()}),e))}if(i.counter>=o.maxRetries)return o.eventQueue.set(v,[...null!==(e=o.eventQueue.get(v))&&void 0!==e?e:[],...i.events]),o.eventQueue.set(y,void 0),void o.flushQueue();o.eventQueue.set(y,Object.assign(Object.assign({},i),{queued:(new Date).getTime(),counter:i.counter+1}))}const r=null===(n=o.eventQueue.get(y))||void 0===n?void 0:n.events;if(Array.isArray(r)&&r.length>0){const e=JSON.stringify(r);fetch(m,{method:"POST",body:e}).then((()=>{o.eventQueue.set(y,void 0)})).catch((()=>{}))}}queueEvent(e){var t;const n=b.getInstance(),o=[...null!==(t=n.eventQueue.get(v))&&void 0!==t?t:[],e];n.eventQueue.set(v,o),n.queTimeout>0&&(window.clearTimeout(n.queTimeout),n.queTimeout=-1),o.length>=20?n.flushQueue():n.queTimeout=window.setTimeout((()=>{n.flushQueue()}),1e3)}raiseEvent(e){const{store:t}=Object(l.b)(),{appName:n=d.a,entity:o,eventType:i,data:r,element:c}=e,u=null!=r?r:{},{product:a,storyboard:f,template:m,impressionsData:h,widgets:g,playbookId:w}=u,v=p(u,["product","storyboard","template","impressionsData","widgets","playbookId"]),y=(new Date).getTime()/1e3,_=b.getInstance();_.stats[i]+=1,_.log(o,i,r,c),_.queueEvent(Object.assign(Object.assign({app_name:n,store_id:t,product_id:a,storyboard_id:f,widget_ids:g,template_id:m,category:o,action:i,time:y,playbook_id:w,device_id:Object(s.a)()},v),h))}log(e,t,n,o){c.a.debug(`MM:${e}:${t}`),o&&c.a.debug("src element: ",o),c.a.debug("data: ",JSON.stringify(n)),c.a.debug("stats: ",JSON.stringify(b.getInstance().stats))}click(e){const{entity:t,element:n,data:o,appName:i}=e;b.getInstance().raiseEvent({appName:i,entity:t,eventType:h.CLICK,data:o,element:n})}impression(e){const{entity:t,element:n,data:o,appName:i}=e,r=b.getInstance();r.impressionsCache.has(n)||(r.raiseEvent({appName:i,entity:t,eventType:h.IMPRESSION,data:o,element:n}),r.impressionsCache.add(n))}view(e){const{entity:t,element:n,data:o,appName:i}=e,r=b.getInstance();r.viewsCache.has(n)||(r.raiseEvent({appName:i,entity:t,eventType:h.VIEW,data:o,element:n}),r.viewsCache.add(n))}hide(e){const{entity:t,element:n,data:o,appName:i}=e;b.getInstance().raiseEvent({appName:i,entity:t,eventType:h.HIDE,data:o,element:n})}conversion(e){const{data:t,appName:n}=e;b.getInstance().raiseEvent({appName:n,entity:g.WIDGET,eventType:h.CONVERSION,data:t})}}const _=b.getInstance()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(0);const i="mm.userDeviceID",r=()=>{const e=window.localStorage.getItem(i);if(Object(o.e)(e)){const e=JSON.stringify(performance.now())+Math.random().toString(36).substring(2,11);return window.localStorage.setItem(i,e),e}return e}},,,,function(e,t,n){"use strict";function o(){const e=document.querySelectorAll("[data-app='mm']");let t={};return e.forEach((e=>{t=Object.assign(Object.assign({},t),e.dataset)})),t}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var o=n(7),i=n(0);const r={swift:!0,shopflo:!0,fastrr:!0};function c(e){const{customerLocale:t,customerId:n,orderId:r,lineItems:c,email:s,cartToken:u,source:a}=e,d=c.reduce(((e,{properties:t={}})=>{const n=t.__mmWidget,o=Object(i.j)(n,null);return null===o||Array.isArray(o)||"object"!=typeof o||e.push(o),e}),[]);o.a.conversion({appName:"shopify",data:{widgets:d,meta:{source:a,line_items:c,order:r,cartToken:u,src:window.location.href,customer:{id:n,locale:t,email:s}},impressionsData:{apply_type:"manual"}}})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(0);class i{constructor(e=!0){this.sessionKey="",this.cache=new Map,this.persistent=!0,this.persistent=!!e}init(e){this.sessionKey=`${e}-cache`,this.cache=new Map(Object(o.j)(this.persistent?window.localStorage.getItem(this.sessionKey):window.sessionStorage.getItem(this.sessionKey),[]))}get(e){return this.cache.get(e)}set(e,t){this.cache.set(e,t),this.persistent?window.localStorage.setItem(this.sessionKey,JSON.stringify(Array.from(this.cache.entries()))):window.sessionStorage.setItem(this.sessionKey,JSON.stringify(Array.from(this.cache.entries())))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o="-- empty --"},,function(e,t){var n,o,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(e){o=c}}();var u,a=[],d=!1,l=-1;function p(){d&&u&&(d=!1,u.length?a=u.concat(a):l=-1,a.length&&f())}function f(){if(!d){var e=s(p);d=!0;for(var t=a.length;t;){for(u=a,a=[];++l1)for(var n=1;n{const[,,i]=n;e.apply(t,n),o.listeners.forEach((e=>"string"==typeof i&&e(i.split("?")[1]||"")))}})}static listen(e){o.unlisten(e),o.listeners.push(e)}static unlisten(e){o.listeners=o.listeners.filter((t=>t!==e))}}o.listeners=[]},,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"addFeatureSettings",(function(){return l}));var o=n(0),i=n(2),r=n(9),c=n(7),s=n(13),u=n(6),a=n(21),d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{u(o.next(e))}catch(e){r(e)}}function s(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}u((o=o.apply(e,t||[])).next())}))};function l(e,t,n="modeMagic"){const o=`${n}Settings`;void 0===window[o]&&(window[o]={}),void 0!==t&&(window[o][e]=t)}function p(e){try{const t=JSON.parse(e.responseText);!function(e){e.forEach((({name:e,src:t,data:n})=>{l(e,n,"modeMagic");const o=document.createElement("script");o.setAttribute("data-mm-script",e),o.setAttribute("type","text/javascript"),o.setAttribute("src",t),o.setAttribute("fetchPriority","high"),document.body.appendChild(o)}))}(t.data)}catch(e){i.a.debug(e)}}const f=()=>{const{store:e,product:t}=Object(u.b)(),n=(new Date).getTime()/1e3;fetch(c.d,{method:"POST",body:JSON.stringify({device_id:Object(r.a)(),meta:{url:window.location.href},product_id:null!=t?t:"",action:c.b.PAGE_VIEW,time:n,store_id:e,category:"price_drop"})})},m=()=>d(void 0,void 0,void 0,(function*(){const e=Object(s.a)();if(!e.product&&Object(o.g)(window.Shopify)){const t=yield d(void 0,void 0,void 0,(function*(){var e,t;let n=null;try{const o=yield fetch(`${window.location.pathname}.json`).then((e=>e.json()));n=null===(t=null===(e=null==o?void 0:o.product)||void 0===e?void 0:e.id)||void 0===t?void 0:t.toString()}catch(e){i.a.debug(e)}return null!=n?n:null}));if("string"==typeof t){e.product=t;const n=document.createElement("div");n.setAttribute("data-app","mm"),n.setAttribute("data-product",t),document.body.appendChild(n)}}return Promise.resolve()}));function h(){var e;return d(this,void 0,void 0,(function*(){let t=!1;const{store:n,product:o}=Object(u.b)(),i=void 0!==(null===(e=window.Shopify)||void 0===e?void 0:e.checkout)||void 0!==window.Shopflo&&"thank_you"===new URLSearchParams(window.location.search).get("page")?"true":"false",c={shop:n,path:window.location.pathname,domain:window.location.host,product:o,app:"modemagic",hash:window.location.hash,device_id:Object(r.a)(),thankyou:i};t||(f(),t=!0,null===window||void 0===window||window.addEventListener("popstate",(()=>{t&&f()})));const s=new URL("https://app.getmodemagic.com/api/features");!function(e,t){Object.entries(t).forEach((([t,n])=>{n&&e.searchParams.set(t,n)}))}(s,c);const a=new XMLHttpRequest;a.addEventListener("load",p.bind(null,a)),(null===window||void 0===window?void 0:window.MMScriptLoaded)||(a.open("GET",s.toString(),!0),a.send(),window.MMScriptLoaded=!0)}))}const g=()=>d(void 0,void 0,void 0,(function*(){var e;(null===window||void 0===window?void 0:window.MMScriptLoaded)||(window.MMScriptLoaded=null!==(e=null===window||void 0===window?void 0:window.MMScriptLoaded)&&void 0!==e&&e,yield m(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",g):yield h())}));i.a.debug("[loader] starting initialization"),g(),a.a.init(),a.a.listen((()=>{"undefined"!=typeof window&&window.MMScriptLoaded&&void 0!==window.Shopflo&&"thank_you"===new URLSearchParams(window.location.search).get("page")&&(i.a.debug("[loader] re-initializing as shopflo integration changed query param in thank you page"),window.MMScriptLoaded=!1,g())}))}]);