File Editor
Directories:
.. (Back)
css
js
Files:
131.min.js
Create New File
Create
Edit File: 131.min.js
(self.webpackChunkoptin_monster_wp_api=self.webpackChunkoptin_monster_wp_api||[]).push([[131],{7131:function(t,e,n){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.r(e),n.d(e,{default:function(){return f}});var o=n(8156),i=n.n(o);const s=[];OMAPI._usedSlugs=OMAPI._usedSlugs||{};class a extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{holder:".om-elementor-editor .om-elementor-holder",select:".om-elementor-editor select",links:".om-elementor-editor a"}}}getDefaultElements(){const t=this.getSettings("selectors");return{$holder:this.$element.find(t.holder),$select:this.$element.find(t.select),$links:this.$element.find(t.links)}}bindEvents(){window.OMAPI_Elementor.instances.push(this),this.oldSlug=this.campaignSlug(),this.campaignLoaded=!1,this.on("campaignLoaded",(()=>{this.campaignLoaded=!0,this.$element.find(".om-elementor-editor .om-errors").hide()})),this.on("otherCampaignLoaded",this.updateSelect.bind(this)),this.on("otherCampaignRemoved",this.updateSelect.bind(this)),this.on("campaignError",this.foundError.bind(this)),this.elements.$select.on("change",this.onSelect.bind(this)),this.elements.$links.on("click",this.onClickLinks.bind(this)),this.initCampaignPreview(),this.maybeTogglePanelSettings()}unbindEvents(){const t=this.getCampaign();t&&(s.push(t),t.off()),this.oldSlug&&(delete OMAPI._usedSlugs[this.oldSlug],window.OMAPI_Elementor.utils.events.trigger(document,"Plugin.Elementor.Instance.removed",{id:this.oldSlug}))}foundError(t){const e=this.campaignSlug();if(t.responseURL&&0>t.responseURL.indexOf(e))return;let n=t;t.response&&(n=JSON.parse(t.response).message||JSON.parse(t.response).error),t.message&&(n=t.message),this.$element.find(".om-elementor-editor .om-errors").show().find(".om-error-description").html(n)}onClickLinks(t){t.preventDefault(),window.open(t.target.href)}onSelect(t){t.preventDefault(),window.parent.jQuery('#elementor-controls .elementor-control-campaign_id select[data-setting="campaign_id"]').val(this.elements.$select.val()).trigger("change")}onElementChange(t,e,n){const r=e.$el.find('select[data-setting="campaign_id"]');r.length&&(a.$editorSelect=r),this.maybeTogglePanelSettings(),"campaign_id"===t&&this.initCampaignPreview()}initCampaignPreview(){this.initCampaign(),this.updateSelect()}initCampaign(){const t=this.campaignSlug();if(!t)return;this.oldSlug&&delete OMAPI._usedSlugs[this.oldSlug],this.oldSlug=t,OMAPI._usedSlugs[t]=!0,this.elements.$holder.html(`<div id="om-${t}-holder"></div>`);let e=this.getCampaign();if(e)return;if(s.length&&(e=s.find((e=>t===e.id)),e))return s.splice(s.indexOf(e),1),setTimeout((()=>e.reset()),200);if(e)return;const n={id:`om-${t}-js`,type:"text/javascript",src:OMAPI.apiUrl,async:!0,"data-user":OMAPI.omUserId,"data-campaign":t};OMAPI.omEnv&&(n["data-env"]=OMAPI.omEnv);const r=document.getElementsByTagName("head")[0]||document.documentElement,o=document.createElement("script");let i;for(i in n)o.setAttribute(i,n[i]);r.appendChild(o)}updateSelect(){this.updateSelectOptions(this.elements.$select)}updateSelectOptions(t){const e=this.campaignSlug(),n=document.createDocumentFragment();t.find("option").remove(),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&!(OMAPI.site_ids&&OMAPI.site_ids.length>0))return[];const n=i()(OMAPI,`campaigns.${t}`,{});if(Object.keys(n).length<1||!OMAPI.omUserId)return[];let r=Object.keys(n).map((t=>{let r=i()(n,`${t}.title`,"");return i()(n,`${t}.pending`)&&(r+=" [Pending]"),{value:t,label:r,selected:null!==e&&e===t,disabled:null!==e&&i()(OMAPI,`_usedSlugs.${t}`)&&t!==e}}));return r.length>0&&r.unshift({value:"",label:OMAPI.i18n.campaign_select}),r}("inline",e).forEach((t=>{const e=document.createElement("option");e.textContent=t.label,e.value=t.value,t.selected&&(e.selected=!0),t.disabled&&(e.disabled=!0),n.appendChild(e)})),t.append(n)}campaignSlug(){return this.getElementSettings("campaign_id").replace(/[^a-zA-Z0-9]/g,"")}getCampaign(){return function(){const t=`om${arguments.length>0&&void 0!==arguments[0]?arguments[0]:""}`;return window[t]?window[t]:null}(this.campaignSlug())}onEditSettingsChange(t){"panel"===t&&this.maybeTogglePanelSettings()}maybeTogglePanelSettings(){setTimeout((()=>{const t=elementor.getPanelView().getCurrentPageView(),e=this.campaignSlug();t.getControlViewByName&&["edit_campaign","followrules","campaign_id"].forEach((n=>{const r=t.getControlModel(n);if(!r)return;const o=t.getControlViewByModel(r);if(o){if("campaign_id"===n){const t=o.$el.find('[data-setting="campaign_id"]');t.length&&this.updateSelectOptions(t)}else o.$el[e?"show":"hide"]();if(e&&"edit_campaign"===n){const t=o.$el.find("a");t.length&&t.attr("href",OMAPI.editUrl.replace(/--CAMPAIGN_SLUG--/g,e))}}}))}),10)}}var u,c,l,p;u=a,l=c="$editorSelect",p=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(l),(c="symbol"==r(p)?p:String(p))in u?Object.defineProperty(u,c,{value:null,enumerable:!0,configurable:!0,writable:!0}):u[c]=null;var f=a},1549:function(t,e,n){var r=n(2032),o=n(3862),i=n(6721),s=n(2749),a=n(5749);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=s,u.prototype.set=a,t.exports=u},79:function(t,e,n){var r=n(3702),o=n(80),i=n(4739),s=n(8655),a=n(1175);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=s,u.prototype.set=a,t.exports=u},8223:function(t,e,n){var r=n(6110)(n(9325),"Map");t.exports=r},3661:function(t,e,n){var r=n(3040),o=n(7670),i=n(289),s=n(4509),a=n(2949);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=s,u.prototype.set=a,t.exports=u},1873:function(t,e,n){var r=n(9325).Symbol;t.exports=r},4932:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},6025:function(t,e,n){var r=n(5288);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},7422:function(t,e,n){var r=n(1769),o=n(7797);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},2552:function(t,e,n){var r=n(1873),o=n(659),i=n(9350),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?o(t):i(t)}},5083:function(t,e,n){var r=n(1882),o=n(7296),i=n(3805),s=n(7473),a=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,p=c.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?f:a).test(s(t))}},7556:function(t,e,n){var r=n(1873),o=n(4932),i=n(6449),s=n(4394),a=r?r.prototype:void 0,u=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(s(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},1769:function(t,e,n){var r=n(6449),o=n(8586),i=n(1802),s=n(3222);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(s(t))}},5481:function(t,e,n){var r=n(9325)["__core-js_shared__"];t.exports=r},4840:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},2651:function(t,e,n){var r=n(4218);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},6110:function(t,e,n){var r=n(5083),o=n(392);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},659:function(t,e,n){var r=n(1873),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=s.call(t);return r&&(e?t[a]=n:delete t[a]),o}},392:function(t){t.exports=function(t,e){return null==t?void 0:t[e]}},2032:function(t,e,n){var r=n(1042);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:function(t){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},6721:function(t,e,n){var r=n(1042),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},2749:function(t,e,n){var r=n(1042),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},5749:function(t,e,n){var r=n(1042);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},8586:function(t,e,n){var r=n(6449),o=n(4394),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||s.test(t)||!i.test(t)||null!=e&&t in Object(e)}},4218:function(t){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},7296:function(t,e,n){var r,o=n(5481),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},3702:function(t){t.exports=function(){this.__data__=[],this.size=0}},80:function(t,e,n){var r=n(6025),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():o.call(e,n,1),--this.size,0))}},4739:function(t,e,n){var r=n(6025);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},8655:function(t,e,n){var r=n(6025);t.exports=function(t){return r(this.__data__,t)>-1}},1175:function(t,e,n){var r=n(6025);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},3040:function(t,e,n){var r=n(1549),o=n(79),i=n(8223);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},7670:function(t,e,n){var r=n(2651);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},289:function(t,e,n){var r=n(2651);t.exports=function(t){return r(this,t).get(t)}},4509:function(t,e,n){var r=n(2651);t.exports=function(t){return r(this,t).has(t)}},2949:function(t,e,n){var r=n(2651);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},2224:function(t,e,n){var r=n(104);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},1042:function(t,e,n){var r=n(6110)(Object,"create");t.exports=r},9350:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},9325:function(t,e,n){var r=n(4840),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},1802:function(t,e,n){var r=n(2224),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)})),e}));t.exports=s},7797:function(t,e,n){var r=n(4394);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},7473:function(t){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},5288:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},8156:function(t,e,n){var r=n(7422);t.exports=function(t,e,n){var o=null==t?void 0:r(t,e);return void 0===o?n:o}},6449:function(t){var e=Array.isArray;t.exports=e},1882:function(t,e,n){var r=n(2552),o=n(3805);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},3805:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},346:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},4394:function(t,e,n){var r=n(2552),o=n(346);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},104:function(t,e,n){var r=n(3661);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},3222:function(t,e,n){var r=n(7556);t.exports=function(t){return null==t?"":r(t)}}}]);
Save Changes
Rename File
Rename