(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{1101:function(t,e,n){"use strict";var r=n(0),a=n(1),o=n(9),i=n.n(o),c=n(3),s=n(337);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)}function l(){l=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),c=new I(r||[]);return a(i,"_invoke",{value:x(t,n,c)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var m="suspendedStart",b="executing",y="completed",d={};function v(){}function g(){}function w(){}var j={};f(j,i,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(A([])));E&&E!==n&&r.call(E,i)&&(j=E);var _=w.prototype=v.prototype=Object.create(j);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(a,o,i,c){var s=p(t[a],t,o);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==u(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function x(e,n,r){var a=m;return function(o,i){if(a===b)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var s=S(c,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===m)throw a=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=b;var u=p(e,n,r);if("normal"===u.type){if(a=r.done?y:"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(a=y,r.method="throw",r.arg=u.arg)}}}function S(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(a,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function N(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;C(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}function f(t,e,n,r,a,o,i){try{var c=t[o](i),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,a)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,a,o,i,c=[],s=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(t){u=!0,a=t}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(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 p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0)){t.next=2;break}return t.abrupt("return");case 2:return E(!0),t.prev=3,t.next=6,i()({method:"GET",path:Object(c.A)("/v3/contacts/".concat(d.id,"/engagement/").concat(parseInt(o),"?mode=1"))});case 6:"result"in(e=t.sent)&&w(e.result),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(3),console.log(t.t0),t.t0&&"message"in t.t0?L(t.t0.message):Object(a.__)("There are some technical difficulties while getting emails. Please contact support.","wp-marketing-automations");case 14:E(!1);case 15:case"end":return t.stop()}}),t,null,[[3,10]])})),function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(t){f(o,r,a,i,c,"next",t)}function c(t){f(o,r,a,i,c,"throw",t)}i(void 0)}))});return function(){return e.apply(this,arguments)}}();Object(r.useEffect)((function(){b&&x()}),[b]);return Object(r.createElement)(s.a,{isOpen:b,isLoading:O,onRequestClose:function(){m(),w({}),L("")},error:k,subject:![2,3].includes(parseInt(u))&&g?g.subject:"",body:g&&g.body?g.body:"",sourceType:p,mode:u,contact:t.contact,conversation:t.conversation,template:g})}},1455:function(t,e,n){"use strict";n.r(e);var r=n(0),a=n(146),o=n(1),i=n(5),c=n(11),s=n(3),u=n(77),l=n(2),f=n(1101),h=n(179),p=n(356);function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,a,o,i,c=[],s=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(t){u=!0,a=t}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return b(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0?P.map((function(t){return"ID"in t&&parseInt(t.ID)>0&&[{display:J(t),value:t.subject},{display:Object(s.ib)(t.created_at,!1),value:t.created_at},{display:t.open?t.open:0,value:t.open},{display:t.click?t.click:0,value:t.click},{display:Object(r.createElement)(c.a,{className:"is-secondary bwf-btn-small is-blue-btn",onClick:function(){y(t),g(!0)}},Object(o.__)("View","wp-marketing-automations")),value:null}]})):[];return Object(r.createElement)("div",{className:"bwf-cs-contact-tab-data"},Object(r.createElement)("div",{className:"bwf-content-header-new"},Object(r.createElement)("div",{className:"bwf-content-header-left"},T||G?Object(r.createElement)("div",{className:"bwf-placeholder-temp bwf-w-150 bwf-h-15"}):Object(r.createElement)("div",{className:"bwf-normal-text"},parseInt(M)>0&&Object(o.sprintf)(Object(o.__)("All Emails (%s)","wp-marketing-automations"),M))),Object(r.createElement)("div",{className:"bwf-content-header-right"},T||G?Object(r.createElement)("div",{className:"bwf-placeholder-temp bwf-w-60 bwf-h-30"}):Object(r.createElement)(i.Button,{className:"bwf-btn-small is-blue",isPrimary:!0,onClick:function(){O({status:!0,contactInfo:E})}},Object(o.__)("Send Email","wp-marketing-automations")))),Object(r.createElement)("div",{className:"bwf-c-s-data"},Object(r.createElement)("div",{className:"bwf-c-s-section"},Object(r.createElement)(a.a,{className:"contact-single-table contact-emails",headers:B,hideHeader:"yes",rows:U,query:{paged:D},totalRows:M,rowsPerPage:q,isLoading:T||G,showMenu:!1,onPageChange:function(t,n){return A(e,(t-1)*q,q)},onQueryChange:function(t){return"per_page"===t?function(t){return t!==q&&A(e,F,t)}:function(){return{}}},emptyMessage:Object(o.__)("No emails found","wp-marketing-automations")}))),Object(r.createElement)(f.a,{onRequestClose:function(){return g(!1)},conversation:b,contact:E,isOpen:v}),j.status&&Object(r.createElement)(p.a,{contact:j.contactInfo,setSendMessageModel:O,onSuccess:function(){return A(e,F,q)},messageType:"email"}))}}}]);