Current File : /var/www/pediatribu/wp-content/plugins/mailpoet/assets/dist/js/settings.js |
"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[472],{69796:(e,t,i)=>{i(22731);var s=i(79124),n=i(50661),a=i(42109),o=i(59437),r=i(89470),l=i(82808),c=i(71328),m=i(79711),d=i(30253),p=i(77542),h=i(28425),u=i(29975),x=i(93554),g=i(42616),j=i(73867),_=i(86106);function b({title:e,description:t,htmlFor:i}){return(0,_.jsxs)("div",{className:"mailpoet-settings-label",children:[(0,_.jsx)("label",{className:"mailpoet-settings-label-title",htmlFor:i,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=i(7378),k=i(43318),y=i(85386),w=i(16609),C=i(2726),F=i.n(C);const S=(e,t,i)=>{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")));i((0,_.jsx)("p",{children:e}),{scroll:!0})}}else t((0,_.jsx)("p",{children:k.U.I18n.t("re-engagementDisabledNotice")}),{scroll:!0})};function N(){const[e,t]=(0,f.useState)(!1),i=(0,w.d4)("isSaving")(),s=(0,w.d4)("hasErrorFlag")(),a=(0,w.d4)("getSavingError")(),o=(0,w.d4)("hasReEngagementNotice")(),r=(0,w.d4)("getReEngagementAction")(),l=(0,w.y3)("saveSettings"),{notices:c}=(0,f.useContext)(n.F),m=c.error,d=c.success;return(0,f.useEffect)((()=>{e&&!i&&(a?m(a.map((e=>(0,_.jsx)("p",{children:e}))),{scroll:!0}):(d((0,_.jsx)("p",{children:k.U.I18n.t("settingsSaved")}),{scroll:!0}),o&&S(r,m,d)))}),[e,a,i,m,d,o,r]),(0,_.jsx)("div",{className:"mailpoet-settings-save",children:(0,_.jsx)(y.$,{type:"button",automationId:"settings-submit-button",isDisabled:i||s,onClick:()=>{t(!0),l()},children:k.U.I18n.t("saveSettings")})})}var K=i(94010);function I(e){const t=e.segmentsSelector?e.segmentsSelector:"getDefaultSegments",i=(0,w.d4)(t)().map((e=>({value:e.id,label:e.name,count:e.subscribers}))),s=i.filter((t=>e.value.includes(t.value)));return(0,_.jsx)(K.ReactSelect,{isMulti:!0,defaultValue:s,id:e.id,placeholder:e.placeholder,options:i,onChange:t=>{e.setValue((t||[]).map((e=>e.value)))}})}var T=i(36113);function E(e){const t=(0,w.d4)("getPages")();let i=t.find((t=>t.id===parseInt(e.value,10)));return i||(i=t[0]),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row mailpoet-settings-inputs-row-centered",children:[(0,_.jsx)(T.Select,{id:e.id,automationId:e.automationId,value:i.id,onChange:(0,d.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,d.t)("previewPage"),rel:"noopener noreferrer",href:i.url[e.preview],"data-automation-id":e.linkAutomationId,children:(0,d.t)("preview")})]})}var M=i(63599),D=i(49429);function A({showModal:e}){const t=(0,w.d4)("isMssActive")(),[i,s]=(0,w.iK)("sender","name"),[n,a]=(0,w.iK)("sender","address"),[o,r]=(0,f.useState)(!0),l=(0,d.Y8)(n),[c,m]=(0,f.useState)(!window.mailpoet_verified_sender_domains.includes(l)),[p,h]=(0,f.useState)(window.mailpoet_partially_verified_sender_domains.includes(l)),[u,x]=(0,w.iK)("reply_to","name"),[g,j]=(0,w.iK)("reply_to","address"),y=(0,w.y3)("setErrorFlag"),C=n&&!(0,d.xf)(n),F=g&&!(0,d.xf)(g);return(0,f.useEffect)((()=>{y(C||F||!o&&t)}),[F,C,y,o,t]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("defaultSenderTitle"),description:(0,d.t)("defaultSenderDescription"),htmlFor:"sender-name"}),(0,_.jsxs)(v,{children:[(0,_.jsx)("label",{htmlFor:"sender-name",children:(0,d.t)("from")}),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"text",id:"sender-name",placeholder:(0,d.t)("yourName"),"data-automation-id":"from-name-field",value:i,onChange:(0,d.k9)(s)}),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"text",placeholder:"from@mydomain.com","data-automation-id":"from-email-field",value:n,onChange:(0,d.k9)((0,d.Xv)((e=>{r(!0),m(!1),h(!1),a(e)}))),onBlur:(0,d.k9)((e=>{if(!t)return;const i=(0,d.Y8)(e);window.mailpoet_verified_sender_domains.includes(i)||((e=>{r(window.mailpoet_authorized_emails.includes(e))})(e),m(!0),h(window.mailpoet_partially_verified_sender_domains.includes(i)))}))}),(0,_.jsx)("br",{}),C&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("invalidEmail")}),(0,_.jsx)("div",{className:"regular-text",children:(0,_.jsx)(D.Y,{emailAddress:n,mssActive:t,showModal:e,isEmailAuthorized:o,showSenderDomainWarning:c,isPartiallyVerifiedDomain:p,senderRestrictions:window.mailpoet_sender_restrictions,onSuccessfulEmailOrDomainAuthorization:e=>{"email"===e.type&&(r(!0),k.U.trackEvent("MSS in plugin authorize email",{"authorized email source":"settings",wasSuccessful:"yes"})),"domain"===e.type&&(m(!1),h(!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)(M.p,{dimension:"small",type:"text",id:"reply_to-name",placeholder:(0,d.t)("yourName"),"data-automation-id":"reply_to-name-field",value:u,onChange:(0,d.k9)(x)}),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"text",placeholder:"reply_to@mydomain.com","data-automation-id":"reply_to-email-field",value:g,onChange:(0,d.k9)((0,d.Xv)(j))}),(0,_.jsx)("br",{}),F&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("invalidEmail")})]})]})}var P=i(6519);function $({title:e,description:t,event:i}){const[s,n]=(0,w.iK)("subscribe",i,"enabled"),[a,o]=(0,w.iK)("subscribe",i,"label"),[r,l]=(0,w.iK)("subscribe",i,"segments");return(0,f.useEffect)((()=>{""===a&&o((0,d.t)("yesAddMe"))}),[a,o]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:e,description:t,htmlFor:`subscribe-${i}-enabled`}),(0,_.jsxs)(v,{children:[(0,_.jsx)(P.S,{id:`subscribe-${i}-enabled`,automationId:`subscribe-${i}-checkbox`,checked:"1"===s,onCheck:e=>n(e?"1":"0")}),"1"===s&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"text",value:a,onChange:(0,d.k9)(o)}),(0,_.jsx)("label",{className:"mailpoet-settings-inputs-row",htmlFor:`subscribe-${i}-segments`,children:(0,d.t)("usersWillBeSubscribedTo")}),(0,_.jsx)("div",{"data-automation-id":`subscribe-${i}-segments-selection`,children:(0,_.jsx)(I,{id:`subscribe-${i}-segments`,placeholder:(0,d.t)("chooseList"),value:r,setValue:l})})]})]})]})}function z(){const[e,t]=(0,w.iK)("subscription","pages","manage");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("manageSubTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.t)("manageSubDescription1")," ",F()((0,d.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)(E,{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,d.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 W(){const[e,t]=(0,w.iK)("subscription","pages","unsubscribe"),[i,s]=(0,w.iK)("subscription","pages","confirm_unsubscribe");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("unsubscribeTitle"),description:(0,_.jsxs)(_.Fragment,{children:[F()((0,d.t)("unsubscribeDescription1"),"[mailpoet_page]",(()=>(0,_.jsx)("code",{children:"[mailpoet_page]"},"mp")))," ",F()((0,d.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,d.t)("confirmationPageTitle"),":"]}),(0,_.jsx)(E,{value:i,preview:"confirm_unsubscribe",setValue:s,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,d.t)("successPageTitle"),":"]}),(0,_.jsx)(E,{value:e,preview:"unsubscribe",setValue:t,id:"subscription-pages-unsubscribe",automationId:"unsubscribe-success-page-selection",linkAutomationId:"unsubscribe_page_preview_link"})]})]})}function R(){const[e,t]=(0,w.iK)("stats_notifications","enabled"),[i,s]=(0,w.iK)("stats_notifications","automated"),[n,a]=(0,w.iK)("stats_notifications","address"),o=(0,w.y3)("setErrorFlag"),r=("1"===e||"1"===i)&&""===n.trim(),l=n&&!(0,d.xf)(n);return(0,f.useEffect)((()=>{o(r||l)}),[r,l,o]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("statsNotifsTitle"),description:(0,d.t)("statsNotifsDescription"),htmlFor:"stats-enabled"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(P.S,{id:"stats-enabled",checked:"1"===e,onCheck:e=>t(e?"1":"0")}),(0,_.jsx)("label",{htmlFor:"stats-enabled",children:(0,d.t)("newslettersAndPostNotifs")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(P.S,{id:"stats-automated",checked:"1"===i,onCheck:e=>s(e?"1":"0")}),(0,_.jsx)("label",{htmlFor:"stats-automated",children:(0,d.t)("welcomeAndWcEmails")})]}),(0,_.jsx)(M.p,{dimension:"small",type:"email",value:n,onChange:(0,d.k9)((0,d.Xv)(a)),placeholder:"me@mydomain.com"}),r&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("pleaseFillEmail")}),l&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("invalidEmail")})]})]})}var L=i(51015);function O(){const[e,t]=(0,w.iK)("subscriber_email_notification","enabled"),[i,s]=(0,w.iK)("subscriber_email_notification","address"),n=(0,w.y3)("setErrorFlag"),a="1"===e&&""===i.trim(),o=i&&!(0,d.xf)(i);return(0,f.useEffect)((()=>{n(a||o)}),[a,o,n]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("newSubscriberNotifsTitle"),description:(0,d.t)("newSubscriberNotifsDescription"),htmlFor:"subscriber_email_notification-enabled"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(L.s,{checked:"1"===e,value:"1",onCheck:t}),(0,d.t)("yes")," ",(0,_.jsx)(L.s,{checked:""===e,value:"",onCheck:t}),(0,d.t)("no"),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"email",value:i,onChange:(0,d.k9)((0,d.Xv)(s)),placeholder:"me@mydomain.com"}),a&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("pleaseFillEmail")}),o&&(0,_.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("invalidEmail")})]})]})}var V=i(68490),B=i(85501);function U({name:e,title:t,description:i}){const[s,n]=(0,f.useState)([]),[a,r]=(0,f.useState)(""),[l,c]=(0,f.useState)(null),[m,p]=(0,f.useState)(null),[h,u]=(0,f.useState)(""),[x,g]=(0,f.useState)("");let j=`[${e}`;return s.length&&(j+=` segments="${s.join(",")}"`),l&&(j+=` start_date="${k.U.Date.format(l,{format:"Y-m-d"})}"`),m&&(j+=` end_date="${k.U.Date.format(m,{format:"Y-m-d"})}"`),a&&parseInt(a,10)>0&&(j+=` in_the_last_days="${a}"`),h&&h.length>0&&(j+=` subject_contains="${h}"`),x&&parseInt(x,10)>0&&(j+=` limit="${x}"`),j+="]",(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:t,description:i,htmlFor:`${e}-shortcode`}),(0,_.jsxs)(v,{children:[(0,_.jsx)(M.p,{dimension:"small",readOnly:!0,type:"text",value:j,onClick:e=>{e.target.focus(),e.target.select()},id:`${e}-shortcode`}),(0,_.jsx)(B.T,{variant:"secondary",targetId:`${e}-shortcode`,alwaysSelectText:!0}),(0,_.jsx)("br",{}),(0,_.jsx)(I,{value:s,setValue:n,id:`${e}-shortcode-segments`,placeholder:(0,d.t)("leaveEmptyToDisplayAll"),segmentsSelector:"getSegments"}),"mailpoet_archive"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{type:"number",min:"1",max:"365000",dimension:"small",tooltip:(0,o.__)("Include newsletters sent no more than this many days ago. This overrides start and end dates.","mailpoet"),name:"in_the_last_days",placeholder:(0,o.__)("In the last days","mailpoet"),onChange:e=>{const t=e.target.value.trim();if(""===t)return void r("");const i=Number(t);Number.isInteger(i)&&i>0&&(c(null),p(null),r(t))},value:a}),(0,_.jsx)("br",{}),(0,_.jsx)(V.t,{dimension:"small",dateFormat:"MMMM d, yyyy",onChange:e=>{c(e),null!==e&&r("")},selected:l,maxDate:m,placeholderText:(0,o.__)("Start date","mailpoet"),isClearable:!0}),(0,_.jsx)(V.t,{dimension:"small",dateFormat:"MMMM d, yyyy",onChange:e=>{p(e),null!==e&&r("")},selected:m,minDate:l,placeholderText:(0,o.__)("End date","mailpoet"),isClearable:!0}),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"text",value:h,onChange:e=>u(e.target.value),placeholder:(0,o.__)("Subject lines containing","mailpoet")}),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{type:"number",min:"1",max:"1000",dimension:"small",placeholder:(0,o.__)("Maximum number to display","mailpoet"),onChange:e=>{const t=e.target.value.trim();if(""===t)return void g("");const i=Number(t);Number.isInteger(i)&&i>0&&g(t)},value:x})]})]})]})}function q(){return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("gdprTitle"),description:(0,d.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,d.t)("readGuide"),target:"_blank",rel:"noopener noreferrer",children:(0,d.t)("readGuide")})})]})}function G(){const[e,t]=(0,w.iK)("reEngagement","page");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("reEngagementTitle"),description:(0,d.t)("reEngagementDescription"),htmlFor:"re-engagement-page"}),(0,_.jsx)(v,{children:(0,_.jsx)(E,{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)(A,{showModal:e}),(0,_.jsx)($,{event:"on_comment",title:(0,d.t)("subscribeInCommentsTitle"),description:(0,d.t)("subscribeInCommentsDescription")}),(0,_.jsx)($,{event:"on_register",title:(0,d.t)("subscribeInRegistrationTitle"),description:(0,d.t)("subscribeInRegistrationDescription")}),(0,_.jsx)(z,{}),(0,_.jsx)(W,{}),(0,_.jsx)(G,{}),(0,_.jsx)(R,{}),(0,_.jsx)(O,{}),(0,_.jsx)(U,{name:"mailpoet_archive",title:(0,d.t)("archiveShortcodeTitle"),description:(0,d.t)("archiveShortcodeDescription")}),(0,_.jsx)(U,{name:"mailpoet_subscribers_count",title:(0,d.t)("subscribersCountShortcodeTitle"),description:(0,d.t)("subscribersCountShortcodeDescription")}),(0,_.jsx)(q,{}),(0,_.jsx)(N,{})]})}function Y(){const[e,t]=(0,w.iK)("cron_trigger","method"),i=(0,w.d4)("getPaths")();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,o.__)("Newsletter task scheduler (cron)","mailpoet"),description:(0,_.jsxs)(_.Fragment,{children:[(0,o.__)("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,o.__)("Read more.","mailpoet")})]}),htmlFor:"cron_trigger-method"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.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,o.__)("Action Scheduler (recommended)","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.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,o.__)("Visitors to your website","mailpoet")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.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,o.__)("Server side cron (Linux cron)","mailpoet")})]}),"Linux Cron"===e&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,o.__)("To use this option please add this command to your crontab:","mailpoet")}),(0,_.jsx)(M.p,{dimension:"small",type:"text",readOnly:!0,value:`php ${i.plugin}/mailpoet-cron.php ${i.root}`}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,o.__)("With the frequency of running it every minute:","mailpoet")}),(0,_.jsx)(M.p,{dimension:"small",type:"text",readOnly:!0,value:"*/1 * * * *"})]})]})]})}function X(){const e=(0,w.d4)("hasMembersPlugin")();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("rolesTitle"),description:(0,d.t)("rolesDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,_.jsx)("p",{children:e?(0,_.jsx)("a",{className:"mailpoet-link",href:"?page=roles",children:(0,d.t)("manageUsingMembers")}):F()((0,d.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 Z(){const[e,t]=(0,w.iK)("tracking","level");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("engagementTrackingTitle"),description:(0,d.t)("engagementTrackingDescription"),htmlFor:"engagement_tracking"}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"tracking-basic",value:"basic",checked:"basic"===e,onCheck:t,automationId:"tracking-basic-radio"}),(0,_.jsx)("label",{htmlFor:"tracking-basic",children:(0,d.t)("engagementTrackingBasic")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"tracking-partial",value:"partial",checked:"partial"===e,onCheck:t,automationId:"tracking-partial-radio"}),(0,_.jsx)("label",{htmlFor:"tracking-partial",children:(0,d.t)("engagementTrackingPartial")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"tracking-full",value:"full",checked:"full"===e,onCheck:t,automationId:"tracking-full-radio"}),(0,_.jsx)("label",{htmlFor:"tracking-full",children:(0,d.t)("engagementTrackingFull")})]})]})]})}function J(){const[e,t]=(0,w.iK)("tracking","opens");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,o.__)("Human and machine opens","mailpoet"),description:(0,o.__)("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)(L.s,{id:"opens-merged",value:"merged",checked:"merged"===e,onCheck:t,automationId:"opens-merged-radio"}),(0,_.jsx)("label",{htmlFor:"opens-merged",children:(0,o.__)("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)(L.s,{id:"opens-separated",value:"separated",checked:"separated"===e,onCheck:t,automationId:"opens-separated-radio"}),(0,_.jsx)("label",{htmlFor:"opens-separated",children:(0,o.__)("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")(),[i,s]=(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,d.t)("hostOption")),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("transactionalTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.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,d.t)("transactionalLink")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(L.s,{id:"transactional-enabled",value:"1",checked:"1"===i,onCheck:s}),(0,_.jsxs)("label",{htmlFor:"transactional-enabled",children:[(0,d.t)("transactionalCurrentMethod").replace("%1$s",n),(0,_.jsx)("br",{}),(0,_.jsx)("span",{className:"mailpoet-note",children:F()((0,d.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)(L.s,{id:"transactional-disabled",value:"",checked:""===i,onCheck:s}),(0,_.jsx)("label",{htmlFor:"transactional-disabled",children:(0,d.t)("transactionalWP")})]})]})]})}function ee(){const[e,t]=(0,w.iK)("deactivate_subscriber_after_inactive_days"),[i]=(0,w.iK)("tracking","level"),s="basic"!==i;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("inactiveSubsTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.t)("inactiveSubsDescription")," ",(0,_.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/264-inactive-subscribers",rel:"noopener noreferrer",target:"_blank",children:(0,d.t)("readMore")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[!s&&(0,_.jsx)("p",{"data-automation-id":"inactive-subscribers-disabled",children:(0,d.t)("disabledBecauseTrackingIs")}),s&&(0,_.jsxs)("div",{"data-automation-id":"inactive-subscribers-enabled",children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"inactive-subscribers-disabled",automationId:"inactive-subscribers-option-never",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-disabled",children:(0,d.t)("never")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"inactive-subscribers-3-months",value:"90",checked:"90"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-3-months",children:(0,d.t)("after3months")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"inactive-subscribers-6-months",value:"180",checked:"180"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-6-months",children:(0,d.t)("after6months")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.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,d.t)("after12months")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"inactive-subscribers-18-months",value:"540",checked:"540"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"inactive-subscribers-18-months",children:(0,d.t)("after18months")})]})]})]})]})}function te(){const[e,t]=(0,w.iK)("analytics","enabled");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("shareDataTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.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,d.t)("readMore")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(L.s,{id:"share-data-enabled",value:"1",checked:"1"===e,onCheck:t,automationId:"analytics-yes"}),(0,_.jsx)("label",{htmlFor:"share-data-enabled",children:(0,d.t)("yes")}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)(L.s,{id:"share-data-disabled",value:"",checked:""===e,onCheck:t,automationId:"analytics-no"}),(0,_.jsx)("label",{htmlFor:"share-data-disabled",children:(0,d.t)("no")})]})]})}function ie(){const[e,t]=(0,w.iK)("3rd_party_libs","enabled");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("libs3rdPartyTitle"),description:(0,_.jsxs)(_.Fragment,{children:[F()((0,d.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,d.t)("readMore")})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(L.s,{id:"libs-3rd-party-enabled",value:"1",checked:"1"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"libs-3rd-party-enabled",children:(0,d.t)("yes")}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)(L.s,{id:"libs-3rd-party-disabled",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"libs-3rd-party-disabled",children:(0,d.t)("no")})]})]})}function se(){const[e,t]=(0,w.iK)("captcha","type"),[i,s]=(0,w.iK)("captcha","recaptcha_site_token"),[n,a]=(0,w.iK)("captcha","recaptcha_secret_token"),[o,r]=(0,w.iK)("captcha","recaptcha_invisible_site_token"),[l,c]=(0,w.iK)("captcha","recaptcha_invisible_secret_token"),m=(0,w.d4)("isBuiltInCaptchaSupported")(),p=(0,w.y3)("setErrorFlag"),h="recaptcha"===e&&""===i.trim(),u="recaptcha"===e&&""===n.trim(),x="recaptcha-invisible"===e&&""===o.trim(),g="recaptcha-invisible"===e&&""===l.trim();return(0,f.useEffect)((()=>{p(h||u||g||x)}),[u,h,g,x,p]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("captchaTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.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,d.t)("readMore")}),("recaptcha"===e||"recaptcha-invisible"===e)&&(0,_.jsxs)("p",{children:[(0,_.jsxs)("span",{children:[(0,d.t)("reCaptchaDescription")," "]}),(0,_.jsx)("a",{className:"mailpoet-link",href:"https://www.google.com/recaptcha/admin",rel:"noopener noreferrer",target:"_blank",children:(0,d.t)("signupForCaptchaKey")})]})]}),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"built-in-captcha",disabled:!m,value:"built-in",checked:"built-in"===e,onCheck:t}),(0,_.jsxs)("label",{htmlFor:"built-in-captcha",children:[(0,d.t)("builtInCaptcha")," ",!m&&(0,d.t)("disbaledBecauseExtensionMissing")]})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"google-captcha",value:"recaptcha",checked:"recaptcha"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"google-captcha",children:(0,d.t)("googleReCaptchaCheckbox")})]}),"recaptcha"===e&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(M.p,{dimension:"small",type:"text",value:i,onChange:(0,d.k9)(s),placeholder:(0,d.t)("yourReCaptchaKey")}),h&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("fillReCaptchaKeys")}),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"text",value:n,onChange:(0,d.k9)(a),placeholder:(0,d.t)("yourReCaptchaSecret")}),u&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("fillReCaptchaKeys")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"google-captcha-invisible",value:"recaptcha-invisible",checked:"recaptcha-invisible"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"google-captcha-invisible",children:(0,d.t)("googleReCaptchaInvisible")})]}),"recaptcha-invisible"===e&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(M.p,{dimension:"small",type:"text",value:o,onChange:(0,d.k9)(r),placeholder:(0,d.t)("yourReCaptchaKey")}),x&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("fillReCaptchaKeys")}),(0,_.jsx)("br",{}),(0,_.jsx)(M.p,{dimension:"small",type:"text",value:l,onChange:(0,d.k9)(c),placeholder:(0,d.t)("yourReCaptchaSecret")}),g&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,d.t)("fillReCaptchaKeys")})]}),(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,_.jsx)(L.s,{id:"no-captcha",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"no-captcha",children:(0,d.t)("disable")})]})]})]})}function ne(){const e=(0,w.y3)("reinstall"),{notices:t}=(0,f.useContext)(n.F);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("reinstallTitle"),description:(0,d.t)("reinstallDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,_.jsx)(y.$,{type:"button",onClick:async()=>{if(window.confirm((0,d.t)("reinstallConfirmation"))){const i=await e();"SAVE_FAILED"===i.type?t.error(i.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,d.t)("reinstallNow")})})]})}function ae(){const e=(0,w.y3)("recalculateSubscribersScore"),{notices:t}=(0,f.useContext)(n.F);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("recalculateSubscribersScoreTitle"),description:(0,d.t)("recalculateSubscribersScoreDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,_.jsx)(y.$,{type:"button",onClick:async()=>{await e(),t.info((0,_.jsx)("p",{children:(0,d.t)("recalculateSubscribersScoreNotice")}),{scroll:!0})},variant:"secondary",dimension:"small",children:(0,d.t)("recalculateSubscribersScoreNow")})})]})}function oe(){const[e,t]=(0,w.iK)("logging");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("loggingTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.t)("loggingDescription")," ",(0,_.jsx)("a",{href:"?page=mailpoet-logs",className:"mailpoet-link",children:(0,d.t)("loggingDescriptionLink")})]}),htmlFor:"logging-level"}),(0,_.jsx)(v,{children:(0,_.jsxs)(T.Select,{id:"logging-level",value:e,onChange:(0,d.k9)(t),automationId:"logging-select-box",isMinWidth:!0,dimension:"small",children:[(0,_.jsx)("option",{value:"everything","data-automation-id":"log-everything",children:(0,d.t)("everythingLogOption")}),(0,_.jsx)("option",{value:"errors","data-automation-id":"log-errors",children:(0,d.t)("errorsLogOption")}),(0,_.jsx)("option",{value:"nothing","data-automation-id":"log-nothing",children:(0,d.t)("nothingLogOption")})]})})]})}function re(){const[e,t]=(0,w.iK)("bounce","address");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("bounceEmail"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.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,d.t)("readMore")})]}),htmlFor:"bounce-address"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",id:"bounce-address",placeholder:"bounce@mydomain.com","data-automation-id":"bounce-address-field",value:e,onChange:(0,d.k9)((0,d.Xv)(t))})})]})}function le(){const[e,t]=(0,w.iK)("captcha","on_register_forms","enabled"),i=(0,w.d4)("hasWooCommerce")();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("captchaOnRegisterTitle"),description:(0,d.t)(i?"captchaOnRegisterWooActiveDescription":"captchaOnRegisterWooInactiveDescription"),htmlFor:""}),(0,_.jsxs)(v,{children:[(0,_.jsx)(L.s,{id:"captcha-on-register-enabled",value:"1",checked:"1"===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"captcha-on-register-enabled",children:(0,d.t)("yes")}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)(L.s,{id:"captcha-on-register-disabled",value:"",checked:""===e,onCheck:t}),(0,_.jsx)("label",{htmlFor:"captcha-on-register-disabled",children:(0,d.t)("no")})]})]})}function ce(){return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(re,{}),(0,_.jsx)(Y,{}),(0,_.jsx)(X,{}),(0,_.jsx)(Z,{}),(0,_.jsx)(J,{}),(0,_.jsx)(Q,{}),(0,_.jsx)(ae,{}),(0,_.jsx)(ee,{}),(0,_.jsx)(te,{}),(0,_.jsx)(ie,{}),(0,_.jsx)(se,{}),(0,_.jsx)(le,{}),(0,_.jsx)(ne,{}),(0,_.jsx)(oe,{}),(0,_.jsx)(N,{})]})}var me=i(57232),de=i(37035),pe=i(59866),he=i(54787);const ue=F()((0,d.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"))),xe=F()((0,d.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 ge({subscribersCount:e}){const t=(0,w.d4)("getKeyActivationState")(),i=(0,w.y3)("updateKeyActivationState"),s=(0,w.y3)("sendCongratulatoryMssEmail"),[n,a]=(0,w.iK)("sender","address"),[o,r]=(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===me.W0.VALID_MSS_ACTIVE&&(!n||o);return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(b,{htmlFor:"mailpoet_premium_key",title:(0,d.t)("premiumTabActivationKeyLabel"),description:(0,_.jsxs)(_.Fragment,{children:[ue,(0,_.jsx)("br",{}),(0,_.jsx)("br",{}),xe,(0,_.jsx)("br",{}),(0,_.jsx)("br",{}),F()((0,d.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)(he.M,{}),(0,_.jsx)(pe.y,{label:(0,d.t)("premiumTabVerifyButton")})]}),c&&(0,_.jsx)(de.U,{onRequestClose:()=>{i({fromAddressModalCanBeShown:!1}),s(),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 r(null),l()}})]})}var je=i(65069);function _e(){const e=(0,j.Zp)(),t=(0,w.d4)("isMssActive")(),[i]=(0,w.iK)("mta","mailpoet_api_key"),{mssStatus:s,premiumStatus:n}=(0,w.d4)("getKeyActivationState")(),a=null!==s&&s!==me.W0.INVALID,o=null!==n&&n!==me.Ks.INVALID,r=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 s=>{s.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"],i),await l(["signup_confirmation","enabled"],"1"),c()))()}}),(0,_.jsx)("span",{className:"mailpoet-form-radio-control"}),(0,_.jsx)("h4",{className:"mailpoet-h4",children:(0,d.t)("mssTitle")}),(0,_.jsx)("p",{children:t?(0,d.t)("youreSendingWithMss"):(0,d.t)("solveSendingProblems")}),(0,_.jsxs)("ul",{className:"mailpoet-sending-method-benefits mailpoet_success",children:[(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,d.t)("mssBenefit1")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,d.t)("mssBenefit2")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,d.t)("mssBenefit3")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,d.t)("mssBenefit4")}),(0,_.jsx)("li",{className:"mailpoet_success_item",children:(0,d.t)("mssBenefit5")})]}),!a&&!o&&(0,_.jsxs)("div",{className:"mailpoet-sending-method-actions",children:[(0,_.jsx)("a",{className:"mailpoet-button button-primary",href:r,rel:"noopener noreferrer",target:"_blank",children:(0,d.t)("freeUpto")}),(0,_.jsxs)("span",{children:[" ",(0,d.t)("or")," "]}),F()((0,d.t)("enterYourKey"),/\[link\](.*?)\[\/link\]/g,((e,t)=>(0,_.jsx)(je.Link,{to:"/premium",className:"mailpoet-link",children:e},t)))]}),!a&&o&&(0,_.jsxs)("div",{className:"mailpoet-sending-method-actions",children:[(0,_.jsx)("i",{children:(0,d.t)("invalidKeyForMss")})," ",(0,_.jsx)("a",{className:"mailpoet-button button-primary",href:"https://account.mailpoet.com/",rel:"noopener noreferrer",target:"_blank",children:(0,d.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,d.t)("otherTitle")}),(0,_.jsxs)("p",{children:[(0,d.t)("sendViaHost")," ",(0,_.jsx)("strong",{children:(0,d.t)("notRecommended")})," ",(0,d.t)("orViaThirdParty")]}),(0,_.jsx)("div",{className:"mailpoet-sending-method-actions",children:(0,_.jsx)(je.Link,{to:"/mta/other",className:"mailpoet-link",children:(0,d.t)("configure")})})]})})]})}function be(){const[e,t]=(0,w.iK)("smtp_provider"),[,i]=(0,w.iK)("mta_group"),[,s]=(0,w.iK)("mta","method");return(0,f.useEffect)((()=>{switch(e){case"server":i("website"),s("PHPMail");break;case"manual":i("smtp"),s("SMTP");break;case"AmazonSES":i("smtp"),s("AmazonSES");break;case"SendGrid":i("smtp"),s("SendGrid");break;default:s("PHPMail")}}),[e,i,s]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("method"),htmlFor:"mailpoet_smtp_method"}),(0,_.jsx)(v,{children:(0,_.jsxs)(T.Select,{id:"mailpoet_smtp_method",value:e,onChange:(0,d.k9)(t),isMinWidth:!0,dimension:"small",children:[(0,_.jsx)("option",{value:"server",children:(0,d.t)("hostOption")}),(0,_.jsx)("option",{value:"manual",children:(0,d.t)("smtpOption")}),(0,_.jsxs)("optgroup",{label:(0,d.t)("selectProvider"),children:[(0,_.jsx)("option",{value:"AmazonSES",children:"Amazon SES"}),(0,_.jsx)("option",{value:"SendGrid",children:"SendGrid"})]})]})})]})}function ve(){return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("spfTitle"),description:(0,d.t)("spfDescription"),htmlFor:""}),(0,_.jsx)(v,{children:(0,d.t)("spfSetup")})]})}var fe=i(62138),ke=i(19669);function ye(){const[e,t]=(0,f.useState)(window.mailpoet_current_user_email),[i]=(0,w.iK)("mta"),{state:s,error:n}=(0,w.d4)("getTestEmailState")(),a=(0,w.y3)("sendTestEmail");return(0,_.jsxs)(_.Fragment,{children:[s===me.cP.SENDING&&(0,_.jsx)(m.R,{}),s===me.cP.SUCCESS&&(0,_.jsx)(ke.$,{type:"success",scroll:!0,children:(0,_.jsx)("p",{children:(0,d.t)("emailSent")})}),s===me.cP.FAILURE&&(0,_.jsx)(ke.$,{type:"error",scroll:!0,children:(0,_.jsx)("p",{children:n.map((e=>(0,_.jsx)("p",{children:e},e)))})}),(0,_.jsx)(b,{title:(0,d.t)("testSending"),htmlFor:"mailpoet_mta_test_email"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(M.p,{dimension:"small",type:"text",id:"mailpoet_mta_test_email",value:e,onChange:(0,d.k9)(t)}),(0,_.jsx)(y.$,{type:"button",dimension:"small",variant:"secondary",onClick:()=>a(e,i),children:(0,d.t)("sendTestEmail")}),(0,_.jsx)(fe.Tooltip,{tooltipId:"tooltip-settings-test",className:"mailpoet_tooltip_icon",tooltip:(0,_.jsx)("span",{style:{pointerEvents:"all"},children:F()((0,d.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 we(){const e=(0,w.y3)("saveSettings"),t=(0,w.y3)("loadSettings"),i=(0,j.Zp)();return(0,_.jsxs)("div",{className:"mailpoet-settings-save",children:[(0,_.jsx)(y.$,{type:"button",onClick:async()=>{await e(),i("/mta")},children:(0,d.t)("activate")}),(0,_.jsx)(y.$,{onClick:async()=>{k.U.Modal.loading(!0),await t(),i("/mta"),k.U.Modal.loading(!1)},variant:"tertiary",children:(0,d.t)("orCancel")})]})}const Ce=1440,Fe=86400;function Se(e){const t=Math.floor(parseInt(e,10));return t>60?(0,d.t)("everyHours").replace("%1$d",""+t/60):60===t?(0,d.t)("everyHour"):t>1?(0,d.t)("everyMinutes").replace("%1$d",`${t}`):(0,d.t)("everyMinute")}function Ne({recommendedEmails:e,recommendedInterval:t}){const[i,s]=(0,w.iK)("mailpoet_sending_frequency"),[n,a]=(0,w.iK)("mta","frequency","emails"),[o,r]=(0,w.iK)("mta","frequency","interval");(0,f.useEffect)((()=>{"auto"===i&&(a(`${e}`),r(`${t}`))}),[i,e,t,a,r]);const l=Math.floor(Ce*parseInt(n,10)/parseInt(o,10)),c=Math.floor(l/Fe*10)/10;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("sendingFrequency"),htmlFor:"mailpoet_sending_frequency"}),(0,_.jsxs)(v,{children:[(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsxs)(T.Select,{id:"mailpoet_sending_frequency",value:i,onChange:(0,d.k9)(s),dimension:"small",children:[(0,_.jsx)("option",{value:"auto",children:(0,d.t)("recommendedTitle")}),(0,_.jsx)("option",{value:"manual",children:(0,d.t)("ownFrequency")})]})}),"manual"===i&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row mailpoet-settings-inputs-row-centered",children:[(0,_.jsx)(M.p,{dimension:"small",id:"other_frequency_emails",type:"number",min:"1",max:"1000",value:n,onChange:(0,d.k9)(a)}),(0,_.jsx)("span",{className:"mailpoet-gap"}),(0,_.jsx)("span",{children:(0,d.t)("emails")})]}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsxs)(T.Select,{id:"other_frequency_interval",value:o,onChange:(0,d.k9)(r),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"===i&&(0,_.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,d.t)("xEmails").replace("%1$s",n)," ",Se(o),". "]}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:F()((0,d.t)("thatsXEmailsPerDay").replace("%1$s",l.toLocaleString()),/<strong>(.*?)<\/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,d.t)("thatsXEmailsPerSecond").replace("%1$s",c.toLocaleString()),/<strong>(.*?)<\/strong>/g,((e,t)=>(0,_.jsx)("strong",{children:e},t)))})}),"manual"===i&&(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:F()((0,d.t)("frequencyWarning").replace("%1$s",c.toLocaleString()),/<strong>(.*?)<\/strong>/g,((e,t)=>(0,_.jsx)("strong",{children:e},t)))})]})]})}function Ke(){const[e,t]=(0,w.iK)("web_host"),i=(0,w.d4)("getWebHosts")(),s=i[e];return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("yourHost"),htmlFor:"mailpoet_web_host"}),(0,_.jsx)(v,{children:(0,_.jsx)(T.Select,{id:"mailpoet_web_host",value:e,onChange:(0,d.k9)(t),isMinWidth:!0,dimension:"small",children:Object.entries(i).map((([e,t])=>(0,_.jsx)("option",{value:e,children:t.name},e)))})}),(0,_.jsx)(Ne,{recommendedEmails:s.emails,recommendedInterval:s.interval})]})}function Ie(){const[e,t]=(0,w.iK)("mta","host"),[i,s]=(0,w.iK)("mta","port"),[n,a]=(0,w.iK)("mta","login"),[o,r]=(0,w.iK)("mta","password"),[l,c]=(0,w.iK)("mta","encryption"),[m,p]=(0,w.iK)("mta","authentication");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Ne,{recommendedEmails:100,recommendedInterval:5}),(0,_.jsx)(b,{title:(0,d.t)("smtpHost"),description:(0,d.t)("smtpHostExample"),htmlFor:"mailpoet_smtp_host"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",id:"mailpoet_smtp_host",value:e,onChange:(0,d.k9)(t)})}),(0,_.jsx)(b,{title:(0,d.t)("smtpPort"),htmlFor:"mailpoet_smtp_port"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",id:"mailpoet_smtp_port",value:i,onChange:(0,d.k9)(s)})}),(0,_.jsx)(b,{title:(0,d.t)("login"),htmlFor:"mailpoet_smtp_login"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",id:"mailpoet_smtp_login",value:n,onChange:(0,d.k9)(a)})}),(0,_.jsx)(b,{title:(0,d.t)("password"),htmlFor:"mailpoet_smtp_password"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"password",id:"mailpoet_smtp_password",value:o,onChange:(0,d.k9)(r)})}),(0,_.jsx)(b,{title:(0,d.t)("secureConnectioon"),htmlFor:"mailpoet_smtp_encryption"}),(0,_.jsx)(v,{children:(0,_.jsxs)(T.Select,{id:"mailpoet_smtp_encryption",value:l,onChange:(0,d.k9)(c),isMinWidth:!0,dimension:"small",children:[(0,_.jsx)("option",{value:"",children:(0,d.t)("no")}),(0,_.jsx)("option",{value:"ssl",children:"SSL"}),(0,_.jsx)("option",{value:"tls",children:"TLS"})]})}),(0,_.jsx)(b,{title:(0,d.t)("authentication"),description:(0,d.t)("authenticationDescription"),htmlFor:"mailpoet_smtp_authentication"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(L.s,{value:"1",checked:"1"===m,onCheck:p}),(0,d.t)("yes")," ",(0,_.jsx)(L.s,{value:"-1",checked:"-1"===m,onCheck:p}),(0,d.t)("no")]})]})}function Te(){const[e,t]=(0,w.iK)("mta","region"),[i,s]=(0,w.iK)("mta","access_key"),[n,a]=(0,w.iK)("mta","secret_key"),o=(0,w.d4)("getAmazonSesOptions")();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Ne,{recommendedEmails:o.emails,recommendedInterval:o.interval}),(0,_.jsx)(b,{title:(0,d.t)("region"),htmlFor:"mailpoet_amazon_ses_region"}),(0,_.jsx)(v,{children:(0,_.jsx)(T.Select,{id:"mailpoet_amazon_ses_region",value:e,onChange:(0,d.k9)(t),isMinWidth:!0,dimension:"small",children:Object.entries(o.regions).map((([e,t])=>(0,_.jsx)("option",{value:t,children:e},t)))})}),(0,_.jsx)(b,{title:(0,d.t)("accessKey"),htmlFor:"mailpoet_amazon_ses_access_key"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",value:i,className:"regular-text",onChange:(0,d.k9)(s),id:"mailpoet_amazon_ses_access_key"})}),(0,_.jsx)(b,{title:(0,d.t)("secretKey"),htmlFor:"mailpoet_amazon_ses_secret_key"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",value:n,className:"regular-text",onChange:(0,d.k9)(a),id:"mailpoet_amazon_ses_secret_key"})})]})}function Ee(){const[e,t]=(0,w.iK)("mta","api_key"),i=(0,w.d4)("getSendGridOptions")();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Ne,{recommendedEmails:i.emails,recommendedInterval:i.interval}),(0,_.jsx)(b,{title:(0,d.t)("apiKey"),htmlFor:"mailpoet_sendgrid_api_key"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",value:e,onChange:(0,d.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)(be,{}),"PHPMail"===e&&(0,_.jsx)(Ke,{}),"SMTP"===e&&(0,_.jsx)(Ie,{}),"AmazonSES"===e&&(0,_.jsx)(Te,{}),"SendGrid"===e&&(0,_.jsx)(Ee,{}),(0,_.jsx)(ve,{}),(0,_.jsx)(ye,{}),(0,_.jsx)(we,{})]})}function De(){const{subPage:e}=(0,j.g)();return"other"===e?(0,_.jsx)(Me,{}):(0,_.jsx)(_e,{})}function Ae(){const e=(0,w.d4)("isMssActive")(),[t,i]=(0,w.iK)("signup_confirmation","enabled"),s=e=>{"1"===e&&window.confirm((0,d.t)("subscribersNeedToActivateSub"))&&i("1"),""===e&&window.confirm((0,d.t)("newSubscribersAutoConfirmed"))&&i("")};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("enableSignupConfTitle"),description:(0,_.jsxs)(_.Fragment,{children:[(0,d.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,d.t)("readAboutDoubleOptIn")})]}),htmlFor:"signup_confirmation-enabled"}),(0,_.jsx)(v,{children:e?(0,_.jsx)("p",{children:(0,d.t)("signupConfirmationIsMandatory")}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(L.s,{id:"signup_confirmation-enabled",checked:"1"===t,value:"1",onCheck:s,automationId:"enable_signup_confirmation"}),(0,d.t)("yes")," ",(0,_.jsx)(L.s,{checked:""===t,value:"",onCheck:s,automationId:"disable_signup_confirmation"}),(0,d.t)("no")]})})]})}function Pe(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,i]=(0,w.iK)("signup_confirmation","subject"),[s]=(0,w.iK)("signup_confirmation","use_mailpoet_editor");return e?"1"===s?null:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("emailSubject"),htmlFor:"signup_confirmation-subject"}),(0,_.jsx)(v,{children:(0,_.jsx)(M.p,{dimension:"small",type:"text",size:50,id:"signup_confirmation-subject","data-automation-id":"signup_confirmation_email_subject",value:t,onChange:(0,d.k9)(i)})})]}):null}var $e=i(33609);function ze(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,i]=(0,w.iK)("signup_confirmation","body"),[s]=(0,w.iK)("signup_confirmation","use_mailpoet_editor");if(!e)return null;if("1"===s)return null;const n=(0,d.t)("emailContentDescription").replace("[current_site_title]",window.mailpoet_current_site_title||"").split("<br />").filter((e=>e));return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.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)($e.T,{id:"signup_confirmation-body",cols:50,rows:15,"data-automation-id":"signup_confirmation_email_body",value:t,onChange:(0,d.k9)(i)})})]})}function We(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,i]=(0,w.iK)("subscription","pages","confirmation");return e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("confirmationPage"),description:(0,d.t)("confirmationPageDescription"),htmlFor:"subscription-pages-confirmation"}),(0,_.jsx)(v,{children:(0,_.jsx)(E,{value:t,preview:"confirm",setValue:i,id:"subscription-pages-confirmation",automationId:"page_selection",linkAutomationId:"preview_page_link"})})]}):null}function Re(){const[e]=(0,w.iK)("signup_confirmation","enabled"),[t,i]=(0,w.iK)("signup_confirmation","use_mailpoet_editor"),[s]=(0,w.iK)("signup_confirmation","transactional_email_id"),n=(0,w.y3)("openEmailCustomizer");return e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("emailCustomizerTitle"),description:(0,d.t)("emailCustomizerDescription"),htmlFor:"mailpoet_confirmation_email_customizer"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(P.S,{id:"mailpoet_confirmation_email_customizer",automationId:"mailpoet_confirmation_email_customizer",checked:"1"===t,onCheck:e=>i(e?"1":"")}),(0,_.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,_.jsx)(y.$,{type:"button",onClick:()=>n(s),variant:"secondary",dimension:"small",children:(0,d.t)("openTemplateEditor")})})]})]}):null}function Le(){return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(Ae,{}),(0,_.jsx)(Re,{}),(0,_.jsx)(Pe,{}),(0,_.jsx)(ze,{}),(0,_.jsx)(We,{}),(0,_.jsx)(N,{})]})}function Oe(){const[e,t]=(0,w.iK)("woocommerce","use_mailpoet_editor"),[i]=(0,w.iK)("woocommerce","transactional_email_id"),s=(0,w.y3)("openWoocommerceCustomizer");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("wcCustomizerTitle"),description:(0,d.t)("wcCustomizerDescription"),htmlFor:"mailpoet_wc_customizer"}),(0,_.jsxs)(v,{children:[(0,_.jsx)(P.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:()=>s(i),variant:"secondary",dimension:"small",children:(0,d.t)("openTemplateEditor")})})]})]})}var Ve=i(78631);function Be(){const[e,t]=(0,w.iK)("woocommerce","optin_on_checkout","enabled"),[i,s]=(0,w.iK)("woocommerce","optin_on_checkout","segments"),[n,a]=(0,w.iK)("woocommerce","optin_on_checkout","message"),[r,l]=(0,w.iK)("woocommerce","optin_on_checkout","position"),c=(0,w.y3)("setErrorFlag"),m=""===n.trim();return(0,f.useEffect)((()=>{c(m)}),[m,c]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,o.__)("Opt-in on checkout","mailpoet"),description:(0,o.__)('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)(Ve.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,o.__)("Lists to also subscribe customers to:","mailpoet"),(0,_.jsx)("br",{}),(0,_.jsx)("span",{children:(0,o.__)('Leave empty to subscribe only to "WooCommerce Customers" list')})]}),(0,_.jsx)("br",{}),(0,_.jsx)(I,{id:"mailpoet_wc_checkout_optin_segments",value:i,setValue:s,placeholder:(0,o.__)("Select lists...","mailpoet")})]})]}),"1"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,o.__)("Checkbox opt-in message","mailpoet"),description:(0,o.__)('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)(Ve.Input,{dimension:"small",type:"text",id:"mailpoet_wc_checkout_optin_message","data-automation-id":"mailpoet_wc_checkout_optin_message",value:n,onChange:(0,Ve.onChange)(a),placeholder:(0,o.__)("Checkbox opt-in message","mailpoet")}),(0,_.jsx)("br",{}),m&&(0,_.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.__)("The checkbox opt-in message cannot be empty.","mailpoet")})]})]}),"1"===e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,o.__)("Checkbox opt-in position","mailpoet"),description:(0,o.__)("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)(Ve.Select,{id:"mailpoet_wc_checkout_optin_position",value:r,onChange:(0,Ve.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,o.__)("After billing info","mailpoet")}),(0,_.jsx)("option",{value:"after_order_notes","data-automation-id":"after_order_notes",children:(0,o.__)("After order notes","mailpoet")}),(0,_.jsx)("option",{value:"after_terms_and_conditions","data-automation-id":"after_terms_and_conditions",children:(0,o.__)("After terms and conditions","mailpoet")}),(0,_.jsx)("option",{value:"before_payment_methods","data-automation-id":"before_payment_methods",children:(0,o.__)("Before payment methods","mailpoet")}),(0,_.jsx)("option",{value:"before_terms_and_conditions","data-automation-id":"before_terms_and_conditions",children:(0,o.__)("Before terms and conditions","mailpoet")})]})})]})]})}function Ue(){const[e,t]=(0,w.iK)("mailpoet_subscribe_old_woocommerce_customers","enabled");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{title:(0,d.t)("subscribeOldWCTitle"),description:(0,d.t)("subscribeOldWCDescription"),htmlFor:"mailpoet_subscribe_old_wc_customers"}),(0,_.jsx)(v,{children:(0,_.jsx)(P.S,{id:"mailpoet_subscribe_old_wc_customers",automationId:"mailpoet_subscribe_old_wc_customers",checked:"1"===e,onCheck:e=>t(e?"1":"")})})]})}function qe(){return(0,_.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,_.jsx)(Oe,{}),(0,_.jsx)(Be,{}),(0,_.jsx)(Ue,{}),(0,_.jsx)(N,{})]})}var Ge=i(87948),He=i(98968);function Ye(){const[e,t]=(0,f.useState)(!0);return e&&(0,_.jsxs)(He.A,{className:"mailpoet-welcome-wizard-confirmation-modal",title:(0,o.__)("Confirm sending service selection","mailpoet"),onRequestClose:()=>{},isDismissible:!1,children:[(0,_.jsx)("p",{children:(0,Ge.A)((0,o.__)('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 <link>upgrade to a subscription</link> 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)(Ve.Button,{onClick:()=>{t(!1),window.location.href="admin.php?page=mailpoet-settings#/mta/other"},children:(0,o.__)("Update service settings","mailpoet")})})]})}const Xe=window.location.href.includes("/mta");function Ze(){const e=(0,w.d4)("isSaving")(),t=(0,w.d4)("hasWooCommerce")();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u.V,{}),e&&(0,_.jsx)(m.R,{}),(0,_.jsx)(r.D,{}),(0,_.jsx)(c.q,{}),(0,_.jsx)(g.z,{heading:(0,o.__)("Settings","mailpoet")}),(0,_.jsx)(l.D,{}),(0,_.jsx)(x.O,{storeName:"mailpoet-settings"}),(0,_.jsxs)(p.k,{activeKey:"basics",children:[(0,_.jsx)(h.o,{route:"basics/:showModal?",title:(0,d.t)("basicsTab"),automationId:"basic_settings_tab",children:(0,_.jsx)(H,{})},"basics"),(0,_.jsx)(h.o,{title:(0,d.t)("signupConfirmationTab"),automationId:"signup_settings_tab",children:(0,_.jsx)(Le,{})},"signup"),(0,_.jsx)(h.o,{route:"mta/:subPage?",title:(0,d.t)("sendWithTab"),automationId:"send_with_settings_tab",children:(0,_.jsx)(De,{})},"mta"),t&&(0,_.jsx)(h.o,{title:(0,d.t)("wooCommerceTab"),automationId:"woocommerce_settings_tab",children:(0,_.jsx)(qe,{})},"woocommerce"),(0,_.jsx)(h.o,{title:(0,d.t)("advancedTab"),automationId:"settings-advanced-tab",children:(0,_.jsx)(ce,{})},"advanced"),(0,_.jsx)(h.o,{title:(0,d.t)("keyActivationTab"),automationId:"activation_settings_tab",children:(0,_.jsx)(ge,{subscribersCount:window.mailpoet_subscribers_count})},"premium")]}),window.mailpoet_mss_active&&!window.mailpoet_mss_key_valid&&!Xe&&(0,_.jsx)(Ye,{})]})}function Je(){return(0,_.jsx)(n.F.Provider,{value:(0,n.f)(window),children:(0,_.jsx)(Ze,{})})}const Qe=document.getElementById("settings_container");Qe&&((0,Ve.registerTranslations)(),(0,a.k)(),(0,s.H)(Qe).render((0,_.jsx)(Je,{})))},41669:e=>{e.exports=jQuery}},e=>{e.O(0,[223],(()=>e(e.s=69796))),e.O()}]);