"use strict";(self.webpackChunkgravitysmtp=self.webpackChunkgravitysmtp||[]).push([[1707,4832,4854,6558],{18698:function(t,n,e){e.r(n),e.d(n,{AmazonAWSFullLogo:function(){return r.A},BrevoFullLogo:function(){return o.A},BrokenImageFull:function(){return i.A},CloudflareFullLogo:function(){return u.A},CustomSMTPFullLogo:function(){return a.A},ElasticEmailFullLogo:function(){return c.A},EmailitFullLogo:function(){return s.A},GoogleAltLogo:function(){return l.A},GoogleFullLogo:function(){return d.A},GravityFormsStackedLogo:function(){return p.A},GravitySMTPFullLogo:function(){return f.A},MailFailedBg:function(){return m.A},MailSuccessBg:function(){return _.A},MailchimpFullLogo:function(){return v.A},MailerSendFullLogo:function(){return g.A},MailgunFullLogo:function(){return b.A},MailjetFullLogo:function(){return A.A},MailtrapFullLogo:function(){return y.A},MicrosoftAltLogo:function(){return S.A},MicrosoftFullLogo:function(){return h.A},PHPFullLogo:function(){return w.A},PostmarkFullLogo:function(){return k.A},ResendFullLogo:function(){return O.A},SMTP2GOFullLogo:function(){return P.A},SMTPFullLogo:function(){return z.A},SendGridFullLogo:function(){return x.A},SparkPostFullLogo:function(){return j.A},WPMailSMTPFullLogo:function(){return C.A},ZohoAltLogo:function(){return F.A},ZohoFullLogo:function(){return I.A}});var r=e(61294),o=e(93015),i=e(79866),u=e(66470),a=e(59417),c=e(3108),s=e(68414),l=e(63660),d=e(57438),p=e(79124),f=e(10997),v=e(41921),g=e(25587),m=e(91570),b=e(67652),A=e(34981),_=e(89564),y=e(18673),S=e(40783),h=e(51511),w=e(69703),k=e(10162),O=e(95826),x=e(45279),P=e(63279),z=e(83197),j=e(47400),C=e(33653),F=e(64158),I=e(65911)},24679:function(t,n,e){var r=e(88856),o=e(90455),i=e(8140),u=e(78564),a=e.n(u),c=e(27122),s=e.n(c),l=e(7175),d=e(6648),p=e(35739),f=e(75195),v=e(30242),g=e(5529),m=e(66598),b=e(55899),A=e(84860),_=e(28099),y=e(83707),S=e(93313),h=e(18698),w=e(65224),k=e(57290),O=l.q_.useEffect,x=l.q_.useRef,P=l.q_.useState,z=["google","microsoft"];n.default=function(t){var n,e,u,c=t.common,j=t.data,C=t.endpoints,F=t.i18n,I=c.i18n,B=(void 0===I?{}:I).debug_messages,E=void 0===B?{}:B,L=E.saving_integration_settings,D=void 0===L?"":L,N=E.saving_integration_settings_error,q=void 0===N?"":N,M=F.setup_wizard_next_button,T=void 0===M?"":M,G=F.setup_wizard_mail_settings_title,H=void 0===G?"":G,R=F.setup_wizard_mail_settings_copy,U=void 0===R?"":R,J=F.setup_wizard_integration_settings_error,W=void 0===J?"":J,X=j.integrations,Z=(0,k.default)(function(t){return t.activeStep}),$=(0,k.default)(function(t){return t.isAnimatedIn}),K=(0,k.default)(function(t){return t.integration}),Q=(0,k.default)(function(t){return t.integrationSettingsFormData}),V=(0,k.default)(function(t){return t.setActiveStepNext}),Y=(0,k.default)(function(t){return t.setActiveNavBarStepNext}),tt=(0,k.default)(function(t){return t.setSetupStatus}),nt=(0,k.default)(function(t){return t.setIntegrationSettingsFormData}),et=(0,k.default)(function(t){return t.setSettingsUpdated}),rt=(0,k.default)(function(t){return t.setHasDebugError}),ot=x(null),it=P(!1),ut=(0,i.A)(it,2),at=ut[0],ct=ut[1],st=(0,p.uN)(X,"id",K),lt=(null==st||null===(n=st.settings)||void 0===n?void 0:n.fields)||[],dt=(null==C||null===(e=C.save_connector_settings)||void 0===e?void 0:e.action)||"",pt=(null==C||null===(u=C.save_connector_settings)||void 0===u?void 0:u.nonce)||"",ft=(0,A.dh)(),vt=function(){var t=(0,o.A)(a().mark(function t(){var n,e,r,o,i,u,c;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return ct(!0),n=ot.current.offsetWidth,ot.current.style.width="".concat(n,"px"),e={action:dt,security:pt,connector_type:K,settings:Q[K]},t.next=6,(0,y.A)((0,p.nv)(D,K,JSON.stringify((0,S.A)(["api_key","api_secret","server_api_token","password","security"],e))),"info");case 6:return t.prev=6,t.next=9,(0,f.bE)({endpoint:s(),body:e});case 9:if(o=t.sent,ct(!1),null!=o&&null!==(r=o.data)&&void 0!==r&&r.success){t.next=19;break}return c=(0,p.Fh)(null==o||null===(i=o.error)||void 0===i||null===(i=i.detail)||void 0===i?void 0:i.data)?JSON.parse(null==o||null===(u=o.error)||void 0===u||null===(u=u.detail)||void 0===u?void 0:u.data):"",t.next=15,(0,y.A)((0,p.nv)(q,K,JSON.stringify(c)),"error");case 15:rt(!0),ft((null==c?void 0:c.data)||W,"error"),t.next=22;break;case 19:tt("success"),z.includes(K)||(V(),Y()),et();case 22:t.next=30;break;case 24:return t.prev=24,t.t0=t.catch(6),console.error(t.t0),t.next=29,(0,y.A)((0,p.nv)(q,K,JSON.stringify(t.t0)),"error");case 29:rt(!0);case 30:ot.current&&(ot.current.style.width="");case 31:case"end":return t.stop()}},t,null,[[6,24]])}));return function(){return t.apply(this,arguments)}}(),gt=x();O(function(){4===Z&>.current&>.current.focus()},[Z]);var mt={ref:(0,d.rM)(4===Z&&$),className:(0,l.pS)((0,r.A)({"gravitysmtp-setup-wizard__screen":!0},"gravitysmtp-setup-wizard__screen--step-".concat(4),!0)),"aria-hidden":4!==Z,"data-test-id":"setup-wizard-screen-04"},bt=(0,_.A)(lt,{activeIntegrationId:K,context:"wizard",integrationSettingsFormData:Q,saveConnectorSettings:vt,savingSettings:at,Svgs:h,i18n:null==c?void 0:c.i18n,addSnackBarMessage:ft});return l.q_.createElement("div",mt,l.q_.createElement("div",{className:"gravitysmtp-setup-wizard__screen-inner"},l.q_.createElement(l.mM,{scrollableNodeProps:{ref:gt}},l.q_.createElement("div",{className:"gravitysmtp-setup-wizard__content"},l.q_.createElement(v.A,{customClasses:["gravitysmtp-setup-wizard__content-header"],spacing:6},l.q_.createElement(g.A,{content:H,spacing:8,size:"display-sm",tagName:"h2",weight:"medium"}),l.q_.createElement(m.A,{content:(0,p.nv)(U,null==st?void 0:st.title),spacing:6,size:"text-lg",weight:"medium"}),l.q_.createElement("form",{id:K},l.q_.createElement(b.A,{id:K,fields:bt,setFieldData:function(t,n){return nt(K,t,n)}}))),l.q_.createElement(w.default,{i18n:F,backButtonCustomAttributes:{customAttributes:{"data-test-id":"setup-wizard-screen-04-back-button"}},skipButtonCustomAttributes:{customAttributes:{"data-test-id":"setup-wizard-screen-04-skip-button"},onClick:function(){tt("skipped"),V(),Y()}},nextButtonCustomAttributes:{customAttributes:{"data-test-id":"setup-wizard-screen-04-next-button"},onClick:vt,active:at,activeType:"loader",activeText:T,disabled:at||z.includes(K),icon:at?"":"arrow-narrow-right",lockSize:!0,ref:ot}})))))}},27764:function(t,n,e){var r,o=e(40450),i=e.n(o),u=(null===(r=(0,e(35739).zj)(i(),"gravitysmtp_admin_config"))||void 0===r?void 0:r.common)||{};n.A=function(){var t,n,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return{iconPrefix:"gravity-admin-icon",locked:(null==u||null===(t=u.data)||void 0===t||null===(t=t.locked_settings)||void 0===t?void 0:t.includes(e))||r,lockedMessage:o||(null==u||null===(n=u.i18n)||void 0===n?void 0:n.setting_locked)||""}}},28099:function(t,n,e){var r=e(90455),o=e(88856),i=e(78564),u=e.n(i),a=e(7175),c=e(63662),s=e(12094),l=e(87029),d=e(25787),p=e(66598),f=e(35739),v=e(6648),g=e(27764);function m(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,r)}return e}function b(t){for(var n=1;n=t.length?{done:!0}:{done:!1,value:t[r++]}},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 i,u=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw i}}}}function _(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e1&&void 0!==arguments[1]?arguments[1]:{},n=S(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t),e=O(n),r=y(e,t.activeIntegrationId);if(!["microsoft","google","generic","amazon","zoho"].includes(t.activeIntegrationId))return r;var o=r;return"google"===t.activeIntegrationId&&(o=h(o,t)),["microsoft","google","amazon","zoho"].includes(t.activeIntegrationId)?o=w(o,t):"generic"===t.activeIntegrationId&&(o=k(o,t)),o}},57290:function(t,n,e){var r,o,i,u,a,c=e(88856),s=e(7175),l=e(6648),d=e(35739),p=e(40450),f=e.n(p);function v(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,r)}return e}function g(t){for(var n=1;n0&&void 0!==g[0]?g[0]:"",o=g.length>1&&void 0!==g[1]?g[1]:"debug",i=p.data,a=void 0===i?{}:i,s=p.endpoints,f=(null==(l=void 0===s?{}:s)||null===(n=l.log_debug_item)||void 0===n?void 0:n.action)||"",v=(null==l||null===(e=l.log_debug_item)||void 0===e?void 0:e.nonce)||"",null!=a&&a.debug_log_enabled&&f&&v&&r){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,(0,d.bE)({endpoint:c(),body:{action:f,security:v,message:r,priority:o}}).catch(function(t){console.error(t)});case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t)})),v.apply(this,arguments)}},93313:function(t,n,e){var r=e(52888),o=e(8140);n.A=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"*",e=function(i){return Object.entries(i).reduce(function(i,u){var a=(0,o.A)(u,2),c=a[0],s=a[1];return"object"===(0,r.A)(s)&&null!==s?i[c]=e(s):t.includes(c)?i[c]=null===s?null:n.repeat(s.length):i[c]=s,i},Array.isArray(i)?[]:{})};return e(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}}}]);