File Editor
Directories:
.. (Back)
Files:
admin.min.js
campaign-selector.min.js
campaign-selector.min.js.LICENSE.txt
editor.min.js
elementor.min.js
global.min.js
helper.min.js
metabox.min.js
om-format.min.js
om-settings.min.js
plugininstall.min.js
wc-marketing.min.js
Create New File
Create
Edit File: campaign-selector.min.js
/*! For license information please see campaign-selector.min.js.LICENSE.txt */ !function(){var t={5580:function(t,e,n){var r=n(6110)(n(9325),"DataView");t.exports=r},1549:function(t,e,n){var r=n(2032),o=n(3862),i=n(6721),a=n(2749),s=n(5749);function c(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])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,t.exports=c},79:function(t,e,n){var r=n(3702),o=n(80),i=n(4739),a=n(8655),s=n(1175);function c(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])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,t.exports=c},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),a=n(4509),s=n(2949);function c(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])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,t.exports=c},2804:function(t,e,n){var r=n(6110)(n(9325),"Promise");t.exports=r},6545:function(t,e,n){var r=n(6110)(n(9325),"Set");t.exports=r},8859:function(t,e,n){var r=n(3661),o=n(1380),i=n(1459);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,t.exports=a},7217:function(t,e,n){var r=n(79),o=n(1420),i=n(938),a=n(3605),s=n(9817),c=n(945);function u(t){var e=this.__data__=new r(t);this.size=e.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,t.exports=u},1873:function(t,e,n){var r=n(9325).Symbol;t.exports=r},7828:function(t,e,n){var r=n(9325).Uint8Array;t.exports=r},8303:function(t,e,n){var r=n(6110)(n(9325),"WeakMap");t.exports=r},9770:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}},695:function(t,e,n){var r=n(8096),o=n(2428),i=n(6449),a=n(3656),s=n(361),c=n(7167),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),l=!n&&o(t),p=!n&&!l&&a(t),f=!n&&!l&&!p&&c(t),h=n||l||p||f,m=h?r(t.length,String):[],g=m.length;for(var d in t)!e&&!u.call(t,d)||h&&("length"==d||p&&("offset"==d||"parent"==d)||f&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||s(d,g))||m.push(d);return m}},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}},4528:function(t){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},4248:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},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}},2199:function(t,e,n){var r=n(4528),o=n(6449);t.exports=function(t,e,n){var i=e(t);return o(t)?i:r(i,n(t))}},2552:function(t,e,n){var r=n(1873),o=n(659),i=n(9350),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},7534:function(t,e,n){var r=n(2552),o=n(346);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},270:function(t,e,n){var r=n(7068),o=n(346);t.exports=function t(e,n,i,a,s){return e===n||(null==e||null==n||!o(e)&&!o(n)?e!=e&&n!=n:r(e,n,i,a,t,s))}},7068:function(t,e,n){var r=n(7217),o=n(5911),i=n(1986),a=n(689),s=n(5861),c=n(6449),u=n(3656),l=n(7167),p="[object Arguments]",f="[object Array]",h="[object Object]",m=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,g,d,v){var y=c(t),b=c(e),_=y?f:s(t),x=b?f:s(e),O=(_=_==p?h:_)==h,w=(x=x==p?h:x)==h,j=_==x;if(j&&u(t)){if(!u(e))return!1;y=!0,O=!1}if(j&&!O)return v||(v=new r),y||l(t)?o(t,e,n,g,d,v):i(t,e,_,n,g,d,v);if(!(1&n)){var E=O&&m.call(t,"__wrapped__"),S=w&&m.call(e,"__wrapped__");if(E||S){var P=E?t.value():t,A=S?e.value():e;return v||(v=new r),d(P,A,n,g,v)}}return!!j&&(v||(v=new r),a(t,e,n,g,d,v))}},5083:function(t,e,n){var r=n(1882),o=n(7296),i=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,p=u.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:s).test(a(t))}},4901:function(t,e,n){var r=n(2552),o=n(294),i=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},8984:function(t,e,n){var r=n(5527),o=n(3650),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}},8096:function(t){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},7556:function(t,e,n){var r=n(1873),o=n(4932),i=n(6449),a=n(4394),s=r?r.prototype:void 0,c=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},7301:function(t){t.exports=function(t){return function(e){return t(e)}}},9219:function(t){t.exports=function(t,e){return t.has(e)}},1769:function(t,e,n){var r=n(6449),o=n(8586),i=n(1802),a=n(3222);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},5481:function(t,e,n){var r=n(9325)["__core-js_shared__"];t.exports=r},5911:function(t,e,n){var r=n(8859),o=n(4248),i=n(9219);t.exports=function(t,e,n,a,s,c){var u=1&n,l=t.length,p=e.length;if(l!=p&&!(u&&p>l))return!1;var f=c.get(t),h=c.get(e);if(f&&h)return f==e&&h==t;var m=-1,g=!0,d=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++m<l;){var v=t[m],y=e[m];if(a)var b=u?a(y,v,m,e,t,c):a(v,y,m,t,e,c);if(void 0!==b){if(b)continue;g=!1;break}if(d){if(!o(e,(function(t,e){if(!i(d,e)&&(v===t||s(v,t,n,a,c)))return d.push(e)}))){g=!1;break}}else if(v!==y&&!s(v,y,n,a,c)){g=!1;break}}return c.delete(t),c.delete(e),g}},1986:function(t,e,n){var r=n(1873),o=n(7828),i=n(5288),a=n(5911),s=n(317),c=n(4247),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;t.exports=function(t,e,n,r,u,p,f){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!p(new o(t),new o(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var h=s;case"[object Set]":var m=1&r;if(h||(h=c),t.size!=e.size&&!m)return!1;var g=f.get(t);if(g)return g==e;r|=2,f.set(t,e);var d=a(h(t),h(e),r,u,p,f);return f.delete(t),d;case"[object Symbol]":if(l)return l.call(t)==l.call(e)}return!1}},689:function(t,e,n){var r=n(2),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,i,a,s){var c=1&n,u=r(t),l=u.length;if(l!=r(e).length&&!c)return!1;for(var p=l;p--;){var f=u[p];if(!(c?f in e:o.call(e,f)))return!1}var h=s.get(t),m=s.get(e);if(h&&m)return h==e&&m==t;var g=!0;s.set(t,e),s.set(e,t);for(var d=c;++p<l;){var v=t[f=u[p]],y=e[f];if(i)var b=c?i(y,v,f,e,t,s):i(v,y,f,t,e,s);if(!(void 0===b?v===y||a(v,y,n,i,s):b)){g=!1;break}d||(d="constructor"==f)}if(g&&!d){var _=t.constructor,x=e.constructor;_==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(g=!1)}return s.delete(t),s.delete(e),g}},4840:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},2:function(t,e,n){var r=n(2199),o=n(4664),i=n(5950);t.exports=function(t){return r(t,i,o)}},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,a=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}},4664:function(t,e,n){var r=n(9770),o=n(3345),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return i.call(t,e)})))}:o;t.exports=s},5861:function(t,e,n){var r=n(5580),o=n(8223),i=n(2804),a=n(6545),s=n(8303),c=n(2552),u=n(7473),l="[object Map]",p="[object Promise]",f="[object Set]",h="[object WeakMap]",m="[object DataView]",g=u(r),d=u(o),v=u(i),y=u(a),b=u(s),_=c;(r&&_(new r(new ArrayBuffer(1)))!=m||o&&_(new o)!=l||i&&_(i.resolve())!=p||a&&_(new a)!=f||s&&_(new s)!=h)&&(_=function(t){var e=c(t),n="[object Object]"==e?t.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return m;case d:return l;case v:return p;case y:return f;case b:return h}return e}),t.exports=_},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}},361:function(t){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},8586:function(t,e,n){var r=n(6449),o=n(4394),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\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))||a.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}},5527:function(t){var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},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}},317:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},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},3650:function(t,e,n){var r=n(4335)(Object.keys,Object);t.exports=r},6009:function(t,e,n){t=n.nmd(t);var r=n(4840),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},9350:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},4335:function(t){t.exports=function(t,e){return function(n){return t(e(n))}}},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},1380:function(t){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},1459:function(t){t.exports=function(t){return this.__data__.has(t)}},4247:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},1420:function(t,e,n){var r=n(79);t.exports=function(){this.__data__=new r,this.size=0}},938:function(t){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},3605:function(t){t.exports=function(t){return this.__data__.get(t)}},9817:function(t){t.exports=function(t){return this.__data__.has(t)}},945:function(t,e,n){var r=n(79),o=n(8223),i=n(3661);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},1802:function(t,e,n){var r=n(2224),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=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=a},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}},2428:function(t,e,n){var r=n(7534),o=n(346),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=c},6449:function(t){var e=Array.isArray;t.exports=e},4894:function(t,e,n){var r=n(1882),o=n(294);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},3656:function(t,e,n){t=n.nmd(t);var r=n(9325),o=n(9935),i=e&&!e.nodeType&&e,a=i&&t&&!t.nodeType&&t,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;t.exports=c},2404:function(t,e,n){var r=n(270);t.exports=function(t,e){return r(t,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}},294:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},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)}},7167:function(t,e,n){var r=n(4901),o=n(7301),i=n(6009),a=i&&i.isTypedArray,s=a?o(a):r;t.exports=s},5950:function(t,e,n){var r=n(695),o=n(8984),i=n(4894);t.exports=function(t){return i(t)?r(t):o(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 a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},3345:function(t){t.exports=function(){return[]}},9935:function(t){t.exports=function(){return!1}},3222:function(t,e,n){var r=n(7556);t.exports=function(t){return null==t?"":r(t)}},2694:function(t,e,n){"use strict";var r=n(6925);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},5556:function(t,e,n){t.exports=n(2694)()},6925:function(t){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6942:function(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=a(t,i(n)))}return t}function i(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)r.call(t,n)&&t[n]&&(e=a(e,n));return e}function a(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(n=function(){return o}.apply(e,[]))||(t.exports=n)}()}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},function(){"use strict";var t=React,e=n(5556),r=n.n(e);function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.defaultProps;const n={maxWidth:e.width+"px",maxHeight:e.height+"px",minWidth:e.width+"px",minHeight:e.height+"px",...e.style};return(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.width,height:e.height,viewBox:"0 0 189 159",style:n},(0,t.createElement)("path",{d:"M112.547 55.298c0 8.867-7.57 16.055-16.91 16.055-9.339 0-16.91-7.188-16.91-16.055s7.571-16.056 16.91-16.056c.955 0 1.89.075 2.802.22a8.824 8.824 0 1011.077 6.661c1.911 2.6 3.031 5.763 3.031 9.175z"}),(0,t.createElement)("path",{d:"M134.604 31.662C120.805 19.652 103.51 15.729 86.45 15.69h-.33c-10.827.008-21.55 1.57-31.216 3.619 1.185.27 2.38.529 3.58.79 5.349 1.16 10.787 2.342 15.831 4.502-8.53.884-17.35 3.825-24.997 7.65-5.002 2.35-10.294 5.882-14.412 9.704l-4.119 4.118c1.324-.155 2.627-.352 3.914-.546 3.578-.54 7.038-1.063 10.499-.631-2.941 1.764-5.883 3.825-8.53 6.472-2.648 0-5.293-.296-6.763-1.177-.892-.447-1.276-3.59-1.538-5.728-.084-.685-.155-1.268-.226-1.625-.297-3.531-4.706-5.002-7.353-3.235-4.706 3.529-7.353 9.998-7.94 15.88-.59 5.883 0 13.532 4.115 17.941 3.531 4.118 11.201 5.56 17.67 5.856 0 .294-.181 4.174-.316 4.145H33.14c-.587-1.764-2.354-3.822-4.705-3.235-2.354.587-4.705 3.235-4.999 5.295-3.53 1.47-7.06 4.116-8.236 8.527-.587 2.355-.587 5.002 0 7.06 1.47 6.766 7.646 10.587 13.529 11.765.587.293.883.293 1.47.293v6.472c-.883-.883-2.057-1.47-3.234-1.764-1.471-.59-3.529-.59-5.296-.296-1.47-1.764-3.234-2.058-4.412-1.471-.586.297-1.174 1.767-1.174 3.238-2.06.88-3.824 1.764-5.295 2.941-1.47-.59-2.941-.883-3.528-.296-.587.296-.587 1.767-.294 3.237-.392.49-.784.948-1.177 1.405-.784.914-1.57 1.829-2.354 3.007-1.174-.59-2.351-.59-2.645 0-.59.881 0 2.351.881 3.822-.293 1.177-.587 2.354-.587 3.528 0 10.294 14.706 20.885 24.117 21.178 5.585.294 11.468-2.647 14.115-7.646 37.056 1.47 74.114 1.47 111.169 0 2.648 4.999 8.234 7.94 13.823 7.646 9.704-.293 24.41-10.884 24.116-21.178 0-1.174-.293-2.351-.59-3.528.884-1.471 1.471-2.941.297-3.822-.297-.59-1.471-.59-2.648 0-.883-1.471-2.057-2.941-3.528-4.412.293-1.47.293-2.647-.297-3.237-.587-.587-1.764-.294-3.234.296-1.471-.883-3.528-2.061-5.293-2.941 0-1.471-.59-2.941-1.177-3.238-.883-.587-2.941 0-4.411 1.471-1.765-.294-3.529-.294-5.293.296-1.177.294-2.06.881-3.237 1.764v-6.472c.123 0 .296-.051.498-.11.286-.083.629-.183.972-.183 5.882-1.178 12.058-4.999 13.529-11.765.59-2.058.59-4.412 0-7.06-.881-4.705-4.705-7.056-8.234-8.527-.293-2.06-2.647-4.708-4.998-5.295-2.355-.587-4.119 1.47-4.706 3.235-.59 0-.643-3.76-.643-4.054 6.47-.293 12.995-1.829 16.523-5.947 4.119-4.409 4.706-12.058 4.119-17.94-.59-5.586-3.235-12.059-7.943-15.587-2.645-1.764-7.057 0-7.35 3.235 0 1.47-.297 6.47-1.767 7.353-2.352 1.47-7.057 1.47-10.585.883-3.238-7.943-7.943-14.706-13.825-19.707zM27.553 126.365c4.705 1.471 9.117 10.001 10.88 17.647 0 .884 0 1.765-.293 2.942-1.177 5.882-7.056 9.707-12.939 9.413-6.472-.296-15.292-5.589-19.41-12.061-.884-10.294 14.409-19.998 21.762-17.941zm123.814 17.647c1.767-7.646 6.179-16.176 10.884-17.647 7.35-2.351 22.643 7.647 21.763 17.647-4.119 6.473-13.236 11.765-19.412 12.059-5.882.296-11.764-3.528-12.938-9.411-.297-.883-.297-1.764-.297-2.648zm-43.525-14.999c13.823 3.825 25.881 10.294 37.939 17.354-33.527.88-67.348 1.177-101.465-.294 11.471-7.059 23.53-12.648 36.762-16.47a91.5 91.5 0 0011.471 4.409c.506.17.721.242.924.217.151-.018.296-.091.547-.217 4.705-1.174 9.41-2.941 13.822-4.999zm-32.056-2.351c-12.059 3.528-23.823 8.82-34.705 15.293-.251-3.029-1.153-6.271-1.96-9.174-.134-.481-.265-.954-.39-1.414-.58-1.351-1.285-2.701-2.034-4.134-.394-.752-.799-1.528-1.204-2.338V111.66c.19-.126.394-.252.602-.382.76-.471 1.585-.982 2.045-1.675 2.06-.587 4.412-1.471 5-2.941.59-1.177-.588-2.354-2.059-3.235.294-.294.294-.59.294-.884.884-.293 2.06-.88 2.648-1.177 9.41 9.707 19.117 18.531 31.763 25.297zm37.055-.297c12.255-6.419 23.353-15.155 33.58-24.771l.241-.229c.59.59 1.47.884 2.354 1.177 0 .13.056.259.12.388l.053.108c.065.13.12.259.12.388-1.47.881-2.647 1.764-2.057 3.235.88 1.177 2.941 2.647 4.999 2.941.883.883 1.764 1.764 2.647 2.354 0 4.412 0 9.117-.293 13.529-1.177 2.057-2.354 4.118-2.941 6.176-1.178 2.941-2.061 6.763-2.355 10.294-11.764-6.473-23.823-11.765-36.468-15.59zM49.32 89.456c1.093-.128 2.185-.257 3.327-.386l.493-.055c.587 2.057 1.177 4.118 2.354 5.882 3.235 5.589 14.41 11.765 14.703 2.354 1.91 4.634 11.654 3.961 16.814 3.604a236.6 236.6 0 011.127-.076l1.011-.109c4.622-.496 6.987-.749 7.812-4.596 4.115 1.177 9.998 1.177 14.409.88l.925-.072c3.16-.242 5.945-.454 7.016-2.869l.066.4c.277 1.672.589 3.556 1.404 5.19 3.531 7.059 12.058.589 15.293-10.295 2.648.294 5.589.59 8.53.884 0 .129-.056.258-.12.384l-.053.112c-.065.129-.12.258-.12.384-.294 1.177 1.177 2.354 2.647 2.941-15.589 15.296-31.176 28.825-53.232 35.001-20.588-6.763-36.468-19.411-50.88-34.704 1.764-.59 2.94-1.47 2.94-3.531 0-.294 0-.587-.293-.88a592.84 592.84 0 003.827-.443zm76.166 8.97c-2.057.883-2.644.59-2.938-1.471-.346-2.304-.601-4.608-.855-6.894-.394-3.551-.783-7.059-1.499-10.457 4.412 0 8.824 0 12.942.293-.297 5.59-2.354 15.883-7.65 18.528zm-58.23-1.765c-.294 2.354-1.47 2.354-3.235 1.47-7.056-3.234-8.824-11.47-7.353-17.94l.771-.055c3.828-.274 7.43-.532 11.287-.532-.261 2.225-.464 5.265-.661 8.214-.246 3.676-.482 7.21-.81 8.843zm6.176-17.057c6.175-.296 12.351-.296 18.824-.296.293 2.647.88 16.766-.297 17.647-4.409 1.177-13.822 1.177-17.937-.587-2.061-.884-1.178-13.823-.59-16.764zm24.706 12.939c-1.47-.88-1.47-11.765-1.47-13.236 6.175-.293 12.645-.293 18.821-.293.293 1.764 1.177 13.235-.587 13.825-3.825 1.174-13.236 1.47-16.764-.296zM20.496 45.487c1.048-1.048 2.093-1.515 2.936-1.524h.044c1.021.003 1.726.69 1.726 1.817 0 1.84.47 3.45.78 4.397 0 0 .72 1.988 1.773 2.8l.027.021c1.2.793 3.096 1.33 4.476 1.606l1.177.05-2.474 4.285 5.709-2.278c.366-.121.72-.243 1.066-.363 1.321-.456 2.535-.875 3.933-1.107-3.529 6.472-5.88 13.529-6.763 20.882-1.177 0-2.648-.003-4.119-.297-.179-.035-2.553-.522-2.63-.58l-.017-.013c-3.531-.883-6.763-2.051-8.82-4.11-.58-.577-3.242-4.09-3.236-8.823l-.008-.085c-.273-3.59.625-12.886 4.42-16.678zm148.812 0c3.496 3.786 4.684 13.056 4.42 16.664-.088 2.662-.854 6.1-3.243 9.217-1.506 1.966-4.949 3.21-8.445 3.81l-3.026.601c-1.468.294-2.645.294-3.822.294-.587-7.353-2.354-14.41-4.706-21.176h3.822c.027.021.05.044.074.065l-.012-.059.233-.014c2.409-.154 4.15-.264 5.723-1.075 1.429-.733 2.694-1.573 3.402-3.346.294-.892.874-2.65.874-4.688 0-2.06 2.354-2.647 4.706-.293zM95.491 72.544c-13.823 0-25-11.177-25-25 0-13.528 11.177-24.706 25-24.706 13.822 0 24.997 10.884 24.997 24.706 0 13.823-11.175 25-24.998 25z"}),(0,t.createElement)("path",{d:"M104.608 1C95.49-.249 85.49 3.72 81.374 12.836c14.704-7.94 29.703-5.292 41.174 7.65-.59-11.765-8.823-18.237-17.94-19.488z"}))}o.propTypes={width:r().number,height:r().number,style:r().object},o.defaultProps={width:28,height:28,style:{}};var i=o;function a(t){return a="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},a(t)}function s(t,e,n){return r=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==a(r)?r:String(r))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var r}var c=n(2404),u=n.n(c),l=n(8156),p=n.n(l);const f=()=>OMAPI.site_ids&&OMAPI.site_ids.length>0;function h(e){const{width:n,fill:r}=e;let o={...e.wrapperStyles,display:"flex",alignItems:"center",justifyContent:"center"};return(0,t.createElement)("div",{style:o,className:"om-archie-loader"},(0,t.createElement)("svg",{height:"100%",width:"100%",version:"1.1",viewBox:"0 0 50 50",style:{maxWidth:n+"px"}},(0,t.createElement)("circle",{cx:"25",cy:"25",r:"23",style:{stroke:r}}),(0,t.createElement)("path",{d:"M12.75 27.84c.3.06.83.12 1.07.42l.12.11c.36-.05.72-.05 1.08-.11-.18-.12-.36-.24-.54-.3-.36-.6-.9-.72-1.61-.78V27c-1.32-.06-2.94-.36-3.66-1.2-.84-.9-.96-2.46-.84-3.66A4.7 4.7 0 0110 18.91c.54-.36 1.44-.06 1.5.66.06.3.12 1.38.36 1.5.3.18.84.24 1.38.24a8.83 8.83 0 011.73-1.32c-.96-.12-1.91.12-2.93.24l.84-.84a15.24 15.24 0 018.03-3.54c-1.26-.54-2.64-.78-3.96-1.08 5.1-1.07 11.63-1.5 16.24 2.52 1.2 1.02 2.16 2.4 2.81 4.02.72.11 1.68.11 2.16-.18.3-.18.36-1.2.36-1.5.06-.66.96-1.02 1.5-.66.96.72 1.5 2.04 1.62 3.17.12 1.2 0 2.76-.84 3.66-.72.84-2.28 1.14-3.6 1.2v.18c-.71 0-1.31.18-1.67.78-.18.06-.36.18-.54.3.36.06.78.11 1.14.11 0-.05.06-.11.12-.11.23-.3.77-.36 1.07-.42h.24c.12-.36.48-.78.96-.66s.96.66 1.02 1.08c.72.3 1.5.77 1.68 1.73a17.55 17.55 0 01-2.15 3.67 4 4 0 01-.6.17c-.13 0-.25.06-.3.06v.86c-.28.31-.57.6-.87.9.02-.67.02-1.35.02-2-.18-.12-.36-.3-.54-.48a1.72 1.72 0 01-1.01-.6c-.12-.3.12-.48.42-.66 0-.06-.06-.12-.06-.18a1.21 1.21 0 01-.48-.24 31.57 31.57 0 01-6.9 5.1c1.65.5 3.24 1.1 4.8 1.83-.37.2-.74.4-1.12.57a25.37 25.37 0 00-4.7-1.87c-.9.42-1.85.78-2.81 1.02-.12.06-.12.06-.3 0-.78-.24-1.56-.54-2.34-.9A29 29 0 0017.7 39c-.38-.17-.76-.36-1.12-.56 1.5-.73 3.04-1.34 4.62-1.8a26.15 26.15 0 01-6.48-5.15c-.12.06-.36.18-.53.24 0 .06 0 .12-.07.18.3.18.55.42.42.66-.11.3-.6.48-1.01.6-.12.18-.36.3-.54.42v2.24c-.38-.35-.74-.72-1.08-1.1v-.84c-.12 0-.18 0-.3-.06a4.24 4.24 0 01-.57-.16 17.6 17.6 0 01-2.18-3.7 2.7 2.7 0 011.67-1.71c.06-.42.54-.96 1.02-1.08.48-.12.84.3.96.66h.24zm1.73 2.21c2.94 3.12 6.18 5.7 10.37 7.07 4.5-1.25 7.67-4.01 10.84-7.13-.3-.12-.6-.36-.53-.6 0-.06.06-.12.06-.18l-1.74-.18c-.66 2.22-2.4 3.54-3.12 2.1-.18-.36-.24-.78-.3-1.14-.24.54-.9.54-1.61.6-.9.06-2.1.06-2.94-.18-.18.84-.72.84-1.8.96-.96.06-3.23.3-3.65-.72-.06 1.92-2.34.66-3-.48-.24-.36-.36-.78-.48-1.2l-1.56.18c.06.06.06.12.06.18 0 .42-.24.6-.6.72zm16.24.54c.06.42.18.48.6.3 1.08-.54 1.5-2.63 1.56-3.77-.84-.06-1.74-.06-2.64-.06.24 1.14.3 2.33.48 3.53zm-11.92.24c.36.18.6.18.66-.3.12-.6.18-2.45.3-3.47-.84 0-1.62.06-2.46.12-.3 1.32.06 3 1.5 3.65zM24.55 27c-1.32 0-2.58 0-3.83.06-.12.6-.3 3.23.11 3.41.84.36 2.76.36 3.66.12.24-.18.12-3.05.06-3.6zm.9 0c0 .3 0 2.51.3 2.7.72.35 2.64.3 3.41.05.36-.12.18-2.45.12-2.81-1.26 0-2.57 0-3.83.06zm-11.2-4.92c-.37.06-.67.18-1.02.3l-.84.36a5.36 5.36 0 00-.36 3.54c.3.06.6.06.84.06.18-1.5.66-2.94 1.37-4.26zm22.94-.06h-.78c.48 1.38.84 2.82.96 4.32.24 0 .48 0 .78-.06.42-1.62 0-3.42-.96-4.26zm-25.7 4.14a5.3 5.3 0 01.84-4.2c-.3-.06-.72-.18-.96-.36-1.26.36-1.86 1.8-1.98 3.24.12.18.18.36.3.48.42.42 1.08.66 1.8.84zm27.26 0a3.34 3.34 0 001.74-.78c.12-.12.24-.3.3-.48-.06-1.44-.66-2.82-1.98-3.24-.24.24-.6.3-.96.36.9.96 1.14 2.7.9 4.14zm-18.63-5.63a5.09 5.09 0 1010.18 0 5.04 5.04 0 00-5.09-5.04 5.08 5.08 0 00-5.1 5.04zm5.15-1.62c-.48 0-.96.06-1.38.24.6.18 1.08.78 1.08 1.44 0 .83-.72 1.55-1.68 1.55-.6 0-1.14-.3-1.44-.78-.06.24-.06.48-.06.78 0 1.8 1.56 3.24 3.42 3.24 1.92 0 3.47-1.44 3.47-3.24.06-1.8-1.5-3.23-3.41-3.23zm-14.2 2.22c-.06-.18-.18-.54-.18-.96 0-.42-.48-.54-.96-.06-.78.78-.96 2.7-.9 3.41.3-.9.9-1.92 2.04-2.4zm28.04 0a3.78 3.78 0 012.04 2.4c.06-.73-.18-2.64-.9-3.42-.48-.48-.96-.36-.96.06s-.12.78-.18.96zm-16.78-7.67c1.68-3.72 8.15-3.24 8.4 1.55-2.34-2.63-5.4-3.17-8.4-1.55z",fill:r})))}h.propTypes={fill:r().string,width:r().number,wrapperStyles:r().string},h.defaultProps={fill:"#858b98",width:100};var m=h;const{InspectorControls:g}=wp.blockEditor,{SelectControl:d,ToggleControl:v,PanelBody:y}=wp.components;function b(e){const{slug:n,options:r,followrules:o,onSelectCampaign:i,onToggleFollowRules:a}=e;return r.length>0||n?(0,t.createElement)(g,{key:"optinmonster-gutenberg-campaign-selector-inspector-controls"},(0,t.createElement)(y,{title:OMAPI.i18n.block_settings},(0,t.createElement)(d,{label:OMAPI.i18n.campaign_selected,value:n,options:r,onChange:i}),n?(0,t.createElement)(v,{label:OMAPI.i18n.followrules_label,help:(()=>{const e=OMAPI.i18n.followrules_help.replace("%s",""),r=OMAPI.outputSettingsUrl.replace("%s",n);return(0,t.createElement)("span",null,(0,t.createElement)("span",{dangerouslySetInnerHTML:{__html:e}})," ",(0,t.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:r,className:"skip-om-trigger"},OMAPI.i18n.output_settings),".")})(),checked:!!o,onChange:()=>{a(!o)}}):null)):null}b.propTypes={slug:r().string,options:r().array,followrules:r().bool,onSelectCampaign:r().func,onToggleFollowRules:r().func},b.defaultProps={slug:"",options:[],followrules:!1,onSelectCampaign:()=>{},onToggleFollowRules:()=>{}};var _=b,x=n(6942),O=n.n(x);const{Button:w}=wp.components;function j(e){return(0,t.createElement)("form",{className:"optinmonster-gutenberg-campaign-selector-no_campaigns",onSubmit:t=>{t.preventDefault(),window.open(OMAPI.templatesUri+"&type=inline","_blank")}},e.children,(0,t.createElement)("p",{className:"optinmonster-gutenberg-campaign-selector-no_campaigns-help"},OMAPI.i18n.no_campaigns_help),(0,t.createElement)("p",{className:"optinmonster-gutenberg-campaign-selector-no_campaigns-button"},(0,t.createElement)(w,{isPrimary:!0,variant:"primary",type:"submit"},OMAPI.i18n.create_inline_campaign)),(0,t.createElement)("p",{className:"optinmonster-gutenberg-campaign-selector-no_campaigns-button-help"},(0,t.createElement)(w,{isTertiary:!0,href:"https://optinmonster.com/docs/getting-started-optinmonster-wordpress-checklist/?utm_source=plugin&utm_medium=link&utm_campaign=gutenbergblock",target:"_blank",rel:"noopener"},OMAPI.i18n.no_campaigns_button_help)))}j.propTypes={children:r().node};var E=j;const{Button:S}=wp.components;function P(e){return(0,t.createElement)("form",{className:"optinmonster-gutenberg-campaign-selector-no_sites"},e.children,(0,t.createElement)("div",{className:"optinmonster-gutenberg-campaign-selector-no_sites-button"},(0,t.createElement)(S,{isTertiary:!0,href:OMAPI.wizardUri,target:"_blank",rel:"noopener"},OMAPI.i18n.no_sites_button_create_account),"or",(0,t.createElement)(S,{isTertiary:!0,href:OMAPI.settingsUri+"#connect",target:"_blank",rel:"noopener"},OMAPI.i18n.no_sites_button_connect_account)))}P.propTypes={children:r().node};var A=P;const{Button:M,SelectControl:I,Placeholder:z}=wp.components;function C(e){const{slug:n,hasSites:r,options:o,onSelectCampaign:i}=e,a=o.length>0;let s=OMAPI.i18n.campaign_select_display,c=null;r?a||(c=(0,t.createElement)(E,null),s=OMAPI.i18n.no_inline_campaigns):(c=(0,t.createElement)(A,null),s=OMAPI.i18n.no_sites);!c&&a&&(c=(0,t.createElement)("div",{className:"components-placeholder__fieldset-wrapper"},(0,t.createElement)("div",{className:"components-placeholder__fieldset-fields"},(0,t.createElement)(I,{key:"optinmonster-gutenberg-campaign-selector-select-control",value:n,options:o,onChange:i}),(0,t.createElement)("form",{onSubmit:t=>{t.preventDefault();const{submitter:e}=t.nativeEvent,n=e&&e.name?e.name:"inline";window.open(`${OMAPI.templatesUri}&type=${n}`,"_blank")}},(0,t.createElement)(M,{name:"popup",type:"submit",isSecondary:!0,isSmall:!0},OMAPI.i18n.create_new_popup),(0,t.createElement)(M,{name:"inline",type:"submit",isSecondary:!0,isSmall:!0},OMAPI.i18n.create_new_inline)))));const u={"optinmonster-gutenberg-campaign-selector-no_campaigns":!a,"optinmonster-gutenberg-campaign-selector-no_sites":!r};return(0,t.createElement)(z,{key:"optinmonster-gutenberg-campaign-selector-wrap",className:O()("optinmonster-gutenberg-campaign-selector-wrap",u),icon:(0,t.createElement)("img",{src:OMAPI.logoUrl,alt:"OptinMonster Logo"}),label:"OptinMonster",instructions:s},c)}C.propTypes={slug:r().string,hasSites:r().bool,options:r().array,onSelectCampaign:r().func},C.defaultProps={slug:"",hasSites:!0,options:[],onSelectCampaign:()=>{}};var T=C;const{Component:k,Fragment:U}=wp.element,L=[];OMAPI._usedSlugs=OMAPI._usedSlugs||{};class N extends k{constructor(e){var n;super(e),n=this,s(this,"maybeUpdateOptions",(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t&&(OMAPI._usedSlugs[t]=!0),e&&e!==t&&delete OMAPI._usedSlugs[e];const r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&!f())return[];const n=p()(OMAPI,`campaigns.${t}`,{});if(Object.keys(n).length<1||!OMAPI.omUserId)return[];let r=Object.keys(n).map((t=>{let r=p()(n,`${t}.title`,"");return p()(n,`${t}.pending`)&&(r+=" [Pending]"),{value:t,label:r,selected:null!==e&&e===t,disabled:null!==e&&p()(OMAPI,`_usedSlugs.${t}`)&&t!==e}}));return r.length>0&&r.unshift({value:"",label:OMAPI.i18n.campaign_select}),r}("inline",t);u()(r,n.state.options)||n.setState({options:r})})),s(this,"setAsPreview",(t=>{t.detail.Campaign.preview=!0})),s(this,"loadingStop",(t=>{this.slug()===t.detail.Campaign.id&&this.setState({loading:!1,hasError:!1})})),s(this,"foundError",(t=>{const{Campaign:e,error:n}=t.detail,r=this.slug();if(e&&r!==e.id)return;if(n.responseURL&&0>n.responseURL.indexOf(r))return;let o=n;n.response&&(o=JSON.parse(n.response).message||JSON.parse(n.response).error),n.message&&(o=n.message),this.setState({loading:!1,hasError:o})})),s(this,"fetch",(()=>{this.setState({loading:!0,hasError:!1});const t=this.slug(),e={type:"text/javascript",src:OMAPI.apiUrl,async:!0,"data-user":OMAPI.omUserId,"data-campaign":t};OMAPI.omEnv&&(e["data-env"]=OMAPI.omEnv),this.setState({embed:e})})),s(this,"getSlug",(t=>{const{attributes:{slug:e=""}}=t;return e})),s(this,"slug",(()=>this.getSlug(this.props))),s(this,"campaign",(()=>function(){const t=`om${arguments.length>0&&void 0!==arguments[0]?arguments[0]:""}`;return window[t]?window[t]:null}(this.slug()))),s(this,"getOutput",(()=>{const e=this.slug(),{embed:n}=this.state;let r=this.campaign();if(!r&&(L.length&&(r=L.find((t=>e===t.id)),r&&(L.splice(L.indexOf(r),1),r.reset())),!r&&n&&Object.keys(n).length>0)){const t=document.getElementsByTagName("head")[0]||document.documentElement,e=document.createElement("script");let r;for(r in n)e.setAttribute(r,n[r]);t.appendChild(e)}return(0,t.createElement)("div",{key:`om-${e}-holder`,id:`om-${e}-holder`})})),this.props=e,this.state={embed:{},loading:!1,hasError:null,options:[],prevSlug:""}}componentDidMount(){document.addEventListener("om.Campaign.init",this.setAsPreview),document.addEventListener("om.Campaign.afterShow",this.loadingStop),document.addEventListener("om.Main.getCampaigns.error",this.foundError),document.addEventListener("om.Campaign.show.error",this.foundError),document.addEventListener("om.Campaign.load.error",this.foundError);const t=this.slug();t&&this.fetch(),this.maybeUpdateOptions(t)}componentWillUnmount(){const t=this.campaign();t&&L.push(t),this.slug()&&delete OMAPI._usedSlugs[this.slug()],document.removeEventListener("om.Campaign.init",this.setAsPreview),document.removeEventListener("om.Campaign.afterShow",this.loadingStop),document.removeEventListener("om.Main.getCampaigns.error",this.foundError),document.removeEventListener("om.Campaign.show.error",this.foundError),document.removeEventListener("om.Campaign.load.error",this.foundError)}componentDidUpdate(t,e){const n=this.slug(),r=this.getSlug(t);if(this.maybeUpdateOptions(n,r),!n||r===n)return;const o=this.campaign();this.setState({loading:!0,hasError:!1}),o?(o.reset(),OMAPI._usedSlugs[n]&&delete OMAPI._usedSlugs[n]):(this.fetch(),OMAPI._usedSlugs[n]=!0)}render(){const{attributes:{slug:e="",followrules:n},setAttributes:r}=this.props,{embed:o,hasError:i}=this.state,a=t=>r({slug:t}),s=e&&(!o||this.state.loading);return(0,t.createElement)(U,null,(0,t.createElement)(_,{slug:e,options:this.state.options,followrules:n,onSelectCampaign:a,onToggleFollowRules:t=>r({followrules:t})}),!i&&s&&(0,t.createElement)(m,null),(()=>{if(!i)return null;let n=OMAPI.i18n.found_error;return e&&-1===i.indexOf(e)&&(n=(0,t.createElement)(U,null,n," ",(0,t.createElement)("code",null,(0,t.createElement)("small",null,e)))),(0,t.createElement)("p",{className:"error"},(0,t.createElement)("strong",null,n,":")," ",i)})(),o&&e?this.getOutput():(0,t.createElement)(T,{slug:e,hasSites:f(),options:this.state.options,onSelectCampaign:a}))}}N.propTypes={attributes:r().object,setAttributes:r().func};var $=N;const{__:F}=wp.i18n;wp.blocks.registerBlockType("optinmonster/campaign-selector",(()=>{const t=parseFloat(OMAPI.wpVersion),e={icon:i,edit:$,save(){return null}},n={title:OMAPI.i18n.title,description:OMAPI.i18n.description,category:"embed",keywords:[F("Popup","optin-monster-api"),F("Form","optin-monster-api"),F("Campaign","optin-monster-api"),F("Email","optin-monster-api"),F("Conversion","optin-monster-api")],attributes:{slug:{type:"string"},followrules:{type:"boolean",default:!0}}};return t>=5.8?e:Object.assign(e,n)})())}()}();
Save Changes
Rename File
Rename