- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 line
31 KiB
JavaScript
Executable File
1 line
31 KiB
JavaScript
Executable File
(window.webpackJsonp=window.webpackJsonp||[]).push([[84],{1483:function(t,e,r){"use strict";r.r(e);var n=r(0),o=r(1),a=r(1065),i=r(344),c=function(t){var e=t.metrics,r=(0,a.a.getEmailAnalyticsLoading)();return Object(n.createElement)("div",{className:"bwf-crm-emails-report-tiles"},Object(n.createElement)(i.a,{items:e,title:Object(o.__)("Overview","wp-marketing-automations"),isLoading:r}))},u=r(340),l=r(24),s=r(2),f=r(5),p=r(6),m=r.n(p),y=r(12);function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return b(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var v=function(t){var e=t.query,r=t.metrics,i=e.chart?e.chart:"email_sents",c=a.a.getEmailAnalyticsLoading,p=a.a.getEmailAnalytics,b=c(),v=p(),d=h(Object(n.useState)(r[0]),2),g=d[0],w=d[1],O=Object(l.h)(e),j=Object(l.d)(function(t){return t.period&&null!=t.period&&""!=t.period||(t.period="month"),t.compare&&null!=t.compare&&""!=t.compare||(t.compare="previous_year"),t}(e));j.includes(O)||(O=j[j.length-1]);return Object(n.createElement)(u.a,{isRequesting:b,data:function(t){var e=[];v&&v.hasOwnProperty("intervals")&&v.intervals.map((function(r){"email_sents"===t&&e.push({date:r.start_date,email_sents:{label:Object(o.__)("SMS Sent","wp-marketing-automations"),value:parseInt(r.subtotals.email_sents)}}),"email_click"===t&&e.push({date:r.start_date,email_click:{label:Object(o.__)("SMS Clicks","wp-marketing-automations"),value:parseInt(r.subtotals.email_click)}}),"total_orders"===t&&e.push({date:r.start_date,total_orders:{label:Object(o.__)("Total Orders","wp-marketing-automations"),value:parseInt(r.subtotals.total_orders)}}),"total_revenue"===t&&e.push({date:r.start_date,total_revenue:{label:Object(o.__)("Total Revenue","wp-marketing-automations"),value:parseInt(r.subtotals.total_revenue)}})}));return e}(i),title:Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:""},Object(o.__)("Performance","wp-marketing-automations"))),interval:O,layout:"item-comparison",interactiveLegend:!0,chartType:"curve-line",chartMeta:g,tabs:r,hideTypeSelect:!0,customHeaderItem:Object(n.createElement)(n.Fragment,null,r&&Object(s.isArray)(r)&&Object(n.createElement)("div",{className:"bwf-chart-tabs"},r.filter((function(t){return"convert_time"!==t.key})).map((function(t){return Object(n.createElement)(f.Button,{className:m()({"is-gray-light":g.key!==t.key,"is-secondary-light":g.key===t.key}),key:t.key,onClick:function(r){w(t),r.preventDefault(),delete e.compare,Object(y.l)({chart:t.key},"/",e)}},t.title)}))))})},d=r(3),g=r(355),w=r(366),O=r(63),j=r.n(O),_=r(9),E=r.n(_),k=r(17),S=r(35),L=r.n(S);function P(t){return(P="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)}function x(){x=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="executing",y="completed",h={};function b(){}function v(){}function d(){}var g={};l(g,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(T([])));O&&O!==r&&n.call(O,i)&&(g=O);var j=d.prototype=b.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==P(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=S(c,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function S(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,h;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(P(e)+" is not iterable")}return v.prototype=d,o(j,"constructor",{value:d,configurable:!0}),o(d,"constructor",{value:v,configurable:!0}),v.displayName=l(d,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new E(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function A(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=P(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==P(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var N=T(T({},w.a),{options:function(t){return(e=x().mark((function t(e){var r,n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!j()(e)){t.next=2;break}return t.abrupt("return",[]);case 2:return r={search:e,type:1,mode:2,limit:5,offset:0},t.next=5,E()({path:Object(d.A)("/analytics/engagements/search?"+Object(k.stringify)(r)),method:"GET"});case 5:return n=t.sent,o=L()(n,"result")?n.result.map((function(t){return{key:t.id,name:t.title,label:t.title}})):[],t.abrupt("return",o);case 8:case"end":return t.stop()}}),t)})),r=function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(t){A(a,n,o,i,c,"next",t)}function c(t){A(a,n,o,i,c,"throw",t)}i(void 0)}))},function(t){return r.apply(this,arguments)})(t);var e,r}});function Y(t){return(Y="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)}function I(){I=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,i=Object.create(a.prototype),c=new x(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="executing",y="completed",h={};function b(){}function v(){}function d(){}var g={};l(g,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(A([])));O&&O!==r&&n.call(O,i)&&(g=O);var j=d.prototype=b.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Y(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=S(c,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function S(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,h;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Y(e)+" is not iterable")}return v.prototype=d,o(j,"constructor",{value:d,configurable:!0}),o(d,"constructor",{value:v,configurable:!0}),v.displayName=l(d,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new E(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function F(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function G(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?G(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Y(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var U=C(C({},r(1223).a),{options:function(t){return(e=I().mark((function t(e){var r,n,o;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!j()(e)){t.next=2;break}return t.abrupt("return",[]);case 2:return r={search:e,type:2,mode:2,limit:5,offset:0},t.next=5,E()({path:Object(d.A)("/analytics/engagements/search?"+Object(k.stringify)(r)),method:"GET"});case 5:return n=t.sent,o=L()(n,"result")?n.result.map((function(t){return{key:t.id,name:t.title,label:t.title}})):[],t.abrupt("return",o);case 8:case"end":return t.stop()}}),t)})),r=function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(t){F(a,n,o,i,c,"next",t)}function c(t){F(a,n,o,i,c,"throw",t)}i(void 0)}))},function(t){return r.apply(this,arguments)})(t);var e,r}});function H(t){return(H="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)}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){$(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=H(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==H(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return J(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Q=function(t){var e=t.query,r=t.children,a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(e.hasOwnProperty("filter")){var r=0;return"broadcast"==e.filter?r=2:"automation"==e.filter&&(r=1),E()({path:Object(d.A)("/analytics/entity/data/?type=".concat(r,"&oid=").concat(t)),method:"GET"}).then((function(t){return 200==t.code&&t.hasOwnProperty("result")?[{key:t.result.id,label:t.result.title}]:[]}))}},i=[{staticParams:["page","path","period","chart","chartType"],param:"filter",showFilters:function(){return!0},filters:[{label:Object(o.__)("All SMS","wp-marketing-automations"),value:"all"}]}];if(Object(d.ac)()){var c=[{label:Object(o.__)("Single Automation","wp-marketing-automations"),value:"select_automation",subFilters:[{component:"Search",value:"automation",path:["select_automation"],autocompleter:N,settings:{type:"custom",param:"id",selected:!0,getLabels:a,labels:{placeholder:Object(o.__)("Type to search for a automation","wp-marketing-automations"),button:Object(o.__)("Automation","wp-marketing-automations")}}}]},{label:Object(o.__)("Single Broadcast","wp-marketing-automations"),value:"select_broadcast",subFilters:[{component:"Search",value:"broadcast",path:["select_broadcast"],autocompleter:U,settings:{type:"custom",param:"id",getLabels:a,labels:{placeholder:Object(o.__)("Type to search for a broadcast","wp-marketing-automations"),button:Object(o.__)("Broadcast","wp-marketing-automations")}}}]}];i[0].filters=[].concat(z(i[0].filters),c)}return Object(n.createElement)("div",{className:"bwf-crm-emails-report-filter"},r,Object(n.createElement)(g.a,{siteLocale:"en-US",path:"/",query:e,filterTitle:Object(o.__)("Email","wp-marketing-automations"),filters:i,onDateSelect:function(t){var r=B(B({},e),t);delete r.compare,Object(y.l)(r,"/",{})},showDatePicker:!0,isoDateFormat:l.j,hideCompare:!0,dateQuery:function(t){t.compare="previous_year";var e=Object(l.g)(t),r=e.period,n=e.compare,o=e.before,a=e.after,i=Object(l.e)(t);return{period:r,compare:n,before:o,after:a,primaryDate:i.primary,secondaryDate:i.secondary}}(e),currency:Object(d.zb)()}))},K=r(1092),V=r(1093),W=r(47),X=r(70),Z=r(146),tt=r(1067),et=r(1094);function rt(t){return function(t){if(Array.isArray(t))return nt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return nt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}e.default=function(){var t=Object(W.a)(Object(d.zb)()).formatAmount,e=Object(K.a)(),r=e.fetchEmailAnalytics,i=e.fetchEmailTable,u=e.setEmailTableData,f=e.setEmailAnalyticsData;Object(V.a)("sms",!1,"");var p=Object(y.i)(),m=function(t){return t.compare="previous_year",Object(l.e)(t).primary};p.hasOwnProperty("period")||(p.period="month");var h=a.a.getEmailTableLoading,b=a.a.getEmailTableLimit,g=a.a.getEmailTableOffset,w=a.a.getEmailTablePage,O=a.a.getEmailTableList,j=a.a.getEmailTableTotal,_=a.a.getEmailAnalytics,E=h(),k=g(),S=b(),L=w(),P=O(),x=j(),A=p.period,M=p.compare,T=p.interval,D=p.after,N=p.before,Y=p.id,I=p.filter,F=_(),G=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,c=m(t),u="",l="";c&&(Object(s.isEmpty)(c.after)||(u=c.after.format("YYYY-MM-DD HH:mm:ss")),Object(s.isEmpty)(c.before)||(l=c.before.format("YYYY-MM-DD 23:59:59")),Object(s.isEmpty)(u)||Object(s.isEmpty)(l)||(n&&r(u,l,e,Y,I,2),i(o,a,u,l,e,Y,I,2)))};Object(n.useEffect)((function(){if(Object(d.m)(Object(o.__)("SMS Analytics","wp-marketing-automations")),Object(d.ac)()){var t=p.hasOwnProperty("interval")?p.interval:"day";G(p,t,!0,S,k)}else{for(var e=m(p),r=0,n=0,a=0,i=0,c=[],l=e.after;l.isBefore(e.before);l.add(1,"days")){var s=Math.floor(11*Math.random()),y=Math.floor(Math.random()*parseInt(s)),h=Math.floor(Math.random()*parseInt(y)),b=Math.floor(100*Math.random());c.push({date_end_gmt:l.format("YYYY-MM-DD")+" 23:59:59",date_start_gmt:l.format("YYYY-MM-DD")+" 00:00:00",end_date:l.format("YYYY-MM-DD")+" 23:59:59",interval:l.format("YYYY-MM-DD"),start_date:l.format("YYYY-MM-DD")+" 00:00:00",subtotals:{click_rate:(y/s*100).toFixed(2),email_click:y,email_sents:s,total_orders:h,total_revenue:b}}),r+=s,n+=y,a+=h,i+=b}f("data",{totals:{click_rate:(n/r*100).toFixed(2),email_click:n,email_sents:r,total_orders:a,total_revenue:i},intervals:c}),f("isLoading",!1),u("data",[{click_count:n,click_rate:(n/r*100).toFixed(2),conversions:a,oid:"5",revenue:i,sent:r,subject:Object(o.__)("Dummy Message","wp-marketing-automations"),template:"",tid:"52",title:Object(o.__)("Dummy SMS","wp-marketing-automations"),type:"1"}]),u("isLoading",!1)}}),[A,M,T,D,N,Y,I]);var C,q=[{key:"message",label:Object(o.__)("Message","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-360 bwf-max-w-400"},{key:"source",label:Object(o.__)("Source","wp-marketing-automations"),isLeftAligned:!1},{key:"sent",label:Object(o.__)("Sent","wp-marketing-automations"),isLeftAligned:!0,isNumeric:!0},{key:"click",label:Object(o.__)("Click","wp-marketing-automations"),isLeftAligned:!1,isNumeric:!0},Object(d.qc)()?{key:"orders",label:Object(o.__)("Orders","wp-marketing-automations"),isLeftAligned:!0}:{},Object(d.qc)()?{key:"revenue",label:Object(o.__)("Revenue","wp-marketing-automations"),isLeftAligned:!1,isNumeric:!0}:{}],U=function(t){if(t!==S){u("limit",t);var e=p.hasOwnProperty("interval")?p.interval:"day";G(p,e,!1,t,k)}},H=function(t){if(!F||!F.hasOwnProperty("totals"))return 0;var e=F.totals;return e.hasOwnProperty(t)?e[t]:void 0},R=function(e){return[{key:"email_sents",title:Object(o.__)("Sent","wp-marketing-automations"),icon:"sent",value:parseInt(H("email_sents"))},{key:"email_click",title:Object(o.__)("Clicks","wp-marketing-automations"),icon:"open-rate",value:parseInt(H("email_click"))}].concat(rt(Object(d.qc)()?[{key:"total_orders",title:Object(o.__)("Orders","wp-marketing-automations"),icon:"open-rate",value:parseInt(H("total_orders"))},{key:"total_revenue",title:Object(o.__)("Revenue","wp-marketing-automations"),icon:"open-rate",value:t(H("total_revenue")),isCurrency:!0}]:[]))};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-content-header-new"},Object(n.createElement)("div",{className:"bwf-content-header-left"},Object(n.createElement)("div",{className:"bwf-content-header-title"},Object(o.__)("SMS","wp-marketing-automations")))),Object(n.createElement)(X.a,null),Object(n.createElement)("div",{className:"bwf-crm-analytics-wrap bwf-crm-emails-report-wrap bwf-table-with-border"},!d.Yb&&!Object(d.ac)()&&Object(n.createElement)(tt.a,{onPage:!0,modalContent:{proLink:Object(d.fb)("upgrade",{utm_medium:"SMS+Analytics+Upgrade+Modal"})}}),Object(n.createElement)(Q,{query:p},d.Yb&&Object(n.createElement)(et.a,{title:Object(o.__)("SMS Analytics","wp-marketing-automations"),message:Object(o.__)("Use our sample data to explore SMS Analytics. Use these trends to find out best time to send campaigns.","wp-marketing-automations"),proLink:Object(d.fb)("upgrade",{utm_medium:"SMS+Analytics+Sample+Data+Notice"})})),Object(n.createElement)("div",{className:"bwf_clear_2"}),Object(n.createElement)(c,{query:p,metrics:R()}),Object(n.createElement)(v,{query:p,metrics:R()}),Object(n.createElement)(Z.a,{title:Object(o.__)("SMS","wp-marketing-automations"),rows:(C=[],Object(s.isEmpty)(P)||P.map((function(e){var r=parseFloat(e.click_rate)?" ( "+parseFloat(e.click_rate).toFixed(2)+"% ) ":"";C.push([{display:e.template?Object(n.createElement)("div",{className:"bwf-pre-line"},e.template):"-",value:e.subject},{display:e.title?e.title:"-",value:e.title},{display:parseInt(e.sent)?parseInt(e.sent):"-",value:e.sent},{display:parseInt(e.click_count)?e.click_count+r:"-",value:e.click_count},Object(d.qc)()?{display:parseInt(e.conversions)?parseInt(e.conversions):"-",value:e.conversions}:{},Object(d.qc)()?{display:e&&e.hasOwnProperty("revenue")&&e.revenue?t(e.revenue):"-",value:e.revenue,isCurrency:!0}:{}])})),C),headers:q,query:{paged:L},rowsPerPage:S?parseInt(S):25,totalRows:x,isLoading:E,onPageChange:function(t,e){var r=(t-1)*S;u("offset",r);var n=p.hasOwnProperty("interval")?p.interval:"day";G(p,n,!1,S,r)},onQueryChange:function(t){return"per_page"!==t?function(){}:U},showMenu:!1,rowHeader:!0,hideHeader:"yes",emptyMessage:Object(o.__)("No SMS found","wp-marketing-automations")})))}}}]); |