/*! Dtr - Wed, 16 Apr 2025 23:03:24 GMT */ "use strict";(self.webpackChunkom_api_js=self.webpackChunkom_api_js||[]).push([[10],{4419:function(e,t,i){i.r(t),i.d(t,{default:function(){return o}});var s=i(499),a=i(1441),r=i(3824);class o{constructor(e){this.C=e,this.init()}init(){this.global("OMCustomVariables",this.setCustomVariable),this.global("OptinMonsterCustomVariables",this),(0,r.trigger)(document,"Dtr.init",{Dtr:this,Campaign:this.C})}global=(e,t)=>{(0,r.isFunction)(window[e])&&window[e](t)};replaceCustomVars=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=t.match(/\{\{(.*?)\}\}/g);return i?((0,r.each)(i,((i,s)=>t=e.replace(s,t))),t):t}})();replace=(()=>{var e=this;return function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=t;if(!t.length)return;const o=t.replace("{{","").replace("}}","").trim().split("|"),n=void 0!==o[1]?o[1]:"",l=void 0!==o[0]?e.sanitize(o[0]):"";if((0,r.hasQueryArg)(l))i=i.replace(a,(0,r.escape)(decodeURIComponent((0,r.getQueryArg)(l))));else if(s.A.get(l))i=i.replace(a,(0,r.escape)(s.A.get(l)));else if(e.getCustomVariable(l))i=i.replace(a,(0,r.escape)(e.getCustomVariable(l)));else{if(""===n)return i=i.replace(a+" ",""),i=i.replace(a,""),i;i=i.replace(a,(0,r.escape)(n))}return i}})();sanitize(e){const t=document.createElement("div");return t.innerHTML=e,t.innerText.trim()}getCustomVariable=e=>!!this.hasCustomVariable(e)&&window[a.GLOBAL_OM].custom[e];setCustomVariable=(e,t)=>{window[a.GLOBAL_OM].custom[e]=t};getCustomVariables=()=>window[a.GLOBAL_OM].custom;hasCustomVariable=e=>(0,r.hasProp)(window[a.GLOBAL_OM].custom,e);hasCustomVariables=()=>!(0,r.empty)(this.getCustomVariables());deleteCustomVariable=e=>delete window[a.GLOBAL_OM].custom[e]}}}]);