- 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
49 KiB
JavaScript
Executable File
1 line
49 KiB
JavaScript
Executable File
(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{1399:function(t,e,r){},1481:function(t,e,r){"use strict";r.r(e);var n=r(0),o=r(70),a=r(1),i=r(146),c=r(51);function u(t){return(u="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)}var s=["getStateProp"];function l(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 f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p=function(){var t=Object(c.a)("taskHistoryList"),e=t.getStateProp;return f(f({},function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,s)),{},{getTaskHistory:function(){return e("tasks")},getPageNumber:function(){return parseInt(e("offset"))/parseInt(e("limit"))+1},getPerPageCount:function(){return parseInt(e("limit"))},getOffset:function(){return parseInt(e("offset"))},getTotalCount:function(){return parseInt(e("total"))},getLoadingStatus:function(){return e("isLoading")},getCompletedCount:function(){return e("completed")},getScheduledCount:function(){return e("scheduled")},getPausedCount:function(){return e("paused")},getFailedCount:function(){return e("failed")},getPageCountData:function(){return e("countData")}})},b=r(50),h=r(3);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)}var d=["fetch","setStateProp"];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 v(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){w(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 w(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 O=function(){var t=Object(b.a)("taskHistoryList"),e=t.fetch,r=t.setStateProp;return v(v({},function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,d)),{},{fetch:function(t,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=r.s,c=void 0===i?"":i,u=r.automation,s=r.action,l={offset:n,limit:o,status:t,action_slug:s,automation_id:u,search:""!=a?a:c};e("GET",Object(h.A)("/automations/task-history"),l)},setTaskListValues:function(t,e){r(t,e)}})},j=r(2),_=r(61),E=r(62),k=r(19),S=r(5),x=r(55),P=r(9),L=r.n(P),T=r(6),C=r.n(T),N=(r(1399),r(12)),A=r(8),D=r(197),I=r(27);function F(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,s=!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){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return G(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)?G(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 G(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 M=function(t){var e=t.onSearch,r=F(Object(n.useState)([]),2),o=r[0],i=r[1];return Object(n.createElement)(I.a,{autocompleter:D.d,multiple:!1,allowFreeTextSearch:!0,inlineTags:!0,selected:o,onChange:function(t){i(t),e(Object(j.isEmpty)(t)?"":t[0].key)},placeholder:Object(a.__)("Search","wp-marketing-automations"),showClearButton:!0,disabled:!1,bwfMaintainSingleTerm:!0})},R=r(148),B=r(96);function q(t){return(q="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 H(){H=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 s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,i=Object.create(a.prototype),c=new L(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=l;var m="suspendedStart",p="executing",b="completed",h={};function y(){}function d(){}function g(){}var v={};s(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(T([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=g.prototype=y.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){s(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 s=u.arg,l=s.value;return l&&"object"==q(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(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=m;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===b){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===m)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?b:"suspendedYield",s.arg===h)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=b,n.method="throw",n.arg=s.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 x(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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,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(q(e)+" is not iterable")}return d.prototype=g,o(j,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:d,configurable:!0}),d.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),s(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(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),s(j,u,"Generator"),s(j,i,(function(){return this})),s(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,L.prototype={constructor:L,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"),s=n.call(i,"finallyLoc");if(u&&s){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(!s)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:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function Y(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)}var U=function(t){var e=t.isOpen,r=t.tasks,o=t.onSuccess,i=t.onError,c=t.onRequestClose,u=r?r.length:0,s=Object(B.useMutation)(function(){var t,e=(t=H().mark((function t(e){return H().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,L()({path:Object(h.A)("/automations/tasks/"),method:"DELETE",data:{task_ids:e}});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){Y(a,n,o,i,c,"next",t)}function c(t){Y(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}(),{onSuccess:function(){setTimeout((function(){return s.reset()}),2500),o&&o()},onError:function(){i&&i()}});return Object(n.createElement)(x.a,{modalTitle:Object(a._n)("Delete Task","Delete Tasks",u,"wp-marketing-automations"),deleteDescriptionText:Object(n.createElement)(n.Fragment,null,Object(a.__)("You are about to delete ","wp-marketing-automations"),Object(a._n)("task","tasks",u,"wp-marketing-automations"),Object(a.__)(". This action cannot be undone. Cancel to stop, Delete to proceed.","wp-marketing-automations")),confirmButtonText:Object(a.__)("Delete","wp-marketing-automations"),cancelButtonText:Object(a.__)("Cancel","wp-marketing-automations"),onConfirm:function(){return s.mutate(r.map((function(t){return t.id})))},isLoading:s.isLoading,successMessage:s.isSuccess&&Object(a.__)("Tasks Deleted!","wp-marketing-automations"),errorMessage:s.isError&&(s.error&&s.error.message?s.error.message:Object(a.__)("Unable to delete tasks","wp-marketing-automations")),onRequestClose:function(){return!!c&&c()},isOpen:e,confirmDescription:Object(a.__)("This action is irreversible","wp-marketing-automations"),isDelete:!0})};function V(t){return(V="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 $(){$=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 s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,i=Object.create(a.prototype),c=new L(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=l;var m="suspendedStart",p="executing",b="completed",h={};function y(){}function d(){}function g(){}var v={};s(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(T([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=g.prototype=y.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){s(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 s=u.arg,l=s.value;return l&&"object"==V(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(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=m;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===b){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===m)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?b:"suspendedYield",s.arg===h)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=b,n.method="throw",n.arg=s.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 x(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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,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(V(e)+" is not iterable")}return d.prototype=g,o(j,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:d,configurable:!0}),d.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),s(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(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),s(j,u,"Generator"),s(j,i,(function(){return this})),s(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,L.prototype={constructor:L,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"),s=n.call(i,"finallyLoc");if(u&&s){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(!s)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:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function J(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)}var Q=function(t){var e=t.isOpen,r=t.tasks,o=t.onSuccess,i=t.onError,c=t.onRequestClose,u=t.screenType,s=Object(B.useMutation)(function(){var t,e=(t=$().mark((function t(e){return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,L()({path:Object(h.A)("/automations/execute-tasks/"),method:"POST",data:{task_ids:e}});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){J(a,n,o,i,c,"next",t)}function c(t){J(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}(),{onSuccess:function(){setTimeout((function(){return s.reset()}),2500),o&&o()},onError:function(){i&&i()}});return Object(n.createElement)(x.a,{modalTitle:"failed"===u?Object(a.__)("Reschedule Task","wp-marketing-automations"):Object(a.__)("Execute Task","wp-marketing-automations"),deleteDescriptionText:"failed"===u?Object(a.__)("You are about to reschedule selected task. This action cannot be undone. Cancel to stop, Reschedule to proceed.","wp-marketing-automations"):Object(a.__)("You are about to execute selected task. This action cannot be undone. Cancel to stop, Execute to proceed.","wp-marketing-automations"),confirmButtonText:"failed"===u?Object(a.__)("Reschedule","wp-marketing-automations"):Object(a.__)("Execute","wp-marketing-automations"),cancelButtonText:Object(a.__)("Cancel","wp-marketing-automations"),onConfirm:function(){return s.mutate(r.map((function(t){return t.id})))},successMessage:s.isSuccess&&("failed"===u?Object(a.__)("Tasks Rescheduled!","wp-marketing-automations"):Object(a.__)("Tasks Executed!","wp-marketing-automations")),errorMessage:s.isError&&(s.error&&s.error.message?s.error.message:"failed"===u?Object(a.__)("Unable to reschedule tasks","wp-marketing-automations"):Object(a.__)("Unable to execute tasks","wp-marketing-automations")),onRequestClose:function(){return!!c&&c()},isOpen:e,isDelete:!0})};function z(){return(z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(null,arguments)}function K(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,s=!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){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return W(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)?W(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 W(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 X=function(t){var e=t.floatingBarProps,r=void 0===e?{}:e,o=t.resetSelection,i=t.onSuccess,c=t.screenType,u=t.screenTypeId,s=K(Object(n.useState)([]),2),l=s[0],f=s[1],m=K(Object(n.useState)(!1),2),p=m[0],b=m[1],h=K(Object(n.useState)(!1),2),y=h[0],d=h[1],g=function(){o&&o(),f([])};Object(n.useEffect)((function(){g()}),[c]);var v,w,O=Object(n.useCallback)((function(t,e){switch(t){case"delete":f(e),b(!0);break;case"execute":f(e),d(!0)}}),[]);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(R.a,z({actions:(v=c,w=[{id:"delete",icon:"trash",hint:Object(a.__)("Delete Tasks","wp-marketing-automations")}],"completed"!==v&&w.push({id:"execute",icon:"play",hint:"failed"===v?Object(a.__)("Reschedule","wp-marketing-automations"):Object(a.__)("Execute","wp-marketing-automations")}),w),onAction:O},r)),Object(n.createElement)(U,{tasks:l,isOpen:p,onSuccess:function(){i&&i("delete",l),g()},onError:g,onRequestClose:function(){return b(!1)}}),Object(n.createElement)(Q,{tasks:l,isOpen:y,onSuccess:function(){i&&i("execute",l),g()},onError:g,onRequestClose:function(){return d(!1)},screenType:c,screenTypeId:u}))},Z=r(44);function tt(t){return(tt="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 et(){return(et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(null,arguments)}function rt(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 nt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){ot(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ot(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=tt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function at(){at=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 s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,i=Object.create(a.prototype),c=new L(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=l;var m="suspendedStart",p="executing",b="completed",h={};function y(){}function d(){}function g(){}var v={};s(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(T([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=g.prototype=y.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){s(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 s=u.arg,l=s.value;return l&&"object"==tt(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(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=m;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===b){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===m)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?b:"suspendedYield",s.arg===h)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=b,n.method="throw",n.arg=s.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 x(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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,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(tt(e)+" is not iterable")}return d.prototype=g,o(j,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:d,configurable:!0}),d.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),s(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(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),s(j,u,"Generator"),s(j,i,(function(){return this})),s(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,L.prototype={constructor:L,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"),s=n.call(i,"finallyLoc");if(u&&s){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(!s)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:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function it(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 ct(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){it(a,n,o,i,c,"next",t)}function c(t){it(a,n,o,i,c,"throw",t)}i(void 0)}))}}function ut(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,s=!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){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(t,e)||st(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 st(t,e){if(t){if("string"==typeof t)return lt(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)?lt(t,e):void 0}}function lt(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 ft=function(t){var e=t.type,r=t.query,o=r.automation,c=r.action,u=O(),s=p(),l=Object(n.useContext)(h.h),f=u.fetch,m=u.setTaskListValues,b=s.getTaskHistory,y=s.getPageNumber,d=s.getPerPageCount,g=s.getTotalCount,v=s.getOffset,w=s.getLoadingStatus,P=s.getCompletedCount,T=s.getFailedCount,D=s.getPausedCount,I=s.getScheduledCount,F=Object(n.useRef)(new AbortController),G=ut(Object(n.useState)({loading:!1,status:!1}),2),B=G[0],q=G[1],H=ut(Object(n.useState)([]),2),Y=H[0],U=H[1],V=ut(Object(n.useState)([]),2),$=V[0],J=V[1],Q=ut(Object(n.useState)(!1),2),z=Q[0],K=Q[1],W=ut(Object(n.useState)({}),2),tt=W[0],rt=W[1],ot=ut(Object(n.useState)(""),2),it=ot[0],lt=ot[1],ft=[],mt=ut(Object(n.useState)([]),2),pt=(mt[0],mt[1]),bt=b(),ht=d(),yt=v(),dt=g(),gt=y(),vt=w(),wt=I(),Ot=T(),jt=P(),_t=D(),Et="t_0";Object(j.isEmpty)(e)||("paused"===e?Et="t_1":"completed"===e?Et="l_1":"failed"===e&&(Et="l_0")),Object(n.useEffect)((function(){pt([]),f(Et,r,yt,ht,it)}),[yt,ht,e,o,c]);var kt=function(){var t=ct(at().mark((function t(){return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,L()({path:Object(h.A)("/automations/task-filters"),method:"GET",signal:F.current.signal}).then((function(t){200==t.code&&(t.result.hasOwnProperty("automations")&&U(Object.entries(t.result.automations).map((function(t){var e=ut(t,2),r=e[0];return{label:e[1],value:r}}))),t.result.hasOwnProperty("actions")&&J(t.result.actions&&Object.entries(t.result.actions).map((function(t){var e=ut(t,2),r=e[0];return{label:e[1],value:r}}))))})).catch((function(t){console.log(t)}));case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(){return t.apply(this,arguments)}}();Object(n.useEffect)((function(){return kt(),function(){F.current.abort()}}),[]);var St=function(t){t!==ht&&m("limit",t)},xt=function(){var t=ct(at().mark((function t(e,n){var o,i,c,u;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o="",i="",c="","delete"===n?(o=Object(h.A)("/automations/tasks"),i="DELETE",c="Deleting..."):"execute"===n?(o=Object(h.A)("/automations/execute-tasks"),i="POST",c="Executing..."):"run"===n&&(o=Object(h.A)("/automations/run-tasks"),i="POST",c="Running..."),l(c),!(Array.isArray(e)&&!Object(j.isEmpty)(e)||"run"===n&&parseInt(e)>0)){t.next=18;break}return t.prev=6,t.next=9,L()({path:o,method:i,data:{task_ids:e}}).then((function(t){if(200===t.code)q({status:!1}),f(Et,r,0,ht,it),l(t.message);else{var e=t&&t.message&&t.message.msg?t.message.msg:"";e=!e&&t&&t.message?t.message:e,l(e)}}));case 9:t.next=16;break;case 11:t.prev=11,t.t0=t.catch(6),u=!(u=t.t0&&t.t0.message&&t.t0.message.msg?t.t0.message.msg:"")&&t.t0&&t.t0.message?t.t0.message:u,l(u);case 16:t.next=19;break;case 18:l(Object(a.__)("No Task Selected","wp-marketing-automations"));case 19:Object(h.Lb)(l,3e3);case 20:case"end":return t.stop()}}),t,null,[[6,11]])})));return function(e,r){return t.apply(this,arguments)}}(),Pt=Object(n.useMemo)((function(){var t={};if(Array.isArray(bt)){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=st(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}(bt);try{for(r.s();!(e=r.n()).done;){var n=e.value;t[n.id]=n}}catch(t){r.e(t)}finally{r.f()}}return t}),[bt]),Lt=Object(R.b)(Pt),Tt=Lt.singleSelectProps,Ct=Lt.selectAllProps,Nt=Lt.floatingBarProps,At=Lt.resetSelection,Dt=bt?bt.map((function(t){var e,r=[{display:Object(n.createElement)(Z.a,et({type:"checkbox",checked:!1,onChange:function(){}},Tt[t.id])),value:t.id},{display:(e=t,Object(n.createElement)(_.a,{label:Object(a.__)("Quick Actions","wp-marketing-automations"),menuPosition:"bottom right",renderContent:function(t){var r=t.onToggle;return Object(n.createElement)(n.Fragment,null,["t_0","t_1"].includes(Et)&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(E.a,{isClickable:!0,onInvoke:function(){xt(e.id,"run"),r()}},Object(n.createElement)(k.a,{justify:"flex-start"},Object(n.createElement)(k.c,null,Object(n.createElement)(A.a,{icon:"play"})),Object(n.createElement)(k.c,null,Object(a.__)("Run now","wp-marketing-automations"))))),Object(n.createElement)(E.a,{isClickable:!0,onInvoke:function(){var t={status:!0,deleteDescriptionText:Object(a.__)("You are about to delete task. This action cannot be undone. Cancel to stop, Delete to proceed.","wp-marketing-automations"),buttonConfirm:Object(a.__)("Delete","wp-marketing-automations"),buttonCancel:Object(a.__)("Cancel","wp-marketing-automations"),modalTitle:Object(a.__)("Delete Task","wp-marketing-automations")};q(nt(nt({},t),{},{onConfirm:function(){return xt([e.id],"delete",t)}})),r()}},Object(n.createElement)(k.a,{justify:"flex-start"},Object(n.createElement)(k.c,null,Object(n.createElement)(A.a,{icon:"trash"})),Object(n.createElement)(k.c,null,Object(a.__)("Delete","wp-marketing-automations")))))}})),value:""},{display:"#"+t.id,value:""},{display:t.task_integration+" : "+t.task_integration_action,value:t.task_integration},{display:t.task_details?Object(n.createElement)("ul",{dangerouslySetInnerHTML:{__html:t.task_details}}):"-",value:""},{display:t.automation_name?Object(n.createElement)("a",{href:t.automation_url,className:"bwf-a-no-underline"},t.automation_name):"-",value:t.automation_name},{display:t.task_date?Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:t.task_date}}):"-",value:""},{display:Object(n.createElement)(S.Button,{isSecondary:!0,className:"bwf-btn-small is-light bwf-btn-gray",onClick:function(){rt(t),K(!0)}},Object(a.__)("View","wp-marketing-automations")),value:""}];return ft.push(t.id),r})):[],It=Object(n.createElement)(n.Fragment,null,Object(a.__)("Scheduled","wp-marketing-automations"),parseInt(wt)>0?Object(n.createElement)("span",{className:"bwf-crm-btn-group-count"},wt):""),Ft=Object(n.createElement)(n.Fragment,null,Object(a.__)("Completed","wp-marketing-automations"),parseInt(jt)>0?Object(n.createElement)("span",{className:"bwf-crm-btn-group-count"},jt):""),Gt=Object(n.createElement)(n.Fragment,null,Object(a.__)("Failed","wp-marketing-automations"),parseInt(Ot)>0?Object(n.createElement)("span",{className:"bwf-crm-btn-group-count"},Ot):""),Mt=Object(n.createElement)(n.Fragment,null,Object(a.__)("Paused","wp-marketing-automations"),parseInt(_t)>0?Object(n.createElement)("span",{className:"bwf-crm-btn-group-count"},_t):""),Rt=C()("bwfcrm-task-list-table",{"has-search":!0}),Bt=[{key:"id",label:Object(n.createElement)(Z.a,et({type:"checkbox",checked:!1,onChange:function(){},"aria-label":Object(a.__)("Select","wp-marketing-automations")},Ct)),required:!0,cellClassName:"bwf-col-action bwf-w-30 bwf-table-col-sticky bwf-sticky-left"},{key:"action",label:"",isLeftAligned:!0,required:!0,cellClassName:"bwf-col-action bwf-w-30 bwf-table-col-sticky bwf-sticky-left"},{key:"task",label:Object(a.__)("Task","wp-marketing-automations"),isLeftAligned:!0,required:!0,cellClassName:"bwf-w-100"},{key:"actions",label:Object(a.__)("Action","wp-marketing-automations"),isLeftAligned:!0},{key:"data",label:Object(a.__)("Data","wp-marketing-automations"),isLeftAligned:!0},{key:"automation",label:Object(a.__)("Automation","wp-marketing-automations"),isLeftAligned:!0},{key:"date",label:Object(a.__)("Date","wp-marketing-automations"),isLeftAligned:!0},{key:"view",label:"",isLeftAligned:!0,cellClassName:"bwf-w-60"}],qt=Object(n.createElement)("div",{className:"bwf-page-filters bwf-display-flex bwf-flex"},Object(n.createElement)(S.SelectControl,{className:"bwf-w-300 bwf-mr-10",value:o||"",options:[{label:Object(a.__)("Select Automation","wp-marketing-automations"),value:""}].concat(Y),onChange:function(t){if(t)Object(N.l)({automation:t},"/",r);else{var e=r;delete e.automation,Object(N.l)({},"/",e)}}}),Object(n.createElement)(S.SelectControl,{className:"bwf-w-300 bwf-mr-10",value:c||"",options:[{label:Object(a.__)("Select Action","wp-marketing-automations"),value:""}].concat($),onChange:function(t){if(t)Object(N.l)({action:t},"/",r);else{var e=r;delete e.action,Object(N.l)({},"/",e)}}}));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)("span",{className:"bwf-cursor-pointer bwf-display-flex",onClick:function(){return Object(N.l)({page:"autonami",path:"/automations-v1"},"/",{})}},Object(n.createElement)(A.a,{icon:"arrow-left",size:20})),Object(n.createElement)("div",{className:"bwf-content-header-title"},Object(a.__)("Task History","wp-marketing-automations")),parseInt(dt)>0&&Object(n.createElement)("div",{className:"bwf-content-header-count"},Object(a.sprintf)(Object(a.__)("(%s Results)","wp-marketing-automations"),dt)))),Object(n.createElement)(S.ButtonGroup,{className:"bwf-btn-group-tabs"},Object(n.createElement)(S.Button,{isPrimary:!e||"scheduled"===e,isSecondary:e&&"scheduled"!==e,onClick:function(){return Object(N.l)({path:"/automations-v1/task-history/scheduled"},"/",r)}},It),Object(n.createElement)(S.Button,{isPrimary:e&&"paused"===e,isSecondary:e&&"paused"!==e,onClick:function(){return Object(N.l)({path:"/automations-v1/task-history/paused"},"/",r)}},Mt),Object(n.createElement)(S.Button,{isPrimary:e&&"completed"===e,isSecondary:e&&"completed"!==e,onClick:function(){return Object(N.l)({path:"/automations-v1/task-history/completed"},"/",r)}},Ft),Object(n.createElement)(S.Button,{isPrimary:e&&"failed"===e,isSecondary:e&&"failed"!==e,onClick:function(){return Object(N.l)({path:"/automations-v1/task-history/failed"},"/",r)}},Gt)),Object(n.createElement)("div",{className:"bwf_clear_20"}),Object(n.createElement)(i.a,{rows:Dt,className:Rt,headers:Bt,query:{paged:gt},rowsPerPage:ht,totalRows:dt,isLoading:vt,onPageChange:function(t,e){m("offset",(t-1)*ht)},onQueryChange:function(t){return"per_page"!==t?function(){}:St},rowHeader:!0,showMenu:!1,actions:[Object(n.createElement)("div",{className:"bwf-flex",key:"bwf-an-task-history-filters"},qt),Object(n.createElement)(M,{query:r,onSearch:function(t){lt(t||""),f(Et,r,0,ht,t)},key:"bwf-an-task-history-search"})],emptyMessage:Object(a.__)("No tasks found","wp-marketing-automations")}),z&&Object(n.createElement)(S.Modal,{className:"bwf-message-preview-modal bwf-admin-modal bwf-admin-modal-large bwf-task-model bwf-h--core-header",shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1},Object(n.createElement)("div",{className:"bwf-modal-header"},Object(n.createElement)("div",{className:"bwf-modal-heading"},Object(a.__)("Details","wp-marketing-automations")),Object(n.createElement)("span",{onClick:function(){return K(!1)},className:"bwf-modal-close"},Object(n.createElement)(A.a,{icon:"close",color:"#353030"}))),Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-p-15 bwf-bb-grey"},Object(n.createElement)("div",{className:"bwf-w-150 bwf_bold bwf_align_center"},Object(a.__)("Automation","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf_align_center"},tt.automation_name)),Object(n.createElement)("div",{className:"bwf-p-15 bwf-bb-grey"},Object(n.createElement)("div",{className:"bwf-w-150 bwf_bold bwf_align_center"},Object(a.__)("Event","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf_align_center"},tt.automation_source+" : "+tt.automation_event)),Object(n.createElement)("div",{className:"bwf-p-15 bwf-bb-grey"},Object(n.createElement)("div",{className:"bwf-w-150 bwf_bold bwf_align_center"},Object(a.__)("Action","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf_align_center"},tt.task_integration+(tt.task_integration_action?" : ".concat(tt.task_integration_action):""))),Object(n.createElement)("div",{className:"bwf-p-15 bwf-bb-grey bwf-task-details"},Object(n.createElement)("ul",{className:"bwf_align_center",dangerouslySetInnerHTML:{__html:tt.task_details}})),!Object(j.isEmpty)(tt.task_message)&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-h3 bwf-pt-15"},Object(a.__)("Notes","wp-marketing-automations")),Object.entries(tt.task_message).map((function(t,e){var r=ut(t,2),o=r[0],a=r[1];return Object(n.createElement)("div",{className:"bwf-p-15",key:e},Object(n.createElement)("div",{className:"bwfcrm-task_notes_card"},a),Object(n.createElement)("div",{className:"bwfcrm-task_notes_time"},Object(n.createElement)("i",null,o)))}))))),Object(n.createElement)(x.a,{modalTitle:B.modalTitle,deleteDescriptionText:B.deleteDescriptionText,confirmButtonText:B.buttonConfirm,cancelButtonText:B.buttonCancel,onConfirm:B.onConfirm,isLoading:B.loading,successMessage:B.success,errorMessage:B.error,onRequestClose:function(){return q({status:!1})},isOpen:B.status,content:B.content,isDelete:!0}),Object(n.createElement)(X,{floatingBarProps:Nt,resetSelection:At,onSuccess:function(){return f(Et,r,0,ht)},screenType:e,screenTypeId:Et}))},mt=r(1069),pt=r(108),bt=r(76);function ht(t){return(ht="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 yt(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 dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(r),!0).forEach((function(e){gt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function gt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ht(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ht(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}e.default=function(t){var e=(0,p().getPageCountData)(),r=Object(pt.a)().getPageCountData,i=Object(bt.a)().setPageCountData,c=r();Object(n.useEffect)((function(){i(dt(dt({},c),e))}),[e]),Object(mt.a)("automations-v1","","","","",0),Object(h.m)(Object(a.__)("Task History","wp-marketing-automations"));var u=t.match.params.type,s=Object(N.i)();return Object(n.createElement)(o.a,null,Object(n.createElement)("div",{className:"bwfcrm-task-list"},Object(n.createElement)(ft,{query:s,type:u})))}}}]); |