/*! Campaigns - Wed, 16 Apr 2025 23:03:24 GMT */ "use strict";(self.webpackChunkom_api_js=self.webpackChunkom_api_js||[]).push([[5],{7651:function(t,e,i){i.r(e),i.d(e,{default:function(){return m}});var s=i(9564),o=i(1441),n=i(187),r=i(5728),a=i(8305),c=i(3824);class d{constructor(t){this.om=window[o.GLOBAL_OM],this.site=this.getSite(t),this.e=null,this.init()}init(){(0,c.trigger)(document,"Ecommerce.init",{Ecommerce:this}),this.om.ecommerce||(this.om.ecommerce={customer:null,cart:{},errors:[],fetching:!1,loaded:!1}),this.site&&this.getEcommerceClass().then((t=>{this.e=t,!this.e||this.om.ecommerce.fetching||this.om.ecommerce.loaded||this.e.getCart()}))}getEcommerceClass=()=>this.isEdd()?i.e(11).then(i.bind(i,990)).then((t=>new t.default(this))):this.isWoocommerce()?i.e(29).then(i.bind(i,7709)).then((t=>new t.default(this))):this.isShopify()?i.e(23).then(i.bind(i,7215)).then((t=>new t.default(this))):this.isBigcommerce()?i.e(3).then(i.bind(i,9508)).then((t=>new t.default(this))):(n.A.debug("No supported eCommerce platform could be found."),Promise.resolve());getSite=t=>{const e=t&&t[0]?t[0].length:0;for(let i=0;i{const{wordpress:t,woocommerce:e}=this.site.settings,i=window?.omapi_data?.wc_cart,s=window?.omapi_data?.wc_active,o=window?.woocommerce_params?.ajax_url;return!!(t&&e&&o&&(i||s))};isShopify=()=>{const{shopify:t}=this.site.settings,e=window?.Shopify?.shop;return!(!t||!e)};isBigcommerce=()=>{const{bigcommerce:t}=this.site.settings,e=window?.BCData?.csrf_token;return!(!t||!e)};isEdd=()=>{const{wordpress:t,edd:e}=this.site.settings,i=window?.omapi_data?.edd?.cart,s=window?.omapi_data?.edd_active;return!(!t||!e||!i&&!s)};checkDisplayRule=(t,e)=>!!this.om.ecommerce.loaded&&((0,c.trigger)(document,"Ecommerce."+t,{Ecommerce:this}),this.e&&(0,c.isFunction)(this.e[t])&&this.e[t](e));request=(t,e)=>{this.om.ecommerce.fetching=!0;const i=(new r.A).get(t,e).setCache(!1).setTimeout(5e3);t.includes("omapp/v1")&&i.setHeader("X-WP-Nonce",window.omapi_data.nonce),i.send().then((t=>this.success(t))).catch((t=>this.error(t)))};success=t=>{const e=JSON.parse(t.response);this.om.ecommerce.cart=e.data||e,(0,c.isFunction)(this.e.success)&&this.e.success(t),this.om.ecommerce.fetching=!1,this.om.ecommerce.loaded=!0};error=t=>{this.om.ecommerce.errors.push(t),this.om.ecommerce.fetching=!1,this.om.ecommerce.loaded=!0,(0,c.isFunction)(this.e.error)&&this.e.error(t)}}var h=i(2e3);class l{constructor(t,e){this.Cs=t,this.defaults=e,window[o.GLOBAL_OM].scripts=window[o.GLOBAL_OM].scripts||{};const i=void 0===window.om_load_webfont||window.om_load_webfont;this.enabled={fonts:{fontAwesome:i,googleFonts:i}},(0,c.empty)(window[o.GLOBAL_OM].scripts)&&(0,c.each)(o.SCRIPTS,((t,e)=>{if("analytics"===e)return window[o.GLOBAL_OM].scripts[e]={};window[o.GLOBAL_OM].scripts[e]={status:"ready",object:null,data:{},error:""}})),this.init()}init(){(0,c.trigger)(document,"Scripts.init",{Scripts:this}),(0,c.each)(this.Cs,((t,e)=>{(0,c.each)(e,((t,e)=>{(0,c.each)(e.rulesets,((t,e)=>{(0,c.each)(e.groups,((t,e)=>{(0,c.each)(e.rules,((t,e)=>{if((0,c.inArray)(e.type,["geolocation","adblock"])){let t=e.type;if("ready"!==window[o.GLOBAL_OM].scripts[t].status)return;window[o.GLOBAL_OM].scripts[t].status="loading",this[t]().catch((()=>{}))}}))})),(0,c.each)(e.actions,((t,e)=>{"sound-effect"===e.type&&"none"!==e.value&&this.soundEffects()}))})),(0,c.keys)(e.fonts).length&&"ready"===window[o.GLOBAL_OM].scripts.fonts.status&&(window[o.GLOBAL_OM].scripts.fonts.status="loading",this.fonts())}))}))}geolocation=()=>{const t=(0,c.getTestFlag)("omip","omipspoof"),e=(0,c.getUrl)(this.defaults,"geolocation").replace(t?"{ip}":"/{ip}",t);return(new r.A).get(e).setCache(!1).send().then((t=>{let e=JSON.parse(t.response);if(!e)throw new Error("Geolocation failed");window[o.GLOBAL_OM].scripts.geolocation.data={country:{shortName:e.country_iso||"",longName:e.country||""},administrative_area_level_1:{shortName:e.region_code||"",longName:e.region_name||""},locality:{shortName:e.city||"",longName:e.city||""},original:e},window[o.GLOBAL_OM].scripts.geolocation.status="loaded"})).catch((()=>{window[o.GLOBAL_OM].scripts.geolocation.data={},window[o.GLOBAL_OM].scripts.geolocation.error="There was an error retrieving the geolocation data.",window[o.GLOBAL_OM].scripts.geolocation.status="failed"}))};adblock=()=>new Promise(((t,e)=>{(0,c.addScript)((0,c.getUrl)(this.defaults,"adblock"),!0,(()=>{window[o.GLOBAL_OM].scripts.adblock.status="loaded",t()}),(()=>{window[o.GLOBAL_OM].scripts.adblock.status="failed",e()}))}));soundEffects=()=>new Promise(((t,e)=>{if(void 0!==window.omSoundEffects)return window[o.GLOBAL_OM].scripts.soundEffects.status="loaded",t();(0,c.addScript)((0,c.getUrl)(this.defaults,"soundEffects"),!0,(()=>{window[o.GLOBAL_OM].scripts.soundEffects.status="loaded",t()}),(()=>{window[o.GLOBAL_OM].scripts.soundEffects.status="failed",e()}))}));fonts=()=>new Promise((t=>this.enabled.fonts&&(this.enabled.fonts.fontAwesome||this.enabled.fonts.googleFonts)?void 0!==window.FontFace?(window[o.GLOBAL_OM].scripts.fonts.status="loaded",window[o.GLOBAL_OM].scripts.fonts.object=window.FontFace,t()):void 0:(window[o.GLOBAL_OM].scripts.fonts.status="blocked",t())));recaptcha=t=>new Promise(((e,i)=>{if(void 0!==window.grecaptcha&&"loaded"===window[o.GLOBAL_OM].scripts.recaptcha.status)return e();(0,c.addScript)(o.URLS.recaptcha.replace("{recaptchaSiteKey}",t),!0,(()=>{window[o.GLOBAL_OM].scripts.recaptcha.status="loaded",window[o.GLOBAL_OM].scripts.recaptcha.object=window.grecaptcha,e()}),(()=>{window[o.GLOBAL_OM].scripts.recaptcha.status="failed",i()}))}))}var w=i(2973);class m{constructor(t,e,i){window[o.GLOBAL_OM].reset=this.reset,window[o.GLOBAL_OM].pageStart=i.pageStart,this.campaigns="account"!==e||i.override?t.length?[t]:[]:t.campaigns,this.embed=e,this.defaults=i,this.Sessions=new h.A(this.defaults),window[o.GLOBAL_OM].domains="account"===e&&!i.override&&t.domains?t.domains:t.length&&t[0].domains?t[0].domains:window[o.GLOBAL_OM].domains||null,this.defaults.Scripts=new l(this.campaigns,this.defaults),this.defaults.Ecommerce=new d(this.campaigns),this.init()}init(){if("complete"!==document.readyState&&"interactive"!==document.readyState)return void setTimeout((()=>{this.init()}),50);(0,c.trigger)(document,"Campaigns.init",{Campaigns:this}),s.A.queryAll(this.defaults);let t=[];(0,c.each)(this.sort(this.campaigns),((e,s)=>{let n=(s=(0,c.shuffleArray)(s))[(0,c.randomKey)(s)];if(this.defaults.override||this.defaults.ruleTest){const t=s.find((t=>t.id===this.defaults.override||t.id===this.defaults.ruleTest));t&&(n=t)}n.clones=[],(0,c.each)(s,((t,e)=>{e.id!==n.id&&n.clones.push(e.id)}));let r=n.clones.concat([n.id]),a=!0;(0,c.each)(r,((t,e)=>{window["om"+e]&&(this.defaults.ruleTest&&e===this.defaults.ruleTest?window["om"+n.id].off():a=!1)})),a&&(i.e(4).then(i.bind(i,4793)).then((t=>{window["om"+n.id]||(window[o.GLOBAL_OM].campaigns[n.id]=window["om"+n.id]=new t.default(n,this.defaults))})),t.push(n.id))})),s.A.initMonsterLinks(t)}sort=t=>t.sort(((t,e)=>{let i=!1;return(0,c.each)(e,((t,e)=>{e.rulesets.filter((t=>t.groups.filter((t=>t.rules.filter((t=>"adblock"===t.type)))))).length&&(i=!0)})),i?1:-1})).sort(((t,e)=>{let i=!1;return(0,c.each)(e,((t,e)=>{e.options.mobile&&(i=!0)})),i?1:-1}));reset=()=>{if(void 0===window[o.GLOBAL_OM]||(0,c.empty)(window[o.GLOBAL_OM].campaigns))return void n.A.debug("A reset cannot happen since no campaigns have loaded.");s.A.queryAll(this.defaults);let t=[];(0,c.each)(window[o.GLOBAL_OM].campaigns,((e,i)=>{delete window[o.GLOBAL_OM].campaigns[i.id],delete window["om"+i.id],t.push(i.id),i.reset()})),window[o.GLOBAL_OM].pageStart=(0,c.currentTime)(),s.A.initMonsterLinks(t),window[o.GLOBAL_OM].visitsAdded=!1,new w.A}}},8305:function(t,e,i){i.d(e,{A:function(){return a}});var s=i(1441),o=i(8379),n=i(3824);class r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.C=t.C,this.site=e,this.id=this.site.id||this.details("id"),this.numericId=this.site.numeric_id||0,this.categories=this.site.categories||[],this.domain=this.site.domain||this.details("domain"),this.site.settings=this.site.settings||{},this.settings={affiliateLink:this.site.settings.affiliate_link||s.AFFILIATE_URL,affiliateLinkPosition:this.site.settings.affiliate_link_position||"under",globalInteractionCookie:this.site.settings.global_interaction_cookie||0,globalSuccessCookie:this.site.settings.global_success_cookie||0,shopify:this.site.settings.shopify||0,wordpress:this.site.settings.wordpress||0,recaptchaSiteKey:this.site.settings.recaptcha_site_key||this.details("recaptcha"),woocommerce:this.site.settings.woocommerce||0,bigcommerce:this.site.settings.bigcommerce||0,edd:this.site.settings.edd||0},this.created=this.site.created?new Date(this.site.created.replace(" ","T")+"Z").getTime()/1e3:0,this.init()}init(){(0,n.trigger)(document,"Site.init",{Site:this,Campaign:this.C})}websiteMatch=()=>{let t=`${(0,o.tl)((0,n.removeWww)(this.domain).replace("*.","[a-z0-9.-]+"))}`;return(0,n.getDomain)()===t||!!new RegExp(`^${t}$`,"i").test((0,n.getDomain)())};details=t=>{const e=!this.site.domain&&(0,n.inArray)((0,n.tld)(),s.OM_DOMAINS);switch(t){case"domain":return e?(0,n.tld)():"";case"id":return e?(0,n.tld)():null;case"recaptcha":return e?this.C.options.omRecaptcha:null;default:return null}}}class a{constructor(t){this.C=t,this.sites=[],this.valid=[],this.allowed=s.ALLOWED_HOSTS,(0,n.each)(t.site,((t,e)=>{this.sites.push(new r(this,e))})),this.init()}init(){(0,n.trigger)(document,"Sites.init",{Sites:this,Campaign:this.C}),this.websiteMatch()}websiteMatch=()=>{if((0,n.each)(this.sites,((t,e)=>{e.websiteMatch()&&this.valid.push(e)})),!this.valid.length&&this.websiteAllowed()&&this.valid.push(new r(this)),this.valid.length)return!0};websiteAllowed=()=>{let t=!1;return(0,n.each)(this.allowed,((e,i)=>{if(-1<(0,n.getDomain)().indexOf(i))return t=!0,!1})),t};current=()=>this.valid[0]||new r(this)}},9564:function(t,e,i){i.d(e,{A:function(){return r}});var s=i(1441),o=i(3231),n=i(3824);class r{static disable=!1;constructor(t){this.rule=t,this.C=t.C,this.pass=!1}init(){return this.rule.group.ruleset.monster.length||(this.rule.group.ruleset.monster=[]),this.rule.group.ruleset.monster.push(this),this.pass}trigger=()=>{this.C.startShow()};static validateLink=t=>{try{if((0,n.hasClass)(t,"skip-om-trigger"))throw new Error}catch(t){return[null,null]}if("A"!==t.tagName&&!(0,n.hasClass)(t,["manual-optin-trigger","om-monster-link"])&&!(t=t.closest("a")))return[null,null];const e=t.getAttribute("data-optin-slug")||t.getAttribute("href");return e?[e,t]:[null,null]};static queryAll=t=>{const e=(0,n.getUrl)(t,"monsterCampaigns"),i=(0,n.getUrl)(t,"customCampaigns"),o=(0,n.querySelectorAll)(`[href^="${e}"], [href^="${i}"], [data-optin-slug]`),a=e.replace(/[.*+?^${}()|[\]\\\\/]/g,"\\$&"),c=new RegExp("^"+a+"([a-z0-9]*)\\/?"),d={};o.forEach((t=>{const[e]=r.validateLink(t);if(!e)return;const i=c.exec(e);i&&i[1]?d[i[1]]=!0:d[e]=!0})),window[s.GLOBAL_OM].monsterLinksOnPage=Object.keys(d)};static existsOnPage=t=>-1!==(window[s.GLOBAL_OM].monsterLinksOnPage||[]).indexOf(t);static initMonsterLinks=t=>{(0,n.trigger)(document,"MonsterLink.init",{MonsterLink:r}),r.disable||(void 0===window[s.GLOBAL_OM].monsterLinks&&(window[s.GLOBAL_OM].monsterLinks=[],document.addEventListener("click",(t=>{if(0!==t.button)return;const[e,i]=r.validateLink(t.target);e&&window[s.GLOBAL_OM].monsterLinks.forEach((s=>{-1!==e.indexOf(s)&&(r.loadMonsterLink(s,i)||r.isVisible(s))&&t.preventDefault()}))}),!1)),t.forEach((t=>{(0,n.inArray)(t,window[s.GLOBAL_OM].monsterLinks)||window[s.GLOBAL_OM].monsterLinks.push(t)})))};static loadMonsterLink=(t,e)=>{const i=e.getAttribute("data-mobile-slug");if(i&&o.A.isMobile()&&(t=i),!window["om"+t]||window["om"+t].hasConflict())return!1;window["om"+t].settings.monster=!0;let s=e.getAttribute("data-view");s&&(window["om"+t].view=s,window["om"+t].settings.monsterView=!0);let n=e.getAttribute("data-monster-effect");n&&(window["om"+t].settings.monsterFx=n);let r=e.getAttribute("data-sound-effect");return r&&(window["om"+t].settings.monsterSoundFx=r),window["om"+t].startShow(),document.addEventListener("om.Campaign.afterShow",(e=>{e.detail.Campaign.id===t&&e.detail.Campaign.settings.monster&&(window["om"+t].settings.monster=!1,window["om"+t].settings.monsterView=!1,window["om"+t].settings.monsterFx=!1,window["om"+t].settings.monsterSoundFx=!1)})),t};static isVisible=t=>!(!window["om"+t]||!window["om"+t].settings.visible)&&!("slide"===window["om"+t].type&&!window["om"+t].Types.Type.open)}}}]);