"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[472],{27911(e,t,s){s(60405);var i=s(79124),n=s(13722),a=s(6072),r=s(69139),o=s(65591),l=s(10812),c=s(27901),d=s(8720),m=s(98933),p=s(14051),u=s(16791),h=s(25354),x=s(28691),g=s(4379),j=s(99091),_=s(86106);function b({title:e,description:t,htmlFor:s}){return(0,_.jsxs)("div",{className:"mailpoet-settings-label",children:[s?(0,_.jsx)("label",{className:"mailpoet-settings-label-title",htmlFor:s,children:e}):(0,_.jsx)("div",{className:"mailpoet-settings-label-title",children:e}),t&&(0,_.jsx)("p",{className:"description",children:t})]})}function v({children:e}){return(0,_.jsx)("div",{className:"mailpoet-settings-inputs",children:e})}var f=s(7378),k=s(83673),y=s(97041),w=s(9339),C=s(2726),F=s.n(C);function S(){const[e,t]=(0,f.useState)(!1),s=(0,w.d4)("isSaving"),i=(0,w.d4)("hasErrorFlag"),a=(0,w.d4)("getSavingError"),r=(0,w.d4)("hasReEngagementNotice"),o=(0,w.d4)("getReEngagementAction"),l=(0,w.y3)("saveSettings"),{notices:c}=(0,f.useContext)(n.F),d=c.error,m=c.success;return(0,f.useEffect)(()=>{e&&!s&&(a?d(a.map(e=>(0,_.jsx)("p",{children:e})),{scroll:!0}):(m((0,_.jsx)("p",{children:k.U.I18n.t("settingsSaved")}),{scroll:!0}),r&&((e,t,s)=>{if("deactivate"!==e){if("reactivate"===e){const e=F()(k.U.I18n.t("re-engagementReactivatedNotice"),/\[link\](.*?)\[\/link\]/g,e=>(0,_.jsx)("a",{href:"?page=mailpoet-newsletters#/re_engagement",rel:"noopener noreferrer",children:e},"reEngagementEmailsTabLink"));s((0,_.jsx)("p",{children:e}),{scroll:!0})}}else t((0,_.jsx)("p",{children:k.U.I18n.t("re-engagementDisabledNotice")}),{scroll:!0})})(o,d,m)))},[e,a,s,d,m,r,o]),(0,_.jsx)("div",{className:"mailpoet-settings-save",children:(0,_.jsx)(y.$,{type:"button",automationId:"settings-submit-button",isDisabled:s||i,onClick:()=>{t(!0),l()},children:k.U.I18n.t("saveSettings")})})}var N=s(38094);function K(e){const t=e.segmentsSelector?e.segmentsSelector:"getDefaultSegments",s=(0,w.d4)(t).map(e=>({value:e.id,label:e.name,count:e.subscribers})),i=s.filter(t=>e.value.includes(t.value));return(0,_.jsx)(N.ReactSelect,{isMulti:!0,defaultValue:i,id:e.id,placeholder:e.placeholder,options:s,onChange:t=>{e.setValue((t||[]).map(e=>e.value))}})}var I=s(41636);function T(e){const t=(0,w.d4)("getPages");let s=t.find(t=>t.id===parseInt(e.value,10));return s||(s=t[0]),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row mailpoet-settings-inputs-row-centered",children:[(0,_.jsx)(I.Select,{id:e.id,automationId:e.automationId,value:s.id,onChange:(0,m.k9)(e.setValue),isMinWidth:!0,dimension:"small",children:t.map(e=>(0,_.jsx)("option",{value:e.id,children:`${e.title}`},e.id))}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)("a",{className:"mailpoet-link",target:"_blank",title:(0,m.t)("previewPage"),rel:"noopener noreferrer",href:s.url[e.preview],"data-automation-id":e.linkAutomationId,children:(0,m.t)("preview")})]})}var E=s(68354),A=s(88516);function D({showModal:e}){const t=(0,w.d4)("isMssActive"),[s,i]=(0,w.iK)("sender","name"),[n,a]=(0,w.iK)("sender","address"),[r,o]=(0,f.useState)(!0),l=(0,m.Y8)(n),[c,d]=(0,f.useState)(!window.mailpoet_verified_sender_domains.includes(l)),[p,u]=(0,f.useState)(window.mailpoet_partially_verified_sender_domains.includes(l)),[h,x]=(0,w.iK)("reply_to","name"),[g,j]=(0,w.iK)("reply_to","address"),y=(0,w.y3)("setErrorFlag"),C=n&&!(0,m.xf)(n),F=g&&!(0,m.xf)(g),S=window.mailpoet_sender_restrictions?.skipAuthorization;return(0,f.useEffect)(()=>{y(C||F||!r&&t&&!S)},[F,C,y,r,t,S]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("defaultSenderTitle"),description:(0,m.t)("defaultSenderDescription"),htmlFor:"sender-name"}),(0,_.jsxs)(v,{children:[(0,_.jsx)("label",{htmlFor:"sender-name",children:(0,m.t)("from")}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",id:"sender-name",placeholder:(0,m.t)("yourName"),"data-automation-id":"from-name-field",value:s,onChange:(0,m.k9)(i)}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",placeholder:"from@mydomain.com","data-automation-id":"from-email-field",value:n,onChange:(0,m.k9)((0,m.Xv)(e=>{o(!0),d(!1),u(!1),a(e)})),onBlur:(0,m.k9)(e=>{if(!t)return;const s=(0,m.Y8)(e);window.mailpoet_verified_sender_domains.includes(s)||((e=>{o(window.mailpoet_authorized_emails.includes(e))})(e),d(!0),u(window.mailpoet_partially_verified_sender_domains.includes(s)))})}),(0,_.jsx)("br",{}),C&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,m.t)("invalidEmail")}),(0,_.jsx)("div",{className:"regular-text",children:(0,_.jsx)(A.Y,{emailAddress:n,mssActive:t,showModal:e,isEmailAuthorized:r,showSenderDomainWarning:c,isPartiallyVerifiedDomain:p,senderRestrictions:window.mailpoet_sender_restrictions,onSuccessfulEmailOrDomainAuthorization:e=>{"email"===e.type&&(o(!0),k.U.trackEvent("MSS in plugin authorize email",{"authorized email source":"settings",wasSuccessful:"yes"})),"domain"===e.type&&(d(!1),u(!1),k.U.trackEvent("MSS in plugin verify sender domain",{"verify sender domain source":"settings",wasSuccessful:"yes"}))}})}),(0,_.jsx)("label",{className:"mailpoet-settings-inputs-row",htmlFor:"reply_to-name",children:"Reply-to"}),(0,_.jsx)(E.p,{dimension:"small",type:"text",id:"reply_to-name",placeholder:(0,m.t)("yourName"),"data-automation-id":"reply_to-name-field",value:h,onChange:(0,m.k9)(x)}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",placeholder:"reply_to@mydomain.com","data-automation-id":"reply_to-email-field",value:g,onChange:(0,m.k9)((0,m.Xv)(j))}),(0,_.jsx)("br",{}),F&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,m.t)("invalidEmail")})]})]})}var M=s(32882);function P({title:e,description:t,event:s}){const[i,n]=(0,w.iK)("subscribe",s,"enabled"),[a,r]=(0,w.iK)("subscribe",s,"label"),[o,l]=(0,w.iK)("subscribe",s,"segments");return(0,f.useEffect)(()=>{""===a&&r((0,m.t)("yesAddMe"))},[a,r]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:e,description:t,htmlFor:`subscribe-${s}-enabled`}),(0,_.jsxs)(v,{children:[(0,_.jsx)(M.S,{id:`subscribe-${s}-enabled`,automationId:`subscribe-${s}-checkbox`,checked:"1"===i,onCheck:e=>n(e?"1":"0")}),"1"===i&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",value:a,onChange:(0,m.k9)(r)}),(0,_.jsx)("label",{className:"mailpoet-settings-inputs-row",htmlFor:`subscribe-${s}-segments`,children:(0,m.t)("usersWillBeSubscribedTo")}),(0,_.jsx)("div",{"data-automation-id":`subscribe-${s}-segments-selection`,children:(0,_.jsx)(K,{id:`subscribe-${s}-segments`,placeholder:(0,m.t)("chooseList"),value:o,setValue:l})})]})]})]})}function z(){const[e,t]=(0,w.iK)("subscription","pages","manage");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("manageSubTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("manageSubDescription1")," ",F()((0,m.t)("manageSubDescription2"),/\[link\](.*?)\[\/link\]/,e=>(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/222-customize-your-manage-subscription-page",rel:"noopener noreferrer",target:"_blank",children:e},e))]}),htmlFor:"subscription-manage-page"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(T,{value:e,preview:"manage",setValue:t,id:"subscription-manage-page",automationId:"subscription-manage-page-selection",linkAutomationId:"preview_manage_subscription_page_link"}),(0,_.jsx)("p",{children:F()((0,m.t)("hideListFromManageSubPage"),/\[link\](.*?)\[\/link\]/,e=>(0,_.jsx)("a",{className:"mailpoet-link",href:"/wp-admin/admin.php?page=mailpoet-lists#/",rel:"noopener noreferrer",target:"_blank",children:e},e))})]})]})}function $(){const[e,t]=(0,w.iK)("subscription","pages","unsubscribe"),[s,i]=(0,w.iK)("subscription","pages","confirm_unsubscribe"),[n,a]=(0,w.iK)("subscription","unsubscribe_survey","enabled"),[r,o]=(0,w.iK)("subscription","unsubscribe_survey","allow_other_text");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("unsubscribeTitle"),description:(0,_.jsxs)(_.Fragment,{children:[F()((0,m.t)("unsubscribeDescription1"),"[mailpoet_page]",()=>(0,_.jsx)("code",{children:"[mailpoet_page]"},"mp"))," ",F()((0,m.t)("unsubscribeDescription2"),/\[link\](.*?)\[\/link\]/,e=>(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/221-customize-your-unsubscribe-page",rel:"noopener noreferrer",target:"_blank",children:e},e))]}),htmlFor:"subscription-pages-unsubscribe"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,m.t)("confirmationPageTitle"),":"]}),(0,_.jsx)(T,{value:s,preview:"confirm_unsubscribe",setValue:i,id:"subscription-pages-unsubscribe-confirmation",automationId:"unsubscribe-confirmation-page-selection",linkAutomationId:"unsubscribe_page_preview_link_confirmation"}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,m.t)("successPageTitle"),":"]}),(0,_.jsx)(T,{value:e,preview:"unsubscribe",setValue:t,id:"subscription-pages-unsubscribe",automationId:"unsubscribe-success-page-selection",linkAutomationId:"unsubscribe_page_preview_link"}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(M.S,{id:"subscription-unsubscribe-survey-enabled",automationId:"unsubscribe-survey-enabled",checked:"1"===n,onCheck:e=>{a(e?"1":"0")}}),(0,_.jsx)("label",{htmlFor:"subscription-unsubscribe-survey-enabled",children:(0,m.t)("unsubscribeSurveyEnabled")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(M.S,{id:"subscription-unsubscribe-survey-allow-other-text",automationId:"unsubscribe-survey-allow-other-text",checked:"1"===r,disabled:"1"!==n,onCheck:e=>{o(e?"1":"0")}}),(0,_.jsx)("label",{htmlFor:"subscription-unsubscribe-survey-allow-other-text",children:(0,m.t)("unsubscribeSurveyAllowOtherText")})]})]})]})}function W(){const[e,t]=(0,w.iK)("stats_notifications","enabled"),[s,i]=(0,w.iK)("stats_notifications","automated"),[n,a]=(0,w.iK)("stats_notifications","address"),r=(0,w.y3)("setErrorFlag"),o=("1"===e||"1"===s)&&""===n.trim(),l=n&&!(0,m.xf)(n);return(0,f.useEffect)(()=>{r(o||l)},[o,l,r]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("statsNotifsTitle"),description:(0,m.t)("statsNotifsDescription"),htmlFor:"stats-enabled"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(M.S,{id:"stats-enabled",checked:"1"===e,onCheck:e=>t(e?"1":"0")}),(0,_.jsx)("label",{htmlFor:"stats-enabled",children:(0,m.t)("newslettersAndPostNotifs")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(M.S,{id:"stats-automated",checked:"1"===s,onCheck:e=>i(e?"1":"0")}),(0,_.jsx)("label",{htmlFor:"stats-automated",children:(0,m.t)("welcomeAndWcEmails")})]}),(0,_.jsx)(E.p,{dimension:"small",type:"email",value:n,onChange:(0,m.k9)((0,m.Xv)(a)),placeholder:"me@mydomain.com"}),o&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,m.t)("pleaseFillEmail")}),l&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,m.t)("invalidEmail")})]})]})}var R=s(63146);function q(){const[e,t]=(0,w.iK)("subscriber_email_notification","enabled"),[s,i]=(0,w.iK)("subscriber_email_notification","address"),n=(0,w.y3)("setErrorFlag"),a="1"===e&&""===s.trim(),r=s&&!(0,m.xf)(s);return(0,f.useEffect)(()=>{n(a||r)},[a,r,n]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("newSubscriberNotifsTitle"),description:(0,m.t)("newSubscriberNotifsDescription"),htmlFor:"subscriber_email_notification-enabled"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(R.s,{checked:"1"===e,value:"1",onCheck:t}),(0,m.t)("yes")," ",(0,_.jsx)(R.s,{checked:""===e,value:"",onCheck:t}),(0,m.t)("no"),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"email",value:s,onChange:(0,m.k9)((0,m.Xv)(i)),placeholder:"me@mydomain.com"}),a&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,m.t)("pleaseFillEmail")}),r&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,m.t)("invalidEmail")})]})]})}var L=s(78169),O=s(61630);function B({name:e,title:t,description:s}){const[i,n]=(0,f.useState)([]),[a,o]=(0,f.useState)(""),[l,c]=(0,f.useState)(null),[d,p]=(0,f.useState)(null),[u,h]=(0,f.useState)(""),[x,g]=(0,f.useState)("");let j=`[${e}`;return i.length&&(j+=` segments="${i.join(",")}"`),l&&(j+=` start_date="${k.U.Date.format(l,{format:"Y-m-d"})}"`),d&&(j+=` end_date="${k.U.Date.format(d,{format:"Y-m-d"})}"`),a&&parseInt(a,10)>0&&(j+=` in_the_last_days="${a}"`),u&&u.length>0&&(j+=` subject_contains="${u}"`),x&&parseInt(x,10)>0&&(j+=` limit="${x}"`),j+="]",(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:t,description:s,htmlFor:`${e}-shortcode`}),(0,_.jsxs)(v,{children:[(0,_.jsx)(E.p,{dimension:"small",readOnly:!0,type:"text",value:j,onClick:e=>{e.target.focus(),e.target.select()},id:`${e}-shortcode`}),(0,_.jsx)(O.T,{variant:"secondary",targetId:`${e}-shortcode`,alwaysSelectText:!0}),(0,_.jsx)("br",{}),(0,_.jsx)(K,{value:i,setValue:n,id:`${e}-shortcode-segments`,placeholder:(0,m.t)("leaveEmptyToDisplayAll"),segmentsSelector:"getSegments"}),"mailpoet_archive"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{type:"number",min:"1",max:"365000",dimension:"small",tooltip:(0,r.__)("Include newsletters sent no more than this many days ago. This overrides start and end dates.","mailpoet"),name:"in_the_last_days",placeholder:(0,r.__)("In the last days","mailpoet"),onChange:e=>{const t=e.target.value.trim();if(""===t)return void o("");const s=Number(t);Number.isInteger(s)&&s>0&&(c(null),p(null),o(t))},value:a}),(0,_.jsx)("br",{}),(0,_.jsx)(L.t,{dimension:"small",formatWithWordPressSettings:!0,onChange:e=>{c(e),null!==e&&o("")},selected:l,maxDate:d,placeholderText:(0,r.__)("Start date","mailpoet"),isClearable:!0}),(0,_.jsx)(L.t,{dimension:"small",formatWithWordPressSettings:!0,onChange:e=>{p(e),null!==e&&o("")},selected:d,minDate:l,placeholderText:(0,r.__)("End date","mailpoet"),isClearable:!0}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",value:u,onChange:e=>h(e.target.value),placeholder:(0,r.__)("Subject lines containing","mailpoet")}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{type:"number",min:"1",max:"1000",dimension:"small",placeholder:(0,r.__)("Maximum number to display","mailpoet"),onChange:e=>{const t=e.target.value.trim();if(""===t)return void g("");const s=Number(t);Number.isInteger(s)&&s>0&&g(t)},value:x})]})]})]})}function V(){return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("gdprTitle"),description:(0,m.t)("gdprDescription"),htmlFor:"gdpr-compliant"}),(0,_.jsx)(v,{children:(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/246-guide-to-conform-to-gdpr",title:(0,m.t)("readGuide"),target:"_blank",rel:"noopener noreferrer",children:(0,m.t)("readGuide")})})]})}function U(){const[e,t]=(0,w.iK)("reEngagement","page");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("reEngagementTitle"),description:(0,m.t)("reEngagementDescription"),htmlFor:"re-engagement-page"}),(0,_.jsx)(v,{children:(0,_.jsx)(T,{value:e,preview:"re_engagement",setValue:t,id:"re-engagement-page"})})]})}function H(){const{showModal:e}=(0,j.g)();return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(D,{showModal:e}),(0,_.jsx)(P,{event:"on_comment",title:(0,m.t)("subscribeInCommentsTitle"),description:(0,m.t)("subscribeInCommentsDescription")}),(0,_.jsx)(P,{event:"on_register",title:(0,m.t)("subscribeInRegistrationTitle"),description:(0,m.t)("subscribeInRegistrationDescription")}),(0,_.jsx)(z,{}),(0,_.jsx)($,{}),(0,_.jsx)(U,{}),(0,_.jsx)(W,{}),(0,_.jsx)(q,{}),(0,_.jsx)(B,{name:"mailpoet_archive",title:(0,m.t)("archiveShortcodeTitle"),description:(0,m.t)("archiveShortcodeDescription")}),(0,_.jsx)(B,{name:"mailpoet_subscribers_count",title:(0,m.t)("subscribersCountShortcodeTitle"),description:(0,m.t)("subscribersCountShortcodeDescription")}),(0,_.jsx)(V,{}),(0,_.jsx)(S,{})]})}function G(){const[e,t]=(0,w.iK)("cron_trigger","method"),s=(0,w.d4)("getPaths");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,r.__)("Newsletter task scheduler (cron)","mailpoet"),description:(0,_.jsxs)(_.Fragment,{children:[(0,r.__)("Select what will activate your newsletter queue.","mailpoet")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/129-newsletter-task-scheduler-cron",rel:"noopener noreferrer",target:"_blank",children:(0,r.__)("Read more.","mailpoet")})]}),htmlFor:"cron_trigger-method"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"cron_trigger-method-action-scheduler",value:"Action Scheduler",checked:"Action Scheduler"===e,onCheck:t,automationId:"action_scheduler_cron_radio"}),(0,_.jsx)("label",{htmlFor:"cron_trigger-method-action-scheduler",children:(0,r.__)("Action Scheduler (recommended)","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"cron_trigger-method-wordpress",value:"WordPress",checked:"WordPress"===e,onCheck:t,automationId:"wordress_cron_radio"}),(0,_.jsx)("label",{htmlFor:"cron_trigger-method-wordpress",children:(0,r.__)("Visitors to your website","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"cron_trigger-method-cron",value:"Linux Cron",checked:"Linux Cron"===e,onCheck:t,automationId:"linux_cron_radio"}),(0,_.jsx)("label",{htmlFor:"cron_trigger-method-cron",children:(0,r.__)("Server side cron (Linux cron)","mailpoet")})]}),"Disabled"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"cron_trigger-method-disabled",value:"Disabled",checked:"Disabled"===e,onCheck:t,automationId:"disabled_cron_radio"}),(0,_.jsx)("label",{htmlFor:"cron_trigger-method-disabled",children:(0,r.__)("Disabled","mailpoet")})]}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,r.__)("MailPoet will not process scheduled emails automatically.","mailpoet")})]}),"Linux Cron"===e&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,r.__)("To use this option please add this command to your crontab:","mailpoet")}),(0,_.jsx)(E.p,{dimension:"small",type:"text",readOnly:!0,value:`php ${s.plugin}/mailpoet-cron.php ${s.root}`}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,r.__)("With the frequency of running it every minute:","mailpoet")}),(0,_.jsx)(E.p,{dimension:"small",type:"text",readOnly:!0,value:"*/1 * * * *"})]})]})]})}function Y(){const e=(0,w.d4)("hasMembersPlugin");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("rolesTitle"),description:(0,m.t)("rolesDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,_.jsx)("p",{children:e?(0,_.jsx)("a",{className:"mailpoet-link",href:"?page=roles",children:(0,m.t)("manageUsingMembers")}):F()((0,m.t)("installMembers"),/\[link\](.*?)\[\/link\]/,e=>(0,_.jsx)("a",{className:"mailpoet-link",href:"https://wordpress.org/plugins/members/",rel:"noopener noreferrer",target:"_blank",children:e},e))})})]})}function X(){const[e,t]=(0,w.iK)("tracking","level");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("engagementTrackingTitle"),description:(0,m.t)("engagementTrackingDescription"),htmlFor:"engagement_tracking"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"tracking-basic",value:"basic",checked:"basic"===e,onCheck:t,automationId:"tracking-basic-radio"}),(0,_.jsx)("label",{htmlFor:"tracking-basic",children:(0,m.t)("engagementTrackingBasic")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"tracking-partial",value:"partial",checked:"partial"===e,onCheck:t,automationId:"tracking-partial-radio"}),(0,_.jsx)("label",{htmlFor:"tracking-partial",children:(0,m.t)("engagementTrackingPartial")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"tracking-full",value:"full",checked:"full"===e,onCheck:t,automationId:"tracking-full-radio"}),(0,_.jsx)("label",{htmlFor:"tracking-full",children:(0,m.t)("engagementTrackingFull")})]})]})]})}function Z(){const[e,t]=(0,w.iK)("tracking","opens");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,r.__)("Human and machine opens","mailpoet"),description:(0,r.__)("Choose how human and machine opens should be displayed.","mailpoet"),htmlFor:"opens_mode"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"opens-merged",value:"merged",checked:"merged"===e,onCheck:t,automationId:"opens-merged-radio"}),(0,_.jsx)("label",{htmlFor:"opens-merged",children:(0,r.__)("Merged – both are counted as total opens. Similar to other email marketing tools.","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"opens-separated",value:"separated",checked:"separated"===e,onCheck:t,automationId:"opens-separated-radio"}),(0,_.jsx)("label",{htmlFor:"opens-separated",children:(0,r.__)("Separated – only human opens are counted as total opens. More accurate, but the numbers tend to be lower.","mailpoet")})]})]})]})}function Q(){const[e]=(0,w.iK)("smtp_provider"),t=(0,w.d4)("isMssActive"),[s,i]=(0,w.iK)("send_transactional_emails");let n="";return t?n="MailPoet Sending Service":"manual"===e?n="SMTP":"SendGrid"===e?n="SendGrid":"AmazonSES"===e?n="Amazon SES":"server"===e&&(n=(0,m.t)("hostOption")),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("transactionalTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("transactionalDescription")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("transactionalLink")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(R.s,{id:"transactional-enabled",value:"1",checked:"1"===s,onCheck:i}),(0,_.jsxs)("label",{htmlFor:"transactional-enabled",children:[(0,m.t)("transactionalCurrentMethod").replace("%1$s",n),(0,_.jsx)("br",{}),(0,_.jsx)("span",{className:"mailpoet-note",children:F()((0,m.t)("transactionalMssNote"),/\[link\](.*?)\[\/link\]/,e=>(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails#attachments",rel:"noopener noreferrer",target:"_blank",children:e},e))})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"transactional-disabled",value:"",checked:""===s,onCheck:i}),(0,_.jsx)("label",{htmlFor:"transactional-disabled",children:(0,m.t)("transactionalWP")})]})]})]})}function J(){const[e,t]=(0,w.iK)("deactivate_subscriber_after_inactive_days"),[s]=(0,w.iK)("tracking","level"),i="basic"!==s;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("inactiveSubsTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("inactiveSubsDescription")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/264-inactive-subscribers",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("readMore")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[!i&&(0,_.jsx)("p",{"data-automation-id":"inactive-subscribers-disabled",children:(0,m.t)("disabledBecauseTrackingIs")}),i&&(0,_.jsxs)("div",{"data-automation-id":"inactive-subscribers-enabled",children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"inactive-subscribers-disabled",automationId:"inactive-subscribers-option-never",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-disabled",children:(0,m.t)("never")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"inactive-subscribers-3-months",value:"90",checked:"90"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-3-months",children:(0,m.t)("after3months")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"inactive-subscribers-6-months",value:"180",checked:"180"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-6-months",children:(0,m.t)("after6months")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"inactive-subscribers-12-months",value:"365",checked:"365"===e,onCheck:t,automationId:"inactive-subscribers-default"}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-12-months",children:(0,m.t)("after12months")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"inactive-subscribers-18-months",value:"540",checked:"540"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-18-months",children:(0,m.t)("after18months")})]})]})]})]})}function ee(){const[e,t]=(0,w.iK)("sending_status_retention_days");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,r.__)("Sending status data retention","mailpoet"),description:(0,r.__)('Choose how long per-subscriber sending records are kept after a newsletter has been sent. Select "Never" to keep records indefinitely — recommended if you have compliance or audit requirements.',"mailpoet"),htmlFor:""}),(0,_.jsx)(v,{children:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-status-retention-never",automationId:"sending-status-retention-option-never",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-status-retention-never",children:(0,r.__)("Never (default)","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-status-retention-1-month",automationId:"sending-status-retention-option-1-month",value:"30",checked:"30"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-status-retention-1-month",children:(0,r.__)("After 1 month","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-status-retention-2-months",automationId:"sending-status-retention-option-2-months",value:"60",checked:"60"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-status-retention-2-months",children:(0,r.__)("After 2 months","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-status-retention-3-months",automationId:"sending-status-retention-option-3-months",value:"90",checked:"90"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-status-retention-3-months",children:(0,r.__)("After 3 months","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-status-retention-6-months",automationId:"sending-status-retention-option-6-months",value:"180",checked:"180"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-status-retention-6-months",children:(0,r.__)("After 6 months","mailpoet")})]})]})})]})}function te(){const[e,t]=(0,w.iK)("sending_queue_body_retention_days");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("sendingQueueBodyCleanupTitle"),description:(0,m.t)("sendingQueueBodyCleanupDescription"),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-queue-body-cleanup-never",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-queue-body-cleanup-never",children:(0,m.t)("never")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-queue-body-cleanup-7-days",value:"7",checked:"7"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-queue-body-cleanup-7-days",children:(0,m.t)("after7days")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-queue-body-cleanup-30-days",value:"30",checked:"30"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-queue-body-cleanup-30-days",children:(0,m.t)("after30days")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-queue-body-cleanup-90-days",value:"90",checked:"90"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-queue-body-cleanup-90-days",children:(0,m.t)("after90days")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"sending-queue-body-cleanup-365-days",value:"365",checked:"365"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"sending-queue-body-cleanup-365-days",children:(0,m.t)("after365days")})]})]})]})}function se(){const[e,t]=(0,w.iK)("collect_subscriber_timezones","enabled");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("collectSubscriberTimeZonesTitle"),description:(0,m.t)("collectSubscriberTimeZonesDescription"),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(R.s,{id:"collect-subscriber-timezones-enabled",value:"1",checked:"1"===e,onCheck:t,automationId:"collect-subscriber-timezones-yes"}),(0,_.jsx)("label",{htmlFor:"collect-subscriber-timezones-enabled",children:(0,m.t)("yes")}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)(R.s,{id:"collect-subscriber-timezones-disabled",value:"",checked:""===e,onCheck:t,automationId:"collect-subscriber-timezones-no"}),(0,_.jsx)("label",{htmlFor:"collect-subscriber-timezones-disabled",children:(0,m.t)("no")})]})]})}function ie(){const[e,t]=(0,w.iK)("analytics","enabled");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("shareDataTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("shareDataDescription")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/130-sharing-your-data-with-us",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("readMore")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(R.s,{id:"share-data-enabled",value:"1",checked:"1"===e,onCheck:t,automationId:"analytics-yes"}),(0,_.jsx)("label",{htmlFor:"share-data-enabled",children:(0,m.t)("yes")}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)(R.s,{id:"share-data-disabled",value:"",checked:""===e,onCheck:t,automationId:"analytics-no"}),(0,_.jsx)("label",{htmlFor:"share-data-disabled",children:(0,m.t)("no")})]})]})}function ne(){const[e,t]=(0,w.iK)("3rd_party_libs","enabled");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("libs3rdPartyTitle"),description:(0,_.jsxs)(_.Fragment,{children:[F()((0,m.t)("libs3rdPartyDescription"),/\[link\](.*?)\[\/link\]/,e=>(0,_.jsx)("a",{href:"https://www.mailpoet.com/support/",rel:"noopener noreferrer",target:"_blank",children:e},e))," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/338-enabledisable-3rd-party-libraries",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("readMore")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(R.s,{id:"libs-3rd-party-enabled",value:"1",checked:"1"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"libs-3rd-party-enabled",children:(0,m.t)("yes")}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)(R.s,{id:"libs-3rd-party-disabled",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"libs-3rd-party-disabled",children:(0,m.t)("no")})]})]})}function ae(){const[e,t]=(0,w.iK)("captcha","type"),[s,i]=(0,w.iK)("captcha","recaptcha_site_token"),[n,a]=(0,w.iK)("captcha","recaptcha_secret_token"),[r,o]=(0,w.iK)("captcha","recaptcha_invisible_site_token"),[l,c]=(0,w.iK)("captcha","recaptcha_invisible_secret_token"),[d,p]=(0,w.iK)("captcha","turnstile_site_token"),[u,h]=(0,w.iK)("captcha","turnstile_secret_token"),x=(0,w.d4)("isBuiltInCaptchaSupported"),g=(0,w.y3)("setErrorFlag"),j="recaptcha"===e&&""===s.trim(),k="recaptcha"===e&&""===n.trim(),y="recaptcha-invisible"===e&&""===r.trim(),C="recaptcha-invisible"===e&&""===l.trim(),F="turnstile"===e&&""===d.trim(),S="turnstile"===e&&""===u.trim();return(0,f.useEffect)(()=>{g(j||k||C||y||F||S)},[k,j,C,y,S,F,g]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("captchaTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("captchaDescription")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/182-add-a-captcha-to-subscription-forms",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("readMore")})," ",("recaptcha"===e||"recaptcha-invisible"===e)&&(0,_.jsxs)("span",{children:[(0,_.jsxs)("span",{children:[(0,m.t)("reCaptchaDescription")," "]}),(0,_.jsx)("a",{className:"mailpoet-link",href:"https://www.google.com/recaptcha/admin",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("signupForCaptchaKey")})]}),"turnstile"===e&&(0,_.jsxs)("span",{children:[(0,_.jsxs)("span",{children:[(0,m.t)("turnstileDescription")," "]}),(0,_.jsx)("a",{className:"mailpoet-link",href:"https://dash.cloudflare.com/?to=/:account/turnstile",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("signupForCaptchaKey")})]})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"built-in-captcha",disabled:!x,value:"built-in",checked:"built-in"===e,onCheck:t}),(0,_.jsxs)("label",{htmlFor:"built-in-captcha",children:[(0,m.t)("builtInCaptcha")," ",!x&&(0,m.t)("disbaledBecauseExtensionMissing")]})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"google-captcha",value:"recaptcha",checked:"recaptcha"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"google-captcha",children:(0,m.t)("googleReCaptchaCheckbox")})]}),"recaptcha"===e&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(E.p,{dimension:"small",type:"text",value:s,onChange:(0,m.k9)(i),placeholder:(0,m.t)("yourReCaptchaKey")}),j&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error mailpoet_error_captcha",children:(0,m.t)("fillReCaptchaKeys")}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",value:n,onChange:(0,m.k9)(a),placeholder:(0,m.t)("yourReCaptchaSecret")}),k&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error mailpoet_error_captcha",children:(0,m.t)("fillReCaptchaKeys")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"google-captcha-invisible",value:"recaptcha-invisible",checked:"recaptcha-invisible"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"google-captcha-invisible",children:(0,m.t)("googleReCaptchaInvisible")})]}),"recaptcha-invisible"===e&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(E.p,{dimension:"small",type:"text",value:r,onChange:(0,m.k9)(o),placeholder:(0,m.t)("yourReCaptchaKey")}),y&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error mailpoet_error_captcha",children:(0,m.t)("fillReCaptchaKeys")}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",value:l,onChange:(0,m.k9)(c),placeholder:(0,m.t)("yourReCaptchaSecret")}),C&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error mailpoet_error_captcha",children:(0,m.t)("fillReCaptchaKeys")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"cloudflare-turnstile",value:"turnstile",checked:"turnstile"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"cloudflare-turnstile",children:(0,m.t)("cloudflareTurnstile")})]}),"turnstile"===e&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(E.p,{dimension:"small",type:"text",value:d,onChange:(0,m.k9)(p),placeholder:(0,m.t)("yourTurnstileKey")}),F&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error mailpoet_error_captcha",children:(0,m.t)("fillTurnstileKeys")}),(0,_.jsx)("br",{}),(0,_.jsx)(E.p,{dimension:"small",type:"text",value:u,onChange:(0,m.k9)(h),placeholder:(0,m.t)("yourTurnstileSecret")}),S&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error mailpoet_error_captcha",children:(0,m.t)("fillTurnstileKeys")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"no-captcha",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"no-captcha",children:(0,m.t)("disable")})]})]})]})}function re(){const e=(0,w.y3)("reinstall"),{notices:t}=(0,f.useContext)(n.F);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("reinstallTitle"),description:(0,m.t)("reinstallDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,_.jsx)(y.$,{type:"button",onClick:async()=>{if(window.confirm((0,m.t)("reinstallConfirmation"))){const s=await e();"SAVE_FAILED"===s.type?t.error(s.error.map(e=>(0,_.jsx)("p",{children:e})),{scroll:!0}):window.location.href=`admin.php?page=${k.U.mainPageSlug}`}},automationId:"reinstall-button",variant:"destructive",children:(0,m.t)("reinstallNow")})})]})}function oe(){const e=(0,w.y3)("recalculateSubscribersScore"),{notices:t}=(0,f.useContext)(n.F);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("recalculateSubscribersScoreTitle"),description:(0,m.t)("recalculateSubscribersScoreDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,_.jsx)(y.$,{type:"button",onClick:async()=>{await e(),t.info((0,_.jsx)("p",{children:(0,m.t)("recalculateSubscribersScoreNotice")}),{scroll:!0})},variant:"secondary",dimension:"small",children:(0,m.t)("recalculateSubscribersScoreNow")})})]})}function le(){const[e,t]=(0,w.iK)("logging");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("loggingTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("loggingDescription")," ",(0,_.jsx)("a",{href:"?page=mailpoet-logs",className:"mailpoet-link",children:(0,m.t)("loggingDescriptionLink")})]}),htmlFor:"logging-level"}),(0,_.jsx)(v,{children:(0,_.jsxs)(I.Select,{id:"logging-level",value:e,onChange:(0,m.k9)(t),automationId:"logging-select-box",isMinWidth:!0,dimension:"small",children:[(0,_.jsx)("option",{value:"everything","data-automation-id":"log-everything",children:(0,m.t)("everythingLogOption")}),(0,_.jsx)("option",{value:"errors","data-automation-id":"log-errors",children:(0,m.t)("errorsLogOption")}),(0,_.jsx)("option",{value:"nothing","data-automation-id":"log-nothing",children:(0,m.t)("nothingLogOption")})]})})]})}function ce(){const[e,t]=(0,w.iK)("bounce","address");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("bounceEmail"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("yourBouncedEmails")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/180-bounce-management-in-mailpoet-3",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("readMore")})]}),htmlFor:"bounce-address"}),(0,_.jsx)(v,{children:(0,_.jsx)(E.p,{dimension:"small",type:"text",id:"bounce-address",placeholder:"bounce@mydomain.com","data-automation-id":"bounce-address-field",value:e,onChange:(0,m.k9)((0,m.Xv)(t))})})]})}function de(){const[e,t]=(0,w.iK)("captcha","on_register_forms","enabled"),s=(0,w.d4)("hasWooCommerce");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("captchaOnRegisterTitle"),description:(0,m.t)(s?"captchaOnRegisterWooActiveDescription":"captchaOnRegisterWooInactiveDescription"),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(R.s,{id:"captcha-on-register-enabled",value:"1",checked:"1"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"captcha-on-register-enabled",children:(0,m.t)("yes")}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)(R.s,{id:"captcha-on-register-disabled",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"captcha-on-register-disabled",children:(0,m.t)("no")})]})]})}function me(){const[e,t]=(0,w.iK)("subscription","pages","captcha");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,r.__)("Built-in CAPTCHA page","mailpoet"),description:(0,_.jsx)(_.Fragment,{children:F()((0,r.__)("Built-in CAPTCHA is shown when users need to verify they’re not a robot. You can customize this page by editing it in WordPress and using the [mailpoet_page] shortcode to display the CAPTCHA form.","mailpoet"),"[mailpoet_page]",()=>(0,_.jsx)("code",{children:"[mailpoet_page]"},"mp"))}),htmlFor:"subscription-pages-captcha"}),(0,_.jsx)(v,{children:(0,_.jsx)(T,{value:e,preview:"captcha",setValue:t,id:"subscription-pages-captcha"})})]})}function pe(){const[e]=(0,w.iK)("captcha","type");return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(ce,{}),(0,_.jsx)(G,{}),(0,_.jsx)(Y,{}),(0,_.jsx)(X,{}),(0,_.jsx)(Z,{}),(0,_.jsx)(Q,{}),(0,_.jsx)(oe,{}),(0,_.jsx)(J,{}),(0,_.jsx)(ee,{}),(0,_.jsx)(te,{}),(0,_.jsx)(se,{}),(0,_.jsx)(ie,{}),(0,_.jsx)(ne,{}),(0,_.jsx)(ae,{}),"built-in"===e&&(0,_.jsx)(me,{}),(0,_.jsx)(de,{}),(0,_.jsx)(re,{}),(0,_.jsx)(le,{}),(0,_.jsx)(S,{})]})}var ue=s(70813),he=s(66162),xe=s(87560),ge=s(14240);const je=F()((0,m.t)("premiumTabDescription"),/\[link\](.*?)\[\/link\]/g,e=>(0,_.jsx)("a",{href:"https://account.mailpoet.com/account?utm_source=plugin&utm_medium=settings&utm_campaign=activate-existing-plan&ref=settings-key-activation",target:"_blank",rel:"noopener noreferrer",children:e},"premium-tab-description")),_e=F()((0,m.t)("premiumTabGetKey"),/\[link\](.*?)\[\/link\]/g,e=>(0,_.jsx)("a",{href:"https://account.mailpoet.com/account?utm_source=plugin&utm_medium=settings&utm_campaign=activate-existing-plan&ref=settings-key-activation",target:"_blank",rel:"noopener noreferrer",children:e},"premium-tab-get-key"));function be({subscribersCount:e}){const t=(0,w.d4)("getKeyActivationState"),s=(0,w.y3)("updateKeyActivationState"),i=(0,w.y3)("sendCongratulatoryMssEmail"),[n,a]=(0,w.iK)("sender","address"),[r,o]=(0,w.iK)("authorized_emails_addresses_check"),l=(0,w.y3)("setSaveDone"),c=(t.fromAddressModalCanBeShown||JSON.parse(sessionStorage.getItem("mailpoet_from_address_modal_can_be_shown")))&&t.mssStatus===ue.W0.VALID_MSS_ACTIVE&&(!n||r);return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(b,{htmlFor:"mailpoet_premium_key",title:(0,m.t)("premiumTabActivationKeyLabel"),description:(0,_.jsxs)(_.Fragment,{children:[je,(0,_.jsx)("br",{}),(0,_.jsx)("br",{}),_e,(0,_.jsx)("br",{}),(0,_.jsx)("br",{}),F()((0,m.t)("premiumTabGetPlan"),/\[link\](.*?)\[\/link\]/g,t=>(0,_.jsx)("a",{href:`https://account.mailpoet.com/?s=${e}&utm_source=plugin&utm_medium=settings&utm_campaign=create-new-plan&ref=settings-key-activation`,target:"_blank",rel:"noopener noreferrer",children:t},"premium-tab-get-plan"))]})}),(0,_.jsxs)(v,{children:[(0,_.jsx)(ge.M,{}),(0,_.jsx)(xe.y,{label:(0,m.t)("premiumTabVerifyButton")})]}),c&&(0,_.jsx)(he.U,{onRequestClose:()=>{s({fromAddressModalCanBeShown:!1}),i(),sessionStorage.removeItem("mailpoet_from_address_modal_can_be_shown")},setAuthorizedAddress:async e=>{sessionStorage.removeItem("mailpoet_from_address_modal_can_be_shown"),await a(e),await o(null),l()}})]})}var ve=s(36125);function fe(){const e=(0,j.Zp)(),t=(0,w.d4)("isMssActive"),[s]=(0,w.iK)("mta","mailpoet_api_key"),{mssStatus:i,premiumStatus:n}=(0,w.d4)("getKeyActivationState"),a=null!==i&&i!==ue.W0.INVALID,r=null!==n&&n!==ue.Ks.INVALID,o=window.mailpoet_free_plan_url,l=(0,w.y3)("setSetting"),c=(0,w.y3)("saveSettings");return(0,_.jsxs)("ul",{className:"mailpoet-sending-methods",children:[(0,_.jsx)("li",{children:(0,_.jsxs)("label",{className:"mailpoet-sending-method mailpoet-form-checkbox",children:[(0,_.jsx)("input",{type:"radio",checked:t,onChange:async i=>{i.preventDefault(),t||a||e("/premium"),!t&&a&&await(async()=>(await l(["mta_group"],"mailpoet"),await l(["mta","method"],"MailPoet"),await l(["mta","mailpoet_api_key"],s),await l(["signup_confirmation","enabled"],"1"),c()))()}}),(0,_.jsx)("span",{className:"mailpoet-form-radio-control"}),(0,_.jsx)("h4",{className:"mailpoet-h4",children:(0,m.t)("mssTitle")}),(0,_.jsx)("p",{children:t?(0,m.t)("youreSendingWithMss"):(0,m.t)("solveSendingProblems")}),(0,_.jsxs)("ul",{className:"mailpoet-sending-method-benefits mailpoet_success",children:[(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,m.t)("mssBenefit1")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,m.t)("mssBenefit2")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,m.t)("mssBenefit3")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,m.t)("mssBenefit4")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,m.t)("mssBenefit5")})]}),!a&&!r&&(0,_.jsxs)("div",{className:"mailpoet-sending-method-actions",children:[(0,_.jsx)("a",{className:"mailpoet-button button-primary",href:o,rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("freeUpto")}),(0,_.jsxs)("span",{children:[" ",(0,m.t)("or")," "]}),F()((0,m.t)("enterYourKey"),/\[link\](.*?)\[\/link\]/g,(e,t)=>(0,_.jsx)(ve.Link,{to:"/premium",className:"mailpoet-link",children:e},t))]}),!a&&r&&(0,_.jsxs)("div",{className:"mailpoet-sending-method-actions",children:[(0,_.jsx)("i",{children:(0,m.t)("invalidKeyForMss")})," ",(0,_.jsx)("a",{className:"mailpoet-button button-primary",href:"https://account.mailpoet.com/",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("getPlan")})]})]})}),(0,_.jsx)("li",{children:(0,_.jsxs)("label",{className:"mailpoet-sending-method mailpoet-form-checkbox",children:[(0,_.jsx)("input",{type:"radio",checked:!t,onChange:t=>{t.preventDefault(),e("/mta/other")}}),(0,_.jsx)("span",{className:"mailpoet-form-radio-control"}),(0,_.jsx)("h4",{className:"mailpoet-h4",children:(0,m.t)("otherTitle")}),(0,_.jsxs)("p",{children:[(0,m.t)("sendViaHost")," ",(0,_.jsx)("strong",{children:(0,m.t)("notRecommended")})," ",(0,m.t)("orViaThirdParty")]}),(0,_.jsx)("div",{className:"mailpoet-sending-method-actions",children:(0,_.jsx)(ve.Link,{to:"/mta/other",className:"mailpoet-link",children:(0,m.t)("configure")})})]})})]})}function ke(){const[e,t]=(0,w.iK)("smtp_provider"),[,s]=(0,w.iK)("mta_group"),[,i]=(0,w.iK)("mta","method");return(0,f.useEffect)(()=>{switch(e){case"server":s("website"),i("PHPMail");break;case"manual":s("smtp"),i("SMTP");break;case"AmazonSES":s("smtp"),i("AmazonSES");break;case"SendGrid":s("smtp"),i("SendGrid");break;default:i("PHPMail")}},[e,s,i]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("method"),htmlFor:"mailpoet_smtp_method"}),(0,_.jsx)(v,{children:(0,_.jsxs)(I.Select,{id:"mailpoet_smtp_method",value:e,onChange:(0,m.k9)(t),isMinWidth:!0,dimension:"small",children:[(0,_.jsx)("option",{value:"server",children:(0,m.t)("hostOption")}),(0,_.jsx)("option",{value:"manual",children:(0,m.t)("smtpOption")}),(0,_.jsxs)("optgroup",{label:(0,m.t)("selectProvider"),children:[(0,_.jsx)("option",{value:"AmazonSES",children:"Amazon SES"}),(0,_.jsx)("option",{value:"SendGrid",children:"SendGrid"})]})]})})]})}function ye(){return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("spfTitle"),description:(0,m.t)("spfDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,m.t)("spfSetup")})]})}var we=s(97997),Ce=s(14442);function Fe(){const[e,t]=(0,f.useState)(window.mailpoet_current_user_email),[s]=(0,w.iK)("mta"),{state:i,error:n}=(0,w.d4)("getTestEmailState"),a=(0,w.y3)("sendTestEmail");return(0,_.jsxs)(_.Fragment,{children:[i===ue.cP.SENDING&&(0,_.jsx)(d.R,{}),i===ue.cP.SUCCESS&&(0,_.jsx)(Ce.$,{type:"success",scroll:!0,children:(0,_.jsx)("p",{children:(0,m.t)("emailSent")})}),i===ue.cP.FAILURE&&(0,_.jsx)(Ce.$,{type:"error",scroll:!0,children:(0,_.jsx)("p",{children:n.map(e=>(0,_.jsx)("p",{children:e},e))})}),(0,_.jsx)(b,{title:(0,m.t)("testSending"),htmlFor:"mailpoet_mta_test_email"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(E.p,{dimension:"small",type:"text",id:"mailpoet_mta_test_email",value:e,onChange:(0,m.k9)(t)}),(0,_.jsx)(y.$,{type:"button",dimension:"small",variant:"secondary",onClick:()=>a(e,s),children:(0,m.t)("sendTestEmail")}),(0,_.jsx)(we.Tooltip,{tooltipId:"tooltip-settings-test",className:"mailpoet_tooltip_icon",tooltip:(0,_.jsx)("span",{style:{pointerEvents:"all"},children:F()((0,m.t)("testEmailTooltip"),/\[link\](.*?)\[\/link\]/g,(e,t)=>(0,_.jsx)("a",{className:"mailpoet-link",target:"_blank",rel:"noopener noreferrer",href:"https://kb.mailpoet.com/article/146-the-newsletters-are-not-being-received",children:e},t))})})]})]})}function Se(){const e=(0,w.y3)("saveSettings"),t=(0,w.y3)("loadSettings"),s=(0,j.Zp)();return(0,_.jsxs)("div",{className:"mailpoet-settings-save",children:[(0,_.jsx)(y.$,{type:"button",onClick:async()=>{await e(),s("/mta")},children:(0,m.t)("activate")}),(0,_.jsx)(y.$,{onClick:async()=>{k.U.Modal.loading(!0),await t(),s("/mta"),k.U.Modal.loading(!1)},variant:"tertiary",children:(0,m.t)("orCancel")})]})}function Ne(e){const t=Math.floor(parseInt(e,10));return t>60?(0,m.t)("everyHours").replace("%1$d",""+t/60):60===t?(0,m.t)("everyHour"):t>1?(0,m.t)("everyMinutes").replace("%1$d",`${t}`):(0,m.t)("everyMinute")}function Ke({recommendedEmails:e,recommendedInterval:t}){const[s,i]=(0,w.iK)("mailpoet_sending_frequency"),[n,a]=(0,w.iK)("mta","frequency","emails"),[r,o]=(0,w.iK)("mta","frequency","interval");(0,f.useEffect)(()=>{"auto"===s&&(a(`${e}`),o(`${t}`))},[s,e,t,a,o]);const l=Math.floor(1440*parseInt(n,10)/parseInt(r,10)),c=Math.floor(l/86400*10)/10;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("sendingFrequency"),htmlFor:"mailpoet_sending_frequency"}),(0,_.jsxs)(v,{children:[(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsxs)(I.Select,{id:"mailpoet_sending_frequency",value:s,onChange:(0,m.k9)(i),dimension:"small",children:[(0,_.jsx)("option",{value:"auto",children:(0,m.t)("recommendedTitle")}),(0,_.jsx)("option",{value:"manual",children:(0,m.t)("ownFrequency")})]})}),"manual"===s&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row mailpoet-settings-inputs-row-centered",children:[(0,_.jsx)(E.p,{dimension:"small",id:"other_frequency_emails",type:"number",min:"1",max:"1000",value:n,onChange:(0,m.k9)(a)}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)("span",{children:(0,m.t)("emails")})]}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsxs)(I.Select,{id:"other_frequency_interval",value:r,onChange:(0,m.k9)(o),dimension:"small",children:[(0,_.jsx)("option",{value:"1",children:"every minute"}),(0,_.jsx)("option",{value:"2",children:"every 2 minutes"}),(0,_.jsx)("option",{value:"5",children:"every 5 minutes (recommended)"}),(0,_.jsx)("option",{value:"10",children:"every 10 minutes"}),(0,_.jsx)("option",{value:"15",children:"every 15 minutes"}),(0,_.jsx)("option",{value:"30",children:"every 30 minutes"})]})})]}),"auto"===s&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,m.t)("xEmails").replace("%1$s",n)," ",Ne(r),". "]}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:F()((0,m.t)("thatsXEmailsPerDay").replace("%1$s",l.toLocaleString()),/(.*?)<\/strong>/g,(e,t)=>(0,_.jsx)("strong",{children:e},t))}),c>1&&(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsx)("span",{className:"mailpoet_emails_per_second_warning",children:F()((0,m.t)("thatsXEmailsPerSecond").replace("%1$s",c.toLocaleString()),/(.*?)<\/strong>/g,(e,t)=>(0,_.jsx)("strong",{children:e},t))})}),"manual"===s&&(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:F()((0,m.t)("frequencyWarning").replace("%1$s",c.toLocaleString()),/(.*?)<\/strong>/g,(e,t)=>(0,_.jsx)("strong",{children:e},t))})]})]})}function Ie(){const[e,t]=(0,w.iK)("web_host"),s=(0,w.d4)("getWebHosts"),i=(0,f.useMemo)(()=>s[e],[s,e]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("yourHost"),htmlFor:"mailpoet_web_host"}),(0,_.jsx)(v,{children:(0,_.jsx)(I.Select,{id:"mailpoet_web_host",value:e,onChange:(0,m.k9)(t),isMinWidth:!0,dimension:"small",children:Object.entries(s).map(([e,t])=>(0,_.jsx)("option",{value:e,children:t.name},e))})}),(0,_.jsx)(Ke,{recommendedEmails:i?.emails??25,recommendedInterval:i?.interval??5})]})}function Te(){const[e,t]=(0,w.iK)("mta","host"),[s,i]=(0,w.iK)("mta","port"),[n,a]=(0,w.iK)("mta","login"),[r,o]=(0,w.iK)("mta","password"),[l,c]=(0,w.iK)("mta","encryption"),[d,p]=(0,w.iK)("mta","authentication");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Ke,{recommendedEmails:100,recommendedInterval:5}),(0,_.jsx)(b,{title:(0,m.t)("smtpHost"),description:(0,m.t)("smtpHostExample"),htmlFor:"mailpoet_smtp_host"}),(0,_.jsx)(v,{children:(0,_.jsx)(E.p,{dimension:"small",type:"text",id:"mailpoet_smtp_host",value:e,onChange:(0,m.k9)(t)})}),(0,_.jsx)(b,{title:(0,m.t)("smtpPort"),htmlFor:"mailpoet_smtp_port"}),(0,_.jsx)(v,{children:(0,_.jsx)(E.p,{dimension:"small",type:"text",id:"mailpoet_smtp_port",value:s,onChange:(0,m.k9)(i)})}),(0,_.jsx)(b,{title:(0,m.t)("login"),htmlFor:"mailpoet_smtp_login"}),(0,_.jsx)(v,{children:(0,_.jsx)(E.p,{dimension:"small",type:"text",id:"mailpoet_smtp_login",value:n,onChange:(0,m.k9)(a)})}),(0,_.jsx)(b,{title:(0,m.t)("password"),htmlFor:"mailpoet_smtp_password"}),(0,_.jsx)(v,{children:(0,_.jsx)(E.p,{dimension:"small",type:"password",id:"mailpoet_smtp_password",value:r,onChange:(0,m.k9)(o)})}),(0,_.jsx)(b,{title:(0,m.t)("secureConnectioon"),htmlFor:"mailpoet_smtp_encryption"}),(0,_.jsx)(v,{children:(0,_.jsxs)(I.Select,{id:"mailpoet_smtp_encryption",value:l,onChange:(0,m.k9)(c),isMinWidth:!0,dimension:"small",children:[(0,_.jsx)("option",{value:"",children:(0,m.t)("no")}),(0,_.jsx)("option",{value:"ssl",children:"SSL"}),(0,_.jsx)("option",{value:"tls",children:"TLS"})]})}),(0,_.jsx)(b,{title:(0,m.t)("authentication"),description:(0,m.t)("authenticationDescription"),htmlFor:"mailpoet_smtp_authentication"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(R.s,{value:"1",checked:"1"===d,onCheck:p}),(0,m.t)("yes")," ",(0,_.jsx)(R.s,{value:"-1",checked:"-1"===d,onCheck:p}),(0,m.t)("no")]})]})}var Ee=s(3334);function Ae(){const[e,t]=(0,w.iK)("mta","region"),[s,i]=(0,w.iK)("mta","access_key"),[n,a]=(0,w.iK)("mta","secret_key"),r=(0,w.d4)("getAmazonSesOptions");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Ke,{recommendedEmails:r.emails,recommendedInterval:r.interval}),(0,_.jsx)(b,{title:(0,m.t)("region"),htmlFor:"mailpoet_amazon_ses_region"}),(0,_.jsx)(v,{children:(0,_.jsx)(I.Select,{id:"mailpoet_amazon_ses_region",value:e,onChange:(0,m.k9)(t),isMinWidth:!0,dimension:"small",children:Object.entries(r.regions).map(([e,t])=>(0,_.jsx)("option",{value:t,children:e},t))})}),(0,_.jsx)(b,{title:(0,m.t)("accessKey"),htmlFor:"mailpoet_amazon_ses_access_key"}),(0,_.jsx)(v,{children:(0,_.jsx)(Ee.yA,{dimension:"small",value:s,className:"regular-text",onChange:(0,m.k9)(i),id:"mailpoet_amazon_ses_access_key"})}),(0,_.jsx)(b,{title:(0,m.t)("secretKey"),htmlFor:"mailpoet_amazon_ses_secret_key"}),(0,_.jsx)(v,{children:(0,_.jsx)(Ee.yA,{dimension:"small",value:n,className:"regular-text",onChange:(0,m.k9)(a),id:"mailpoet_amazon_ses_secret_key"})})]})}function De(){const[e,t]=(0,w.iK)("mta","api_key"),s=(0,w.d4)("getSendGridOptions");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Ke,{recommendedEmails:s.emails,recommendedInterval:s.interval}),(0,_.jsx)(b,{title:(0,m.t)("apiKey"),htmlFor:"mailpoet_sendgrid_api_key"}),(0,_.jsx)(v,{children:(0,_.jsx)(Ee.yA,{dimension:"small",value:e,onChange:(0,m.k9)(t),id:"mailpoet_sendgrid_api_key"})})]})}function Me(){const[e]=(0,w.iK)("mta","method");return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(ke,{}),"PHPMail"===e&&(0,_.jsx)(Ie,{}),"SMTP"===e&&(0,_.jsx)(Te,{}),"AmazonSES"===e&&(0,_.jsx)(Ae,{}),"SendGrid"===e&&(0,_.jsx)(De,{}),(0,_.jsx)(ye,{}),(0,_.jsx)(Fe,{}),(0,_.jsx)(Se,{})]})}function Pe(){const{subPage:e}=(0,j.g)();return"other"===e?(0,_.jsx)(Me,{}):(0,_.jsx)(fe,{})}function ze(){const e=(0,w.d4)("isMssActive"),[t,s]=(0,w.iK)("signup_confirmation","enabled"),i=e=>{"1"===e&&window.confirm((0,m.t)("subscribersNeedToActivateSub"))&&s("1"),""===e&&window.confirm((0,m.t)("newSubscribersAutoConfirmed"))&&s("")};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("enableSignupConfTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,m.t)("enableSignupConfDescription")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/128-signup-confirmation-double-opt-in-feature",rel:"noopener noreferrer",target:"_blank",children:(0,m.t)("readAboutDoubleOptIn")})]}),htmlFor:"signup_confirmation-enabled"}),(0,_.jsx)(v,{children:e?(0,_.jsx)("p",{children:(0,m.t)("signupConfirmationIsMandatory")}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(R.s,{id:"signup_confirmation-enabled",checked:"1"===t,value:"1",onCheck:i,automationId:"enable_signup_confirmation"}),(0,m.t)("yes")," ",(0,_.jsx)(R.s,{checked:""===t,value:"",onCheck:i,automationId:"disable_signup_confirmation"}),(0,m.t)("no")]})})]})}function $e(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,s]=(0,w.iK)("signup_confirmation","subject"),[i]=(0,w.iK)("signup_confirmation","use_mailpoet_editor");return e?"1"===i?null:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("emailSubject"),htmlFor:"signup_confirmation-subject"}),(0,_.jsx)(v,{children:(0,_.jsx)(E.p,{dimension:"small",type:"text",size:50,id:"signup_confirmation-subject","data-automation-id":"signup_confirmation_email_subject",value:t,onChange:(0,m.k9)(s)})})]}):null}var We=s(99808);function Re(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,s]=(0,w.iK)("signup_confirmation","body"),[i]=(0,w.iK)("signup_confirmation","use_mailpoet_editor");if(!e)return null;if("1"===i)return null;const n=(0,m.t)("emailContentDescription").replace("[current_site_title]",window.mailpoet_current_site_title||"").split("
").filter(e=>e);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("emailContent"),description:n.map(e=>(0,_.jsxs)("span",{children:[e,(0,_.jsx)("br",{}),(0,_.jsx)("br",{})]},e)),htmlFor:"signup_confirmation-body"}),(0,_.jsx)(v,{children:(0,_.jsx)(We.T,{id:"signup_confirmation-body",cols:50,rows:15,"data-automation-id":"signup_confirmation_email_body",value:t,onChange:(0,m.k9)(s)})})]})}function qe(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,s]=(0,w.iK)("subscription","pages","confirmation");return e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("confirmationPage"),description:(0,m.t)("confirmationPageDescription"),htmlFor:"subscription-pages-confirmation"}),(0,_.jsx)(v,{children:(0,_.jsx)(T,{value:t,preview:"confirm",setValue:s,id:"subscription-pages-confirmation",automationId:"page_selection",linkAutomationId:"preview_page_link"})})]}):null}function Le(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,s]=(0,w.iK)("signup_confirmation","use_mailpoet_editor"),[i]=(0,w.iK)("signup_confirmation","transactional_email_id"),n=(0,w.y3)("openEmailCustomizer");return e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("emailCustomizerTitle"),description:(0,m.t)("emailCustomizerDescription"),htmlFor:"mailpoet_confirmation_email_customizer"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(M.S,{id:"mailpoet_confirmation_email_customizer",automationId:"mailpoet_confirmation_email_customizer",checked:"1"===t,onCheck:e=>s(e?"1":"")}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsx)(y.$,{type:"button",onClick:()=>n(i),variant:"secondary",dimension:"small",children:(0,m.t)("openTemplateEditor")})})]})]}):null}const Oe="delete_unconfirmed_subscribers_after_days",Be="delete-unconfirmed-subscribers-warning";function Ve(){const[e,t]=(0,w.iK)(Oe);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("deleteUnconfirmedSubscribersTitle"),description:(0,_.jsx)("span",{id:Be,children:(0,m.t)("deleteUnconfirmedSubscribersDescription")})}),(0,_.jsx)(v,{children:(0,_.jsxs)("div",{role:"radiogroup","aria-label":(0,m.t)("deleteUnconfirmedSubscribersTitle"),"aria-describedby":Be,children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"delete-unconfirmed-subscribers-never",name:Oe,automationId:"delete-unconfirmed-subscribers-option-never",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"delete-unconfirmed-subscribers-never",children:(0,m.t)("never")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(R.s,{id:"delete-unconfirmed-subscribers-after-30-days",name:Oe,automationId:"delete-unconfirmed-subscribers-option-30-days",value:"30",checked:"30"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"delete-unconfirmed-subscribers-after-30-days",children:(0,m.t)("deleteUnconfirmedSubscribersAfter30Days")})]})]})})]})}function Ue(){return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(ze,{}),(0,_.jsx)(Le,{}),(0,_.jsx)($e,{}),(0,_.jsx)(Re,{}),(0,_.jsx)(qe,{}),(0,_.jsx)(Ve,{}),(0,_.jsx)(S,{})]})}function He(){const[e,t]=(0,w.iK)("woocommerce","use_mailpoet_editor"),[s]=(0,w.iK)("woocommerce","transactional_email_id"),i=(0,w.y3)("openWoocommerceCustomizer");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("wcCustomizerTitle"),description:(0,m.t)("wcCustomizerDescription"),htmlFor:"mailpoet_wc_customizer"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(M.S,{id:"mailpoet_wc_customizer",automationId:"mailpoet_wc_customizer",checked:"1"===e,onCheck:e=>t(e?"1":"")}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsx)(y.$,{type:"button",onClick:()=>i(s),variant:"secondary",dimension:"small",children:(0,m.t)("openTemplateEditor")})})]})]})}var Ge=s(14762);function Ye(){const[e,t]=(0,w.iK)("woocommerce","optin_on_checkout","enabled"),[s,i]=(0,w.iK)("woocommerce","optin_on_checkout","segments"),[n,a]=(0,w.iK)("woocommerce","optin_on_checkout","message"),[o,l]=(0,w.iK)("woocommerce","optin_on_checkout","position"),c=(0,w.y3)("setErrorFlag"),d=""===n.trim();return(0,f.useEffect)(()=>{c(d)},[d,c]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,r.__)("Opt-in on checkout","mailpoet"),description:(0,r.__)('Customers can subscribe to the "WooCommerce Customers" list and optionally other lists via a checkbox on the checkout page.',"mailpoet"),htmlFor:"mailpoet_wc_checkout_optin"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(Ge.Checkbox,{id:"mailpoet_wc_checkout_optin",automationId:"mailpoet_wc_checkout_optin",checked:"1"===e,onCheck:e=>t(e?"1":"")}),"1"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("br",{}),(0,_.jsxs)("label",{htmlFor:"mailpoet_wc_checkout_optin_segments",children:[(0,r.__)("Lists to also subscribe customers to:","mailpoet"),(0,_.jsx)("br",{}),(0,_.jsx)("span",{children:(0,r.__)('Leave empty to subscribe only to "WooCommerce Customers" list')})]}),(0,_.jsx)("br",{}),(0,_.jsx)(K,{id:"mailpoet_wc_checkout_optin_segments",value:s,setValue:i,placeholder:(0,r.__)("Select lists...","mailpoet")})]})]}),"1"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,r.__)("Checkbox opt-in message","mailpoet"),description:(0,r.__)('This is the checkbox message your customers will see on your WooCommerce checkout page to subscribe to the "WooCommerce Customers" list and lists selected in "Opt-in on checkout" setting.'),htmlFor:"mailpoet_wc_checkout_optin_message"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(Ge.Input,{dimension:"small",type:"text",id:"mailpoet_wc_checkout_optin_message","data-automation-id":"mailpoet_wc_checkout_optin_message",value:n,onChange:(0,Ge.onChange)(a),placeholder:(0,r.__)("Checkbox opt-in message","mailpoet")}),(0,_.jsx)("br",{}),d&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,r.__)("The checkbox opt-in message cannot be empty.","mailpoet")})]})]}),"1"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,r.__)("Checkbox opt-in position","mailpoet"),description:(0,r.__)("Select where the marketing opt-in checkbox appears on the checkout page.","mailpoet"),htmlFor:"mailpoet_wc_checkout_optin_position"}),(0,_.jsx)(v,{children:(0,_.jsxs)(Ge.Select,{id:"mailpoet_wc_checkout_optin_position",value:o,onChange:(0,Ge.onChange)(l),automationId:"mailpoet_wc_checkout_optin_position",isMinWidth:!0,dimension:"small",children:[(0,_.jsx)("option",{value:"after_billing_info","data-automation-id":"after_billing_info",children:(0,r.__)("After billing info","mailpoet")}),(0,_.jsx)("option",{value:"after_order_notes","data-automation-id":"after_order_notes",children:(0,r.__)("After order notes","mailpoet")}),(0,_.jsx)("option",{value:"after_terms_and_conditions","data-automation-id":"after_terms_and_conditions",children:(0,r.__)("After terms and conditions","mailpoet")}),(0,_.jsx)("option",{value:"before_payment_methods","data-automation-id":"before_payment_methods",children:(0,r.__)("Before payment methods","mailpoet")}),(0,_.jsx)("option",{value:"before_terms_and_conditions","data-automation-id":"before_terms_and_conditions",children:(0,r.__)("Before terms and conditions","mailpoet")})]})})]})]})}function Xe(){const[e,t]=(0,w.iK)("mailpoet_subscribe_old_woocommerce_customers","enabled");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,m.t)("subscribeOldWCTitle"),description:(0,m.t)("subscribeOldWCDescription"),htmlFor:"mailpoet_subscribe_old_wc_customers"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.S,{id:"mailpoet_subscribe_old_wc_customers",automationId:"mailpoet_subscribe_old_wc_customers",checked:"1"===e,onCheck:e=>t(e?"1":"")})})]})}function Ze(){return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(He,{}),(0,_.jsx)(Ye,{}),(0,_.jsx)(Xe,{}),(0,_.jsx)(S,{})]})}var Qe=s(27314),Je=s(77779);function et(){const[e,t]=(0,f.useState)(!0);return e&&(0,_.jsxs)(Je.A,{className:"mailpoet-welcome-wizard-confirmation-modal",title:(0,r.__)("Confirm sending service selection","mailpoet"),onRequestClose:()=>{},isDismissible:!1,children:[(0,_.jsx)("p",{children:(0,Qe.A)((0,r.__)('Your currently selected sending method is "MailPoet Sending Service". The API key you entered is not valid for sending with our sending service. You can either upgrade to a subscription that allows you to send with our service or choose a different sending service',"mailpoet"),{link:(0,_.jsxs)("a",{href:`https://account.mailpoet.com/?s=${window.mailpoet_subscribers_count}&utm_source=plugin&utm_medium=settings&utm_campaign=switch-to-sending-plan&ref=settings-key-activation`,target:"_blank",rel:"noopener noreferrer",children:[" "," "," "]})})}),(0,_.jsx)("div",{className:"mailpoet-welcome-wizard-confirmation-modal-buttons",children:(0,_.jsx)(Ge.Button,{onClick:()=>{t(!1),window.location.href="admin.php?page=mailpoet-settings#/mta/other"},children:(0,r.__)("Update service settings","mailpoet")})})]})}const tt=window.location.href.includes("/mta");function st(){const e=(0,w.d4)("isSaving"),t=(0,w.d4)("hasWooCommerce");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(h.V,{}),e&&(0,_.jsx)(d.R,{}),(0,_.jsx)(o.D,{}),(0,_.jsx)(c.q,{}),(0,_.jsx)(g.z,{heading:(0,r.__)("Settings","mailpoet")}),(0,_.jsx)(l.D,{}),(0,_.jsx)(x.O,{storeName:"mailpoet-settings"}),(0,_.jsxs)(p.k,{activeKey:"basics",children:[(0,_.jsx)(u.o,{route:"basics/:showModal?",title:(0,m.t)("basicsTab"),automationId:"basic_settings_tab",children:(0,_.jsx)(H,{})},"basics"),(0,_.jsx)(u.o,{title:(0,m.t)("signupConfirmationTab"),automationId:"signup_settings_tab",children:(0,_.jsx)(Ue,{})},"signup"),(0,_.jsx)(u.o,{route:"mta/:subPage?",title:(0,m.t)("sendWithTab"),automationId:"send_with_settings_tab",children:(0,_.jsx)(Pe,{})},"mta"),t&&(0,_.jsx)(u.o,{title:(0,m.t)("wooCommerceTab"),automationId:"woocommerce_settings_tab",children:(0,_.jsx)(Ze,{})},"woocommerce"),(0,_.jsx)(u.o,{title:(0,m.t)("advancedTab"),automationId:"settings-advanced-tab",children:(0,_.jsx)(pe,{})},"advanced"),(0,_.jsx)(u.o,{title:(0,m.t)("keyActivationTab"),automationId:"activation_settings_tab",children:(0,_.jsx)(be,{subscribersCount:window.mailpoet_subscribers_count})},"premium")]}),window.mailpoet_mss_active&&!window.mailpoet_mss_key_valid&&!tt&&(0,_.jsx)(et,{})]})}function it(){return(0,_.jsx)(n.F.Provider,{value:(0,n.f)(window),children:(0,_.jsx)(st,{})})}const nt=document.getElementById("settings_container");nt&&((0,Ge.registerTranslations)(),(0,a.k)(),(0,i.H)(nt).render((0,_.jsx)(it,{})))},41669(e){e.exports=jQuery}},e=>{e.O(0,[223],()=>e(e.s=27911)),e.O()}]);