File Editor
Directories:
.. (Back)
Files:
admin.min.js
campaign-selector.min.js
campaign-selector.min.js.LICENSE.txt
editor.min.js
elementor.min.js
elementor.min.js.LICENSE.txt
global.min.js
helper.min.js
metabox.min.js
om-format.min.js
om-format.min.js.LICENSE.txt
om-settings.min.js
plugininstall.min.js
trustpulse.min.js
wc-marketing.min.js
Create New File
Create
Edit File: om-format.min.js
!function(){var t={6617:function(t){"use strict";t.exports=function(t,e){var n;if(t===e)return!0;if(t.length!==e.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}},6991:function(t,e,n){"use strict";var r=n(7663),o=n(6617),i=Array.isArray;t.exports=function(t,e){if(t&&e){if(t.constructor===Object&&e.constructor===Object)return r(t,e);if(i(t)&&i(e))return o(t,e)}return t===e},t.exports.isShallowEqualObjects=r,t.exports.isShallowEqualArrays=o},7663:function(t){"use strict";var e=Object.keys;t.exports=function(t,n){var r,o,i,c,s;if(t===n)return!0;if(r=e(t),o=e(n),r.length!==o.length)return!1;for(i=0;i<r.length;){if(void 0===(s=t[c=r[i]])&&!n.hasOwnProperty(c)||s!==n[c])return!1;i++}return!0}},1549:function(t,e,n){var r=n(2032),o=n(3862),i=n(6721),c=n(2749),s=n(5749);function a(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])}}a.prototype.clear=r,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=c,a.prototype.set=s,t.exports=a},79:function(t,e,n){var r=n(3702),o=n(80),i=n(4739),c=n(8655),s=n(1175);function a(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])}}a.prototype.clear=r,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=c,a.prototype.set=s,t.exports=a},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),c=n(4509),s=n(2949);function a(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])}}a.prototype.clear=r,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=c,a.prototype.set=s,t.exports=a},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),c=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":c&&c in Object(t)?o(t):i(t)}},5083:function(t,e,n){var r=n(1882),o=n(7296),i=n(3805),c=n(7473),s=/^\[object .+?Constructor\]$/,a=Function.prototype,u=Object.prototype,p=a.toString,l=u.hasOwnProperty,f=RegExp("^"+p.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?f:s).test(c(t))}},7556:function(t,e,n){var r=n(1873),o=n(4932),i=n(6449),c=n(4394),s=r?r.prototype:void 0,a=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(c(e))return a?a.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),c=n(3222);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(c(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,c=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=c.call(t);return r&&(e?t[s]=n:delete t[s]),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)\]/,c=/^\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))||c.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,c=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=c},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 c=t.apply(this,r);return n.cache=i.set(o,c)||i,c};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)}},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,c){if(c!==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"}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),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)},function(){"use strict";function t(e){return t="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},t(e)}function e(e,n,r){return o=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n),(n="symbol"==t(o)?o:String(o))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e;var o}var r=React,o=n(5556),i=n.n(o),c=n(8156),s=n.n(c);const a=()=>OMAPI.site_ids&&OMAPI.site_ids.length>0;function u(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.defaultProps;const e={maxWidth:t.width+"px",maxHeight:t.height+"px",minWidth:t.width+"px",minHeight:t.height+"px",...t.style};return(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,viewBox:"0 0 189 159",style:e},(0,r.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,r.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,r.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"}))}u.propTypes={width:i().number,height:i().number,style:i().object},u.defaultProps={width:28,height:28,style:{}};var p=u;const{Button:l}=wp.components;function f(t){return(0,r.createElement)("form",{className:"optinmonster-gutenberg-campaign-selector-no_sites"},t.children,(0,r.createElement)("div",{className:"optinmonster-gutenberg-campaign-selector-no_sites-button"},(0,r.createElement)(l,{isTertiary:!0,href:OMAPI.wizardUri,target:"_blank",rel:"noopener"},OMAPI.i18n.no_sites_button_create_account),"or",(0,r.createElement)(l,{isTertiary:!0,href:OMAPI.settingsUri+"#connect",target:"_blank",rel:"noopener"},OMAPI.i18n.no_sites_button_connect_account)))}f.propTypes={children:i().node};var h=f;const{Button:m}=wp.components;function v(t){const e=OMAPI.upgradeUri.replace("--FEATURE--",t.feature);return(0,r.createElement)("div",{className:"optinmonster-gutenberg-upgrade"},(0,r.createElement)("p",{className:"optinmonster-gutenberg-upgrade-help"},OMAPI.i18n[t.helpI18nKey]),(0,r.createElement)("p",{className:"optinmonster-gutenberg-upgrade-button"},(0,r.createElement)(m,{isSecondary:!0,href:e,target:"_blank",rel:"noopener"},OMAPI.i18n.upgrade)))}v.propTypes={feature:i().string,helpI18nKey:i().string};var g=v,d=n(6991),y=n.n(d);const{RichTextToolbarButton:_}=wp.blockEditor,{Button:b,Popover:x,SelectControl:O}=wp.components,{Fragment:w,Component:A}=wp.element,{applyFormat:P,removeFormat:E}=wp.richText,{getRectangleFromRange:j}=wp.dom;class M extends A{constructor(t){super(t),e(this,"getSelectedCampaign",(()=>{const{isActive:t,activeAttributes:e}=this.props;return t&&e&&e["data-slug"]?e["data-slug"]:""})),e(this,"showPopup",(()=>{this.setState({showPopup:!0})})),e(this,"hideAndReset",(()=>{this.setState({showPopup:!1,anchorRect:null})})),e(this,"getAnchorRect",(()=>{if(this.state.anchorRect)return this.state.anchorRect;const{isActive:t}=this.props,e=window.getSelection(),n=""===e.toString();if(!(e.rangeCount>0)||n&&!t)return this.hideAndReset(),new DOMRect(0,0,0,0);const r=e.getRangeAt(0);if(n&&"#text"!==s()(r,"commonAncestorContainer.nodeName"))return new DOMRect(0,0,0,0);const o=j(r);return this.setState({anchorRect:o}),o})),e(this,"onSelectCampaign",(t=>{if(!t)return this.removeFormatting();var e;this.props.onChange(P(this.props.value,{type:"optinmonster/om-format",attributes:{url:(e=t,OMAPI.monsterlink+e+"/"),target:"_blank",rel:"noopener noreferrer","data-slug":t}}))})),e(this,"onClickButton",(()=>{const{isActive:t}=this.props;this[t?"removeFormatting":"showPopup"]()})),e(this,"removeFormatting",(()=>{this.props.onChange(E(this.props.value,"optinmonster/om-format")),this.hideAndReset()})),e(this,"renderPopupContent",(()=>{if(!a())return(0,r.createElement)(h,null,(0,r.createElement)("h3",{style:{margin:"0 0 1em 0"}},OMAPI.i18n.not_connected));if(!OMAPI.canMonsterlink)return(0,r.createElement)(g,{feature:"monster-link",helpI18nKey:"upgrade_monsterlink"});const t=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&!a())return[];const n=s()(OMAPI,`campaigns.${t}`,{});if(Object.keys(n).length<1||!OMAPI.omUserId)return[];let r=Object.keys(n).map((t=>{let r=s()(n,`${t}.title`,"");return s()(n,`${t}.pending`)&&(r+=" [Pending]"),{value:t,label:r,selected:null!==e&&e===t,disabled:null!==e&&s()(OMAPI,`_usedSlugs.${t}`)&&t!==e}}));return r.length>0&&r.unshift({value:"",label:OMAPI.i18n.campaign_select}),r}("other");if(0===t.length)return(0,r.createElement)(w,null,(0,r.createElement)("p",{style:{margin:"1em 1em 0.5em"}},OMAPI.i18n.no_campaigns_yet),(0,r.createElement)("p",{style:{margin:"0 1em 1.1em"}},(0,r.createElement)("a",{className:"optinmonster-format-campaign-selector-no-campaigns",href:OMAPI.templatesUri+"&type=popup",target:"_blank",rel:"noopener noreferrer"},OMAPI.i18n.create_popup_campaign)));const e=this.getSelectedCampaign(),n=this.props.isActive?OMAPI.i18n.update_selected_popup:OMAPI.i18n.open_popup;return(0,r.createElement)(w,null,(0,r.createElement)("p",{style:{marginTop:"0"}},n),(0,r.createElement)(O,{key:"optinmonster-format-campaign-selector-select-control",value:e,options:t,onChange:this.onSelectCampaign}),this.props.isActive&&(0,r.createElement)(b,{style:{marginTop:"5px"},isLink:!0,onClick:this.removeFormatting},OMAPI.i18n.remove_popup))})),e(this,"render",(()=>{const{isActive:t}=this.props,e=(0,r.createElement)(p,{width:24,height:24,style:{padding:"2px"}});return(0,r.createElement)(w,null,(0,r.createElement)(_,{icon:e,title:t?OMAPI.i18n.remove_popup:OMAPI.i18n.open_popup,isActive:t,onClick:this.onClickButton}),this.state.showPopup&&(0,r.createElement)(x,{className:"om-format-popover",getAnchorRect:this.getAnchorRect,position:"bottom center",focusOnMount:"container",onClose:this.hideAndReset,noArrow:!1},this.renderPopupContent()))})),this.state={showPopup:!1,anchorRect:null}}shouldComponentUpdate(t,e){return!y()(t.activeAttributes,this.props.activeAttributes)||t.isActive!==this.props.isActive||e.showPopup!==this.state.showPopup}componentDidUpdate(t,e){this.props.isActive&&!this.state.showPopup&&(document.activeElement&&document.activeElement.closest(".block-editor-block-toolbar")||this.showPopup())}}M.propTypes={isActive:i().bool,activeAttributes:i().object,onChange:i().func,value:i().object};var S=M;wp.richText.registerFormatType("optinmonster/om-format",{title:OMAPI.i18n.open_popup,tagName:"a",className:"om-format",attributes:{url:"href",target:"target",rel:"rel","data-slug":"data-slug"},edit:S})}()}();
Save Changes
Rename File
Rename