@emailmaker/emailmaker 1.0.40 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8458],{90219:(e,t,a)=>{a.d(t,{A:()=>S});var s=a(92810),l=a(95838),i=a(12280),n=a(55039),r=a(81662),o=a(66522),c=a(28372),m=a(45934),d=a(64617),u=a(23287),p=a(38883),h=a.n(p),_=a(55701),g=a(17581),A=a(84568),x=a(8493),j=a(87790),y=a(65983),v=a(56991),b=a(32269),f=a(85163),k=a(70082);const{useToken:w}=l.A,{title:O,description:N,tags:D,type:C,is_template:I}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template"},P={[O]:"",[N]:"",[D]:[],[I]:!1},E={[N]:"",[D]:[],[C]:""},L=({className:e,element:t})=>{const{__:a}=(0,u.s9)(),{projectId:l}=(0,d.g)(),p=(0,m.wA)(),[L]=i.A.useForm(),{token:S}=w(),z=(0,v.rD)(),M=(0,m.Pj)(),U=t.hasOwnProperty("type")?f.IE:f.Tm,T=t.hasOwnProperty("type")?f.YY:f.zh;const{data:G}=A.Nq.endpoints.getProject.select(+l)(M.getState());(0,s.useEffect)((()=>{var e;q(null===(e=function(e){const t=new Set;return null===e||void 0===e?void 0:e.filter((e=>!t.has(e.name)&&(t.add(e.name),!0)))}((0,b.HT)(G,T)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[G,T]),(0,s.useEffect)((()=>{if(t){var e,a;const s=null===(e=(0,b._q)(t,T))||void 0===e?void 0:e.map((e=>e.name)),l=t.emailtags||t.blocktags,i=null===(a=(0,b._q)(t,T))||void 0===a?void 0:a.filter((e=>l.includes(e.id))).map((e=>e.name));L.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||s,type:t.type})}}),[L,t,T]);const{data:F}=(0,_.h1)(),[B,V]=(0,s.useState)([]),[R,q]=(0,s.useState)([]);return(0,s.useEffect)((()=>{if(F){const e=F.schema.properties.acf.properties.type.items.enum;let t=[];const s={Applications:a("Apps"),Articles:a("Article"),Banners:a("Banners"),Buttons:a("Buttons"),"Call to Action":a("Call to Action"),Contacts:a("Contacts"),Content:a("Content"),"E-Commerce":a("E-Commerce"),Feature:a("Features"),Footer:a("Footers"),Header:a("Headers"),Lists:a("Lists"),Menu:a("Menus"),Other:a("Others"),Polls:a("Polls"),Promocodes:a("Promocodes"),Separators:a("Separators")};for(let a in e)t.push({label:s[e[a]],value:e[a]});V(t)}}),[F,a]),(0,k.jsx)("div",{className:h()("settings-panel",{[e]:e}),children:(0,k.jsxs)(i.A,{form:L,layout:"vertical",name:"settings_panel_form",initialValues:U===f.Tm?{EmailInitialValues:P}:E,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case O:t.isNew?p((0,x.BQ)(e[a])):p((0,y.VK)(e[a]));break;case N:U===f.Tm?t.isNew?p((0,x.Zs)(e[a])):p(g.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[a]})}))):t.isNew?p((0,j.AS)(e[a])):p(_.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[a]})})));break;case I:t.isNew?p((0,x.TC)(e[a])):p(g.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[a]})})));break;case D:{const s=e[a].map((e=>e.trim()));U===f.Tm?t.isNew?p((0,x.yY)(s)):p(g.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:s})}))):t.isNew?p((0,j.TB)(s)):p(_.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:s})})));break}case C:p(_.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[a]})})));break;default:return}},autoComplete:"off",children:[z.subjectEnabled&&U===f.Tm&&(0,k.jsx)(i.A.Item,{label:a("Title"),name:O,tooltip:{title:a("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:(0,k.jsx)(c.A,{})},children:(0,k.jsx)(n.A.TextArea,{placeholder:a("Type title here"),autoSize:{minRows:1}})}),z.descriptionEnabled&&(0,k.jsx)(i.A.Item,{label:a("Description"),name:N,tooltip:{title:a("Description is used in other sections of the service."),icon:(0,k.jsx)(c.A,{})},children:(0,k.jsx)(n.A.TextArea,{placeholder:a("Type your description here"),autoSize:{minRows:2}})}),z.tagsEnabled&&(0,k.jsx)(i.A.Item,{label:a("Tags"),name:D,tooltip:{title:a("Tags help you find the block in the list."),icon:(0,k.jsx)(c.A,{})},rules:[{message:"Please input your username!",type:"array"}],children:(0,k.jsx)(r.A,{mode:"tags",style:{width:"100%"},placeholder:a("Type your tags here"),options:R,tagRender:e=>{const{label:t,closable:a,onClose:s}=e;return(0,k.jsx)(o.A,{color:S.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:a,onClose:s,style:{borderRadius:6},children:t})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})}),U===f.IE&&(0,k.jsx)(i.A.Item,{name:C,label:a("Type"),tooltip:{title:a("Select the block type to find any block on the list faster."),icon:(0,k.jsx)(c.A,{})},rules:[{message:"Please input type!"}],children:(0,k.jsx)(r.A,{placeholder:a("Choose block type"),options:B,getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})]})})};L.defaultProps={className:"",email:void 0};const S=L},13465:(e,t,a)=>{a.d(t,{A:()=>y});a(92810);var s=a(2018),l=a(7744),i=a(68694),n=a.n(i),r=a(38610),o=a.n(r),c=a(73248),m=a.n(c),d=a(41705),u=a.n(d),p=a(96588),h=a.n(p),_=a(97433),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],y=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},85291:(e,t,a)=>{a.d(t,{A:()=>y});a(92810);var s=a(2018),l=a(7744),i=a(69029),n=a.n(i),r=a(41579),o=a.n(r),c=a(70869),m=a.n(c),d=a(8456),u=a.n(d),p=a(20931),h=a.n(p),_=a(24186),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],y=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},57903:(e,t,a)=>{a.d(t,{A:()=>u});a(92810);var s=a(59018),l=a.n(s),i=a(23287),n=a(71157),r=a(17581),o=a(55701),c=a(32269),m=a(70082);const d=({element:e})=>{const{__:t,_x:a}=(0,i.s9)(),[s]=(0,r.dN)(),[l]=(0,o.OZ)(),d=(0,n.hN)(),u=(e,s)=>{if(e.error)return(0,c.p6)(e,d),!1;(0,c.wB)(t("The ")+(s.hasOwnProperty("type")?t("block"):a("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(s.lock?s.hasOwnProperty("type")?a("unlocked.","block"):a("unlocked.","email"):s.hasOwnProperty("type")?a("locked.","block"):a("locked.","email")),d)};return(0,m.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?l({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):s({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))},children:e.lock?t("Unlock"):t("Lock")})};d.defaultProps={element:l().shape({lock:null,id:null})};const u=d},90775:(e,t,a)=>{a.d(t,{A:()=>A});var s=a(92810),l=a(12280),i=a(14852),n=a(43005),r=a(2018),o=a(7744),c=a(55039),m=a(71157),d=a(45934),u=a(23287),p=a(64936),h=a(32269),_=a(40869),g=a(70082);const A=({isModalVisible:e,userEmail:t,subscriptionRequest:a,userName:A,currentPlane:x})=>{const{__:j}=(0,u.s9)(),y=(0,d.wA)(),[v]=l.A.useForm(),[b,f]=(0,_.E)(),k=(0,m.hN)(),w=()=>{y((0,p.Oo)())},O=()=>{v.validateFields().then((()=>{const e=v.getFieldsValue(!0);b(JSON.stringify(e)).then((e=>{var t,a,s;200===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.status)?((0,h.wB)(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.message,k),w()):e.error&&(0,h.p6)(e,k)}))})).catch((e=>{console.warn(e)}))};return(0,s.useEffect)((()=>{a&&(null===v||void 0===v||v.setFieldsValue({request_tariff:a,user_name:A,user_email:t,user_tariff:x}))}),[v,a,x,A,t]),(0,g.jsx)(i.A,{title:j("Request for changing the pricing plan"),className:"blocks-modal",open:e,onOk:O,onCancel:w,centered:!0,width:572,footer:[(0,g.jsx)(n.Ay,{type:"primary",size:"large",onClick:O,disabled:f.isLoading,children:j("Send")},"submit")],forceRender:!0,children:(0,g.jsxs)(l.A,{form:v,layout:"vertical",name:"switch_to_plan_form",onFinish:O,initialValues:{request_email:t,request_phone:"",comment:"",request_tariff:a},autoComplete:"off",style:{padding:"10px 24px 0"},children:[(0,g.jsxs)(r.A,{gutter:16,children:[(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Email"),name:"request_email",rules:[{required:!0,message:j("Please enter your email address"),validator:(e,t)=>h.au.test(t)?Promise.resolve():Promise.reject(new Error(j("Please enter the correct email.")))}],children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Email"),type:"email"})})]}),(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Phone number"),name:"request_phone",children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Phone number")})})]})]}),(0,g.jsx)(l.A.Item,{label:j("Comment"),name:"comment",children:(0,g.jsx)(c.A.TextArea,{placeholder:j("Please add a comment to your request"),autoSize:{minRows:2}})})]})})}},4519:(e,t,a)=>{a.d(t,{A:()=>v});var s=a(92810),l=a(41919),i=a(76662),n=a(81e3),r=a(66726),o=a(43005),c=a(64617),m=a(58013),d=a(23287),u=a(98655),p=a(30961),h=a(20757),_=a(32269),g=a(85163),A=a(90070),x=a(70082);const{Content:j}=l.A,{Paragraph:y}=i.A,v=()=>{const{__:e}=(0,d.s9)(),{projectId:t,emailId:a}=(0,c.g)(),i=(0,A.p6)();let v=(0,c.Zp)();const b=i.get(g.A9.em_template_email)||a;(0,s.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const f=(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(n.A,{size:10,children:[(0,x.jsx)(r.A,{title:e("To emails"),placement:"left",children:(0,x.jsx)(o.Ay,{type:"text",icon:(0,x.jsx)(m.A,{}),onClick:()=>(0,_.XZ)(v,`/projects/${t}`),shape:"circle"})}),(0,x.jsx)(y,{className:"ant-page-header-heading-title",children:e("Select email template")}),(0,x.jsx)(p.A,{isBlocks:!1,templateEmailId:b})]})}),k=(0,x.jsx)(x.Fragment,{});return(0,x.jsxs)(l.A,{className:"template-page",children:[(0,x.jsx)(h.A,{leftBlock:f,rightBlock:k}),(0,x.jsx)(j,{className:"template-page__container",children:(0,x.jsx)("div",{className:"template-page__content container",children:(0,x.jsx)(u.A,{projectId:g.p5,emailsView:g.Y$,templateEmailId:b})})})]})}},70656:(e,t,a)=>{a.d(t,{A:()=>_});var s=a(92810),l=a(37005),i=a(66726),n=a(45934),r=a(39990),o=a(62303),c=a(65983),m=a(69156),d=a(23287),u=a(45695),p=a(85163),h=a(70082);const _=()=>{var e;const{__:t}=(0,d.s9)(),a=(0,n.wA)(),[_]=(0,r.b9)(),[g,A]=(0,s.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(p.V0.em_color_scheme)),x=(0,u.XW)(),j=(0,s.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,m.Hk)(e),null===e){const e=matchMedia(p.F3).matches?p.nd:p.T;localStorage.removeItem(p.V0.em_color_scheme),t=e}else localStorage.setItem(p.V0.em_color_scheme,e),t=e;a((0,c.eX)(t===p.nd?`vs-${t}`:p.T)),(0,m.A5)(t),x({operation:p.Ru.UPDATE_PREVIEW,theme:t}),_({theme:e})})(t),A(t)}),[a,_,x]);return(0,s.useEffect)((()=>{matchMedia(p.F3).onchange=()=>j()}),[j]),(0,h.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,h.jsx)(l.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:g,options:[{label:(0,h.jsx)(i.A,{title:t("Light theme"),children:(0,h.jsx)(o.A,{icon:"LightMode",style:{fontSize:18}})}),value:p.T},{label:(0,h.jsx)(i.A,{title:t("System theme"),children:(0,h.jsx)(o.A,{icon:"AutoMode",style:{fontSize:18}})}),value:null},{label:(0,h.jsx)(i.A,{title:t("Dark theme"),children:(0,h.jsx)(o.A,{icon:"DarkMode",style:{fontSize:18}})}),value:p.nd}],onChange:e=>j(e)})})}},54565:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(92810),l=a(12280),i=a(29234),n=a(55039),r=a(28372),o=a(45934),c=a(38883),m=a.n(c),d=a(23287),u=a(17581),p=a(8493),h=a(70082);const{utm_source:_,utm_medium:g,utm_campaign:A,utm_term:x,utm_content:j}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},y={[_]:"",[g]:"",[A]:"",[x]:"",[j]:""},v=({className:e,email:t})=>{const{__:a}=(0,d.s9)(),c=(0,o.wA)(),[v]=l.A.useForm();(0,s.useEffect)((()=>{var e,a,s,l,i;t&&v.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_medium)||"",utm_campaign:(null===(s=t.utm_parameters)||void 0===s?void 0:s.utm_campaign)||"",utm_term:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[v,t]);return(0,h.jsx)("div",{className:m()("settings-panel",{[e]:e}),children:(0,h.jsxs)(l.A,{form:v,layout:"vertical",name:"settings_panel_form_utm",initialValues:y,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case _:t.isNew?c((0,p.K3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[a]}})})));break;case g:t.isNew?c((0,p.ol)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[a]}})})));break;case A:t.isNew?c((0,p.P3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[a]}})})));break;case x:t.isNew?c((0,p.zH)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[a]}})})));break;case j:t.isNew?c((0,p.mk)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[a]}})})));break;default:return}},autoComplete:"off",children:[(0,h.jsx)(i.A,{message:a("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),(0,h.jsx)(l.A.Item,{label:a("utm_source"),name:_,tooltip:{title:a("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("google")})}),(0,h.jsx)(l.A.Item,{label:a("utm_medium"),name:g,tooltip:{title:a("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("cpc")})}),(0,h.jsx)(l.A.Item,{label:a("utm_campaign"),name:A,tooltip:{title:a("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("spring_sale")})}),(0,h.jsx)(l.A.Item,{label:a("utm_term"),name:x,tooltip:{title:a("Identifies search terms. For example: utm_term=running+shoes"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("running+shoes")})}),(0,h.jsx)(l.A.Item,{label:a("utm_content"),name:j,tooltip:{title:a("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("textlink")})})]})})};v.defaultProps={className:"",email:void 0};const b=v},5559:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(92810),l=a(76662),i=a(43005),n=a(4800),r=a(55039),o=a(66726),c=a(45934),m=a(38883),d=a.n(m),u=a(23287),p=a(77532),h=a(62303),_=a(64936),g=a(95679),A=a(56991),x=a(85163),j=a(85677),y=a(70082);const{Text:v}=l.A,b=({onChange:e,value:t,validateStatus:a,placeholder:l,disabled:m,name:b,elementSettings:f,imageInfo:k})=>{const w=(0,A.rD)(),{__:O}=(0,u.s9)(),[N,D]=(0,s.useState)({width:"",height:"",size:""});let C=(0,c.wA)();const I=(0,c.d4)(p.js),P=(0,c.d4)(p.Uf),E=(0,c.d4)(p.Ac),[L]=(0,g.FQ)();(0,s.useEffect)((()=>{t&&L(t).then((({data:e})=>{e&&D({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(0),format:null===e||void 0===e?void 0:e.format})}))}),[t,L]),(0,s.useEffect)((()=>{m||(b.startsWith("src")&&I&&((null===f||void 0===f?void 0:f.type)!==x.bV.CAROUSEL||P===b)?e(I):"backgroundImage"!==b||!E||(null===f||void 0===f?void 0:f.type)===x.bV.CAROUSEL&&P!==b||e(E),C((0,p.BK)()))}),[I,P,E,e,b,C,m,null===f||void 0===f?void 0:f.type]);const S=(e=null)=>{b.startsWith("src")?(C((0,p.Yw)(b)),C((0,p.tm)(t)),C((0,_.qf)(e||x.lx.UPLOAD_IMAGE_MODAL))):b.startsWith("backgroundImage")&&(C((0,p.Yw)(b)),C((0,p.e_)(t)),C((0,_.qf)(e||x.lx.UPLOAD_BACKGROUND_MODAL)))},z=[{label:O("Upload"),key:"Upload",onClick:()=>S(b.startsWith("src")?x.lx.UPLOAD_IMAGE_MODAL_UPLOAD:x.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},{label:O("Stock"),key:"Stock",onClick:()=>S(b.startsWith("src")?x.lx.UPLOAD_IMAGE_MODAL_STOCK:x.lx.UPLOAD_BACKGROUND_MODAL_STOCK)},{label:O("GIF"),key:"GIF",onClick:()=>S(b.startsWith("src")?x.lx.UPLOAD_IMAGE_MODAL_GIF:x.lx.UPLOAD_BACKGROUND_MODAL_GIF)},{label:O("AI"),key:"AI",onClick:()=>S(b.startsWith("src")?x.lx.UPLOAD_IMAGE_MODAL_AI:x.lx.UPLOAD_BACKGROUND_MODAL_AI)}];return(0,y.jsx)("div",{className:d()("upload-bg-image",{"upload-bg-image_disabled":m}),children:!t||t&&"error"===a?(0,y.jsxs)(i.Ay,{type:"default",block:!0,onClick:()=>S(b.startsWith("src")?x.lx.UPLOAD_IMAGE_MODAL_UPLOAD:x.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD),children:[(0,y.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),O("Add image")]}):(0,y.jsxs)("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,a,s,l;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(a=e.target)&&void 0!==a&&a.closest(".upload-bg-image__edit-menu")||null!==(s=e.target)&&void 0!==s&&s.closest(".upload-bg-image__menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".inputGroup")||S(b.startsWith("src")?x.lx.UPLOAD_IMAGE_MODAL_UPLOAD:x.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},children:[(0,y.jsx)(n.A,{arrow:!0,dropdownRender:()=>(0,y.jsx)("div",{className:"inputGroup",children:(0,y.jsx)(r.A,{prefix:(0,y.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:l,name:b,disabled:m,className:"upload-bg-image__input"})}),overlayClassName:"upload-bg-image__dropdown-overlay",overlayStyle:{top:32,marginTop:"8px",width:347,left:0},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".upload-bg-image__inner-wrap"),children:(0,y.jsxs)("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"},children:[(0,y.jsx)("div",{className:"upload-bg-image__uploader",children:(0,y.jsx)("div",{className:"upload-bg-image__uploader-content",children:(0,y.jsxs)("div",{className:"upload-bg-image__uploader-content-inner",children:[(0,y.jsx)("div",{className:"upload-bg-image__uploader-img-wrap",children:(0,y.jsx)("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})}),(0,y.jsx)("div",{className:"upload-bg-image__uploader-icons-wrap",children:(0,y.jsx)("div",{className:"upload-bg-image__uploader-content"})})]})})}),N.width&&N.height?(0,y.jsxs)("div",{className:"image-size",children:[N.width," \xd7 ",N.height,!!f&&(f.type===x.bV.IMG||f.type===x.bV.CAROUSEL)&&" \u2192 "+k.renderedWidth+" \xd7 "+k.renderedHeight,(0,y.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,y.jsxs)("span",{children:[N.size," ",O("kB")]}),N.format&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,y.jsx)("span",{className:"image-size-format",children:N.format})]})]}):(0,y.jsx)(v,{type:"secondary",className:"image-empty-text",children:l})]})}),(0,y.jsx)("div",{style:{flexGrow:1}}),"gif"!==N.format&&w.imageCenterEditorEnabled&&(0,y.jsx)(o.A,{title:O("Edit"),children:(0,y.jsx)(v,{type:"link",className:"upload-bg-image__edit",children:(0,y.jsx)(j.A,{style:{fontSize:16},onClick:e=>{S(),C((0,_.Wz)(x.lx.IMAGE_EDITOR_MODAL))}})})}),(0,y.jsx)(n.A,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:z},overlayClassName:"upload-bg-image__menu",children:(0,y.jsx)(v,{type:"link",className:"upload-bg-image__edit-menu image-change",children:!t||t&&"error"===a?O("Upload"):(0,y.jsx)(h.A,{style:{fontSize:20},icon:"Reload"})})},"Actions")]})})}},13591:()=>{}}]);
1
+ "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8458],{90219:(e,t,a)=>{a.d(t,{A:()=>S});var s=a(92810),l=a(95838),i=a(12280),n=a(55039),r=a(81662),o=a(66522),c=a(28372),m=a(45934),d=a(64617),u=a(23287),p=a(38883),h=a.n(p),_=a(55701),g=a(17581),A=a(84568),x=a(8493),j=a(87790),y=a(65983),v=a(56991),b=a(32269),f=a(85163),k=a(70082);const{useToken:O}=l.A,{title:w,description:D,tags:N,type:C,is_template:I}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template"},P={[w]:"",[D]:"",[N]:[],[I]:!1},E={[D]:"",[N]:[],[C]:""},L=({className:e,element:t})=>{const{__:a}=(0,u.s9)(),{projectId:l}=(0,d.g)(),p=(0,m.wA)(),[L]=i.A.useForm(),{token:S}=O(),U=(0,v.rD)(),M=(0,m.Pj)(),z=t.hasOwnProperty("type")?f.IE:f.Tm,T=t.hasOwnProperty("type")?f.YY:f.zh;const{data:G}=A.Nq.endpoints.getProject.select(+l)(M.getState());(0,s.useEffect)((()=>{var e;q(null===(e=function(e){const t=new Set;return null===e||void 0===e?void 0:e.filter((e=>!t.has(e.name)&&(t.add(e.name),!0)))}((0,b.HT)(G,T)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[G,T]),(0,s.useEffect)((()=>{if(t){var e,a;const s=null===(e=(0,b._q)(t,T))||void 0===e?void 0:e.map((e=>e.name)),l=t.emailtags||t.blocktags,i=null===(a=(0,b._q)(t,T))||void 0===a?void 0:a.filter((e=>l.includes(e.id))).map((e=>e.name));L.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||s,type:t.type})}}),[L,t,T]);const{data:B}=(0,_.h1)(),[F,R]=(0,s.useState)([]),[V,q]=(0,s.useState)([]);return(0,s.useEffect)((()=>{if(B){const e=B.schema.properties.acf.properties.type.items.enum;let t=[];const s={Applications:a("Apps"),Articles:a("Article"),Banners:a("Banners"),Buttons:a("Buttons"),"Call to Action":a("Call to Action"),Contacts:a("Contacts"),Content:a("Content"),"E-Commerce":a("E-Commerce"),Feature:a("Features"),Footer:a("Footers"),Header:a("Headers"),Lists:a("Lists"),Menu:a("Menus"),Other:a("Others"),Polls:a("Polls"),Promocodes:a("Promocodes"),Separators:a("Separators")};for(let a in e)t.push({label:s[e[a]],value:e[a]});R(t)}}),[B,a]),(0,k.jsx)("div",{className:h()("settings-panel",{[e]:e}),children:(0,k.jsxs)(i.A,{form:L,layout:"vertical",name:"settings_panel_form",initialValues:z===f.Tm?{EmailInitialValues:P}:E,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case w:t.isNew?p((0,x.BQ)(e[a])):p((0,y.VK)(e[a]));break;case D:z===f.Tm?t.isNew?p((0,x.Zs)(e[a])):p(g.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[a]})}))):t.isNew?p((0,j.AS)(e[a])):p(_.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[a]})})));break;case I:t.isNew?p((0,x.TC)(e[a])):p(g.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[a]})})));break;case N:{const s=e[a].map((e=>e.trim()));z===f.Tm?t.isNew?p((0,x.yY)(s)):p(g.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:s})}))):t.isNew?p((0,j.TB)(s)):p(_.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:s})})));break}case C:p(_.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[a]})})));break;default:return}},autoComplete:"off",children:[U.subjectEnabled&&z===f.Tm&&(0,k.jsx)(i.A.Item,{label:a("Title"),name:w,tooltip:{title:a("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:(0,k.jsx)(c.A,{})},children:(0,k.jsx)(n.A.TextArea,{placeholder:a("Type title here"),autoSize:{minRows:1}})}),U.descriptionEnabled&&(0,k.jsx)(i.A.Item,{label:a("Description"),name:D,tooltip:{title:a("Description is used in other sections of the service."),icon:(0,k.jsx)(c.A,{})},children:(0,k.jsx)(n.A.TextArea,{placeholder:a("Type your description here"),autoSize:{minRows:2}})}),U.tagsEnabled&&(0,k.jsx)(i.A.Item,{label:a("Tags"),name:N,tooltip:{title:a("Tags help you find the block in the list."),icon:(0,k.jsx)(c.A,{})},rules:[{message:"Please input your username!",type:"array"}],children:(0,k.jsx)(r.A,{mode:"tags",style:{width:"100%"},placeholder:a("Type your tags here"),options:V,tagRender:e=>{const{label:t,closable:a,onClose:s}=e;return(0,k.jsx)(o.A,{color:S.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:a,onClose:s,style:{borderRadius:6},children:t})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})}),z===f.IE&&(0,k.jsx)(i.A.Item,{name:C,label:a("Type"),tooltip:{title:a("Select the block type to find any block on the list faster."),icon:(0,k.jsx)(c.A,{})},rules:[{message:"Please input type!"}],children:(0,k.jsx)(r.A,{placeholder:a("Choose block type"),options:F,getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})]})})};L.defaultProps={className:"",email:void 0};const S=L},13465:(e,t,a)=>{a.d(t,{A:()=>y});a(92810);var s=a(2018),l=a(7744),i=a(68694),n=a.n(i),r=a(38610),o=a.n(r),c=a(73248),m=a.n(c),d=a(41705),u=a.n(d),p=a(96588),h=a.n(p),_=a(97433),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],y=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},85291:(e,t,a)=>{a.d(t,{A:()=>y});a(92810);var s=a(2018),l=a(7744),i=a(69029),n=a.n(i),r=a(41579),o=a.n(r),c=a(70869),m=a.n(c),d=a(8456),u=a.n(d),p=a(20931),h=a.n(p),_=a(24186),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],y=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},57903:(e,t,a)=>{a.d(t,{A:()=>u});a(92810);var s=a(59018),l=a.n(s),i=a(23287),n=a(71157),r=a(17581),o=a(55701),c=a(32269),m=a(70082);const d=({element:e})=>{const{__:t,_x:a}=(0,i.s9)(),[s]=(0,r.dN)(),[l]=(0,o.OZ)(),d=(0,n.hN)(),u=(e,s)=>{if(e.error)return(0,c.p6)(e,d),!1;(0,c.wB)(t("The ")+(s.hasOwnProperty("type")?t("block"):a("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(s.lock?s.hasOwnProperty("type")?a("unlocked.","block"):a("unlocked.","email"):s.hasOwnProperty("type")?a("locked.","block"):a("locked.","email")),d)};return(0,m.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?l({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):s({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))},children:e.lock?t("Unlock"):t("Lock")})};d.defaultProps={element:l().shape({lock:null,id:null})};const u=d},90775:(e,t,a)=>{a.d(t,{A:()=>A});var s=a(92810),l=a(12280),i=a(14852),n=a(43005),r=a(2018),o=a(7744),c=a(55039),m=a(71157),d=a(45934),u=a(23287),p=a(64936),h=a(32269),_=a(40869),g=a(70082);const A=({isModalVisible:e,userEmail:t,subscriptionRequest:a,userName:A,currentPlane:x})=>{const{__:j}=(0,u.s9)(),y=(0,d.wA)(),[v]=l.A.useForm(),[b,f]=(0,_.E)(),k=(0,m.hN)(),O=()=>{y((0,p.Oo)())},w=()=>{v.validateFields().then((()=>{const e=v.getFieldsValue(!0);b(JSON.stringify(e)).then((e=>{var t,a,s;200===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.status)?((0,h.wB)(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.message,k),O()):e.error&&(0,h.p6)(e,k)}))})).catch((e=>{console.warn(e)}))};return(0,s.useEffect)((()=>{a&&(null===v||void 0===v||v.setFieldsValue({request_tariff:a,user_name:A,user_email:t,user_tariff:x}))}),[v,a,x,A,t]),(0,g.jsx)(i.A,{title:j("Request for changing the pricing plan"),className:"blocks-modal",open:e,onOk:w,onCancel:O,centered:!0,width:572,footer:[(0,g.jsx)(n.Ay,{type:"primary",size:"large",onClick:w,disabled:f.isLoading,children:j("Send")},"submit")],forceRender:!0,children:(0,g.jsxs)(l.A,{form:v,layout:"vertical",name:"switch_to_plan_form",onFinish:w,initialValues:{request_email:t,request_phone:"",comment:"",request_tariff:a},autoComplete:"off",style:{padding:"10px 24px 0"},children:[(0,g.jsxs)(r.A,{gutter:16,children:[(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Email"),name:"request_email",rules:[{required:!0,message:j("Please enter your email address"),validator:(e,t)=>h.au.test(t)?Promise.resolve():Promise.reject(new Error(j("Please enter the correct email.")))}],children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Email"),type:"email"})})]}),(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Phone number"),name:"request_phone",children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Phone number")})})]})]}),(0,g.jsx)(l.A.Item,{label:j("Comment"),name:"comment",children:(0,g.jsx)(c.A.TextArea,{placeholder:j("Please add a comment to your request"),autoSize:{minRows:2}})})]})})}},4519:(e,t,a)=>{a.d(t,{A:()=>v});var s=a(92810),l=a(41919),i=a(76662),n=a(81e3),r=a(66726),o=a(43005),c=a(64617),m=a(58013),d=a(23287),u=a(98655),p=a(30961),h=a(20757),_=a(32269),g=a(85163),A=a(90070),x=a(70082);const{Content:j}=l.A,{Paragraph:y}=i.A,v=()=>{const{__:e}=(0,d.s9)(),{projectId:t,emailId:a}=(0,c.g)(),i=(0,A.p6)();let v=(0,c.Zp)();const b=i.get(g.A9.em_template_email)||a;(0,s.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const f=(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(n.A,{size:10,children:[(0,x.jsx)(r.A,{title:e("To emails"),placement:"left",children:(0,x.jsx)(o.Ay,{type:"text",icon:(0,x.jsx)(m.A,{}),onClick:()=>(0,_.XZ)(v,`/projects/${t}`),shape:"circle"})}),(0,x.jsx)(y,{className:"ant-page-header-heading-title",children:e("Select email template")}),(0,x.jsx)(p.A,{isBlocks:!1,templateEmailId:b})]})}),k=(0,x.jsx)(x.Fragment,{});return(0,x.jsxs)(l.A,{className:"template-page",children:[(0,x.jsx)(h.A,{leftBlock:f,rightBlock:k}),(0,x.jsx)(j,{className:"template-page__container",children:(0,x.jsx)("div",{className:"template-page__content container",children:(0,x.jsx)(u.A,{projectId:g.p5,emailsView:g.Y$,templateEmailId:b})})})]})}},70656:(e,t,a)=>{a.d(t,{A:()=>_});var s=a(92810),l=a(37005),i=a(66726),n=a(45934),r=a(39990),o=a(62303),c=a(65983),m=a(69156),d=a(23287),u=a(45695),p=a(85163),h=a(70082);const _=()=>{var e;const{__:t}=(0,d.s9)(),a=(0,n.wA)(),[_]=(0,r.b9)(),[g,A]=(0,s.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(p.V0.em_color_scheme)),x=(0,u.XW)(),j=(0,s.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,m.Hk)(e),null===e){const e=matchMedia(p.F3).matches?p.nd:p.T;localStorage.removeItem(p.V0.em_color_scheme),t=e}else localStorage.setItem(p.V0.em_color_scheme,e),t=e;a((0,c.eX)(t===p.nd?`vs-${t}`:p.T)),(0,m.A5)(t),x({operation:p.Ru.UPDATE_PREVIEW,theme:t}),_({theme:e})})(t),A(t)}),[a,_,x]);return(0,s.useEffect)((()=>{matchMedia(p.F3).onchange=()=>j()}),[j]),(0,h.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,h.jsx)(l.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:g,options:[{label:(0,h.jsx)(i.A,{title:t("Light theme"),children:(0,h.jsx)(o.A,{icon:"LightMode",style:{fontSize:18}})}),value:p.T},{label:(0,h.jsx)(i.A,{title:t("System theme"),children:(0,h.jsx)(o.A,{icon:"AutoMode",style:{fontSize:18}})}),value:null},{label:(0,h.jsx)(i.A,{title:t("Dark theme"),children:(0,h.jsx)(o.A,{icon:"DarkMode",style:{fontSize:18}})}),value:p.nd}],onChange:e=>j(e)})})}},54565:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(92810),l=a(12280),i=a(29234),n=a(55039),r=a(28372),o=a(45934),c=a(38883),m=a.n(c),d=a(23287),u=a(17581),p=a(8493),h=a(70082);const{utm_source:_,utm_medium:g,utm_campaign:A,utm_term:x,utm_content:j}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},y={[_]:"",[g]:"",[A]:"",[x]:"",[j]:""},v=({className:e,email:t})=>{const{__:a}=(0,d.s9)(),c=(0,o.wA)(),[v]=l.A.useForm();(0,s.useEffect)((()=>{var e,a,s,l,i;t&&v.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_medium)||"",utm_campaign:(null===(s=t.utm_parameters)||void 0===s?void 0:s.utm_campaign)||"",utm_term:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[v,t]);return(0,h.jsx)("div",{className:m()("settings-panel",{[e]:e}),children:(0,h.jsxs)(l.A,{form:v,layout:"vertical",name:"settings_panel_form_utm",initialValues:y,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case _:t.isNew?c((0,p.K3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[a]}})})));break;case g:t.isNew?c((0,p.ol)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[a]}})})));break;case A:t.isNew?c((0,p.P3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[a]}})})));break;case x:t.isNew?c((0,p.zH)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[a]}})})));break;case j:t.isNew?c((0,p.mk)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[a]}})})));break;default:return}},autoComplete:"off",children:[(0,h.jsx)(i.A,{message:a("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),(0,h.jsx)(l.A.Item,{label:a("utm_source"),name:_,tooltip:{title:a("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("google")})}),(0,h.jsx)(l.A.Item,{label:a("utm_medium"),name:g,tooltip:{title:a("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("cpc")})}),(0,h.jsx)(l.A.Item,{label:a("utm_campaign"),name:A,tooltip:{title:a("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("spring_sale")})}),(0,h.jsx)(l.A.Item,{label:a("utm_term"),name:x,tooltip:{title:a("Identifies search terms. For example: utm_term=running+shoes"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("running+shoes")})}),(0,h.jsx)(l.A.Item,{label:a("utm_content"),name:j,tooltip:{title:a("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("textlink")})})]})})};v.defaultProps={className:"",email:void 0};const b=v},5559:(e,t,a)=>{a.d(t,{A:()=>O});var s=a(92810),l=a(76662),i=a(43005),n=a(4800),r=a(55039),o=a(66726),c=a(45934),m=a(38883),d=a.n(m),u=a(23287),p=a(77532),h=a(62303),_=a(92779),g=a(64936),A=a(95679),x=a(86286),j=a(36404),y=a(56991),v=a(85163),b=a(85677),f=a(70082);const{Text:k}=l.A,O=({onChange:e,value:t,validateStatus:a,placeholder:l,disabled:m,name:O,elementSettings:w,imageInfo:D})=>{var N,C;const I=(0,c.d4)(x.C1),P=(0,c.d4)(x.B$),E=(0,c.d4)(j.yN),L=(0,y.rD)(),{__:S}=(0,u.s9)(),[U,M]=(0,s.useState)({width:"",height:"",size:""}),[z,T]=(0,s.useState)(!1),[G,B]=(0,s.useState)(0);let F=(0,c.wA)();const R=(0,c.d4)(p.js),V=(0,c.d4)(p.Uf),q=(0,c.d4)(p.Ac),[W]=(0,A.FQ)();let Y=!P&&(null===(N=I.id)||void 0===N?void 0:N.toString())===(null===E||void 0===E||null===(C=E.members)||void 0===C?void 0:C.owner.ID);(0,s.useEffect)((()=>{t&&W(t).then((({data:e})=>{e&&M({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(0),format:null===e||void 0===e?void 0:e.format})}))}),[t,W]),(0,s.useEffect)((()=>{m||(O.startsWith("src")&&R&&((null===w||void 0===w?void 0:w.type)!==v.bV.CAROUSEL||V===O)?e(R):"backgroundImage"!==O||!q||(null===w||void 0===w?void 0:w.type)===v.bV.CAROUSEL&&V!==O||e(q),F((0,p.BK)()))}),[R,V,q,e,O,F,m,null===w||void 0===w?void 0:w.type]);const K=(e=null)=>{O.startsWith("src")?(F((0,p.Yw)(O)),F((0,p.tm)(t)),F((0,g.qf)(e||v.lx.UPLOAD_IMAGE_MODAL))):O.startsWith("backgroundImage")&&(F((0,p.Yw)(O)),F((0,p.e_)(t)),F((0,g.qf)(e||v.lx.UPLOAD_BACKGROUND_MODAL)))},Q=[{label:S("Upload"),key:"Upload",onClick:()=>K(O.startsWith("src")?v.lx.UPLOAD_IMAGE_MODAL_UPLOAD:v.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];L.imageCenterStockEnabled&&Q.push({label:S("Stock"),key:"Stock",onClick:()=>K(O.startsWith("src")?v.lx.UPLOAD_IMAGE_MODAL_STOCK:v.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),L.imageCenterGifEnabled&&Q.push({label:S("GIF"),key:"GIF",onClick:()=>K(O.startsWith("src")?v.lx.UPLOAD_IMAGE_MODAL_GIF:v.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),L.elementAIimageEnabled&&Q.push({label:S("AI"),key:"AI",onClick:()=>K(O.startsWith("src")?v.lx.UPLOAD_IMAGE_MODAL_AI:v.lx.UPLOAD_BACKGROUND_MODAL_AI)});return(0,f.jsxs)("div",{className:d()("upload-bg-image",{"upload-bg-image_disabled":m}),children:[!t||t&&"error"===a?(0,f.jsxs)(i.Ay,{type:"default",block:!0,onClick:()=>K(O.startsWith("src")?v.lx.UPLOAD_IMAGE_MODAL_UPLOAD:v.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD),children:[(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),S("Add image")]}):(0,f.jsxs)("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,a,s,l;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(a=e.target)&&void 0!==a&&a.closest(".upload-bg-image__edit-menu")||null!==(s=e.target)&&void 0!==s&&s.closest(".upload-bg-image__menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".inputGroup")||K(O.startsWith("src")?v.lx.UPLOAD_IMAGE_MODAL_UPLOAD:v.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},children:[(0,f.jsx)(n.A,{arrow:!0,dropdownRender:()=>(0,f.jsx)("div",{className:"inputGroup",children:(0,f.jsx)(r.A,{prefix:(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:l,name:O,disabled:m,className:"upload-bg-image__input"})}),overlayClassName:"upload-bg-image__dropdown-overlay",overlayStyle:{top:32,marginTop:"8px",width:347,left:0},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".upload-bg-image__inner-wrap"),children:(0,f.jsxs)("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"},children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content",children:(0,f.jsxs)("div",{className:"upload-bg-image__uploader-content-inner",children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader-img-wrap",children:(0,f.jsx)("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})}),(0,f.jsx)("div",{className:"upload-bg-image__uploader-icons-wrap",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content"})})]})})}),U.width&&U.height?(0,f.jsxs)("div",{className:"image-size",children:[U.width," \xd7 ",U.height,!!w&&(w.type===v.bV.IMG||w.type===v.bV.CAROUSEL)&&" \u2192 "+D.renderedWidth+" \xd7 "+D.renderedHeight,(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsxs)("span",{children:[U.size," ",S("kB")]}),U.format&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsx)("span",{className:"image-size-format",children:U.format})]})]}):(0,f.jsx)(k,{type:"secondary",className:"image-empty-text",children:l})]})}),(0,f.jsx)("div",{style:{flexGrow:1}}),"gif"!==U.format&&L.imageCenterEditorEnabled&&(0,f.jsx)(o.A,{title:S("Edit"),children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit",children:(0,f.jsx)(b.A,{style:{fontSize:16},onClick:e=>{Y?(T(!0),B(5)):(K(),F((0,g.Wz)(v.lx.IMAGE_EDITOR_MODAL)))}})})}),(0,f.jsx)(n.A,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:Q},overlayClassName:"upload-bg-image__menu",children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit-menu image-change",children:!t||t&&"error"===a?S("Upload"):(0,f.jsx)(h.A,{style:{fontSize:20},icon:"Reload",onClick:()=>K(O.startsWith("src")?v.lx.UPLOAD_IMAGE_MODAL_UPLOAD:v.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})})},"Actions")]}),(0,f.jsx)(_.A,{open:z,onCancel:()=>{T(!1)},initialSlide:G})]})}},13591:()=>{}}]);
package/translations.pot CHANGED
@@ -1366,7 +1366,7 @@ msgstr ""
1366
1366
  #: src/modules/components/BlocksTable/BlocksTable.jsx:511
1367
1367
  #: src/modules/components/Discuss/Discuss.jsx:656
1368
1368
  #: src/modules/components/EmailsTable/EmailsTable.jsx:551
1369
- #: src/modules/components/UploadBgImage/UploadBgImage.jsx:194
1369
+ #: src/modules/components/UploadBgImage/UploadBgImage.jsx:219
1370
1370
  msgid "Edit"
1371
1371
  msgstr ""
1372
1372
 
@@ -2500,19 +2500,19 @@ msgstr ""
2500
2500
  msgid "Set"
2501
2501
  msgstr ""
2502
2502
 
2503
- #: src/modules/components/ImageAI/ImageAI.jsx:184
2503
+ #: src/modules/components/ImageAI/ImageAI.jsx:190
2504
2504
  msgid "Evaluating the task"
2505
2505
  msgstr ""
2506
2506
 
2507
- #: src/modules/components/ImageAI/ImageAI.jsx:197
2507
+ #: src/modules/components/ImageAI/ImageAI.jsx:203
2508
2508
  msgid "Something went wrong, please try again"
2509
2509
  msgstr ""
2510
2510
 
2511
- #: src/modules/components/ImageAI/ImageAI.jsx:278
2511
+ #: src/modules/components/ImageAI/ImageAI.jsx:284
2512
2512
  msgid "Generate image"
2513
2513
  msgstr ""
2514
2514
 
2515
- #: src/modules/components/ImageAI/ImageAI.jsx:329
2515
+ #: src/modules/components/ImageAI/ImageAI.jsx:335
2516
2516
  msgid "Use this variant"
2517
2517
  msgstr ""
2518
2518
 
@@ -2538,7 +2538,7 @@ msgid "The image was successfully uploaded."
2538
2538
  msgstr ""
2539
2539
 
2540
2540
  #: src/modules/components/ImageLoaderModal/ImageLoaderModal.jsx:614
2541
- #: src/modules/components/UploadBgImage/UploadBgImage.jsx:215
2541
+ #: src/modules/components/UploadBgImage/UploadBgImage.jsx:246
2542
2542
  msgid "Upload"
2543
2543
  msgstr ""
2544
2544
 
@@ -2555,17 +2555,17 @@ msgid "Paste image URL here"
2555
2555
  msgstr ""
2556
2556
 
2557
2557
  #: src/modules/components/ImageLoaderModal/ImageLoaderModal.jsx:658
2558
- #: src/modules/components/UploadBgImage/UploadBgImage.jsx:91
2558
+ #: src/modules/components/UploadBgImage/UploadBgImage.jsx:106
2559
2559
  msgid "Stock"
2560
2560
  msgstr ""
2561
2561
 
2562
2562
  #: src/modules/components/ImageLoaderModal/ImageLoaderModal.jsx:681
2563
- #: src/modules/components/UploadBgImage/UploadBgImage.jsx:95
2563
+ #: src/modules/components/UploadBgImage/UploadBgImage.jsx:113
2564
2564
  msgid "GIF"
2565
2565
  msgstr ""
2566
2566
 
2567
2567
  #: src/modules/components/ImageLoaderModal/ImageLoaderModal.jsx:704
2568
- #: src/modules/components/UploadBgImage/UploadBgImage.jsx:99
2568
+ #: src/modules/components/UploadBgImage/UploadBgImage.jsx:120
2569
2569
  msgid "AI"
2570
2570
  msgstr ""
2571
2571
 
@@ -2958,7 +2958,7 @@ msgid "empty src"
2958
2958
  msgstr ""
2959
2959
 
2960
2960
  #: src/modules/components/Optimise/Optimise.jsx:661
2961
- #: src/modules/components/UploadBgImage/UploadBgImage.jsx:175
2961
+ #: src/modules/components/UploadBgImage/UploadBgImage.jsx:200
2962
2962
  msgid "kB"
2963
2963
  msgstr ""
2964
2964
 
@@ -3954,7 +3954,7 @@ msgid ""
3954
3954
  msgstr ""
3955
3955
 
3956
3956
  #: src/modules/components/SelectedTextCommonForm/SelectedTextCommonForm.jsx:310
3957
- #: src/modules/components/UploadBgImage/UploadBgImage.jsx:113
3957
+ #: src/modules/components/UploadBgImage/UploadBgImage.jsx:138
3958
3958
  msgid "Add image"
3959
3959
  msgstr ""
3960
3960
 
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[2223],{28316:(e,t,i)=>{i.d(t,{Kp:()=>s,Sb:()=>o,_1:()=>n});const s="SAVE",n="SHOW",o="NOTIFY"},85163:(e,t,i)=>{i.d(t,{A9:()=>c,BD:()=>de,Bv:()=>w,CJ:()=>u,EW:()=>r,F3:()=>E,F5:()=>n,G$:()=>X,IE:()=>Z,IJ:()=>h,JE:()=>Y,Jy:()=>U,KI:()=>te,N7:()=>x,ND:()=>ae,QV:()=>_e,Qz:()=>z,Ru:()=>O,St:()=>F,T:()=>p,Tm:()=>$,UW:()=>d,Ug:()=>le,V0:()=>l,VG:()=>A,Vp:()=>oe,Vv:()=>L,WU:()=>N,Y$:()=>q,YY:()=>ce,aO:()=>W,bV:()=>D,e3:()=>pe,eA:()=>Q,eG:()=>ee,ff:()=>o,gY:()=>V,hc:()=>B,iU:()=>se,iV:()=>G,iW:()=>M,jg:()=>ue,lx:()=>v,m3:()=>K,mX:()=>S,nA:()=>j,nd:()=>m,oy:()=>a,p5:()=>ie,pe:()=>k,rW:()=>T,rY:()=>R,rb:()=>b,rl:()=>J,vd:()=>g,wF:()=>ne,xz:()=>I,y2:()=>_,yI:()=>y,yo:()=>H,yy:()=>C,zh:()=>re,zx:()=>P});var s=i(19378);const n="LOADING",o="ERROR",a="useblocks",r={isPlugin:!1},c={em_token:"em_token",em_elements_view:"em_elements_view",em_new_block:"em_new_block",em_new_email:"em_new_email",em_id:"em_id",em_name:"em_name",em_email:"em_email",em_locale:"em_locale",em_carrotquest_hash:"em_carrotquest_hash",em_ducalis_hash:"em_ducalis_hash",em_email_subscription_consent:"em_email_subscription_consent",em_folder:"em_folder",promocode:"promocode"},l={em_color_scheme:"em_color_scheme",em_code_mode_pane_sizes:"em_code_mode_pane_sizes",em_preview_pane_sizes:"em_preview_pane_sizes",em_default_sizes:"em_default_sizes",em_pane_sizes:"em_pane_sizes",em_test_emails:"em_test_emails",em_menu_is_locked:"em_menu_is_locked",em_code_mode_settings:"em_code_mode_settings",em_folder_is_open:"em_folder_is_open"},d="deleted",_="all",u="not all",p="light",m="dark",h="system",g="(prefers-color-scheme: light)",E="(prefers-color-scheme: dark)",A="#1890ff",v={ADD_NEW_PROJECT_MODAL:"ADD_NEW_PROJECT_MODAL",EDIT_PROJECT_MODAL:"EDIT_PROJECT_MODAL",BLOCKS_MODAL:"BLOCKS_MODAL",EDIT_PROFILE_MODAL:"EDIT_PROFILE_MODAL",SEND_TEST_EMAIL:"SEND_TEST_EMAIL",ADD_NEW_EBLOCK_MODAL:"ADD_NEW_EBLOCK_MODAL",ADD_NEW_EMAIL_MODAL:"ADD_NEW_EMAIL_MODAL",SWITCH_TO_PLAN_MODAL:"SWITCH_TO_PLAN_MODAL",IMAGE_EDITOR_MODAL:"IMAGE_EDITOR_MODAL",ADD_NEW_FOLDER_MODAL:"ADD_NEW_FOLDER_MODAL",EDIT_FOLDER_NAME_MODAL:"EDIT_FOLDER_NAME_MODAL",UPLOAD_IMAGE_MODAL:"UPLOAD_IMAGE_MODAL",UPLOAD_BACKGROUND_MODAL:"UPLOAD_BACKGROUND_MODAL",UPLOAD_IMAGE_MODAL_AI:"UPLOAD_IMAGE_MODAL_AI",UPLOAD_BACKGROUND_MODAL_AI:"UPLOAD_BACKGROUND_MODAL_AI",UPLOAD_IMAGE_MODAL_STOCK:"UPLOAD_IMAGE_MODAL_STOCK",UPLOAD_BACKGROUND_MODAL_STOCK:"UPLOAD_BACKGROUND_MODAL_STOCK",UPLOAD_IMAGE_MODAL_GIF:"UPLOAD_IMAGE_MODAL_GIF",UPLOAD_BACKGROUND_MODAL_GIF:"UPLOAD_BACKGROUND_MODAL_GIF",UPLOAD_IMAGE_MODAL_EDIT:"UPLOAD_IMAGE_MODAL_EDIT",UPLOAD_BACKGROUND_MODAL_EDIT:"UPLOAD_BACKGROUND_MODAL_EDIT",UPLOAD_IMAGE_MODAL_UPLOAD:"UPLOAD_IMAGE_MODAL_UPLOAD",UPLOAD_BACKGROUND_MODAL_UPLOAD:"UPLOAD_BACKGROUND_MODAL_UPLOAD"};let f;!function(e){e[e.Amp=0]="Amp",e[e.HTML=1]="HTML",e[e.Everywhere=2]="Everywhere"}(f||(f={}));const O={MESSAGE:"message",UPDATE_PREVIEW:"update_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_SUBJECT_UPDATE:(0,s.Qm)("application_subject_update"),APPLICATION_PREHEADER_UPDATE:(0,s.Qm)("application_preheader_update"),APPLICATION_DOMPARSER_ERROR:(0,s.Qm)("application_domparser_error"),APPLICATION_UPDATE_ENTITY:(0,s.Qm)("application_update_entity"),APPLICATION_IFRAME_DRAG_EVENT:(0,s.Qm)("application_iframe_drag_event"),APPLICATION_HAS_AMP:(0,s.Qm)("application_has_amp"),SANDBOX_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:(0,s.Qm)("SANDBOX_READY"),SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_SUBJECT_UPDATE:(0,s.Qm)("sandbox_subject_update"),SANDBOX_PREHEADER_UPDATE:(0,s.Qm)("sandbox_preheader_update"),SANDBOX_DRAG_EVENT:(0,s.Qm)("sandbox_drag_event"),SANDBOX_ADD_MERGETAG:(0,s.Qm)("sandbox_add_mergetag"),SANDBOX_TRANSLATIONS:(0,s.Qm)("sandbox_send_translations"),SANDBOX_SET_THEME_VARIABLES:(0,s.Qm)("sandbox_send_theme_variables"),SANDBOX_SET_ENTITY:(0,s.Qm)("sandbox_set_entity"),SANDBOX_INIT_START:(0,s.Qm)("sandbox_init_start"),SANDBOX_INITED:(0,s.Qm)("sandbox_inited"),SANDBOX_UPDATE_ENTITY:(0,s.Qm)("sandbox_update_entity"),RELOAD:(0,s.Qm)("reload"),SANDBOX_IS_EMAIL_EMPTY:(0,s.Qm)("sandbox_is_email_empty")},T={language:"html",detectIndentation:!1,wordWrap:"on",wrappingIndent:"same",smoothScrolling:!0,automaticLayout:!0,tabSize:2,indentSize:2};let D;!function(e){e.IMG="img",e.TEXT="text",e.LINK="a",e.TABLE="table",e.VINDENT="vindent",e.TD="td",e.STRUCTURE="structure",e.GROUP="group",e.BUTTON="button",e.DIV="div",e.FLOAT_BLOCK="floatBlock",e.VAR="var",e.EMPTY_TABLE="emptyTable",e.EMPTY_TD="emptyTd",e.COUNTDOWN="countdown",e.VIDEO="video",e.COLUMN="column",e.CAROUSEL="carousel",e.ACCORDION="accordion"}(D||(D={}));const I="Appearance",S="Structure",C="Settings",y="Properties",L="History",b="Disabled_tab",N="Edit selected element",M="UTM parameters",P="Edit",w="Build",R="Styles",B="Discuss",k="TEXT_AI",j="Blocks",U="Atoms",x="Optimise",G={top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},H="Owner",F="Administrator",K="User",X="The invitation has been sent",V="Assign the project owner",z="Change role to Administrator",W="Change role to User",Q="Remove member",Y="Revoke the invite",Z="block",$="email",q="cards",J="list",ee="pending",te="d41d8",ie=1865,se=127017,ne={borderRadiusAll:"all",borderRadiusTopLeft:"topLeft",borderRadiusBottomLeft:"bottomLeft",borderRadiusTopRight:"topRight",borderRadiusBottomRight:"bottomRight"},oe="desktop",ae="mobile",re="emailtags",ce="blocktags",le="all_folders",de={text:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",lineHeight:21,lineHeightDim:"px",color:"#5a5a5a",textAlign:"left",paddingBottom:10,paddingBottomDim:"px"},headings:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:24,fontSizeDim:"px",lineHeight:32,lineHeightDim:"px",color:"#333333",textAlign:"left",paddingTop:20,paddingTopDim:"px",paddingBottom:10,paddingBottomDim:"px",letterSpacing:0,letterSpacingDim:"px",bold:!0,italic:!1},links:{color:"#1C52DC",underline:!0},buttons:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",letterSpacing:0,letterSpacingDim:"px",color:"#FFFFFF",bold:!1,italic:!1,backgroundColor:"#1C52DC",marginTop:10,marginTopDim:"px",marginBottom:10,marginBottomDim:"px",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},textAlign:"center",padding:{all:null,top:null,right:null,bottom:null,left:null}},block:{backgroundColor:""}},_e=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here")}),ue={Applications:"Apps",Articles:"Article",Banners:"Banners",Buttons:"Buttons","Call to Action":"Call to Action",Contacts:"Contacts",Content:"Content","E-Commerce":"E-Commerce",Feature:"Features",Footer:"Footers",Header:"Headers",Lists:"Lists",Menu:"Menus",Other:"Others",Polls:"Polls",Promocodes:"Promocodes",Separators:"Separators"},pe={maker:"https://ai-mail.emcdn.ru",blocks:"https://ai-mail.useblocks.io"}},19378:(e,t,i)=>{function s(e){return e}i.d(t,{Qm:()=>s,bg:()=>c});const n="INIT_MESSAGE";function o(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}class a{constructor(){this._children=[],this._isDisposed=!1}isDisposed(){return this._isDisposed}addDisposable(e){return this._children.push(e),e.hasOwnProperty("addDisposable")&&e.addDisposable({dispose:()=>{const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}}),e}removeDisposable(e){const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}dispose(){this._isDisposed=!0;for(const e of this._children)e.dispose()}}class r extends a{constructor(...e){super(...e),this._listeners=Object.create(null),this.addListenerAsync=(e,t,i=0,s)=>{const n=this._listeners[e]||(this._listeners[e]=[]);s&&"function"===typeof t&&(t=t.bind(s));const o=n.findIndex((([e,t])=>i<=t)),a=[t,i];return this.isDisposed()||n.splice(o>=0?o:n.length,0,a),{dispose(){const e=n.indexOf(a);e>=0&&n.splice(e,1)}}},this.fireAsync=(e,t)=>{if(!this.isDisposed()){const i=this._listeners[e]||(this._listeners[e]=[]);let s;for(let e=0;e<i.length;e++){let t=i[e][0],n=s;s=e=>t(e,n)}if(s)return s(t)}},this.addListener=(e,t,i=0)=>this.addListenerAsync(e,((e,i)=>{try{t(e)}catch(s){console.log(s)}return i&&i(e)}),i)}}class c extends a{constructor(e,t){super(),this._singleton=t,this._target=void 0,this._guid=o(),this._targetGuid="",this._emitter=this.addDisposable(new r),this._onReceiveMessage=e=>{const t=e.data;if(i=t,s=this._guid,i&&"object"===typeof i&&i.guid===s||this._singleton&&function(e,t){return e&&"object"===typeof e&&e.operationId===t}(t,n)){const i=this._emitter.fireAsync(t.operationId||"",void 0===t.operationId?e:t.data),s=t.result,n=t.error;s&&n&&Promise.resolve(i).then((e=>this._sendMessage(s,e)),(e=>this._sendMessage(n,e)))}var i,s},window.addEventListener("message",this._onReceiveMessage),this.addListener(n,(e=>{this._targetGuid!==e&&(this._targetGuid=e,this.send(n,this._guid))})),e&&this.setTarget(e)}setTarget(e){this._target!==e&&(this._target=e,this._targetGuid="",e&&e.postMessage({operationId:n,data:this._guid},"*"))}getTarget(){return this._target}get target(){return this._target}_sendMessage(e,t,i=!0){if(!i&&!this.isInited())return;const s=this.addDisposable(this.onInit(((i,n)=>{const o=e?{operationId:e,data:t}:t;i.postMessage({...o,guid:n},"*"),s.dispose()})))}send(e,t,i){return"string"===typeof e?this._sendMessage(e,t,i):this._sendMessage("",e,t)}sendAsync(e,t,i=!0){if(!i&&!this.isInited())return Promise.resolve();const s=o(),n=o();return new Promise(((i,o)=>{const r=this.addDisposable(new a);r.addDisposable(this.onInit(((a,c)=>{a.postMessage({operationId:e,data:t,guid:c,result:s,error:n},"*"),r.addDisposable(this._onMessage(s,(e=>{i(e),r.dispose()}))),r.addDisposable(this._onMessage(n,(e=>{o(e),r.dispose()})))})))}))}_onMessage(e,t,i=0){return this._emitter.addListener(e,t,i)}addListener(e,t,i){return t?this._onMessage(e,t,i):this._onMessage("",e)}addListenerAsyncPipe(e,t,i=0){return this._emitter.addListenerAsync(e,t,i)}addListenerAsync(e,t,i=0){return this._emitter.addListenerAsync(e,(async(e,i)=>{const s=await t(e);return i?i(e):s}),i)}isInited(){return!!this._targetGuid}get inited(){return!!this._targetGuid}onInit(e,t=!0,i=0){const s=this.addDisposable(new a);return this._targetGuid&&this._target?t&&Promise.resolve().then((()=>{this._targetGuid&&this._target?e(this._target,this._targetGuid):s.addDisposable(this.onInit(e,t,i))})):s.addDisposable(this._onMessage(n,(()=>{e(this._target,this._targetGuid)}),i)),s}dispose(){window.removeEventListener("message",this._onReceiveMessage),super.dispose()}}},13329:(e,t,i)=>{i.d(t,{D3:()=>_,RS:()=>d});var s=i(45934),n=i(92810),o=i(41664),a=i(23397),r=i(23580),c=i(95152);const l=(0,o.Q)();function d(e,t,i){e instanceof c.m||(e=(0,r.My)(e));e.getOrCreateInstance(l,(()=>new a.v)).fire({id:t,payload:i})}const _=(e,t)=>{const i=function(e,t){return(0,r.My)(e).getOrCreateInstance(l,(()=>new a.v)).addEventListener}((0,s.Pj)());(0,n.useEffect)((()=>{const s=i((({id:i,payload:s})=>{i===e&&t(s)}));return()=>s.dispose()}),[i,e,t])}},95152:(e,t,i)=>{i.d(t,{m:()=>a});var s=i(23397),n=i(77509);function o(e){return`service_container_${e}`}class a extends n.j{constructor(e){super(),this._parent=e,this._injections=Object.create(null),this._emitter=this.addDisposable(new s.v)}inject(e,t,i){if("function"===typeof t){let s=this._injections[e],n="function"===typeof s?s():s;const o=this._injections[e]=()=>(n=t(this,n),n);i&&o()}else this._injections[e]=()=>t;this._emitter.fire(e)}_find(e){var t;return this._injections[e]||(null===(t=this._parent)||void 0===t?void 0:t._find(e))}_onInject(e,t,i=new n.j){return i.addDisposable(this._emitter.addEventListener((s=>{e===s&&(i.dispose(),t(this.getInstance(s)))}))),this._parent&&i.addDisposable(this._parent._onInject(e,t,i)),this.addDisposable(i),i}getInstance(e){const t=this._find(e);if("function"===typeof t)return t()}getOrCreateInstance(e,t){const i=this._find(e);if("function"===typeof i)return i();{const i=t(this);return this.inject(e,i),i}}getInstanceAsync(e){const t=this._find(e);return"function"===typeof t?Promise.resolve(t()):new Promise((t=>this._onInject(e,(()=>t(this.getInstance(e))))))}addService(e,t){const i=o(e);this.inject(i,((e,i=[])=>i.indexOf(t)<0?[...i,t]:i));const s=new n.j;return s.addDispose((()=>{this.inject(i,((e,i=[])=>i.filter((e=>e!==t))))})),s}getServices(e){var t;const i=o(e);return[...this.getInstance(i)||[],...(null===(t=this._parent)||void 0===t?void 0:t.getServices(e))||[]]}createChild(){return new a(this)}dispose(){this._injections=Object.create(null)}}},45695:(e,t,i)=>{i.d(t,{K9:()=>u,QC:()=>d,XW:()=>_,ur:()=>l});var s=i(19378),n=i(33288),o=i(45934),a=i(41664),r=i(92810);const c=(0,a.Q)("MESSAGE_SERVICE");function l(){const e=d();return(0,r.useCallback)((t=>{e.setTarget(t instanceof Element?t.contentWindow:t)}),[e])}function d(){const e=(0,o.Pj)();return(0,r.useMemo)((()=>function(e){return n.di.getOrCreateInstance(e,c,(()=>new s.bg))}(e)),[e])}function _(){const e=d();return(0,r.useCallback)((function(t){e.send(t)}),[e])}function u(){const e=d();return(0,r.useCallback)((function(t,i){e.send(t,i)}),[e])}},23397:(e,t,i)=>{i.d(t,{v:()=>n});var s=i(77509);class n extends s.j{constructor(e){super(),this._options=e,this._listeners=[],this.fire=e=>{if(!this.isDisposed()){let t;const i=[...this._listeners];for(const s of i){if(!1===t)return!1;t=t instanceof Promise?t.then((e=>!1!==e&&!this.isDisposed()&&s(e))).catch((e=>console.log(e))):s(e)}return t}},this.addEventListener=e=>{const t=this._listeners;var i;(t.push(e),1===t.length)&&((null===(i=this._options)||void 0===i?void 0:i.onFirstListenerAdd)&&this._options.onFirstListenerAdd());return{dispose:()=>{const i=t.indexOf(e);var s;i>=0&&(t.splice(i),t.length||(null===(s=this._options)||void 0===s?void 0:s.onFirstListenerAdd)&&this._options.onLastListenerRemove())}}},this.event=this.addEventListener}}let o;!function(e){function t(e){let t;const i=new n({onFirstListenerAdd(){t=e(i.fire)},onLastListenerRemove(){t.dispose()}});return i.event}e.snapshot=t,e.filter=function(e,i){return t((t=>e((e=>i(e)&&t(e)))))},e.map=function(e,i){return t((t=>e((e=>t(i(e))))))}}(o||(o={}))},93982:(e,t,i)=>{i.d(t,{Zc:()=>l,_q:()=>d,cZ:()=>r,dB:()=>c,ml:()=>_});var s=i(45934),n=i(41664),o=i(23580),a=i(55654);function r(e){return(0,n.Q)(e)}function c(e,t){return(0,o.My)(e).getOrCreateInstance(t,(()=>new a.lt))}function l(e,t){return(0,o.My)(e).getOrCreateInstance(t,(()=>new a.lt)).event}function d(e){return _(e).event}function _(e){return c((0,s.Pj)(),e)}},32269:(e,t,i)=>{i.d(t,{Cb:()=>X,Cl:()=>m,DI:()=>w,Dx:()=>M,EU:()=>R,HT:()=>z,Hy:()=>W,Id:()=>p,Np:()=>N,Qi:()=>G,Tr:()=>Q,X7:()=>F,XZ:()=>U,Yq:()=>h,Z1:()=>K,_9:()=>x,_q:()=>V,au:()=>P,d_:()=>B,el:()=>O,ez:()=>T,fq:()=>g,gq:()=>b,i0:()=>k,iV:()=>j,jG:()=>l.j,p6:()=>I,sh:()=>H,vl:()=>d.v,wB:()=>S});var s=i(74267),n=i(92810),o=i(85163),a=i(1741),r=i.n(a),c=i(45695),l=i(77509),d=i(23397),_=i(71210),u=i(70082);const p=e=>{Object.keys(o.A9).forEach((t=>{"onboarding_success"!==e.get(o.A9[t])&&e.remove(o.A9[t])}))};function m(e){const t=(0,s.A)(e);return isNaN(t)?new Date(e):t}const h=(e,t,i=!1)=>{Date;const s=new Date,n=e.getDate()===s.getDate()&&e.getMonth()===s.getMonth()&&e.getFullYear()===s.getFullYear();if(i&&n){const i=Math.floor((s-e)/1e3),n=Math.floor(i/60),o=Math.floor(n/60);if(i<60)return t("Just now");if(o>0){const e=n%60;return`${o} ${t("hour","hours",o)} ${e} ${t("minute","minutes",e)}`}return`${n} ${t("minute","minutes",n)}`}{const t=new Intl.DateTimeFormat(navigator.language,{dateStyle:"short"}),i=new Intl.DateTimeFormat(navigator.language,{timeStyle:"short"});return t.format(e)+" "+i.format(e)}},g=e=>{const t=e.match(/(\(copy\))( \d+)?$/),i=null===t||void 0===t?void 0:t[1],s=null===t||void 0===t?void 0:t[2];return i?s?`${e.slice(0,-s.length)} ${+s.slice(1)+1}`:`${e} 2`:`${e} (copy)`};function E(e,t,i){const s=new Map,n=new RegExp(`(${t})(.*?)(${i})`,"gis");return e=e.replaceAll(n,((e,t,i,n)=>{const o=(0,_.l)();return s.set(o,i),t+o+n})),{escapes:s,html:e}}function A(e,t){let i=[];for(const[s,n]of t){const{escapes:t,html:o}=E(e,s,n);e=o,i.push([s,n,t])}return{escapes:i,html:e}}function v(e,t,i,s){const n=new RegExp(`(${t})(.*?)(${i})`,"gis");return e.replaceAll(n,((e,t,i,n)=>{const o=s.get(i);return"string"===typeof o?t+o+n:e}))}const f=/<title>(.*)<\/title>/gm,O=(e,t)=>{let{escapes:i,html:s}=A(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return s=s.replaceAll(f,((e,i)=>i===t?`<title>${g(i)}</title>`:e)),function(e,t){for(const[i,s,n]of t)e=v(e,i,s,n);return e}(s,i.reverse())};function T(e){let{html:t}=A(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return[...t.matchAll(f)].map((e=>e[1])).find((e=>!!e))}const D="bottomRight",I=(e,t,i=D)=>{var s,n,o,a;t.error({innerException:e.error instanceof Error?e.error:void 0,message:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(s=e.error)||void 0===s||null===(n=s.data)||void 0===n?void 0:n.code)||(null===(o=e.error)||void 0===o?void 0:o.status)||e.error}}),description:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(a=e.error.data)||void 0===a?void 0:a.message)||e.error.error}}),placement:i})},S=(e,t,i=D)=>{t.success({message:e,placement:i})},C="ascend",y="descend",L="desc",b=e=>{switch(e){case C:return"asc";case y:return L;default:return""}},N=e=>{switch(e){case"asc":return C;case L:return y;default:return""}},M=e=>{const t=document.createElement("div");return t.className=e||"resizer",t},P=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,w=e=>new Promise(((t,i)=>{let s=new Image;s.src=e,s.addEventListener("load",(()=>{t("success")})),s.addEventListener("error",(()=>{i("error")})),s=null})),R=(e,t)=>{for(const i of t)"object"===typeof e.properties&&(e=e.properties[i]);return e},B=e=>e instanceof Array?e.map((e=>({label:e,value:e}))):Object.keys(e).map((t=>({label:e[t],value:t}))),k=(e,t,i=!0)=>{const s=Object.keys(t);for(const n of s){const s=t[n];void 0!==s&&null!==s&&(e[n]=i&&"object"===typeof s?k(e[n]||{},s,!0):s)}return e},j=e=>new Promise(((t,i)=>{r().load({google:{families:[e]},classes:!1,active:t,inactive:i})})),U=(e,t)=>{t&&e(t)},x=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i)=>{document.querySelectorAll(".block-search__preview").forEach((e=>e.remove()));const s=document.getElementById("iframe-scroll-top"),n=document.getElementById("iframe-scroll-bottom"),a=document.getElementById("email_iframe"),r=document.body.getBoundingClientRect().height,c=a.getClientRects()[0];c.top<0&&(s.style.display="block"),c.top+c.height>r&&(n.style.display="block");const l={operation:o.Ru.SANDBOX_BLOCK_INSERT,settings:{blockHTML:i||null,targetBlock:null,project:"emailmaker"}};t.dataTransfer.setData("Text",JSON.stringify(l)),e(l)}),[e])},G=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i,s)=>{const n=document.getElementById("iframe-scroll-top"),a=document.getElementById("iframe-scroll-bottom"),r=document.getElementById("email_iframe"),c=document.body.getBoundingClientRect().height,l=r.getClientRects()[0];l.top<0&&(n.style.display="block"),l.top+l.height>c&&(a.style.display="block");const d={operation:o.Ru.SANDBOX_ATOM_INSERT,settings:{atomHTML:i.html||null,targetBlock:null}};s(i)&&t.dataTransfer.setData("Text",JSON.stringify(d)),e(d)}),[e])},H=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i)=>{e({operation:o.Ru.SANDBOX_BLOCK_INSERT,action:"insert",settings:{blockHTML:i}})}),[e])},F=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i)=>{e({operation:o.Ru.SANDBOX_ATOM_INSERT,action:"insert",settings:{atomHTML:i}})}),[e])},K=(e,t)=>{t.success({maskClosable:!0,centered:!0,title:e("Coming soon"),content:e("The feature is under development."),okText:e("Ok. I'll be waiting"),onOk:()=>{}})},X=()=>{const e=(0,c.XW)();return(t,i)=>{e({operation:o.Ru.SANDBOX_ELEMENT_SETTINGS_SET,settings:t,type:i})}},V=(e,t="")=>{var i,s;const n=[];return null===(i=e._embedded)||void 0===i||null===(s=i["wp:term"])||void 0===s||s.filter((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})).forEach((e=>{const t=e[0].taxonomy;n[t]||(n[t]=[]),n[t]=e.map((e=>({id:e.id,name:e.name,children:e.children}))),n[n.length]=n[t]})),""!==t&&n.length?n[t]:n},z=(e,t="")=>{var i,s,n,o,a;return(null===(i=e._embedded)||void 0===i||null===(s=i["wp:term"])||void 0===s||null===(n=s.find((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})))||void 0===n||null===(o=n.find((e=>{var t;return null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.startsWith("project_")})))||void 0===o||null===(a=o.children)||void 0===a?void 0:a.map((e=>({id:e.id,name:e.name,count:e.count}))))||null},W=(e,t)=>{const i=e.target,s=t.getBoundingClientRect().height,n=i.getBoundingClientRect().height-s,o=e.clientY-t.getBoundingClientRect().top-30,a=-n*(Math.min(Math.max(o,0),s-60)/(s-60));i.style.transform=`translateY(${a}px)`},Q=({target:e})=>{e.style.transform="translateY(0)"}},20116:(e,t,i)=>{function s(e){return t=>{const i=t.query,s=t.queryFn||((e,t,s,n)=>n(i(e)));if(s){let i;if("object"===typeof e){const{queryFn:s,...n}=e;i=s;for(const e of Object.keys(n))t[e]=n[e]}else i=e;t.query=void 0,t.queryFn=async(e,t,n,o)=>{try{let a=await i(e);return"function"===typeof a&&(a=await a((async(e,i=t,a=n,r=o)=>{const c=await s(e,i,a,r);if(c.error)throw c.error;return c.data}))),{data:a,error:null}}catch(a){return{error:a}}}}}}function n(){return s((()=>{}))}function o(e,t){const i={},n=Object.keys(t);for(const o of n)i[o]=s(t[o]);e.enhanceEndpoints({endpoints:i})}function a(e,t){for(const i of Object.keys(t))t[i](e)}i.d(t,{BD:()=>a,BX:()=>o,nM:()=>s,pl:()=>n})},98589:(e,t,i)=>{function s(e,t){if(e===t)return!0;if("object"===typeof e&&e&&"object"===typeof t&&t){const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(const o of i)if(!s(e[o],t[o]))return!1;return!0}return!1}function n(e,t){if(!e)return t;const i={};for(const n of Object.keys(t))s(t[n],e[n])||(i[n]=t[n]);return i}i.d(t,{g:()=>n})},88896:(e,t,i)=>{i.d(t,{X:()=>n});const s=Symbol("Error");function n(e){return Promise.all(e.map((e=>e instanceof Promise?e.catch((e=>(console.log(e),s))):e))).then((e=>e.filter((e=>e!==s))))}},91738:(e,t,i)=>{i.d(t,{AU:()=>d});var s=i(90854),n=i(58689),o=i(44824),a=i(85974),r=i(91391);const c=e=>function(e){var t;return function(e){return"___SCRIPT"===e.tagName}(e)&&(null===(t=e.src)||void 0===t?void 0:t.startsWith(r.gP))}(e)||(0,a.Nh)(e)||(0,s.BF)(e),l=e=>{if(c(e))return!0;if((0,s.vq)(e)||(0,s.wz)(e))for(const t of e.querySelectorAll("*"))if(c(t))return!0;return!1};async function d(e,t){"string"===typeof e&&(e={code:e});const i=e.code?await(0,n.PJ)(e.code||"",[n.qy],e.utm_parameters,(async e=>{void 0===t&&(t=l(e)),t&&await(0,o.e)(e,"html")})):"",s=e.code&&t?await(0,n.PJ)(e.code||"",[n.qy],e.utm_parameters,(async e=>{await(0,o.e)(e,"amp")})):"";return{...e,compiled:{html:i,ampHtml:s}}}},91366:(e,t,i)=>{i.d(t,{Qq:()=>g,PL:()=>A,KA:()=>E,wz:()=>v});var s=i(33288),n=i(41664),o=i(15230),a=i(32269),r=i(55654);class c extends r.IO{async execute([e],t){for(const i of t){const t=await i(e);t&&(void 0===t.id&&(t.id=e.value.id),e.value=t)}return e.value}}var l=i(98589);class d extends r.lt{}var _=i(56991);class u extends a.jG{constructor(...e){super(...e),this._items=new Map,this._onChangeEmitter=new r.HN,this.onChange=this._onChangeEmitter.event}async _getOrCreate(e,t){const i=this._items;let s;if(i.has(e))try{s=await i.get(e)}catch{t&&(s=await t())}else t&&(s=await t(),s&&this._onChangeEmitter.fire());return s}async _addOrUpdate(e,t){let i;const s=this._items;if(s.has(e))try{i=await s.get(e)}catch{}const n=await t(i);return(0,_.bD)(i,n)||this._onChangeEmitter.fire(),n}entries(){return Promise.all([...this._items.entries()].map((([e,t])=>t.then((t=>[e,t]))))).then((e=>e.filter((([e,t])=>!!t))))}values(){return Promise.all([...this._items.values()].map((e=>e)).filter((e=>!!e)))}getOrCreate(e,t){let i=this._getOrCreate(e,(()=>t(e)));return this._items.set(e,i),i}addOrUpdate(e,t){let i=this._addOrUpdate(e,t);return this._items.set(e,i),i}add(e,t){const i=Promise.resolve(t);return this._items.set(e,i),i}remove(e){if(this._items.has(e)){const t=this._items.get(e);return this._items.delete(e),this._onChangeEmitter.fire(),t}return Promise.resolve(void 0)}async setAll(e){try{this.suspendChange();const t=[],i=new Set(Array.from(e).map((([e,t])=>e))),s=(await this.entries()).filter((([e,t])=>!i.has(e)));for(const[n,o]of e)t.push(this.addOrUpdate(n,(()=>o))),i.add(n);for(const[e]of s)t.push(this.remove(e));return await Promise.all(t),s}finally{this.resumeChange()}}clear(){this._items.clear(),this._onChangeEmitter.fire()}suspendChange(){this._onChangeEmitter.suspend()}resumeChange(){this._onChangeEmitter.resume()}}var p=i(71210);class m extends a.jG{constructor(...e){super(...e),this._cache=new u,this._readEmitter=new r.lt,this._saveEmitter=this.addDisposable(new c),this._removeEmitter=this.addDisposable(new d),this._foreignCache=Object.create(null),this.handlerRead=this._readEmitter.event,this.onSave=this._saveEmitter.event,this.onRemove=this._removeEmitter.event,this.onChange=this._cache.onChange}async get(e){return this._cache.getOrCreate(e,(async t=>Object.assign({id:e},...(await this._readEmitter.fire(e)).filter((e=>!!e)))))}get cache(){return this._cache}byForeignKey(e){let t=this._foreignCache[e];if(!t){const i=this.addDisposable(new a.jG);i.addDispose((()=>delete this._foreignCache[e]));const s=i.addDisposable(new u),n=i.addDisposable(new r.lt);t=this._foreignCache[e]={get:async(t,i={})=>(await s.getOrCreate(t,(async()=>{try{const i=function(e=[]){if((e=e.filter((e=>e))).length<=1)return e[0];let t=new Map;for(const i of e)for(const e of i)if(void 0!==e.id){let i=t.get(e.id)||{};t.set(e.id,{...i,...e})}return[...t].map((([e,t])=>t))}(await n.fire(t))||[];for(const s of i)s[e]=t,await this._cache.add(s.id,s);return i}catch{return[]}})),function(e,{filter:t,order:i="asc",orderBy:s,page:n,pageSize:o=20}={}){const a=e.length;let r=e.length;if(void 0!==t){const i=Object.keys(t);r=(e=e.filter((e=>{for(const s of i){const i=e[s],n=t[s];return"id"===s||"string"!==typeof i?i===n:"string"===typeof n&&i.startsWith(n)}return!0}))).length}return s&&(e=e.sort(((e,t)=>(e[s]>t[s]?1:t[s]>e[s]?-1:0)*("asc"===i?1:-1)))),void 0!==n&&(e=e.slice(o*(n-1),o*n-1)),{data:e,filteredTotal:r,total:a,totalPages:Math.floor(a/o)}}(await this._cache.values()||[],i)),first:(e,i={})=>t.get(e,{...i,page:1,pageSize:1}).then((e=>e[0])),handleRead:n.event,clear(){s.clear()},dispose(){i.dispose()}}}return t}async create(e,{source:t="",silent:i}={}){let s=e;return i||(s=await this._saveEmitter.fire({prev:void 0,patch:e,value:s,source:t})),void 0===s.id&&(s.id=(0,p.l)()),await this._cache.addOrUpdate(s.id,(()=>s))}async update(e,t,{source:i="",silent:s}={}){return this._cache.addOrUpdate(e,(async e=>{let n=e?{...e,...t}:t;if(!s)return t=e?(0,l.g)(e,t):t,await this._saveEmitter.fire({prev:e,patch:t,value:n,source:i})}))}async remove(e,{source:t="",silent:i}={}){const s=await this._cache.remove(e);return i||await this._removeEmitter.fire({value:s,source:t}),s}refresh(){this._cache.clear();for(const e of Object.values(this._foreignCache))e.clear()}suspendChange(){this._cache.suspendChange()}resumeChange(){this._cache.resumeChange()}}i(18398);var h=i(39990);function g(){const e=(0,n.Q)();return t=>s.di.getOrCreateInstance(t,e,(()=>new m))}function E(e){const t=s.di.getInstance(e,o.ax);if(!t)throw new Error("Failed");return t}function A(e){const t=s.di.getInstance(e,o.Lz);if(!t)throw new Error("Failed");return t}async function v(e){const t=E(e),i=await t.dispatch(h.Q2.endpoints.getMe.initiate({},{forceRefetch:!0}));return Promise.resolve(i.data)}},13437:(e,t,i)=>{i.d(t,{A:()=>a,i:()=>o});var s=i(71210),n=i(814);function o({code:e,...t},i){var n,o;const a=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,s.l)(),project:null===(n=a.projectSlice)||void 0===n||null===(o=n.project)||void 0===o?void 0:o.id}}function a({html:e,renderGuid:t,...i},s){const o=s.getState(),{project:a}=o.configSlice;return(0,n.TB)({...i,code:e,project:void 0===a?i.project:a,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}},25181:(e,t,i)=>{function s(e,t){var i;return{severity:Number(t.severity),message:t.message,source:t.source,startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn,get startOffset(){return e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn})},get endOffset(){return e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn})},tags:null===(i=t.tags)||void 0===i?void 0:i.map((e=>Number(e)))}}i.d(t,{B:()=>s})},91253:(e,t,i)=>{i.d(t,{I:()=>o,y:()=>n});var s=i(814);function n(e,t,i){const s=t.getState();var n,o;void 0===i&&(i=void 0===e.post?null===(n=s.emailSlice)||void 0===n||null===(o=n.email)||void 0===o?void 0:o.id:e.post);return{...e,content:e.content?`<p>${e.content}</p>`:"",post:i}}function o(e,t){return(0,s.TB)({...e,link:void 0,comment_status:void 0})}},81304:(e,t,i)=>{i.d(t,{E:()=>a,I:()=>o});var s=i(71210),n=i(814);function o({code:e,...t},i){var n,o;const a=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,s.l)(),project:null===(n=a.projectSlice)||void 0===n||null===(o=n.project)||void 0===o?void 0:o.id,utm_parameters:t.utm_parameters||{},_embedded:void 0}}function a({html:e,renderGuid:t,...i},s){const o=s.getState(),{project:a,config:r}=o.configSlice;return(0,n.TB)({...i,code:e,project:void 0===a?i.project:a,utm_parameters:r.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0,compiled:(0,n.TB)({html:e,ampHtml:e&&""})})}},4453:(e,t,i)=>{i.d(t,{E:()=>o,_:()=>n});var s=i(814);function n({code:e,...t},i,s){const n=i.getState();var o,a;void 0===s&&(s=void 0===t.parent?null===(o=n.emailSlice)||void 0===o||null===(a=o.email)||void 0===a?void 0:a.id:t.parent);return{...t,...e?{html:e}:{},parent:s}}function o({html:e,...t},i){return(0,s.TB)({...t,code:e,guid:void 0,compiled:(0,s.TB)({html:e,ampHtml:e&&""})})}},23036:(e,t,i)=>{i.d(t,{Xy:()=>a,bg:()=>c,yc:()=>r});var s=i(20116),n=i(55701),o=i(91366);const a=(0,o.Qq)(),r=(0,o.Qq)();function c(e){const t=a(e),i=t.byForeignKey("project"),c=r(e),l=c.byForeignKey("parent"),{dispatch:d,getState:_}=(0,o.KA)(e),u=(0,o.PL)(e);u.addDisposable(t.onChange((()=>d(n.VM.util.invalidateTags(["Blocks"]))))),u.addDisposable(t.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.html===e.html&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE)),(0,s.BX)(n.VM,{async getBlocks(e){const t={};e.name&&(t.title=e.name),e.type&&(t.type=e.type);return await i.get(e.projectId,{filter:t,page:e.page,pageSize:e.pageSize,order:e.order,orderBy:e.orderby}).then((({data:e})=>e))},getBlocksSchema:()=>e=>e({}),getParentEmailBlocks:e=>t=>t(e),getTemplateBlocks:e=>t=>t(e),async getBlock(e){const t=_().projectSlice.project.id;return i.first(t,{filter:{id:e}})},getBlockHistory:async({blockId:e,page:t=1})=>({...await l.get(e,{page:t}),args:{blockId:e,page:t}}),addBlock:e=>async i=>{const s=await t.create(e);return _().configSlice.config.preventSendDataToEM||i(s).catch((e=>console.log(e))),s},editBlock:({blockId:e,...i})=>t.update(e,i),deleteBlock:e=>t.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveBlock:({blockId:e,body:t})=>c.create({...t,parent:e})})}},72788:(e,t,i)=>{i.d(t,{B:()=>c,D:()=>r});var s=i(18777),n=i(91366),o=i(68415),a=i(20116);const r=(0,n.Qq)();function c(e){const t=r(e),i=t.byForeignKey("post"),{dispatch:c}=(0,n.KA)(e);(0,n.PL)(e).addDisposable(t.onChange((()=>c(s.Jg.util.invalidateTags(["Comments"]))))),(0,a.BX)(s.Jg,{getComments:e=>i.get(e).then((({data:e})=>e)),addComment({subjectId:e,author:i,parent:s,content:n,author_name:a,author_email:r,targetId:c}){const l={post:e,author:i,author_name:a,author_email:r,content:n,parent:s,target_id:c,date:(0,o.A)(new Date),author_avatar_urls:{}};return t.create(l)},deleteComment:e=>t.remove(e),editComment:({commentId:e,...i})=>t.update(e,i),deleteTarget:e=>t.update(e,{target_id:""})})}},87265:(e,t,i)=>{i.d(t,{Av:()=>r,jw:()=>c,sE:()=>l});var s=i(17581),n=i(91366),o=i(71210),a=i(20116);const r=(0,n.Qq)(),c=(0,n.Qq)();function l(e){const t=r(e),i=c(e),l=i.byForeignKey("parent"),{dispatch:d,getState:_}=(0,n.KA)(e),u=(0,n.PL)(e);u.addDisposable(t.onChange((async()=>{d(s.GY.util.invalidateTags(["Email"]))}))),u.addDisposable(i.onChange((()=>{d(s.GY.util.invalidateTags(["EmailAutosaves"]))}))),u.addDisposable(t.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.subject===e.subject&&i.html===e.html&&i.preheader===e.preheader&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE)),(0,a.BX)(s.GY,{getEmails:e=>[],getTemplateEmails:e=>t=>t(e),getEmail:async e=>await t.get(e),getEmailHistory:({emailId:e,page:t=1})=>(l.clear(),async s=>{if(_().configSlice.config.revisionService){const n=await s({emailId:e,page:t});for(const e of n.data)i.cache.add(e.id,e);return n}return{...await l.get(e,{page:t}),args:{emailId:e,page:t}}}),async addEmail({source:e,...i}){const s=await t.create(i,{source:e});return s.renderGuid||(s.renderGuid=(0,o.l)()),s},editEmail:e=>async i=>{let{emailId:s,source:n,...o}=e;return _().configSlice.config.revisionService&&await i(e),t.update(s,o,{source:n})},deleteEmail:e=>t.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveEmail:({emailId:e,body:t})=>async s=>(_().configSlice.config.revisionService&&await s({emailId:e,body:t}),await i.create({...t,parent:e,modified:(new Date).toString()}))})}},43347:(e,t,i)=>{i.d(t,{Ri:()=>_,uS:()=>u});var s=i(15230),n=i(63531),o=i(33288),a=i(55654),r=i(93982),c=i(13522),l=i(20116);const d="tmp",_=o.di.createIdentifier();o.di.createIdentifier();function u(e){const t=o.di.getInstance(e,s.Lz);if(!t)throw new Error("Something was wrong");const i=t.addDisposable(new a.lt);o.di.inject(e,_,i);const u=(0,r.dB)(e,c.A.ON_SEND_TESTEMAIL_ID),p=(0,r.dB)(e,c.A.ON_SEND_LIVEPREVIEW_ID);(0,l.BX)(n.yH,{uploadImage:t=>async n=>{const a=e.getState(),{project:r}=a.configSlice,c=t.folder===d?null:await i.fire({file:t.file,project:r}),l=c?c.find((e=>e)):null;return l?[{file_url:l,project:r}]:n({...t,user_id:String((await o.di.getInstanceAsync(e,s.sZ)).app_id)})},sendTestEmail:t=>async i=>{const n=e.getState(),{project:a}=n.configSlice;(await u.fire({project:a,email_id:t.email_id,subject:t.subject,email:t.email,html:t.html,from_name:t.from_name})).some((e=>!1===e))&&await i({...t,user_id:String((await o.di.getInstanceAsync(e,s.sZ)).app_id)})},async sendLivePreview(t){const i=e.getState(),{project:s}=i.configSlice;(await p.fire({project:s,id:t.email,subject:t.subject,html:t.content})).some((e=>!1===e))},sendShortLink:e=>t=>t(e)})}},14999:(e,t,i)=>{i.d(t,{A:()=>O});var s=i(20116),n=i(53200);var o=i(84612);var a=i(91366),r=i(39990);var c=i(15230),l=i(47036);var d=i(95679);var _=i(62689);var u=i(84568);var p=i(46312);var m=i(65119);var h=i(43347),g=i(83351);var E=i(23036),A=i(72788),v=i(94381);var f=i(87265);const O={addUserToProjectApiMock:function(){n.B.enhanceEndpoints({endpoints:{addUserToProject:(0,s.pl)()}})},AiApiMock:function(){(0,s.BX)(o.Zs,{sendMessage:({body:e})=>t=>t({body:e}),getDialog:e=>t=>t(e)})},authorizationApiMock:function(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:(0,a.KA)(e).getState().userSlice.currentUser.locale,counters:{},avatar_urls:{},autosaves:!0};r.Q2.enhanceEndpoints({endpoints:{userRegistration:(0,s.pl)(),getSchema:(0,s.nM)((()=>e=>e({}))),getMe:(0,s.nM)((()=>t)),editMe:(0,s.nM)((e=>t={...t,...e})),getSubscriptions:(0,s.nM)((()=>[]))}})},blocksApiMock:E.bg,commentsApiMock:A.B,emailsApiMock:f.sE,emailRawApiMock:function(){(0,s.BX)(l.f,{getEmailRaw({emailId:e,secret_hash:t}){throw new Error(c.f5)}})},imageApiMock:function(){(0,s.BX)(d.CL,{sendAiImageRequest:function({body:e}){return t=>t({body:e})},getAiImage:e=>t=>t(e)})},localesApiMock:function(e){(0,s.BX)(v.Ad,{getLocale:async({id:e})=>t=>t({id:e}),getLocales:()=>async e=>e({})})},notificationsApiMock:function(){(0,s.BX)(_.vx,{getNotifications:e=>[],notificationShown({id:e,datetime:t}){throw new Error(c.f5)}})},projectsApiMock:function(e){let t;(0,s.BX)(u.Nq,{getProjects:(e={page:1})=>[],getProject:e=>i=>t||(t=i(e).then((t=>({...t,id:e})))),addProject(e){throw new Error},editProject:({projectId:e,...i})=>t=t.then((t=>({...t,...i,id:e}))),deleteProject(e){throw new Error}})},proxyApiMock:function(){(0,s.BX)(p.Z8,{getFile({url:e,tryFetch:t=!0,type:i}){throw new Error(c.f5)}})},recoverPasswordApiMock:function(){(0,s.BX)(m.yR,{resetPassword(e){throw new Error(c.f5)},setPassword(e){throw new Error(c.f5)},validateRecoverPasswordCode(e){throw new Error(c.f5)}})},saveFileApiMock:h.uS,tokenApiMock:function(){(0,s.BX)(g.OV,{tokenCreate:e=>t=>t(e),tokenValidate:()=>e=>e({})})}}},62410:(e,t,i)=>{i.d(t,{r:()=>v});var s=i(33288),n=i(14386),o=i(18398),a=i(47358),r=i(86286),c=i(39990),l=i(99751),d=i(15230),_=i(13652);function u(e){var t;return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:"off"!==e.wordWrap,minimap:null===(t=e.minimap)||void 0===t?void 0:t.enabled,insertSpaces:e.insertSpaces}}var p=i(39217),m=i(32269),h=i(91366),g=i(93982),E=i(13522),A=i(48802);const v=(0,n.l)((e=>{const t=(0,h.PL)(e),i=(0,A.m)((0,g.Zc)(e,E.A.READ_LOCALE)),n=t.addDisposable(new A.U(i)),v=e.dispatch,f=s.di.getInstanceAsync(e,d.sZ).then((e=>(null===e||void 0===e?void 0:e.app_config)||{}),(e=>(console.log(e),{}))),O=(0,_.y)(),T=async(...t)=>{const i=Object.assign({},...t),s=Object.assign({},...t.map((e=>e.editor))),{locale:n="ru_RU",theme:r,codeModeDirection:l,...d}=i;void 0!==l&&("none"===l?v((0,a.N6)(!1)):(v((0,a.N6)(!0)),v((0,a.Uf)(l))));const _=await(0,h.wz)(e);var u;await v(c.Q2.endpoints.editMe.initiate({..._,code_editor:s?(u=s,{font_size:u.fontSize,font_family:u.fontFamily,tab_size:u.tabSize,word_wrap:u.wordWrap,minimap:u.minimap,insert_spaces:u.insertSpaces}):_.code_editor,locale:"string"===typeof n?n:_.locale,theme:"string"===typeof r?r:_.theme})),v((0,o._R)(d))};let D;return{setOptions:O.decorate((async({config:i={},project:a,user:r,advancedConfigs:d,handleReadLocale:_})=>{var u;n.setListener(_);let g=await f,E=d||g.advancedConfigs,A=localStorage.getItem("configSwither"),O=E&&E[(null===i||void 0===i?void 0:i.mode)||A||"pro"]||(null===(u=(0,l.$)((null===i||void 0===i?void 0:i.mode)||A||"pro"))||void 0===u?void 0:u.config);if(O={...O,configSwither:i.configSwither||!1},await T(O,g,i),v((0,o.bn)(String(a))),v((0,o.ee)(E)),D&&D.dispose(),D=new m.jG,r){let i={...await(0,h.wz)(e),email:"",password:"",...r,id:"number"===typeof r.id?String(r.id):r.id};void 0===r.id&&delete i.id,v(c.Q2.endpoints.editMe.initiate(i)),r.id&&t.addDisposable(s.di.addService(e,p.jY,{execute(e){e.headers.append("user_id",i.id)}}))}a&&t.addDisposable(s.di.addService(e,p.jY,{execute(e){e.headers.append("project_id",String(a))}}))})),instance:{setConfig:O.decorate((async e=>{var t;let i=null===(t=(0,l.$)((null===e||void 0===e?void 0:e.mode)||"pro"))||void 0===t?void 0:t.config;await T(i,await f,e)})),getConfig:()=>function(e){var t,i;const s=e.getState(),n=s[r.Ay.name],c=s[o.Ay.name],l=s[a.Ay.name];return{...c.config,theme:null===(t=n.currentUser)||void 0===t?void 0:t.theme,locale:null===(i=n.currentUser)||void 0===i?void 0:i.locale,codeModeDirection:l.isCodeMode?l.codeModeDirection:"none",editor:u(n.monacoOptions)}}(e),updateConfig:O.decorate((e=>T(e))),handleReadLocale:i}}}))},33746:(e,t,i)=>{i.d(t,{F:()=>c});var s=i(44141),n=i(33288),o=i(15230),a=i(14386),r=i(39217);const c=(0,a.l)((e=>{let t=!0;return{setOptions(i){if(i.hasOwnProperty("baseUrl")){const s=n.di.getInstance(e,r.eT),o=s.getOptions(),a=(0,r.qT)(i.baseUrl);o.baseUrl!==a&&(s.setOptions({baseUrl:a}),t=!0)}if(t){const i=n.di.getInstance(e,s.Pz);n.di.inject(e,o.sZ,(async(e,t)=>t||i.app.app_init_create({}).then((({data:e})=>e))),!0),t=!0}}}}))},19209:(e,t,i)=>{i.d(t,{F:()=>u});var s=i(14386),n=i(14315),o=i(33288),a=i(41664),r=i(39217),c=i(13652),l=i(85163);const d=(0,a.Q)(),_=(0,a.Q)(),u=(0,s.l)((e=>({setOptions(t){const i=(0,c.y)(),s=(0,r.mg)(e);o.di.addService(e,r.jY,{execute:i.decorate((async i=>{if(t.jwtAuth){let a=o.di.getInstance(e,d),r=o.di.getInstance(e,_);if(!r&&!a){const i=await s.jwtAuth.token_create({body:t.jwtAuth,type:n.cM.Json});if(i.error)throw r=l.ff,o.di.inject(e,_,l.ff),new Error(l.ff);a=i.data.token,o.di.inject(e,d,a)}r||i.headers.append("authorization",`Bearer ${a}`)}}))})}})))},1383:(e,t,i)=>{i.d(t,{Y:()=>l,h:()=>d});var s=i(14386),n=i(41664),o=i(33288),a=i(39217),r=i(47271),c=i(12264);const l=(0,n.Q)(),d=(0,s.l)((e=>{let t;return o.di.addService(e,a.jY,{execute:async i=>{if(t){const t=await o.di.getInstanceAsync(e,l);t&&i.headers.append("authorization",`Bearer ${t}`)}}}),{setOptions(i){t!==i.getAuthToken&&(t=i.getAuthToken,o.di.inject(e,l,void 0),o.di.inject(e,l,(async(e,i)=>{try{let e=await i;var s;return t?e&&1e3*(null===(s=(0,r.iU)(e))||void 0===s?void 0:s.exp)>(0,c.N)()?e:await t(e):""}catch(n){return console.log(n),""}}),!0))}}}))},14386:(e,t,i)=>{function s(e){return async function(t){return{setOptions:()=>{},instance:{},dispose:()=>{},...await e(t)||{}}}}function n(e){return async t=>{const i={},s=[];for(const n of e)s.push(await n(t));for(const e of s)Object.assign(i,e.instance);return{instance:i,setOptions:e=>{const t=s.map((t=>t.setOptions(e)));return t.some((e=>e instanceof Promise))?Promise.all(t).then((()=>{})):void 0},dispose:()=>{for(const e of s)e.dispose()}}}}i.d(t,{E:()=>n,l:()=>s})},893:(e,t,i)=>{i.d(t,{m:()=>c});var s=i(17126),n=i(92810),o=i(45934),a=i(18398),r=i(70082);const c=({children:e})=>{const[t,i]=(0,n.useState)(),c=(0,o.d4)(a.p5);return(0,r.jsxs)("div",{className:"App blocks-app blocks-plugin",children:[c&&(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:c}}),(0,r.jsx)(s.fh.Provider,{value:t,children:e}),(0,r.jsx)("div",{ref:i,className:"blocks-modal-container"})]})}},97001:(e,t,i)=>{i.d(t,{P:()=>S});var s=i(32269),n=i(93556),o=i(23580),a=i(71210),r=i(56991),c=i(13329),l=i(28316),d=i(18398),_=i(13437),u=i(81304),p=i(4453),m=i(91253),h=i(33288),g=i(15230),E=i(13652),A=i(13522),v=i(93982),f=i(91738),O=i(17581),T=i(39217),D=i(25181);const I="EXTERNAL";class S extends s.jG{constructor(e){super(),this._store=e,this._emailTemplateCache=Object.create(null),this._prevCommand=void 0,this._prevContent=void 0,this._dataSources=void 0,this._eventLock=void 0,this._queue=(0,E.y)(),this._model=void 0,this._currentEmail=void 0,this.show=this._queue.decorate(this._show,this),this.save=this._queue.decorate(this._save,this);const t=(0,o.My)(e);this._dataSources=(0,n.zC)(t),this._eventLock=(0,n.QQ)(t);const i=(0,v.Zc)(e,A.A.ON_MODEL_CHANGE),s=(0,v.Zc)(e,A.A.ON_EMAIL_CHANGED_ID);this.addDisposable(i((e=>{this._model=e}))),this.addDisposable(s((e=>{this._currentEmail=e}))),this.addDisposable(h.di.addService(e,T.jY,{execute:e=>{var t;null!==(t=this._currentEmail)&&void 0!==t&&t.id&&!this._currentEmail.isNew&&e.headers.append("email_id",this._currentEmail.id)}}))}async getProject(){const e=await h.di.getInstanceAsync(this._store,g.sZ);return null===e||void 0===e?void 0:e.project}async getTemplateEmail(e){e=String(e);let t=this._emailTemplateCache[e];if(!t){const i=await this._store.dispatch(O.GY.endpoints.getTemplateEmail.initiate(e));i.error?console.log(i.error):(t={...i.data,lock:!1,parent_email:e},delete t.id)}return t}async getBlocks(){const{cache:e}=this._dataSources.blocks,t=await this.getProject();return(await e.values()).filter((e=>e.project===t)).map((e=>(0,_.A)(e,this._store)))}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmail();return(await e.values()).filter((e=>e.post===t.id)).map((e=>(0,m.I)(e,this._store)))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmail();return(await e.values()).filter((e=>e.parent===t.id)).map((e=>(0,p.E)(e,this._store)))}async setBlocks(e=[]){const{cache:t}=this._dataSources.blocks;await t.setAll(e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,_.i)(e,this._store)])))}async setEmailRevisions(e=[],t){const{cache:i}=this._dataSources.emailRevisions,s=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,p._)(e,this._store,t)]));await i.setAll(s)}async setComments(e=[],t){const{cache:i}=this._dataSources.comments,s=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,m.y)(e,this._store,t)]));await i.setAll(s)}async getEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,f.AU)(i,t.isAmp)}async compileEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,f.AU)(i,t.isAmp)}async setEmail(e,t,i=!1){const s=this._dataSources.emails,n=s.cache,o=await this.getProject();e="string"===typeof e?{code:e}:{...e};let r=(0,u.I)(e,this._store);const c=r.id;let l=c;if(void 0!==c?r={...await s.get(c),...r,project:o}:(r={...r,project:o},l=(0,a.l)(),delete r.project),t){const e=await this.getTemplateEmail(String(t));e&&(r={...e,id:String(t),...r})}await n.setAll([[l,r]]),i&&this._runShowCommand({isNew:void 0===c,id:l,project:o})}_runShowCommand(e){const t={...e,type:"email"};this._prevCommand&&!(0,r.bD)(this._prevCommand,e)?(0,c.RS)(this._store,l._1,t):this._store.dispatch((0,d.Ir)(t)),this._prevCommand=e}async _show(e){try{if(!e)return;if(this._eventLock.suspendChange(),e!==this._prevContent){this._prevContent=e;const{email:t,blocks:i,autosaves:s,comments:o,templateId:a}=(0,n.Uw)(e),r=[];r.push(this.setBlocks(i)),void 0!==t.id&&(r.push(this.setComments(o)),r.push(this.setEmailRevisions(s))),r.push(this.setEmail(t,Number(a),!0)),await Promise.all(r)}}catch(t){console.log(t)}finally{this._eventLock.resumeChange()}return new Promise((e=>{(0,v.Zc)(this._store,A.A.ON_EMAIL_INIT_ID)((()=>e()))}))}_save(){return new Promise((async e=>{const t=this._dataSources.emails,i=this.addDisposable(t.onSave((({value:t,source:s})=>{s===I&&(i.dispose(),e((0,u.E)(t,this._store)))}),Number.MIN_VALUE));(0,c.RS)(this._store,l.Kp,I)}))}getCodeErrors(){var e;const t=this._store.getState(),i=this._model;return i?null===(e=t.emailSlice.problemsList)||void 0===e?void 0:e.map((e=>(0,D.B)(i,e))):void 0}}},44376:(e,t,i)=>{i.d(t,{y:()=>E});var s=i(23580),n=i(93556),o=i(81304),a=i(13437),r=i(91253),c=i(4453),l=i(32269),d=i(48802),_=i(13522),u=i(93982),p=i(18398),m=i(98589),h=i(55654),g=i(25181);class E extends l.jG{constructor(e){super(),this._store=e,this._events=void 0,this._model=void 0,this._listenersUpdaters=void 0;const t=(0,u.Zc)(e,_.A.ON_MODEL_CHANGE);this.addDisposable(t((e=>{this._model=e})))}_get(){const e=this._store,t=(0,s.My)(e),{blocks:i,emails:l,comments:E,emailRevisions:A}=(0,n.zC)(t),v=(0,u.Zc)(e,_.A.ON_SAVEBUTTON_CLICK_ID),f=(0,u.Zc)(e,_.A.ON_PREVIOUSBUTTON_CLICK_ID),O=(0,u.Zc)(e,_.A.ON_NEXTBUTTON_CLICK_ID),T=(0,u.Zc)(e,_.A.ON_EMAIL_INIT_ID),D=(0,u.Zc)(e,_.A.ON_EMAIL_CHANGED_ID),I=(0,u.Zc)(e,_.A.ON_CONTENT_CHANGED_ID),S=(0,u.Zc)(e,_.A.ON_SEND_TESTEMAIL_ID),C=(0,u.Zc)(e,_.A.ON_SEND_EMAIL_MODAL_ID),y=(0,u.Zc)(e,_.A.ON_EMAIL_CLONE_ID),L=(0,u.Zc)(e,_.A.ON_SHARE_ID),b=(0,u.Zc)(e,_.A.ON_SHOW_PREVIEW_ID),N=(0,u.Zc)(e,_.A.ON_SEND_LIVEPREVIEW_ID),M=(0,u.Zc)(e,_.A.ON_CODE_VALIDATE_ID);return{handleValidate:(0,d.m)(M,(e=>this._model?e.map((e=>(0,g.B)(this._model,e))):[])),handleReadEmail:(0,d.m)(l.handlerRead,(e=>e),(t=>t&&(0,o.I)(t,e))),handleSaveEmail:(0,d.m)(l.onSave,(function({prev:t,patch:i,value:s,source:n}){const a=t?(0,o.E)(t,e):void 0;return{prev:a,patch:(0,m.g)(a,(0,o.E)(i,e)),value:(0,o.E)(s,e),source:n}}),(t=>t?(0,o.I)(t,e):void 0)),handleRemoveEmail:(0,d.m)(l.onRemove,(({value:t,source:i})=>({value:(0,o.E)(t,e),source:i})),(()=>{})),handleReadBlocks:(0,d.m)(i.byForeignKey("project").handleRead,(t=>(0,p.jY)(e.getState())||String(t)),(t=>null===t||void 0===t?void 0:t.map((t=>(0,a.i)(t,e))))),handleSaveBlock:(0,d.m)(i.onSave,(function({prev:t,patch:i,value:s,source:n}){const o=t?(0,a.A)(t,e):void 0;return{prev:o,patch:(0,m.g)(o,(0,a.A)(i,e)),value:(0,a.A)(s,e),source:n}}),(t=>t?(0,a.i)(t,e):void 0)),handleRemoveBlock:(0,d.m)(i.onRemove,(({value:t,source:i})=>({value:(0,a.A)(t,e),source:i})),(()=>{})),handleReadComments:(0,d.m)(E.byForeignKey("post").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.y)(t,e))))),handleSaveComment:(0,d.m)(E.onSave,(function({prev:t,patch:i,value:s,source:n}){const o=t?(0,r.I)(t,e):void 0;return{prev:o,patch:(0,m.g)(o,(0,r.I)(i,e)),value:(0,r.I)(s,e),source:n}}),(t=>t?(0,r.y)(t,e):void 0)),handleRemoveComment:(0,d.m)(E.onRemove,(({value:t,source:i})=>({value:(0,r.I)(t,e),source:i})),(()=>{})),handleReadEmailRevisions:(0,d.m)(A.byForeignKey("parent").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,c._)(t,e))))),handleEmailAutosave:(0,d.m)(A.onSave,(function({prev:t,patch:i,value:s,source:n}){return{value:(0,c.E)(s,e),source:n}}),(t=>t?(0,c._)(t,e):void 0)),handleRemoveEmailAutoSave:(0,d.m)(A.onRemove,(({value:t,source:i})=>({value:(0,c.E)(t,e),source:i})),(()=>{})),handleEmailChanged:(0,d.m)((0,h.sg)(D,100),(t=>(0,o.E)(t,e))),handleEmailInit:(0,d.m)(T,(t=>(0,o.E)(t,e))),handlePreviousButtonClick:(0,d.m)(f,(t=>(0,o.E)(t,e))),handleNextButtonClick:(0,d.m)(O,(t=>(0,o.E)(t,e))),handleSaveButtonClick:(0,d.m)(v,(t=>(0,o.E)(t,e))),handleHtmlChanged:(0,d.m)((0,h.sg)(I,100)),handleTestEmailSend:(0,d.m)(S,(({html:e,...t})=>({...t,code:e,compiled:{html:e,ampHtml:""}}))),handleTestEmailModal:(0,d.m)(C,(t=>(0,o.E)(t,e))),handleCloneEmail:(0,d.m)(y,(t=>(0,o.E)(t,e))),handleShareEmail:(0,d.m)(L),handlePreviewEmail:(0,d.m)(b),handleLivePreviewEmail:(0,d.m)(N)}}get(){return this._events||(this._events=this._get())}setOptions(e={}){const t=this.get();let i=this._listenersUpdaters;if(!i){i=this._listenersUpdaters={};for(const e of Object.keys(t))i[e]=this.addDisposable(new d.U(t[e]))}for(const s of Object.keys(t))i[s].setListener(e[s])}}},93556:(e,t,i)=>{i.d(t,{QQ:()=>r,Uw:()=>c,zC:()=>a});var s=i(23036),n=i(72788),o=i(87265);function a(e){return{emails:(0,o.Av)(e),blocks:(0,s.Xy)(e),emailRevisions:(0,o.jw)(e),blocksRevision:(0,s.yc)(e),comments:(0,n.D)(e)}}function r(e){const t=Object.values(a(e));return{suspendChange(){t.forEach((e=>e.suspendChange()))},resumeChange(){t.forEach((e=>e.resumeChange()))}}}function c(e){return"string"===typeof e?{email:{code:e}}:function(e){return!e.hasOwnProperty("email")&&!e.hasOwnProperty("block")&&!e.hasOwnProperty("templateId")}(e)?{email:e}:{...e,email:"string"===typeof e.email?{code:e.email}:e.email||{}}}},8671:(e,t,i)=>{i.d(t,{e:()=>c});var s=i(14386),n=i(33288),o=i(15230),a=i(32269),r=i(48802);const c=(0,s.l)((e=>{const t=n.di.getInstance(e,o.Lz),i=t.addDisposable(new a.vl),s=(0,r.m)(i.event),c=t.addDisposable(new r.U(s));return{setOptions({handleDestroy:e}){c.setListener(e)},instance:{handleDestroy:s,destroy:()=>t.dispose()}}}))},63772:(e,t,i)=>{i.d(t,{Z:()=>c});var s=i(14386),n=i(43347),o=i(33288),a=i(48802),r=i(15230);const c=(0,s.l)((e=>{const t=o.di.getInstance(e,r.Lz),i=o.di.getInstance(e,n.Ri),s=(0,a.m)(i.event),c=t.addDisposable(new a.U(s));return{setOptions(e){c.setListener(e.handleLoadImage)},instance:{handleLoadImage:(0,a.m)(i.event)}}}))},55853:(e,t,i)=>{i.d(t,{E:()=>c});var s=i(14386),n=i(33288),o=i(15230),a=i(55654),r=i(48802);const c=(0,s.l)((e=>{const t=n.di.getInstance(e,o.Lz),i=t.addDisposable(new a.vl),s=n.di.getInstanceAsync(e,o.Cd);s.then((({instance:e})=>i.fire(e)));const c=(0,r.m)(i.event),l=t.addDisposable(new r.U(c));return{setOptions({handleLoad:e}){l.setListener(e)},instance:{handleLoad:c,reset:e=>s.then((({instance:t,setOptions:i})=>Promise.resolve(i(e)).then((()=>t))))},destroy:()=>t.dispose()}}))},1281:(e,t,i)=>{i.d(t,{Z:()=>g});var s=i(14386),n=i(33288),o=i(15230),a=i(48802),r=i(13329),c=i(28316),l=(i(92810),i(814)),d=i(70082);function _(e){return"string"===typeof e?e:e?(0,d.jsx)("div",{ref:t=>null===t||void 0===t?void 0:t.replaceWith(e)}):void 0}function u(e,t="success"){return"string"===typeof e&&(e={message:e}),(0,l.TB)({type:e.type||t,data:e.data,innerException:e.innerException,message:_(e.message),description:_(e.description),btn:_(e.btn),onClose:e.onClose,duration:e.duration,icon:_(e.icon),placement:e.placement,style:e.style,closeIcon:"boolean"===typeof e.closeIcon||"undefined"===typeof e.closeIcon?e.closeIcon:_(e.closeIcon),props:e.props,role:e.role})}var p=i(13522),m=i(55654),h=i(93982);const g=(0,s.l)((e=>{const t=n.di.getInstance(e,o.Lz),i=(0,h.Zc)(e,p.A.ON_NOTIFICATION),s=(0,m.pb)(i,(e=>"error"===e.type)),l=(0,m.pb)(i,(e=>"success"===e.type)),d=(0,a.m)(i,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),_=(0,a.m)(s,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e,"error"):e)),g=(0,a.m)(l,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),E=t.addDisposable(new a.U(d)),A=t.addDisposable(new a.U(_)),v=t.addDisposable(new a.U(g));return{setOptions({handleNotify:e,handleSuccess:t,handleError:i}){E.setListener(e),A.setListener(i),v.setListener(t)},instance:{notify(t){(0,r.RS)(e,c.Sb,{placement:"bottomRight",...u(t)})},handleNotify:d,handleError:_,handleSuccess:g}}}))},89949:(e,t,i)=>{i.d(t,{R:()=>a});var s=i(92810),n=i(45934),o=i(39990);const a=({onLoad:e,children:t})=>{(0,s.useEffect)((()=>{e&&e()}),[e]);const i=(0,n.wA)();return(0,s.useMemo)((()=>i(o.Q2.endpoints.getMe.initiate({}))),[i]),t}},55654:(e,t,i)=>{i.d(t,{HN:()=>d,IO:()=>o,P9:()=>a,lt:()=>u,pb:()=>c,sg:()=>l,vl:()=>_});var s=i(32269);class n extends s.jG{constructor(...e){super(...e),this._listeners=[],this.event=this._addListener.bind(this)}getListeners(e){return this._listeners.flatMap((([t])=>"function"===typeof t?t:t.getListeners(e)))}hasListeners(){return this._listeners.length>0}_addListener(e,t=0,i){if(!this.isDisposed()){const s=this._listeners;i&&"function"===typeof e&&(e=e.bind(i));const n=s.findIndex((([e,i])=>t<i)),o=[e,t];return s.splice(n>=0?n:s.length,0,o),{dispose(){const e=s.indexOf(o);e>=0&&s.splice(e,1)}}}}dispose(){this._listeners.splice(0,this._listeners.length),super.dispose()}}class o extends n{constructor(...e){super(...e),this.fire=this._fire.bind(this)}execute(e,t){for(const s of t)try{s(...e)}catch(i){console.log(i)}}_fire(...e){if(!this.isDisposed())return this.execute(e,this.getListeners(e))||void 0}}function a(e,t=0){const i=new n;return i.addDisposable(e(i,t)),i.event}class r extends n{constructor(e){super(),this._filter=e}getListeners(e){return this._filter(...e)?super.getListeners(e):[]}}function c(e,t,i=0){const s=new r(t);return s.addDisposable(e(s,i)),s.event}function l(e,t=0,i=0){const s=new o;let n,a=0;return s.addDisposable(e(((...e)=>{n=e,a||(a=setTimeout((()=>{s.fire(...n),a=0}),t))}),i)),s.event}class d extends o{constructor(...e){super(...e),this._suspendCounter=0,this._wasFired=!1}proccessResult(){}execute([e],t){if(this._suspendCounter)this._wasFired=!0;else for(const s of t)try{s(e)}catch(i){console.log(i)}}suspend(){this._suspendCounter++}resume(){0===--this._suspendCounter&&(this._wasFired&&this.fire(),this._wasFired=!1)}}class _ extends o{execute([e],t){for(const s of t)try{s(e)}catch(i){console.log(i)}}}class u extends o{async execute([e],t){const i=[];for(const s of t){const t=await s(e);i.push(t)}return i}}},48802:(e,t,i)=>{i.d(t,{U:()=>o,m:()=>a});var s=i(32269),n=i(55654);class o extends s.jG{constructor(e){super(),this._event=e,this._listener=void 0,this._disposeEvent=void 0}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),this._disposeEvent=e?this._event(e):void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}}function a(e,t,i){const s=(0,n.P9)(e);return(e,n,o)=>{const a=s((async s=>{const n=t?t(s):s;o&&e.bind(o);const a=await e(n);return i?i(a):a}),n,o);return()=>a.dispose()}}},13652:(e,t,i)=>{i.d(t,{y:()=>s});const s=e=>{let t={current:Promise.resolve(),state:e,decorate:(e,i)=>(i&&(e=e.bind(i)),function(...i){const s=t.current.then((()=>e(...i)));return t.current=s.then((e=>{t.state=e}),(e=>{console.log(e)})),s})};return t}},18398:(e,t,i)=>{i.d(t,{Ay:()=>D,EV:()=>O,GH:()=>m,Ir:()=>h,Kj:()=>T,RP:()=>_,_R:()=>E,bn:()=>A,ee:()=>v,jY:()=>p,p5:()=>u,s0:()=>l,zg:()=>d});var s=i(90536),n=i(31770),o=i(99751);const a="configSlice",r=(0,n.ur)((0,o.$)("pro")),c=(0,s.createSlice)({name:a,initialState:{...r,initialMergeTags:void 0},reducers:{setPage:(e,t)=>{e.page=t.payload},setConfig:(e,t)=>{e.config={...r.config,...t.payload}},changeConfigMode:(e,t)=>{var i,s,n;const a=null!==(i=null===e||void 0===e||null===(s=e.advancedConfigs)||void 0===s?void 0:s[t.payload])&&void 0!==i?i:null===(n=(0,o.$)(t.payload))||void 0===n?void 0:n.config;if("simple"!==e.config.mode&&"simple"!==t.payload){const t={...e.config,...Object.fromEntries(Object.entries(a).filter((([e])=>o.i.includes(e))))};e.config=t}else e.config={...e.config,...(0,o.$)(t.payload).config}},setInitialMergeTags:(e,t)=>{e.initialMergeTags=t.payload},setMergeTags:(e,t)=>{e.config.mergeTags=t.payload},updateConfig:(e,t)=>{e.config={...e.config,...t.payload}},setProject:(e,t)=>{e.project=t.payload},setAdvancedConfigs:(e,t)=>{e.advancedConfigs=t.payload}},extraReducers:e=>{}}),l=e=>e[a].page,d=e=>e[a].config,_=e=>e[a].config.themes,u=e=>e[a].config.styles,p=e=>e[a].project,m=e=>e[a].config.mergeTags||e[a].initialMergeTags,{setPage:h,setConfig:g,updateConfig:E,setProject:A,setAdvancedConfigs:v,setMergeTags:f,changeConfigMode:O,setInitialMergeTags:T}=c.actions,D=c},47358:(e,t,i)=>{i.d(t,{Ay:()=>k,B:()=>y,Bp:()=>I,CS:()=>M,Ct:()=>N,Fk:()=>h,Fv:()=>w,N6:()=>T,NQ:()=>b,Oo:()=>p,PM:()=>m,Tn:()=>R,Uf:()=>v,V$:()=>B,Wm:()=>L,cL:()=>C,mi:()=>g,qf:()=>u,sy:()=>S,vc:()=>E,vs:()=>A,wW:()=>f,wr:()=>O,yy:()=>P});var s=i(90536),n=i(85163),o=i(31770),a=i(55701);const r=window.localStorage.getItem(n.V0.em_code_mode_settings),c=r&&JSON.parse(r),l=(0,o.ur)({activeModal:"",lastActiveSettingsTab:n.Bv,activeSettingsTab:n.Bv,isPanelHistoryCollapsed:!0,monacoHeight:0,isCodeMode:(null===c||void 0===c?void 0:c.isCodeMode)||n.EW.isPlugin,codeModeDirection:(null===c||void 0===c?void 0:c.codeModeDirection)||"left",emailWidth:"100%",emailViewType:n.Vp,mobileViewActive:{shutdown:!0,styles:!0},emailMaxWidthSize:425,propertiesPanelKey:n.WU,parentBlocks:[]}),d="emailPageSlice",_=(0,s.createSlice)({name:d,initialState:l,reducers:{openModal:(e,t)=>{e.activeModal=t.payload},closeModal:e=>{e.activeModal=""},setActiveSettingsTab:(e,t)=>{e.lastActiveSettingsTab=e.activeSettingsTab,e.activeSettingsTab=t.payload,t.payload!==n.Vv&&(e.isPanelHistoryCollapsed=!0)},resetToLastActiveSettingsTab:e=>{"Properties"===e.lastActiveSettingsTab?e.activeSettingsTab="Build":e.activeSettingsTab=e.lastActiveSettingsTab,e.lastActiveSettingsTab!==n.Vv&&(e.isPanelHistoryCollapsed=!0)},switchIsPanelHistoryCollapsed:(e,t)=>{e.isPanelHistoryCollapsed=t.payload||!e.isPanelHistoryCollapsed},setEmailWidth:(e,{payload:t})=>{e.emailWidth=t,e.emailViewType=t>e.emailMaxWidthSize||"100%"===t?n.Vp:n.ND,window.localStorage.setItem(n.V0.em_default_sizes,JSON.stringify(t))},setEmailMaxWidthSize:(e,{payload:t})=>{e.emailMaxWidthSize=t},setEmailViewType:(e,t)=>{e.emailViewType=t.payload},switchCodeMode:e=>{const t=!e.isCodeMode;e.isCodeMode=t,window.localStorage.setItem(n.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:t}))},setCodeMode:(e,t)=>{const i=t.payload;e.isCodeMode!==i&&(e.isCodeMode=i,window.localStorage.setItem(n.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:i})))},switchCodeModeDirection:(e,t)=>{e.codeModeDirection=t.payload,window.localStorage.setItem(n.V0.em_code_mode_settings,JSON.stringify({isCodeMode:e.isCodeMode,codeModeDirection:t.payload}))},setMobileViewActive:(e,t)=>{e.mobileViewActive=t.payload},setPropertiesPanelKey:(e,t)=>{e.propertiesPanelKey=t.payload},resetParentBlocks:e=>{e.parentBlocks=[]},setParentBlocks:(e,t)=>{e.parentBlocks=t.payload}},extraReducers:e=>{e.addMatcher(a.VM.endpoints.getParentEmailBlocks.matchFulfilled,((e,t)=>{e.parentBlocks=t.payload}))}}),{openModal:u,closeModal:p,setActiveSettingsTab:m,resetToLastActiveSettingsTab:h,switchIsPanelHistoryCollapsed:g,setEmailWidth:E,switchCodeMode:A,switchCodeModeDirection:v,setMobileViewActive:f,setEmailViewType:O,setCodeMode:T,setEmailMaxWidthSize:D,setPropertiesPanelKey:I,resetParentBlocks:S}=_.actions,C=e=>e[d].activeModal,y=e=>e[d].activeSettingsTab,L=e=>e[d].isPanelHistoryCollapsed,b=e=>e[d].emailWidth,N=e=>e[d].emailViewType,M=e=>e[d].mobileViewActive,P=e=>e[d].codeModeDirection,w=e=>e[d].isCodeMode,R=e=>e[d].propertiesPanelKey,B=e=>e[d].parentBlocks,k=_},57964:()=>{}}]);