Files
roi-theme/wp-content/plugins/wp-marketing-automations/admin/frontend/dist/46.e07f99b3327e63baa453.js
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- 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>
2025-11-03 21:04:30 -06:00

1 line
79 KiB
JavaScript
Executable File

(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{1066:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(0);var o=function(t,e){var r=Object(n.useRef)();Object(n.useEffect)((function(){r.current=t}),[t]),Object(n.useEffect)((function(){if(null!==e){var t=setInterval((function(){r.current()}),e);return function(){return clearInterval(t)}}}),[e])}},1100:function(t,e,r){"use strict";var n=r(50),o=r(3);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=["fetch","setStateProp","clearError"];function c(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 u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function l(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}e.a=function(){var t=Object(n.a)("singleTemplateData"),e=t.fetch,r=t.setStateProp,a=t.clearError;return u(u({},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,i)),{},{fetch:function(t){r("isLoading",!0),a(),e("GET",Object(o.A)("/template/".concat(t)))},setTemplateData:function(t){r("data",t)},setTemplateListData:function(t){r("listData",t)}})}},1105:function(t,e,r){"use strict";var n=r(0),o=r(1066),a=(r(1114),r(8)),i=r(1),c=r(9),u=r.n(c),l=r(3),s=r(5),f=r(2);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 m(){m=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 v?e:v,i=Object.create(a.prototype),c=new N(n||[]);return o(i,"_invoke",{value:P(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 h="suspendedStart",b="executing",y="completed",d={};function v(){}function g(){}function O(){}var w={};l(w,i,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&n.call(E,i)&&(w=E);var _=O.prototype=v.prototype=Object.create(w);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(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 P(e,r,n){var o=h;return function(a,i){if(o===b)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=L(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=b;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function L(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,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;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,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(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 g.prototype=O,o(_,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:g,configurable:!0}),g.displayName=l(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(x.prototype),l(x.prototype,c,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new x(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(_),l(_,u,"Generator"),l(_,i,(function(){return this})),l(_,"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=C,N.prototype={constructor:N,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(T),!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,d):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),d},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),T(r),d}},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;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function h(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 b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){h(a,n,o,i,c,"next",t)}function c(t){h(a,n,o,i,c,"throw",t)}i(void 0)}))}}function y(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 d(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)?d(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 d(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={automation:Object(i.__)("Automation","wp-marketing-automations"),templates:Object(i.__)("Template","wp-marketing-automations"),recovered_carts:Object(i.__)("Recovered Cart","wp-marketing-automations"),lost_carts:Object(i.__)("Lost Cart","wp-marketing-automations"),recoverable_carts:Object(i.__)("Recoverable Cart","wp-marketing-automations")};e.a=function(t){var e=t.type,r=void 0===e?"":e,c=t.localData,p=void 0===c?{}:c,h=t.onDismiss,d=void 0===h?function(){}:h,g=Object(n.useContext)(l.h),O=y(Object(n.useState)(1),2),w=O[0],j=O[1],E=y(Object(n.useState)(!1),2),_=E[0],k=E[1],x=y(Object(n.useState)(!1),2),P=x[0],L=x[1],S=y(Object(n.useState)({}),2),T=S[0],N=S[1],C=function(){var t=b(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u()({path:Object(l.A)("/export/status?type=".concat(r)),method:"GET"}).then((function(t){if(200!==t.code||!t.hasOwnProperty("result"))throw Error(Object(l.u)(null==t?void 0:t.message));var e=t.result,r=e.status,n=void 0===r?1:r,o=e.msg,a=void 0===o?[]:o,i=e.url,c=void 0===i?"":i;j(n),N({msg:a,url:c})}));case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),g(t.t0.hasOwnProperty("message")&&""!==t.t0.message?t.t0.message:Object(i.__)("Unable to export.","wp-marketing-automations")),Object(l.Lb)(g,3e3);case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(){return t.apply(this,arguments)}}();Object(n.useEffect)((function(){if(Object(f.isEmpty)(p))""!==r&&C();else{var t=p.status,e=void 0===t?1:t,n=p.msg,o=void 0===n?[]:n,a=p.url,i=void 0===a?"":a;j(e),N({msg:o,url:i})}}),[]);var D=function(){var t=b(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u()({path:Object(l.A)("/export/action?type=".concat(r,"&action=cancel")),method:"POST"}).then((function(t){if(200!==t.code||!t.hasOwnProperty("result"))throw Error(Object(l.u)(null==t?void 0:t.message));var e=t.result.status;(void 0===e?1:e)&&(bwfcrm_contacts_data.export_data.hasOwnProperty(r)&&delete bwfcrm_contacts_data.export_data[r],k(!0),d())}));case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),g(t.t0.hasOwnProperty("message")&&""!==t.t0.message?t.t0.message:Object(i.__)("Unable to perform action.","wp-marketing-automations")),Object(l.Lb)(g,3e3);case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(){return t.apply(this,arguments)}}(),I=function(){var t=b(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.open(Object(l.wb)()+"/wp-json"+Object(l.A)("/export/download?type=".concat(r,"&bwf-nonce=").concat(Object(l.F)(),"&user_id=").concat(Object(l.N)())),"_blank");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();if(Object(o.a)((function(){1==w&&""!==r&&C()}),5e3),""===r||_)return Object(n.createElement)(n.Fragment,null);var A=T.url,F=void 0===A?"":A,G=T.msg,M=void 0===G?[]:G,B={1:Object(i.__)("Export In Progress…","wp-marketing-automations"),2:Object(i.__)("File Is Ready","wp-marketing-automations"),3:Object(i.__)("Export Failed","wp-marketing-automations")},R={1:Object(i.__)("Cancel","wp-marketing-automations"),2:Object(i.__)("Download","wp-marketing-automations"),3:Object(i.__)("View Details","wp-marketing-automations")};return Object(n.createElement)("div",{className:"bwf-export-info-wrap bwf-status-".concat(w)},Object(n.createElement)("div",{className:"bwf-export-info-left"},Object(n.createElement)("div",{className:"bwf-export-status-icon"},Object(n.createElement)(a.a,{icon:"export-info",size:20})),Object(n.createElement)("div",{className:"bwf-export-status-message"},B[w])),Object(n.createElement)("div",{className:"bwf-export-info-right"},(2!==parseInt(w)||!(2===parseInt(w)&&""===F))&&Object(n.createElement)("div",{className:"bwf-export-status-button",onClick:function(){switch(parseInt(w)){case 1:D();break;case 2:I();break;case 3:L(!0)}}},R[w]),1!==parseInt(w)&&Object(n.createElement)("div",{className:"bwf-export-status-dismiss",onClick:D},Object(n.createElement)(a.a,{icon:"close",size:16,color:"#FFF"}))),P&&Object(n.createElement)(s.Modal,{onRequestClose:function(){return L(!1)},className:"bwf-admin-modal bwf-admin-modal-480 bwf-admin-modal-no-header bwf-export-info-modal"},Object(n.createElement)("div",{className:"bwf-admin-m-header-new"},Object(n.createElement)("div",{className:"bwf-admin-m-title"},Object(i.sprintf)(Object(i.__)("Error! Export %ss","wp-marketing-automations"),v.hasOwnProperty(r)?v[r]:r)),Object(n.createElement)("div",{className:"bwf-admin-m-close",onClick:function(){return L(!1)}},Object(n.createElement)(a.a,{icon:"close",size:20}))),Object(n.createElement)("div",{className:"bwf-export-info-content"},Object(n.createElement)("div",{className:"bwf-export-info-content-bold"},Object(i.__)("Following reasons while creating file for export","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-export-info-content-error-list"},Object(f.isEmpty)(M)?Object(n.createElement)("li",null,Object(i.__)("Unable to create export","wp-marketing-automations")):M.map((function(t,e){return Object(n.createElement)("li",{key:e},t)}))))))}},1114:function(t,e,r){},1161:function(t,e,r){"use strict";var n=r(0),o=r(1),a=r(3),i=(r(563),r(5)),c=r(8);e.a=function(t){var e=t.onFileSelected,r=t.filetypeArray,u=t.type,l=void 0===u?"automation":u,s=t.importText,f=void 0===s?"":s,p=t.importInfo,m=void 0===p?"":p,h=Object(n.useContext)(a.h),b=function(t){t&&t[0]&&"type"in t[0]?r.includes(t[0].type)?(e(t[0]),Object(a.Lb)(h,3e3)):h(Object(o.__)("Uploaded file is not valid.","wp-marketing-automations")):h(Object(o.__)("Uploaded file not found","wp-marketing-automations"))};return Object(n.createElement)("div",{className:"bwf-component-import-wrapper"},Object(n.createElement)("div",{className:"bwf-import-area-wrapper"},Object(n.createElement)(i.FormFileUpload,{isSecondary:!0,accept:"application/json",onChange:function(t){return b(t.target.files)},render:function(t){var e=t.openFileDialog;return Object(n.createElement)("div",{className:"bwf-import-area",onClick:e},Object(n.createElement)(c.a,{icon:"json-upload",size:72}),Object(n.createElement)("div",{className:"bwf-drop-import-heading"},""!==f?f:Object(o.__)("Click or Drag & Drop your JSON file","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-drop-import-content"},""!==m?m:Object(o.sprintf)(Object(o.__)("This tool allows you to import the %s from the JSON file.","wp-marketing-automations"),l)))}}),Object(n.createElement)(i.DropZone,{onFilesDrop:b,onHTMLDrop:b,onDrop:b})))}},1440:function(t,e,r){"use strict";r.r(e);var n=r(0),o=r(1),a=r(349),i=r(3),c=r(12),u=r(50);function l(t){return(l="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=["fetch","setStateProp"];function f(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 p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(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"!=l(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var h=function(){var t=Object(u.a)("templateData"),e=t.fetch,r=t.setStateProp;return p(p({},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)),{},{fetch:function(t,n,o){r("isLoading",!0);var a={offset:n,limit:o,search:t.s,get_template:!1};e("GET",Object(i.A)("/templates"),a)},setTemplateValues:function(t,e){r(t,e)}})},b=r(51);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=["getStateProp"];function v(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 g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(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 w=function(){var t=Object(b.a)("templateData"),e=t.getStateProp;return g(g({},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)),{},{getTemplates:function(){return e("data")},getPageNumber:function(){return parseInt(e("offset"))/parseInt(e("limit"))+1},getPerPageCount:function(){return parseInt(e("limit"))},getPageOffset:function(){return parseInt(e("offset"))},getTotalCount:function(){return parseInt(e("total_count"))}})},j=r(146),E=r(55),_=r(61),k=r(62),x=r(19),P=r(8),L=r(9),S=r.n(L),T=r(148),N=r(1100),C=r(1161),D=r(5);function I(t){return(I="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 A(){A=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 y?e:y,i=Object.create(a.prototype),c=new S(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",h="completed",b={};function y(){}function d(){}function v(){}var g={};l(g,i,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O(T([])));w&&w!==r&&n.call(w,i)&&(g=w);var j=v.prototype=y.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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"==I(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===h){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=x(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,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?h:"suspendedYield",l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function x(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,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;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,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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(I(e)+" is not iterable")}return d.prototype=v,o(j,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=l(v,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,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},E(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(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,S.prototype={constructor:S,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(L),!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,b):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),b},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),L(r),b}},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;L(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),b}},e}function F(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 G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?F(Object(r),!0).forEach((function(e){M(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F(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"!=I(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==I(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B(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 R(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 U(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)?U(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 U(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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(n.createElement)(n.Fragment,null,"".concat(""!==t?t:"It seems there was an issue during the import",". For further help, contact "),Object(n.createElement)("a",{href:Object(i.fb)("support",{utm_medium:"Support+Recipe+Import+Failed"}),target:"_blank",rel:"noopener noreferrer"},Object(o.__)(" support. ","wp-marketing-automations")))},z=function(t){var e=t.onRequestClose,r=Object(c.i)(),a=R(Object(n.useState)({status:!1,modalTitle:Object(o.__)("Import Template","wp-marketing-automations")}),2),u=a[0],l=a[1],s=R(Object(n.useState)(null),2),f=s[0],p=s[1],m=function(){var t,a=(t=A().mark((function t(){var a;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l(G(G({},u),{},{loading:!0,title:Object(o.__)("Please wait…","wp-marketing-automations"),message:Object(n.createElement)(n.Fragment,null,Object(o.sprintf)(Object(o.__)("Please wait! We are importing %s data","wp-marketing-automations"),null==f?void 0:f.name))})),t.prev=1,(a=new FormData).append("files",f),t.next=6,S()({method:"POST",body:a,path:Object(i.A)("/templates/import")}).then((function(t){200==t.code?t.result.hasOwnProperty("template_id")?(l(G(G({},u),{},{status:!0,loading:!1,title:Object(o.__)("Importing Done","wp-marketing-automations"),message:Object(o.__)("Successfully Imported and added in your Template","wp-marketing-automations")})),setTimeout((function(){Object(c.l)({page:"autonami",path:"/template/".concat(t.result.template_id)},"/",{})}),1e3)):(Object(c.l)({path:"/templates/"},"/",r),e()):(p(null),l(G(G({},u),{},{status:!1,loading:!1,title:Object(o.__)("Importing Failed","wp-marketing-automations"),message:q(t.message)})))}));case 6:t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),p(null),l(G(G({},u),{},{status:!1,loading:!1,title:Object(o.__)("Importing Failed","wp-marketing-automations"),message:q(t.t0.message)}));case 12:case"end":return t.stop()}}),t,null,[[1,8]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){B(a,n,o,i,c,"next",t)}function c(t){B(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return a.apply(this,arguments)}}();return Object(n.useEffect)((function(){f&&m()}),[f]),Object(n.createElement)(n.Fragment,null,Object(n.createElement)(D.Modal,{className:"bwf-admin-modal bwf-admin-modal-480 bwf-admin-modal-no-header",shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1},Object(n.createElement)("div",{className:"bwf-admin-m-header-new"},Object(n.createElement)("div",{className:"bwf-admin-m-title"},Object(o.__)("Import Template","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-admin-m-close",onClick:e},Object(n.createElement)(P.a,{icon:"close",size:20}))),u.title&&Object(n.createElement)("div",{className:"bwf-import-modal-content bwf-t-center"},u.loading?Object(n.createElement)(P.a,{icon:"import-loading"}):Object(n.createElement)(P.a,{icon:u.status?"success-loader":"circle-close",size:48}),Object(n.createElement)("div",{className:"bwf-drop-import-content"},u.message)),!u.title&&Object(n.createElement)(C.a,{onFileSelected:function(t){return p(t)},filetypeArray:["application/json"],importText:Object(o.__)("Drag or Browse a json file to import template","wp-marketing-automations"),importInfo:"( "+Object(o.__)("File size 10 MB max","wp-marketing-automations")+" )"})))},Y=r(96);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 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 y?e:y,i=Object.create(a.prototype),c=new S(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",h="completed",b={};function y(){}function d(){}function v(){}var g={};l(g,i,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O(T([])));w&&w!==r&&n.call(w,i)&&(g=w);var j=v.prototype=y.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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"==V(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===h){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=x(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,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?h:"suspendedYield",l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function x(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,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;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,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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=v,o(j,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=l(v,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,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},E(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(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,S.prototype={constructor:S,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(L),!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,b):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),b},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),L(r),b}},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;L(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),b}},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)}function H(t){return 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)}))}}var W=function(t){var e=t.isOpen,r=t.tasks,a=t.onSuccess,c=t.onError,u=t.onRequestClose,l=t.actionType,s=r?r.length:0,f=Object(Y.useMutation)(function(){var t=H($().mark((function t(e){return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S()({path:Object(i.A)("/bulk-action/template"),method:"DELETE",data:{ids:e}});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),{onSuccess:function(){setTimeout((function(){return f.reset()}),2500),a&&a()},onError:function(){c&&c()}}),p=function(){var t=H($().mark((function t(){return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.mutate(r.map((function(t){return t.ID})));case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),m={delete:{title:Object(o._n)("Delete Template","Delete Templates",s,"wp-marketing-automations"),description:Object(n.createElement)(n.Fragment,null,Object(o.__)("You are about to delete ","wp-marketing-automations"),Object(o._n)("template","templates",s,"wp-marketing-automations"),Object(o.__)(". This action cannot be undone. Cancel to stop, Delete to proceed.","wp-marketing-automations")),confirmBtn:Object(o.__)("Delete","wp-marketing-automations"),cancelBtn:Object(o.__)("Cancel","wp-marketing-automations"),successMsg:Object(o.__)("Bulk action executed successfully","wp-marketing-automations"),errorMsg:Object(o.__)("Unable to delete template","wp-marketing-automations"),confirmDescription:Object(o.__)("This action is irreversible","wp-marketing-automations")}};return Object(n.createElement)(E.a,{modalTitle:m.hasOwnProperty(l)&&m[l].hasOwnProperty("title")?m[l].title:Object(o._n)("Perform Actions","Perform Actions",s,"wp-marketing-automations"),deleteDescriptionText:m.hasOwnProperty(l)&&m[l].hasOwnProperty("description")?m[l].description:"",confirmButtonText:m.hasOwnProperty(l)&&m[l].hasOwnProperty("confirmBtn")?m[l].confirmBtn:Object(o.__)("Confirm","wp-marketing-automations"),cancelButtonText:m.hasOwnProperty(l)&&m[l].hasOwnProperty("cancelBtn")?m[l].cancelBtn:Object(o.__)("Cancel","wp-marketing-automations"),onConfirm:p,isLoading:f.isLoading,successMessage:f.isSuccess&&(m.hasOwnProperty(l)&&m[l].hasOwnProperty("successMsg")?m[l].successMsg:Object(o.__)("Actions Done!","wp-marketing-automations")),errorMessage:f.isError&&(f.error&&f.error.message?f.error.message:m.hasOwnProperty(l)&&m[l].hasOwnProperty("errorMsg")?m[l].errorMsg:Object(o.__)("Unable to perform action","wp-marketing-automations")),onRequestClose:function(){return!!u&&u()},isOpen:e,confirmDescription:m.hasOwnProperty(l)&&m[l].hasOwnProperty("confirmDescription")?m[l].confirmDescription:"",isDelete:!0})},Q=r(1105),K=r(2),Z=r(44),X=r(195),tt=r(334),et=r(26),rt=r(11);function nt(t){return(nt="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 ot(){return(ot=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 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 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 y?e:y,i=Object.create(a.prototype),c=new S(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",h="completed",b={};function y(){}function d(){}function v(){}var g={};l(g,i,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O(T([])));w&&w!==r&&n.call(w,i)&&(g=w);var j=v.prototype=y.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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"==nt(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===h){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=x(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,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?h:"suspendedYield",l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function x(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,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;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,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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(nt(e)+" is not iterable")}return d.prototype=v,o(j,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=l(v,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,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},E(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(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,S.prototype={constructor:S,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(L),!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,b):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),b},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),L(r),b}},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;L(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),b}},e}function it(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 ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?it(Object(r),!0).forEach((function(e){ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ut(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lt(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 st(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){lt(a,n,o,i,c,"next",t)}function c(t){lt(a,n,o,i,c,"throw",t)}i(void 0)}))}}function ft(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)||pt(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 pt(t,e){if(t){if("string"==typeof t)return mt(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)?mt(t,e):void 0}}function mt(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 ht=function(t){var e=t.menuButtons,r=void 0===e?Object(n.createElement)(n.Fragment,null):e,a=t.pitchData,u=void 0===a?{}:a,l=t.setOpenProModal,s=void 0===l?function(){}:l,f=Object(n.useContext)(i.h),p=Object(c.i)(),m=p.s,b=void 0===m?"":m,y={1:Object(o.__)("Rich Text","wp-marketing-automations"),2:Object(o.__)("WooCommerce","wp-marketing-automations"),3:Object(o.__)("Raw HTML","wp-marketing-automations"),4:Object(o.__)("Visual Builder (Legacy)","wp-marketing-automations"),5:Object(o.__)("Visual Builder","wp-marketing-automations")},d=h(),v=d.fetch,g=d.setTemplateValues,O=Object(N.a)().setTemplateListData,L=w(),C=L.getLoading,D=L.getTemplates,I=L.getTotalCount,A=L.getPageOffset,F=L.getPerPageCount,G=L.getPageNumber,M=L.getError,B=D(),R=A(),U=F(),q=C(),Y=I(),V=G(),$=M(),J=Object(i.Fb)();Object(n.useEffect)((function(){v(p,R,U)}),[R,U,p.s]);var H=ft(Object(n.useState)({loading:!1,status:!1}),2),nt=H[0],it=H[1],ut=ft(Object(n.useState)(!1),2),lt=ut[0],mt=ut[1],ht=ft(Object(n.useState)(!1),2),bt=ht[0],yt=ht[1],dt=ft(Object(n.useState)(!1),2),vt=dt[0],gt=dt[1],Ot=ft(Object(n.useState)([]),2),wt=Ot[0],jt=Ot[1],Et=ft(Object(n.useState)(!1),2),_t=Et[0],kt=Et[1],xt=ft(Object(n.useState)(""),2),Pt=xt[0],Lt=xt[1];Object(n.useEffect)((function(){q||gt(!1)}),[q]);var St=function(){Rt&&Rt(),jt([])};Object(n.useEffect)((function(){return St(),function(){return g("offset",0)}}),[]);var Tt,Nt=function(t,e){if(Object(i.ac)())if("export"===t){var r=[];e.map((function(t){return r.push(t.ID)})),Wt(r)}else jt(e),Lt(t),kt(!0);else s(!0)},Ct=function(){var t=st(at().mark((function t(e){var r,n=arguments;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},it(ct(ct({},r),{},{status:!0})),t.prev=2,t.next=5,S()({path:Object(i.A)("/template/".concat(e)),method:"DELETE"}).then((function(t){f(t.message),it({status:!1}),v(p,R,U)}));case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),it({status:!0,error:t.t0.message?t.t0.message:Object(o.__)("Error in deleting template","wp-marketing-automations")});case 10:Object(i.Lb)(f,3e3);case 11:case"end":return t.stop()}}),t,null,[[2,7]])})));return function(e){return t.apply(this,arguments)}}(),Dt=function(){var t=st(at().mark((function t(e){return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f(Object(o.__)("Cloning…","wp-marketing-automations")),t.prev=1,t.next=4,S()({path:Object(i.A)("/template/".concat(e,"/clone")),method:"GET"}).then((function(t){200==t.code?(f(Object(o.__)("Template cloned","wp-marketing-automations")),v(p,0,U)):f(t.message)}));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),f(t.t0.message);case 9:Object(i.Lb)(f,3e3);case 10:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(e){return t.apply(this,arguments)}}(),It=function(t){return Object(n.createElement)(_.a,{label:Object(o.__)("Quick Actions","wp-marketing-automations"),menuPosition:"bottom right",renderContent:function(e){var r=e.onToggle;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){O(t.title),Object(c.l)({path:"/template/"+parseInt(t.ID)},"/",p),r()}},Object(n.createElement)(x.a,{justify:"space-between"},Object(n.createElement)(x.c,null,Object(o.__)("Edit","wp-marketing-automations")))),Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){Object(i.ac)()?Dt(parseInt(t.ID)):s(!0),r()}},Object(n.createElement)(x.a,{justify:"space-between"},Object(n.createElement)(x.c,null,Object(o.__)("Duplicate","wp-marketing-automations")),!Object(i.ac)()&&Object(n.createElement)(x.c,null,i.e))),Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){Object(i.ac)()?Wt(t.ID,t.title):s(!0),r()}},Object(n.createElement)(x.a,{justify:"space-between"},Object(n.createElement)(x.c,null,Object(o.__)("Export","wp-marketing-automations")),!Object(i.ac)()&&Object(n.createElement)(x.c,null,i.e))),Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){var e={status:!0,modalTitle:Object(o.__)("Delete Template","wp-marketing-automations"),deleteEntityName:t.title,buttonConfirm:Object(o.__)("Delete","wp-marketing-automations"),buttonCancel:Object(o.__)("Cancel","wp-marketing-automations"),isDelete:!0};it(ct(ct({},e),{},{onConfirm:function(){return Ct(t.ID,e)}})),r()}},Object(n.createElement)(x.a,{justify:"flex-start"},Object(n.createElement)(x.c,null,Object(o.__)("Delete","wp-marketing-automations")))))}})},At=Object(n.useMemo)((function(){var t={};if(Array.isArray(B)){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=pt(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}}}}(B);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}),[B]),Ft=Object(T.b)(At),Gt=Ft.singleSelectProps,Mt=Ft.selectAllProps,Bt=Ft.floatingBarProps,Rt=Ft.resetSelection,Ut=Ft.selected,qt=Object.keys(Ut).filter((function(t){return Ut[t]})).length,zt=[{key:"select_template",label:Object(n.createElement)(Z.a,ot({type:"checkbox",checked:!1,onChange:function(){}},Mt)),isLeftAligned:!0,required:!0,cellClassName:"bwf-col-action bwf-w-30"},{key:"actions",label:"",isLeftAligned:!1,cellClassName:"bwf-col-action bwf-w-30"},{key:"name",label:Object(o.__)("Name","wp-marketing-automations"),isLeftAligned:!0},{key:"createdon",label:Object(o.__)("Created On","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-240"},{key:"type",label:Object(o.__)("Type","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-210"},{key:"updatedon",label:Object(o.__)("Last Update","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-240"}],Yt=function(t){return Object(n.createElement)("a",{href:"admin.php?page=autonami&path=/template/"+t.ID,type:"bwf-crm",className:"bwf-a-no-underline",onClick:function(e){e.preventDefault(),O(t.title),Object(c.l)({path:"/template/"+parseInt(t.ID)},"/",p)}},Object(n.createElement)("b",null,t.title.charAt(0).toUpperCase()+t.title.slice(1)+" "))},Vt=B.map((function(t){return[{display:Gt.hasOwnProperty(t.ID)?Object(n.createElement)(Z.a,ot({type:"checkbox",checked:!1,onChange:function(){}},Gt[t.ID])):Object(n.createElement)(n.Fragment,null),value:null},{display:It(t),value:"action"},{display:t.title?Yt(t):"-",value:""},{display:Object(i.ib)(t.created_at),value:""},{display:y.hasOwnProperty(parseInt(t.mode))?Object(n.createElement)(n.Fragment,null,y[parseInt(t.mode)],5===parseInt(t.mode)&&Object(n.createElement)("span",{className:"bwf-tags bwf-tag-green bwf-ml-4"},Object(o.__)("New","wp-marketing-automations"))):"-",value:""},{display:Object(i.ib)(t.updated_at),value:""}]})),$t=function(t){t!==U&&g("limit",t)},Jt=function(t,e){var r="data:text/json;charset=utf-8,"+encodeURIComponent(t),n=document.createElement("a");n.setAttribute("href",r),n.setAttribute("download",e+".json"),document.body.appendChild(n),n.click(),n.remove()},Ht=function(){var t=st(at().mark((function t(){return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f(Object(o.__)("Exporting…","wp-marketing-automations")),t.prev=1,t.next=4,S()({path:Object(i.A)("/export/action"),data:{type:"templates",action:"start",extra_data:{search:b}},method:"POST"}).then((function(t){if(200!==t.code)throw Error(Object(i.u)(null==t?void 0:t.message));t.hasOwnProperty("result")&&t.result.hasOwnProperty("data")&&!Object(K.isEmpty)(t.result.data)&&(bwfcrm_contacts_data.export_data=t.result.data,f(Object(o.__)("Template export has started","wp-marketing-automations"))),Object(i.Lb)(f,3e3)}));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),Object(i.Lb)(f,3e3);case 9:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(){return t.apply(this,arguments)}}(),Wt=function(){var t=st(at().mark((function t(){var e,r,n,a=arguments;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:0,r=a.length>1&&void 0!==a[1]?a[1]:"templates",f(Object(o.__)("Exporting…","wp-marketing-automations")),n="",!Object(K.isArray)(e)&&parseInt(e)>0?n=Object(i.A)("/templates/".concat(e,"/export")):(n=Object(i.A)("/templates/export/"),Object(K.isEmpty)(e)||(n+="?ids=".concat(e.join(",")))),t.prev=5,t.next=8,S()({path:n,method:"GET"}).then((function(t){if(200!==t.code)throw Error(Object(i.u)(null==t?void 0:t.message));Jt(t.result,r),f(Object(o.__)("Template exported","wp-marketing-automations")),Object(K.isArray)(e)&&St(),Object(i.Lb)(f,3e3)}));case 8:t.next=14;break;case 10:t.prev=10,t.t0=t.catch(5),Object(i.Lb)(f,3e3),setTimeout((function(){it({status:!0,modalTitle:Object(o.__)("Export Template","wp-marketing-automations"),error:t.t0.message})}),[1500]);case 14:case"end":return t.stop()}}),t,null,[[5,10]])})));return function(){return t.apply(this,arguments)}}(),Qt=0===parseInt(qt)?Object(n.createElement)("div",{className:"bwf-display-flex gap-12"},J.hasOwnProperty("templates")&&Object(n.createElement)(Q.a,{type:"templates",localData:J.templates,onDismiss:function(){return mt(!0)}}),Object(n.createElement)(rt.a,{className:"bwf-btn-small is-light",title:Object(o.__)("Export","wp-marketing-automations"),onClick:function(){Object(i.ac)()?Ht():s(!0)},disabled:J.hasOwnProperty("templates")&&!lt},Object(n.createElement)("span",{className:"bwf-display-flex gap-4"},Object(n.createElement)(P.a,{icon:Object(i.ac)()?"export":"king",size:16}),Object(n.createElement)("span",null,Object(o.__)("Export All","wp-marketing-automations")))),Object(n.createElement)(rt.a,{className:"bwf-btn-small is-light",title:Object(o.__)("Import","wp-marketing-automations"),onClick:function(){Object(i.ac)()?yt(!0):s(!0)}},Object(n.createElement)("span",{className:"bwf-display-flex gap-4"},Object(n.createElement)(P.a,{icon:Object(i.ac)()?"import":"king",size:16}),Object(n.createElement)("span",null,Object(o.__)("Import","wp-marketing-automations"))))):Object(n.createElement)(n.Fragment,null),Kt=q||vt||0!==Y||""!==b||$;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.__)("Templates","wp-marketing-automations")),parseInt(Y)>0&&Object(n.createElement)("div",{className:"bwf-content-header-count"},Object(o.sprintf)(Object(o._n)("(%s Result)","(%s Results)",Y,"wp-marketing-automations"),Y))),Object(n.createElement)("div",{className:"bwf-content-header-right"},Kt&&!q&&r)),$&&Object(n.createElement)(et.a,{status:"error"},$.message),Kt?Object(n.createElement)(j.a,{className:"bwf-template-table has-search",title:"",rows:Vt,headers:zt,query:{paged:V},rowsPerPage:U,totalRows:Y,isLoading:q,onPageChange:function(t,e){g("offset",(t-1)*U)},onQueryChange:function(t){return"per_page"!==t?function(){}:$t},showMenu:!1,rowHeader:!0,actions:qt>0?[Object(n.createElement)(T.a,ot({key:"template-bulk-action",actions:(Tt=[],-1!==Object(i.n)(bwfcrm_contacts_data.bwf_pro_version,"2.9.5")&&Tt.push({id:"export",icon:"export",hint:Object(o.__)("Export","wp-marketing-automations"),isPro:!0}),Tt.push({id:"delete",icon:"trash",hint:Object(o.__)("Delete","wp-marketing-automations")}),Tt),onAction:Nt,inLine:!0,reset:St},Bt))]:[Object(n.createElement)(X.a,{key:"search",isLoading:q,searchTerm:null==p?void 0:p.s,showResultCount:!1,setSearchData:function(t){if(Object(K.size)(t))Object(c.l)({s:t},"/",p);else{var e=Object(K.cloneDeep)(p);e.hasOwnProperty("s")&&(null==e||delete e.s),gt(!0),Object(c.l)(e,"/",{})}}})],emptyMessage:Object(o.__)("No templates found","wp-marketing-automations"),extraSectionBeforefilterCol:Qt}):Object(n.createElement)(tt.a,{data:u}),Object(n.createElement)(E.a,{modalTitle:nt.modalTitle,deleteEntityName:nt.deleteEntityName,confirmText:nt.confirmText,confirmButtonText:nt.buttonConfirm,cancelButtonText:nt.buttonCancel,onConfirm:nt.onConfirm,isLoading:nt.loading,successMessage:nt.success,errorMessage:nt.error,content:nt.content,onRequestClose:function(){return it({status:!1})},isOpen:nt.status,isDelete:!nt.hasOwnProperty("isDelete")||nt.isDelete}),Object(n.createElement)(W,{tasks:wt,isOpen:_t,onSuccess:function(){v(p,R,U),St()},onError:St,onRequestClose:function(){return kt(!1)},screenType:"bulkaction",actionType:Pt}),bt&&Object(n.createElement)(z,{onRequestClose:function(){return yt(!1)}}))};r(345),r(347),r(48);function bt(t){return(bt="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(){yt=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 y?e:y,i=Object.create(a.prototype),c=new S(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",h="completed",b={};function y(){}function d(){}function v(){}var g={};l(g,i,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O(T([])));w&&w!==r&&n.call(w,i)&&(g=w);var j=v.prototype=y.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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"==bt(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===h){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=x(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,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?h:"suspendedYield",l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function x(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,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;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,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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(bt(e)+" is not iterable")}return d.prototype=v,o(j,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=l(v,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,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},E(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(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,S.prototype={constructor:S,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(L),!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,b):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),b},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),L(r),b}},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;L(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),b}},e}function dt(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 vt(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 gt(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)?gt(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 gt(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 Ot=function(t){var e=t.onCloseModal,r=Object(n.useContext)(i.h),a=vt(Object(n.useState)(!1),2),u=a[0],l=a[1],s=vt(Object(n.useState)(""),2),f=s[0],p=s[1],m=vt(Object(n.useState)({}),2),h=(m[0],m[1]),b=vt(Object(n.useState)(null),2),y=b[0],d=b[1],v=Object(N.a)().setTemplateListData;Object(n.useEffect)((function(){l(!1),h({}),d(""),p("")}),[]);var g=function(){var t,e=(t=yt().mark((function t(){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l(!0),p(""),t.prev=2,t.next=5,S()({path:Object(i.A)("/template/"),method:"POST",data:{title:y,mode:5,escape_body:!0}}).then((function(t){200==t.code&&(Object(i.eb)()||(bwfcrm_contacts_data.first_template_id=1),r(Object(o.__)("Template created","wp-marketing-automations")),v(y),Object(c.l)({path:"/template/"+t.result.id},"/",{}))}));case 5:t.next=11;break;case 7:t.prev=7,t.t0=t.catch(2),l(!1),p(t.t0.message);case 11:Object(i.Lb)(r,3e3);case 12:case"end":return t.stop()}}),t,null,[[2,7]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){dt(a,n,o,i,c,"next",t)}function c(t){dt(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return e.apply(this,arguments)}}(),O=function(){Object(K.isEmpty)(y)?p(Object(o.__)("Name is required.","wp-marketing-automations")):(p(""),g())};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(D.Modal,{className:"bwf-admin-modal bwf-admin-modal-squeezy 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(o.__)("Add Template","wp-marketing-automations")),Object(n.createElement)("span",{onClick:e,className:"bwf-modal-close"},Object(n.createElement)(P.a,{icon:"close",color:"#353030"}))),Object(n.createElement)("div",{className:"bwf-form-fields",onKeyPress:function(t){"Enter"==t.key&&O()}},f&&Object(n.createElement)(et.a,{status:"error",onRemove:function(){return p("")}},f),Object(n.createElement)(D.TextControl,{placeholder:Object(o.__)("Enter","wp-marketing-automations"),autoFocus:!0,label:Object(o.__)("Name","wp-marketing-automations"),value:y||"",onChange:function(t){return d(t)},disabled:u}),Object(n.createElement)("div",{className:"bwf_text_right bwf-form-buttons"},Object(n.createElement)(rt.a,{onClick:function(){return e()},className:"bwf-cancel-btn"},Object(o.__)("Cancel","wp-marketing-automations")),Object(n.createElement)(rt.a,{isPrimary:!0,disabled:u,isBusy:u,onClick:function(){O()}},Object(o.__)("Add","wp-marketing-automations"))))))},wt=r(76),jt=r(108),Et=r(70),_t=r(40);function kt(t){return(kt="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 xt(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 Pt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xt(Object(r),!0).forEach((function(e){Lt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Lt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=kt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function St(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 Tt(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)?Tt(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 Tt(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=(0,w().getTotalCount)(),e=Object(n.createElement)(D.Button,{isPrimary:!0,className:"bwf-display-flex",onClick:function(){Object(i.ac)()?f(!0):u(!0)}},!Object(i.ac)()&&Object(n.createElement)(P.a,{icon:"king",size:"16",color:"#fff"}),Object(n.createElement)("span",null,Object(o.__)("Create Template","wp-marketing-automations")));Object(a.a)(Object(o.__)("Templates","wp-marketing-automations"),e,t);var r=St(Object(n.useState)(!1),2),c=r[0],u=r[1],l=St(Object(n.useState)(!1),2),s=l[0],f=l[1];Object(n.useEffect)((function(){Object(i.m)(Object(o.__)("My Templates","wp-marketing-automations"))}),[]);var p=Object(jt.a)().getPageCountData,m=Object(wt.a)().setPageCountData,h=p();Object(n.useEffect)((function(){m(Pt(Pt({},h),{},{templates_templates:t}))}),[t]);var b=[{type:"heading",data:{title:Object(o.__)("Truly Flexible Email Editor With Beautiful Templates","wp-marketing-automations"),desc:Object(o.__)("Import beautiful email templates with a single click and never ever start from blank page again.","wp-marketing-automations")}},{type:"image-desc",data:[{img:Object(i.t)()+"template/template1.png",title:Object(o.__)("Pick from proven email templates","wp-marketing-automations"),desc:Object(o.__)("Save time with ever growing template library","wp-marketing-automations")},{img:Object(i.t)()+"template/template2.png",title:Object(o.__)("Edit with our easy drag-and-drop editor","wp-marketing-automations"),desc:Object(o.__)("Launch fast with features like saved sections & global styles","wp-marketing-automations")}]},{type:"buttons",data:{buttons:[{text:Object(o.__)("Create Email Template","wp-marketing-automations"),proCheck:!0,onClick:function(){Object(i.ac)()?f(!0):u(!0)}}]}},{type:"link-wth-text",data:{text:Object(o.__)("Curious about templates?","wp-marketing-automations"),link:"https://funnelkit.com/docs/autonami-2/email-builder/email-templates/",linkText:Object(o.__)("Learn More","wp-marketing-automations")}}];return Object(n.createElement)(n.Fragment,null,Object(i.eb)()&&0!==i.p?Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Et.a,null),Object(n.createElement)(ht,{menuButtons:e,pitchData:b,setOpenProModal:u})):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.__)("Templates","wp-marketing-automations")),!Object(i.ac)()&&i.e)),Object(n.createElement)(tt.a,{data:b})),!Object(i.ac)()&&Object(n.createElement)(_t.b,{isOpen:c,onRequestClose:function(){return u(!1)},modalContent:{isFeature:!0,featureTitle:Object(o.__)("Templates","wp-marketing-automations"),proLink:Object(i.fb)("upgrade",{utm_medium:"Create+Templates+Upgrade+Modal"}),image:Object(i.sb)("templates.png"),benefit:Object(o.__)("Unlock Templates and other awesome features.","wp-marketing-automations")}}),s&&Object(n.createElement)(Ot,{onCloseModal:function(){return f(!1)}}))}}}]);