PATH:
home
/
lab2454c
/
caimegroup.com
/
wp-content
/
plugins
/
mailpoet
/
assets
/
dist
/
js
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[392],{73055:function(e,t,a){var i=a(26372),o=a.n(i),s=a(2226),n=a(70079),r=a(485),l=a(21263),c=a(91908),d=a(30550),m=a(41474),u=a(69138),p=a(21229),h=a(5748),b=a(86268),_=a(54678),g=a(41728),v=a(61750),x=a(51867),j=a(28234),S=a(89912),f=a(38516),N=(a(20644),a(35250)),y=a(14029),w=a(71111);function Z(){const{isSidebarOpened:e,selectedStep:t,savedState:a}=(0,p.Z)((e=>({isSidebarOpened:e(w.storeName).isSidebarOpened,selectedStep:e(w.storeName).getSelectedStep,savedState:e(w.storeName).getSavedState()}))),{openSidebar:i,closeSidebar:o,save:s,toggleFeature:r}=(0,y.Z)(w.storeName),{registerShortcut:l}=(0,y.Z)(v.h);return(0,n.useEffect)((()=>{l({name:"mailpoet/automation-editor/toggle-fullscreen",category:"global",description:(0,x.__)("Toggle fullscreen mode.","mailpoet"),keyCombination:{modifier:"secondary",character:"f"}}),l({name:"mailpoet/automation-editor/toggle-sidebar",category:"global",description:(0,x.__)("Show or hide the settings sidebar.","mailpoet"),keyCombination:{modifier:"primaryShift",character:","}}),l({name:"mailpoet/automation-editor/save",category:"global",description:(0,x.__)("Save your changes.","mailpoet"),keyCombination:{modifier:"primary",character:"s"}})}),[l]),(0,v.bx)("mailpoet/automation-editor/toggle-fullscreen",(()=>{r("fullscreenMode")})),(0,v.bx)("mailpoet/automation-editor/toggle-sidebar",(a=>{if(a.preventDefault(),e())o();else{const e=t()?w.stepSidebarKey:w.automationSidebarKey;i(e)}})),(0,v.bx)("mailpoet/automation-editor/save",(e=>{e.preventDefault(),"unsaved"===a&&s()})),null}var A=a(63374),k=a(82371);function D({sidebarKey:e}){const{openSidebar:t}=(0,y.Z)(w.storeName),[a,i]=e===w.automationSidebarKey?[(0,x.__)("Automation (selected)","mailpoet"),"is-active"]:[(0,x.__)("Automation","mailpoet"),""],[o,s]=e===w.stepSidebarKey?[(0,x.__)("Step (selected)","mailpoet"),"is-active"]:[(0,x.__)("Step","mailpoet"),""];return(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(l.ZP,{onClick:()=>t(w.automationSidebarKey),className:`edit-site-sidebar-edit-mode__panel-tab ${i}`,"aria-label":a,"data-label":(0,x.__)("Automation","mailpoet"),children:(0,x.__)("Automation","mailpoet")})}),(0,N.jsx)("li",{children:(0,N.jsx)(l.ZP,{onClick:()=>t(w.stepSidebarKey),className:`edit-site-sidebar-edit-mode__panel-tab ${s}`,"aria-label":o,"data-label":(0,x.__)("Step","mailpoet"),children:(0,x.__)("Step","mailpoet")})})]})}var C=a(48558),E=a(93832),L=a(47294),O=a(48927),P=a(66276);function I({title:e,description:t,icon:a}){return(0,N.jsxs)("div",{className:"block-editor-block-card",children:[(0,N.jsx)(P.Z,{icon:a}),(0,N.jsxs)("div",{className:"block-editor-block-card__content",children:[(0,N.jsx)("h2",{className:"block-editor-block-card__title",children:e}),(0,N.jsx)("span",{className:"block-editor-block-card__description",children:t})]})]})}function K(){const{errors:e}=(0,p.Z)((e=>({errors:e(w.storeName).getStepError(e(w.storeName).getSelectedStep().id)})),[]);if(!e||!e?.fields)return null;const t=e.fields?.general;return t?(0,N.jsx)(C.Z,{isDismissible:!1,status:"error",children:t}):null}function F(){const{selectedStep:e,selectedStepType:t}=(0,p.Z)((e=>({selectedStep:e(w.storeName).getSelectedStep(),selectedStepType:e(w.storeName).getSelectedStepType()})),[]);if(!e)return(0,N.jsx)(E.ZP,{children:"No step selected."});if(!t)return(0,N.jsx)(E.ZP,{children:"Unknown step type."});const a=t.edit;return(0,N.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,N.jsx)(K,{}),(0,N.jsx)(I,{title:t.title(e,"sidebar"),description:t.description(e,"sidebar"),icon:t.icon}),(0,N.jsx)(a,{},e.id),"trigger"===e.type&&(0,N.jsx)(O.G9,{strings:L.E})]})}var T=a(90564),V=a(77309),W=a(74325),M=a(84209);function B(){const e=M.Hooks.applyFilters("mailpoet.automation.settings.render",{});return 0===Object.keys(e).length?null:(0,N.jsx)(E.ZP,{title:(0,x.__)("Automation settings","mailpoet"),initialOpen:!0,children:Object.keys(e).map((t=>(0,N.jsx)(T.Z,{children:e[t]},t)))})}function G(){const{automationData:e}=(0,p.Z)((e=>({automationData:e(w.storeName).getAutomationData()})),[]),t={year:"numeric",month:"long",day:"numeric"};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(E.ZP,{title:(0,x.__)("Automation details","mailpoet"),initialOpen:!0,children:[(0,N.jsxs)(T.Z,{children:[(0,N.jsx)("strong",{children:"Date added"})," ",new Date(Date.parse(e.created_at)).toLocaleDateString(W.locale.toString(),t)]}),(0,N.jsxs)(T.Z,{children:[(0,N.jsx)("strong",{children:"Activated"})," ","active"===e.status&&new Date(Date.parse(e.updated_at)).toLocaleDateString(W.locale.toString(),t),"active"!==e.status&&e.activated_at&&new Date(Date.parse(e.activated_at)).toLocaleDateString(W.locale.toString(),t),"active"!==e.status&&!e.activated_at&&(0,N.jsx)("span",{className:"mailpoet-deactive",children:"Not activated yet."})]}),(0,N.jsxs)(T.Z,{children:[(0,N.jsx)("strong",{children:"Author"})," ",e.author.name]}),(0,N.jsx)(T.Z,{children:(0,N.jsx)(V.Q,{})})]}),(0,N.jsx)(B,{})]})}const q=b.Z.select({web:!0,native:!1});function z(e){const{keyboardShortcut:t,sidebarKey:a,showIconLabels:i,automationName:o}=(0,p.Z)((e=>({keyboardShortcut:e(v.h).getShortcutRepresentation("mailpoet/automation-editor/toggle-sidebar"),sidebarKey:e(g.h).getActiveComplementaryArea(w.storeName)??w.automationSidebarKey,showIconLabels:e(w.storeName).isFeatureActive("showIconLabels"),automationName:e(w.storeName).getAutomationData().name})),[]);return(0,N.jsxs)(g.Vi,{identifier:a,header:(0,N.jsx)(D,{sidebarKey:a}),closeLabel:(0,x.__)("Close settings","mailpoet"),headerClassName:"edit-site-sidebar-edit-mode__panel-tabs",title:(0,x.__)("Settings","mailpoet"),icon:k.Z,className:"edit-site-sidebar mailpoet-automation-sidebar",panelClassName:"edit-site-sidebar",smallScreenTitle:o||(0,x.__)("(no title)","mailpoet"),scope:w.storeName,toggleShortcut:t,isActiveByDefault:q,showIconLabels:i,...e,children:[a===w.automationSidebarKey&&(0,N.jsx)(G,{}),a===w.stepSidebarKey&&(0,N.jsx)(F,{})]})}var H=a(75233),Q=a(96854),R=a(69177),Y=a(55382),$=a(61970),U=a(6958),J=a(59098),X=a(26462);function ee({onClose:e}){const[t,a]=(0,n.useState)(!1),{activate:i}=(0,y.Z)(w.storeName);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"mailpoet-automation-activate-panel__header",children:[(0,N.jsx)("div",{className:"mailpoet-automation-activate-panel__header-activate-button",children:(0,N.jsxs)(l.ZP,{variant:"primary",disabled:t,isBusy:t,autoFocus:!t,onClick:()=>{a(!0),i()},children:[t&&(0,x.__)("Activating…","mailpoet"),!t&&(0,x.__)("Activate","mailpoet")]})}),(0,N.jsx)("div",{className:"mailpoet-automation-activate-panel__header-cancel-button",children:(0,N.jsx)(l.ZP,{variant:"secondary",onClick:e,disabled:t,children:(0,x.__)("Cancel","mailpoet")})})]}),t&&(0,N.jsx)("div",{className:"mailpoet-automation-activate-panel__body",children:(0,N.jsx)(U.ZP,{})}),!t&&(0,N.jsxs)("div",{className:"mailpoet-automation-activate-panel__body",children:[(0,N.jsx)("p",{children:(0,N.jsx)("strong",{children:(0,x.__)("Are you ready to activate?","mailpoet")})}),(0,N.jsx)("p",{children:(0,x.__)("Double-check your settings before activating.","mailpoet")})]})]})}function te({onClose:e}){const{automation:t}=(0,p.Z)((e=>({automation:e(w.storeName).getAutomationData()})),[]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"mailpoet-automation-activate-panel__header",children:(0,N.jsx)(l.ZP,{icon:J.Z,onClick:e,label:(0,x.__)("Close","mailpoet")})}),(0,N.jsxs)("div",{className:"mailpoet-automation-activate-panel__body",children:[(0,N.jsx)("div",{className:"mailpoet-automation-activate-panel__section",children:(0,x.sprintf)((0,x.__)('"%s" is now live.',"mailpoet"),t.name)}),(0,N.jsx)("p",{children:(0,N.jsx)("strong",{children:(0,x.__)("What’s next?","mailpoet")})}),(0,N.jsx)("p",{children:(0,x.__)("View all your automations to track statistics and create new ones.","mailpoet")}),(0,N.jsx)(l.ZP,{variant:"secondary",onClick:()=>{window.location.href=R.MailPoet.urls.automationListing},children:(0,x.__)("View all automations","mailpoet")})]})]})}function ae(){const{automation:e,errors:t}=(0,p.Z)((e=>({errors:e(w.storeName).getErrors(),automation:e(w.storeName).getAutomationData()})),[]),{closeActivationPanel:a}=(0,y.Z)(w.storeName);if((0,n.useEffect)((()=>{t&&a()}),[t,a]),t)return null;const i=e.status===X.b.ACTIVE;return(0,N.jsxs)("div",{className:"mailpoet-automation-activate-panel",children:[i&&(0,N.jsx)(te,{onClose:a}),!i&&(0,N.jsx)(ee,{onClose:a})]})}var ie=a(96621);function oe(e){return"saved"!==(0,m.Y)(w.storeName).getSavedState()?(e.returnValue=(0,x.__)("There are unsaved changes that will be lost. Do you want to continue?","mailpoet"),e.returnValue):""}function se(){const{isFullscreenActive:e,isInserterOpened:t,isActivationPanelOpened:a,isSidebarOpened:i,showIconLabels:s,automation:h}=(0,p.Z)((e=>({isFullscreenActive:e(w.storeName).isFeatureActive("fullscreenMode"),isInserterOpened:e(w.storeName).isInserterSidebarOpened(),isSidebarOpened:e(w.storeName).isSidebarOpened(),isActivationPanelOpened:e(w.storeName).isActivationPanelOpened(),showIconLabels:e(w.storeName).isFeatureActive("showIconLabels"),automation:e(w.storeName).getAutomationData()})),[]),[b,S]=(0,n.useState)(!0);if((0,n.useEffect)((()=>(window.addEventListener("beforeunload",oe),()=>window.removeEventListener("beforeunload",oe))),[]),(0,n.useEffect)((()=>{b&&("trash"===h.status&&(window.location.href=(0,j.f)(R.MailPoet.urls.automationListing,{notice:Y.f.automationHadBeenDeleted,"notice-args":[h.name]})),function(){const e=(0,m.Y)(w.storeName).getAutomationData();if(![X.b.ACTIVE,X.b.DEACTIVATING].includes(e.status))return;if(0===e.stats.totals.in_progress)return;const{createNotice:t}=(0,u.W)(d.store);t("success",(0,x.__)("Editing an active automation is temporarily unavailable. We are working on introducing this functionality.","mailpoet"),{type:"snackbar"})}(),S(!1))}),[h.name,h.status,b]),"trash"===h.status)return null;const y=o()("interface-interface-skeleton",{"is-sidebar-opened":i,"show-icon-labels":s});return(0,N.jsx)(v.vn,{children:(0,N.jsxs)(r.zt,{children:[(0,N.jsx)(g.x4,{isActive:e}),(0,N.jsx)(Z,{}),(0,N.jsx)(z,{}),(0,N.jsx)(g.v4,{className:y,drawer:e&&(0,N.jsx)("div",{className:"edit-site-navigation-toggle",children:(0,N.jsx)(l.ZP,{className:"edit-site-navigation-toggle__button has-icon",href:"admin.php?page=mailpoet-automation",children:(0,N.jsx)(c.Z,{size:36,icon:_.Z})})}),header:(0,N.jsx)(f.h4,{showInserterToggle:!1}),content:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(A.s,{}),(0,N.jsx)(H.q,{context:"edit"})]}),sidebar:(0,N.jsx)(g.Vi.Slot,{scope:w.storeName}),secondarySidebar:null}),a&&(0,N.jsx)(ae,{})]})})}window.addEventListener("DOMContentLoaded",(()=>{if((0,x.setLocaleData)(window.wp.i18n.getLocaleData()),void 0!==window.wp.date.getSettings){const e=window.wp;(0,h.setSettings)(e.date.getSettings())}else{const e=window.wp;(0,h.setSettings)(e.date.__experimentalGetSettings())}(0,w.createStore)();const e=b.Z.select({web:!0,native:!1});(0,u.W)(g.h).enableComplementaryArea(w.storeName,e?w.automationSidebarKey:void 0);const t=document.getElementById("mailpoet_automation_editor");t&&((0,S.registerTranslations)(),$.default.use((async(e,t)=>{try{return await t(e)}catch(t){if(e.signal?.aborted)return;const a=t,i=a.data?.status;if("mailpoet_automation_not_valid"===a.code)return void(0,u.W)(w.storeName).setErrors({steps:a.data.errors});if(i&&i>=400&&i<500){const e=a.message;return(0,u.W)(d.store).createErrorNotice(e??(0,x.__)("An unknown error occurred.","mailpoet"),{explicitDismiss:!0}),void(0,u.W)(w.storeName).setErrors({steps:[]})}throw(0,u.W)(d.store).createErrorNotice((0,x.__)("An unknown error occurred.","mailpoet"),{explicitDismiss:!0}),t}})),(0,Q.q)(),(0,ie.R)(),(0,s.s)(t).render((0,N.jsx)(se,{})))}))},65311:function(e){e.exports=jQuery}},function(e){e.O(0,[351],(function(){return 73055,e(e.s=73055)})),e.O()}]);
[-] form_editor.js
[edit]
[-] automation_editor.js
[edit]
[-] automation.js
[edit]
[-] index.php
[edit]
[-] form_preview.js
[edit]
[+]
..
[-] admin.js
[edit]
[-] post_editor_block.js
[edit]
[-] vendor.js
[edit]
[-] mailpoet.js
[edit]
[-] commons.js
[edit]
[+]
marketing-optin-block
[-] newsletter_editor.js
[edit]
[-] mailpoet.js.LICENSE.txt
[edit]
[-] automation_analytics.js.LICENSE.txt
[edit]
[-] settings.js
[edit]
[-] commons.js.LICENSE.txt
[edit]
[-] manifest.json
[edit]
[-] admin_vendor.js
[edit]
[-] public.js.LICENSE.txt
[edit]
[+]
skins
[+]
email-editor
[-] public.js
[edit]
[-] newsletter_editor.js.LICENSE.txt
[edit]
[-] automation_analytics.js
[edit]
[-] automation_templates.js
[edit]
[-] runtime.js
[edit]
[-] form_editor.js.LICENSE.txt
[edit]
[-] admin.js.LICENSE.txt
[edit]
[-] post_editor_block.js.LICENSE.txt
[edit]