@emailmaker/emailmaker 1.0.89 → 1.0.90
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.
- package/README.md +1 -1
- package/asset-manifest.json +10 -10
- package/emailmaker-esm.js +1 -1
- package/emailmaker.d.ts +12 -0
- package/emailmaker.js +1 -1
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/iframe-eblock.2da62676cd51ab369172.html +1 -0
- package/iframe/iframe.2da62676cd51ab369172.html +1 -0
- package/iframe/js/826.203f82ea.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/iframe/sandbox.js +1 -1
- package/package.json +1 -1
- package/plugin.html +1 -1
- package/plugin_blocks_test.html +1 -1
- package/plugin_default.html +1 -1
- package/plugin_idigital.html +1 -1
- package/plugin_nota.html +1 -1
- package/plugin_s.html +1 -1
- package/static/js/{1538.d92fd4ae.chunk.js → 1538.c37b25fc.chunk.js} +2 -2
- package/static/js/{3017.87931e82.chunk.js → 3017.1bbeda89.chunk.js} +1 -1
- package/static/js/{3397.b73b33df.chunk.js → 3397.c4e8daad.chunk.js} +2 -2
- package/static/js/3927.53e3058b.js +1 -0
- package/static/js/985.35d145ce.js +1 -0
- package/static/js/{emailmaker_core.3dcfca4b.js → emailmaker_core.b4c43c8c.js} +2 -2
- package/translations.pot +243 -243
- package/iframe/iframe-eblock.4dd1098170ff6da98996.html +0 -1
- package/iframe/iframe.4dd1098170ff6da98996.html +0 -1
- package/iframe/js/826.f5fb51be.js +0 -1
- package/static/js/3927.bdc998c8.js +0 -1
- package/static/js/985.a2045bb0.js +0 -1
- /package/iframe/js/{826.f5fb51be.js.LICENSE.txt → 826.203f82ea.js.LICENSE.txt} +0 -0
- /package/static/js/{1538.d92fd4ae.chunk.js.LICENSE.txt → 1538.c37b25fc.chunk.js.LICENSE.txt} +0 -0
- /package/static/js/{3397.b73b33df.chunk.js.LICENSE.txt → 3397.c4e8daad.chunk.js.LICENSE.txt} +0 -0
- /package/static/js/{emailmaker_core.3dcfca4b.js.LICENSE.txt → emailmaker_core.b4c43c8c.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3927],{47827:()=>{},39941:()=>{},10148:(e,t,l)=>{l.d(t,{A:()=>B});var o=l(98173),a=l(2604),i=l(30150),r=l(37969),n=l(93511),m=l(5553),d=l(59010),s=l(26298),c=l.n(s),u=l(8807),p=l(98845),g=l(65716),b=l(61058),E=l(54838),h=l(22536),f=l(1047),v=l(12543),A=l(40277),_=l(52919),y=l(86095),S=l(32947);const B=({emailElement:e})=>{const{__:t}=(0,v.s9)(),l=(0,_.XW)(),s=(0,a.wA)(),{projectId:B}=(0,i.g)(),k=(0,y.fn)(),x=(0,a.d4)(b.p1),w=(0,a.d4)(b.RL),R=(0,a.d4)(E.Wm),[N,T]=(0,o.useState)(!0),[I,P]=(0,o.useState)(!1),[C,L]=(0,o.useState)([]),[O,F]=(0,o.useState)([]),D=e=>s((0,E.mi)(e)),M=(0,o.useCallback)((e=>{s((0,f.no)(e)),k.setValue(null===e||void 0===e?void 0:e.html.replaceAll("\r\n","\n"))}),[k,s]),{data:V}=g.Nq.useGetProjectQuery(Number(B),{skip:!B}),[z,H]=(0,o.useState)([]);(0,o.useEffect)((()=>{if(V){const{owner:e,admins:t,users:l}=null===V||void 0===V?void 0:V.members;H([e&&{...e},t&&Array.isArray(t)&&t.map((e=>({...e}))),l&&Array.isArray(l)&&l.map((e=>({...e})))].filter((e=>e)).flat(1).map((e=>({id:e.ID,display_name:e.display_name}))))}}),[V,null===V||void 0===V?void 0:V.members,t]);const[G,W]=(0,o.useState)(1),[j,U]=(0,o.useState)(!1);(0,o.useEffect)((()=>{const e=Array.isArray(x)&&x.length&&(null===x||void 0===x?void 0:x.map((e=>{var l;return{key:e.id,author:e.author,date:(0,A.Yq)((0,A.Cl)(e.date||e.modified),t),title:e.title,html:e.html,common_styles:e.common_styles,loading:!1,isAutosave:null===(l=e.slug)||void 0===l?void 0:l.includes("autosave")}})));F(e||[]),L(e),T(!1),w<2&&U(!0)}),[x,w,t]);const X=N||I||j?null:o.createElement("div",{style:{textAlign:"center",marginTop:24,marginBottom:24,height:32,lineHeight:"32px"}},o.createElement(r.Ay,{onClick:()=>{P(!0),F(C.concat([...new Array(3)].map((()=>({loading:!0}))))),s(p.GY.endpoints.getEmailHistory.initiate({emailId:e.id,page:G+1})).then((e=>{const{data:l,totalPages:o}=e.data,a=Array.isArray(l)&&(null===l||void 0===l?void 0:l.map((e=>({key:e.id,author:e.author,date:(0,A.Yq)((0,A.Cl)(e.date||e.modified),t),title:e.title,html:e.html,loading:!1})))),i=C.concat(a);F(i),L(i),P(!1),window.dispatchEvent(new Event("resize")),G+1>=o&&U(!0),W(G+1)}))}},t("loading more"))),[q,$]=(0,o.useState)(),[Y,K]=(0,o.useState)(null),Q=(0,o.useRef)();return Q.current=e,(0,o.useEffect)((()=>{if(!R&&!Y){const e=Q.current;e&&K({html:k.getValue(),preheader:e.preheader,common_styles:e.common_styles,subject:e.subject})}}),[R,K,k,Y]),(0,o.useEffect)((()=>{R&&Y&&(M(Y),K(null))}),[R,Y,M]),o.createElement(o.Fragment,null,o.createElement(n.A,{className:"secondary-tabs email-settings__collapse secondary-tabs_unset_scroll",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:S.Vv,items:[{label:o.createElement(o.Fragment,null,t("Version history")),key:S.Vv,forceRender:!0,className:"email-settings__collapse-panel",style:{height:"100%"},children:o.createElement(m.A,{className:"history-panel__list",loading:N,itemLayout:"horizontal",loadMore:X,dataSource:O,header:o.createElement("div",{className:"history-panel__list-header"},o.createElement("div",{className:"history-panel__list-date"},t("Time")),o.createElement("div",{className:"history-panel__list-author"},t("Author")),o.createElement("div",{className:"history-panel__restore"},"Set")),renderItem:(e,a)=>{var i;return o.createElement(m.A.Item,{onClick:()=>{a!==q&&($(a),M(C[a])),s((0,h.rc)(!0))},className:c()("history-panel__item",{"history-panel__item_active":a===q})},o.createElement(d.A,{title:!1,loading:e.loading||!1,active:!0},o.createElement("div",{className:"history-panel__list-date"},e.date),o.createElement("div",{className:"history-panel__list-author"},(null===(i=z.find((t=>{var l,o;return(null===(l=t.id)||void 0===l?void 0:l.toString())===(null===(o=e.author)||void 0===o?void 0:o.toString())})))||void 0===i?void 0:i.display_name)||"\u2013"),e.isAutosave&&q!==a&&o.createElement("div",{style:{opacity:.45},className:"history-panel__list-autosave"},t("Auto")),!e.isAutosave&&o.createElement(r.Ay,{size:"small",className:"history-panel__restore",type:"link",onClick:e=>{q===a&&e.stopPropagation(),M(C[a]),$(null),K(null),l({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1}),s((0,E.Fk)())}},t("Set")),e.isAutosave&&q===a&&o.createElement(r.Ay,{size:"small",className:"history-panel__restore",type:"link",onClick:e=>{q===a&&e.stopPropagation(),M(C[a]),D(!0),$(null),K(null),l({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1})}},t("Set"))))}})}]}),o.createElement(r.Ay,{type:"text",className:"ant-modal-close","aria-label":"Close",onClick:()=>{s((0,E.Fk)()),M(Y),K(null),D(!0),l({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1})}},o.createElement(u.A,{icon:"Close"})))}},80922:(e,t,l)=>{l.d(t,{A:()=>Ae});var o=l(98173),a=l(2604),i=l(67594),r=l(71446),n=l(27499),m=l(8218),d=l(48753),s=l(98447),c=l(93511),u=l(64909),p=l(5889),g=l(38826),b=l(12543),E=l(30150),h=l(8122),f=l(40835),v=l(871),A=l(47014),_=l(23424),y=l(80772),S=l(84572),B=l(32947),k=l(56545),x=l(37969),w=l(76293),R=l(80320),N=l(96734),T=l(90614),I=l(3792),P=l(15626),C=l(12352);const L={text:{replaceDefault:!0,defaultCategory:"handwriting",items:[{family:"Montserrat Light",src:"customFonts/Montserrat-Light.woff2"},{family:"Montserrat Regular",src:"customFonts/Montserrat-Regular.woff2"},{family:"Montserrat Bold",src:"customFonts/Montserrat-Bold.woff2"},{family:"Montserrat Black",src:"customFonts/Montserrat-Black.woff2"},{family:"Roboto Light",src:"customFonts/Roboto-Light.woff2"},{family:"Roboto Regular",src:"customFonts/Roboto-Regular.woff2"},{family:"Roboto Bold",src:"customFonts/Roboto-Bold.woff2"},{family:"Roboto Black",src:"customFonts/Roboto-Black.woff2"},{family:"Lato Light",src:"customFonts/Lato-Light.woff2"},{family:"Lato Regular",src:"customFonts/Lato-Regular.woff2"},{family:"Lato Bold",src:"customFonts/Lato-Bold.woff2"},{family:"Lato Black",src:"customFonts/Lato-Black.woff2"},{family:"Rubik Light",src:"customFonts/Rubik-Light.woff2"},{family:"Rubik Regular",src:"customFonts/Rubik-Regular.woff2"},{family:"Rubik Bold",src:"customFonts/Rubik-Bold.woff2"},{family:"Rubik Black",src:"customFonts/Rubik-Black.woff2"},{family:"Bebas Neue Light",src:"customFonts/BebasNeueLight.woff2"},{family:"Bebas Neue Regular",src:"customFonts/BebasNeueRegular.woff2"},{family:"Bebas Neue Book",src:"customFonts/BebasNeueBook.woff2"},{family:"Bebas Neue Bold",src:"customFonts/BebasNeueBold.woff2"},{family:"Arial",src:"customFonts/ArialMT.woff2"},{family:"Arial Bold",src:"customFonts/Arial-BoldMT.woff2"}]}};function O(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const l=`image/${e}`;return((e,t="application/octet-stream")=>fetch(`data:${t};base64,${e}`).then((e=>e.blob())))(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),l)}const F=o.createElement(g.A,{style:{fontSize:48},spin:!0}),D=({currentImageLink:e,newLink:t,onSave:i,uploadImageResultIsLoading:r})=>{const n=(0,N.p)(),[m,c]=(0,o.useState)(),[u,p]=(0,o.useState)(),{__:g}=(0,b.s9)();let E=(0,a.wA)();const h=(0,a.Pj)(),f=(0,a.d4)(A.C1),v=(0,a.d4)(_.sK),D=(0,a.d4)(S.yN),M=(0,o.useRef)(!1),[V,z]=(0,o.useState)(),H=(0,T.ml)(P.AZ.FILE_PROXY_EVENT_ID);(0,o.useEffect)((()=>{(async()=>{let t;try{const l=await fetch(e);t=await l.blob()}catch{if(t=await H.fire({url:e,project:D}).filter((e=>e instanceof Blob))[0],!t){const l=n.get(B.A9.em_token)||await I.di.getInstance(h,C.Y),o=await fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${l}`}});t=await o.blob()}}if(t){let e=new FileReader;e.onload=()=>{null===V||void 0===V||V.tools.import.openBackgroundImage(m),e.result!==m&&(c(e.result),p(t.type))},e.readAsDataURL(t)}})().catch((e=>{}))}),[e,t,c,n,m,V,H,D,h]);const G=(0,o.useCallback)((()=>{c(null),p(null),E((0,y.BK)()),E((0,_.Os)()),E((0,_.Oo)(B.lx.UPLOAD_IMAGE_MODAL))}),[E]),W=(0,o.useRef)();W.current=async function(e,t,l){const o=await O(l,e);i&&i(new File([o],t,{lastModified:(new Date).getTime(),type:o.type}))};const j=(0,o.useCallback)((e=>{if(e)if(M.current&&V);else{M.current=!0;const e=f.locale?f.locale.replace("_","-"):"ru-RU",t=f.theme===B.IJ?matchMedia(B.F3).matches?B.nd:B.T:f.theme;Promise.all([l.e(3085),l.e(9880)]).then(l.bind(l,85466)).then((({Pixie:l})=>l.init({selector:"#pixie-editor",baseUrl:"https://emailmaker.ru/assets/pixie",image:m,activeLanguage:e,languages:(0,k.g)(e,g),tools:L,ui:{menubar:{replaceDefaultItems:!0,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:o.createElement(w.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:o.createElement(R.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:()=>G()}]},nav:{position:"top"},activeTheme:t,mode:"inline",forceOverlayModeOnMobile:!1},onSave:async function(e,t,l){W.current(e,t,l)}}))).then((e=>{z(e)})).catch((e=>{}))}}),[f.theme,m,V,z,f.locale,g,G]),U=(0,o.useCallback)((()=>{null===V||void 0===V||V.tools.export.save(null===e||void 0===e?void 0:e.split("/").pop().split(".")[0],null===u||void 0===u?void 0:u.split("/")[1])}),[V,e,u]);return o.createElement(d.A,{afterOpenChange:j,width:"100%",style:{maxWidth:"100%",minHeight:"100vh"},className:"image-editor-modal blocks-modal",centered:!0,closable:!1,zIndex:1100,mask:!1,open:v,footer:[o.createElement(x.Ay,{key:"Cancel",className:"em-analytics__profile-cancel",onClick:G},g("Cancel")),o.createElement(x.Ay,{key:"Ok",className:"em-analytics__profile-updapixiete",id:"save",type:"primary",onClick:U},g("Update"))]},r&&o.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},o.createElement(s.A,{size:"large",indicator:F})),o.createElement("div",{id:"pixie-editor"}))},M=o.createElement(g.A,{style:{fontSize:48},spin:!0}),V=({currentImageLink:e,newLink:t,onSave:l,uploadImageResultIsLoading:a})=>o.createElement(o.Fragment,null,o.createElement("div",null,o.createElement("div",{className:"image-preview"},a&&o.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},o.createElement(s.A,{size:"large",indicator:M})),(t||e)&&o.createElement("img",{alt:"uploadedImage",src:t||e}))),o.createElement(D,{currentImageLink:e,newLink:t,onSave:l,uploadImageResultIsLoading:a}));var z=l(201),H=l(66964),G=l(50483),W=l(13785),j=l(94674),U=l(20127),X=l(21867),q=l(80293),$=l(8807);const Y="blocks",K=({setCurrentImageLink:e,setModalHeight:t,setModalWidth:l,setImageStockList:a,imageStockList:i,currentReq:r,setCurrentReq:d,inputRef:c,setStockLink:u,customRequest:p})=>{const[E,h]=(0,o.useState)(!1),[f,A]=(0,o.useState)(2),{__:_}=(0,b.s9)(),[y]=(0,v.Jg)(),[S]=(0,v.h4)();(0,o.useEffect)((()=>{""!==r.keywords&&B()}),[r.color,r.orientation]);const B=async()=>{const e=await S({query:r,page:1});e.data.results.length>0&&(a(e.data.results),setTimeout((()=>{l(1060),t("84vh")}),0))},[k,x]=(0,o.useState)(null);return o.createElement("div",{className:"stock-tab"},o.createElement(n.A,{onValuesChange:B,className:i.length>0?"serach-results":""},o.createElement(z.A,{gutter:24},o.createElement(H.A,{span:i.length>0?"":24},o.createElement(n.A.Item,{className:"stock-search-input"},o.createElement(m.A,{onKeyDown:e=>"Space"===e.code&&B(),onPressEnter:e=>B(),allowClear:!0,size:i.length>0?"medium":"large",placeholder:_("Search image"),value:r.keywords,onChange:e=>d((t=>({...t,keywords:e.target.value}))),ref:c,spellCheck:"false",suffix:o.createElement(q.A,{onClick:B,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})}))),i.length>0&&o.createElement(o.Fragment,null,o.createElement(H.A,null,o.createElement(G.Ay.Group,{defaultValue:"",onChange:e=>d((t=>({...t,orientation:e.target.value})))},o.createElement(W.A,{title:_("All"),placement:"top"},o.createElement(G.Ay.Button,{value:""},o.createElement($.A,{icon:"MixedView"}))),o.createElement(W.A,{title:_("Landscape"),placement:"top"},o.createElement(G.Ay.Button,{value:"landscape"},o.createElement($.A,{icon:"LandscapeView"}))),o.createElement(W.A,{title:_("Portrait"),placement:"top"},o.createElement(G.Ay.Button,{value:"portrait"},o.createElement($.A,{icon:"PortraitView"}))),o.createElement(W.A,{title:_("Squarish"),placement:"top"},o.createElement(G.Ay.Button,{value:"squarish"},o.createElement($.A,{icon:"SquareView"}))))),o.createElement(H.A,null,o.createElement(G.Ay.Group,{defaultValue:"",className:"stock-color-filter",onChange:e=>d((t=>({...t,color:e.target.value})))},o.createElement(W.A,{title:_("All"),placement:"top"},o.createElement(G.Ay.Button,{className:"all-colors",value:""},"All")),o.createElement(W.A,{title:_("Black"),placement:"top"},o.createElement(G.Ay.Button,{className:"black-color",value:"black"},"B")),o.createElement(W.A,{title:_("Black and White"),placement:"top"},o.createElement(G.Ay.Button,{className:"bw-color",value:"black_and_white"},"B&\xa7W")),o.createElement(W.A,{title:_("White"),placement:"top"},o.createElement(G.Ay.Button,{className:"white-color",value:"white"},"W")),o.createElement(W.A,{title:_("Orange"),placement:"top"},o.createElement(G.Ay.Button,{className:"orange-color",value:"orange"},"O")),o.createElement(W.A,{title:_("Red"),placement:"top"},o.createElement(G.Ay.Button,{className:"red-color",value:"red"},"R")),o.createElement(W.A,{title:_("Purple"),placement:"top"},o.createElement(G.Ay.Button,{className:"purple-color",value:"purple"},"P")),o.createElement(W.A,{title:_("Magenta"),placement:"top"},o.createElement(G.Ay.Button,{className:"magenta-color",value:"magenta"},"M")),o.createElement(W.A,{title:_("Green"),placement:"top"},o.createElement(G.Ay.Button,{className:"green-color",value:"green"},"G")),o.createElement(W.A,{title:_("Teal"),placement:"top"},o.createElement(G.Ay.Button,{className:"teal-color",value:"teal"},"T")),o.createElement(W.A,{title:_("Blue"),placement:"top"},o.createElement(G.Ay.Button,{className:"blue-color",value:"blue"},"Blue")))))),i.length>0&&o.createElement("div",{className:"blocks-search__divider-wrapper"},o.createElement("div",{className:"ant-divider ant-divider-horizontal",role:"separator"}))),o.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},i.length>0&&o.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},o.createElement(U.A,{dataLength:i&&i.length,next:async()=>{E||(h(!0),S({query:r,page:f}).then((e=>{a((t=>[...t,...e.data.results])),h(!1),A((e=>e+1))})).catch((()=>{h(!1)})))},hasMore:i,endMessage:o.createElement(j.A,{plain:!0},_("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:null},o.createElement(X.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},i.map((t=>o.createElement("div",{className:"list-item",key:t.id,onClick:()=>{return l=t.urls,o=t.links,a=t.id,y(o.download_location),x(a),setTimeout((()=>x(null)),2e3),u(`${l.raw}&w=1200&q=96`),e(`${l.raw}&w=1200&q=96`),void p(`${l.raw}&w=1200&q=96`);var l,o,a}},o.createElement("img",{className:k===t.id?"loaded-image":"",width:"322px",src:`${t.urls.raw}&w=644&q=96`,alt:t.description,onLoad:e=>e.target.parentNode.classList.add("loaded")}),o.createElement("p",{className:"creator-info",onClick:e=>e.stopPropagation()},"Photo by"," ",o.createElement("a",{target:"_blank",href:`${t.user.links.html}?utm_source=${Y}&utm_medium=referral`,rel:"noreferrer"},t.user.name)," ","on"," ",o.createElement("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${Y}&utm_medium=referral`,rel:"noreferrer"},"Unsplash")),k===t.id&&o.createElement(s.A,{className:"ant-spin",indicator:o.createElement(g.A,{spin:!0})})))))))))};var Q=l(82021),Z=l(35850),J=l(50078),ee=l(36236);const te=({images:e,transitionDuration:t=1e3})=>{const[l,a]=(0,o.useState)([]);return(0,o.useEffect)((()=>{if(e.length>0){const t=e[e.length-1];a((e=>[...e,{src:t,opacity:0}])),setTimeout((()=>{a((e=>e.map(((t,l)=>l===e.length-1?{...t,opacity:1}:t))))}),1e3)}}),[e]),o.createElement("div",{className:"slideshow-container"},l.map(((e,l)=>o.createElement("img",{key:l,src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${l+1}`,className:"slideshow-image",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`}}))))};var le=l(30753),oe=l(27941),ae=l(89613);const ie=(0,o.memo)((({className:e,onClick:t})=>o.createElement("div",{className:`image-ai__arrow image-ai__arrow--next ${e||""}`,onClick:t},o.createElement(x.Ay,{className:"image-ai__arrow-btn image-ai__arrow-btn--next",size:"large",icon:o.createElement(Z.A,{rev:"true"})}))));ie.displayName="SampleNextArrow";const re=(0,o.memo)((({className:e,onClick:t})=>o.createElement("div",{className:`image-ai__arrow image-ai__arrow--prev ${e||""}`,onClick:t},o.createElement(x.Ay,{className:"image-ai__arrow-btn image-ai__arrow-btn--prev",size:"large",icon:o.createElement(J.A,{rev:"true"})}))));re.displayName="SamplePrevArrow";const ne=({setModalHeight:e,customRequest:t,aiTabRef:l,inputAiRef:a,isImageUploaded:i,setIsImageUploaded:r,aiImageRequest:d,setAiImageRequest:s,imageAiList:c,setImageAiList:p,isLoadingAi:h,setIsLoadingAi:f})=>{const{aiImageCounter:A,currentAiImgLimits:_,loadingDuringGeneration:y,requestStatus:S,handleGenerate:k,convertBase64ToFile:w,isShiftPressed:R,setIsShiftPressed:N,limitsInPlugin:I}=function({setModalHeight:e,customRequest:t,aiTabRef:l,isImageUploaded:a,setIsImageUploaded:i,aiImageRequest:r,imageAiList:n,setImageAiList:m,isLoadingAi:d,setIsLoadingAi:s}){const{__:c}=(0,b.s9)(),p=(0,oe.rD)(),g=(0,u.hN)(),h=(0,ae.u)(),{emailId:f,blockId:A,projectId:_}=(0,E.g)(),[y]=(0,v.Mv)(),[S,{data:k=[]}]=(0,v.gg)(),x=(null===p||void 0===p?void 0:p.sendAIImageRequest)||y,w=(null===p||void 0===p?void 0:p.trigger)||S,R=(null===p||void 0===p?void 0:p.handleLimitUsageEmitter)||(0,T.ml)(P.AZ.ON_LIMIT_ID),[N,I]=(0,o.useState)(0),[C,L]=(0,o.useState)(null),[O,F]=(0,o.useState)(!1),[D,M]=(0,o.useState)(c("Evaluating the task")),[V,z]=(0,o.useState)(!1),H=f||A,{limits:G}=null!==p&&void 0!==p&&p.limits?p:{limits:{ai_img_limit:0}},{ai_img_limit:W}=G,j=W>0&&N>=W,U=!(!p.limits||!p.counters)&&B.EW.isPlugin,X=(0,o.useCallback)((()=>{R.fire({name:"AiImgCount",count:N+1})}),[R,N]),q=(0,o.useMemo)((()=>!j&&(!U||0===W||N<W)),[j,U,N,W]),$=(0,o.useCallback)((async()=>{M(c("Evaluating the task")),""===r||d||(s(!0),z(!0),m([]),h({event:"submit_form",action:"ai_image_generation",entity_id:f,project_id:_}),x({body:{project_id:_,request:"create-image",connection:"midjourney",message:r}}).then((({data:e,error:t})=>{if(t)throw t;if(401===e.data.status)throw new Error(B.ff);200===(null===e||void 0===e?void 0:e.data.status)?(null!==e&&void 0!==e&&e.data.task.id&&(M(e.data.task.message),L(e.data.task.id)),e.message&&g.success({id:"AI_IMAGE_SEND_SUCCESS",message:e.message,placement:"bottomRight",data:r}),w({task_id:null===e||void 0===e?void 0:e.data.task.id,entity_id:H})):(s(!1),z(!1),g.error({id:"AI_IMAGE_SEND_ERROR",message:(null===e||void 0===e?void 0:e.message)||c("Something went wrong, please try again"),placement:"bottomRight",data:r,innerException:e}))})).catch((e=>{s(!1),z(!1),(null!==e&&void 0!==e&&e.error||null!==e&&void 0!==e&&e.data)&&g.fromError("AI_IMAGE_SEND_ERROR",r,e.error||e)})))}),[r,d,s,z,m,h,f,_,x,g,w,H,c]),Y=(0,o.useCallback)((()=>{q?(U&&(I((e=>e+1)),X()),$()):U&&g.error({message:c("The usage limit has been exceeded"),description:c("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[q,U,I,X,$,g,c]);(0,o.useEffect)((()=>{var e;U&&I((null===p||void 0===p||null===(e=p.counters)||void 0===e?void 0:e.ai_img_counter)||0)}),[p,U]);const K=(0,o.useCallback)((e=>{if(!a){i(!0);const l=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!l)return;const o=l[1],a=l[2],r=atob(a),n=new Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);const m=new Uint8Array(n),d=new Blob([m],{type:`image/${o}`}),s=new File([d],"image.jpeg",{type:d.type});t({file:s})}}),[a,i,t]),Q=(0,o.useCallback)((e=>{"error"!==e.status&&"Canceled"!==e.status?e.images?(M(e.status),100===e.progress&&(m(e.images),M(c("Evaluating the task")),L(null),z(!1))):(m([e.data]),s(!1)):(s(!1),z(!1),g.error({id:"AI_IMAGE_GET_ERROR",message:c("Something went wrong, please try again"),placement:"bottomRight",data:C}))}),[m,M,c,s,e,C,g,z]);return(0,o.useEffect)((()=>{k.length>1&&Q(k[k.length-1])}),[k,Q]),(0,o.useEffect)((()=>{(d||n.length>0)&&setTimeout((()=>{let t=550;l.current&&(t=l.current.offsetHeight+68),e(t)}),0)}),[l,k,n.length,d,e]),{aiImageCounter:N,setAiImageCounter:I,currentAiImgLimits:W,isFieldsDisabled:j,canGenerateImage:q,aiImageRequest:r,imageAiList:n,setImageAiList:m,isLoadingAi:d,setIsLoadingAi:s,loadingDuringGeneration:V,setLoadingDuringGeneration:z,requestStatus:D,setRequestStatus:M,handleGenerate:Y,handleLimitAiImgCount:X,convertBase64ToFile:K,isShiftPressed:O,setIsShiftPressed:F,currentReqId:C,setCurrentReqId:L,limitsInPlugin:U}}({setModalHeight:e,customRequest:t,aiTabRef:l,isImageUploaded:i,setIsImageUploaded:r,aiImageRequest:d,imageAiList:c,setImageAiList:p,isLoadingAi:h,setIsLoadingAi:f}),[C,L]=(0,o.useState)(!1),O=(0,o.useCallback)((()=>L(!0)),[]),F=(0,o.useCallback)((()=>L(!1)),[]),D=(0,o.useCallback)((e=>s(e.target.value)),[s]),M=(0,o.useCallback)((e=>{"Shift"===e.key?N(!0):"Enter"!==e.key||R||(e.preventDefault(),k())}),[R,k,N]),V=(0,o.useCallback)((e=>{"Shift"===e.key&&N(!1)}),[N]);return o.createElement("div",{className:"image-ai"},I&&o.createElement(le.A,{text:"images",counter:A,limits:_,wrapperStyles:{marginTop:-25}}),o.createElement(z.A,{gutter:24,className:"image-ai__row"},o.createElement(H.A,{span:24},o.createElement(n.A.Item,{style:{margin:0}},o.createElement("span",{className:"ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper"+(C?" ant-input-affix-wrapper-focused":"")},o.createElement(m.A.TextArea,{ref:a,onKeyDown:M,onKeyUp:V,onFocus:O,onBlur:F,autoSize:!0,allowClear:!0,className:"text-area-input-hybrid image-ai__textarea",placeholder:"Generate image",value:d,onChange:D,spellCheck:"false"}),o.createElement("span",{className:"ant-input-suffix image-ai__input-suffix"},h||y?o.createElement(g.A,{className:"input-icon image-ai__input-icon",spin:!0,rev:null}):o.createElement($.A,{icon:"AI",className:"input-icon image-ai__input-icon",onClick:k})))))),(h||c.length>0)&&o.createElement(Q.A,{dotPosition:"top",arrows:!0,nextArrow:o.createElement(ie,null),prevArrow:o.createElement(re,null),className:"image-ai__carousel"},h&&o.createElement("div",{className:"image-ai__loading"},o.createElement("div",{className:"spin"},o.createElement(g.A,{style:{fontSize:48},spin:!0,rev:"true"}),o.createElement("p",{className:"status"},S))),c.length>0&&c.map(((e,t)=>o.createElement("div",{key:t,className:"image-ai__image-item"},o.createElement(te,{images:c}),o.createElement("div",{className:"buttons"},c.length>0&&o.createElement(x.Ay,{onClick:()=>w(`data:image/jpeg;base64, ${e}`),icon:o.createElement(ee.A,{rev:"true"})},"Use this variant")))))))};var me=l(42811);const de=({setNewLink:e,setCurrentImageLink:t,setModalHeight:l,setModalWidth:a,setImageGifList:i,imageGifList:r,currentReqGif:d,setCurrentReqGif:c,inputRef:u,setStockLink:p,customRequest:E})=>{const{__:h}=(0,b.s9)(),[f,A]=(0,o.useState)(null),[_,y]=(0,o.useState)(!1),[S,B]=(0,o.useState)(25),[k]=(0,v.eo)(),x=async()=>{var e,t;const o=await k({query:d,page:0});(null===o||void 0===o||null===(e=o.data)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.length)>0&&(i(o.data.data),setTimeout((()=>{l("84vh"),a(1060)}),0))},w=o.createElement(g.A,{style:{fontSize:20},spin:!0});return o.createElement("div",{className:"stock-tab"},o.createElement(n.A,{onValuesChange:x,className:r.length>0?"serach-results":""},o.createElement(z.A,{gutter:24},o.createElement(H.A,{span:r.length>0?"":24},o.createElement(n.A.Item,{className:"stock-search-input"},o.createElement(m.A,{onKeyDown:e=>"Space"===e.code&&x(),onPressEnter:e=>x(),allowClear:!0,size:r.length>0?"medium":"large",placeholder:h("Search GIFs"),value:d.keywords,onChange:e=>c((t=>({...t,keywords:e.target.value}))),ref:u,spellCheck:"false",suffix:o.createElement(q.A,{onClick:x,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})))),r.length>0&&o.createElement("div",{className:"blocks-search__divider-wrapper"},o.createElement("div",{className:"ant-divider ant-divider-horizontal blocks-search__divider",role:"separator"}))),o.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},r.length>0&&o.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},o.createElement(U.A,{dataLength:r&&r.length,next:async()=>{_||(y(!0),k({query:d,page:S}).then((e=>{i((t=>[...t,...e.data.data])),y(!1),B((e=>e+25))})).catch((()=>{y(!1)})))},hasMore:r,endMessage:o.createElement(j.A,{plain:!0},h("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:o.createElement(s.A,{indicator:w})},o.createElement(X.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},r.map(((e,l)=>o.createElement("div",{className:"list-item",key:e.id+l,onClick:()=>{return l=e.images.downsized.url,o=e.id,A(o),setTimeout((()=>{A(null)}),2e3),p(`${l}`),t(`${l}`),void E(`${l}`);var l,o}},o.createElement("img",{className:f===e.id?"loaded-image":"",width:"322px",src:`${e.images.downsized.url}`,alt:e.title,onLoad:e=>e.target.parentNode.classList.add("loaded")}),o.createElement("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()},o.createElement("div",{className:"overlay-image",style:{backgroundImage:`url(${me})`}})),f===e.id&&o.createElement(s.A,{className:"ant-spin",indicator:o.createElement(g.A,{spin:!0})})))))))))};var se=l(48956),ce=l(40277);const ue="IMG",pe="BACKGROUND",ge="EDITOR",be="UPLOAD",Ee="STOCK",he="GIF",fe="AI",{Dragger:ve}=i.A,Ae=()=>{var e,t;const l=(0,oe.rD)(),{__:i}=(0,b.s9)(),k=(0,a.wA)(),{projectId:x}=(0,E.g)(),[w,R]=(0,f.dS)(),[N]=(0,v.FQ)(),{modal:I}=r.A.useApp(),C=(0,u.hN)(),L=(0,a.d4)(A.B$),O=(0,a.d4)(A.C1),F=(0,a.d4)(_.cL),D=(0,a.d4)(y.js),M=(0,a.d4)(y.Ac),[z,H]=(0,o.useState)(""),[G,W]=(0,o.useState)(""),[j,U]=(0,o.useState)(""),[X,q]=(0,o.useState)(""),[$,Y]=(0,o.useState)(be),[Q,Z]=(0,o.useState)({width:"",height:"",size:"",format:""}),[J,ee]=(0,o.useState)("success"),[te,le]=(0,o.useState)(!1),ae=o.useRef(null),ie=o.useRef(null),re=o.useRef(null),me=o.useRef(null),Ae=o.useRef(null),_e=o.useRef(null),ye=o.useRef(null),Se=o.useRef(null),Be=o.useRef(null),[ke,xe]=(0,o.useState)("auto"),[we,Re]=(0,o.useState)(572),[Ne,Te]=(0,o.useState)(null),[Ie,Pe]=(0,o.useState)(!1),[Ce,Le]=(0,o.useState)({keywords:"",color:"",orientation:""}),[Oe,Fe]=(0,o.useState)({keywords:""}),[De,Me]=(0,o.useState)([]),[Ve,ze]=(0,o.useState)([]),[He,Ge]=(0,o.useState)([]),[We,je]=(0,o.useState)(!1),[Ue,Xe]=(0,o.useState)(""),[qe,$e]=(0,o.useState)(!1),[Ye,Ke]=(0,o.useState)(0),Qe=(0,a.d4)(S.yN),Ze=(0,T.ml)(P.AZ.FILE_PROXY_EVENT_ID);let Je=!(L||(null===(e=O.id)||void 0===e?void 0:e.toString())!==(null===Qe||void 0===Qe||null===(t=Qe.members)||void 0===t?void 0:t.owner.ID))&&!0;const et=async e=>{if(e)try{const t=await tt(e);ot({url:e}),t&&at(t)&&it({file:t})}catch(t){}},tt=async e=>{try{const t=(await Ze.fire({url:e,project:Qe})).filter((e=>e instanceof Blob))[0];if(t)return t;const l=`https://api.emailmaker.ru/tools/file-proxy.php?url=${encodeURIComponent(e)}`,o=await fetch(l);if(!o.ok)throw new Error(`Server returned ${o.status}`);const a=await o.blob();return new File([a],e.split("/").pop(),{type:a.type})}catch(t){}};document.onpaste=function(e){const t=e.clipboardData.items[0];if($===be&&X){if(0===t.type.indexOf("image")){const e=t.getAsFile();at(e);const l={file:e};W(""),it(l)}0===t.type.indexOf("text")&&t.getAsString((e=>{"http"===e.slice(0,4)?(W(""),H(e),ot({url:e})):"meta"===e.toString().slice(1,5)&&(W(""),H(e.toString().split('"')[1]),ot({url:e.toString().split('"')[1]}))}))}};const lt=(0,o.useMemo)((()=>({IMG:D,BACKGROUND:M})),[D,M]);(0,o.useEffect)((()=>{const e=e=>{let t=null;F.includes("UPLOAD_BACKGROUND_MODAL")?(t=pe,q(pe)):F.includes("UPLOAD_IMAGE_MODAL")&&(q(ue),t=ue),lt[t]&&(H(lt[t]),Y(e))};F===B.lx.UPLOAD_IMAGE_MODAL||F===B.lx.UPLOAD_BACKGROUND_MODAL?e(ge):F===B.lx.UPLOAD_IMAGE_MODAL_AI||F===B.lx.UPLOAD_BACKGROUND_MODAL_AI?(Je?($e(!0),Ke(2)):e(fe),setTimeout((()=>{var e;return null===(e=Be.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===B.lx.UPLOAD_IMAGE_MODAL_UPLOAD||F===B.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD?(e(be),setTimeout((()=>{var e;return null===(e=_e.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===B.lx.UPLOAD_IMAGE_MODAL_STOCK||F===B.lx.UPLOAD_BACKGROUND_MODAL_STOCK?(Je?($e(!0),Ke(3)):e(Ee),setTimeout((()=>{var e;return null===(e=Se.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===B.lx.UPLOAD_IMAGE_MODAL_GIF||F===B.lx.UPLOAD_BACKGROUND_MODAL_GIF?(Je?($e(!0),Ke(3)):e(he),setTimeout((()=>{var e;return null===(e=ye.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===B.lx.UPLOAD_IMAGE_MODAL_EDIT||F===B.lx.UPLOAD_BACKGROUND_MODAL_EDIT?(Je?($e(!0),Ke(5)):e(ge),k((0,_.Wz)(B.lx.IMAGE_EDITOR_MODAL))):q("")}),[F,k,Je,lt]);const ot=(0,o.useCallback)((({url:e=z||""})=>{H(e),X===ue&&k((0,y.tm)(e)),X===pe&&k((0,y.e_)(e)),setTimeout((()=>{Le({keywords:"",color:"",orientation:""}),Fe({keywords:""}),ze([]),Me([]),q(""),Xe(""),je(!1),U(""),W(""),Y(be)}),200),k((0,_.Oo)()),k((0,_.Os)())}),[z,k,X]);(0,o.useEffect)((()=>{const e=G||j;e?(0,ce.DI)(e).then((t=>{ee(t),Re(572),setTimeout((()=>{let e=0;ie.current&&(e=ie.current.offsetHeight+62),xe(e)}),0),ot(e)})).catch((e=>{ee(e)})):ee("")}),[G,j,ot]),(0,o.useEffect)((()=>{z&&N(z).then((({data:e})=>{Z({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(2),format:null===e||void 0===e?void 0:e.format})}))}),[z,N]);(0,o.useEffect)((()=>{var e;""===Ce.keywords&&(null===_e||void 0===_e||null===(e=_e.current)||void 0===e||e.focus({cursor:"start"}),ze([]),setTimeout((()=>{xe("auto"),Re(572)}),0))}),[Ce,ze,xe,Re]);const at=e=>{const t="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type||"image/webp"===e.type||"image/gif"===e.type||"image/svg+xml"===e.type;return t||C.error({id:"IMAGE_UPLOAD_WRONG_FORMAT",data:e,message:"Upload",description:"You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!",placement:"bottomRight"}),t},it=({file:e})=>{const t="image/svg+xml"===e.type,a="image/webp"===e.type,r=e=>{const t=new Image;t.src=URL.createObjectURL(e),t.onload=()=>{(async e=>{Pe(!0);const t=e.file;try{"image/gif"!==t.type&&(e.file=await(0,h.A)(t,{maxSizeMB:l.compressMaxSize||.45,maxWidthOrHeight:l.compressMaxWidthOrHeight||2e3})),w(e).then((({error:e,data:l})=>{var a;if(e)C.fromError("IMAGE_UPLOAD_ERROR",t,e);else if(400===(null===l||void 0===l||null===(a=l.data)||void 0===a?void 0:a.status))C.error({id:"IMAGE_UPLOAD_ERROR",data:t,innerException:null===l||void 0===l?void 0:l.data,message:o.createElement("div",{dangerouslySetInnerHTML:{__html:l.code}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:l.message}}),placement:"bottomRight"});else{var r;const e=null===l||void 0===l||null===(r=l[0])||void 0===r?void 0:r.file_url;e&&(xe("auto"),le(!1),ot({url:e})),C.success({id:"IMAGE_UPLOAD_SUCCESS",data:t,message:i("The image was successfully uploaded.")})}})).catch((e=>{})).finally((()=>{Pe(!1)}))}catch(a){Pe(!1)}})({user_id:O.id,folder:x,file:e})}};t?((e,t)=>{const l=new FileReader;l.onload=function(l){const o=l.target.result,a=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(a),r=new Image;r.onload=function(){const l=document.createElement("canvas");l.width=2*r.width,l.height=2*r.height,l.getContext("2d").drawImage(r,0,0,l.width,l.height),l.toBlob((l=>{const o=new File([l],e.name.replace(".svg",".png"),{type:"image/png"});t(o),URL.revokeObjectURL(i)}),"image/png")},r.src=i},l.readAsText(e)})(e,(e=>r(e))):a?((e,t,l=90)=>{const o=new Image;o.src=URL.createObjectURL(e),o.onload=()=>{const e=document.createElement("canvas");e.width=o.width,e.height=o.height;const a=e.getContext("2d");a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(o,0,0,e.width,e.height),e.toBlob((e=>{const l=new File([e],"converted.jpg",{type:"image/jpeg"});t(l)}),"image/jpeg",l/100)},o.onerror=e=>{t(null)}})(e,(e=>r(e))):r(e)},rt=e=>it({file:e});let nt=[{label:i("Upload"),key:be,children:o.createElement("div",{ref:ae,style:{paddingBottom:24}},o.createElement(ve,{showUploadList:!1,name:"Image",beforeUpload:at,customRequest:it,style:{marginBottom:10},multiple:!1,accept:"image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml"},o.createElement("p",{className:"ant-upload-drag-icon"},o.createElement(p.A,null)),o.createElement("p",{className:"ant-upload-text"},i("Click to select, paste from the clipboard, or drag and drop")),o.createElement("p",{className:"ant-upload-hint"},i("Accepted formats: PNG, JPG, WEBP, SVG or GIF."))),o.createElement(n.A,{style:{padding:"0 2px 0 2px"}},o.createElement(n.A.Item,{validateStatus:J},o.createElement(m.A,{ref:_e,allowClear:!0,size:"large",placeholder:i("Paste image URL here"),value:G,onChange:e=>{const t=e.target.value;W(t),Ne&&clearTimeout(Ne);const l=setTimeout((()=>et(t)),1e3);Te(l)},spellCheck:"false"}))))}];l.imageCenterStockEnabled&&!Je&&nt.push({label:i("Stock"),key:Ee,children:o.createElement("div",{ref:re,style:{paddingBottom:24}},o.createElement(K,{currentReq:Ce,setCurrentReq:Le,imageStockList:Ve,setImageStockList:ze,setModalWidth:Re,setModalHeight:xe,setStockLink:U,setCurrentImageLink:H,inputRef:Se,customRequest:et}))}),l.imageCenterGifEnabled&&!Je&&nt.push({label:i("GIF"),key:he,children:o.createElement("div",{ref:me,style:{paddingBottom:24}},o.createElement(de,{currentReqGif:Oe,setCurrentReqGif:Fe,imageGifList:De,setImageGifList:Me,setModalWidth:Re,setModalHeight:xe,setStockLink:U,setCurrentImageLink:H,inputRef:ye,customRequest:et}))}),l.elementAIimageEnabled&&!Je&&nt.push({label:i("AI"),key:fe,children:o.createElement("div",{ref:Ae,style:{paddingBottom:24}},o.createElement(ne,{setModalHeight:xe,customRequest:it,aiImageRequest:Ue,setAiImageRequest:Xe,imageAiList:He,setImageAiList:Ge,isLoadingAi:We,setIsLoadingAi:je,aiTabRef:Ae,inputAiRef:Be,isImageUploaded:te,setIsImageUploaded:le}))}),l.imageCenterEditorEnabled&&nt.push({label:"",key:ge,children:o.createElement("div",{ref:ie},o.createElement(V,{currentImageLink:z,newLink:G,imageSize:Q,onSave:rt,uploadImageResultIsLoading:R.isLoading||!1}))});const mt=o.createElement(g.A,{style:{fontSize:32,margin:-16},spin:!0});return o.createElement(o.Fragment,null,o.createElement(d.A,{width:we,className:"image-center blocks-modal",title:i("Image Center"),centered:!0,style:{minHeight:390},open:!!X,onOk:ot,onCancel:()=>{k((0,_.Oo)()),setTimeout((()=>{H(""),W(""),ze([]),ze([]),Le({keywords:"",color:"",orientation:""}),Fe({keywords:""}),xe("auto"),!We&&Xe(""),Re(572),Y(be)}),200)},footer:$===ge?o.createElement(o.Fragment,null):null},o.createElement(s.A,{spinning:Ie,indicator:mt},o.createElement(c.A,{activeKey:$,onChange:e=>{"GALLERY"===e?I.success({maskClosable:!0,centered:!0,title:i("Coming soon"),content:i("The feature is under development."),okText:i("Ok. I'll be waiting"),onOk:()=>{}}):e===ge&&""===z?I.warning({maskClosable:!0,centered:!0,title:i(""),content:i("To preview and edit the uploaded image"),okText:i("Upload Image"),onOk:()=>{Y(be)}}):(setTimeout((()=>{let t=0,l=0;var o;if(e===be&&ae.current)""===Ce.keywords&&(null===(o=_e.current)||void 0===o||o.focus({cursor:"start"})),t=300,l=572;else if(e===ge&&ie.current)t=ie.current.offsetHeight+62,l=572;else if(e===Ee&&re.current){var a;""===Ce.keywords&&(null===(a=Se.current)||void 0===a||a.focus({cursor:"start"})),t=130,l=572,Ve.length>0&&(l=1060,t="84vh")}else if(e===he&&me.current){var i;""===Ce.keywords&&(null===(i=ye.current)||void 0===i||i.focus({cursor:"start"})),t=130,l=572,De.length>0&&(l=1060,t="84vh")}else if(e===fe&&Ae.current){var r;if(""===Ue&&0===He.length)null===(r=Be.current)||void 0===r||r.focus({cursor:"start"}),t=130;else t=Ae.current.offsetHeight+82;l=572}xe(t),Re(l)}),0),Y(e))},items:nt,style:{height:ke,minHeight:130}}))),o.createElement(se.A,{open:qe,onCancel:()=>$e(!1),initialSlide:Ye}))}},25911:(e,t,l)=>{l.d(t,{A:()=>re});var o=l(98173),a=l(30150),i=l(47555),r=l(40120),n=l(64909),m=l(86406),d=l(77073),s=l(91321),c=l(2604),u=l(26298),p=l.n(u),g=l(37969),b=l(93771),E=l(79245),h=l(12543),f=l(16238),v=l(76428),A=l(58316),_=l(87690),y=l(62296),S=l(1549),B=l(95331),k=l(10267),x=l(6311),w=l(70178),R=l(51070),N=l(85758),T=l(27352),I=l(23424),P=l(84572),C=l(47014),L=l(78915),O=l(40277),F=l(96734),D=l(32947);const M=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:l})=>{var i;const{__:r}=(0,h.s9)();let n=(0,c.wA)(),m=(0,a.Zp)();const{projectId:d}=(0,a.g)(),{pathname:s}=(0,a.zy)(),[u,M]=(0,o.useState)(""),V=(0,c.d4)(P.yN),z=(0,c.d4)(C.C1),H=(0,F.p)(),G=(0,o.useCallback)((()=>{s.includes("blocks")?M("Blocks"):s.includes("emails")?M("Emails"):s.includes("members")&&M("Members"),!l&&t(!0)}),[s,t,l]);(0,o.useEffect)((()=>{G()}),[G]);let W=[],j=[];const U=(null===V||void 0===V?void 0:V.title)||"";let X=[{label:o.createElement("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer"},r("Help")),key:"Help center",icon:o.createElement(f.A,{style:{fontSize:"16px"}}),className:"help-center"},{label:r("Chat support"),key:"Support chat",icon:o.createElement(v.A,{style:{fontSize:"16px"}}),className:"open-support-chat",onClick:()=>{try{window.carrotquest.open()}catch(e){}}}],q=[{label:r("Account settings"),key:"Account settings",icon:o.createElement(A.A,{style:{fontSize:"16px"}}),className:"em-analytics__account-settings",onClick:()=>{n((0,I.qf)(D.lx.EDIT_PROFILE_MODAL)),!l&&t(!0)}},{label:o.createElement(E.N_,{to:"/billing"},r("Billing")),key:"Billing",icon:o.createElement(_.A,{style:{fontSize:"16px"}}),className:"em-analytics__billing"},{label:r("Sign out"),icon:o.createElement(y.A,{style:{fontSize:"16px"}}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{(0,O.Id)(H),n(L.Q2.util.resetApiState()),m("/auth",{replace:!0})}}];const $="/projects"+(d?"/"+d+"/emails?page=1":""),Y=[{label:o.createElement(E.N_,{style:{fontSize:16},to:$},U),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:d?o.createElement(E.N_,{to:$,className:"project-menu__block",style:{fontSize:"18px",zIndex:99}},o.createElement(g.Ay,{type:"primary",className:"project-menu__block-button"},null===U||void 0===U?void 0:U.split(" ").slice(0,2).map((e=>Array.from(e)[0])))):o.createElement(E.N_,{to:$,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"28px"}},o.createElement("b",null,o.createElement("span",{className:"letters"},"E"),(!e||l)&&o.createElement("span",{className:"hidden-text"},"mail")),o.createElement("span",{className:"letters"},"M"),(!e||l)&&o.createElement("span",{className:"hidden-text"},"aker")),className:p()("project-menu__list-item project-menu__list-item_project project-menu__list-item_project",{"project-menu__list-item_logo":!d,"project-menu__list-item_project":d}),children:d&&[{label:r("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:o.createElement(S.A,{style:{fontSize:"16px"}}),onClick:()=>{n((0,I.qf)(D.lx.EDIT_PROJECT_MODAL)),!l&&t(!0)}},{label:o.createElement(E.N_,{to:"/projects"},r("List of projects")),key:"List of projects",icon:o.createElement(B.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}]},{type:"divider"}];return W.push({icon:o.createElement(k.A,{style:{fontSize:20}}),label:o.createElement(E.N_,{to:`/projects/${d}/emails`,rel:"noopener noreferrer"},r("Emails")),key:"Emails",className:"project-menu__list-item em-analytics__project-menu-emails"},{icon:o.createElement(x.A,{style:{fontSize:20}}),label:o.createElement(E.N_,{to:`/projects/${d}/blocks`,rel:"noopener noreferrer"},r("Blocks")),key:"Blocks",className:"project-menu__list-item em-analytics__project-menu-blocks"},{icon:o.createElement(w.A,{style:{fontSize:20}}),label:o.createElement(E.N_,{to:`/projects/${d}/members`,rel:"noopener noreferrer"},r("Members")),key:"Members",className:"project-menu__list-item em-analytics__project-menu-members"}),"community"===z.subscription.post_name&&d&&z.counters.emails_counter>2&&j.push({icon:o.createElement(R.A,{style:{fontSize:20,lineHeight:"44px"}}),label:o.createElement(E.N_,{to:"/billing",rel:"noopener noreferrer",style:{fontSize:16,color:"white"}},r("Upgrade")),key:"Emails",className:"project-menu__list-item"}),j.push({icon:o.createElement(N.A,{style:{fontSize:18}}),label:r("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:X},{icon:o.createElement(T.A,{style:{fontSize:18}}),label:r("What's new"),key:"What's new",className:"project-menu__list-item ducalis-changelog-widget em-analytics__project-menu-ducalis"},{icon:o.createElement("span",{style:{width:"20px",height:"20px",fontSize:"20px"},className:"user-profile__avatar anticon"},null!==z&&void 0!==z&&null!==(i=z.avatar_urls)&&void 0!==i&&i[24]?[o.createElement("img",{style:{width:"100%"},key:"img",src:null===z||void 0===z?void 0:z.avatar_urls[24],alt:null!==z&&void 0!==z&&z.name?`${null===z||void 0===z?void 0:z.name} avatar`:"User avatar",className:"user-profile__avatar-img"}),o.createElement(A.A,{key:"UserOutlined",style:{position:"absolute",fontSize:20,borderRadius:100,overflow:"hidden",height:20,width:20,lineHeight:0,zIndex:-1}})]:o.createElement(A.A,{style:{color:"white"}})),label:(null===z||void 0===z?void 0:z.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:q}),o.createElement(o.Fragment,null,o.createElement("div",{className:"project-menu"},o.createElement("div",null,o.createElement(b.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:Y,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),d&&o.createElement(b.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[u],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:W,triggerSubMenuAction:"hover"})),o.createElement(b.A,{disabledOverflow:!0,selectable:!0,selectedKeys:["Emails"],forceSubMenuRender:"true",className:"project-menu__list project-menu__list_bottom",style:{fontSize:14,marginBottom:6},subMenuOpenDelay:.3,subMenuCloseDelay:.6,items:j,triggerSubMenuAction:"hover"})))};var V=l(63837),z=l(99460),H=l(62913),G=l(13785),W=l(8807),j=l(1047),U=l(39420),X=l(52919);const q=()=>{var e;const{__:t}=(0,h.s9)(),l=(0,c.wA)(),[a]=(0,L.b9)(),[i,r]=(0,o.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(D.V0.em_color_scheme)),n=(0,X.XW)(),m=(0,o.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,U.Hk)(e),null===e){const e=matchMedia(D.F3).matches?D.nd:D.T;localStorage.removeItem(D.V0.em_color_scheme),t=e}else localStorage.setItem(D.V0.em_color_scheme,e),t=e;l((0,j.eX)(t===D.nd?`vs-${t}`:D.T)),(0,U.A5)(t),n({operation:D.Ru.UPDATE_PREVIEW,theme:t}),a({theme:e})})(t),r(t)}),[l,a,n]);return(0,o.useEffect)((()=>{matchMedia(D.F3).onchange=()=>m()}),[m]),o.createElement("div",{onClick:e=>e.stopPropagation()},o.createElement(H.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:i,options:[{label:o.createElement(G.A,{title:t("Light theme")},o.createElement(W.A,{icon:"LightMode",style:{fontSize:18}})),value:D.T},{label:o.createElement(G.A,{title:t("System theme")},o.createElement(W.A,{icon:"AutoMode",style:{fontSize:18}})),value:null},{label:o.createElement(G.A,{title:t("Dark theme")},o.createElement(W.A,{icon:"DarkMode",style:{fontSize:18}})),value:D.nd}],onChange:e=>m(e)}))};var $=l(705),Y=l(22536),K=l(49982),Q=l(69201),Z=l(62347),J=l(86095),ee=l(90121),te=l(27941),le=l(89613),oe=l(13668);const{Sider:ae}=i.A,{useToken:ie}=r.A,re=()=>{const{token:e}=ie();let t=(0,a.zy)();const l=(0,c.wA)(),r=(0,a.Zp)(),{emailId:u,blockId:g}=(0,a.g)(),b=(0,c.d4)(C.C1),E=(0,c.d4)(I.cL),h=(0,o.useRef)(),f=(0,le.u)(),[v]=((0,te.rD)(),(0,$.bw)()),A=(0,n.hN)();h.current||(h.current=(0,J.$Z)()),(0,o.useEffect)((()=>{(0,U.FN)(e)}),[e]);const{data:_=[],isSuccess:y}=(0,$.I9)(b.id,{pollingInterval:3e4,skip:E});(0,o.useEffect)((()=>{const e=_.filter((e=>""===e.seen||null===e.seen));setTimeout((()=>{e.length&&y&&e.forEach((e=>{var t,l;"subscription_payment"===e.event&&f({event:"payment",data:e.data}),A[e.type]({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(t=e.title)||void 0===t?void 0:t.rendered)||e.title||""}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(l=e.content)||void 0===l?void 0:l.rendered)||""}}),placement:"bottomRight"});const a=(new Date).toLocaleString();v({id:e.id,datetime:a}).unwrap()}))}),5e3)}),[y,v,_,A]),(0,K.A)(),(0,Q.A)(),(0,Z.A)(),(0,o.useEffect)((()=>{g||l((0,Y.nJ)()),u||l((0,j.ss)())}),[g,u,l,t.pathname]);let S=null;u||g||t.pathname.endsWith("/new")?S=h.current:h.current&&h.current.getValue()&&setTimeout((()=>h.current.setValue("")),1e3);const B=JSON.parse(localStorage.getItem(D.V0.em_menu_is_locked)),[k,x]=(0,o.useState)((null===B||void 0===B?void 0:B.isLocked)||!1),[w,R]=(0,o.useState)(!0);return(0,o.useEffect)((()=>{const e=()=>localStorage.setItem(D.V0.em_menu_is_locked,JSON.stringify({isLocked:k}));return e(),e()}),[k]),(0,ee.D3)(oe._1,(0,o.useCallback)((e=>{const t=(0,te.Mu)(e);r(t)}),[r])),o.createElement("div",{className:"main"},o.createElement(J.kx.Provider,{value:S},o.createElement("div",{className:"main__pane main__pane_main"},o.createElement("div",{className:"main__pane-content",id:"pane-content-iframe"},o.createElement(i.A,{className:"main__pane-layout",hasSider:!0},!D.EW.isPlugin&&o.createElement(ae,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed",overflow:window.innerWidth>1400?"hidden":""},collapsible:!0,collapsed:!k&&w,defaultCollapsed:!0,reverseArrow:!k&&!w||k&&!w,trigger:o.createElement("div",{className:"main__pane-trigger"},k?o.createElement(s.A,{style:{fontSize:window.innerWidth>1400?18:13}}):o.createElement(o.Fragment,null,o.createElement(m.A,{style:{fontSize:window.innerWidth>1400?18:13}}),o.createElement(d.A,{style:{fontSize:window.innerWidth>1400?18:13}})),o.createElement(q,null)),className:p()("main__menu",{main__menu_lock:k}),width:260,collapsedWidth:window.innerWidth>1400?80:0,zeroWidthTriggerStyle:{},onCollapse:(e,t)=>{e?!k&&R(!0):R(!e),x(!k)},onMouseEnter:()=>!k&&R(!1),onMouseLeave:()=>!k&&R(!0)},o.createElement(M,{isMenuCollapsed:w,setIsMenuCollapsed:R,isLocked:k})),o.createElement(V.A,{isModalVisible:E===D.lx.EDIT_PROJECT_MODAL}),o.createElement(z.A,{isModalVisible:E===D.lx.EDIT_PROFILE_MODAL}),o.createElement(a.sv,null))))))}},48956:(e,t,l)=>{l.d(t,{A:()=>c});var o=l(98173),a=l(48753),i=l(82021),r=l(37969),n=l(12543),m=l(30150),d=l(89613),s=l(98173);const c=({open:e,sideOnOk:t,onCancel:l,initialSlide:c=0})=>{const{__:u}=(0,n.s9)(),p=(0,m.Zp)(),[g,b]=(0,o.useState)(c),E=(0,o.useRef)(null),h=(0,d.u)();(0,o.useEffect)((()=>{e&&E.current&&(E.current.goTo(c,!0),b(c))}),[e,c]);const f=(0,o.useMemo)((()=>[{image:u("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--blue-2)",title:u("More editing features"),description:u("Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png"),backgroundColor:"var(--purple-2)",title:u("Work with the HTML code"),description:u("Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions \u2014 you can create templates of any complexity!")},{image:u("https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png"),backgroundColor:"var(--cyan-2)",title:u("AI image generation"),description:u("Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.")},{image:u("https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png"),backgroundColor:"var(--green-2)",title:u("Stock photos and GIFs"),description:u("Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_NDYloAO.png"),backgroundColor:"var(--magenta-2)",title:u("Version history"),description:u("Check who and when made changes to the email template and, if necessary, restore one of the previous versions.")},{image:u("https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png"),backgroundColor:"var(--red-2)",title:u("Image editor"),description:u("Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.")},{image:u("https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png"),backgroundColor:"var(--orange-2)",title:u("Email optimization"),description:u("Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.")},{image:u("https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png"),backgroundColor:"var(--volcano-2)",title:u("Team collaboration"),description:u("Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.")},{image:u("https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png"),backgroundColor:"var(--geekblue-2)",title:u("Email testing"),description:u("Check how your email appears across various devices and email clients.")},{image:u("https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"),backgroundColor:"var(--geekblue-2)",title:u("AI assistant"),description:u("Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!")}]),[u]);return(0,o.useEffect)((()=>{if(e&&E.current){E.current.goTo(c,!0),b(c);const e=f[c];h({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:e.title})}}),[e,f,c,h]),s.createElement(a.A,{open:e,footer:null,onCancel:l,centered:!0,closable:!1,className:"premium-features-modal",classNames:{mask:"premium-features-modal-mask"},styles:{mask:{background:"rgba(0, 0, 0, 0.65)"}},width:1100,style:{maxWidth:"80%"}},s.createElement(i.A,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:g,ref:E},f.map(((e,t)=>s.createElement("div",{key:t},s.createElement("div",{className:"carousel-slide",style:{background:`${e.backgroundColor}`}},s.createElement("div",{className:"slide-item-image"},s.createElement("img",{src:e.image,alt:`slide-${t}`})),s.createElement("div",{className:"slide-item-content"},s.createElement("h3",{className:"slide-title"},e.title),s.createElement("p",{className:"slide-description"},e.description))))))),s.createElement("div",{className:"modal-subtitle"},u("This and other features are available for you on any paid plan.")),s.createElement("div",{className:"modal-buttons"},s.createElement(r.Ay,{size:"large",onClick:()=>l(!1)},u("Cancel")),s.createElement(r.Ay,{type:"primary",size:"large",onClick:()=>{t&&t(),p("/billing"),l(!1)},style:{padding:"0 30px"}},u("Select plan"))))}},1753:(e,t,l)=>{l.d(t,{A:()=>s});var o=l(98173),a=l(49856),i=l(98447),r=l(38826);const n=o.createElement(r.A,{style:{fontSize:48},rev:null,spin:!0}),m=(0,o.lazy)((()=>Promise.all([l.e(6819),l.e(1880),l.e(5346),l.e(8084)]).then(l.bind(l,10275)))),d={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"};function s(e){return o.createElement(o.Suspense,{fallback:o.createElement(a.A,{size:"large",style:d},o.createElement(i.A,{indicator:n}))},o.createElement(m,e))}},89687:(e,t,l)=>{l.d(t,{A:()=>i});var o=l(98173),a=l(30150);const i=({lastProjectId:e})=>{const{pathname:t,search:l}=(0,a.zy)();return!1===e?o.createElement(a.C5,{to:"/projects"}):e&&o.createElement(a.C5,{to:`/projects/${e+t+l}`})}},67007:(e,t,l)=>{l.d(t,{A:()=>i});var o=l(98173),a=l(30150);const i=({to:e})=>o.createElement(a.C5,{to:e})},96087:(e,t,l)=>{l.d(t,{A:()=>c});var o=l(98173),a=l(47555),i=l(72570),r=l(37969),n=l(30150),m=l(12543),d=l(40277);const{Content:s}=a.A,c=()=>{const{__:e}=(0,m.s9)();let t=(0,n.Zp)();return o.createElement(a.A,null,o.createElement(s,{className:"container"},o.createElement(i.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:o.createElement(r.Ay,{type:"primary",onClick:()=>(0,d.XZ)(t,"/projects")},e("Back Home"))})))}},53821:(e,t,l)=>{l.d(t,{A:()=>Y});var o=l(98173),a=l(30150),i=l(2604),r=l(26298),n=l.n(r),m=l(30753),d=l(63719),s=l(49856),c=l(67034),u=l(94674),p=l(201),g=l(66964),b=l(37969),E=l(38976),h=l(5553),f=l(69194),v=l(13785),A=l(34401),_=l(66711),y=l(51717),S=l(63448),B=l(42567),k=l(2952),x=l(1047),w=l(65716),R=l(40277),N=l(64909),T=l(52919),I=l(90614),P=l(27941),C=l(12543),L=l(86095),O=l(15626),F=l(32947);const{Text:D,Link:M,Title:V}=d.A,z="Links",H="Images",G="Spam assassin",W="Problems",j="valid",U="warnings",X="errors",q=[j,X,U],$=({summary:e,__:t,selectedTags:l,setSelectedTags:a})=>o.createElement(V,{level:5,style:{margin:0,fontSize:"14px"}},o.createElement(s.A,{style:{flexWrap:"wrap"},gap:"6"},q.map(((i,r)=>o.createElement(c.A.CheckableTag,{key:i+r,checked:null===l||void 0===l?void 0:l.includes(i),onChange:e=>((e,t)=>{const o=t?2===l.length?[]:[...l,e]:l.filter((t=>t!==e));a(o)})(i,e),className:n()(`${i} optimise__button`,{[`${i}_active`]:l.includes(i)})},t(i===j?"Valid":i===U?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[i])||0))))),Y=()=>{var e,t,l,r,d,s,c;const{__:q}=(0,C.s9)(),Y=(0,i.wA)(),K=(0,L.fn)(),Q=(0,P.rD)(),Z=(0,N.hN)(),{emailId:J,projectId:ee}=(0,a.g)(),te=(0,T.QC)(),le=(0,i.d4)(x.rd),oe=(0,I.ml)(O.AZ.ON_LIMIT_ID),[ae,ie]=(0,k.Sr)(),[re,ne]=(0,k.ku)(),[me,de]=(0,k.Ju)(),{data:se,isSuccess:ce,refetch:ue}=(0,w.fo)(+ee,{skip:!!F.EW.isPlugin||!+ee}),{limits:pe}=F.EW.isPlugin?Q.limits?Q:{limits:{optimization_limit:0}}:se||{limits:{optimization_limit:0}},{optimization_limit:ge}=pe,[be,Ee]=(0,o.useState)(),[he,fe]=(0,o.useState)([]),[ve,Ae]=(0,o.useState)([]),[_e,ye]=(0,o.useState)([]),[Se,Be]=(0,o.useState)([]),[ke,xe]=(0,o.useState)(0),[we,Re]=(0,o.useState)([]),[Ne,Te]=(0,o.useState)([]),Ie=ke>=ge&&ge>0,Pe=!(!Q.limits||!Q.counters)&&F.EW.isPlugin,Ce=(0,o.useCallback)((()=>{oe.fire({name:"OptimizationCount",count:ke+1})}),[oe,ke]);(0,o.useEffect)((()=>{var e,t;Pe?xe((null===Q||void 0===Q||null===(e=Q.counters)||void 0===e?void 0:e.optimization_counter)||0):ce&&(null===se||void 0===se||null===(t=se.counters)||void 0===t?void 0:t.optimization_counter)&&xe(se.counters.optimization_counter)}),[Pe,se,ce,Q]),(0,o.useEffect)((()=>{var e,t;be===z&&we.links&&Ae(he.length>0?null===(e=we.links)||void 0===e?void 0:e.filter((e=>he.includes(e.status))):we.links);be===H&&Ne.images&&ye(he.length>0?null===(t=Ne.images)||void 0===t?void 0:t.filter((e=>he.includes(e.status))):Ne.images)}),[we.links,Ne.images,he,be]);const Le=()=>{if(!J)return void Z.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;Pe&&(xe((e=>e+1)),Ce());const t=K.getValue(),l=(new DOMParser).parseFromString(t,"text/html"),a={},i={};l.querySelectorAll("a[href]").forEach(((e,t)=>{a[`link_${t}`]=e.getAttribute("href"),i[`link_${t}`]=e.innerText})),te.send({operation:"sandbox_set_attr_to_links"}),re({entity_id:J,data:a}).then((({data:t,error:l})=>{if(l)(0,R.p6)({error:l},Z);else if(null!==t&&void 0!==t&&t.result){let l=[...t.result];null===l||void 0===l||l.sort(((e,t)=>e.linkId-t.linkId));const o=e=>{var t,l,o,a;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(l=e.page)||void 0===l?void 0:l.secure)||void 0===t||t):"invalid"!==e.type)?j:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(o=null===(a=e.page)||void 0===a?void 0:a.secure)||void 0===o||o))&&"invalid"!==e.type?U:X};e={links:l.map((e=>({...e,text:i[e.linkId],status:o(e)}))),summary:{valid:l.filter((e=>o(e)===j)).length||0,warnings:l.filter((e=>o(e)===U)).length||0,errors:l.filter((e=>o(e)===X)).length||0}},Re(e),(0,R.wB)(q("Links validation was successfully completed"),Z),!F.EW.isPlugin&&ue()}else t.statusCode>300||!t.success?(0,R.p6)({error:{data:t}},Z):Z.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!we.links&&De("")})).catch((e=>{(0,R.p6)({error:e},Z)}))},Oe=()=>{if(!J)return void Z.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});Pe&&(xe((e=>e+1)),Ce());const e=K.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let l={};t.querySelectorAll("img").forEach(((e,t)=>l[`image_${t}`]=e.src)),te.send({operation:"sandbox_set_attr_to_images"}),me({entity_id:J,data:l}).then((({data:e,error:t})=>{let l;if(t)(0,R.p6)({error:t},Z);else if(null!==e&&void 0!==e&&e.result){let t=Object.values(e.result);t.sort(((e,t)=>e.imageId-t.imageId));let o=t.reduce(((e,t)=>e+Math.round(t.image.bytes/1024)),0);const a=e=>null!==e.statusCode&&e.statusCode<300?j:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?U:X;l={images:t.map((e=>({...e,status:a(e)})))||[],summary:{valid:t.filter((e=>a(e)===j)).length||0,warnings:t.filter((e=>a(e)===U)).length||0,errors:t.filter((e=>a(e)===X)).length||0},summaryTime:{value:(o>1200?o/1e3:o).toFixed(1),name:q(o>1200?"MB":"KB")}},l&&Te(l),(0,R.wB)(q("Images validation was successfully completed"),Z),!F.EW.isPlugin&&ue()}else{var a;e.statusCode>300||!e.success?(0,R.p6)({error:{data:e}},Z):Z.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===Ne||void 0===Ne||null===(a=Ne.images)||void 0===a||!a.length)&&De("")}})).catch((e=>{(0,R.p6)({error:e},Z)}))},Fe=()=>{J?(Pe&&(xe((e=>e+1)),Ce()),ae({entity_id:J,data:{html:K.getValue()}}).then((({data:e,error:t})=>{if(t)(0,R.p6)({error:t},Z);else if(e&&e.success){const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort(((e,t)=>e.score-t.score)),Be({...e.result,report:t})),(0,R.wB)(q("Spam validation was successfully completed"),Z),!F.EW.isPlugin&&ue()}else e.statusCode>300||!e.success?(0,R.p6)({error:{data:e}},Z):Z.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}}),placement:"bottomRight"}),(null===Se||void 0===Se||!Se.length)&&De("")})).catch((e=>{(0,R.p6)({error:e},Z)}))):Z.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},De=e=>{Ee(e!==be?e:""),fe([])};let Me=null;return(0,o.useEffect)((()=>{ge>0&&ke>=+ge&&Z.error({message:q("The usage limit has been exceeded"),description:q("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[ke,ge,q,Z]),o.createElement("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize"},Pe&&o.createElement(m.A,{counter:ke,limits:ge}),Q.optimizeLinksEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("Links validation"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;De(z),null!==we&&void 0!==we&&null!==(e=we.links)&&void 0!==e&&e.length||be===z||Le()},loading:ne.isLoading,disabled:Ie&&!(null!==we&&void 0!==we&&null!==(e=we.links)&&void 0!==e&&e.length)},!ne.isLoading&&(be===z?o.createElement(A.A,null):o.createElement(_.A,null))))),be===z&&!(null===we||void 0===we||!we.links)&&(0===(null===we||void 0===we||null===(t=we.links)||void 0===t?void 0:t.length)?o.createElement(p.A,{style:{marginBottom:24}},o.createElement(E.A,{message:q("No links found."),type:"info"})):o.createElement(o.Fragment,null,o.createElement(p.A,{style:{marginBottom:14}},o.createElement("div",{className:"optimise__title-wrapper"},o.createElement($,{__:q,summary:we.summary,setSelectedTags:fe,selectedTags:he}),o.createElement(b.Ay,{disabled:Ie,loading:ne.isLoading,onClick:Le,icon:o.createElement(y.A,null)},q("Refresh")))),o.createElement(p.A,{style:{marginBottom:24}},o.createElement(g.A,{span:24},o.createElement(h.A,{itemLayout:"horizontal",dataSource:ve,renderItem:(e,t)=>{var l;return o.createElement(h.A.Item,{style:{border:"none"},key:t+"_"+e.id},o.createElement(h.A.Item.Meta,{avatar:e.status===j?o.createElement(S.A,{className:j}):e.status===U?o.createElement(S.A,{className:U}):o.createElement(B.A,{className:X}),title:o.createElement(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,l=600>e.statusCode>399||!e.statusCode,void te.send({operation:F.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:l}});var t,l}},""===e.url?q("empty link"):e.url),description:o.createElement(o.Fragment,null,!(null===(l=e.text)||void 0===l||!l.length)&&o.createElement(D,{type:"secondary"},e.text),e.page.title&&e.page.title,e.page.secure&&e.status===j&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),o.createElement("span",{className:j},q("secure"))),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),o.createElement(D,{type:"secondary"},q("Failed to load"))))}))}})))))),Q.optimizeImagesEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("Images validation"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;De(H),null!==Ne&&void 0!==Ne&&null!==(e=Ne.images)&&void 0!==e&&e.length||be===H||Oe()},loading:de.isLoading},!de.isLoading&&(be===H?o.createElement(A.A,null):o.createElement(_.A,null))))),be===H&&!(null===Ne||void 0===Ne||!Ne.images)&&(0===(null===Ne||void 0===Ne||null===(l=Ne.images)||void 0===l?void 0:l.length)?o.createElement(p.A,{style:{marginBottom:24}},o.createElement(E.A,{message:q("No images found."),type:"info"})):o.createElement(o.Fragment,null,o.createElement(p.A,{style:{marginBottom:16}},o.createElement(E.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:o.createElement("div",{className:"optimise__summary"},o.createElement("div",null,o.createElement(V,{level:4,style:{marginBottom:"0"}},Ne.images.length," "),o.createElement("span",{style:{fontSize:"12px"}},q("images"))),o.createElement("div",null,o.createElement(V,{level:4,style:{marginBottom:"0"}},null===(r=Ne.summaryTime)||void 0===r?void 0:r.value,null===(d=Ne.summaryTime)||void 0===d?void 0:d.name),o.createElement("span",{style:{fontSize:"12px"}},q("total size"))),o.createElement("div",null,o.createElement(V,{level:4,style:{marginBottom:"0"}},(Math.max(...Ne.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+q("s")),o.createElement("span",{style:{fontSize:"12px"}},q("time to load")))),type:"warning"})),o.createElement(p.A,{style:{marginBottom:12}},o.createElement("div",{className:"optimise__title-wrapper"},o.createElement($,{__:q,summary:Ne.summary,setSelectedTags:fe,selectedTags:he}),o.createElement(b.Ay,{icon:o.createElement(y.A,null),disabled:Ie,loading:de.isLoading,onClick:()=>Oe()},q("Refresh")))),o.createElement(p.A,{style:{marginBottom:12}},o.createElement(g.A,{span:24},o.createElement(h.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:_e,renderItem:(e,t)=>o.createElement(h.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},key:t},o.createElement(h.A.Item.Meta,{className:n()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:o.createElement(f.A,{className:n()("image-item__image",{"image-item__image_fail":!e.resolvedUrl||!e.valid}),width:92,height:"auto",style:{height:"auto"},src:e.resolvedUrl||"",preview:!1,onMouseEnter:()=>{var t;return((e,t)=>{clearTimeout(Me);let l=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,o=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(l=document.createElement("div"),l.classList.add("img-preview"),o=document.createElement("div"),o.classList.add("img-preview-content"),l.append(o),document.querySelector(".email-pane__col_settings-inner").append(l)),o.innerHTML=`<table cellspacing="0" cellpadding="0" border="0" width="100%"><img height="auto" width=${t+"px"} alt="" style="max-width: 100%; object-fit: contain" src=${e}></table>`,"1"!==l.style.opacity&&setTimeout((function(){l.style.opacity="1",l.style.transform="translateX(-100%)"}),10)})(e.url,null===(t=e.image.dimensions)||void 0===t?void 0:t.width)},onMouseLeave:()=>(()=>{let e=document.querySelector(".img-preview");e&&(Me=setTimeout((()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout((function(){e.remove()}),300)}),300))})()}),title:e.url?o.createElement(v.A,{placement:"top",title:e.message},o.createElement(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,l=600>e.statusCode>399||!e.statusCode,void te.send({operation:F.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:l}});var t,l}},""===(null===e||void 0===e?void 0:e.url)?q("empty src"):e.url)):e.message,description:o.createElement(o.Fragment,null,o.createElement("div",{className:"image-size"},e.image.dimensions&&o.createElement(o.Fragment,null,e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,Math.round(e.image.bytes/1024),q("kB")),o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,e.image.responseTime,q("ms")),o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:"image-size-format"},e.image.contentType)),e.image.secure&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:j},q("secure"))),e.resolvedUrl&&!e.valid&&o.createElement(D,{type:"danger"},q("not valid")))," ",!e.resolvedUrl&&!e.statusCode&&o.createElement(D,{type:"danger"},q("Failed to load")))}))})))))),Q.optimizeSpamAssassinEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("SpamAssassin"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:ie.isLoading,onClick:()=>{var e;De(G),null!==(e=Se.report)&&void 0!==e&&e.length||Fe()},disabled:Ie&&!(null!==Se&&void 0!==Se&&null!==(s=Se.report)&&void 0!==s&&s.length)},!ie.isLoading&&(be===G?o.createElement(A.A,null):o.createElement(_.A,null))))),be===G&&!(null===(c=Se.report)||void 0===c||!c.length)&&o.createElement(o.Fragment,null,o.createElement(p.A,{style:{marginBottom:8}},o.createElement("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam"},o.createElement(V,{level:1,style:{margin:0},type:Se.spamScore<2||!Se.spamScore||Se.spamScore<=Se.baseSpamScore-1?"success":Se.spamScore<Se.baseSpamScore-1?"warning":"danger"},o.createElement("span",{style:{marginRight:"12px"}},Se.spamScore||0),o.createElement(D,{style:{marginRight:"12px",fontSize:"20px"}},"Score")),o.createElement(b.Ay,{disabled:Ie,icon:o.createElement(y.A,null),loading:ie.isLoading,onClick:Fe},q("Refresh"))),Se.spamScore>Se.baseSpamScore-1&&o.createElement(D,null,q("Lower scores are better. Aim for a score less than ")+(Se.baseSpamScore-1)+".")),o.createElement(p.A,{style:{marginBottom:8}},o.createElement(g.A,{span:24},o.createElement(h.A,{itemLayout:"horizontal",dataSource:Se.report,renderItem:e=>o.createElement(h.A.Item,{style:{border:"none"}},o.createElement(h.A.Item.Meta,{title:o.createElement(o.Fragment,null,o.createElement(D,{style:{fontSize:"20px"}},e.score),o.createElement("span",{style:{marginLeft:"12px"}},e.description))}))}))))),Q.optimizeCheckCodeEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("Source code validation"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>De(W)},be===W?o.createElement(A.A,null):o.createElement(_.A,null)))),be===W&&o.createElement(o.Fragment,null,null!==le&&void 0!==le&&le.length?o.createElement(p.A,{style:{marginBottom:8}},o.createElement(g.A,{span:24},o.createElement(h.A,{itemLayout:"horizontal",dataSource:le,renderItem:e=>o.createElement(h.A.Item,{style:{border:"none"}},o.createElement(h.A.Item.Meta,{avatar:e.severity<6?o.createElement(B.A,{className:U}):o.createElement(B.A,{className:X}),title:o.createElement(D,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};Y((0,x.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error"},"Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber),description:o.createElement(D,null,e.message)}))}))):o.createElement(p.A,{style:{marginBottom:24}},o.createElement(E.A,{message:q("No problems found."),type:"info"})))))}},56605:(e,t,l)=>{l.d(t,{A:()=>n});var o=l(98173),a=l(49856),i=l(98447),r=l(38826);const n=({small:e=!1,style:t,wrap:l=!1})=>{const n={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},m=o.createElement(r.A,{style:{fontSize:48},spin:!0});return o.createElement(a.A,{size:"large",style:n,wrap:l},o.createElement(i.A,{indicator:m}))}},97041:(e,t,l)=>{l.d(t,{A:()=>p});var o=l(98173),a=l(64909),i=l(30150),r=l(79245),n=l(78915),m=l(40277),d=l(96734),s=l(89613),c=l(32947);const u="emailmaker.ru",p=({children:e})=>{const t=(0,i.zy)(),l=(0,a.hN)(),p=(0,d.p)(),[g,b]=(0,r.ok)(),E=(0,s.u)(),[h,{isError:f,isSuccess:v,error:A,data:_}]=(0,n.i2)(),{isError:y,isUninitialized:S,isLoading:B,isSuccess:k,error:x,data:w,refetch:R}=(0,n.CR)("",{skip:c.EW.isPlugin||!p.get(c.A9.em_token)}),N=(0,o.useMemo)((()=>({email:g.get("email"),hash:g.get("hash"),event:"confirmation"===g.get("event")})),[g]);if((0,o.useEffect)((()=>{f?(0,m.p6)({error:A},l):v&&(E({event:"email_confirmation",user_email:null===_||void 0===_?void 0:_.email}),(0,m.wB)(_.message,l),w&&R())}),[_,A,f,v,l,w,R,E]),(0,o.useEffect)((()=>{!(N.email&&N.hash&&N.event)||!1!==(null===w||void 0===w?void 0:w.email_confirmation)&&p.get(c.A9.em_token)||_||h({hash:N.hash,email:N.email,event:N.event}).catch((e=>{})).finally((()=>b("")))}),[N,h,w,p,b,_]),(0,o.useEffect)((()=>{y&&x&&((0,m.p6)({error:x},l),(0,m.Id)(p))}),[w,y,x,l,p]),c.EW.isPlugin)return e;if(!c.EW.isPlugin&&!p.get(c.A9.em_token)&&!t.pathname.includes("auth"))return o.createElement(i.C5,{to:"/auth",state:{from:t}});if((S||B)&&!t.pathname.includes("auth"))return o.createElement(o.Fragment,null);if(y&&!t.pathname.includes("auth"))return o.createElement(i.C5,{to:"/auth",state:{from:t}});if(k){const{id:l,email:a,name:r,locale:n,carrotquest_hash:m,ducalis_hash:d,email_subscription_consent:s,last_used_project:g}=w;return p.set(c.A9.em_id,l,{domain:u}),p.set(c.A9.em_email,a,{domain:u}),p.set(c.A9.em_name,r,{domain:u}),p.set(c.A9.em_locale,n,{domain:u}),p.set(c.A9.em_carrotquest_hash,m,{domain:u}),p.set(c.A9.em_ducalis_hash,d,{domain:u}),p.set(c.A9.em_email_subscription_consent,s,{domain:u}),g&&"/"===t.pathname?o.createElement(i.C5,{to:`/projects/${g}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},14107:(e,t,l)=>{l.d(t,{A:()=>E});var o=l(98173),a=l(30150),i=l(2604),r=l(47555),n=l(72570),m=l(37969),d=l(12543),s=l(65716),c=l(84572),u=l(56605),p=l(40277),g=l(32947);const{Content:b}=r.A,E=()=>{var e;const{__:t}=(0,d.s9)(),{projectId:l}=(0,a.g)();let E=(0,a.Zp)(),h=(0,a.zy)();const f=(0,i.wA)(),v=(0,s.fo)(+l,{skip:!l}),{isLoading:A,isError:_,error:y,isSuccess:S,data:B}=v;return(0,o.useEffect)((()=>{S&&(null===B||void 0===B?void 0:B.id)!==l&&f((0,c.od)(B))}),[S,B,f,l]),(0,o.useEffect)((()=>{S&&l&&h.pathname.endsWith(l)&&E(`${h.pathname}/emails`)}),[S,h,E,l]),o.createElement(o.Fragment,null,A&&o.createElement(u.A,null),_&&y&&o.createElement(r.A,{className:"project-outlet"},o.createElement(b,{className:"project-outlet__container container"},o.createElement(n.Ay,{status:y.status,title:y.status,subTitle:null===(e=y.data)||void 0===e?void 0:e.message,extra:o.createElement(m.Ay,{type:"primary",onClick:()=>(0,p.XZ)(E,"/projects")},t("Back To Projects"))}))),(S||g.EW.isPlugin)&&o.createElement(a.sv,{context:{...v}}))}},15737:(e,t,l)=>{l.d(t,{A:()=>g});var o=l(98173),a=l(27499),i=l(48753),r=l(37969),n=l(8218),m=l(64909),d=l(2604),s=l(12543),c=l(83027),u=l(23424),p=l(32947);const g=({group:e,refetch:t})=>{const{__:l,_x:g}=(0,s.s9)(),b=(0,d.wA)(),[E]=a.A.useForm(),h=(0,o.useRef)(null),f=(0,d.d4)(u.cL)===p.lx.EDIT_GROUP_NAME_MODAL,v=(0,m.hN)(),{id:A=null,name:_=""}=e,y=()=>b((0,u.Oo)()),[S,B]=(0,c.CE)();(0,o.useEffect)((()=>{f&&E.setFieldsValue({name:_})}),[f,_,E]);const k=()=>{E.validateFields().then((({name:e})=>{S({id:A,data:{name:e}}).then((({data:a,error:i})=>{i?(v.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:i.data.code}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:i.data.message}}),placement:"bottomRight"}),E.setFieldValue("name",e)):(t().then((({data:e})=>{if(e){var t,l,o;const a=null===(t=e[0])||void 0===t||null===(l=t.children)||void 0===l||null===(o=l.find((e=>e.id===A)))||void 0===o?void 0:o.name;E.setFieldValue("name",a)}})),y(),v.success({message:l("The group \u201c")+e+g("\u201d was successfully changed to \u201c","group")+a.name+l("\u201d."),placement:"bottomRight"}))}))}))};return o.createElement(i.A,{title:l("Change group name"),open:f,onOk:k,onCancel:y,className:"new-group-name-modal",centered:!0,footer:[o.createElement(r.Ay,{key:"submit",type:"primary",size:"large",loading:B.isLoading,onClick:k},l("Change name"))]},o.createElement(a.A,{form:E,layout:"vertical",name:"rename_group_form",onFinish:k,initialValues:{remember:!1,name:_},autoComplete:"off",style:{paddingTop:10}},o.createElement(a.A.Item,{name:"name",rules:[{required:!0,message:l("Please enter the group name")}]},o.createElement(n.A,{disabled:B.isLoading,size:"large",placeholder:l("Enter the group name"),ref:h,style:{marginBottom:5}}))))}},95942:(e,t,l)=>{l.d(t,{A:()=>u});var o=l(98173),a=l(37969),i=l(2604),r=l(71446),n=l(94160),m=l(47014),d=l(8807),s=l(40277),c=l(12543);const u=()=>{const{__:e}=(0,c.s9)(),{notification:t}=r.A.useApp(),l=(0,i.d4)(m.C1),[u]=(0,n.C)(),[p,g]=(0,o.useState)(!1);(0,o.useEffect)((()=>{l.hasOwnProperty("email_confirmation")&&g(l.email_confirmation)}),[l,p]);return null!==l&&void 0!==l&&l.email_confirmation||null===l||void 0===l||!l.privacy_policy_agreement?null:o.createElement("div",{className:"main__ribbon"},o.createElement("span",null,o.createElement(d.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}})," ",e("Confirmation email was sent to"),"\xa0",o.createElement("em",null,l.email),".\xa0",e("Didn't receive an email?"),"\xa0",o.createElement(a.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{u({userId:l.id,email:l.email}).then((({data:o,error:a})=>{o?(0,s.wB)(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",l.email),t):a&&(0,s.p6)(a,t)}))}},e("Resend")," ",o.createElement(d.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}}))))}},40409:(e,t,l)=>{l.d(t,{A:()=>S});var o=l(98173),a=l(80703),i=l(13785),r=l(37969),n=l(64909),m=l(30150),d=l(2604),s=l(12543),c=l(52218),u=l.n(c),p=l(68984),g=l(65716),b=l(83027),E=l(62093),h=l(22536),f=l(40277),v=l(89613),A=l(86095),_=l(32947);const y=({block:e,isEditableRights:t,rightCol:l,autoSaveBlockResult:c})=>{const{__:y}=(0,s.s9)(),{projectId:S,blockId:B}=(0,m.g)();let k=(0,d.d4)(h.Fv),x=(0,d.d4)(h.Fv),w=(0,d.wA)();const R=(0,n.hN)(),N=(0,A.fn)(),T=(0,d.Pj)(),[I,P]=(0,o.useState)(!1),[C,L]=(0,o.useState)(null),[O,F]=(0,o.useState)(!1),[D,M]=(0,o.useState)(!1),V=(0,v.u)();(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&L(!0)}),[]);const{data:z,refetch:H}=(0,g.fo)(+S,{skip:!+S}),[G]=(0,p.Gr)(),[W,j]=(0,p.OZ)(),[U,X]=(0,p.pP)(),[q]=(0,g.OD)(),$=`project_${S}`,Y=z&&(0,f._q)(z,_.YY).find((e=>e.name===$)),K=z&&(0,f.HT)(z,_.YY),Q=(0,o.useCallback)((l=>{var o,a;if(F(!0),!t&&e.lock&&D)return R.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",message:y("No access to edit the letter."),placement:"bottomRight",data:(0,n.x_)(e)}),void F(!1);if(((null===(o=e.tags)||void 0===o?void 0:o.length)||(null===(a=e.blocktags)||void 0===a?void 0:a.length))>10&&D)return R.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",message:y("Maximum 10 tags available."),placement:"bottomRight",data:(0,n.x_)(e)}),void F(!1);if(""===e.type)return R.error({message:y("Set the type"),description:y("Please set the 'Type' field in the Settings section."),placement:"bottomRight"}),void F(!1);const i=t=>{var o;const a=null===(o=e.tags)||void 0===o?void 0:o.map((e=>{const l=null===K||void 0===K?void 0:K.find((t=>t.name===e));return l?l.id:G({name:e,parent:t}).then((({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(R.fromError("TAG_CREATING_ERROR",e,t),F(!1)))}))})),i=(o=null)=>{const a=l=>{T.dispatch(b.kE.endpoints.getTags.initiate({parent:t})),H(),D&&(R.success({id:"BLOCK_EDITING_SUCCESS",message:y("The block was successfully saved.","block"),data:(0,n.x_)(e)}),F(!1)),fetch(((e,t,l,o)=>`https://scr.emcdn.ru/screenshot?delay=1000&width=800&fullPage=true&deviceScaleFactor=0.8&format=jpg&clearCache=true${o?`&cacheControl=true&cache-hash=${u()(o)}`:""}&url=${encodeURIComponent(`https://dev-backend-1.emailmaker.ru/get${e}/${l}?secret_hash=${u()(`${t}${l}${_.KI}`)}&raw=true`)}`)(_.IE,S,l.id,l.modified),{mode:"no-cors"}).then((()=>{}))},i=(0,f._q)(e,_.zh).filter((t=>(o||e.blocktags).includes(t.id))).map((e=>e.name));e.isNew?X.status!==_.eG&&U({source:l,title:null===e.title?y("New block title"):e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===N||void 0===N?void 0:N.getValue())||"",blocktags:o?o.join(","):e.blocktags,tags:i}).then((({data:t,error:l})=>{l?(R.fromError("BLOCK_CREATING_ERROR",{title:e.title,html:(null===N||void 0===N?void 0:N.getValue())||""},l),F(!1)):a(t)})):j.status!==_.eG&&W({blockId:e.id,source:l,title:e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===N||void 0===N?void 0:N.getValue())||"",blocktags:o||e.blocktags,tags:i}).then((({data:t,error:l})=>{l&&D?(R.fromError("BLOCK_EDITING_ERROR",(0,n.x_)(e),l),F(!1)):a(t)}))};a?Promise.all(a).then((e=>i(e))):i(null)};F(!0),Y?i(Y.id):G({name:$}).then((async({data:t,error:l})=>{if(l)R.fromError("FOLDER_CREATING_ERROR",$,l),F(!1);else{const{data:l,error:o}=await q({projectId:S,blocktags:t.id});o?(R.fromError("BLOCK_CLONING_ERROR",(0,n.x_)(e),o),F(!1)):l&&i(l.blocktags&&l.blocktags[0])}})).catch((e=>{}))}),[X.status,U,j.status,W,e,t,G,q,S,y,D,N,R,K,H,T,Y,$]);(0,o.useEffect)((()=>{D&&(Q(),M(!1))}),[D,Q]);const Z=(0,o.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),M(!0))}),[]);(0,o.useEffect)((()=>(document.addEventListener("keydown",Z),()=>{document.removeEventListener("keydown",Z)})),[Z]);const J=(0,o.useCallback)((e=>{const t=e.data.operation,l=e.data.action;t===_.Ru.APPLICATION_ACTION&&"save_email"===l&&M(!0)}),[]);return(0,E.A)(J),(0,o.useEffect)((()=>{X.isError&&(F(!1),(0,f.p6)(X,R))}),[w,X,R]),(0,o.useEffect)((()=>{const e=setTimeout((()=>{P(!0)}),1e4);return()=>{clearTimeout(e)}}),[]),(0,o.useEffect)((()=>{e.isNew&&!B&&I&&(Q(),P(!1))}),[I,e,Q,B]),o.createElement(i.A,{title:y(C?"Save by \u2318S":"Save by Ctrl+S"),placement:l?"right":"bottomRight"},o.createElement(r.Ay,{type:"primary",block:l,className:"em-analytics__block-save",icon:o.createElement(a.A,null),onClick:()=>{V({event:"click",action:"save_block"}),M(!0)},loading:j.isLoading||q.isLoading||X.isLoading||O||c},l||k||x?"":y("Save")))};y.defaultProps={block:null};const S=y},45887:(e,t,l)=>{l.d(t,{Ay:()=>F,QG:()=>L,Wv:()=>C});var o=l(98173),a=l(13785),i=l(37969),r=l(49856),n=l(64909),m=l(80703),d=l(30150),s=l(2604),c=l(52218),u=l.n(c),p=l(12543),g=l(98845),b=l(65716),E=l(83027),h=l(62093),f=l(12741),v=l(1047),A=l(40277),_=l(27941),y=l(89613),S=l(86095),B=l(90121),k=l(90614),x=l(96734),w=l(32947),R=l(15626),N=l(13668),T=l(16390);const I="NEXT_BUTTON",P="KEYBOARD",C=(e,t,l,o,a=!0,i=.8,r)=>`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${r?"":"&fullPage=true"}&deviceScaleFactor=${i}&format=jpg&clearCache=${a}${o?`&cacheControl=true&cache-hash=${u()(o)}`:""}&url=${encodeURIComponent(`https://app.emailmaker.ru/get${e}/${l}?secret_hash=${u()(`${t}${l}${w.KI}`)}&raw=true`)}${r?`&selector=${r}`:""}`,L=(e,t,l=!0,o=.8,a)=>{let i=`https://racs.rest/v3/file/${e}?resource=exportPngApi`;return`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${a?"":"&fullPage=true"}&deviceScaleFactor=${o}&format=jpg&clearCache=${l}${t?`&cacheControl=true&cache-hash=${u()(t)}`:""}&url=${encodeURIComponent(`${i}`)}${a?`&selector=${a}`:""}`},O=({email:e,isEditableRights:t,autoSaveEmailResult:l,disabled:c})=>{var u,L;let O=(0,s.wA)(),F=(0,d.Zp)();const{__:D,_x:M}=(0,p.s9)(),{projectId:V,emailId:z}=(0,d.g)(),H=(0,x.p)(),G=(0,n.hN)(),W=(0,_.rD)(),j=(0,S.fn)(),U=(0,s.Pj)(),X=(0,s.d4)(v.rY),q=(0,s.d4)(v.UI),[$,Y]=(0,o.useState)(!1),[K,Q]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&Q(!0)}),[]);const{data:Z,refetch:J}=(0,b.fo)(+V,{skip:!+V}),{data:ee,refetch:te}=(0,E.Jz)({parent:null===Z||void 0===Z||null===(u=Z.folder)||void 0===u?void 0:u[0]},{skip:!w.EW.isPlugin||!(null!==Z&&void 0!==Z&&null!==(L=Z.folder)&&void 0!==L&&L[0])}),[le]=(0,g.Gr)(),[oe]=(0,E.JI)(),[ae,ie]=(0,g.dN)(),[re,ne]=(0,g.Kh)(),[me]=(0,b.OD)(),[de,se]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(""),pe=`project_${V}`,ge=Z&&(0,A._q)(Z,w.zh).find((e=>e.name===pe)),be=Z&&(0,A.HT)(Z,w.zh),Ee=(0,k.ml)(R.AZ.BEFORE_SAVE_EMAIL),he=(0,y.u)(),fe=(0,o.useCallback)((l=>{var o,a;if(!t&&e.lock&&ce)return void G.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:(0,n.Gy)(e),message:D("No access to edit the letter."),placement:"bottomRight"});if(((null===e||void 0===e||null===(o=e.tags)||void 0===o?void 0:o.length)||(null===(a=e.emailtags)||void 0===a?void 0:a.length))>10&&ce)return void G.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:(0,n.Gy)(e),message:D("Maximum 10 tags available."),placement:"bottomRight"});const i=async t=>{var o;const a=Object.entries(X).flatMap((([e,t])=>t.map((({value:t,label:l})=>({id:+t,name:l,parent:+e.split("_")[0]})))));let i=[];q.length&&q.forEach((e=>{i.push(...null===e||void 0===e?void 0:e.children.map((e=>({id:e.id,parentId:e.parent}))))}));const r=(null===(o=e.tags)||void 0===o?void 0:o.map((e=>{const l=null===be||void 0===be?void 0:be.find((t=>t.name===e));return l?l.id:le({name:e,parent:t}).then((({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(G.fromError("TAG_CREATING_ERROR",e,t),se(!1)))}))})))||[],m=(null===a||void 0===a?void 0:a.map((e=>{const t=null===i||void 0===i?void 0:i.find((t=>t.id===e.id));return t?t.id:oe({name:e.name,parent:e.parent}).then((({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(G.fromError("GROUP_CREATING_ERROR",e,t),se(!1)))}))})))||[],d=(e,o=null,a=null,i=[])=>{var r,m;const d=(null===(r=e.title)||void 0===r?void 0:r.trim())||(null===(m=e.subject)||void 0===m?void 0:m.trim())||D("Untitled email."),s=l=>{U.dispatch(E.kE.endpoints.getTags.initiate({parent:t})),!w.EW.isPlugin&&J&&J(),ce&&(G.success({id:"EMAIL_SAVING_SUCCESS",message:D("The email was successfully saved."),data:(0,n.Gy)(e)}),se(!1),!w.EW.isPlugin&&ee&&te()),w.EW.isPlugin||fetch(C(w.Tm,V,l.id,l.modified),{mode:"no-cors"}).then((()=>{}))},c=(0,A._q)(e,w.zh).filter((t=>(o||e.emailtags).includes(t.id))).map((e=>e.name));var u,p,g,b,h;if(e.isNew){if(ne.status!==w.eG){const t=H.get(w.A9.em_folder);re({title:d,source:l,project:e.project,subject:e.subject,preheader:e.preheader,description:e.description,utm_parameters:{utm_source:e.utm_parameters.utm_source,utm_medium:e.utm_parameters.utm_medium,utm_campaign:e.utm_parameters.utm_campaign,utm_term:e.utm_parameters.utm_term,utm_content:e.utm_parameters.utm_content},html:(null===j||void 0===j?void 0:j.getValue())||"",parent_email:e.parent_email||w.iU,common_styles:e.common_styles||"",emailtags:o?o.join(","):e.emailtags,tags:c,group:a||e.group,is_template:e.is_template||!1,is_inited:e.is_inited,renderGuid:e.renderGuid,folder:t!==w.y2&&t}).then((({data:t,error:o})=>{Re.current=!1,o?(l===I&&Ne(!1),ce&&G.fromError("EMAIL_CREATING_ERROR",{title:e.title,code:(null===j||void 0===j?void 0:j.getValue())||""},o),se(!1)):(O((0,f.aY)(null)),s(t),H.remove(w.A9.em_folder))}))}}else ie.status!==w.eG&&ae({emailId:e.id,source:l,title:d,project:e.project,preheader:e.preheader,subject:e.subject,utm_parameters:{utm_source:null===(u=e.utm_parameters)||void 0===u?void 0:u.utm_source,utm_medium:null===(p=e.utm_parameters)||void 0===p?void 0:p.utm_medium,utm_campaign:null===(g=e.utm_parameters)||void 0===g?void 0:g.utm_campaign,utm_term:null===(b=e.utm_parameters)||void 0===b?void 0:b.utm_term,utm_content:null===(h=e.utm_parameters)||void 0===h?void 0:h.utm_content},description:e.description,html:(null===j||void 0===j?void 0:j.getValue())||"",common_styles:e.common_styles||"",emailtags:o||e.emailtags,tags:c,group:a||e.group,is_template:e.is_template||!1}).then((({error:t})=>{Re.current=!1,t?(l===I&&Ne(!1),ce&&G.fromError("EMAIL_EDITING_ERROR",(0,n.Gy)(e),t),se(!1)):s(e)}));he({event:"save",action:l?"save_email":"auto_save_email",email_id:e.id,project_id:V})},s={...e};Ee.fire(s).finally((()=>{r.length||m.length?Promise.all(r).then((e=>{Promise.all(m).then((t=>{d(s,e,t,[])}))})):d(s,null,null,[])}))};se(!0),ge?i(ge.id):le({name:pe}).then((async({data:t,error:l})=>{if(l)G.fromError("FOLDER_CREATING_ERROR",pe,l),se(!1);else{const{data:l,error:o}=await me({projectId:V,emailtags:t.id});o?(G.fromError("EMAIL_CLONING_ERROR",(0,n.Gy)(e),o),se(!1)):l&&i(l.emailtags&&l.emailtags[0])}})).catch((e=>{}))}),[ne.status,re,ie.status,ae,e,t,le,O,me,V,Z,D,M,ce,j,be,Ee]);(0,B.D3)(N.Kp,(0,o.useCallback)((e=>fe(e||"EXTERNAL")),[fe]));const ve=(0,k.ml)(R.AZ.ON_NEXTBUTTON_CLICK_ID),Ae=(0,k.ml)(R.AZ.ON_SAVEBUTTON_CLICK_ID);(0,o.useEffect)((()=>{ce&&(setTimeout((()=>fe(ce))),ue(""))}),[ce]);const _e=(0,o.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),ue(P))}),[fe]);(0,o.useEffect)((()=>(document.addEventListener("keydown",_e),()=>{document.removeEventListener("keydown",_e)})),[_e]);const ye=(0,o.useCallback)((e=>{const t=e.data.operation,l=e.data.action;t===w.Ru.APPLICATION_ACTION&&"save_email"===l&&ue(P)}),[fe]);(0,h.A)(ye),(0,o.useEffect)((()=>{e.isNew&&ne.isSuccess&&(se(!0),O(g.GY.util.upsertQueryData("getEmail",ne.data.id,{...ne.data,lock:e.lock,isAmp:e.isAmp,subject:e.subject,preheader:e.preheader,description:e.description,html:(null===j||void 0===j?void 0:j.getValue())||"",project:e.project,tags:e.tags,utm_parameters:e.utm_parameters,parent_email:e.parent_email,common_styles:e.common_styles,renderGuid:e.renderGuid,is_inited:e.is_inited,isNew:!1})).then((()=>{F(`/projects/${ne.data.project}/emails/${ne.data.id}`),se(!1),ce&&G.success({id:"EMAIL_SAVING_SUCCESS",message:D("The email was successfully saved."),data:(0,n.Gy)(e)})})))}),[F,O,ne,e.isNew,D,M,ce,j]);const Se=(0,k._q)(R.AZ.ON_EMAIL_INIT_ID);(0,o.useEffect)((()=>{let e=0;const t=Se((()=>{e=setTimeout((()=>Y(!0)),1e4)}));return()=>{e&&clearTimeout(e),t.dispose()}}),[Y,Se]),(0,o.useEffect)((()=>{e.isNew&&!z&&$&&(fe(),Y(!1))}),[$,e,fe,z]);const Be=ie.isLoading||(null===me||void 0===me?void 0:me.isLoading)||ne.isLoading||de||l&&l.isLoading,ke=W.saveButtonEnabled&&o.createElement(a.A,{key:"save-button",title:D(K?"Save by \u2318S":"Save by Ctrl+S"),placement:"bottom"},o.createElement(i.Ay,{disabled:c,type:W.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:Be,icon:o.createElement(m.A,null),onClick:async()=>{const t={...e,html:j.getValue()};try{!1!==await Ae.fire(t)&&ue("SAVE_BUTTON")}catch(l){G.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),l,!0)}}},W.saveButtonText||D("Save"))),xe=!1!==W.disableDoubleClickNextButton,we=!1===W.activeNextButton,Re=(0,o.useRef)(!1),Ne=e=>{O((0,T.wj)(!e))},Te=W.nextButtonEnabled&&o.createElement(i.Ay,{disabled:c||we,key:"next-button",type:"primary",block:"false",className:"em-analytics__email-save",icon:W.primaryCommandButtonIcon,loading:Be,onClick:async()=>{if(Re.current)return;Re.current=!0;const t={...e,html:j.getValue()};try{xe&&Ne(!0),(await ve.fire(t)).every((e=>!1!==e))?ue(I):(Ne(!1),Re.current=!1)}catch(l){G.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),l,!0),Ne(!1),Re.current=!1}}},W.nextButtonText||D("Continue"));return o.createElement(o.Fragment,null,W.saveButtonEnabled&&W.nextButtonEnabled?o.createElement(r.A,null,[ke,Te]):[ke,Te])};O.defaultProps={email:null,isEditableRights:null};const F=O},11399:(e,t,l)=>{l.d(t,{A:()=>E});var o=l(98173),a=l(27499),i=l(50483),r=l(49856),n=l(13785),m=l(60994),d=l(2922),s=l(81149),c=l(12543),u=l(32947),p=l(8807),g=l(52919);const b=({form:e,elementSettings:t,imgParent:l,name:b="align",setAlignStateHandle:E=e=>{},withHotKeys:h=!0})=>{const{__:f}=(0,c.s9)(),v=(0,g.XW)(),[A,_]=(0,o.useState)(t[b]),[y,S]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&S(!0)}),[]);const B=l=>{const o=l.target.value;E(o);const a={[b]:""};o!==A?_(o):(_(""),e.setFieldsValue(a),v({operation:u.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(a.A.Item,{name:b},o.createElement(i.Ay.Group,{disabled:l&&!t.parent},o.createElement(r.A,{size:8},o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align left ( \u2318+Shift+L )":"Text align left ( Ctrl+Shift+L )":"Text align left")},o.createElement(i.Ay.Button,{value:"left",onClick:B},o.createElement(m.A,null))),o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align center ( \u2318+Shift+E )":"Text align center ( Ctrl+Shift+E )":"Text align center")},o.createElement(i.Ay.Button,{value:"center",onClick:B},o.createElement(d.A,null))),o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align right ( \u2318+Shift+R )":"Text align right ( Ctrl+Shift+R )":"Text align right")},o.createElement(i.Ay.Button,{value:"right",onClick:B},o.createElement(s.A,null))),o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align justify ( \u2318+Shift+J )":"Text align justify ( Ctrl+Shift+J )":"Text align justify")},o.createElement(i.Ay.Button,{value:"justify",onClick:B},o.createElement(p.A,{icon:"Justify"}))))))};b.defaultProps={imgParent:!1};const E=b},23863:(e,t,l)=>{l.d(t,{A:()=>R});var o=l(98173),a=l(40120),i=l(27499),r=l(201),n=l(66964),m=l(42490),d=l(50483),s=l(49856),c=l(13785),u=l(80320),p=l(17216),g=l(82984),b=l(85372),E=l(8239),h=l(91916),f=l(48947),v=l(51157),A=l(42734),_=l(26298),y=l.n(_),S=l(12543),B=l(2604),k=l(77637),x=l(1047);const{useToken:w}=a.A,R=({form:e,namePrefix:t="",typeOfForm:l="desktop"})=>{const{__:a,_x:_}=(0,S.s9)(),{token:R}=w(),N=(0,B.d4)(x.uJ),T="mobile"===l,I=T?"mobileBorderPosition":"borderPosition",P=i.A.useWatch(t+I,e),C=e.getFieldsValue(!0),L={borderAll:t+(T?"mobileBorderAll":"borderAll"),borderTop:t+(T?"mobileBorderTop":"borderTop"),borderBottom:t+(T?"mobileBorderBottom":"borderBottom"),borderRight:t+(T?"mobileBorderRight":"borderRight"),borderLeft:t+(T?"mobileBorderLeft":"borderLeft")},O=T?{mobileBorderAll:t+"mobileBorderAll",mobileBorderTop:t+"mobileBorderTop",mobileBorderBottom:t+"mobileBorderBottom",mobileBorderRight:t+"mobileBorderRight",mobileBorderLeft:t+"mobileBorderLeft"}:{borderAll:t+"borderAll",borderTop:t+"borderTop",borderBottom:t+"borderBottom",borderRight:t+"borderRight",borderLeft:t+"borderLeft"},F=e=>(null===e||void 0===e?void 0:e.width)||(null===e||void 0===e?void 0:e.style)||(null===e||void 0===e?void 0:e.color);return o.createElement(r.A,{gutter:30},o.createElement(n.A,{span:12,className:"selected-td-form__border-col"},o.createElement(i.A.Item,{name:[O[P],"color"],className:"form-item-margin-xs"},o.createElement(k.A,{placeholder:a("Color"),usedColors:N.usedColors})),o.createElement(i.A.Item,{name:[O[P],"width"],className:"form-item-margin-xs"},o.createElement(m.A,{min:0,placeholder:_("Width","border"),addonAfter:"px"})),o.createElement(i.A.Item,{name:[O[P],"style"],className:"form-item-margin-xs"},o.createElement(d.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(c.A,{placement:"bottom",title:a("None")},o.createElement(d.Ay.Button,{value:""},o.createElement(u.A,null))),o.createElement(c.A,{placement:"bottom",title:a("Solid")},o.createElement(d.Ay.Button,{value:"solid"},o.createElement(p.A,null))),o.createElement(c.A,{placement:"bottom",title:a("Dashed")},o.createElement(d.Ay.Button,{value:"dashed"},o.createElement(g.A,null))),o.createElement(c.A,{placement:"bottom",title:a("Dotted")},o.createElement(d.Ay.Button,{value:"dotted"},o.createElement(b.A,null))))))),o.createElement(n.A,{span:12,style:{textAlign:"center"}},o.createElement(i.A.Item,{label:"",name:I,labelCol:{span:8}},o.createElement(d.Ay.Group,null,o.createElement(s.A,{size:R.formItemMarginBottomXS,direction:"vertical"},o.createElement(r.A,null,o.createElement(c.A,{placement:"top",title:a("Above")},o.createElement(d.Ay.Button,{value:L.borderTop,style:{margin:"auto"},className:y()("",{"selected-td-form__border-radio":F(C[L.borderTop])})},o.createElement(E.A,null)))),o.createElement(r.A,null,o.createElement(s.A,{size:R.formItemMarginBottomXS},o.createElement(c.A,{placement:"left",title:a("On the left")},o.createElement(d.Ay.Button,{value:L.borderLeft,className:y()("",{"selected-td-form__border-radio":F(C[L.borderLeft])})},o.createElement(h.A,null))),o.createElement(c.A,{placement:"top",title:a("Around")},o.createElement(d.Ay.Button,{value:L.borderAll,className:y()("",{"selected-td-form__border-radio":F(C[L.borderAll])})},o.createElement(f.A,null))),o.createElement(c.A,{placement:"right",title:a("On the right")},o.createElement(d.Ay.Button,{value:L.borderRight,className:y()("",{"selected-td-form__border-radio":F(C[L.borderRight])})},o.createElement(v.A,null))))),o.createElement(r.A,null,o.createElement(c.A,{placement:"bottom",title:a("Below")},o.createElement(d.Ay.Button,{value:L.borderBottom,className:y()("",{"selected-td-form__border-radio":F(C[L.borderBottom])}),style:{margin:"auto"}},o.createElement(A.A,null)))))))))}},67151:(e,t,l)=>{l.d(t,{A:()=>_});var o=l(98173),a=l(201),i=l(66964),r=l(49856),n=l(27499),m=l(37969),d=l(13785),s=l(78469),c=l(31573),u=l(39672),p=l(70552),g=l(26298),b=l.n(g),E=l(12543),h=l(88647),f=l(80877),v=l(52919),A=l(32947);const _=({form:e,oneBorderRadiusValue:t,setOneBorderRadiusValue:l,elementSettings:g,namePrefix:_="",typeOfForm:y="desktop"})=>{const{__:S}=(0,E.s9)(),B=(0,v.XW)(),k="mobile"===y,x=k?"mobileBorderRadius":"borderRadius",w=k?"mobileBorderRadiusAll":"borderRadiusAll",R=k?"mobileBorderRadiusTopLeft":"borderRadiusTopLeft",N=k?"mobileBorderRadiusTopRight":"borderRadiusTopRight",T=k?"mobileBorderRadiusBottomRight":"borderRadiusBottomRight",I=k?"mobileBorderRadiusBottomLeft":"borderRadiusBottomLeft",P=k?A.NW:A.wF;return o.createElement(a.A,{gutter:10},o.createElement(i.A,{span:12},o.createElement(r.A,{size:10,align:"start"},o.createElement(n.A.Item,{name:_+[w]},o.createElement(f.A,{min:0,placeholder:S("Border radius"),prefix:o.createElement(h.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),o.createElement(i.A,{span:12},o.createElement(m.Ay,{className:b()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const o=e.getFieldsValue(!0);let a;if(t)e.setFieldsValue({[R]:o[w]||null,[I]:o[w]||null,[N]:o[w]||null,[T]:o[w]||null}),a={[x]:{[P[R]]:o[w]||0,[P[I]]:o[w]||0,[P[N]]:o[w]||0,[P[T]]:o[w]||0}};else{const t=o[R]===o[I]&&o[R]===o[N]&&o[R]===o[T];t?(e.setFieldsValue({[w]:t?o[R]:null}),a={[x]:{[P[w]]:o[R]}}):(e.setFieldsValue({[R]:null,[I]:null,[N]:null,[T]:null}),a={[x]:{[P[w]]:0,[P[R]]:0,[P[I]]:0,[P[N]]:0,[P[T]]:0}})}let i=k?{mobileBorderRadius:{all:o.mobileBorderRadiusAll||null,classNamePrefix:"em-mob-border_radius_all-"}}:{[x]:{...g[x],...a[x]}};B({operation:A.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:g.type,settings:i}),l((e=>!e))}},o.createElement(h.h,{className:"selected-td-form__icon-radius"}))),o.createElement(i.A,null,o.createElement(a.A,{gutter:10,style:{marginTop:-10}},o.createElement(i.A,{span:12},o.createElement(d.A,{placement:"bottom",title:S("Top left corner")},o.createElement(n.A.Item,{hidden:t,name:_+[R],className:"form-item-margin-xs"},o.createElement(f.A,{min:0,prefix:o.createElement(s.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(d.A,{placement:"bottom",title:S("Bottom left corner")},o.createElement(n.A.Item,{hidden:t,name:_+[I]},o.createElement(f.A,{min:0,prefix:o.createElement(c.A,null),style:{minHeight:10},addonAfter:"px"})))),o.createElement(i.A,{span:12},o.createElement(d.A,{placement:"bottom",title:S("Top right corner")},o.createElement(n.A.Item,{hidden:t,name:_+[N],className:"form-item-margin-xs"},o.createElement(f.A,{min:0,prefix:o.createElement(u.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(d.A,{placement:"bottom",title:S("Bottom right corner")},o.createElement(n.A.Item,{hidden:t,name:_+[T]},o.createElement(f.A,{min:0,prefix:o.createElement(p.A,null),style:{minHeight:10},addonAfter:"px"})))))))}},37133:(e,t,l)=>{l.d(t,{A:()=>u});var o=l(98173),a=l(27499),i=l(50483),r=l(49856),n=l(13785),m=l(12543),d=l(8807),s=l(32947),c=l(52919);const u=({form:e,elementSettings:t,tooltipTitle:l,disabled:u=!1})=>{const{__:p}=(0,m.s9)(),g=(0,c.XW)(),[b,E]=(0,o.useState)(t.valign),h=l=>{const o=l.target.value,a={valign:""};o!==b?E(o):(E(""),e.setFieldsValue(a),g({operation:s.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(a.A.Item,{name:"valign"},o.createElement(i.Ay.Group,{disabled:u},o.createElement(r.A,{size:8},o.createElement(n.A,{placement:"bottom",title:p("Align top")},o.createElement(i.Ay.Button,{value:"top",onClick:h},o.createElement(d.A,{icon:"AlignVerticalTop"}))),o.createElement(n.A,{placement:"bottom",title:p("Center vertically")},o.createElement(i.Ay.Button,{value:"middle",onClick:h},o.createElement(d.A,{icon:"AlignVerticalCenter"}))),o.createElement(n.A,{placement:"bottom",title:p("Align bottom")},o.createElement(i.Ay.Button,{value:"bottom",onClick:h},o.createElement(d.A,{icon:"AlignVerticalBottom"}))))))}},24075:(e,t,l)=>{l.d(t,{A:()=>m});var o=l(98173),a=l(26298),i=l.n(a),r=l(26327);l(47827);const n=({className:e,selectedElement:t,formSettings:l,emailElementType:a})=>o.createElement("div",{className:i()("selected-element-panel",{[e]:e}),style:{height:"100%"}},o.createElement(r.A,{className:i()("selected-element-panel__content SelectedElementPanel",{"column-settings-show":!!t.floatBlocks&&t.floatBlocks.items.length>1}),emailElementType:a,formSettings:l}));n.defaultProps={className:null,selectedElement:{parent:!1}};const m=n},26327:(e,t,l)=>{l.d(t,{A:()=>ul});var o=l(98173),a=l(84893),i=l(26298),r=l.n(i),n=l(2604),m=l(1047),d=l(22536),s=l(30150),c=l(40120),u=l(27499),p=l(13785),g=l(38976),b=l(201),E=l(66964),h=l(94674),f=l(37969),v=l(73114),A=l(49856),_=l(8218),y=l(48300),S=l(5795),B=l(54855),k=l(74984),x=l(72218),w=l(8122),R=l(86956),N=l.n(R),T=l(55207),I=l(23863),P=l(67151),C=l(50483),L=l(12543),O=l(8807),F=l(32947),D=l(52919);const M=({form:e,elementSettings:t,imgParent:l,name:a="align"})=>{const{__:i}=(0,L.s9)(),r=(0,D.XW)(),[n,m]=(0,o.useState)(t[a]),d=l=>{const o=l.target.value,i={[a]:""};o!==n?m(o):(m(""),e.setFieldsValue(i),r({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return o.createElement(u.A.Item,{name:a},o.createElement(C.Ay.Group,{disabled:l&&!t.parent},o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:i("Align left")},o.createElement(C.Ay.Button,{value:"left",onClick:d},o.createElement(O.A,{icon:"AlignHorizontalLeft"}))),o.createElement(p.A,{placement:"bottom",title:i("Center horizontally")},o.createElement(C.Ay.Button,{value:"center",onClick:d},o.createElement(O.A,{icon:"AlignHorizontalCenter"}))),o.createElement(p.A,{placement:"bottom",title:i("Align right ")},o.createElement(C.Ay.Button,{value:"right",onClick:d},o.createElement(O.A,{icon:"AlignHorizontalRight"}))))))};M.defaultProps={imgParent:!1};const V=M;var z=l(37133),H=l(62913),G=l(33365),W=l(80877),j=l(77637);const U=({typeOfForm:e="desktop"})=>{const{__:t}=(0,L.s9)(),l=(0,n.d4)(m.uJ),a="mobile"===e,i=a?"mobileBoxShadowHOffset":"boxShadowHOffset",r=a?"mobileBoxShadowVOffset":"boxShadowVOffset",d=a?"mobileBoxShadowBlurRadius":"boxShadowBlurRadius",s=a?"mobileBoxShadowSpreadRadius":"boxShadowSpreadRadius",c=a?"mobileBoxShadowColor":"boxShadowColor",g=a?"mobileBoxShadowInset":"boxShadowInset";return o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Horizontal offset")},o.createElement(u.A.Item,{name:i,className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:t("Horizontal offset"),prefix:o.createElement(G.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Vertical offset")},o.createElement(u.A.Item,{name:r,className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:t("Vertical offset"),prefix:o.createElement(O.A,{icon:"VerticalOffset"}),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Blur radius")},o.createElement(u.A.Item,{name:d,className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:t("Blur radius"),prefix:o.createElement(O.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Spread radius")},o.createElement(u.A.Item,{name:s,className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:t("Spread radius"),prefix:o.createElement(O.A,{icon:"ZoomOutMap"}),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"start"},o.createElement(u.A.Item,{name:c},o.createElement(j.A,{usedColors:l.usedColors})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},o.createElement(u.A.Item,{name:g,valuePropName:"value"},o.createElement(H.A,{style:{width:"100%"},options:[{label:t("Outside"),value:!1},{label:t("Inside"),value:!0}]}))))))};var X=l(49823),q=l(29123);const{Option:$}=X.A,Y=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement($,{value:"px"},"px"),o.createElement($,{value:"%"},"%")),{useToken:K}=c.A,Q=({form:e,name:t,elementSettings:l,isPicture:a})=>{var i;const{__:r}=(0,L.s9)(),n=(0,D.XW)(),m=(0,o.useRef)(),d=(0,o.useRef)(),[s,c]=(0,o.useState)("auto"===(null===(i=l[t])||void 0===i?void 0:i.value)),{token:p}=K(),[g,b]=(0,o.useState)("");return o.createElement(o.Fragment,null,o.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},o.createElement(W.A,{ref:m,min:0,max:g,placeholder:r("Width"),onChange:l=>{c(!1),b("%"===e.getFieldsValue(!0)[t+"Dim"]?100:"")},prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:t+"Dim",noStyle:!0},Y)})),!a&&o.createElement(A.A,{size:8,align:"end"},o.createElement(q.A,{ref:d,size:"small",checked:s,onChange:o=>{m.current.value=null,e.setFieldsValue({[t]:"",[t+"Dim"]:"px"}),c((e=>!e)),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{[t]:{classNamePrefix:"em-mob-width-",value:s?null:"auto",dim:""}}})},id:"auto-width"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"auto-width"},r("Auto")))))},{useToken:Z}=c.A,J=({form:e,name:t,elementSettings:l,isPicture:a})=>{var i;const{__:r}=(0,L.s9)(),n=(0,D.XW)(),m=(0,o.useRef)(),d=(0,o.useRef)(),[s,c]=(0,o.useState)("auto"===(null===(i=l.mobileHeight)||void 0===i?void 0:i.value)),{token:p}=Z();return o.createElement(o.Fragment,null,o.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},o.createElement(W.A,{ref:m,min:0,placeholder:r("Height"),onChange:e=>{c(!1)},prefix:o.createElement(B.A,null),addonAfter:"px"})),!a&&o.createElement(A.A,{size:8,align:"end"},o.createElement(q.A,{ref:d,size:"small",checked:s,onChange:t=>{m.current.value=null,e.setFieldsValue({mobileHeight:"",mobileHeightDim:"px"}),c((e=>!e)),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{mobileHeight:{classNamePrefix:"em-mob-height-",value:s?null:"auto",dim:""}}})},id:"auto-height"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"auto-height"},r("Auto")))))};var ee=l(42490),te=l(80320),le=l(17216),oe=l(82984),ae=l(85372),ie=l(8239),re=l(91916),ne=l(48947),me=l(51157),de=l(42734);const{useToken:se}=c.A,ce=({mobileBorders:e})=>{const{__:t}=(0,L.s9)(),l=(0,n.d4)(m.uJ),a=e=>(null===e||void 0===e?void 0:e.width)||(null===e||void 0===e?void 0:e.style)||(null===e||void 0===e?void 0:e.color),{token:i}=se();return o.createElement(b.A,{gutter:30},o.createElement(E.A,{span:12,className:"selected-td-form__border-col"},o.createElement(u.A.Item,{name:"mobileBorderColor",className:"form-item-margin-xs"},o.createElement(j.A,{usedColors:l.usedColors})),o.createElement(u.A.Item,{name:"mobileBorderWidth",className:"form-item-margin-xs"},o.createElement(ee.A,{min:0,placeholder:t("Border width"),addonAfter:"px"})),o.createElement(u.A.Item,{name:"mobileBorderStyle",className:"form-item-margin-xs"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:t("None")},o.createElement(C.Ay.Button,{value:""},o.createElement(te.A,null))),o.createElement(p.A,{placement:"bottom",title:t("Solid")},o.createElement(C.Ay.Button,{value:"solid"},o.createElement(le.A,null))),o.createElement(p.A,{placement:"bottom",title:t("Dashed")},o.createElement(C.Ay.Button,{value:"dashed"},o.createElement(oe.A,null))),o.createElement(p.A,{placement:"bottom",title:t("Dotted")},o.createElement(C.Ay.Button,{value:"dotted"},o.createElement(ae.A,null))))))),o.createElement(E.A,{span:12,style:{textAlign:"center"}},o.createElement(u.A.Item,{label:"",name:"mobileBorderPosition",labelCol:{span:8}},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:i.formItemMarginBottomXS,direction:"vertical"},o.createElement(b.A,null,o.createElement(p.A,{placement:"top",title:t("Above")},o.createElement(C.Ay.Button,{value:"top",style:{margin:"auto"},className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.top)})},o.createElement(ie.A,null)))),o.createElement(b.A,null,o.createElement(A.A,{size:i.formItemMarginBottomXS},o.createElement(p.A,{placement:"left",title:t("On the left")},o.createElement(C.Ay.Button,{value:"left",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.left)})},o.createElement(re.A,null))),o.createElement(p.A,{placement:"top",title:t("Around")},o.createElement(C.Ay.Button,{value:"all",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.all)})},o.createElement(ne.A,null))),o.createElement(p.A,{placement:"right",title:t("On the right")},o.createElement(C.Ay.Button,{value:"right",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.right)})},o.createElement(me.A,null))))),o.createElement(b.A,null,o.createElement(p.A,{placement:"bottom",title:t("Below")},o.createElement(C.Ay.Button,{value:"bottom",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.bottom)}),style:{margin:"auto"}},o.createElement(de.A,null)))))))))},ue=({form:e,elementSettings:t,imgParent:l,name:a="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,m]=(0,o.useState)(null===(i=t[a])||void 0===i?void 0:i.value),d=(0,D.XW)(),s=l=>{const o=l.target.value,i={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};o!==n?m(o):(m(""),e.setFieldsValue(i),d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return o.createElement(u.A.Item,{name:a},o.createElement(C.Ay.Group,{disabled:l&&!t.parent},o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:r("Align left")},o.createElement(C.Ay.Button,{value:"left",onClick:s},o.createElement(O.A,{icon:"AlignHorizontalLeft"}))),o.createElement(p.A,{placement:"bottom",title:r("Center horizontally")},o.createElement(C.Ay.Button,{value:"center",onClick:s},o.createElement(O.A,{icon:"AlignHorizontalCenter"}))),o.createElement(p.A,{placement:"bottom",title:r("Align right ")},o.createElement(C.Ay.Button,{value:"right",onClick:s},o.createElement(O.A,{icon:"AlignHorizontalRight"}))))))};ue.defaultProps={imgParent:!1};const pe=ue,ge=({form:e,elementSettings:t,tooltipTitle:l})=>{var a;const{__:i}=(0,L.s9)(),[r,n]=(0,o.useState)(null===(a=t.mobileVerticalAlign)||void 0===a?void 0:a.value),m=(0,D.XW)(),d=l=>{const o=l.target.value,a={mobileVerticalAlign:{classNamePrefix:"em-mob-vertical_align",value:""}};o!==r?n(o):(n(""),e.setFieldsValue(a),m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(u.A.Item,{name:"mobileVerticalAlign"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:i("Align top")},o.createElement(C.Ay.Button,{value:"top",onClick:d},o.createElement(O.A,{icon:"AlignVerticalTop"}))),o.createElement(p.A,{placement:"bottom",title:i("Center vertically")},o.createElement(C.Ay.Button,{value:"middle",onClick:d},o.createElement(O.A,{icon:"AlignVerticalCenter"}))),o.createElement(p.A,{placement:"bottom",title:i("Align bottom")},o.createElement(C.Ay.Button,{value:"bottom",onClick:d},o.createElement(O.A,{icon:"AlignVerticalBottom"}))))))};var be=l(7333),Ee=l(83799);const he=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)();return o.createElement(u.A.Item,{name:"show"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(C.Ay.Button,{value:"all"},l("Both")),o.createElement(p.A,{placement:"top",title:l("Desktop")},o.createElement(C.Ay.Button,{value:"desktop"},o.createElement(be.A,null))),o.createElement(p.A,{placement:"top",title:l("Mobile")},o.createElement(C.Ay.Button,{value:"mobile"},o.createElement(Ee.A,null))))))};he.defaultProps={};const fe=he;var ve=l(57140),Ae=l(46409),_e=l(67073),ye=l(20721);const{useToken:Se}=c.A,Be=({form:e,elementSettings:t,handleChangeValues:l})=>{const{__:a}=(0,L.s9)(),i=(0,o.useRef)(),{token:n}=Se(),[m,d]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1),[g,h]=(0,o.useState)(!1),[v,_]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!1);(0,o.useEffect)((()=>{let e=new URL("https://emailmaker.ru/?"+t.countdown);d(e.searchParams.get("font1").endsWith("-b")||e.searchParams.get("font1").endsWith("-bi")),c(e.searchParams.get("font1").endsWith("-i")||e.searchParams.get("font1").endsWith("-bi")),h(e.searchParams.get("font2").endsWith("-b")||e.searchParams.get("font2").endsWith("-bi")),_(e.searchParams.get("font2").endsWith("-i")||e.searchParams.get("font2").endsWith("-bi")),S("true"===e.searchParams.get("tp"))}),[t]);const B=[{value:"-12",label:a("-12:00 Apia")},{value:"-11",label:a("-11:00 Pago Pago, Midway Atoll")},{value:"-10",label:a("-10:00 Honolulu, Anchorage")},{value:"-9",label:a("-9:00 Anchorage, Yukon")},{value:"-8",label:a("-8:00 Los Angeles, Vancouver")},{value:"-7",label:a("-7:00 Denver, Phoenix")},{value:"-6",label:a("-6:00 Mexico City, Guadalajara")},{value:"-5",label:a("-5:00 New York, Toronto, Havana")},{value:"-4",label:a("-4:00 Caracas, Santo Domingo")},{value:"-3",label:a("-3:00 Buenos Aires, Santiago, Montevideo")},{value:"-2",label:a("-2:00 South Georgia, Saint Helena")},{value:"-1",label:a("-1:00 Azores, Cape Verde")},{value:"0",label:a("+0:00 London, Lisbon, Dublin")},{value:"1",label:a("+1:00 Paris, Berlin, Rome")},{value:"2",label:a("+2:00 Athens, Kiev, Istanbul")},{value:"3",label:a("+3:00 Istanbul, Doha, Baghdad")},{value:"4",label:a("+4:00 Baku, Dubai, Tbilisi")},{value:"5",label:a("+5:00 Karachi, Tashkent, Islamabad")},{value:"6",label:a("+6:00 Almaty, Dhaka, Bishkek")},{value:"7",label:a("+7:00 Bangkok, Ho Chi Minh City, Jakarta")},{value:"8",label:a("+8:00 Beijing, Hong Kong, Singapore")},{value:"9",label:a("+9:00 Tokyo, Seoul, Jayapura")},{value:"10",label:a("+10:00 Sydney, Melbourne, Port Moresby")},{value:"11",label:a("+11:00 Honiara, Nuku'alofa, Apia")}],k=[{value:"20",label:a("20 s")},{value:"40",label:a("40 s")},{value:"60",label:a("60 s")}],x=[{value:"arial",label:"Arial"},{value:"courier-new",label:"Courier New"},{value:"georgia",label:"Georgia"},{value:"helvetica",label:"Helvetica"},{value:"tahoma",label:"Tahoma"},{value:"times-new-roman",label:"Times New Roman"},{value:"trebuchet-ms",label:"Trebuchet MS"},{value:"verdana",label:"Verdana"},{value:"open-sans",label:"Open Sans"},{value:"roboto",label:"Roboto"}],w=e=>{var t;e.target.closest(".ant-picker-dropdown")||(null===(t=i.current)||void 0===t||t.blur())};(0,o.useEffect)((()=>(window.addEventListener("scroll",w,!0),()=>{window.removeEventListener("scroll",w,!0)})));return o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("End time"),name:"countdownTime"},o.createElement(ve.A,{ref:i,format:"DD.MM.YYYY HH:mm",disabledDate:e=>e&&e<N()().endOf("day")-864e5,showTime:!0,getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),allowClear:!1,allowEmpty:!1}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Time zone"),name:"countdownTimeZone",style:{width:"100%"}},o.createElement(X.A,{placeholder:a("Select the time zone"),getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},B.map((e=>o.createElement(X.A.Option,{key:e.value,value:e.value},e.label))))))),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Background color"),name:"countdownBackgroundColor",className:"countdown-color"},o.createElement(j.A,{placeholder:a("Background color"),isDisabled:y,usedColors:t.usedColors}))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"baseline",style:{paddingTop:29}},o.createElement(u.A.Item,{name:"countdownTransparency",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"countdownTransparency",onChange:e=>{S(e)}})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"countdownTransparency"},a("Transparency")))))),o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Countdown font settings")),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownNumbersFont",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:x}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownNumbersColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(j.A,{usedColors:t.usedColors}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownNumbersFontSize"},o.createElement(ee.A,{min:12,placeholder:a("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"}))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Strong")},o.createElement(u.A.Item,{name:"countdownNumbersStrong"},o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":m}),onClick:()=>{const t=!m;e.setFieldValue("countdownNumbersStrong",t),l({countdownNumbersStrong:t}),d(t)}},o.createElement(_e.A,{className:"selected-td-form__icon-radius"}))))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Italic")},o.createElement(u.A.Item,{name:"countdownNumbersItalic"},o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":s}),onClick:()=>{const t=!s;e.setFieldValue("countdownNumbersItalic",t),l({countdownNumbersItalic:t}),c(t)}},o.createElement(ye.A,{className:"selected-td-form__icon-radius"})))))),o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Time units font settings")),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownLabelsFont",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:x}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownLabelsColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(j.A,{usedColors:t.usedColors}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownLabelsFontSize"},o.createElement(ee.A,{min:8,placeholder:a("Font size"),addonAfter:"px",prefix:o.createElement(Ae.A,null)}))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Strong")},o.createElement(u.A.Item,{name:"countdownLabelsStrong"},o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":g}),onClick:()=>{const t=!g;e.setFieldValue("countdownLabelsStrong",t),l({countdownLabelsStrong:t}),h(t)}},o.createElement(_e.A,{className:"selected-td-form__icon-radius"}))))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Italic")},o.createElement(u.A.Item,{name:"countdownLabelsItalic"},o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":v}),onClick:()=>{const t=!v;e.setFieldValue("countdownLabelsItalic",t),l({countdownLabelsItalic:t}),_(t)}},o.createElement(ye.A,{className:"selected-td-form__icon-radius"})))))),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Language"),name:"countdownLanguage",style:{width:"100%"}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:[{value:"ru_RU",label:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"},{value:"en_US",label:"English"},{value:"uk_UA",label:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"},{value:"pt_BR",label:"Portugu\xeas"},{value:"fr-CA",label:"Fran\xe7ais"},{value:"de_DE",label:"Deutsch"},{value:"pl_PL",label:"Polski"},{value:"es_ES",label:"Espa\xf1ol"},{value:"tr_TR",label:"T\xfcrk\xe7e"},{value:"lt_LT",label:"Lietuvi\u0173 kalba"},{value:"lv_LV",label:"Latvie\u0161u valoda"},{value:"et_EE",label:"Eesti keel"},{value:"hu_HU",label:"Magyar"},{value:"el_GR",label:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"},{value:"it_IT",label:"Italiano"}]}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Duration"),name:"countdownDuration",style:{width:"100%"}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:k})))))};var ke=l(9593),xe=l(30245),we=l(29312),Re=l(53056);const{useToken:Ne}=c.A,Te=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)(),{token:a}=Ne();return o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:l("URL of the video clip."),placement:"right"},o.createElement(u.A.Item,{name:["video","source"],className:"selected-image-form__alt"},o.createElement(_.A,{allowClear:!0,placeholder:l("Video URL"),prefix:o.createElement(ke.A,null)}))),o.createElement(u.A.Item,{label:l("Play button"),name:["video","playButton"],style:{width:"100%",marginBottom:a.formItemMarginBottomMD+4}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},o.createElement(X.A.Option,{value:"youtube_red"},o.createElement(xe.A,{style:{color:"#FF0000"}})," ",l("Youtube Red")),o.createElement(X.A.Option,{value:"youtube_black"},o.createElement(xe.A,null)," ",l("Youtube Black")),o.createElement(X.A.Option,{value:"youtube_white"},o.createElement(xe.A,{style:{color:"#aaa"}})," ",l("Youtube White")),o.createElement(X.A.Option,{value:"vimeo"},o.createElement(O.A,{icon:"Vimeo"})," ",l("Vimeo")),o.createElement(X.A.Option,{value:"white_circle"},o.createElement(we.A,{style:{color:"#aaa"}})," ",l("White circle")),o.createElement(X.A.Option,{value:"black_circle"},o.createElement(we.A,null)," ",l("Black circle")),o.createElement(X.A.Option,{value:"white_circle_outlined"},o.createElement(Re.A,{style:{color:"#aaa"}})," ",l("White circle outlined")),o.createElement(X.A.Option,{value:"black_circle_outlined"},o.createElement(Re.A,null)," ",l("Black circle outlined")),o.createElement(X.A.Option,{value:"none"}," ",l("Without button")))))},Ie=()=>{const{__:e}=(0,L.s9)();return o.createElement(u.A.Item,{name:"ampShow"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(C.Ay.Button,{value:"all"},e("Both")),o.createElement(p.A,{placement:"top",title:e("AMP")},o.createElement(C.Ay.Button,{value:"amp"},"AMP")),o.createElement(p.A,{placement:"top",title:e("HTML")},o.createElement(C.Ay.Button,{value:"html"},"HTML")))))};Ie.defaultProps={};const Pe=Ie;var Ce=l(62093),Le=l(40835),Oe=l(23424),Fe=l(54838),De=l(47014),Me=l(80772),Ve=l(27941),ze=l(64909),He=l(40277),Ge=l(99512),We=l(16390);l(47827);const{useToken:je}=c.A,Ue=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:l}=je(),[a]=u.A.useForm();let i=(0,n.wA)();const c=(0,Ve.rD)(),{projectId:R}=(0,s.g)(),C=(0,ze.hN)(),M=(0,n.d4)(m.Hs),H=(0,D.XW)(),G=(0,D.K9)(),j=(0,n.d4)(Fe.Ct),X=(0,n.d4)(Fe.CS),q=(0,n.d4)(De.C1),$=(0,n.d4)(Fe.Fv),Y=(0,n.d4)(Fe.yy),[K]=(0,Le.dS)(),[Z,ee]=(0,Le.tb)(),te=(0,o.useRef)(null),le=(0,o.useRef)(null),oe=(0,o.useRef)(null),ae=(0,o.useRef)(null),ie=(0,o.useRef)(null),re=(0,o.useRef)(null),ne=(0,o.useRef)(null),me=(0,o.useRef)(null),de=(0,o.useRef)(null),[se,ce]=(0,o.useState)({}),[ue,be]=(0,o.useState)(!0),[Ee,he]=(0,o.useState)(!0),[ve,Ae]=(0,o.useState)(""),[_e,ye]=(0,o.useState)(""),[Se,ke]=(0,o.useState)(""),[xe,we]=(0,o.useState)(!1),[Re,Ne]=(0,o.useState)(!1),[Ie,Ue]=(0,o.useState)(!1),[Xe,qe]=(0,o.useState)(!1),[$e,Ye]=(0,o.useState)(!1),[Ke,Qe]=(0,o.useState)(!1),[Ze,Je]=(0,o.useState)(!1),[et,tt]=(0,o.useState)(!1),[lt,ot]=(0,o.useState)("https://"),[at,it]=(0,o.useState)(),[rt,nt]=(0,o.useState)(!1),[mt,dt]=(0,o.useState)(null),[st,ct]=(0,o.useState)({start:0,end:0}),[ut,pt]=(0,o.useState)(!1),[gt,bt]=(0,o.useState)(!1),Et=$&&"bottom"!==Y,ht=M.hasOwnProperty("type")?F.IE:F.Tm;(0,o.useEffect)((()=>{rt&&de.current&&de.current.focus()}),[rt]);const ft=(0,n.d4)(We.GH);(0,o.useEffect)((()=>{var e;null!==ft&&void 0!==ft&&null!==(e=ft.items)&&void 0!==e&&e.length&&it((0,Ve.cM)(ft.items,t,((e,t)=>{nt(!1),G(F.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[ft,it,t,nt,G]);(0,o.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||dt(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||nt(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);const vt=({target:e})=>{if(e&&!ut){const{selectionStart:t,selectionEnd:l}=e;ct({start:t,end:l})}pt(!1)},At=e.border,_t=e.mobileBorder,yt=Object.keys(At).find((e=>{var t,l,o;return(null===(t=At[e])||void 0===t?void 0:t.width)||(null===(l=At[e])||void 0===l?void 0:l.style)||(null===(o=At[e])||void 0===o?void 0:o.color)})),St=Object.keys(_t).find((e=>{var t,l,o;return(null===(t=_t[e])||void 0===t?void 0:t.width)||(null===(l=_t[e])||void 0===l?void 0:l.style)||(null===(o=_t[e])||void 0===o?void 0:o.color)})),Bt=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,i,r,n,m,d,s,c,u,p,g,b,E,h,f,v,A,_,y,S,B,k,x,w,R,T,I,P,C,L,O,F,D,M,V,z,H,G,W,j,U,X,q,$,Y,K,Q,Z,J;const ee=e.boxShadow;if(ce(ee),e.link&&ot((0,Ge.TW)(e.link,"https://")),a.setFieldsValue({...e,link:e.link?e.link:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(i=e.height)||void 0===i?void 0:i.dim,borderAll:(0,Ge.ok)(e.border.all),borderTop:(0,Ge.ok)(e.border.top),borderBottom:(0,Ge.ok)(e.border.bottom),borderRight:(0,Ge.ok)(e.border.right),borderLeft:(0,Ge.ok)(e.border.left),mobileBorderAll:Bt(e.mobileBorder.all)||!(Bt(e.mobileBorder.top)||Bt(e.mobileBorder.bottom)||Bt(e.mobileBorder.right)||Bt(e.mobileBorder.left))&&Bt(e.border.all),mobileBorderTop:Bt(e.mobileBorder.top)||!Bt(e.mobileBorder.all)&&Bt(e.border.top),mobileBorderBottom:Bt(e.mobileBorder.bottom)||!Bt(e.mobileBorder.all)&&Bt(e.border.bottom),mobileBorderRight:Bt(e.mobileBorder.right)||!Bt(e.mobileBorder.all)&&Bt(e.border.right),mobileBorderLeft:Bt(e.mobileBorder.left)||!Bt(e.mobileBorder.all)&&Bt(e.border.left),borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(r=e.boxShadow)||void 0===r?void 0:r.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(n=e.boxShadow)||void 0===n?void 0:n.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(m=e.boxShadow)||void 0===m?void 0:m.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(d=e.boxShadow)||void 0===d?void 0:d.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(s=e.boxShadow)||void 0===s?void 0:s.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(c=e.boxShadow)||void 0===c?void 0:c.color),mobileWidth:(0,Ge.xc)(null===(u=e.mobileWidth)||void 0===u?void 0:u.value)||(null===(p=e.width)||void 0===p?void 0:p.value),mobileWidthDim:(0,Ge.xc)(null===(g=e.mobileWidth)||void 0===g?void 0:g.value)?null===(b=e.mobileWidth)||void 0===b?void 0:b.dim:null===(E=e.width)||void 0===E?void 0:E.dim,mobileHeight:(0,Ge.xc)(null===(h=e.mobileHeight)||void 0===h?void 0:h.value)||(null===(f=e.height)||void 0===f?void 0:f.value),mobileHeightDim:(0,Ge.xc)(null===(v=e.mobileHeight)||void 0===v?void 0:v.value)?null===(A=e.mobileHeight)||void 0===A?void 0:A.dim:null===(_=e.height)||void 0===_?void 0:_.dim,mobileBorderRadiusAll:(0,Ge.ok)(e.mobileBorderRadius.all)||(0,Ge.ok)(e.borderRadius.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null===(y=e.mobileBorderRadius)||void 0===y?void 0:y.topLeft)||(0,Ge.ok)(null===(S=e.mobileBorderRadius)||void 0===S?void 0:S.all)||(0,Ge.ok)(null===(B=e.borderRadius)||void 0===B?void 0:B.topLeft)||(0,Ge.ok)(null===(k=e.borderRadius)||void 0===k?void 0:k.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null===(x=e.mobileBorderRadius)||void 0===x?void 0:x.bottomLeft)||(0,Ge.ok)(null===(w=e.mobileBorderRadius)||void 0===w?void 0:w.all)||(0,Ge.ok)(null===(R=e.borderRadius)||void 0===R?void 0:R.bottomLeft)||(0,Ge.ok)(null===(T=e.borderRadius)||void 0===T?void 0:T.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null===(I=e.mobileBorderRadius)||void 0===I?void 0:I.topRight)||(0,Ge.ok)(null===(P=e.mobileBorderRadius)||void 0===P?void 0:P.all)||(0,Ge.ok)(null===(C=e.borderRadius)||void 0===C?void 0:C.topRight)||(0,Ge.ok)(null===(L=e.borderRadius)||void 0===L?void 0:L.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null===(O=e.mobileBorderRadius)||void 0===O?void 0:O.bottomRight)||(0,Ge.ok)(null===(F=e.mobileBorderRadius)||void 0===F?void 0:F.all)||(0,Ge.ok)(null===(D=e.borderRadius)||void 0===D?void 0:D.bottomRight)||(0,Ge.ok)(null===(M=e.borderRadius)||void 0===M?void 0:M.all),mobileBoxShadowInset:null!=(null===(V=e.mobileBoxShadow)||void 0===V?void 0:V.inset)?e.mobileBoxShadow.inset:(null===(z=e.boxShadow)||void 0===z?void 0:z.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(H=e.mobileBoxShadow)||void 0===H?void 0:H.hOffset)||(0,Ge.ok)(null===(G=e.boxShadow)||void 0===G?void 0:G.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(W=e.mobileBoxShadow)||void 0===W?void 0:W.vOffset)||(0,Ge.ok)(null===(j=e.boxShadow)||void 0===j?void 0:j.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(U=e.mobileBoxShadow)||void 0===U?void 0:U.blurRadius)||(0,Ge.ok)(null===(X=e.boxShadow)||void 0===X?void 0:X.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(q=e.mobileBoxShadow)||void 0===q?void 0:q.spreadRadius)||(0,Ge.ok)(null===($=e.boxShadow)||void 0===$?void 0:$.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)((null===(Y=e.mobileBoxShadow)||void 0===Y?void 0:Y.color)||(null===(K=e.boxShadow)||void 0===K?void 0:K.color)),mobileAlign:(0,Ge.ok)(null===(Q=e.mobileAlign)||void 0===Q?void 0:Q.value)||e.align,mobileVerticalAlign:(0,Ge.ok)((null===(Z=e.mobileVerticalAlign)||void 0===Z?void 0:Z.value)||e.valign),show:e.show?e.show:"all",altSrc:e.src}),e.countdown){let t=new URL("https://emailmaker.ru/?"+e.countdown),l=t.searchParams.get("font1"),o=!1,i=!1;l.endsWith("-b")?(l=l.substring(0,l.length-2),o=!0):l.endsWith("-i")?(l=l.substring(0,l.length-2),i=!0):l.endsWith("-bi")&&(l=l.substring(0,l.length-3),o=!0,i=!0);let r=t.searchParams.get("font2"),n=!1,m=!1;r.endsWith("-b")?(r=r.substring(0,r.length-2),n=!0):r.endsWith("-i")?(r=r.substring(0,r.length-2),m=!0):r.endsWith("-bi")&&(r=r.substring(0,r.length-3),n=!0,m=!0),a.setFieldsValue({countdownTime:N()(new Date(Date.parse(t.searchParams.get("time"))+36e5*t.searchParams.get("timezone")+(new Date).getTimezoneOffset()/60*36e5).toISOString()),countdownDuration:t.searchParams.get("frames")||20,countdownTimeZone:t.searchParams.get("timezone"),countdownLanguage:t.searchParams.get("locale").replace("-","_"),countdownBackgroundColor:"#"+t.searchParams.get("bg"),countdownTransparency:"true"===t.searchParams.get("tp")?"checked":"",countdownNumbersFont:l,countdownNumbersFontSize:t.searchParams.get("size1")/2,countdownNumbersFontSizeDim:"px",countdownNumbersColor:"#"+t.searchParams.get("color1"),countdownLabelsFont:r,countdownLabelsFontSize:t.searchParams.get("size2")/2,countdownLabelsFontSizeDim:"px",countdownLabelsColor:"#"+t.searchParams.get("color2"),countdownNumbersStrong:o,countdownNumbersItalic:i,countdownLabelsStrong:n,countdownLabelsItalic:m})}!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?be(!1):be(!0),!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))||(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))||!(0,Ge.ok)(e.borderRadius.all)&&!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?he(!1):he(!0),we(!!yt),Ne(!!yt||!!St),Ue(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),qe(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),Ye(!!e.boxShadow),Qe(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),Je(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value||!!e.height.value),Ae(e.link),ye(e.alt),ke(e.title),bt(null===(J=e.imgReplacer)||void 0===J?void 0:J.length)}}),[a,e]);const kt=async(e,t,l)=>{const o={};o.user_id=q.id,o.folder=e,t&&("image/gif"!==t.type&&(t=await(0,w.A)(t,{maxSizeMB:c.compressMaxSize||.45,maxWidthOrHeight:c.compressMaxWidthOrHeight||2e3})),o.file=t),l&&(o.page_url=l);const a=await K(o);var i,r,n;if(a.error)C.fromError("IMAGE_UPLOAD_ERROR",t,a.error,!0);else if(400!==(null===(i=a.data.data)||void 0===i?void 0:i.status))return null===(r=a.data)||void 0===r||null===(n=r[0])||void 0===n?void 0:n.file_url},xt=((e,t)=>{let l;return function(...o){clearTimeout(l),l=setTimeout((()=>{clearTimeout(l),e(...o)}),t)}})((()=>{const t=a.getFieldsValue(!0);let l=new URL("https://cdt3.emcdn.ru/timer/?"+e.countdown),o=t.countdownNumbersFont;t.countdownNumbersStrong&&t.countdownNumbersItalic?o+="-bi":t.countdownNumbersStrong?o+="-b":t.countdownNumbersItalic&&(o+="-i");let i=t.countdownLabelsFont;t.countdownLabelsStrong&&t.countdownLabelsItalic?i+="-bi":t.countdownLabelsStrong?i+="-b":t.countdownLabelsItalic&&(i+="-i"),l.searchParams.set("time",new Date(t.countdownTime.$d-36e5*t.countdownTimeZone-(new Date).getTimezoneOffset()/60*36e5).toISOString()),l.searchParams.set("bg",t.countdownBackgroundColor.substring(1)||"#FFFFFF"),l.searchParams.set("tp",!!t.countdownTransparency),l.searchParams.set("font1",o),l.searchParams.set("size1",2*t.countdownNumbersFontSize||12),l.searchParams.set("color1",t.countdownNumbersColor.substring(1)||"#000000"),l.searchParams.set("font2",i),l.searchParams.set("size2",2*t.countdownLabelsFontSize||8),l.searchParams.set("color2",t.countdownLabelsColor.substring(1)||"#959595"),l.searchParams.set("spacing",Math.round(.4*t.countdownNumbersFontSize)||5),l.searchParams.set("locale",t.countdownLanguage.replace("_","-")),l.searchParams.set("timezone",t.countdownTimeZone),l.searchParams.set("frames",t.countdownDuration),Z({link:JSON.stringify({target:l.href})}),tt(!0)}),500),wt=(0,o.useCallback)((e=>{i(ht===F.Tm?(0,m.A9)(e):(0,d.A9)(e))}),[i,ht]),Rt=(t,...l)=>{const o=a.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(r){case"link":let e=t[r];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),a.setFieldValue("link",e)),n={link:e};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var m,d,s;if("borderAll"===o.borderPosition)n={border:{...F.iV,all:{...Ge.RH,...o.borderAll}}},a.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(m=o.borderAll)&&void 0!==m&&m.width||null!==(d=o.borderAll)&&void 0!==d&&d.style||null!==(s=o.borderAll)&&void 0!==s&&s.color?(n={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[Ge.Vz[r]]:{...o[r],...t[r]}}},a.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[r]:{...o[r],...t[r]}})):(n={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[Ge.Vz[r]]:{...o[r],...t[r]}}},a.setFieldsValue({border:n.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var u,p,g;if("mobileBorderAll"===o.mobileBorderPosition)n={mobileBorder:{...F.iV,all:{...Ge.RH,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+Ge.ax[r]+"-"}}},a.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(u=o.mobileBorder.all)&&void 0!==u&&u.width||null!==(p=o.mobileBorder.all)&&void 0!==p&&p.style||null!==(g=o.mobileBorder.all)&&void 0!==g&&g.color?(n={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[Ge.ax[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+Ge.ax[r]+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[r]:{...o[r],...t[r]}})):(n={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[Ge.ax[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+Ge.ax[r]+"-"}}},a.setFieldsValue({mobileBorder:n.mobileBorder}));break;case"width":n={[r]:{value:t[r],dim:o.widthDim}};break;case"widthDim":n={width:{value:o.width,dim:t[r]}};break;case"height":n={[r]:{value:t[r],dim:o.heightDim}};break;case"heightDim":n={height:{value:o.height,dim:t[r]}};break;case"borderRadiusAll":n={borderRadius:{[F.wF[r]]:+t[r]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{topLeft:o.borderRadiusTopLeft,bottomLeft:o.borderRadiusBottomLeft,topRight:o.borderRadiusTopRight,bottomRight:o.borderRadiusBottomRight,[F.wF[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:o.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[r]}};break;case"mobileHeight":n={[r]:{classNamePrefix:"em-mob-height-",value:t[r],dim:o.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[r]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[Ge.NW[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+Ge.NW[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[r]:{classNamePrefix:"em-mob-text_align-",value:t[r]}};break;case"mobileVerticalAlign":n={[r]:{classNamePrefix:"em-mob-vertical_align-",value:t[r]}};break;case"countdownTime":case"countdownTimeZone":case"countdownBackgroundColor":case"countdownNumbersFont":case"countdownNumbersFontSize":case"countdownNumbersColor":case"countdownLabelsFont":case"countdownLabelsFontSize":case"countdownLabelsColor":case"countdownLanguage":case"countdownDuration":case"countdownTransparency":case"countdownNumbersStrong":case"countdownNumbersItalic":case"countdownLabelsStrong":case"countdownLabelsItalic":xt();break;case"video":(async()=>{const e=a.getFieldsValue(!0);e.video.source&&kt("tmp",null,e.video.source).then((t=>{var l=document.createElement("canvas"),o=l.getContext("2d"),a=new Image,r=new Image;let n=t,m="https://useblocks.io/app/"+e.video.playButton+".png";a.crossOrigin="Anonymous",r.crossOrigin="Anonymous";let d=!1,s=!1;a.onload=function(){o.clearRect(0,0,l.width,l.height),o.drawImage(a,0,0,l.width,l.height),d=!0},a.src=n,r.onload=function(){var e=l.width/2-r.width/2,t=l.height/2-r.height/2;o.drawImage(r,e,t,r.width,r.height),s=!0},r.src=m;let u=setInterval((function(){if(d&&s){l.width=Math.max(a.width,r.width),l.height=Math.max(a.height,r.height),o.clearRect(0,0,l.width,l.height),o.drawImage(a,0,0,a.width,a.height);var e=l.width/2-r.width/2,t=l.height/2-r.height/2;o.drawImage(r,e,t,r.width,r.height),l.toBlob((async function(e){const t=await(0,w.A)(new File([e],"image.jpeg",{type:"image/jpeg"}),{maxSizeMB:c.compressMaxSize||.45,maxWidthOrHeight:c.compressMaxWidthOrHeight||2e3});kt(R,t).then((e=>{i((0,Me.tm)(e))}))}),"image/jpg",1),clearInterval(u)}}),300)}))})(),o.link=o.video.source,H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"video",settings:{video:{...o.video,...t.video},link:o.link}});break;default:n=t}var b;"borderPosition"!==r&&"mobileBorderPosition"!==r&&-1===r.indexOf("countdown")&&"video"!==r&&(H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n}),"video"!==r&&-1===r.indexOf("countdown")&&"mobileBorderRadiusAll"!==r&&"mobileBorderRadiusTopLeft"!==r&&"mobileBorderRadiusTopRight"!==r&&"mobileBorderRadiusBottomLeft"!==r&&"mobileBorderRadiusBottomRight"!==r&&wt({...e,...n,mobileBorderRadius:{...e.mobileBorderRadius,...null===(b=n)||void 0===b?void 0:b.mobileBorderRadius},activateSection:null,changeKey:r}))};(0,o.useEffect)((()=>{ee.isError&&((0,He.p6)(ee,C),tt(!1))}),[ee,C]),(0,o.useEffect)((()=>{if(ee.isSuccess&&et){var t;if(400===(null===(t=ee.data.data)||void 0===t?void 0:t.status))C.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:ee.data.code}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:ee.data.message}}),placement:"bottomRight"});else{let t=new URL(ee.data.target),l={countdown:{link:ee.data.link,params:t.search.substring(1)}};H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:l})}tt(!1)}}),[ee,et,e,C,H]);(0,Ce.A)((t=>{const l=t.data.operation;l===F.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_AI))):l===F.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):l===F.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_EDIT))):l===F.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_GIF))):l===F.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_STOCK))):l===F.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,Oe.Os)()),i((0,Oe.Oo)()))}));const Nt=()=>{ve?(Ae(""),a.setFieldValue("link",""),H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{link:""}})):(Ae(te.current&&te.current.input.value?te.current.input.value:"..."),setTimeout((()=>{te.current.focus()})))},Tt=e=>{""===e.target.value?Ae("..."):(le.current.classList.add("selected-td-form__button--active"),Ae(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?ot("https://"):"mailto:"===t.substring(0,7)?ot("mailto:"):"tel:"===t.substring(0,4)?ot("tel:"):"sms:"===t.substring(0,4)?ot("sms:"):"ftp://"===t.substring(0,6)?ot("ftp://"):"skype:"===t.substring(0,6)?ot("skype:"):"viber:"===t.substring(0,6)?ot("viber:"):ot("")},It=()=>{const t=a.getFieldsValue(!0);_e?(ye(""),t.alt="",H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{alt:""}})):(ye(oe.current&&oe.current.input.value?oe.current.input.value:"..."),setTimeout((()=>{oe.current.focus()})))},Pt=e=>{""===e.target.value?ye("..."):(ae.current.classList.add("selected-td-form__button--active"),ye(e.target.value))},Ct=()=>{const t=a.getFieldsValue(!0);Se?(ke(""),t.title="",H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{title:""}})):(ke(ie.current&&ie.current.input.value?ie.current.input.value:"..."),setTimeout((()=>{ie.current.focus()})))},Lt=e=>{""===e.target.value?ke("..."):(re.current.classList.add("selected-td-form__button--active"),ke(e.target.value))};return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_image_form",initialValues:{src:"",width:"",height:"",widthDim:"",heightDim:"",alt:"",align:"left",border:"",boxShadow:"",show:"all",borderPosition:Ge.uE[yt]||"borderAll",mobileBorderPosition:Ge.lS[St]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"left",mobileVerticalAlign:"",link:"https://",imgReplacer:"",countdownNumbersStrong:!1,countdownNumbersItalic:!1,countdownLabelsStrong:!1,countdownLabelsItalic:!1,video:{source:"",playButton:"youtube_red"}},onValuesChange:Rt,autoComplete:"off",className:"element-controls"},!Et&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),j===F.ND&&X.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:30,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(pe,{form:a,elementSettings:e,imgParent:!0})),c.formImageFieldVerticalAlignEnabled&&o.createElement(E.A,{span:12,align:"right"},o.createElement(ge,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&o.createElement(o.Fragment,null,o.createElement(Be,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),"video"===e.type&&o.createElement(o.Fragment,null,o.createElement(Te,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&o.createElement(u.A.Item,{style:{marginBottom:0}},o.createElement(T.A,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement(A.A,{size:8,style:{marginBottom:_e||ve||Se?l.formItemMarginBottomXS:l.formItemMarginBottomMD+4}},o.createElement(p.A,{title:_e||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!_e}),onClick:It,ref:ae},o.createElement("span",{className:"addon-text-content"},"Alt"))),c.formFieldImageTitleEnabled&&o.createElement(p.A,{title:Se||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Se}),onClick:Ct,ref:re},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(p.A,{title:ve||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!ve}),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Nt,ref:le}))),(!!ve||!!_e||!!Se)&&o.createElement("div",{style:{marginBottom:l.formItemMarginBottomMD+4}},!!ve&&o.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{ref:te,allowClear:!0,placeholder:t("Hyperlink URL"),prefix:o.createElement(y.A,null),onChange:Tt}))),!!_e&&o.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},o.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:Pt,ref:oe}))),c.formFieldImageTitleEnabled&&!!Se&&o.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},o.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Tooltip text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:Lt,ref:ie})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Je((e=>!e)),Ze&&(t.mobileWidth="",t.mobileHeight="",H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},Ze?o.createElement(x.A,null):o.createElement(k.A,null)))),Ze&&o.createElement(b.A,{gutter:10,style:{paddingBottom:24}},o.createElement(E.A,{span:12},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e,isPicture:"true"})),c.formImageFieldHeightEnabled&&o.createElement(E.A,{span:12},o.createElement(J,{form:a,name:"mobileHeight",elementSettings:e,isPicture:"true"}))),c.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ne((e=>!e)),Re?(t.mobileBorderAll=Ge.RH,t.mobileBorderTop=Ge.RH,t.mobileBorderBottom=Ge.RH,t.mobileBorderRight=Ge.RH,t.mobileBorderLeft=Ge.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},Re?o.createElement(x.A,null):o.createElement(k.A,null)))),Re&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:a,typeOfForm:"mobile"}))),c.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{qe((e=>!e)),Xe?(t.mobileBorderRadiusAll=null,he(!0)):t.mobileBorderRadiusAll=5,H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},Xe?o.createElement(x.A,null):o.createElement(k.A,null)))),Xe&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:Ee,setOneBorderRadiusValue:he,elementSettings:e,typeOfForm:"mobile"}))),c.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Qe((e=>!e)),Ke?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},Ke?o.createElement(x.A,null):o.createElement(k.A,null)))),Ke&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:se,typeOfForm:"mobile"}))),c.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})))),c.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(V,{form:a,elementSettings:e,imgParent:!0})),c.formImageFieldVerticalAlignEnabled&&o.createElement(E.A,{span:12,align:"right"},o.createElement(z.A,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&o.createElement(o.Fragment,null,o.createElement(Be,{form:a,elementSettings:e,handleChangeValues:Rt}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),c.mergeTagsShow&&at&&o.createElement(E.A,{span:24,id:"merge_tags_wrapper"},o.createElement(u.A.Item,{style:{marginBottom:24}},o.createElement(f.Ay,{id:"merge_tags_button",icon:o.createElement(O.A,{icon:"MergeTags"}),style:{width:"100%",display:rt?"none":"block"},onClick:()=>nt(!0)},t("Merge tags")),o.createElement(v.A,{ref:de,popupClassName:"merge-tags",options:at,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const l=t.map(((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map(((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t)))}));return o.createElement("div",{title:t.map((e=>e.label)).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(t,l)=>{if(nt(!1),t){const o=ft.syntax.length>1?at.findIndex((e=>e.key===l[0].key)):0,i=ft.syntax[o].replace("%value%",t[t.length-1]);"selected_image_form_title"===(null===mt||void 0===mt?void 0:mt.getAttribute("id"))||"selected_image_form_alt"===(null===mt||void 0===mt?void 0:mt.getAttribute("id"))||"selected_image_form_link"===(null===mt||void 0===mt?void 0:mt.getAttribute("id"))||"selected_image_form_imgReplacer"===(null===mt||void 0===mt?void 0:mt.getAttribute("id"))?((t,l)=>{const o=document.getElementById(l);if(o){var i,r;const n="selected_image_form_",m=l.substring(l.indexOf(n)+n.length),d=null===(i=o.value)||void 0===i?void 0:i.substring(0,st.start),s=null===(r=o.value)||void 0===r?void 0:r.substring(st.end);H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{...e,[m]:d+t+s}}),a.setFieldValue(m,d+t+s),o.focus(),setTimeout((()=>{o.selectionStart=st.start,o.selectionEnd=st.start+t.length}),400),pt(!0)}})(i,null===mt||void 0===mt?void 0:mt.getAttribute("id")):(a.setFieldValue("imgReplacer",i),H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:i}}))}},style:{display:rt?"block":"none"},open:rt,onKeyDown:e=>{"Escape"===e.key&&nt(!1)}}))),"video"===e.type&&o.createElement(o.Fragment,null,o.createElement(Te,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&o.createElement(u.A.Item,{style:{marginBottom:0}},o.createElement(T.A,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement(A.A,{size:8,style:{marginBottom:_e||ve||Se||gt?l.formItemMarginBottomXS:l.formItemMarginBottomMD+4}},o.createElement(p.A,{title:_e||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!_e}),onClick:It,ref:ae},o.createElement("span",{className:"addon-text-content"},"Alt"))),c.formFieldImageTitleEnabled&&o.createElement(p.A,{title:Se||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Se}),onClick:Ct,ref:re},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(p.A,{title:ve||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!ve}),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Nt,ref:le})),c.formImageFieldReplacerEnabled&&o.createElement(p.A,{title:t("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":gt}),icon:o.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{bt(!gt),gt?(a.setFieldValue("imgReplacer",""),H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:""}})):setTimeout((()=>ne.current.focus()))},ref:me}))),(!!ve||!!_e||!!Se||!!gt)&&o.createElement("div",{style:{marginBottom:l.formItemMarginBottomMD+4}},!!ve&&o.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{addonBefore:o.createElement(Ge.Ai,{linkProtocol:lt,handleLinkProtocolsChange:e=>{a.setFieldValue("link","mergetag"!==e?e:""),ot(e)},__:t}),placeholder:t("Hyperlink URL"),allowClear:!0,ref:te,onChange:Tt,onSelect:vt,prefix:o.createElement(Ge.RM,{linkProtocol:lt})}))),!!_e&&o.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},o.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:Pt,ref:oe,onSelect:vt}))),c.formFieldImageTitleEnabled&&!!Se&&o.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},o.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Enter the title of the image"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:Lt,ref:ie,onSelect:vt}))),!!gt&&o.createElement(p.A,{trigger:["hover"],title:t("Image src"),placement:"bottom"},o.createElement(u.A.Item,{name:"imgReplacer",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},t("Image src")),onChange:e=>{""!==e.target.value&&me.current.classList.add("selected-td-form__button--active")},ref:ne,onSelect:vt})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Size")),o.createElement(b.A,{gutter:l.marginSM,style:{marginBottom:c.formImageFieldHeightEnabled?4:24}},o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:e.maxWidth,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:"px"})))),c.formImageFieldHeightEnabled&&o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Height"),placement:"bottom"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"}))))),c.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{we((e=>!e)),xe?(t.borderAll=Ge.RH,t.borderTop=Ge.RH,t.borderBottom=Ge.RH,t.borderRight=Ge.RH,t.borderLeft=Ge.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},xe?o.createElement(x.A,null):o.createElement(k.A,null)))),xe&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:a,elementSettings:e}))),c.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ue((e=>!e)),Ie?(t.borderRadiusAll=0,be(!0)):t.borderRadiusAll=5,H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},Ie?o.createElement(x.A,null):o.createElement(k.A,null)))),Ie&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:ue,setOneBorderRadiusValue:be,elementSettings:e}))),c.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ye((e=>!e)),$e?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),H({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},$e?o.createElement(x.A,null):o.createElement(k.A,null)))),$e&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:se}))),c.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})))),c.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))};var Xe=l(78320);const qe=()=>{const{__:e}=(0,L.s9)();return o.createElement(p.A,{trigger:["hover"],title:e("The font-size CSS property sets the size of the font."),placement:"top"},o.createElement(u.A.Item,{name:"mobileFontSize"},o.createElement(W.A,{min:8,max:90,placeholder:e("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"})))};var $e=l(38927),Ye=l(44484),Ke=l(96698);const Qe=({form:e,elementSettings:t,name:l,icon:a,tooltipTitle:i=null,showTooltip:n=!0})=>{const{__:m}=(0,L.s9)(),d=e.getFieldValue(l),s=(0,D.XW)(),[c,g]=(0,o.useState)(t[l]);(0,o.useEffect)((()=>{t[l]!==e.getFieldValue(l)&&(e.setFieldValue(l,t[l]),g(t[l]))}),[t,e,l]),(0,o.useEffect)((()=>{c!==d&&g(d)}),[d,c,l]);const b=()=>{const o={[l]:!c};e.setFieldValue(l,!c),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:o}),g((e=>!e))};return o.createElement(u.A.Item,{name:l},n?o.createElement(p.A,{placement:"bottom",title:i||m(l.substring(4))},o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},a)):o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},a))};Qe.defaultProps={imgParent:!1};const Ze=Qe;var Je=l(11399),et=l(52427),tt=l(94338);const{useToken:lt}=c.A,ot=({form:e,elementSettings:t,showAddParagraph:l=!0,isButton:a=!1,linkProtocol:i,setLinkProtocol:m,linkTarget:d,isBulletFontColorChecked:s=!1,setIsBulletFontColorChecked:c=()=>{}})=>{var g,A,k,x,w,R,N;const{__:T}=(0,L.s9)(),{token:I}=lt(),P=(0,ze.hN)(),C=(0,D.XW)(),M=(0,D.K9)(),V=(0,Ve.rD)(),z=(0,o.useRef)(),H=(0,o.useRef)(null),G=(0,o.useRef)(null),[U,q]=(0,o.useState)(!1),[$,Y]=(0,o.useState)(null),[K,Q]=(0,o.useState)({start:0,end:0}),[Z,J]=(0,o.useState)(!1),[ee,te]=(0,o.useState)([]),[le,oe]=(0,o.useState)("#c6c3c3"),ae=(0,tt.A)(),ie=(0,o.useMemo)((()=>ae),[]),re=u.A.useWatch([],e);(0,o.useEffect)((()=>{if(null!==re&&void 0!==re&&re.textColor&&s){const l=e.getFieldValue("textColor");C({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{ColorBullets:l}})}}),[null===re||void 0===re?void 0:re.textColor]);(0,Ce.A)((e=>{e.data.operation===F.Ru.APPLICATION_FOCUS_IN_IFRAME&&Y(null)}));const[ne,me]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&me(!0)}),[]);const de=(0,o.useRef)(null),se=e=>{C({operation:F.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"}),P.success({message:T("It`s done!"),placement:"bottomRight"})},ce=[{key:"1",label:T("This element"),onClick:()=>se("typograf")},{key:"2",label:T("The whole email"),onClick:()=>se("typograf_all")}],[ue,pe]=(0,o.useState)(),[ge,be]=(0,o.useState)(!1);(0,o.useEffect)((()=>{const e=((e,t="#c6c3c3",l={})=>{const{symbolSize:a="25px",marginRight:i="5px",marginBottom:r="5px",textStyle:n={whiteSpace:"normal",lineHeight:"1.2"}}=l;return e.map((e=>({value:e.code,label:o.createElement("div",{style:{display:"flex",alignItems:"center"}},o.createElement("span",{style:{color:t||"#c6c3c3",marginRight:i,marginBottom:r,fontSize:a,lineHeight:"0.7",width:a,textAlign:"center",...n}},e.symbol),o.createElement("span",{style:n},e.description))})))})(ie,le,{});te(e)}),[ie,le]),(0,o.useEffect)((()=>{var e;oe(null===t||void 0===t||null===(e=t.list)||void 0===e?void 0:e.bulletsColor)}),[e,t]),(0,o.useEffect)((()=>{t.linkHref&&("https://"===t.linkHref.substring(0,8)||"http://"===t.linkHref.substring(0,7)?m("https://"):"mailto:"===t.linkHref.substring(0,7)?m("mailto:"):"tel:"===t.linkHref.substring(0,4)?m("tel:"):"sms:"===t.linkHref.substring(0,4)?m("sms:"):"ftp://"===t.linkHref.substring(0,6)?m("ftp://"):"skype:"===t.linkHref.substring(0,6)?m("skype:"):"viber:"===t.linkHref.substring(0,6)?m("viber:"):m("")),e.setFieldsValue({linkHref:t.linkHref?t.linkHref:"https://"})}),[e,t,m]);const Ee=(0,n.d4)(We.GH);(0,o.useEffect)((()=>{var e;null!==Ee&&void 0!==Ee&&null!==(e=Ee.items)&&void 0!==e&&e.length&&pe((0,Ve.cM)(Ee.items,T,((e,t)=>{be(!1),M(F.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[Ee,pe,T,be,M]);(0,o.useEffect)((()=>{ge&&de.current&&de.current.focus()}),[ge]),(0,o.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||Y(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||be(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.removeEventListener("click",t)}}),[]);const he=(0,o.useCallback)((({target:e})=>{if(e&&!Z){const{selectionStart:t,selectionEnd:l}=e;Q({start:t,end:l})}J(!1)}),[Z]);(0,o.useEffect)((()=>he({target:null===d||void 0===d?void 0:d.target})),[d,he]);const fe=(l,o)=>{const a=document.getElementById(o);if(a){var i,r;const n=null===(i=a.value)||void 0===i?void 0:i.substring(0,K.start),m=null===(r=a.value)||void 0===r?void 0:r.substring(K.end),d=o.substring(o.lastIndexOf("_")+1);C({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{[d]:n+l+m}}),e.setFieldValue(d,n+l+m),a.focus(),setTimeout((()=>{a.selectionStart=K.start,a.selectionEnd=K.start+l.length}),400),J(!0)}};(0,o.useEffect)((()=>{var e;q(!(null===(e=t.textReplacer)||void 0===e||!e.length))}),[t,e]);return o.createElement(o.Fragment,null,l&&!t.showOnMobile&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12,gutter:20},o.createElement(Je.A,{form:e,elementSettings:t,name:"textAlign"}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}})),t.showOnMobile&&o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}}),V.formTextFieldTypografEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"AddImage",style:{marginBottom:I.formItemMarginBottomXS}},o.createElement(f.Ay,{icon:o.createElement(O.A,{icon:"AddImage"}),onClick:()=>se("add_img"),style:{width:"100%"}},T("Add image")))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"Typography",style:{marginBottom:I.formItemMarginBottomXS}},o.createElement($e.A,{arrow:!0,menu:{items:ce},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected-element-panel")},o.createElement(f.Ay,{icon:o.createElement(O.A,{icon:"Typograf"}),onClick:()=>se("typograf"),style:{width:"100%"}},T("Typography"))))),V.mergeTagsShow&&ue&&o.createElement(E.A,{span:24,id:"merge_tags_wrapper",style:{marginBottom:0}},o.createElement(f.Ay,{id:"merge_tags_button",icon:o.createElement(O.A,{icon:"MergeTags"}),style:{width:"100%",display:ge?"none":"block"},onClick:()=>be(!0)},T("Merge tags")),o.createElement(v.A,{ref:de,popupClassName:"merge-tags",options:ue,placeholder:T("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const l=t.map(((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map(((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t)))}));return o.createElement("div",{title:t.map((e=>e.label)).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(l,o)=>{if(be(!1),l){const a=Ee.syntax.length>1?ue.findIndex((e=>e.key===o[0].key)):0,i=Ee.syntax[a].replace("%value%",l[l.length-1]);"selected_button_form_href"===(null===$||void 0===$?void 0:$.getAttribute("id"))||"selected_text_form_linkHref"===(null===$||void 0===$?void 0:$.getAttribute("id"))||"selected_text_form_textReplacer"===(null===$||void 0===$?void 0:$.getAttribute("id"))?fe(i,null===$||void 0===$?void 0:$.getAttribute("id")):(e.setFieldValue("textReplacer",i),C({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:i}}))}},style:{display:ge?"block":"none",width:"100%"},open:ge,onKeyDown:e=>{"Escape"===e.key&&be(!1)}}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:I.formItemMarginBottomMD,marginTop:20}})),o.createElement(p.A,{trigger:["hover"],title:T("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"fontFamily",className:"form-item-margin-xs"},o.createElement(et.A,{textEditor:!0}))),!t.showOnMobile&&o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Font size"),placement:"bottom"},o.createElement(u.A.Item,{name:"fontSize"},o.createElement(W.A,{min:8,max:90,placeholder:T("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Line height"),placement:"bottom"},o.createElement(u.A.Item,{name:"lineHeight"},o.createElement(W.A,{min:10,max:110,placeholder:T("Line height"),prefix:o.createElement(Xe.A,null),addonAfter:"px"}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:T(ne?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(_e.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:T(ne?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:T(ne?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:T(ne?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(Ke.A,{className:"selected-text-common-form__icon-radius"})})),l&&o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,className:r()("selected-text-common-form__button selected-text-common-form__button_style",{"selected-text-common-form__button--active":"string"===typeof t.linkHref}),elementSettings:t,name:"textLink",tooltipTitle:T("Link"),icon:o.createElement(y.A,{className:"selected-text-common-form__icon-radius"}),onSelect:he})),a&&o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textColor",rules:[{message:T("Please set the font color")}]},o.createElement(j.A,{placeholder:T("Color"),usedColors:t.usedColors})))),!a&&V.formTextFieldReplacerEnabled&&o.createElement(E.A,{span:3},o.createElement(p.A,{title:T("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":U}),icon:o.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{q(!U),U?(e.setFieldValue("textReplacer",""),C({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:""}})):setTimeout((()=>H.current.focus()))},ref:G})))),l&&"string"===typeof t.linkHref&&o.createElement(p.A,{trigger:["hover"],title:T("The URL that the hyperlink directs to."),placement:"bottom"},o.createElement(u.A.Item,{name:"linkHref"},o.createElement(_.A,{ref:z,addonBefore:o.createElement(Ge.Ai,{linkProtocol:i,handleLinkProtocolsChange:t=>{e.setFieldValue("linkHref","mergetag"!==t?t:""),m(t)},__:T}),allowClear:!0,placeholder:T("Hyperlink URL"),autoFocus:null===t||void 0===t?void 0:t.isNewLink,onSelect:he,prefix:o.createElement(Ge.RM,{linkProtocol:i})}))),!a&&U&&o.createElement(p.A,{trigger:["hover"],title:T("Text"),placement:"bottom"},o.createElement(u.A.Item,{name:"textReplacer"},o.createElement(_.A,{placeholder:T("The code that will replace this text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},T("Text")),onChange:e=>{""!==e.target.value&&G.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const t=e.target,l=t.value,o=t.selectionStart;if(0!==o||" "!==e.key){if(" "===e.key){if(o!==l.length)return void e.preventDefault();l.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:H,onSelect:he}))),!a&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textColor",rules:[{message:T("Please set the font color")}]},o.createElement(j.A,{placeholder:T("Color"),usedColors:t.usedColors})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:T("Please set the background color")}]},o.createElement(j.A,{placeholder:T("Background color"),usedColors:t.usedColors}))))),!a&&(null===t||void 0===t||null===(g=t.list)||void 0===g?void 0:g.isList)&&o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:2}}),!a&&(null===t||void 0===t||null===(A=t.list)||void 0===A?void 0:A.isList)&&o.createElement(b.A,{gutter:[10,10],align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},T("List settings")))),!a&&(null===t||void 0===t||null===(k=t.list)||void 0===k?void 0:k.isList)&&o.createElement(o.Fragment,null,"OL"===(null===t||void 0===t||null===(x=t.list)||void 0===x?void 0:x.listType)&&o.createElement(b.A,null,o.createElement(E.A,{span:24},o.createElement(p.A,{trigger:["hover"],title:T("Bullets font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"BulletsFontFamily",className:"form-item-margin-xs"},o.createElement(et.A,{textEditor:!0,style:{marginTop:"-9px"}}))))),o.createElement(b.A,{gutter:[10]},"UL"===(null===t||void 0===t||null===(w=t.list)||void 0===w?void 0:w.listType)&&o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Bullets type"),placement:"bottom"},o.createElement(u.A.Item,{name:"BulletType",className:"bullet-type"},o.createElement(X.A,{size:"middle",placeholder:T("Bullets type"),onClick:e=>e.stopPropagation(),options:ee}))))),o.createElement(b.A,{gutter:[10]},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Bullets color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"ColorBullets"},o.createElement(j.A,{placeholder:T("Bullets color"),usedColors:t.usedColors,isDisabled:s,onChange:e=>{oe(e),s&&c(!1)},externalValue:s?null===re||void 0===re?void 0:re.textColor:void 0})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Bullets size"),placement:"bottom"},o.createElement(u.A.Item,{name:"BulletsSize"},o.createElement(W.A,{min:8,max:90,defaultValue:null===t||void 0===t||null===(R=t.list)||void 0===R?void 0:R.bulletFontSize,placeholder:T("Bullets size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"}))))),"OL"===(null===t||void 0===t||null===(N=t.list)||void 0===N?void 0:N.listType)&&o.createElement(b.A,null,o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"BulletTextStrong",tooltipTitle:T(ne?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(_e.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"BulletTextItalic",tooltipTitle:T(ne?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"BulletTextStrikethrough",tooltipTitle:T(ne?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Ze,{form:e,elementSettings:t,name:"BulletTextUnderline",tooltipTitle:T(ne?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(Ke.A,{className:"selected-text-common-form__icon-radius"})}))),o.createElement(b.A,{gutter:[10],style:{marginTop:"-8px"}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Between list items"),placement:"bottom"},o.createElement(u.A.Item,{name:"SpacingBetweenParagraphs"},o.createElement(W.A,{min:5,max:100,placeholder:T("Between list items"),prefix:o.createElement(B.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:T("Between bullets and text"),placement:"bottom"},o.createElement(u.A.Item,{name:"SpacingBetweenBulletsAndText"},o.createElement(W.A,{min:1,max:100,placeholder:T("Between bullets and text"),prefix:o.createElement(S.A,null),addonAfter:"px"})))))))};var at=l(81149),it=l(2922),rt=l(60994);const nt=({form:e,elementSettings:t,showAddParagraph:l=!0,isButton:a=!1})=>{const{__:i}=(0,L.s9)(),r=(0,D.XW)(),c=(0,n.wA)(),{emailId:g}=(0,s.g)(),b=(0,n.d4)(g?m.Hs:d.gm).hasOwnProperty("type")?F.IE:F.Tm,[E,v]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&v(!0)}),[]);const S=e=>{r({operation:F.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"})},[B,k]=(0,o.useState)(t.textAlign),[x,w]=(0,o.useState)(t.linkHref),R=e=>k(e);return(0,o.useEffect)((()=>{k(t.textAlign),w(t.linkHref)}),[t]),o.createElement("div",{className:"selected_text_common_form_mobile"},o.createElement(A.A,{size:"8",split:o.createElement(h.A,{type:"vertical"})},o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement("div",{style:{width:190}},o.createElement(p.A,{trigger:["hover"],title:i("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"fontFamily"},o.createElement(et.A,{textEditor:!0,codeMode:!0})))),o.createElement("div",{style:{width:90}},o.createElement(p.A,{trigger:["hover"],title:i("Font size"),placement:"bottom"},o.createElement(u.A.Item,{name:"fontSize"},o.createElement(W.A,{min:8,max:90,placeholder:i("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"})))),o.createElement("div",{style:{width:90}},o.createElement(p.A,{trigger:["hover"],title:i("Line height"),placement:"bottom"},o.createElement(u.A.Item,{name:"lineHeight"},o.createElement(W.A,{min:10,max:110,placeholder:i("Line height"),prefix:o.createElement(Xe.A,null),addonAfter:"px"}))))),o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(Ze,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:i(E?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(_e.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Ze,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:i(E?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(ye.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Ze,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:i(E?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ye.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Ze,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:i(E?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(Ke.A,{className:"selected-td-form__icon-radius"})})),o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(p.A,{trigger:["hover"],title:i("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textColor",rules:[{message:i("Please set the font color")}]},o.createElement(j.A,{placeholder:i("Color"),usedColors:t.usedColors,codeMode:!0}))),!a&&o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:i("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:i("Please set the background color")}]},o.createElement(j.A,{placeholder:i("Background color"),usedColors:t.usedColors}))))),l&&o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(o.Fragment,null,"string"===typeof x?o.createElement($e.A,{arrow:!0,dropdownRender:()=>o.createElement(p.A,{trigger:["hover"],title:i("The URL that the hyperlink directs to."),placement:"bottom"},o.createElement(u.A.Item,{name:"linkHref"},o.createElement(_.A,{allowClear:!0,placeholder:"href",prefix:o.createElement(y.A,null),autoFocus:null===t||void 0===t?void 0:t.isNewLink}))),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:520,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},o.createElement("div",null,o.createElement(Ze,{form:e,className:"selected-td-form__button selected-td-form__button_style selected-td-form__button--active",elementSettings:t,name:"textLink",icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),showTooltip:!1}))):o.createElement(Ze,{form:e,className:"selected-td-form__button selected-td-form__button_style",elementSettings:t,name:"textLink",tooltipTitle:i("Link"),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"})}),o.createElement($e.A,{arrow:!0,dropdownRender:()=>o.createElement(Je.A,{form:e,elementSettings:t,name:"textAlign",setAlignStateHandle:R}),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:615,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},o.createElement(f.Ay,{icon:"right"===B?o.createElement(at.A,null):"center"===B?o.createElement(it.A,null):o.createElement(rt.A,null),className:"selected-td-form__button"})))),o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},l&&o.createElement(p.A,{trigger:["hover"],title:i("Add paragraph"),placement:"bottom"},o.createElement(f.Ay,{icon:o.createElement(O.A,{icon:"Paragraph"}),onClick:()=>S("add_p"),className:"selected-td-form__button"})),o.createElement(p.A,{trigger:["hover"],title:i("Add inline image"),placement:"bottom"},o.createElement(f.Ay,{icon:o.createElement(O.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),onClick:()=>S("add_img"),className:"selected-td-form__button"})),o.createElement(f.Ay,{icon:o.createElement(O.A,{icon:"Typograf"}),className:"selected-td-form__button"}),o.createElement(f.Ay,{icon:o.createElement(te.A,null),type:"icon",style:{marginLeft:26},onClick:()=>{r({operation:F.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),c((0,Fe.Fk)()),setTimeout((()=>{b===F.IE?c((0,d.A9)({type:null})):c((0,m.A9)({type:null}))}),300)}}))))},mt=({form:e,elementSettings:t,imgParent:l,name:a="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,m]=(0,o.useState)(null===(i=t[a])||void 0===i?void 0:i.value),d=(0,D.XW)(),s=l=>{const o=l.target.value,i={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};o!==n?m(o):(m(""),e.setFieldsValue(i),d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return o.createElement(u.A.Item,{name:a},o.createElement(C.Ay.Group,{disabled:l&&!t.parent},o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:r("Text align left")},o.createElement(C.Ay.Button,{value:"left",onClick:s},o.createElement(rt.A,null))),o.createElement(p.A,{placement:"bottom",title:r("Text align center")},o.createElement(C.Ay.Button,{value:"center",onClick:s},o.createElement(it.A,null))),o.createElement(p.A,{placement:"bottom",title:r("Text align right")},o.createElement(C.Ay.Button,{value:"right",onClick:s},o.createElement(at.A,null))),o.createElement(p.A,{placement:"bottom",title:r("Text align justify")},o.createElement(C.Ay.Button,{value:"justify",onClick:s},o.createElement(O.A,{icon:"Justify"}))))))};mt.defaultProps={imgParent:!1};const dt=mt,st=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,n.wA)(),a=(0,D.XW)(),[i]=u.A.useForm(),r=(0,n.d4)(m.Hs),s=(0,n.d4)(Fe.Ct),c=(0,n.d4)(Fe.CS),h=(0,n.d4)(Fe.Fv),f=(0,n.d4)(Fe.yy),v=h&&"bottom"!==f,[A,_]=(0,o.useState)("https://"),[y,S]=(0,o.useState)(!1),B=(0,tt.A)(),k=(0,o.useMemo)((()=>B),[]),x=r.hasOwnProperty("type")?F.IE:F.Tm,w=(0,o.useCallback)((e=>{l(x===F.Tm?(0,m.A9)(e):(0,d.A9)(e))}),[l,x]);(0,o.useEffect)((()=>{var t,l,o,a,r,n,m,d,s,c,u,p,g,b,E,h;e&&i.setFieldsValue({...e,linkHref:e.linkHref?e.linkHref:"https://",mobileFontSize:(0,Ge.ok)((null===(t=e.mobileFontSize)||void 0===t?void 0:t.value)||e.fontSize),mobileFontSizeDim:(null===(l=e.mobileFontSize)||void 0===l?void 0:l.dim)||e.fontSizeDim,mobileLineHeight:(0,Ge.ok)((null===(o=e.mobileLineHeight)||void 0===o?void 0:o.value)||e.lineHeight),mobileLineHeightDim:(null===(a=e.mobileLineHeight)||void 0===a?void 0:a.dim)||e.lineHeightDim,mobileTextAlign:(0,Ge.ok)((null===(r=e.mobileTextAlign)||void 0===r?void 0:r.value)||e.textAlign),SpacingBetweenBulletsAndText:null===e||void 0===e||null===(n=e.list)||void 0===n?void 0:n.betweenRowCell,SpacingBetweenParagraphs:null===e||void 0===e||null===(m=e.list)||void 0===m?void 0:m.betweenParagraphs,BulletsSize:null===e||void 0===e||null===(d=e.list)||void 0===d?void 0:d.bulletFontSize,ColorBullets:null===e||void 0===e||null===(s=e.list)||void 0===s?void 0:s.bulletsColor,BulletTextStrong:null===e||void 0===e||null===(c=e.list)||void 0===c?void 0:c.bulletFontBold,BulletTextItalic:null===e||void 0===e||null===(u=e.list)||void 0===u?void 0:u.bulletFontItalic,CheckboxColor:y,BulletsFontFamily:null===e||void 0===e||null===(p=e.list)||void 0===p?void 0:p.bulletFontFamily,BulletTextUnderline:null===e||void 0===e||null===(g=e.list)||void 0===g?void 0:g.bulletFontUnderline,BulletTextStrikethrough:null===e||void 0===e||null===(b=e.list)||void 0===b?void 0:b.bulletFontStrikethrough,BulletType:null!==(E=null===(h=k.find((t=>{var l;return t.symbol===(null===e||void 0===e||null===(l=e.list)||void 0===l?void 0:l.bulletType)})))||void 0===h?void 0:h.code)&&void 0!==E?E:k[0].code})}),[i,e]);return o.createElement(u.A,{form:i,layout:"vertical",name:"selected_text_form",autoComplete:"off",onValuesChange:t=>{var l,o;const r=i.getFieldsValue(!0),n=Object.keys(t)[0];let m;switch(n){case"mobileFontSize":m={[n]:{classNamePrefix:"em-mob-font_size-",value:t[n],dim:r.mobileFontSizeDim}};break;case"mobileLineHeight":m={[n]:{classNamePrefix:"em-mob-line_height-",value:t[n],dim:r.mobileLineHeightDim}};break;case"mobileTextAlign":m={[n]:{classNamePrefix:"em-mob-text_align-",value:t[n]}};break;case"linkHref":let e=t[n];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),i.setFieldValue("linkHref",e)),m={[n]:e},"https://"===t[n].substring(0,8)||"http://"===t[n].substring(0,7)?_("https://"):"mailto:"===t[n].substring(0,7)?_("mailto:"):"tel:"===t[n].substring(0,4)?_("tel:"):"sms:"===t[n].substring(0,4)?_("sms:"):"ftp://"===t[n].substring(0,6)?_("ftp://"):"skype:"===t[n].substring(0,6)?_("skype:"):"viber:"===t[n].substring(0,6)?_("viber:"):_("");break;default:m=t}a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:m}),w({...e,list:{...e.list,bulletsColor:i.getFieldValue("ColorBullets"),bulletFontFamily:i.getFieldValue("BulletsFontFamily"),bulletFontSize:i.getFieldValue("BulletsSize"),betweenParagraphs:i.getFieldValue("SpacingBetweenParagraphs"),betweenRowCell:i.getFieldValue("SpacingBetweenBulletsAndText"),bulletType:null!==(l=null===(o=k.find((e=>e.code===i.getFieldValue("BulletType"))))||void 0===o?void 0:o.symbol)&&void 0!==l?l:k[0].symbol},...m,activateSection:null,changeKey:n})},className:"element-controls",initialValues:{textAlign:"left",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textColor:"",textBackgroundColor:"",textLink:!1,textReplacer:"",SpacingBetweenBulletsAndText:0,SpacingBetweenParagraphs:0,BulletsSize:0,ColorBullets:"",BulletTextStrong:!1,BulletTextItalic:!1,CheckboxColor:!1,BulletsFontFamily:"",BulletTextUnderline:!1,BulletTextStrikethrough:!1,BulletType:""}},!v&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),!(s===F.ND&&!v&&c.styles)&&o.createElement("div",{id:"selected_element_form_desktop_props",style:{paddingRight:0}},o.createElement("div",{className:"selected_form-props-wrapper"},v?o.createElement(nt,{form:i,elementSettings:e}):o.createElement(ot,{form:i,elementSettings:e,linkProtocol:A,setLinkProtocol:_,isBulletFontColorChecked:y,setIsBulletFontColorChecked:S}))),!v&&o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===F.ND&&c.styles?"block":"none"}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement(dt,{form:i,elementSettings:e,name:"mobileTextAlign"}))),!!e.showOnMobile&&o.createElement(ot,{form:i,elementSettings:e,linkProtocol:A,setLinkProtocol:_}),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(qe,null)),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"mobileLineHeight"},o.createElement(W.A,{min:0,placeholder:t("Line height"),prefix:o.createElement(Xe.A,null),addonAfter:"px"})))))))};var ct=l(78469),ut=l(31573),pt=l(39672),gt=l(70552),bt=l(88647);const Et=({form:e,oneMobileBorderRadiusValue:t,setOneMobileBorderRadiusValue:l,elementSettings:a})=>{const{__:i}=(0,L.s9)(),n=(0,D.XW)();return o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"start"},o.createElement(u.A.Item,{name:"mobileBorderRadiusAll"},o.createElement(W.A,{min:0,placeholder:i("Border radius"),prefix:o.createElement(bt.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const o=e.getFieldsValue(!0);t&&e.setFieldsValue({mobileBorderRadiusTopLeft:o.mobileBorderRadiusAll,mobileBorderRadiusBottomLeft:o.mobileBorderRadiusAll,mobileBorderRadiusTopRight:o.mobileBorderRadiusAll,mobileBorderRadiusBottomRight:o.mobileBorderRadiusAll}),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileBorderRadius:{all:o.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}}),l((e=>!e))}},o.createElement(bt.h,{className:"selected-td-form__icon-radius"}))),o.createElement(E.A,null,o.createElement(b.A,{gutter:10,style:{marginTop:-10}},o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:i("Top left corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusTopLeft",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,prefix:o.createElement(ct.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(p.A,{placement:"bottom",title:i("Bottom left corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusBottomLeft"},o.createElement(W.A,{min:0,prefix:o.createElement(ut.A,null),style:{minHeight:10},addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:i("Top right corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusTopRight",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,prefix:o.createElement(pt.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(p.A,{placement:"bottom",title:i("Bottom right corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusBottomRight"},o.createElement(W.A,{min:0,prefix:o.createElement(gt.A,null),style:{minHeight:10},addonAfter:"px"})))))))},ht=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)(),a=(0,o.useRef)(),i=(0,n.d4)(m.uJ),[r,d]=(0,o.useState)(!t.mobileBoxShadow||0===t.mobileBoxShadow.hOffset&&0===t.mobileBoxShadow.vOffset&&0===t.mobileBoxShadow.blurRadius&&0===t.mobileBoxShadow.spreadRadius&&0===t.mobileBoxShadow.spreadRadius),s=(0,D.XW)(),c=e=>{d(!1)};return o.createElement(o.Fragment,null,o.createElement("div",{style:{float:"right",marginTop:-9,marginRight:50}},o.createElement(A.A,{size:8,align:"end"},o.createElement(q.A,{ref:a,size:"small",checked:r,onChange:l=>{d((e=>!e)),e.setFieldsValue({mobileBoxShadowHOffset:r?"":0,mobileBoxShadowVOffset:r?"":0,mobileBoxShadowBlurRadius:r?"":0,mobileBoxShadowSpreadRadius:r?"":0,mobileBoxShadowColor:"",mobileBoxShadowInset:!1}),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBoxShadow:{classNamePrefix:"em-mob-box_shadow-",hOffset:r?null:0,vOffset:r?null:0,blurRadius:r?null:0,spreadRadius:r?null:0,color:null,inset:!1}}})},id:"without-shadow"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-shadow"},l("Without shadow"))))),o.createElement("p",{style:{paddingBottom:"8px",margin:"-30px 0 0"}},"\xa0"),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Horizontal offset")},o.createElement(u.A.Item,{name:"mobileBoxShadowHOffset",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:l("Horizontal offset"),prefix:o.createElement(G.A,null),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Vertical offset")},o.createElement(u.A.Item,{name:"mobileBoxShadowVOffset",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:l("Vertical offset"),prefix:o.createElement(G.A,{style:{transform:"rotate(90deg)"}}),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Blur radius")},o.createElement(u.A.Item,{name:"mobileBoxShadowBlurRadius",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:l("Blur radius"),prefix:o.createElement(O.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Spread radius")},o.createElement(u.A.Item,{name:"mobileBoxShadowSpreadRadius",className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:l("Spread radius"),prefix:o.createElement(O.A,{icon:"ZoomOutMap"}),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"start"},o.createElement(u.A.Item,{name:"mobileBoxShadowColor"},o.createElement(j.A,{usedColors:i.usedColors})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:l("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},o.createElement(u.A.Item,{name:"mobileBoxShadowInset",valuePropName:"checked"},o.createElement(H.A,{style:{width:"100%"},options:[{label:l("Outside"),value:!1},{label:l("Inside"),value:!0}]}))))))},{useToken:ft}=c.A,vt=({form:e,elementSettings:t,label:l})=>{var a;const{__:i}=(0,L.s9)(),r=(0,o.useRef)(),[n,m]=(0,o.useState)("none"===(null===(a=t.mobileBackgroundColor)||void 0===a?void 0:a.value)),{token:d}=ft(),s=(0,D.XW)();return o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:i("Background color"),placement:"left"},o.createElement(u.A.Item,{name:"mobileBackgroundColor",style:{marginBottom:d.formItemMarginBottomXS/2}},o.createElement(j.A,{onChange:e=>{m(!1)},placeholder:l,usedColors:t.usedColors})),o.createElement(A.A,{size:8,align:"end"},o.createElement(q.A,{ref:r,size:"small",checked:n,onChange:l=>{e.setFieldsValue({mobileBackgroundColor:""}),m((e=>!e)),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:n?"":"none"}}})},id:"without-background-color"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-background-color"},i("Without background color"))))))};l(3783);const At=(e,t)=>{const{__:l}=(0,L.s9)();return o.createElement(p.A,{title:l("During export, the element is converted into an image."),key:"exportAsPicture"},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"exportAsPicture",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"convern-in-image"})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"convern-in-image"},l("Convert into an image")))))},{Option:_t}=X.A,yt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(_t,{value:"px"},"px"),o.createElement(_t,{value:"%"},"%")),{useToken:St}=c.A,Bt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),[i,r]=(0,o.useState)({}),[m,d]=(0,o.useState)({}),[s,c]=(0,o.useState)(!0),[v,A]=(0,o.useState)({}),[_,y]=(0,o.useState)({}),[B,w]=(0,o.useState)(!0),R=(0,n.d4)(Fe.Ct),N=(0,n.d4)(Fe.CS),C=(0,Ve.rD)(),[M,z]=(0,o.useState)(""===e.backgroundImage[0].value),{token:H}=St(),G=(0,n.d4)(Fe.Fv),q=(0,n.d4)(Fe.yy),$=G&&"bottom"!==q,[Y,K]=(0,o.useState)(!1),[Z,J]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),[le,oe]=(0,o.useState)(!1),[ae,ie]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[me,de]=(0,o.useState)(!1),[se,ue]=(0,o.useState)(!1),[ge,be]=(0,o.useState)(!1),[Ee,he]=(0,o.useState)(!1),[ve,Ae]=(0,o.useState)(!1),_e=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],ye=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}];(0,o.useEffect)((()=>{if(e){var t,l,o,i,n,m,s,u,p,g,b,E,h,f,v,_,S,B,k,x,R,N,T,I,P,C,L,O,F,D,M,V,H,G,W,j,U,X,q,$,Y,Q,Z;const ee=e.border,le=e.boxShadow,ae=e.mobileBorder,re=e.mobileBoxShadow;r(ee),d(le),A(ae),y(re);const me=Object.keys(ee).find((e=>{var t,l,o;return(null===(t=ee[e])||void 0===t?void 0:t.width)||(null===(l=ee[e])||void 0===l?void 0:l.style)||(null===(o=ee[e])||void 0===o?void 0:o.color)})),se=Object.keys(ae).find((e=>{var t,l,o;return(null===(t=ae[e])||void 0===t?void 0:t.width)||(null===(l=ae[e])||void 0===l?void 0:l.style)||(null===(o=ae[e])||void 0===o?void 0:o.color)}));a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,maxWidth:null===(o=e.maxWidth)||void 0===o?void 0:o.value,maxWidthDim:null===(i=e.maxWidth)||void 0===i?void 0:i.dim,minWidth:null===(n=e.minWidth)||void 0===n?void 0:n.value,minWidthDim:null===(m=e.minWidth)||void 0===m?void 0:m.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderPosition:me||"all",borderWidth:(null===(s=ee[me])||void 0===s?void 0:s.width)||"",borderColor:(null===(u=ee[me])||void 0===u?void 0:u.color)||"",borderStyle:(null===(p=ee[me])||void 0===p?void 0:p.style)||"",borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(g=e.boxShadow)||void 0===g?void 0:g.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(b=e.boxShadow)||void 0===b?void 0:b.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(E=e.boxShadow)||void 0===E?void 0:E.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(h=e.boxShadow)||void 0===h?void 0:h.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(v=e.boxShadow)||void 0===v?void 0:v.color),mobileWidth:(0,Ge.xc)(null===(_=e.mobileWidth)||void 0===_?void 0:_.value),mobileWidthDim:null===(S=e.mobileWidth)||void 0===S?void 0:S.dim,mobileAlign:null===(B=e.mobileAlign)||void 0===B?void 0:B.value,mobileBorderPosition:se||"all",mobileBorderWidth:null!==(null===(k=ae[se])||void 0===k?void 0:k.width)?null===(x=ae[se])||void 0===x?void 0:x.width:"",mobileBorderColor:(null===(R=ae[se])||void 0===R?void 0:R.color)||"",mobileBorderStyle:(null===(N=ae[se])||void 0===N?void 0:N.style)||"",mobileBorderRadiusAll:(0,Ge.ok)(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Ge.ok)(null===(T=e.mobileBoxShadow)||void 0===T?void 0:T.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(I=e.mobileBoxShadow)||void 0===I?void 0:I.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(P=e.mobileBoxShadow)||void 0===P?void 0:P.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(C=e.mobileBoxShadow)||void 0===C?void 0:C.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(L=e.mobileBoxShadow)||void 0===L?void 0:L.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(O=e.mobileBoxShadow)||void 0===O?void 0:O.color),mobileBackgroundColor:(0,Ge.ok)("none"!==(null===(F=e.mobileBackgroundColor)||void 0===F?void 0:F.value)?null===(D=e.mobileBackgroundColor)||void 0===D?void 0:D.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,Ge.ok)(null===(M=e.mobileBackgroundPositionX)||void 0===M?void 0:M.value),mobileBackgroundPositionY:(0,Ge.ok)(null===(V=e.mobileBackgroundPositionY)||void 0===V?void 0:V.value),mobileBackgroundRepeat:null!==(H=e.mobileBackgroundRepeat)&&void 0!==H&&H.value?null===(G=e.mobileBackgroundRepeat)||void 0===G?void 0:G.value:"none",exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?c(!1):c(!0),(0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight)?w(!1):w(!0),z(""===e.backgroundImage[0].value),K(!(null===(W=ee[me])||void 0===W||!W.width)||!(null===(j=ee[me])||void 0===j||!j.style)||!(null===(U=ee[me])||void 0===U||!U.color)),J(!(null===(X=ae[se])||void 0===X||!X.width)||!(null===(q=ae[se])||void 0===q||!q.style)||!(null===($=ae[se])||void 0===$||!$.color)),te(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),oe(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),ie(!!e.boxShadow),ne(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),de(!(null===(Y=e.width)||void 0===Y||!Y.value)||!(null===(Q=e.minWidth)||void 0===Q||!Q.value)||!(null===(Z=e.maxWidth)||void 0===Z||!Z.value)),ue(!!e.mobileWidth.value),be(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),he(!!e.mobileBackgroundColor.value),Ae(!!e.exportAsPicture)}}),[a,e]);return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_table_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,show:"all",width:{value:"",dim:""},maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",mobileAlign:"",border:"",boxShadow:"",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileBackgroundColor:"",mobileBackgroundImage:""},onValuesChange:t=>{const o=a.getFieldsValue(!0),n=Object.keys(t)[0];let m;switch(n){case"exportAsPicture":m={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":m={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderStyle":m={border:{[o.borderPosition]:{...i[o.borderPosition],style:t[n]}}},"all"===o.borderPosition?r((e=>({...F.iV,[o.borderPosition]:{...e[o.borderPosition],style:t[n]}}))):r((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],style:t[n]}})));break;case"borderColor":m={border:{[o.borderPosition]:{...i[o.borderPosition],color:t[n]}}},"all"===o.borderPosition?r((e=>({...F.iV,[o.borderPosition]:{...e[o.borderPosition],color:t[n]}}))):r((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],color:t[n]}})));break;case"borderWidth":m={border:{[o.borderPosition]:{...i[o.borderPosition],width:t[n]}}},"all"===o.borderPosition?r((e=>({...F.iV,[o.borderPosition]:{...e[o.borderPosition],width:t[n]}}))):r((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],width:t[n]}})));break;case"borderPosition":a.setFieldsValue({borderWidth:i[t[n]].width||"",borderColor:i[t[n]].color||"",borderStyle:i[t[n]].style||""});break;case"width":m={[n]:{value:t[n],dim:o.widthDim}};break;case"widthDim":m={width:{value:o.width,dim:t[n]}};break;case"maxWidth":m={[n]:{value:t[n],dim:o.maxWidthDim}};break;case"maxWidthDim":m={maxWidth:{value:o.maxWidth,dim:t[n]}};break;case"minWidth":m={[n]:{value:t[n],dim:o.minWidthDim}};break;case"minWidthDim":m={minWidth:{value:o.minWidth,dim:t[n]}};break;case"backgroundImage":z(""===t[n]),m={[n]:[{...e.backgroundImage[0],value:t[n]}],backgroundSize:"cover"};break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":m={borderRadius:{[F.wF[n]]:+t[n]}};break;case"mobileWidth":m={[n]:{classNamePrefix:"em-mob-width-",value:t[n],dim:o.mobileWidthDim}};break;case"mobileWidthDim":m={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[n]}};break;case"mobileBorderStyle":m={mobileBorder:{[o.mobileBorderPosition]:{...v[o.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?A((e=>({...F.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):A((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":m={mobileBorder:{[o.mobileBorderPosition]:{...v[o.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?A((e=>({...F.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):A((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":m={mobileBorder:{[o.mobileBorderPosition]:{...v[o.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?A((e=>({...F.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):A((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":a.setFieldsValue({mobileBorderWidth:v[t[n]].width||"",mobileBorderColor:v[t[n]].color||"",mobileBorderStyle:v[t[n]].style||""});break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":m={mobileBorderRadius:{[Ge.NW[n]]:t[n],classNamePrefix:"em-mob-border_radius_"+Ge.NW[n]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":m={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileBackgroundColor":m={[n]:{classNamePrefix:"em-mob-background_color-",value:t[n]}};break;case"mobileBackgroundImage":m={[n]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[n]}]};break;case"mobileBackgroundPositionX":m={[n]:{classNamePrefix:"em-mob-background_position_x-",value:t[n]}};break;case"mobileBackgroundPositionY":m={[n]:{classNamePrefix:"em-mob-background_position_x-",value:t[n]}};break;case"mobileBackgroundRepeat":m={[n]:{classNamePrefix:"em-mob-background_repeat-",value:t[n]}};break;case"mobileAlign":m={[n]:{classNamePrefix:"em-mob-table_align-",value:t[n]}};break;default:m=t}"borderPosition"!==n&&l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:m})},autoComplete:"off",className:"element-controls"},!$&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),R===F.ND&&N.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement("div",{style:{paddingBottom:4}},o.createElement(pe,{form:a,elementSettings:e})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ue((e=>!e)),se&&(t.mobileWidth="",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"}}}))}))}},se?o.createElement(x.A,null):o.createElement(k.A,null)))),se&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},o.createElement("div",{style:{marginBottom:H.formItemMarginBottomMD+4}},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{he((e=>!e)),t.mobileBackgroundColor=Ee?"":"#E5E5E5",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Ee?o.createElement(x.A,null):o.createElement(k.A,null)))),Ee&&o.createElement("div",{style:{marginBottom:(C.formTableFieldBackgroundImageEnabled,H.formItemMarginBottomMD+4)}},o.createElement(vt,{form:a,elementSettings:e})),!1,C.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{J((e=>!e)),Z&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),A((e=>({...F.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},Z?o.createElement(x.A,null):o.createElement(k.A,null)))),Z&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(ce,{mobileBorders:v}))),C.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{oe((e=>!e)),le?(t.mobileBorderRadiusAll=null,w(!0)):t.mobileBorderRadiusAll=5,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},le?o.createElement(x.A,null):o.createElement(k.A,null)))),le&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Et,{form:a,oneMobileBorderRadiusValue:B,setOneMobileBorderRadiusValue:w,elementSettings:e}))),C.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},re?o.createElement(x.A,null):o.createElement(k.A,null)))),re&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(ht,{mobileBoxShadow:_,form:a,elementSettings:e}))),C.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement("div",{style:{paddingBottom:4}},o.createElement(fe,{elementSettings:e,form:a}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement("div",{style:{paddingBottom:4}},o.createElement(V,{form:a,elementSettings:e,tooltipTitle:t("The align attribute sets the horizontal alignment of the table.")})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{de((e=>!e)),me&&(t.width="",t.minWidth="",t.maxWidth="",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},minWidth:{value:null,dim:"px"},maxWidth:{value:null,dim:"px"}}}))}))}},me?o.createElement(x.A,null):o.createElement(k.A,null)))),me&&o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:H.formItemMarginBottomXS}},o.createElement(W.A,{min:0,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},yt),style:{width:"100%"}}))),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"left"},o.createElement(u.A.Item,{name:"minWidth"},o.createElement(W.A,{min:0,placeholder:t("Table min width"),prefix:o.createElement(O.A,{icon:"MinWidth"}),addonAfter:o.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},yt)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"top"},o.createElement(u.A.Item,{name:"maxWidth"},o.createElement(W.A,{min:0,placeholder:t("Table max width"),prefix:o.createElement(O.A,{icon:"MaxWidth"}),addonAfter:o.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},yt)})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),ge?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",z(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},ge?o.createElement(x.A,null):o.createElement(k.A,null)))),ge&&o.createElement(b.A,{gutter:10,style:{marginBottom:M?16:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:C.formTableFieldBackgroundImageEnabled?H.formItemMarginBottomXS:H.formItemMarginBottomMD+4}},o.createElement(j.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),C.formTableFieldBackgroundImageEnabled&&o.createElement(E.A,{span:M?12:24},o.createElement("div",{style:{paddingBottom:M?4:0}},o.createElement(T.A,{form:a,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!M&&o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:H.formItemMarginBottomXS}},o.createElement(W.A,{placeholder:t("Horizontal position"),prefix:o.createElement(O.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:H.formItemMarginBottomXS}},o.createElement(W.A,{placeholder:t("Vertical position"),prefix:o.createElement(O.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:H.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:"Please choose",options:_e,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:H.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:"Please choose",options:ye,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),C.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{K((e=>!e)),Y&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),r((e=>({...F.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},Y?o.createElement(x.A,null):o.createElement(k.A,null)))),Y&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(I.A,{borders:i}))),C.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{te((e=>!e)),ee?(t.borderRadiusAll=0,c(!0)):t.borderRadiusAll=5,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ee?o.createElement(x.A,null):o.createElement(k.A,null)))),ee&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:s,setOneBorderRadiusValue:c,elementSettings:e}))),C.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ie((e=>!e)),ae?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},ae?o.createElement(x.A,null):o.createElement(k.A,null)))),ae&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(U,{boxShadow:m}))),C.formFieldExportAsPictureEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Export settings"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve&&(t.exportAsPicture=!1,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},ve?o.createElement(x.A,null):o.createElement(k.A,null)))),ve&&o.createElement(At,{form:a,elementSettings:e})),C.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement("div",{style:{paddingBottom:4}},o.createElement(fe,{elementSettings:e,form:a}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))};var kt=l(10206);const xt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),i=(0,Ve.rD)(),r=(0,n.d4)(Fe.Fv),m=(0,n.d4)(Fe.yy),[d,s]=(0,o.useState)({});(0,o.useEffect)((()=>{e&&a.setFieldsValue(e)}),[a,e]);return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_link_form",initialValues:{href:"https://",target:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textReplacer:""},onValuesChange:t=>{l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off",className:"element-controls"},r&&"bottom"!==m?o.createElement(nt,{form:a,elementSettings:e,showAddParagraph:!1}):o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"left"},o.createElement(u.A.Item,{name:"href",style:{marginBottom:24,paddingRight:10}},o.createElement(_.A,{allowClear:!0,placeholder:"href",prefix:o.createElement(y.A,null),onSelect:({target:e})=>{const{selectionStart:t,selectionEnd:l}=e;e&&s({target:e,selection:{start:t,end:l}})}}))),i.formLinkFieldInsertImageEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Actions with the chosen text")),o.createElement(u.A.Item,null,o.createElement(f.Ay,{icon:o.createElement(kt.A,null),onClick:()=>{return e="add_img",void l({operation:F.Ru.SANDBOX_ELEMENT_TEXT,action:e});var e}},t("Add inline image")))),o.createElement(ot,{form:a,elementSettings:e,showAddParagraph:!1,linkTarget:d})))},wt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[l]=u.A.useForm(),a=(0,n.wA)(),i=(0,n.d4)(m.Hs),r=(0,D.XW)(),s=(0,n.d4)(Fe.Ct),c=(0,n.d4)(Fe.CS),h=(0,n.d4)(Fe.Fv),f=(0,n.d4)(Fe.yy),v=h&&"bottom"!==f,A=i.hasOwnProperty("type")?F.IE:F.Tm;(0,o.useEffect)((()=>{var t,o,a,i,r,n,m;e&&l.setFieldsValue({...e,height:null===(t=e.height)||void 0===t?void 0:t.value,heightDim:null===(o=e.height)||void 0===o?void 0:o.dim,mobileHeight:(m=(null===(a=e.mobileHeight)||void 0===a?void 0:a.value)||(null===(i=e.height)||void 0===i?void 0:i.value),m&&"auto"!==m?m:0===m?"0":""),mobileHeightDim:(null===(r=e.mobileHeight)||void 0===r?void 0:r.dim)||(null===(n=e.height)||void 0===n?void 0:n.dim)})}),[l,e]);const _=(0,o.useCallback)((e=>{a(A===F.Tm?(0,m.A9)(e):(0,d.A9)(e))}),[a,A]);return o.createElement(u.A,{form:l,layout:"vertical",name:"selected_vindent_form",initialValues:{height:"",heightDim:"",mobileHeight:"",mobileHeightDim:""},onValuesChange:t=>{const o=l.getFieldsValue(!0),a=Object.keys(t)[0];let i;switch(a){case"height":i={[a]:{value:t[a],dim:o.heightDim}};break;case"heightDim":i={height:{value:o.height,dim:t[a]}};break;case"mobileHeight":i={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:o.mobileHeightDim}};break;case"mobileHeightDim":i={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[a]}};break;default:i=t}r({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:i}),_({...e,...i,activateSection:null,changeKey:a})},autoComplete:"off"},!v&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),s===F.ND&&c.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===F.ND&&c.styles?"block":"none",marginBottom:10}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:10,style:{marginBottom:20}},o.createElement(E.A,{span:12},o.createElement(J,{form:l,name:"mobileHeight",elementSettings:e}))))):o.createElement("div",{id:"selected_element_form_desktop_props",style:{display:s===F.ND&&c.styles?"none":"block"}},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:14},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Indent height"),prefix:o.createElement(B.A,null),addonAfter:"px"})))))))};var Rt=l(50078),Nt=l(35850);const Tt=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)(),a=(0,D.XW)(),[i,r]=(0,o.useState)(t.direction),n=l=>{const o=l.target.value,n={direction:""};o!==i?r(o):(r(""),e.setFieldsValue(n),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:n}))};return o.createElement(u.A.Item,{name:"direction"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"top",title:l("Right to left")},o.createElement(C.Ay.Button,{value:"rtl",onClick:n},o.createElement(Rt.A,null))),o.createElement(p.A,{placement:"top",title:l("Left to right")},o.createElement(C.Ay.Button,{value:"ltr",onClick:n},o.createElement(Nt.A,null))))))};Tt.defaultProps={};const It=Tt,{useToken:Pt}=c.A,Ct=({form:e,elementSettings:t,mobilePaddingsExt:l,setMobilePaddingsExt:a})=>{const{__:i}=(0,L.s9)(),{token:n}=Pt(),m=(0,D.XW)();return o.createElement(o.Fragment,null,o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:l?"block":"none"}},o.createElement(p.A,{title:i("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingLeftRight"},o.createElement(W.A,{min:0,placeholder:i("Horizontal"),prefix:o.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:l?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:i("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingLeft",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(W.A,{min:0,placeholder:i("Left"),prefix:o.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:i("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingRight"},o.createElement(W.A,{min:0,placeholder:i("Right"),prefix:o.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:l?"block":"none"}},o.createElement(p.A,{title:i("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingTopBottom"},o.createElement(W.A,{min:0,placeholder:i("Vertical"),prefix:o.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:l?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:i("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingTop",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(W.A,{min:0,placeholder:i("Top"),prefix:o.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:i("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingBottom"},o.createElement(W.A,{min:0,placeholder:i("Bottom"),prefix:o.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},o.createElement(p.A,{title:i("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!l}),onClick:()=>{a((e=>!e));const o=e.getFieldsValue(!0);l||(o.mobilePaddingLeftRight=o.mobilePaddingLeft,o.mobilePaddingTopBottom=o.mobilePaddingTop,o.mobilePaddingRight=o.mobilePaddingLeft,o.mobilePaddingBottom=o.mobilePaddingTop,m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobilePadding:{top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,bottom:""!==o.mobilePaddingTopBottom?o.mobilePaddingTopBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,classNamePrefix:"em-mob-padding_"}}}))}},o.createElement(O.A,{icon:"PaddingSwitcher"})))))},Lt=({form:e,elementSettings:t})=>{var l;const{__:a}=(0,L.s9)(),[i,r]=(0,o.useState)(null===(l=t.mobileDirection)||void 0===l?void 0:l.value),n=(0,D.XW)(),m=l=>{const o=l.target.value,a={mobileDirection:{classNamePrefix:"em-mob-direction-",value:""}};o!==i?r(o):(r(""),e.setFieldsValue(a),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(u.A.Item,{name:"mobileDirection"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"top",title:a("Right to left")},o.createElement(C.Ay.Button,{value:"rtl",onClick:m},o.createElement(Rt.A,null))),o.createElement(p.A,{placement:"top",title:a("Left to right")},o.createElement(C.Ay.Button,{value:"ltr",onClick:m},o.createElement(Nt.A,null))))))};Lt.defaultProps={};const Ot=Lt,{Option:Ft}=X.A,Dt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(Ft,{value:"px"},"px"),o.createElement(Ft,{value:"%"},"%")),{useToken:Mt}=c.A,Vt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),a=(0,n.wA)(),[i]=u.A.useForm(),[s,c]=(0,o.useState)(""),[v,y]=(0,o.useState)({}),[w,R]=(0,o.useState)(!0),[N,C]=(0,o.useState)(!0),M=(0,n.d4)(Fe.Ct),V=(0,n.d4)(Fe.CS),H=(0,n.d4)(m.Hs),G=(0,Ve.rD)(),[$,Y]=(0,o.useState)(""===e.backgroundImage[0].value),{token:K}=Mt(),Z=(0,n.d4)(Fe.Fv),ee=(0,n.d4)(Fe.yy),te=Z&&"bottom"!==ee,[le,oe]=(0,o.useState)(!1),[ae,ie]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[me,de]=(0,o.useState)(!1),[se,ce]=(0,o.useState)(!1),[ue,be]=(0,o.useState)(!1),[Ee,he]=(0,o.useState)(!1),[ve,Ae]=(0,o.useState)(!1),[_e,ye]=(0,o.useState)(!1),[Se,Be]=(0,o.useState)(!1),[ke,xe]=(0,o.useState)(!1),[we,Re]=(0,o.useState)(!1),[Ne,Te]=(0,o.useState)(!1),[Ie,Ce]=(0,o.useState)(!1),Le=H.hasOwnProperty("type")?F.IE:F.Tm,Oe=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],De=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}],Me=e.border,ze=e.mobileBorder,He=Object.keys(Me).find((e=>{var t,l,o;return(null===(t=Me[e])||void 0===t?void 0:t.width)||(null===(l=Me[e])||void 0===l?void 0:l.style)||(null===(o=Me[e])||void 0===o?void 0:o.color)})),We=Object.keys(ze).find((e=>{var t,l,o;return(null===(t=ze[e])||void 0===t?void 0:t.width)||(null===(l=ze[e])||void 0===l?void 0:l.style)||(null===(o=ze[e])||void 0===o?void 0:o.color)})),je=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,a,r,n,m,d,s,c,u,p,g,b,E,h,f,v,A,_,S,B,k,x,w,N,T,I,P,L,O,F,D,M,V,z,H,G,W,j,U,X,q,$,K,Q,Z,J,ee,te,le,ae,re,me,se,ue,pe,ge,Ee,fe,ve,_e,Se,ke,we,Ne,Ie,Pe,Le,Oe,Fe,De,Me,Ve,ze,Ue,Xe,qe,$e,Ye,Ke,Qe,Ze,Je,et,tt,lt,ot,at,it,rt,nt,mt,dt;const st=e.boxShadow;y(st),i.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(a=e.height)||void 0===a?void 0:a.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",isContrastBlock:e.isContrastBlock,borderAll:(0,Ge.ok)(e.border.all),borderTop:(0,Ge.ok)(e.border.top),borderBottom:(0,Ge.ok)(e.border.bottom),borderRight:(0,Ge.ok)(e.border.right),borderLeft:(0,Ge.ok)(e.border.left),mobileBorderAll:je(e.mobileBorder.all)||!(je(e.mobileBorder.top)||je(e.mobileBorder.bottom)||je(e.mobileBorder.right)||je(e.mobileBorder.left))&&je(e.border.all),mobileBorderTop:je(e.mobileBorder.top)||!je(e.mobileBorder.all)&&je(e.border.top),mobileBorderBottom:je(e.mobileBorder.bottom)||!je(e.mobileBorder.all)&&je(e.border.bottom),mobileBorderRight:je(e.mobileBorder.right)||!je(e.mobileBorder.all)&&je(e.border.right),mobileBorderLeft:je(e.mobileBorder.left)||!je(e.mobileBorder.all)&&je(e.border.left),paddingTop:(0,Ge.ok)(null===(r=e.padding)||void 0===r?void 0:r.all)||(0,Ge.ok)(null===(n=e.padding)||void 0===n?void 0:n.top),paddingLeft:(0,Ge.ok)(null===(m=e.padding)||void 0===m?void 0:m.all)||(0,Ge.ok)(null===(d=e.padding)||void 0===d?void 0:d.left),paddingRight:(0,Ge.ok)(null===(s=e.padding)||void 0===s?void 0:s.all)||(0,Ge.ok)(null===(c=e.padding)||void 0===c?void 0:c.right),paddingBottom:(0,Ge.ok)(null===(u=e.padding)||void 0===u?void 0:u.all)||(0,Ge.ok)(null===(p=e.padding)||void 0===p?void 0:p.bottom),paddingLeftRight:(0,Ge.ok)(null===(g=e.padding)||void 0===g?void 0:g.left)||(0,Ge.ok)(null===(b=e.padding)||void 0===b?void 0:b.right),paddingTopBottom:(0,Ge.ok)(null===(E=e.padding)||void 0===E?void 0:E.top)||(0,Ge.ok)(null===(h=e.padding)||void 0===h?void 0:h.bottom),borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(v=e.boxShadow)||void 0===v?void 0:v.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(A=e.boxShadow)||void 0===A?void 0:A.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(_=e.boxShadow)||void 0===_?void 0:_.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(B=e.boxShadow)||void 0===B?void 0:B.color),mobileWidth:(0,Ge.xc)(null===(k=e.mobileWidth)||void 0===k?void 0:k.value)||(0,Ge.xc)(null===(x=e.width)||void 0===x?void 0:x.value),mobileWidthDim:(0,Ge.xc)(null===(w=e.mobileWidth)||void 0===w?void 0:w.value)?null===(N=e.mobileWidth)||void 0===N?void 0:N.dim:null===(T=e.width)||void 0===T?void 0:T.dim,mobileHeight:(0,Ge.xc)(null===(I=e.mobileHeight)||void 0===I?void 0:I.value)||(0,Ge.xc)(null===(P=e.height)||void 0===P?void 0:P.value),mobileHeightDim:(0,Ge.xc)(null===(L=e.mobileHeight)||void 0===L?void 0:L.value)?null===(O=e.mobileHeight)||void 0===O?void 0:O.dim:null===(F=e.height)||void 0===F?void 0:F.dim,mobileBorderRadiusAll:(0,Ge.ok)(null===(D=e.mobileBorderRadius)||void 0===D?void 0:D.all)||(0,Ge.ok)(null===(M=e.borderRadius)||void 0===M?void 0:M.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null===(V=e.mobileBorderRadius)||void 0===V?void 0:V.topLeft)||(0,Ge.ok)(null===(z=e.mobileBorderRadius)||void 0===z?void 0:z.all)||(0,Ge.ok)(null===(H=e.borderRadius)||void 0===H?void 0:H.topLeft)||(0,Ge.ok)(null===(G=e.borderRadius)||void 0===G?void 0:G.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null===(W=e.mobileBorderRadius)||void 0===W?void 0:W.bottomLeft)||(0,Ge.ok)(null===(j=e.mobileBorderRadius)||void 0===j?void 0:j.all)||(0,Ge.ok)(null===(U=e.borderRadius)||void 0===U?void 0:U.bottomLeft)||(0,Ge.ok)(null===(X=e.borderRadius)||void 0===X?void 0:X.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null===(q=e.mobileBorderRadius)||void 0===q?void 0:q.topRight)||(0,Ge.ok)(null===($=e.mobileBorderRadius)||void 0===$?void 0:$.all)||(0,Ge.ok)(null===(K=e.borderRadius)||void 0===K?void 0:K.topRight)||(0,Ge.ok)(null===(Q=e.borderRadius)||void 0===Q?void 0:Q.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null===(Z=e.mobileBorderRadius)||void 0===Z?void 0:Z.bottomRight)||(0,Ge.ok)(null===(J=e.mobileBorderRadius)||void 0===J?void 0:J.all)||(0,Ge.ok)(null===(ee=e.borderRadius)||void 0===ee?void 0:ee.bottomRight)||(0,Ge.ok)(null===(te=e.borderRadius)||void 0===te?void 0:te.all),mobileBoxShadowInset:null!=(null===(le=e.mobileBoxShadow)||void 0===le?void 0:le.inset)?e.mobileBoxShadow.inset:(null===(ae=e.boxShadow)||void 0===ae?void 0:ae.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(re=e.mobileBoxShadow)||void 0===re?void 0:re.hOffset)||(0,Ge.ok)(null===(me=e.boxShadow)||void 0===me?void 0:me.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(se=e.mobileBoxShadow)||void 0===se?void 0:se.vOffset)||(0,Ge.ok)(null===(ue=e.boxShadow)||void 0===ue?void 0:ue.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(pe=e.mobileBoxShadow)||void 0===pe?void 0:pe.blurRadius)||(0,Ge.ok)(null===(ge=e.boxShadow)||void 0===ge?void 0:ge.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(Ee=e.mobileBoxShadow)||void 0===Ee?void 0:Ee.spreadRadius)||(0,Ge.ok)(null===(fe=e.boxShadow)||void 0===fe?void 0:fe.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(ve=e.mobileBoxShadow)||void 0===ve?void 0:ve.color)||(0,Ge.ok)(null===(_e=e.boxShadow)||void 0===_e?void 0:_e.color),mobileAlign:(0,Ge.ok)(null===(Se=e.mobileAlign)||void 0===Se?void 0:Se.value)||e.align,mobileVerticalAlign:(0,Ge.ok)((null===(ke=e.mobileVerticalAlign)||void 0===ke?void 0:ke.value)||e.valign),mobileBackgroundColor:(0,Ge.ok)((null===(we=e.mobileBackgroundColor)||void 0===we?void 0:we.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(Ne=e.mobileBackgroundImage[0])||void 0===Ne?void 0:Ne.value)?null===(Ie=e.mobileBackgroundImage[0])||void 0===Ie?void 0:Ie.value:(null===(Pe=e.backgroundImage)||void 0===Pe?void 0:Pe[0].value)||"",mobileBackgroundPositionX:(0,Ge.ok)(null===(Le=e.mobileBackgroundPositionX)||void 0===Le?void 0:Le.value)||(0,Ge.ok)(null===(Oe=e.backgroundPositionX)||void 0===Oe?void 0:Oe.value),mobileBackgroundPositionY:(0,Ge.ok)(null===(Fe=e.mobileBackgroundPositionY)||void 0===Fe?void 0:Fe.value)||(0,Ge.ok)(null===(De=e.backgroundPositionY)||void 0===De?void 0:De.value),mobileBackgroundRepeat:!(null===(Me=e.mobileBackgroundRepeat)||void 0===Me||!Me.value)||e.backgroundRepeat||"none",mobilePaddingTop:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(null===(Ve=e.padding)||void 0===Ve?void 0:Ve.all)||(0,Ge.ok)(null===(ze=e.padding)||void 0===ze?void 0:ze.top),mobilePaddingLeft:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.left)||(0,Ge.ok)(null===(Ue=e.padding)||void 0===Ue?void 0:Ue.all)||(0,Ge.ok)(null===(Xe=e.padding)||void 0===Xe?void 0:Xe.left),mobilePaddingRight:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(null===(qe=e.padding)||void 0===qe?void 0:qe.all)||(0,Ge.ok)(null===($e=e.padding)||void 0===$e?void 0:$e.right),mobilePaddingBottom:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(null===(Ye=e.padding)||void 0===Ye?void 0:Ye.all)||(0,Ge.ok)(null===(Ke=e.padding)||void 0===Ke?void 0:Ke.bottom),mobilePaddingTopBottom:(0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(null===(Qe=e.padding)||void 0===Qe?void 0:Qe.top)||(0,Ge.ok)(null===(Ze=e.padding)||void 0===Ze?void 0:Ze.bottom),mobilePaddingLeftRight:(0,Ge.ok)(e.mobilePadding.left)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(null===(Je=e.padding)||void 0===Je?void 0:Je.left)||(0,Ge.ok)(null===(et=e.padding)||void 0===et?void 0:et.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?R(!1):R(!0),!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))||(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))||!(0,Ge.ok)(e.borderRadius.all)&&!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?C(!1):C(!0),Y(""===e.backgroundImage[0].value),(0,Ge.ok)(e.padding.all)||!((0,Ge.ok)(e.padding.top)||(0,Ge.ok)(e.padding.right)||(0,Ge.ok)(e.padding.bottom)||(0,Ge.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?oe(!0):oe(!1),!(0,Ge.ok)(e.mobilePadding.all)&&((0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(e.mobilePadding.left))&&(e.mobilePadding.top!==e.mobilePadding.bottom||e.mobilePadding.right!==e.mobilePadding.left)||!(0,Ge.ok)(null===(tt=e.padding)||void 0===tt?void 0:tt.all)&&((0,Ge.ok)(null===(lt=e.padding)||void 0===lt?void 0:lt.top)||(0,Ge.ok)(null===(ot=e.padding)||void 0===ot?void 0:ot.right)||(0,Ge.ok)(null===(at=e.padding)||void 0===at?void 0:at.bottom)||(0,Ge.ok)(null===(it=e.padding)||void 0===it?void 0:it.left))&&((null===(rt=e.padding)||void 0===rt?void 0:rt.top)!==(null===(nt=e.padding)||void 0===nt?void 0:nt.bottom)||(null===(mt=e.padding)||void 0===mt?void 0:mt.right)!==(null===(dt=e.padding)||void 0===dt?void 0:dt.left))?ie(!1):ie(!0),ne(!!He),de(!!He||!!We),ce(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),be(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),he(!!e.boxShadow),Ae(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),ye(!!e.width.value&&"column"!==e.type||!!e.height.value),Be(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value&&"column"!==e.type||!!e.height.value),xe(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Re(!!e.mobileBackgroundColor.value||!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Te(!!e.exportAsPicture||!!e.isContrastBlock),Ce(!!e.mobilePadding.all||0===e.mobilePadding.all||!!e.mobilePadding.top||0===e.mobilePadding.top||!!e.mobilePadding.bottom||0===e.mobilePadding.bottom||!!e.mobilePadding.left||0===e.mobilePadding.left||!!e.mobilePadding.right||0===e.mobilePadding.right||!!e.padding.all||0===e.padding.all||!!e.padding.top||0===e.padding.top||!!e.padding.bottom||0===e.padding.bottom||!!e.padding.left||0===e.padding.left||!!e.padding.right||0===e.padding.right)}}),[i,e]);const Ue=(0,o.useCallback)((e=>{a(Le===F.Tm?(0,m.A9)(e):(0,d.A9)(e))}),[a,Le]);return o.createElement(u.A,{form:i,layout:"vertical",name:"selected_td_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",show:"all",borderPosition:Ge.uE[He]||"borderAll",mobileBorderPosition:Ge.lS[We]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",boxShadowInset:"",boxShadowHOffset:"",boxShadowVOffset:"",boxShadowBlurRadius:"",boxShadowSpreadRadius:"",boxShadowColor:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1},onValuesChange:t=>{const o=i.getFieldsValue(!0),a=Object.keys(t)[0];let r;switch(c("%"===i.getFieldsValue(!0).widthDim?100:""),a){case"exportAsPicture":r={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":r={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var n,m,d;if("borderAll"===o.borderPosition)r={border:{...F.iV,all:{...Ge.RH,...o.borderAll}}},i.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(n=o.borderAll)&&void 0!==n&&n.width||null!==(m=o.borderAll)&&void 0!==m&&m.style||null!==(d=o.borderAll)&&void 0!==d&&d.color?(r={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[Ge.Vz[a]]:{...o[a],...t[a]}}},i.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[a]:{...o[a],...t[a]}})):(r={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[Ge.Vz[a]]:{...o[a],...t[a]}}},i.setFieldsValue({border:r.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var s,u,p;if("mobileBorderAll"===o.mobileBorderPosition)r={mobileBorder:{...F.iV,all:{...Ge.RH,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+Ge.ax[a]+"-"}}},i.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(s=o.mobileBorder.all)&&void 0!==s&&s.width||null!==(u=o.mobileBorder.all)&&void 0!==u&&u.style||null!==(p=o.mobileBorder.all)&&void 0!==p&&p.color?(r={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[Ge.ax[a]]:{...o[a],...t[a],classNamePrefix:"em-mob-border_"+Ge.ax[a]+"-"}}},i.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[a]:{...o[a],...t[a]}})):(r={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[Ge.ax[a]]:{...o[a],...t[a],classNamePrefix:"em-mob-border_"+Ge.ax[a]+"-"}}},i.setFieldsValue({mobileBorder:r.mobileBorder}));break;case"width":r={[a]:{value:t[a],dim:o.widthDim}};break;case"height":r={[a]:{value:t[a],dim:o.heightDim}};break;case"widthDim":r={width:{value:o.width,dim:t[a]}};break;case"heightDim":r={height:{value:o.height,dim:t[a]}};break;case"backgroundImage":Y(""===t[a]),r={[a]:[{...e.backgroundImage[0],value:t[a]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{left:o.paddingLeft,right:o.paddingRight,top:o.paddingTop,bottom:o.paddingBottom,[Ge.yy[a]]:+t[a]}};break;case"paddingTopBottom":r={padding:{left:o.paddingLeft,right:o.paddingRight,top:+t[a],bottom:+t[a]}},o.paddingTop=o.paddingBottom=+t[a];break;case"paddingLeftRight":r={padding:{top:o.paddingTop,bottom:o.paddingBottom,left:+t[a],right:+t[a]}},o.paddingLeft=o.paddingRight=+t[a];break;case"borderRadiusAll":r={borderRadius:{[F.wF[a]]:+t[a]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{topLeft:o.borderRadiusTopLeft,bottomLeft:o.borderRadiusBottomLeft,topRight:o.borderRadiusTopRight,bottomRight:o.borderRadiusBottomRight,[F.wF[a]]:+t[a]}};break;case"mobileWidth":r={[a]:{classNamePrefix:"em-mob-width-",value:t[a],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[a]}};break;case"mobileHeight":r={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:o.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[a]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[Ge.NW[a]]:t[a],classNamePrefix:"em-mob-border_radius_"+Ge.NW[a]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":r={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":r={[a]:{classNamePrefix:"em-mob-text_align-",value:t[a]}};break;case"mobileVerticalAlign":r={[a]:{classNamePrefix:"em-mob-vertical_align-",value:t[a]}};break;case"mobileBackgroundColor":r={[a]:{classNamePrefix:"em-mob-background_color-",value:t[a]}};break;case"mobileBackgroundImage":r={[a]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[a]}]};break;case"mobileBackgroundPositionX":r={[a]:{classNamePrefix:"em-mob-background_position_x-",value:t[a]}};break;case"mobileBackgroundPositionY":r={[a]:{classNamePrefix:"em-mob-background_position_y-",value:t[a]}};break;case"mobileBackgroundRepeat":r={[a]:{classNamePrefix:"em-mob-background_repeat-",value:t[a]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":o.mobilePaddingTop=o.mobilePaddingBottom=t[a],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":o.mobilePaddingLeft=o.mobilePaddingRight=t[a],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;default:r=t}var g;"borderPosition"!==a&&"mobileBorderPosition"!==a&&(l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),"mobileBorderRadiusAll"!==a&&"mobileBorderRadiusTopLeft"!==a&&"mobileBorderRadiusTopRight"!==a&&"mobileBorderRadiusBottomLeft"!==a&&"mobileBorderRadiusBottomRight"!==a&&Ue({...e,...r,mobileBorderRadius:{...e.mobileBorderRadius,...null===(g=r)||void 0===g?void 0:g.mobileBorderRadius},activateSection:null,changeKey:a}))},autoComplete:"off",className:"element-controls"},!te&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),M===F.ND&&V.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:M===F.ND&&V.styles?"block":"none"}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement(pe,{form:i,elementSettings:e,imgParent:!0})),G.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(ge,{form:i,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),G.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ce((e=>!e)),Ie&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},Ie?o.createElement(x.A,null):o.createElement(k.A,null)))),Ie&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,o.createElement(Ct,{form:i,elementSettings:e,mobilePaddingsExt:ae,setMobilePaddingsExt:ie}))),o.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&G.formCellFieldSizeEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Be((e=>!e)),Se&&(t.mobileWidth="",t.mobileHeight="",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},Se?o.createElement(x.A,null):o.createElement(k.A,null)))),Se&&o.createElement(b.A,{gutter:10,style:{paddingBottom:9}},"structure"!==e.type&&o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:15}},o.createElement(Q,{form:i,name:"mobileWidth",elementSettings:e}))),o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:15}},o.createElement(J,{form:i,name:"mobileHeight",elementSettings:e})))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),t.mobileBackgroundColor=we?"":"#E5E5E5",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},we?o.createElement(x.A,null):o.createElement(k.A,null)))),we&&o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:(G.formCellFieldBackgroundImageEnabled,K.formItemMarginBottomMD+4)}},o.createElement(vt,{form:i,elementSettings:e,label:t("Background color")}))),!1,G.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{de((e=>!e)),me?(t.mobileBorderAll=Ge.RH,t.mobileBorderTop=Ge.RH,t.mobileBorderBottom=Ge.RH,t.mobileBorderRight=Ge.RH,t.mobileBorderLeft=Ge.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},me?o.createElement(x.A,null):o.createElement(k.A,null)))),me&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,typeOfForm:"mobile"}))),G.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),ue?(t.mobileBorderRadiusAll=null,C(!0)):t.mobileBorderRadiusAll=5,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},ue?o.createElement(x.A,null):o.createElement(k.A,null)))),ue&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:N,setOneBorderRadiusValue:C,elementSettings:e,typeOfForm:"mobile"}))),G.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},ve?o.createElement(x.A,null):o.createElement(k.A,null)))),ve&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v,typeOfForm:"mobile"}))),G.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:i})),"group"!==e.type&&o.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},o.createElement(Ot,{elementSettings:e,form:i})))),G.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(Je.A,{form:i,elementSettings:e})),G.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(z.A,{form:i,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),G.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("Padding")),o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,"group"!==e.type&&"column"!==e.type&&o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:le?"block":"none"}},o.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeftRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:o.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:le?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Left"),prefix:o.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Right"),prefix:o.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:"group"!==e.type&&"column"!==e.type?156:45,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:le?"block":"none"}},o.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTopBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Vertical"),prefix:o.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:le?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Top"),prefix:o.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Bottom"),prefix:o.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},o.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!le}),onClick:()=>{oe((e=>!e));const t=i.getFieldsValue(!0);le||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(O.A,{icon:"PaddingSwitcher"})))))),o.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&G.formCellFieldSizeEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ye((e=>!e)),_e&&(t.width="",t.height="",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},height:{value:null,dim:"px"}}}))}))}},_e?o.createElement(x.A,null):o.createElement(k.A,null)))),_e&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},"structure"!==e.type&&"column"!==e.type&&o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:s,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Dt)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Height"),placement:"bottom"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"}))))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{xe((e=>!e)),ke?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",Y(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},ke?o.createElement(x.A,null):o.createElement(k.A,null)))),ke&&o.createElement(b.A,{gutter:10,style:{marginBottom:$?16:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:G.formCellFieldBackgroundImageEnabled?K.formItemMarginBottomXS:K.formItemMarginBottomMD+4}},o.createElement(j.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),G.formCellFieldBackgroundImageEnabled&&o.createElement(E.A,{span:$?12:24},o.createElement(T.A,{form:i,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"}),!$&&o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Horizontal position"),prefix:o.createElement(O.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Vertical position"),prefix:o.createElement(O.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:Oe,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:De,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),G.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re?(t.borderAll=Ge.RH,t.borderTop=Ge.RH,t.borderBottom=Ge.RH,t.borderRight=Ge.RH,t.borderLeft=Ge.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},re?o.createElement(x.A,null):o.createElement(k.A,null)))),re&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,elementSettings:e}))),G.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ce((e=>!e)),se?(t.borderRadiusAll=0,R(!0)):t.borderRadiusAll=5,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},se?o.createElement(x.A,null):o.createElement(k.A,null)))),se&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:w,setOneBorderRadiusValue:R,elementSettings:e}))),G.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{he((e=>!e)),Ee?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},Ee?o.createElement(x.A,null):o.createElement(k.A,null)))),Ee&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v}))),G.formFieldExportAsPictureEnabled&&"group"!==e.type&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Settings"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Te((e=>!e)),Ne&&(t.exportAsPicture=!1,t.isContrastBlock=!1,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1,isContrastBlock:!1}}))}))}},Ne?o.createElement(x.A,null):o.createElement(k.A,null)))),Ne&&o.createElement(o.Fragment,null,"structure"===e.type&&o.createElement(p.A,{title:t("The block will change its colors to contrasting colors. You can change them in the Content Styles section."),key:"isContrastBlock"},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"isContrastBlock",valuePropName:"checked",style:{marginBottom:0}},o.createElement(q.A,{size:"small",id:"contrast-colors"})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"contrast-colors"},t("Contrast block"))))),o.createElement(At,{form:i,elementSettings:e}))),G.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:i})),"group"!==e.type&&o.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},o.createElement(It,{elementSettings:e,form:i})))),G.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))},{Option:zt}=X.A,Ht=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(zt,{value:"px"},"px"),o.createElement(zt,{value:"%"},"%")),{useToken:Gt}=c.A,Wt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),[i,m]=(0,o.useState)({}),[d,s]=(0,o.useState)(!0),[c,v]=(0,o.useState)({}),[A,y]=(0,o.useState)(!0),w=(0,n.d4)(Fe.Ct),R=(0,n.d4)(Fe.CS),N=(0,Ve.rD)(),[C,M]=(0,o.useState)(""===e.backgroundImage[0].value),{token:V}=Gt(),H=(0,n.d4)(Fe.Fv),G=(0,n.d4)(Fe.yy),q=H&&"bottom"!==G,[$,Y]=(0,o.useState)(!1),[K,Z]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),[le,oe]=(0,o.useState)(!1),[ae,ie]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[me,de]=(0,o.useState)(!1),[se,ce]=(0,o.useState)(!1),[ue,pe]=(0,o.useState)(!1),[be,Ee]=(0,o.useState)(!1),[he,ve]=(0,o.useState)(!1),[Ae,_e]=(0,o.useState)(!1),[ye,Se]=(0,o.useState)(!1),[Be,ke]=(0,o.useState)(!1),[xe,we]=(0,o.useState)(!1),[Re,Ne]=(0,o.useState)(""),Te=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Ie=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}],Ce=e.border,Le=e.mobileBorder,Oe=Object.keys(Ce).find((e=>{var t,l,o;return(null===(t=Ce[e])||void 0===t?void 0:t.width)||(null===(l=Ce[e])||void 0===l?void 0:l.style)||(null===(o=Ce[e])||void 0===o?void 0:o.color)})),De=Object.keys(Le).find((e=>{var t,l,o;return(null===(t=Le[e])||void 0===t?void 0:t.width)||(null===(l=Le[e])||void 0===l?void 0:l.style)||(null===(o=Le[e])||void 0===o?void 0:o.color)})),Me=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,i,r,n,d,c,u,p,g,b,E,h,f,A,_,S,B,k,x,w,R,N,T,I,P,C,L,O,F,D,V,z,H,G,W,j,U,X,q,$;const K=e.boxShadow,Q=e.mobileBoxShadow;m(K),v(Q),a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(i=e.height)||void 0===i?void 0:i.dim,maxWidth:null===(r=e.maxWidth)||void 0===r?void 0:r.value,maxWidthDim:null===(n=e.maxWidth)||void 0===n?void 0:n.dim,minWidth:null===(d=e.minWidth)||void 0===d?void 0:d.value,minWidthDim:null===(c=e.minWidth)||void 0===c?void 0:c.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderAll:(0,Ge.ok)(e.border.all),borderTop:(0,Ge.ok)(e.border.top),borderBottom:(0,Ge.ok)(e.border.bottom),borderRight:(0,Ge.ok)(e.border.right),borderLeft:(0,Ge.ok)(e.border.left),mobileBorderAll:Me(e.mobileBorder.all)||!(Me(e.mobileBorder.top)||Me(e.mobileBorder.bottom)||Me(e.mobileBorder.right)||Me(e.mobileBorder.left))&&Me(e.border.all),mobileBorderTop:Me(e.mobileBorder.top)||!Me(e.mobileBorder.all)&&Me(e.border.top),mobileBorderBottom:Me(e.mobileBorder.bottom)||!Me(e.mobileBorder.all)&&Me(e.border.bottom),mobileBorderRight:Me(e.mobileBorder.right)||!Me(e.mobileBorder.all)&&Me(e.border.right),mobileBorderLeft:Me(e.mobileBorder.left)||!Me(e.mobileBorder.all)&&Me(e.border.left),paddingTop:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.top),paddingLeft:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.left),paddingRight:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.right),paddingBottom:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.bottom),paddingLeftRight:(0,Ge.ok)(null===(u=e.padding)||void 0===u?void 0:u.left)||(0,Ge.ok)(null===(p=e.padding)||void 0===p?void 0:p.right),paddingTopBottom:(0,Ge.ok)(null===(g=e.padding)||void 0===g?void 0:g.top)||(0,Ge.ok)(null===(b=e.padding)||void 0===b?void 0:b.bottom),borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(E=e.boxShadow)||void 0===E?void 0:E.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(h=e.boxShadow)||void 0===h?void 0:h.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(A=e.boxShadow)||void 0===A?void 0:A.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(_=e.boxShadow)||void 0===_?void 0:_.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.color),mobileWidth:(0,Ge.xc)(null===(B=e.mobileWidth)||void 0===B?void 0:B.value),mobileWidthDim:null===(k=e.mobileWidth)||void 0===k?void 0:k.dim,mobileHeight:(0,Ge.xc)(null===(x=e.mobileHeight)||void 0===x?void 0:x.value),mobileHeightDim:null===(w=e.mobileHeight)||void 0===w?void 0:w.dim,mobileBorderRadiusAll:(0,Ge.ok)(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Ge.ok)(null===(R=e.mobileBoxShadow)||void 0===R?void 0:R.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(N=e.mobileBoxShadow)||void 0===N?void 0:N.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(T=e.mobileBoxShadow)||void 0===T?void 0:T.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(I=e.mobileBoxShadow)||void 0===I?void 0:I.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(P=e.mobileBoxShadow)||void 0===P?void 0:P.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(C=e.mobileBoxShadow)||void 0===C?void 0:C.color),mobileAlign:(0,Ge.ok)(null===(L=e.mobileAlign)||void 0===L?void 0:L.value),mobileVerticalAlign:(0,Ge.ok)(null===(O=e.mobileVerticalAlign)||void 0===O?void 0:O.value),mobileDirection:(0,Ge.ok)(null===(F=e.mobileDirection)||void 0===F?void 0:F.value),mobileBackgroundColor:(0,Ge.ok)("none"!==(null===(D=e.mobileBackgroundColor)||void 0===D?void 0:D.value)?null===(V=e.mobileBackgroundColor)||void 0===V?void 0:V.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,Ge.ok)(null===(z=e.mobileBackgroundPositionX)||void 0===z?void 0:z.value),mobileBackgroundPositionY:(0,Ge.ok)(null===(H=e.mobileBackgroundPositionY)||void 0===H?void 0:H.value),mobileBackgroundRepeat:null!==(G=e.mobileBackgroundRepeat)&&void 0!==G&&G.value?null===(W=e.mobileBackgroundRepeat)||void 0===W?void 0:W.value:"none",mobilePaddingTop:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.top),mobilePaddingLeft:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.left),mobilePaddingRight:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.right),mobilePaddingBottom:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.bottom),mobilePaddingTopBottom:(0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.bottom),mobilePaddingLeftRight:(0,Ge.ok)(e.mobilePadding.left)||(0,Ge.ok)(e.mobilePadding.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?s(!1):s(!0),!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))?y(!1):y(!0),M(""===e.backgroundImage[0].value),(0,Ge.ok)(e.padding.all)||!((0,Ge.ok)(e.padding.top)||(0,Ge.ok)(e.padding.right)||(0,Ge.ok)(e.padding.bottom)||(0,Ge.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?Y(!0):Y(!1),(0,Ge.ok)(e.mobilePadding.all)||!((0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(e.mobilePadding.left))||e.mobilePadding.top===e.mobilePadding.bottom&&e.mobilePadding.right===e.mobilePadding.left?Z(!0):Z(!1),te(!!Oe),oe(!!Oe||!!De),ie(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ne(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),de(!!e.boxShadow),ce(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),pe(!!e.width.value||!!e.height.value||!!e.minWidth.value||!!e.maxWidth.value),Ee(!!e.mobileWidth.value||!!e.mobileHeight.value),ve(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),_e(!!e.mobileBackgroundColor.value),Se(!!e.exportAsPicture),ke(!(null===(j=e.padding)||void 0===j||!j.all)||!(null===(U=e.padding)||void 0===U||!U.top)||!(null===(X=e.padding)||void 0===X||!X.bottom)||!(null===(q=e.padding)||void 0===q||!q.left)||!(null===($=e.padding)||void 0===$||!$.right)),we(!!e.mobilePadding.all||!!e.mobilePadding.top||!!e.mobilePadding.bottom||!!e.mobilePadding.left||!!e.mobilePadding.right)}}),[a,e]);return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_div_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:Ge.uE[Oe]||"borderAll",mobileBorderPosition:Ge.lS[De]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileDirection:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:""},onValuesChange:t=>{const o=a.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(Ne("%"===a.getFieldsValue(!0).widthDim?100:""),i){case"exportAsPicture":r={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":r={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var n,m,d;if("borderAll"===o.borderPosition)r={border:{...F.iV,all:{...Ge.RH,...o.borderAll}}},a.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(n=o.borderAll)&&void 0!==n&&n.width||null!==(m=o.borderAll)&&void 0!==m&&m.style||null!==(d=o.borderAll)&&void 0!==d&&d.color?(r={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[Ge.Vz[i]]:{...o[i],...t[i]}}},a.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[i]:{...o[i],...t[i]}})):(r={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[Ge.Vz[i]]:{...o[i],...t[i]}}},a.setFieldsValue({border:r.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var s,c,u;if("mobileBorderAll"===o.mobileBorderPosition)r={mobileBorder:{...F.iV,all:{...Ge.RH,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+Ge.ax[i]+"-"}}},a.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(s=o.mobileBorder.all)&&void 0!==s&&s.width||null!==(c=o.mobileBorder.all)&&void 0!==c&&c.style||null!==(u=o.mobileBorder.all)&&void 0!==u&&u.color?(r={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[Ge.ax[i]]:{...o[i],...t[i],classNamePrefix:"em-mob-border_"+Ge.ax[i]+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[i]:{...o[i],...t[i]}})):(r={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[Ge.ax[i]]:{...o[i],...t[i],classNamePrefix:"em-mob-border_"+Ge.ax[i]+"-"}}},a.setFieldsValue({mobileBorder:r.mobileBorder}));case"width":r={[i]:{value:t[i],dim:o.widthDim}};break;case"height":r={[i]:{value:t[i],dim:o.heightDim}};break;case"widthDim":r={width:{value:o.width,dim:t[i]}};break;case"heightDim":r={height:{value:o.height,dim:t[i]}};break;case"maxWidth":r={[i]:{value:t[i],dim:o.maxWidthDim}};break;case"maxWidthDim":r={maxWidth:{value:o.maxWidth,dim:t[i]}};break;case"minWidth":r={[i]:{value:t[i],dim:o.minWidthDim}};break;case"minWidthDim":r={minWidth:{value:o.minWidth,dim:t[i]}};break;case"backgroundImage":M(""===t[i]),r={[i]:[{...e.backgroundImage[0],value:t[i]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{[Ge.yy[i]]:+t[i]}};break;case"paddingTopBottom":r={padding:{top:+t[i],bottom:+t[i]}},o.paddingTop=o.paddingBottom=+t[i];break;case"paddingLeftRight":r={padding:{left:+t[i],right:+t[i]}},o.paddingLeft=o.paddingRight=+t[i];break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{[F.wF[i]]:+t[i]}};break;case"mobileWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[i]}};break;case"mobileHeight":r={[i]:{classNamePrefix:"em-mob-height-",value:t[i],dim:o.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[i]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[Ge.NW[i]]:t[i],classNamePrefix:"em-mob-border_radius_"+Ge.NW[i]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":r={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":r={[i]:{classNamePrefix:"em-mob-text_align-",value:t[i]}};break;case"mobileVerticalAlign":r={[i]:{classNamePrefix:"em-mob-vertical_align-",value:t[i]}};break;case"mobileBackgroundColor":r={[i]:{classNamePrefix:"em-mob-background_color-",value:t[i]}};break;case"mobileBackgroundImage":r={[i]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[i]}]};break;case"mobileBackgroundPositionX":r={[i]:{classNamePrefix:"em-mob-background_position_x-",value:t[i]}};break;case"mobileBackgroundPositionY":r={[i]:{classNamePrefix:"em-mob-background_position_x-",value:t[i]}};break;case"mobileBackgroundRepeat":r={[i]:{classNamePrefix:"em-mob-background_repeat-",value:t[i]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":o.mobilePaddingTop=o.mobilePaddingBottom=t[i],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":o.mobilePaddingLeft=o.mobilePaddingRight=t[i],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileDirection":r={[i]:{classNamePrefix:"em-mob-direction-",value:t[i]}};break;default:r=t}"borderPosition"!==i&&"mobileBorderPosition"!==i&&l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off",className:"element-controls"},!q&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),w===F.ND&&R.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(dt,{form:a,elementSettings:e,imgParent:!0})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(ge,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),N.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{we((e=>!e)),xe&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},xe?o.createElement(x.A,null):o.createElement(k.A,null)))),xe&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,o.createElement(Ct,{form:a,elementSettings:e,mobilePaddingsExt:K,setMobilePaddingsExt:Z})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{Ee((e=>!e))}))}},be?o.createElement(x.A,null):o.createElement(k.A,null)))),be&&o.createElement(b.A,{gutter:10,style:{paddingBottom:8}},o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:2*V.formItemMarginBottomXS}},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e}))),o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(J,{form:a,name:"mobileHeight",elementSettings:e})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{_e((e=>!e)),t.mobileBackgroundColor=Ae?"":"#E5E5E5",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Ae?o.createElement(x.A,null):o.createElement(k.A,null)))),Ae&&o.createElement("div",{style:{marginBottom:(N.formDivFieldBackgroundImageEnabled,V.formItemMarginBottomMD+4)}},o.createElement(vt,{form:a,elementSettings:e,label:t("Background color")})),!1,N.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{oe((e=>!e)),le?(t.mobileBorderAll=Ge.RH,t.mobileBorderTop=Ge.RH,t.mobileBorderBottom=Ge.RH,t.mobileBorderRight=Ge.RH,t.mobileBorderLeft=Ge.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},le?o.createElement(x.A,null):o.createElement(k.A,null)))),le&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(I.A,{form:a,typeOfForm:"mobile"}))),N.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re?(t.mobileBorderRadiusAll=null,y(!0)):t.mobileBorderRadiusAll=5,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},re?o.createElement(x.A,null):o.createElement(k.A,null)))),re&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Et,{form:a,oneMobileBorderRadiusValue:A,setOneMobileBorderRadiusValue:y,elementSettings:e}))),N.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ce((e=>!e)),se?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},se?o.createElement(x.A,null):o.createElement(k.A,null)))),se&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(ht,{mobileBoxShadow:c,form:a,elementSettings:e}))),N.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control & Direction")),o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(Ot,{elementSettings:e,form:a})))),N.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement(g.A,{className:"selected_form-desktop-props-title",message:t("Appearance on mobile devices"),type:"info"}),o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Je.A,{form:a,elementSettings:e})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(z.A,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),N.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ke((e=>!e)),Be&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},Be?o.createElement(x.A,null):o.createElement(k.A,null)))),Be&&o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(o.Fragment,null,o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:$?"block":"none"}},o.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeftRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:o.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:$?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Left"),prefix:o.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Right"),prefix:o.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:$?"block":"none"}},o.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTopBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Vertical"),prefix:o.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:$?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Top"),prefix:o.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Bottom"),prefix:o.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},o.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!$}),onClick:()=>{Y((e=>!e));const t=a.getFieldsValue(!0);$||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(O.A,{icon:"PaddingSwitcher"}))))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{pe((e=>!e))}))}},ue?o.createElement(x.A,null):o.createElement(k.A,null)))),ue&&o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width",className:"form-item-margin-xs"}," ",o.createElement(W.A,{min:0,max:Re,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Ht)}))),o.createElement(p.A,{trigger:["hover"],title:t("Height"),placement:"bottom"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"bottom"},o.createElement(u.A.Item,{name:"minWidth",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:t("Min width"),prefix:o.createElement(O.A,{icon:"MinWidth"}),addonAfter:o.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},Ht)}))),o.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"bottom"},o.createElement(u.A.Item,{name:"maxWidth",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:t("Max width"),prefix:o.createElement(O.A,{icon:"MaxWidth"}),addonAfter:o.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},Ht)}))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ve((e=>!e)),he?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",M(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},he?o.createElement(x.A,null):o.createElement(k.A,null)))),he&&o.createElement(b.A,{gutter:10,style:{marginBottom:C?16:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:N.formDivFieldBackgroundImageEnabled?V.formItemMarginBottomXS:V.formItemMarginBottomMD+4}},o.createElement(j.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),N.formDivFieldBackgroundImageEnabled&&o.createElement(E.A,{span:C?12:24},o.createElement("div",{style:{paddingBottom:C?4:0}},o.createElement(T.A,{form:a,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!C&&o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Horizontal position"),prefix:o.createElement(O.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Vertical position"),prefix:o.createElement(O.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:V.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:Te,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:V.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:Ie,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),N.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{te((e=>!e)),ee?(t.borderAll=Ge.RH,t.borderTop=Ge.RH,t.borderBottom=Ge.RH,t.borderRight=Ge.RH,t.borderLeft=Ge.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},ee?o.createElement(x.A,null):o.createElement(k.A,null)))),ee&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(I.A,{form:a,elementSettings:e}))),N.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ie((e=>!e)),ae?(t.borderRadiusAll=0,s(!0)):t.borderRadiusAll=5,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ae?o.createElement(x.A,null):o.createElement(k.A,null)))),ae&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:d,setOneBorderRadiusValue:s,elementSettings:e}))),N.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{de((e=>!e)),me?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},me?o.createElement(x.A,null):o.createElement(k.A,null)))),me&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(U,{boxShadow:i}))),N.formFieldExportAsPictureEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Export settings"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Se((e=>!e)),ye&&(t.exportAsPicture=!1,l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},ye?o.createElement(x.A,null):o.createElement(k.A,null)))),ye&&o.createElement(At,{form:a,elementSettings:e})),N.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control & Direction")),o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(It,{elementSettings:e,form:a})))),N.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))};var jt=l(61153);const{Option:Ut}=X.A,Xt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(Ut,{value:"px"},"px"),o.createElement(Ut,{value:"%"},"%")),qt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(Ut,{value:"px"},"px"));let $t=0;const Yt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),i=(0,n.d4)(Fe.Ct),r=(0,n.d4)(Fe.CS),m=(0,n.d4)(Fe.Fv),d=(0,n.d4)(Fe.yy),s=(0,Ve.rD)(),c=m&&"bottom"!==d;(0,o.useEffect)((()=>{const t=e=>e&&"auto"!==e?e:0===e?"0":"";var l,o,i,r,n,m,d,s,c,u,p,g,b,E;e&&(a.setFieldsValue({...e,width:null===(l=e.width)||void 0===l?void 0:l.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,gap:null===(i=e.gap)||void 0===i?void 0:i.value,gapDim:null===(r=e.gap)||void 0===r?void 0:r.dim,maxWidth:null===(n=e.maxWidth)||void 0===n?void 0:n.value,maxWidthDim:null===(m=e.maxWidth)||void 0===m?void 0:m.dim,minWidth:null===(d=e.minWidth)||void 0===d?void 0:d.value,minWidthDim:null===(s=e.minWidth)||void 0===s?void 0:s.dim,show:e.show?e.show:"all",mobileWidth:t(null===(c=e.mobileWidth)||void 0===c?void 0:c.value),mobileWidthDim:null===(u=e.mobileWidth)||void 0===u?void 0:u.dim,mobileContentWidth:t(null===(p=e.mobileContentWidth)||void 0===p?void 0:p.value),mobileContentWidthDim:null===(g=e.mobileContentWidth)||void 0===g?void 0:g.dim,mobileVerticalAlign:(E=null===(b=e.mobileVerticalAlign)||void 0===b?void 0:b.value,E||(0===E?"0":""))}),$t=e.width.value+e.gap.value)}),[a,e]);return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_float_block_form",initialValues:{width:{value:"",dim:""},gap:{value:"",dim:"px"},valign:"",show:"all",mobileWidth:"",mobileWidthDim:"",mobileContentWidth:"",mobileContentWidthDim:"",mobileVerticalAlign:""},onValuesChange:t=>{const o=a.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(i){case"width":$t=t[i]+o.gap,r={[i]:{value:t[i],dim:o.widthDim},gap:{value:o.gap}};break;case"widthDim":r={width:{value:o.width,dim:t[i]},gap:{value:o.gap}};break;case"gap":o.width=$t-t[i],r={[i]:{value:t[i],dim:"px"}};break;case"mobileWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[i]}};break;case"mobileContentWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:o.mobileContentWidthDim}};break;case"mobileContentWidthDim":r={mobileContentWidth:{classNamePrefix:"em-mob-width-",value:100,dim:t[i]}};break;case"mobileVerticalAlign":r={[i]:{classNamePrefix:"em-mob-vertical_align-",value:t[i]}};break;default:r=t}l({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off",className:"element-controls"},c&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),i===F.ND&&r.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:i===F.ND&&r.styles?"block":"none"}},o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:10,style:{marginBottom:20}},o.createElement(E.A,{span:12},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e})),o.createElement(E.A,{span:12})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Alignments")),o.createElement(ge,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(fe,{elementSettings:e,form:a}),s.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(Pe,null)))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Float block width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width"},o.createElement(ee.A,{min:0,placeholder:t("Float block width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Xt)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Column gap"),placement:"bottom"},o.createElement(u.A.Item,{name:"gap"},o.createElement(ee.A,{min:0,placeholder:t("Column gap"),prefix:o.createElement(jt.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},qt)})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Vertical alignment")),o.createElement(z.A,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(fe,{elementSettings:e,form:a}),s.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(Pe,null)))))},{Option:Kt}=X.A,Qt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(Kt,{value:"px"},"px"),o.createElement(Kt,{value:"%"},"%")),{useToken:Zt}=c.A,Jt=({elementSettings:e})=>{var t;const{__:l}=(0,L.s9)(),a=(0,D.XW)(),[i]=u.A.useForm(),s=(0,n.wA)(),c=(0,n.d4)(m.Hs),[v,A]=(0,o.useState)({}),[y,w]=(0,o.useState)(!0),[R,N]=(0,o.useState)(!0),C=(0,n.d4)(Fe.Ct),M=(0,n.d4)(Fe.CS),z=(0,Ve.rD)(),[H,G]=(0,o.useState)(""===(null===(t=e.backgroundImage)||void 0===t?void 0:t[0].value)),q=(0,n.d4)(Fe.Fv),$=(0,n.d4)(Fe.yy),Y=q&&"bottom"!==$,{token:K}=Zt(),Z=(0,o.useRef)(null),ee=(0,o.useRef)(null),[te,le]=(0,o.useState)(!1),[oe,ae]=(0,o.useState)(!1),[ie,re]=(0,o.useState)(!1),[ne,me]=(0,o.useState)(!1),[de,se]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(!1),[ge,be]=(0,o.useState)(!1),[Ee,he]=(0,o.useState)(!1),[ve,Ae]=(0,o.useState)(!1),[_e,ye]=(0,o.useState)(!1),[Se,Be]=(0,o.useState)(!1),[ke,xe]=(0,o.useState)(!1),[we,Re]=(0,o.useState)(!1),[Ne,Te]=(0,o.useState)(!1),[Ie,Ce]=(0,o.useState)(""),[Le,Oe]=(0,o.useState)("https://"),[De,Me]=(0,o.useState)({}),[ze,He]=(0,o.useState)(!1),We=c.hasOwnProperty("type")?F.IE:F.Tm,je=[{label:l("Not defined"),value:"none"},{label:l("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:l("Repeat background (repeat)"),value:"repeat"},{label:l("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:l("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Ue=[{label:l("Not defined"),value:""},{label:l("Contain"),value:"contain"},{label:l("Cover"),value:"cover"}],Xe=e.border,$e=e.mobileBorder,Ye=Object.keys(Xe).find((e=>{var t,l,o;return(null===(t=Xe[e])||void 0===t?void 0:t.width)||(null===(l=Xe[e])||void 0===l?void 0:l.style)||(null===(o=Xe[e])||void 0===o?void 0:o.color)})),Ke=Object.keys($e).find((e=>{var t,l,o;return(null===(t=$e[e])||void 0===t?void 0:t.width)||(null===(l=$e[e])||void 0===l?void 0:l.style)||(null===(o=$e[e])||void 0===o?void 0:o.color)})),Qe=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,a,r,n,m,d,s,c,u,p,g,b,E,h,f,v,_,y,S,B,k,x,R,T,I,P,C,L,O,F,D,M,V,z,H,W,j,U,X,q,$,Y,K,Q,Z,J,ee,te,oe,ie,ne,de,ce,pe,ge,Ee,fe,ve,_e,Se,ke,we,Ne,Ie,Pe,Ce,Le,Fe,De,Me,Ve,ze,He,We,je,Ue,Xe,qe,$e,Ze,Je,et,tt,lt,ot,at,it,rt,nt,mt,dt,st,ct,ut,pt,gt,bt,Et,ht,ft,vt,At,_t,yt,St,Bt,kt,xt,wt,Rt,Nt,Tt,It,Pt,Ct,Lt,Ot,Ft,Dt,Mt,Vt,zt,Ht,Gt,Wt,jt,Ut,Xt,qt,$t,Yt,Kt,Qt,Zt,Jt,el,tl,ll,ol,al,il,rl,nl,ml,dl,sl,cl,ul,pl,gl,bl,El,hl,fl,vl,Al;const _l=e.boxShadow||{},yl=e.mobilePadding||{},Sl=e.mobileAlign||{},Bl=e.mobileBackgroundImage||[];A(_l),e.href&&("https://"===e.href.substring(0,8)||"http://"===e.href.substring(0,7)?Oe("https://"):"mailto:"===e.href.substring(0,7)?Oe("mailto:"):"tel:"===e.href.substring(0,4)?Oe("tel:"):"sms:"===e.href.substring(0,4)?Oe("sms:"):"ftp://"===e.href.substring(0,6)?Oe("ftp://"):"skype:"===e.href.substring(0,6)?Oe("skype:"):"viber:"===e.href.substring(0,6)?Oe("viber:"):Oe("")),i.setFieldsValue({...e,href:e.href?e.href:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(a=e.height)||void 0===a?void 0:a.dim,backgroundImage:null===(r=e.backgroundImage)||void 0===r?void 0:r[0].value,show:e.show?e.show:"all",textAlign:e.textAlign,borderAll:(0,Ge.ok)(e.border.all),borderTop:(0,Ge.ok)(e.border.top),borderBottom:(0,Ge.ok)(e.border.bottom),borderRight:(0,Ge.ok)(e.border.right),borderLeft:(0,Ge.ok)(e.border.left),mobileBorderAll:Qe(e.mobileBorder.all)||!(Qe(e.mobileBorder.top)||Qe(e.mobileBorder.bottom)||Qe(e.mobileBorder.right)||Qe(e.mobileBorder.left))&&Qe(e.border.all),mobileBorderTop:Qe(e.mobileBorder.top)||!Qe(e.mobileBorder.all)&&Qe(e.border.top),mobileBorderBottom:Qe(e.mobileBorder.bottom)||!Qe(e.mobileBorder.all)&&Qe(e.border.bottom),mobileBorderRight:Qe(e.mobileBorder.right)||!Qe(e.mobileBorder.all)&&Qe(e.border.right),mobileBorderLeft:Qe(e.mobileBorder.left)||!Qe(e.mobileBorder.all)&&Qe(e.border.left),paddingTop:(0,Ge.ok)(null===(n=e.padding)||void 0===n?void 0:n.all)||(0,Ge.ok)(null===(m=e.padding)||void 0===m?void 0:m.top),paddingLeft:(0,Ge.ok)(null===(d=e.padding)||void 0===d?void 0:d.all)||(0,Ge.ok)(null===(s=e.padding)||void 0===s?void 0:s.left),paddingRight:(0,Ge.ok)(null===(c=e.padding)||void 0===c?void 0:c.all)||(0,Ge.ok)(null===(u=e.padding)||void 0===u?void 0:u.right),paddingBottom:(0,Ge.ok)(null===(p=e.padding)||void 0===p?void 0:p.all)||(0,Ge.ok)(null===(g=e.padding)||void 0===g?void 0:g.bottom),paddingLeftRight:(0,Ge.ok)(null===(b=e.padding)||void 0===b?void 0:b.left)||(0,Ge.ok)(null===(E=e.padding)||void 0===E?void 0:E.right),paddingTopBottom:(0,Ge.ok)(null===(h=e.padding)||void 0===h?void 0:h.top)||(0,Ge.ok)(null===(f=e.padding)||void 0===f?void 0:f.bottom),borderRadiusAll:(0,Ge.ok)(null===(v=e.borderRadius)||void 0===v?void 0:v.all),borderRadiusTopLeft:(0,Ge.ok)(null===(_=e.borderRadius)||void 0===_?void 0:_.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(null===(y=e.borderRadius)||void 0===y?void 0:y.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(null===(S=e.borderRadius)||void 0===S?void 0:S.topRight),borderRadiusBottomRight:(0,Ge.ok)(null===(B=e.borderRadius)||void 0===B?void 0:B.bottomRight),boxShadowInset:(0,Ge.ok)(null===(k=e.boxShadow)||void 0===k?void 0:k.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(x=e.boxShadow)||void 0===x?void 0:x.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(R=e.boxShadow)||void 0===R?void 0:R.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(T=e.boxShadow)||void 0===T?void 0:T.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(I=e.boxShadow)||void 0===I?void 0:I.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(P=e.boxShadow)||void 0===P?void 0:P.color),mobileWidth:(0,Ge.xc)(null===(C=e.mobileWidth)||void 0===C?void 0:C.value)||(null===(L=e.width)||void 0===L?void 0:L.value),mobileWidthDim:(0,Ge.xc)(null===(O=e.mobileWidth)||void 0===O?void 0:O.value)?null===(F=e.mobileWidth)||void 0===F?void 0:F.dim:null===(D=e.width)||void 0===D?void 0:D.dim,mobileHeight:(0,Ge.xc)(null===(M=e.mobileHeight)||void 0===M?void 0:M.value)||(null===(V=e.height)||void 0===V?void 0:V.value),mobileHeightDim:(0,Ge.xc)(null===(z=e.mobileHeight)||void 0===z?void 0:z.value)?null===(H=e.mobileHeight)||void 0===H?void 0:H.dim:null===(W=e.height)||void 0===W?void 0:W.dim,mobileBorderRadiusAll:(0,Ge.ok)(null===(j=e.mobileBorderRadius)||void 0===j?void 0:j.all)||(0,Ge.ok)(null===(U=e.borderRadius)||void 0===U?void 0:U.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null===(X=e.mobileBorderRadius)||void 0===X?void 0:X.topLeft)||(0,Ge.ok)(null===(q=e.mobileBorderRadius)||void 0===q?void 0:q.all)||(0,Ge.ok)(null===($=e.borderRadius)||void 0===$?void 0:$.topLeft)||(0,Ge.ok)(null===(Y=e.borderRadius)||void 0===Y?void 0:Y.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null===(K=e.mobileBorderRadius)||void 0===K?void 0:K.bottomLeft)||(0,Ge.ok)(null===(Q=e.mobileBorderRadius)||void 0===Q?void 0:Q.all)||(0,Ge.ok)(null===(Z=e.borderRadius)||void 0===Z?void 0:Z.bottomLeft)||(0,Ge.ok)(null===(J=e.borderRadius)||void 0===J?void 0:J.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null===(ee=e.mobileBorderRadius)||void 0===ee?void 0:ee.topRight)||(0,Ge.ok)(null===(te=e.mobileBorderRadius)||void 0===te?void 0:te.all)||(0,Ge.ok)(null===(oe=e.borderRadius)||void 0===oe?void 0:oe.topRight)||(0,Ge.ok)(null===(ie=e.borderRadius)||void 0===ie?void 0:ie.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null===(ne=e.mobileBorderRadius)||void 0===ne?void 0:ne.bottomRight)||(0,Ge.ok)(null===(de=e.mobileBorderRadius)||void 0===de?void 0:de.all)||(0,Ge.ok)(null===(ce=e.borderRadius)||void 0===ce?void 0:ce.bottomRight)||(0,Ge.ok)(null===(pe=e.borderRadius)||void 0===pe?void 0:pe.all),mobileBoxShadowInset:null!=(null===(ge=e.mobileBoxShadow)||void 0===ge?void 0:ge.inset)?e.mobileBoxShadow.inset:(null===(Ee=e.boxShadow)||void 0===Ee?void 0:Ee.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(fe=e.mobileBoxShadow)||void 0===fe?void 0:fe.hOffset)||(0,Ge.ok)(null===(ve=e.boxShadow)||void 0===ve?void 0:ve.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(_e=e.mobileBoxShadow)||void 0===_e?void 0:_e.vOffset)||(0,Ge.ok)(null===(Se=e.boxShadow)||void 0===Se?void 0:Se.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(ke=e.mobileBoxShadow)||void 0===ke?void 0:ke.blurRadius)||(0,Ge.ok)(null===(we=e.boxShadow)||void 0===we?void 0:we.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(Ne=e.mobileBoxShadow)||void 0===Ne?void 0:Ne.spreadRadius)||(0,Ge.ok)(null===(Ie=e.boxShadow)||void 0===Ie?void 0:Ie.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(Pe=e.mobileBoxShadow)||void 0===Pe?void 0:Pe.color)||(0,Ge.ok)(null===(Ce=e.boxShadow)||void 0===Ce?void 0:Ce.color),mobileAlign:(0,Ge.ok)(null===Sl||void 0===Sl?void 0:Sl.value)||e.align,mobileVerticalAlign:(0,Ge.ok)((null===(Le=e.mobileVerticalAlign)||void 0===Le?void 0:Le.value)||e.valign),mobileBackgroundColor:(0,Ge.ok)((null===(Fe=e.mobileBackgroundColor)||void 0===Fe?void 0:Fe.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(De=Bl[0])||void 0===De?void 0:De.value)?null===(Me=Bl[0])||void 0===Me?void 0:Me.value:(null===(Ve=e.backgroundImage)||void 0===Ve?void 0:Ve[0].value)||"",mobileBackgroundPositionX:(0,Ge.ok)(null===(ze=e.mobileBackgroundPositionX)||void 0===ze?void 0:ze.value)||(0,Ge.ok)(null===(He=e.backgroundPositionX)||void 0===He?void 0:He.value),mobileBackgroundPositionY:(0,Ge.ok)(null===(We=e.mobileBackgroundPositionY)||void 0===We?void 0:We.value)||(0,Ge.ok)(null===(je=e.backgroundPositionY)||void 0===je?void 0:je.value),mobileBackgroundRepeat:(null===(Ue=e.mobileBackgroundRepeat)||void 0===Ue?void 0:Ue.value)||e.backgroundRepeat||"none",mobilePaddingTop:(0,Ge.ok)(yl.all)||(0,Ge.ok)(yl.top)||(0,Ge.ok)(null===(Xe=e.padding)||void 0===Xe?void 0:Xe.all)||(0,Ge.ok)(null===(qe=e.padding)||void 0===qe?void 0:qe.top),mobilePaddingLeft:(0,Ge.ok)(yl.all)||(0,Ge.ok)(yl.left)||(0,Ge.ok)(null===($e=e.padding)||void 0===$e?void 0:$e.all)||(0,Ge.ok)(null===(Ze=e.padding)||void 0===Ze?void 0:Ze.left),mobilePaddingRight:(0,Ge.ok)(yl.all)||(0,Ge.ok)(yl.right)||(0,Ge.ok)(null===(Je=e.padding)||void 0===Je?void 0:Je.all)||(0,Ge.ok)(null===(et=e.padding)||void 0===et?void 0:et.right),mobilePaddingBottom:(0,Ge.ok)(yl.all)||(0,Ge.ok)(yl.bottom)||(0,Ge.ok)(null===(tt=e.padding)||void 0===tt?void 0:tt.all)||(0,Ge.ok)(null===(lt=e.padding)||void 0===lt?void 0:lt.bottom),mobilePaddingTopBottom:(0,Ge.ok)(yl.top)||(0,Ge.ok)(yl.bottom)||(0,Ge.ok)(null===(ot=e.padding)||void 0===ot?void 0:ot.top)||(0,Ge.ok)(null===(at=e.padding)||void 0===at?void 0:at.bottom),mobilePaddingLeftRight:(0,Ge.ok)(yl.left)||(0,Ge.ok)(yl.right)||(0,Ge.ok)(null===(it=e.padding)||void 0===it?void 0:it.left)||(0,Ge.ok)(null===(rt=e.padding)||void 0===rt?void 0:rt.right),mobileTextAlign:(0,Ge.ok)((null===(nt=e.mobileTextAlign)||void 0===nt?void 0:nt.value)||e.textAlign),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture,mobileFontSize:(0,Ge.ok)((null===(mt=e.mobileFontSize)||void 0===mt?void 0:mt.value)||e.fontSize)}),!(0,Ge.ok)(null===(dt=e.borderRadius)||void 0===dt?void 0:dt.all)&&((0,Ge.ok)(null===(st=e.borderRadius)||void 0===st?void 0:st.topLeft)||(0,Ge.ok)(null===(ct=e.borderRadius)||void 0===ct?void 0:ct.bottomLeft)||(0,Ge.ok)(null===(ut=e.borderRadius)||void 0===ut?void 0:ut.topRight)||(0,Ge.ok)(null===(pt=e.borderRadius)||void 0===pt?void 0:pt.bottomRight))?w(!1):w(!0),!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))||(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))||!(0,Ge.ok)(e.borderRadius.all)&&!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?N(!1):N(!0),G(""===(null===(gt=e.backgroundImage)||void 0===gt?void 0:gt[0].value)),(0,Ge.ok)(null===(bt=e.padding)||void 0===bt?void 0:bt.all)||!((0,Ge.ok)(null===(Et=e.padding)||void 0===Et?void 0:Et.top)||(0,Ge.ok)(null===(ht=e.padding)||void 0===ht?void 0:ht.right)||(0,Ge.ok)(null===(ft=e.padding)||void 0===ft?void 0:ft.bottom)||(0,Ge.ok)(null===(vt=e.padding)||void 0===vt?void 0:vt.left))||(null===(At=e.padding)||void 0===At?void 0:At.top)===(null===(_t=e.padding)||void 0===_t?void 0:_t.bottom)&&(null===(yt=e.padding)||void 0===yt?void 0:yt.right)===(null===(St=e.padding)||void 0===St?void 0:St.left)?le(!0):le(!1),!(0,Ge.ok)(yl.all)&&((0,Ge.ok)(yl.top)||(0,Ge.ok)(yl.right)||(0,Ge.ok)(yl.bottom)||(0,Ge.ok)(yl.left))&&(yl.top!==yl.bottom||yl.right!==yl.left)||!(0,Ge.ok)(null===(Bt=e.padding)||void 0===Bt?void 0:Bt.all)&&((0,Ge.ok)(null===(kt=e.padding)||void 0===kt?void 0:kt.top)||(0,Ge.ok)(null===(xt=e.padding)||void 0===xt?void 0:xt.right)||(0,Ge.ok)(null===(wt=e.padding)||void 0===wt?void 0:wt.bottom)||(0,Ge.ok)(null===(Rt=e.padding)||void 0===Rt?void 0:Rt.left))&&((null===(Nt=e.padding)||void 0===Nt?void 0:Nt.top)!==(null===(Tt=e.padding)||void 0===Tt?void 0:Tt.bottom)||(null===(It=e.padding)||void 0===It?void 0:It.right)!==(null===(Pt=e.padding)||void 0===Pt?void 0:Pt.left))?ae(!1):ae(!0),re(!!Ye),me(!!Ye||!!Ke),se(!(null===(Ct=e.borderRadius)||void 0===Ct||!Ct.all)||!(null===(Lt=e.borderRadius)||void 0===Lt||!Lt.topLeft)||!(null===(Ot=e.borderRadius)||void 0===Ot||!Ot.bottomLeft)||!(null===(Ft=e.borderRadius)||void 0===Ft||!Ft.topRight)||!(null===(Dt=e.borderRadius)||void 0===Dt||!Dt.bottomRight)),ue(!(null===(Mt=e.mobileBorderRadius)||void 0===Mt||!Mt.all)||!(null===(Vt=e.mobileBorderRadius)||void 0===Vt||!Vt.topLeft)||!(null===(zt=e.mobileBorderRadius)||void 0===zt||!zt.bottomLeft)||!(null===(Ht=e.mobileBorderRadius)||void 0===Ht||!Ht.topRight)||!(null===(Gt=e.mobileBorderRadius)||void 0===Gt||!Gt.bottomRight)||!(null===(Wt=e.borderRadius)||void 0===Wt||!Wt.all)||!(null===(jt=e.borderRadius)||void 0===jt||!jt.topLeft)||!(null===(Ut=e.borderRadius)||void 0===Ut||!Ut.bottomLeft)||!(null===(Xt=e.borderRadius)||void 0===Xt||!Xt.topRight)||!(null===(qt=e.borderRadius)||void 0===qt||!qt.bottomRight)),be(!!e.boxShadow),he(!(null===($t=e.mobileBoxShadow)||void 0===$t||!$t.blurRadius)||!(null===(Yt=e.mobileBoxShadow)||void 0===Yt||!Yt.color)||!(null===(Kt=e.mobileBoxShadow)||void 0===Kt||!Kt.hOffset)||!(null===(Qt=e.mobileBoxShadow)||void 0===Qt||!Qt.inset)||!(null===(Zt=e.mobileBoxShadow)||void 0===Zt||!Zt.spreadRadius)||!(null===(Jt=e.mobileBoxShadow)||void 0===Jt||!Jt.vOffset)||!!e.boxShadow),Ae(!(null===(el=e.mobileWidth)||void 0===el||!el.value)||!(null===(tl=e.mobileHeight)||void 0===tl||!tl.value)||!!e.width.value||!!e.height.value),ye(!!e.backgroundColor||!(null===(ll=e.backgroundImage)||void 0===ll||!ll[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Be(!(null===(ol=e.mobileBackgroundColor)||void 0===ol||!ol.value)||!!e.backgroundColor||!(null===(al=e.backgroundImage)||void 0===al||!al[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),xe(!(null===(il=e.mobileFontSize)||void 0===il||!il.value)||!!e.fontSize||!!e.showOnMobile),Re(!(null===(rl=e.padding)||void 0===rl||!rl.all)||!(null===(nl=e.padding)||void 0===nl||!nl.top)||!(null===(ml=e.padding)||void 0===ml||!ml.bottom)||!(null===(dl=e.padding)||void 0===dl||!dl.left)||!(null===(sl=e.padding)||void 0===sl||!sl.right)),Te(!(null===(cl=e.mobilePadding)||void 0===cl||!cl.all)||!(null===(ul=e.mobilePadding)||void 0===ul||!ul.top)||!(null===(pl=e.mobilePadding)||void 0===pl||!pl.bottom)||!(null===(gl=e.mobilePadding)||void 0===gl||!gl.left)||!(null===(bl=e.mobilePadding)||void 0===bl||!bl.right)||!(null===(El=e.padding)||void 0===El||!El.all)||!(null===(hl=e.padding)||void 0===hl||!hl.top)||!(null===(fl=e.padding)||void 0===fl||!fl.bottom)||!(null===(vl=e.padding)||void 0===vl||!vl.left)||!(null===(Al=e.padding)||void 0===Al||!Al.right))}}),[i,e,Y]);const Ze=(0,o.useCallback)((e=>{s(We===F.Tm?(0,m.A9)(e):(0,d.A9)(e))}),[s,We]),et=e=>{i.setFieldValue("href","mergetag"!==e?e:""),Oe(e)},tt=({target:e})=>{const{selectionStart:t,selectionEnd:l}=e;e&&Me({target:e,selection:{start:t,end:l}})};(0,o.useEffect)((()=>{var t;He(!(null===(t=e.textReplacer)||void 0===t||!t.length))}),[e]);return o.createElement(u.A,{form:i,layout:"vertical",name:"selected_button_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:Ge.uE[Ye]||"borderAll",mobileBorderPosition:Ge.lS[Ke]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",href:"https://"},onValuesChange:t=>{const l=i.getFieldsValue(!0),o=Object.keys(t)[0];let r;switch(Ce("%"===i.getFieldsValue(!0).widthDim?100:""),o){case"exportAsPicture":r={exportAsPicture:l.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":r={boxShadow:{hOffset:l.boxShadowHOffset,vOffset:l.boxShadowVOffset,blurRadius:l.boxShadowBlurRadius,spreadRadius:l.boxShadowSpreadRadius,color:l.boxShadowColor,inset:l.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var n,m,d;if("borderAll"===l.borderPosition)r={border:{...F.iV,all:{...Ge.RH,...l.borderAll}}},i.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(n=l.borderAll)&&void 0!==n&&n.width||null!==(m=l.borderAll)&&void 0!==m&&m.style||null!==(d=l.borderAll)&&void 0!==d&&d.color?(r={border:{all:null,left:l.borderAll,right:l.borderAll,top:l.borderAll,bottom:l.borderAll,[Ge.Vz[o]]:{...l[o],...t[o]}}},i.setFieldsValue({borderAll:null,borderLeft:l.borderAll,borderRight:l.borderAll,borderTop:l.borderAll,borderBottom:l.borderAll,[o]:{...l[o],...t[o]}})):(r={border:{all:null,left:l.borderLeft,right:l.borderRight,top:l.borderTop,bottom:l.borderBottom,[Ge.Vz[o]]:{...l[o],...t[o]}}},i.setFieldsValue({border:r.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var s,c,u;if("mobileBorderAll"===l.mobileBorderPosition)r={mobileBorder:{...F.iV,all:{...Ge.RH,...l.mobileBorderAll,classNamePrefix:"em-mob-border_"+Ge.ax[o]+"-"}}},i.setFieldsValue({borderLeft:Ge.RH,borderRight:Ge.RH,borderTop:Ge.RH,borderBottom:Ge.RH});else null!==(s=l.mobileBorder.all)&&void 0!==s&&s.width||null!==(c=l.mobileBorder.all)&&void 0!==c&&c.style||null!==(u=l.mobileBorder.all)&&void 0!==u&&u.color?(r={mobileBorder:{all:null,left:l.mobileBorderAll,right:l.mobileBorderAll,top:l.mobileBorderAll,bottom:l.mobileBorderAll,[Ge.ax[o]]:{...l[o],...t[o],classNamePrefix:"em-mob-border_"+Ge.ax[o]+"-"}}},i.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:l.mobileBorderAll,mobileBorderRight:l.mobileBorderAll,mobileBorderTop:l.mobileBorderAll,mobileBorderBottom:l.mobileBorderAll,[o]:{...l[o],...t[o]}})):(r={mobileBorder:{all:null,left:l.mobileBorderLeft,right:l.mobileBorderRight,top:l.mobileBorderTop,bottom:l.mobileBorderBottom,[Ge.ax[o]]:{...l[o],...t[o],classNamePrefix:"em-mob-border_"+Ge.ax[o]+"-"}}},i.setFieldsValue({mobileBorder:r.mobileBorder}));break;case"width":r={[o]:{value:t[o],dim:l.widthDim}};break;case"height":r={[o]:{value:t[o],dim:l.heightDim}};break;case"widthDim":r={width:{value:l.width,dim:t[o]}};break;case"heightDim":r={height:{value:l.height,dim:t[o]}};break;case"backgroundImage":G(""===t[o]),r={[o]:[{...e.backgroundImage[0],value:t[o]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{left:l.paddingLeft,right:l.paddingRight,top:l.paddingTop,bottom:l.paddingBottom,[Ge.yy[o]]:+t[o]}};break;case"paddingTopBottom":r={padding:{left:l.paddingLeft,right:l.paddingRight,top:+t[o],bottom:+t[o]}},l.paddingTop=l.paddingBottom=+t[o];break;case"paddingLeftRight":r={padding:{top:l.paddingTop,bottom:l.paddingBottom,left:+t[o],right:+t[o]}},l.paddingLeft=l.paddingRight=+t[o];break;case"borderRadiusAll":r={borderRadius:{[F.wF[o]]:+t[o]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{topLeft:l.borderRadiusTopLeft,bottomLeft:l.borderRadiusBottomLeft,topRight:l.borderRadiusTopRight,bottomRight:l.borderRadiusBottomRight,[F.wF[o]]:+t[o]}};break;case"mobileWidth":r={[o]:{classNamePrefix:"em-mob-width-",value:t[o],dim:l.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth||100,dim:t[o]}};break;case"mobileHeight":r={[o]:{classNamePrefix:"em-mob-height-",value:t[o],dim:l.mobileHeightDim},mobileLineHeight:{classNamePrefix:"em-mob-line_height-",value:t[o],dim:l.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[o]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[Ge.NW[o]]:t[o],classNamePrefix:"em-mob-border_radius_"+Ge.NW[o]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":r={mobileBoxShadow:{hOffset:l.mobileBoxShadowHOffset,vOffset:l.mobileBoxShadowVOffset,blurRadius:l.mobileBoxShadowBlurRadius,spreadRadius:l.mobileBoxShadowSpreadRadius,color:l.mobileBoxShadowColor,inset:l.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":r={[o]:{classNamePrefix:"em-mob-table_align-",value:t[o]}};break;case"mobileTextAlign":r={[o]:{classNamePrefix:"em-mob-text_align-",value:t[o]}};break;case"mobileVerticalAlign":r={[o]:{classNamePrefix:"em-mob-vertical_align-",value:t[o]}};break;case"mobileBackgroundColor":r={[o]:{classNamePrefix:"em-mob-background_color-",value:t[o]}};break;case"mobileBackgroundPositionX":r={[o]:{classNamePrefix:"em-mob-background_position_x-",value:t[o]}};break;case"mobileBackgroundPositionY":r={[o]:{classNamePrefix:"em-mob-background_position_x-",value:t[o]}};break;case"mobileBackgroundRepeat":r={[o]:{classNamePrefix:"em-mob-background_repeat-",value:t[o]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":r={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":l.mobilePaddingTop=l.mobilePaddingBottom=t[o],r={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":l.mobilePaddingLeft=l.mobilePaddingRight=t[o],r={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileFontSize":r={[o]:{classNamePrefix:"em-mob-font_size-",value:t[o],dim:l.mobileFontSizeDim}};break;case"href":let a=t[o];"https://http"===a.substring(0,12)&&(a=a.substring(8,a.length),l.href=a),r={[o]:a},"https://"===t[o].substring(0,8)||"http://"===t[o].substring(0,7)?Oe("https://"):"mailto:"===t[o].substring(0,7)?Oe("mailto:"):"tel:"===t[o].substring(0,4)?Oe("tel:"):"sms:"===t[o].substring(0,4)?Oe("sms:"):"ftp://"===t[o].substring(0,6)?Oe("ftp://"):"skype:"===t[o].substring(0,6)?Oe("skype:"):"viber:"===t[o].substring(0,6)?Oe("viber:"):Oe("");break;default:r=t}var p;"borderPosition"!==o&&"mobileBorderPosition"!==o&&(a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),"mobileBorderRadiusAll"!==o&&"mobileBorderRadiusTopLeft"!==o&&"mobileBorderRadiusTopRight"!==o&&"mobileBorderRadiusBottomLeft"!==o&&"mobileBorderRadiusBottomRight"!==o&&Ze({...e,...r,mobileBorderRadius:{...e.mobileBorderRadius,...null===(p=r)||void 0===p?void 0:p.mobileBorderRadius},activateSection:null,changeKey:o}))},autoComplete:"off",className:"element-controls"},!Y&&o.createElement(p.A,{title:l("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:l("Appearance on mobile devices"),type:"info"})),Y?o.createElement(nt,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0}):o.createElement(o.Fragment,null,C===F.ND&&M.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(pe,{form:i,elementSettings:e,imgParent:!0})),z.formButtonFieldTextAlignEnabled&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(dt,{form:i,name:"mobileTextAlign",elementSettings:e,imgParent:!0}))),!!e.showOnMobile&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),o.createElement(p.A,{trigger:["hover"],title:l("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"href",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(_.A,{addonBefore:o.createElement(Ge.Ai,{linkProtocol:Le,handleLinkProtocolsChange:et,__:l}),placeholder:l("Hyperlink URL"),allowClear:!0,prefix:o.createElement(Ge.RM,{linkProtocol:Le})})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Text"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{xe((e=>!e)),ke&&(t.mobileFontSize="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileFontSize:{value:null,dim:"px",classNamePrefix:"em-mob-font_size-"}}}))}))}},ke?o.createElement(x.A,null):o.createElement(k.A,null)))),ke&&o.createElement(o.Fragment,null,!!e.showOnMobile&&o.createElement(ot,{form:i,elementSettings:e,setLinkProtocol:Oe,linkProtocol:Le,showAddParagraph:!1,isButton:!0}),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(qe,null)))),o.createElement(h.A,{className:"selected-td-form__divider"}),z.formButtonFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Te((e=>!e)),Ne&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},Ne?o.createElement(x.A,null):o.createElement(k.A,null)))),Ne&&o.createElement(b.A,{gutter:10,style:{paddingBottom:8}},o.createElement(o.Fragment,null,o.createElement(Ct,{form:i,elementSettings:e,mobilePaddingsExt:oe,setMobilePaddingsExt:ae}))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve&&(t.mobileWidth="",t.mobileHeight="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},ve?o.createElement(x.A,null):o.createElement(k.A,null)))),ve&&o.createElement(b.A,{gutter:10,style:{paddingBottom:8}},o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:2*K.formItemMarginBottomXS}},o.createElement(p.A,{title:l("Width"),placement:"bottom"},o.createElement(Q,{form:i,name:"mobileWidth",elementSettings:e})))),o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:2*K.formItemMarginBottomXS}},o.createElement(p.A,{title:l("Height"),placement:"bottom"},o.createElement(J,{form:i,name:"mobileHeight",elementSettings:e}))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Be((e=>!e)),t.mobileBackgroundColor=Se?"":e.commonStyles.buttons.backgroundColor||"#1C52DC",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Se?o.createElement(x.A,null):o.createElement(k.A,null)))),Se&&o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:(z.formButtonFieldBackgroundImageEnabled,K.formItemMarginBottomMD+4)}},o.createElement(vt,{form:i,elementSettings:e,label:l("Background color")}))),z.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{me((e=>!e)),ne?(t.mobileBorderAll=Ge.RH,t.mobileBorderTop=Ge.RH,t.mobileBorderBottom=Ge.RH,t.mobileBorderRight=Ge.RH,t.mobileBorderLeft=Ge.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},ne?o.createElement(x.A,null):o.createElement(k.A,null)))),ne&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,typeOfForm:"mobile"}))),z.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ue((e=>!e)),ce?(t.mobileBorderRadiusAll=null,N(!0)):t.mobileBorderRadiusAll=5,a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},ce?o.createElement(x.A,null):o.createElement(k.A,null)))),ce&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:R,setOneBorderRadiusValue:N,elementSettings:e,typeOfForm:"mobile"}))),z.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{he((e=>!e)),Ee?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},Ee?o.createElement(x.A,null):o.createElement(k.A,null)))),Ee&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v,typeOfForm:"mobile"}))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))),z.formFieldAmpVisibilityEnabled&&e.isAmp&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement(g.A,{className:"selected_form-desktop-props-title",message:l("Appearance on mobile devices"),type:"info"}),o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(V,{form:i,elementSettings:e})),z.formButtonFieldTextAlignEnabled&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(Je.A,{form:i,name:"textAlign",elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),o.createElement(p.A,{trigger:["hover"],title:l("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"href",style:{marginBottom:z.formButtonFieldReplacerEnabled?K.formItemMarginBottomXS:K.formItemMarginBottomMD+4}},o.createElement(_.A,{addonBefore:o.createElement(Ge.Ai,{linkProtocol:Le,handleLinkProtocolsChange:et,__:l}),placeholder:l("Hyperlink URL"),allowClear:!0,onSelect:tt,prefix:o.createElement(Ge.RM,{linkProtocol:Le})}))),z.formButtonFieldReplacerEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:3},o.createElement(p.A,{title:l("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":ze}),icon:o.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{He(!ze),ze?(i.setFieldValue("textReplacer",""),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{textReplacer:""}})):setTimeout((()=>Z.current.focus()))},ref:ee}))),o.createElement(E.A,{span:21},ze&&o.createElement(p.A,{trigger:["hover"],title:l("Text"),placement:"bottom"},o.createElement(u.A.Item,{name:"textReplacer"},o.createElement(_.A,{placeholder:l("The code that will replace this text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Text"),onChange:e=>{""!==e.target.value&&ee.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const t=e.target,l=t.value,o=t.selectionStart;if(0!==o||" "!==e.key){if(" "===e.key){if(o!==l.length)return void e.preventDefault();l.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:Z,onSelect:tt})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),z.formButtonFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),we&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},we?o.createElement(x.A,null):o.createElement(k.A,null)))),we&&o.createElement(b.A,{gutter:K.marginSM,style:{marginBottom:4}},o.createElement(o.Fragment,null,o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:te?"block":"none"}},o.createElement(p.A,{title:l("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeftRight"},o.createElement(W.A,{min:0,max:300,placeholder:l("Horizontal"),prefix:o.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:te?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:l("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:l("Left"),prefix:o.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:l("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingRight"},o.createElement(W.A,{min:0,max:300,placeholder:l("Right"),prefix:o.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:te?"block":"none"}},o.createElement(p.A,{title:l("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTopBottom"},o.createElement(W.A,{min:0,max:300,placeholder:l("Vertical"),prefix:o.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:te?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:l("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:l("Top"),prefix:o.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:l("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingBottom"},o.createElement(W.A,{min:0,max:300,placeholder:l("Bottom"),prefix:o.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},o.createElement(p.A,{title:l("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!te}),onClick:()=>{le((e=>!e));const t=i.getFieldsValue(!0);te||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(O.A,{icon:"PaddingSwitcher"})))))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement("div",{className:"form-group-title"},l("Size")),o.createElement(b.A,{gutter:K.marginSM,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{title:l("Width"),placement:"left"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:Ie,placeholder:l("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Qt)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:l("Height"),placement:"left"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:l("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"}))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{style:{paddingTop:K.formItemMarginBottomMD+4,paddingBottom:4}},o.createElement(ot,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0,setLinkProtocol:Oe,linkProtocol:Le,linkTarget:De})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ye((e=>!e)),_e?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",G(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},_e?o.createElement(x.A,null):o.createElement(k.A,null)))),_e&&o.createElement(b.A,{gutter:10,style:{marginBottom:H?14:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:z.formButtonFieldBackgroundImageEnabled?K.formItemMarginBottomXS:K.formItemMarginBottomMD+4}},o.createElement(j.A,{placeholder:l("Background color"),usedColors:e.usedColors})))),z.formButtonFieldBackgroundImageEnabled&&o.createElement(E.A,{span:H?12:24},o.createElement("div",{style:{paddingBottom:H?4:0}},o.createElement(T.A,{form:i,label:l("Background image"),name:"backgroundImage",tooltipTitle:l("Background image")})),!H&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:l("Horizontal position"),prefix:o.createElement(O.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:l("Vertical position"),prefix:o.createElement(O.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:l("Please choose"),options:je,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:l("Please choose"),options:Ue,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),z.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{re((e=>!e)),ie?(t.borderAll=Ge.RH,t.borderTop=Ge.RH,t.borderBottom=Ge.RH,t.borderRight=Ge.RH,t.borderLeft=Ge.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},ie?o.createElement(x.A,null):o.createElement(k.A,null)))),ie&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,elementSettings:e}))),z.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{se((e=>!e)),de?(t.borderRadiusAll=0,w(!0)):t.borderRadiusAll=5,a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},de?o.createElement(x.A,null):o.createElement(k.A,null)))),de&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:y,setOneBorderRadiusValue:w,elementSettings:e}))),z.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),ge?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},ge?o.createElement(x.A,null):o.createElement(k.A,null)))),ge&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v}))),z.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:i})))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null))))))))};var el=l(94780);const tl=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[l]=u.A.useForm(),{TextArea:a}=_.A,i=(0,D.XW)();(0,o.useEffect)((()=>{e&&l.setFieldsValue({...e})}),[l,e]);return o.createElement(u.A,{form:l,layout:"vertical",name:"selected_variable_form",initialValues:{value:""},onValuesChange:t=>{i({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(u.A.Item,{label:t("Variable value"),name:"value",tooltip:{title:t("Type the output parameters of your platform. E.g., ")+"${Recipient.FirstName}",icon:o.createElement(el.A,null)},style:{marginBottom:35}},o.createElement(a,{rows:4,placeholder:t("Variable value")}))))};var ll=l(40186);const{useToken:ol}=c.A,al=({elementSettings:e,setElementSettings:t,postfix:l="",form:a,handleSelect:i})=>{const{__:n}=(0,L.s9)(),{token:m}=ol(),d=(0,Ve.rD)(),s=(0,D.XW)(),c="src"+l,g="title"+l,b="alt"+l,E="link"+l,h="imgReplacer"+l,v=(0,o.useRef)(null),S=(0,o.useRef)(null),B=(0,o.useRef)(null),k=(0,o.useRef)(null),x=(0,o.useRef)(null),w=(0,o.useRef)(null),R=(0,o.useRef)(null),N=(0,o.useRef)(null),[I,P]=(0,o.useState)(""),[C,M]=(0,o.useState)(""),[V,z]=(0,o.useState)(""),[H,G]=(0,o.useState)(!1),[W,j]=(0,o.useState)("https://");(0,o.useEffect)((()=>{var t,l,o;M(null===(t=e.images)||void 0===t?void 0:t[b]),z(null===(l=e.images)||void 0===l?void 0:l[g]),P(null===(o=e.images)||void 0===o?void 0:o[E])}),[e,b,g,E]);return o.createElement(o.Fragment,null,("img"===e.type||"video"===e.type||"carousel"===e.type)&&o.createElement(u.A.Item,{style:{marginBottom:0}},o.createElement(T.A,{form:a,label:n("Image path"),name:c,placeholder:n("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},o.createElement(A.A,{size:8},o.createElement(p.A,{title:C||n("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!C}),onClick:()=>{C?(M(""),a.setFieldValue("alt",""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[b]:""}})):(M(B.current&&B.current.input.value?B.current.input.value:"..."),setTimeout((()=>{B.current.focus()})))},ref:k},o.createElement("span",{className:"addon-text-content"},"Alt"))),d.formFieldImageTitleEnabled&&o.createElement(p.A,{title:V||n("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!V}),onClick:()=>{V?(z(!1),a.setFieldValue("title",""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[g]:""}})):(z(x.current&&x.current.input.value?x.current.input.value:"..."),setTimeout((()=>{x.current.focus()})))},ref:w},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(p.A,{title:I||n("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!I}),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:()=>{I?(P(""),a.setFieldValue(E,""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[E]:""}})):(P(v.current&&v.current.input.value?v.current.input.value:"..."),setTimeout((()=>{v.current.focus()})))},ref:S})),o.createElement(p.A,{title:n("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":H}),icon:o.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{G(!H),H?(a.setFieldValue(h,""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[h]:""}})):setTimeout((()=>R.current.focus()))},ref:N}))),o.createElement(A.A,{size:8},o.createElement(p.A,{title:n("Remove slide"),placement:"bottom"},o.createElement(f.Ay,{type:"text",onClick:o=>{var i;const r=a.getFieldsValue(!0),n=+l.substring(1),m=Object.keys(null===r||void 0===r?void 0:r.images).reduce(((e,t)=>(t.includes(l)||(e[t]=r[t]),e)),{}),d=null===(i=e.carouselImages)||void 0===i?void 0:i.filter(((e,t)=>t!==n));t((e=>({...e,settings:{...e.settings,carouselImages:d}}))),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,caption:e.caption,settings:{...e,carouselImages:d}}),a.setFieldsValue({images:m})},icon:o.createElement(ll.A,null)})))),(!!I||!!C||!!V||!!H)&&o.createElement("div",null,!!I&&o.createElement(p.A,{trigger:["hover"],title:n("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:E,className:"selected-image-form__alt",style:{marginTop:m.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{addonBefore:o.createElement(Ge.Ai,{linkProtocol:W,handleLinkProtocolsChange:e=>{a.setFieldValue("LinkName","mergetag"!==e?e:""),j(e)},__:n}),placeholder:n("Hyperlink URL"),allowClear:!0,ref:v,onChange:e=>{""===e.target.value?P("..."):(S.current.classList.add("selected-td-form__button--active"),P(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?j("https://"):"mailto:"===t.substring(0,7)?j("mailto:"):"tel:"===t.substring(0,4)?j("tel:"):"sms:"===t.substring(0,4)?j("sms:"):"ftp://"===t.substring(0,6)?j("ftp://"):"skype:"===t.substring(0,6)?j("skype:"):"viber:"===t.substring(0,6)?j("viber:"):j("")},onSelect:i,prefix:o.createElement(Ge.RM,{linkProtocol:W})}))),!!C&&o.createElement(p.A,{trigger:["hover"],title:n("Alternative text"),placement:"bottom"},o.createElement(u.A.Item,{name:b,className:"selected-image-form__alt",style:{marginTop:m.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{placeholder:n("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:e=>{""===e.target.value?M("..."):(k.current.classList.add("selected-td-form__button--active"),M(e.target.value))},ref:B,onSelect:i}))),d.formFieldImageTitleEnabled&&!!V&&o.createElement(p.A,{trigger:["hover"],title:n("Tooltip text"),placement:"bottom"},o.createElement(u.A.Item,{name:g,className:"selected-image-form__alt",style:{marginTop:m.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{placeholder:n("Enter the title of the image"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:e=>{""===e.target.value?z("..."):(w.current.classList.add("selected-td-form__button--active"),z(e.target.value))},ref:x,onSelect:i}))),!!H&&o.createElement(p.A,{trigger:["hover"],title:n("Image src"),placement:"bottom"},o.createElement(u.A.Item,{name:h,className:"selected-image-form__alt",style:{marginTop:m.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{placeholder:n("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},n("Image src")),onChange:e=>{""!==e.target.value&&N.current.classList.add("selected-td-form__button--active")},ref:R,onSelect:i})))))},il={loop:!1,autoplay:!1,borderRadiusAll:0,borderRadiusTopLeft:0,borderRadiusBottomLeft:0,borderRadiusTopRight:0,borderRadiusBottomRight:0,link:"https://",images:{},src_0:"",renderedHeight_0:0,renderedWidth_0:0,imgReplacer_0:"",title_0:"",alt_0:""},{useToken:rl}=c.A,nl=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:l}=rl(),[a]=u.A.useForm();let i=(0,n.wA)();const r=(0,Ve.rD)(),m=(0,D.K9)(),d=(0,D.XW)(),s=(0,n.d4)(Fe.Ct),c=(0,n.d4)(Fe.CS),[y,S]=(0,o.useState)(!0),[B,w]=(0,o.useState)(!0),[R,N]=(0,o.useState)(!1),[T,I]=(0,o.useState)(!1),[C,M]=(0,o.useState)("https://"),[V,z]=(0,o.useState)(null===a||void 0===a?void 0:a.getFieldsValue(!0)),[H,G]=(0,o.useState)(e),[W,j]=(0,o.useState)(null),[U,X]=(0,o.useState)(),[$,Y]=(0,o.useState)(!1),[K,Q]=(0,o.useState)(!1),[Z,J]=(0,o.useState)({start:0,end:0}),ee=(0,o.useRef)(null),te=`selected_${H.type}_form_link`,le=(0,n.d4)(Fe.Fv),oe=(0,n.d4)(Fe.yy),ae=le&&"bottom"!==oe;(0,o.useEffect)((()=>{$&&ee.current&&ee.current.focus()}),[$]),(0,o.useEffect)((()=>{G(e)}),[e]);const ie=(0,n.d4)(We.GH);(0,o.useEffect)((()=>{var e;null!==ie&&void 0!==ie&&null!==(e=ie.items)&&void 0!==e&&e.length&&X((0,Ve.cM)(ie.items,t,((e,t)=>{Y(!1),m(F.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[ie,X,t,Y,m]);(0,o.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||j(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||Y(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);(0,o.useEffect)((()=>{const e=null===a||void 0===a?void 0:a.getFieldsValue(!0);z(e)}),[a]);const re=({target:e})=>{if(e&&!K){const{selectionStart:t,selectionEnd:l}=e;J({start:t,end:l})}Q(!1)};(0,o.useEffect)((()=>{if(H.settings){var e,t,l,o,i,r,n,m,d,s,c,u,p,g,b;const _=H.settings,y=(0,Ge.AO)(_);var E,h,f,v,A;if(null===a||void 0===a||a.setFieldsValue(y),z(y),_.link&&M((0,Ge.TW)(_.link,"https://")),!(0,Ge.ok)(null===(e=_.borderRadius)||void 0===e?void 0:e.all))(0,Ge.ok)(null===(E=_.borderRadius)||void 0===E?void 0:E.topLeft)||(0,Ge.ok)(null===(h=_.borderRadius)||void 0===h?void 0:h.bottomLeft)||(0,Ge.ok)(null===(f=_.borderRadius)||void 0===f?void 0:f.topRight)||(0,Ge.ok)(null===(v=_.borderRadius)||void 0===v?void 0:v.bottomRight)?S(!1):(0,Ge.ok)(null===(A=_.borderRadius)||void 0===A?void 0:A.all)||S(!0);(0,Ge.ok)(null===(t=_.mobileBorderRadius)||void 0===t?void 0:t.topLeft)||(0,Ge.ok)(null===(l=_.mobileBorderRadius)||void 0===l?void 0:l.bottomLeft)||(0,Ge.ok)(null===(o=_.mobileBorderRadius)||void 0===o?void 0:o.topRight)||(0,Ge.ok)(null===(i=_.mobileBorderRadius)||void 0===i?void 0:i.bottomRight)?w(!1):w(!0),N(!(null===(r=_.borderRadius)||void 0===r||!r.all)||!(null===(n=_.borderRadius)||void 0===n||!n.topLeft)||!(null===(m=_.borderRadius)||void 0===m||!m.bottomLeft)||!(null===(d=_.borderRadius)||void 0===d||!d.topRight)||!(null===(s=_.borderRadius)||void 0===s||!s.bottomRight)),I(!(null===(c=_.mobileBorderRadius)||void 0===c||!c.all)||!(null===(u=_.mobileBorderRadius)||void 0===u||!u.topLeft)||!(null===(p=_.mobileBorderRadius)||void 0===p||!p.bottomLeft)||!(null===(g=_.mobileBorderRadius)||void 0===g||!g.topRight)||!(null===(b=_.mobileBorderRadius)||void 0===b||!b.bottomRight))}}),[a,H]);(0,Ce.A)((e=>{const t=e.data.operation;t===F.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_AI))):t===F.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):t===F.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_EDIT))):t===F.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_GIF))):t===F.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_STOCK))):t===F.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,Oe.Os)()),i((0,Oe.Oo)()))}));return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:il,onValuesChange:e=>{const t=(0,Ge.Ze)(H.settings,a,e);d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,caption:t.caption,settings:t}),G((e=>({...e,settings:{...e.settings,...t}})))},autoComplete:"off",className:"element-controls"},!ae&&o.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),s===F.ND&&c.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement("p",null,t("No properties to edit.")))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(p.A,{trigger:["hover"],title:t("Link for all slides"),placement:"bottom"},o.createElement(u.A.Item,{name:"link"},o.createElement(_.A,{addonBefore:o.createElement(Ge.Ai,{linkProtocol:C,handleLinkProtocolsChange:e=>{a.setFieldValue("link","mergetag"!==e?e:""),M(e)},__:t}),placeholder:t("Link for all slides"),allowClear:!0,onSelect:re,prefix:o.createElement(Ge.RM,{linkProtocol:C})}))),o.createElement(h.A,{className:"selected-td-form__divider"}),r.mergeTagsShow&&U&&o.createElement(o.Fragment,null,o.createElement(E.A,{span:24,id:"merge_tags_wrapper"},o.createElement(u.A.Item,{style:{marginBottom:l.formItemMarginBottomMD,marginTop:l.formItemMarginBottomMD}},o.createElement(f.Ay,{id:"merge_tags_button",icon:o.createElement(O.A,{icon:"MergeTags"}),style:{width:"100%",display:$?"none":"block"},onClick:()=>Y(!0)},t("Merge tags")),o.createElement(v.A,{ref:ee,popupClassName:"merge-tags",options:U,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const l=t.map(((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map(((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t)))}));return o.createElement("div",{title:t.map((e=>e.label)).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(e,t)=>{if(Y(!1),e){const l=ie.syntax.length>1?U.findIndex((e=>e.key===t[0].key)):0,o=ie.syntax[l].replace("%value%",e[e.length-1]),i=`selected_${H.type}_form${"carousel"===H.type?"_images":""}`;["imgReplacer","title","alt","src","link"].some((e=>null===W||void 0===W?void 0:W.getAttribute("id").includes(`${i}_${e}`)))||null!==W&&void 0!==W&&W.getAttribute("id").includes(te)?((e,t)=>{const l=document.getElementById(t);if(l){var o,i;const m=`selected_${H.type}_form_${t.includes("__images_")?"_images":""}_`,s=t.substring(t.indexOf(m)+m.length),c=null===(o=l.value)||void 0===o?void 0:o.substring(0,Z.start),u=null===(i=l.value)||void 0===i?void 0:i.substring(Z.end);let p={[s]:c+e+u};var r;if(s.includes("_"))p={carouselImages:[...(null===(r=H.settings)||void 0===r?void 0:r.carouselImages)||[]]},p.carouselImages[s.split("_")[1]][s.split("_")[0]]=c+e+u;else if(H.type===F.bV.CAROUSEL&&te===t){var n;p={[s]:c+e+u,carouselImages:[...(null===(n=H.settings)||void 0===n?void 0:n.carouselImages.map((t=>({...t,link:c+e+u}))))||[]]}}d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...H.settings,...p}}),G((e=>({...e,settings:{...e.settings,...p}}))),a.setFieldValue(s,c+e+u),l.focus(),setTimeout((()=>{l.selectionStart=Z.start,l.selectionEnd=Z.start+e.length}),400),Q(!0)}})(o,null===W||void 0===W?void 0:W.getAttribute("id")):(a.setFieldValue("imgReplacer",o),d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...H.settings,imgReplacer:o}}),G((e=>({...e,settings:{...e.settings,imgReplacer:o}}))))}},style:{display:$?"block":"none"},open:$,onKeyDown:e=>{"Escape"===e.key&&Y(!1)}}))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(u.A.List,{name:"images",initialValue:null===V||void 0===V?void 0:V.images},(()=>{var e,t;return o.createElement("div",{style:{paddingTop:l.formItemMarginBottomMD+4}},null===H||void 0===H||null===(e=H.settings)||void 0===e||null===(t=e.carouselImages)||void 0===t?void 0:t.map(((e,t)=>o.createElement("div",{className:"carousel__slide",key:t},o.createElement(al,{elementSettings:V,setElementSettings:G,postfix:"_"+t,form:a,handleSelect:re})))))})),o.createElement(E.A,{span:24},o.createElement(u.A.Item,{style:{marginBottom:l.formItemMarginBottomMD}},o.createElement(f.Ay,{id:"add_slide_button",icon:o.createElement(O.A,{icon:"AddSlide"}),style:{width:"100%"},onClick:()=>(()=>{var e,t;const{width:l,height:o,renderedWidth:a,renderedHeight:i}=(null===H||void 0===H||null===(e=H.settings)||void 0===e?void 0:e.carouselImages[0])||{width:{value:600},height:{value:600},renderedWidth:600,renderedHeight:600},r={src:"https://emcdn.ru/1865/231031_17_BGU9Mso.png",width:{value:l.value,dim:"px"},height:{value:o.value,dim:"px"},alt:"",title:"",link:null,renderedWidth:a,renderedHeight:i,imgReplacer:"",mobileWidth:{value:null,dim:"px"},mobileHeight:{value:null,dim:"px"},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}},n=[...null===H||void 0===H||null===(t=H.settings)||void 0===t?void 0:t.carouselImages,r];d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...H.settings,carouselImages:n}}),G((e=>({...e,settings:{...e.settings,carouselImages:n}})))})()},t("Add slide")))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:20,style:{marginTop:l.formItemMarginBottomMD-10}},o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"loop",valuePropName:"checked",style:{marginBottom:l.formItemMarginBottomMD-6}},o.createElement(q.A,{size:"small",id:"Loop"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Loop"},t("Loop"))))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"autoplay",valuePropName:"checked",style:{marginBottom:l.formItemMarginBottomMD-6}},o.createElement(q.A,{size:"small",id:"Autoplay"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Autoplay"},t("Autoplay")))))),o.createElement(h.A,{className:"selected-td-form__divider"}),r.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{N((e=>!e)),a.setFieldValue("borderRadiusAll",R?0:5),d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...H.settings,borderRadius:{all:R?"":5}}}),G((e=>({...e,settings:{...e.settings,borderRadius:{all:R?null:5}}})))}))}},R?o.createElement(x.A,null):o.createElement(k.A,null)))),R&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:y,setOneBorderRadiusValue:S,elementSettings:H.settings}))))))},ml={animate:!0,expandSingleSection:!0,sections:[{expanded:!1,index:0}]},{useToken:dl}=c.A,sl=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:l}=dl(),[a]=u.A.useForm(),i=(0,D.XW)(),[r,n]=(0,o.useState)(e);(0,o.useEffect)((()=>{n(e)}),[e]),(0,o.useEffect)((()=>{if(r.settings){const e=r.settings,t=(0,Ge.AO)(e);null===a||void 0===a||a.setFieldsValue(t)}}),[a,r]);return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:ml,onValuesChange:e=>{const t=(0,Ge.Ze)(r.settings,a,e);i({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:r.type,caption:t.caption,settings:t}),n((e=>({...e,settings:{...e.settings,...t}})))},autoComplete:"off",className:"element-controls"},o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:15},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"expandSingleSection",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"ExpandSingleSection"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"ExpandSingleSection"},t("Expand only one section"))))),o.createElement(E.A,{span:9},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"animate",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"Animate"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Animate"},t("Animate")))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(u.A.List,{name:"sections"},(()=>{var e,a;return o.createElement("div",{style:{paddingTop:l.formItemMarginBottomMD+4}},null===r||void 0===r||null===(e=r.settings)||void 0===e||null===(a=e.sections)||void 0===a?void 0:a.map(((e,l)=>{var a,m;return o.createElement(b.A,{gutter:24,key:`expanded_${l}`},o.createElement(E.A,{span:20},o.createElement(A.A,{size:10,align:"baseline"},o.createElement("span",{style:{position:"relative",top:2}},t("Section ")+(l+1)),o.createElement(u.A.Item,{name:`expanded_${l}`},o.createElement(q.A,{size:"small",id:`expanded_${l}`,checked:e.expanded})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:`expanded_${l}`},t("expanded"))))),o.createElement(E.A,null,(null===r||void 0===r||null===(a=r.settings)||void 0===a||null===(m=a.sections)||void 0===m?void 0:m.length)>1&&o.createElement(f.Ay,{type:"text",icon:o.createElement(ll.A,null),style:{marginRight:"auto"},onClick:()=>{return e=l,n((t=>{var l;return{...t,settings:{...t.settings,sections:null===(l=r.settings.sections)||void 0===l?void 0:l.filter(((t,l)=>l!==e))}}})),void i({operation:F.Ru.SANDBOX_ACCORDION_REMOVE_SECTION,settings:{index:e}});var e}})))})))})),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:24},o.createElement(u.A.Item,{style:{marginBottom:l.formItemMarginBottomMD}},o.createElement(f.Ay,{style:{width:"100%",display:"block"},icon:o.createElement(O.A,{icon:"MergeTags"}),onClick:()=>(n((e=>{var t;return{...e,sections:null===r||void 0===r||null===(t=r.settings)||void 0===t?void 0:t.sections.push({expanded:!1})}})),void i({operation:F.Ru.SANDBOX_ACCORDION_ADD_SECTION,settings:{section:t("Section title"),text:t("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}}))},t(" Add section"))))),o.createElement(h.A,{className:"selected-td-form__divider"}))))},cl=({className:e,formSettings:t,emailElementType:l})=>{const i=(0,n.wA)(),s=(0,He.Cb)(),c=(0,o.useRef)(),u=(0,n.d4)(Fe.B),p=(0,n.d4)(m.qX),g=(0,n.d4)(d.qX),b=l===F.Tm?p:g,[E,h]=(0,o.useState)(b);(0,o.useEffect)((()=>{h(b.type===F.bV.CAROUSEL||b.type===F.bV.IMG?t.settings:b)}),[b,t.settings]);return(0,Ce.A)((e=>{const t=e.data.operation,l=e.data.action;if(t===F.Ru.APPLICATION_ACTION){function o(e,t=null){const l={[e]:t||!E[e]};s(l,E.type),i((0,m.G_)(l)),h((e=>({...e,...l})))}"toggle_strong"===l&&o("textStrong"),"toggle_italic"===l&&o("textItalic"),"toggle_underline"===l&&o("textUnderline"),"toggle_strikethrough"===l&&o("textStrikethrough"),"textAlign_left"===l&&o("textAlign","left"),"textAlign_right"===l&&o("textAlign","right"),"textAlign_center"===l&&o("textAlign","center")}})),o.createElement(a.A,{nodeRef:c,in:u===F.yI,timeout:300,classNames:"transition"},o.createElement("div",{ref:c,className:r()("selected-element-panel-content",{[e]:e})},(b.type===F.bV.IMG||b.type===F.bV.COUNTDOWN||b.type===F.bV.VIDEO)&&o.createElement(Ue,{elementSettings:b}),b.type===F.bV.TEXT&&o.createElement(st,{elementSettings:b}),b.type===F.bV.LINK&&o.createElement(xt,{elementSettings:b}),b.type===F.bV.TABLE&&o.createElement(Bt,{elementSettings:b}),(b.type===F.bV.TD||b.type===F.bV.STRUCTURE||b.type===F.bV.GROUP||b.type===F.bV.COLUMN)&&o.createElement(Vt,{elementSettings:b}),b.type===F.bV.VAR&&o.createElement(tl,{elementSettings:b}),b.type===F.bV.BUTTON&&o.createElement(Jt,{elementSettings:b}),b.type===F.bV.DIV&&o.createElement(Wt,{elementSettings:b}),b.type===F.bV.VINDENT&&o.createElement(wt,{elementSettings:b}),b.type===F.bV.FLOAT_BLOCK&&o.createElement(Yt,{elementSettings:b}),t.type===F.bV.CAROUSEL&&o.createElement(nl,{elementSettings:t}),t.type===F.bV.ACCORDION&&o.createElement(sl,{elementSettings:t})))};cl.defaultProps={className:null};const ul=cl},52995:(e,t,l)=>{l.d(t,{A:()=>N});var o=l(98173),a=l(2604),i=l(30150),r=l(40120),n=l(27499),m=l(48753),d=l(37969),s=l(8218),c=l(49823),u=l(67034),p=l(64909),g=l(94780),b=l(12543),E=l(8807),h=l(23424),f=l(47014),v=l(65716),A=l(40835),_=l(40277),y=l(32947),S=l(86095),B=l(90614),k=l(15626),x=l(27941);const{useToken:w}=r.A,R=({isModalVisible:e,email:t})=>{const{__:l}=(0,b.s9)(),[r]=n.A.useForm(),R=(0,a.wA)(),{emailId:N}=(0,i.g)(),T=(0,a.d4)(f.C1),[I,P]=(0,A.lg)(),{token:C}=w(),L=(0,p.hN)(),O=(0,a.Pj)(),[F,D]=(0,o.useState)(!1),M=t.project,[V,z]=(0,v.OD)(),{data:H}=v.Nq.endpoints.getProject.select(+M)(O.getState()),{testEmails:G}=(0,x.rD)(),[W,j]=(0,o.useState)([]),[U,X]=(0,o.useState)(!1),q=(0,B.ml)(k.AZ.ON_SEND_EMAIL_MODAL_ID);(0,o.useEffect)((()=>{y.EW.isPlugin&&e?q.fire(t).then((t=>{t.some((e=>!1===e))?R((0,h.Oo)()):D(e)})):D(e)}),[e,R,D,t,q]),(0,o.useEffect)((()=>{if(H&&!y.EW.isPlugin){const{owner:e,admins:t,users:l,invited_users:o}=H.members;let a=[];const i=localStorage.getItem(y.V0.em_test_emails)?JSON.parse(localStorage.getItem(y.V0.em_test_emails)):[];if(i.length&&i[M]&&i[M].map((({prevLSEmail:e})=>a.push(e))),o&&o.map((({invited_user_email:e})=>a.push(e))),l&&l.map((({user_email:e})=>a.push(e))),e&&a.push(e.user_email),t&&t.map((({user_email:e})=>a.push(e))),H.projects_test_emails){const e=H.projects_test_emails.map((({projects_test_email:e})=>e));a.push(...e)}const r=Array.from(new Set(a));a.length&&j(r.map((e=>({value:e}))))}}),[H,M]),(0,o.useEffect)((()=>{y.EW.isPlugin&&j(G.map((e=>({value:e}))))}),[G]),(0,o.useEffect)((()=>{var e;const t=localStorage.getItem(y.V0.em_test_emails);if(t&&F&&0===(null===(e=r.getFieldValue("recipients"))||void 0===e?void 0:e.length)){const e=JSON.parse(t);null!==e&&void 0!==e&&e[M]&&r.setFieldsValue({recipients:e[M]})}}),[M,F,r]),(0,o.useEffect)((()=>{r.setFieldsValue({subject:t.subject})}),[r,t.subject]);const $=(0,S.fn)();return(0,o.useEffect)((()=>{if(P.isSuccess&&U){var e;if(200!==(null===(e=P.data)||void 0===e?void 0:e.status)){var o,a;(0,_.p6)({error:{data:{code:null===(o=P.data)||void 0===o?void 0:o.code,message:null===(a=P.data)||void 0===a?void 0:a.message}}},L)}else{const e=[...new Set([...W.map((e=>e.value)),...r.getFieldValue("recipients")])];V({projectId:M,projects_test_emails:e.map((e=>({projects_test_email:e})))});const o=localStorage.getItem(y.V0.em_test_emails)?JSON.parse(localStorage.getItem(y.V0.em_test_emails)):[];let a=r.getFieldValue("recipients");localStorage.setItem(y.V0.em_test_emails,JSON.stringify({...o,[M]:[...new Set(a)]})),(0,_.wB)(l("The email \u201c")+t.title+l("\u201d was successfully sent."),L)}X(!1),r.resetFields(),R((0,h.Oo)())}}),[P,r,M,V,W,U,R,t.title,z,l,L]),(0,o.useEffect)((()=>{z.isError&&((0,_.p6)(z,L),X(!1),r.resetFields(),R((0,h.Oo)()))}),[R,z,r,L]),(0,o.useEffect)((()=>{r.setFieldsValue({subject:t.subject||t.title})}),[t,r]),o.createElement(m.A,{width:572,title:o.createElement("div",null,o.createElement(E.A,{icon:"SendOutlined"})," ",l("Send a test email")),className:"blocks-modal",open:F,onCancel:()=>{R((0,h.Oo)()),r.resetFields()},centered:!0,footer:[o.createElement(d.Ay,{key:"submit",size:"large",className:"em-analytics__email-send-test",type:"primary",htmlType:"submit",form:"Send mail",loading:z.isLoading,icon:o.createElement(E.A,{icon:"SendOutlined",className:"email-preview-menu__list-item-icon"}),onClick:()=>{r.validateFields().then((()=>{const e={user_id:T.id,project_id:M,email_id:N,subject:r.getFieldValue("subject"),email:r.getFieldValue("recipients").join(","),html:(t=(null===$||void 0===$?void 0:$.getValue())||"",t.replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[/]/g,"\\/").replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))};var t;I(e),X(!0)})).catch((e=>{}))},disabled:P.isLoading},l("Send"))],forceRender:!0},o.createElement(n.A,{form:r,layout:"vertical",name:"send_mail_form",initialValues:{subject:t.subject||t.title,recipients:[]},autoComplete:"off",style:{padding:"10px 24px 0"}},o.createElement(n.A.Item,{label:l("Subject"),name:"subject",rules:[{required:!1,message:l("Please type subject")}]},o.createElement(s.A,{size:"large",placeholder:l("Type subject")})),o.createElement(n.A.Item,{label:l("Recipients"),name:"recipients",tooltip:{title:l("The test email will be sent to the specified addresses."),icon:o.createElement(g.A,null)},rules:[{required:!0,validator:(e,t)=>t.length>10?Promise.reject(new Error(l("A test email can be sent to a maximum of 10 addresses."))):0!==t.length?t.every((e=>_.au.test(e.toLowerCase())))?Promise.resolve():Promise.reject(new Error(l("Please type correct emails"))):Promise.reject(new Error(l("Please type emails")))}]},o.createElement(c.A,{size:"large",mode:"tags",placeholder:l("Add up to 10 recipients"),tooltip:{title:"Tooltip with customize icon",icon:o.createElement(g.A,null)},options:W,tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(u.A,{color:C.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.getElementById("send_mail_form")}))))};R.defaultProps={isModalVisible:!1,email:null};const N=R},72915:(e,t,l)=>{l.d(t,{A:()=>z});var o=l(98173),a=l(40120),i=l(27499),r=l(8218),n=l(49823),m=l(67034),d=l(94674),s=l(13785),c=l(49856),u=l(29123),p=l(94780),g=l(2604),b=l(30150),E=l(12543),h=l(26298),f=l.n(h),v=l(77306),A=l(68984),_=l(98845),y=l(65716),S=l(83027),B=l(12741),k=l(39206),x=l(1047),w=l(27941),R=l(40277),N=l(32947);const{useToken:T}=a.A,{title:I,description:P,tags:C,type:L,is_template:O,group:F}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},D={[I]:"",[P]:"",[C]:[],[O]:!1},M={[P]:"",[C]:[],[L]:""};const V=({className:e,element:t})=>{var l,a;const{__:h}=(0,E.s9)(),{projectId:O}=(0,b.g)(),V=(0,g.wA)(),[z]=i.A.useForm(),{token:H}=T(),G=(0,w.rD)(),W=(0,g.Pj)(),j=(0,g.d4)(x.UI),{data:U}=(0,A.h1)(),{data:X}=(0,b.KC)(),q=t.hasOwnProperty("type")?N.IE:N.Tm,$=t.hasOwnProperty("type")?N.YY:N.zh,{refetch:Y,isLoading:K,isFetching:Q,isUninitialized:Z,isSuccess:J}=(0,S.Oo)({parent:null===(l=X.group)||void 0===l?void 0:l[0]},{skip:!(null!==(a=X.group)&&void 0!==a&&a[0])});(0,o.useEffect)((()=>{!Z&&Y()}),[Z,Y]);const[ee,te]=(0,o.useState)([]),[le,oe]=(0,o.useState)([]),[ae,ie]=(0,o.useState)(t.is_template||!1),{data:re}=y.Nq.endpoints.getProject.select(+O)(W.getState());(0,o.useEffect)((()=>{!Z&&Y()}),[t.group,Y,Z]),(0,o.useEffect)((()=>{if(J&&t.is_template&&t.group.length){const e=t.group;let l={};e.length&&j.length&&(null===e||void 0===e||e.forEach((e=>{null===j||void 0===j||j.forEach((t=>{let o=t.children.find((t=>t.id===e));o&&(l.hasOwnProperty(t.id)||(l[t.id]=[]),l[t.id].push({label:o.name,value:o.id}))}))})));let o={};for(let t in l)l.hasOwnProperty(+t)&&(o[`group_${t}`]=l[t].map((e=>({...e,value:String(e.value)}))));z.setFieldsValue(o)}}),[z,j,t.is_template,t.group,J]),(0,o.useEffect)((()=>{var e;oe(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,R.HT)(re,$)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,$]),(0,o.useEffect)((()=>{if(t){var e,l;const o=null===(e=(0,R._q)(t,$))||void 0===e?void 0:e.map((e=>e.name)),a=t.emailtags||t.blocktags,i=null===(l=(0,R._q)(t,$))||void 0===l?void 0:l.filter((e=>a.includes(e.id))).map((e=>e.name));z.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||o,type:t.type})}}),[z,t,$]);(0,o.useEffect)((()=>{if(U){const e=U.schema.properties.acf.properties.type.items.enum;let t=[];const l={Applications:h("Apps"),Articles:h("Article"),Banners:h("Banners"),Buttons:h("Buttons"),"Call to Action":h("Call to Action"),Contacts:h("Contacts"),Content:h("Content"),"E-Commerce":h("E-Commerce"),Feature:h("Features"),Footer:h("Footers"),Header:h("Headers"),Lists:h("Lists"),Menu:h("Menus"),Other:h("Others"),Polls:h("Polls"),Promocodes:h("Promocodes"),Separators:h("Separators")};for(let o in e)t.push({label:l[e[o]],value:e[o]});te(t)}}),[U,h]);return o.createElement("div",{className:f()("settings-panel",{[e]:e})},o.createElement(i.A,{form:z,layout:"vertical",name:"settings_panel_form",initialValues:q===N.Tm?{EmailInitialValues:D}:M,onValuesChange:e=>{const l=Object.keys(e)[0];switch(l.split("_")[0]){case I:t.isNew?V((0,B.BQ)(e[l])):V((0,x.VK)(e[l]));break;case F:V((0,x.Bu)({[l.split("_")[1]]:e[l]}));break;case P:q===N.Tm?t.isNew?V((0,B.Zs)(e[l])):V(_.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[l]})}))):t.isNew?V((0,k.AS)(e[l])):V(A.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[l]})})));break;case"is":t.isNew?V((0,B.TC)(e[l])):V(_.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[l]})})));break;case C:{const o=e[l].map((e=>e.trim()));q===N.Tm?t.isNew?V((0,B.yY)(o)):V(_.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:o})}))):t.isNew?V((0,k.TB)(o)):V(A.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:o})})));break}case L:V(A.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[l]})})));break;default:return}},autoComplete:"off"},G.subjectEnabled&&q===N.Tm&&o.createElement(i.A.Item,{label:h("Title"),name:I,tooltip:{title:h("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:o.createElement(p.A,null)}},o.createElement(r.A.TextArea,{placeholder:h("Type title here"),autoSize:{minRows:1}})),G.descriptionEnabled&&o.createElement(i.A.Item,{label:h("Description"),name:P,tooltip:{title:h("Description is used in other sections of the service."),icon:o.createElement(p.A,null)}},o.createElement(r.A.TextArea,{placeholder:h("Type your description here"),autoSize:{minRows:2}})),G.tagsEnabled&&o.createElement(i.A.Item,{label:h("Tags"),name:C,tooltip:{title:h("Tags help you find the block in the list."),icon:o.createElement(p.A,null)},rules:[{message:"Please input your username!",type:"array"}]},o.createElement(n.A,{mode:"tags",style:{width:"100%"},placeholder:h("Type your tags here"),options:le,tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(m.A,{color:H.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})),q===N.Tm&&G.isTemplateEnabled&&o.createElement(o.Fragment,null,o.createElement(d.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),o.createElement(s.A,{title:t.isNew?h("Save email first."):h("Use this email as a template for creating future emails."),key:"isTemplate"},o.createElement(c.A,{size:10,align:"baseline"},o.createElement(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:ae},o.createElement(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ie(e)},disabled:t.isNew})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:H.colorText}},o.createElement("label",{htmlFor:"setIsTemplate"},h("Is a template")))))),ae&&o.createElement(v.A,{element:t,refetchProjectGroups:Y,isLoading:K||Q}),q===N.IE&&o.createElement(i.A.Item,{name:L,label:h("Type"),tooltip:{title:h("Select the block type to find any block on the list faster."),icon:o.createElement(p.A,null)},rules:[{message:"Please input type!"}]},o.createElement(n.A,{placeholder:h("Choose block type"),options:ee,getPopupContainer:()=>document.querySelector(".email-settings__collapse")}))))};V.defaultProps={className:"",email:void 0};const z=V},45185:(e,t,l)=>{l.d(t,{A:()=>A});var o=l(98173),a=l(201),i=l(66964),r=l(10750),n=l.n(r),m=l(97946),d=l.n(m),s=l(50664),c=l.n(s),u=l(36529),p=l.n(u),g=l(22548),b=l.n(g),E=l(20065),h=l.n(E),f=l(40277);l(39941);const v=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:p()},{sizeArray:[8,8,8],name:"column-three",html:b()},{sizeArray:[6,6,6,6],name:"column-four",html:h()},{sizeArray:[8,16],name:"column-two-33",html:d()},{sizeArray:[16,8],name:"column-two-66",html:c()}],A=()=>{const e=(0,f.sh)(),t=(0,f._9)();return o.createElement("div",{className:"structures blocks-search__empty-wrapper"},o.createElement("div",{className:"structures__list"},o.createElement("div",null,v&&v.map(((l,r)=>o.createElement("div",{key:l.name},o.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,l.html),onDragStart:e=>t(e,l.html)},o.createElement(a.A,{gutter:[6,6],className:"structures__item-row"},l.sizeArray.map(((e,t)=>o.createElement(i.A,{span:e,key:l.name+t},o.createElement("div",{className:"structures__item-col"}))))))))))))}},58099:(e,t,l)=>{l.d(t,{A:()=>A});var o=l(98173),a=l(201),i=l(66964),r=l(7549),n=l.n(r),m=l(29539),d=l.n(m),s=l(6573),c=l.n(s),u=l(75424),p=l.n(u),g=l(43643),b=l.n(g),E=l(96786),h=l.n(E),f=l(40277);l(39941);const v=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:p()},{sizeArray:[8,8,8],name:"column-three",html:b()},{sizeArray:[6,6,6,6],name:"column-four",html:h()},{sizeArray:[8,16],name:"column-two-33",html:d()},{sizeArray:[16,8],name:"column-two-66",html:c()}],A=()=>{const e=(0,f.sh)(),t=(0,f._9)();return o.createElement("div",{className:"structures blocks-search__empty-wrapper"},o.createElement("div",{className:"structures__list"},o.createElement("div",null,v&&v.map(((l,r)=>o.createElement("div",{key:l.name},o.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,l.html),onDragStart:e=>t(e,l.html)},o.createElement(a.A,{gutter:[6,6],className:"structures__item-row"},l.sizeArray.map(((e,t)=>o.createElement(i.A,{span:e,key:l.name+t},o.createElement("div",{className:"structures__item-col"}))))))))))))}},45271:(e,t,l)=>{l.d(t,{A:()=>u});var o=l(98173),a=l(2407),i=l.n(a),r=l(12543),n=l(64909),m=l(98845),d=l(68984),s=l(40277);const c=({element:e})=>{const{__:t,_x:l}=(0,r.s9)(),[a]=(0,m.dN)(),[i]=(0,d.OZ)(),c=(0,n.hN)(),u=(e,o)=>{if(e.error)return(0,s.p6)(e,c),!1;(0,s.wB)(t("The ")+(o.hasOwnProperty("type")?t("block"):l("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(o.lock?o.hasOwnProperty("type")?l("unlocked.","block"):l("unlocked.","email"):o.hasOwnProperty("type")?l("locked.","block"):l("locked.","email")),c)};return o.createElement("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?i({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):a({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))}},e.lock?t("Unlock"):t("Lock"))};c.defaultProps={element:i().shape({lock:null,id:null})};const u=c},41882:(e,t,l)=>{l.d(t,{A:()=>A});var o=l(98173),a=l(47555),i=l(63719),r=l(49856),n=l(13785),m=l(37969),d=l(30150),s=l(50078),c=l(12543),u=l(47091),p=l(79890),g=l(47113),b=l(40277),E=l(32947),h=l(96734);const{Content:f}=a.A,{Paragraph:v}=i.A,A=()=>{const{__:e}=(0,c.s9)(),{projectId:t,emailId:l}=(0,d.g)(),i=(0,h.p)();let A=(0,d.Zp)();const _=i.get(E.A9.em_template_email)||l;(0,o.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const y=o.createElement(o.Fragment,null,o.createElement(r.A,{size:10},o.createElement(n.A,{title:e("To emails"),placement:"left"},o.createElement(m.Ay,{type:"text",icon:o.createElement(s.A,null),onClick:()=>(0,b.XZ)(A,`/projects/${t}`),shape:"circle"})),o.createElement(v,{className:"ant-page-header-heading-title"},e("Select email template")),o.createElement(p.A,{isBlocks:!1,templateEmailId:_}))),S=o.createElement(o.Fragment,null);return o.createElement(a.A,{className:"template-page"},o.createElement(g.A,{leftBlock:y,rightBlock:S}),o.createElement(f,{className:"template-page__container"},o.createElement("div",{className:"template-page__content container"},o.createElement(u.A,{projectId:E.p5,emailsView:E.Y$,templateEmailId:_}))))}},37037:(e,t,l)=>{l.d(t,{A:()=>_});var o=l(98173),a=l(27499),i=l(38976),r=l(8218),n=l(94780),m=l(2604),d=l(26298),s=l.n(d),c=l(12543),u=l(98845),p=l(12741);const{utm_source:g,utm_medium:b,utm_campaign:E,utm_term:h,utm_content:f}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},v={[g]:"",[b]:"",[E]:"",[h]:"",[f]:""},A=({className:e,email:t})=>{const{__:l}=(0,c.s9)(),d=(0,m.wA)(),[A]=a.A.useForm();(0,o.useEffect)((()=>{var e,l,o,a,i;t&&A.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_medium)||"",utm_campaign:(null===(o=t.utm_parameters)||void 0===o?void 0:o.utm_campaign)||"",utm_term:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[A,t]);return o.createElement("div",{className:s()("settings-panel",{[e]:e})},o.createElement(a.A,{form:A,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const l=Object.keys(e)[0];switch(l){case g:t.isNew?d((0,p.K3)(e[l])):d(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[l]}})})));break;case b:t.isNew?d((0,p.ol)(e[l])):d(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[l]}})})));break;case E:t.isNew?d((0,p.P3)(e[l])):d(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[l]}})})));break;case h:t.isNew?d((0,p.zH)(e[l])):d(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[l]}})})));break;case f:t.isNew?d((0,p.mk)(e[l])):d(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[l]}})})));break;default:return}},autoComplete:"off"},o.createElement(i.A,{message:l("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),o.createElement(a.A.Item,{label:l("utm_source"),name:g,tooltip:{title:l("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("google")})),o.createElement(a.A.Item,{label:l("utm_medium"),name:b,tooltip:{title:l("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("cpc")})),o.createElement(a.A.Item,{label:l("utm_campaign"),name:E,tooltip:{title:l("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("spring_sale")})),o.createElement(a.A.Item,{label:l("utm_term"),name:h,tooltip:{title:l("Identifies search terms. For example: utm_term=running+shoes"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("running+shoes")})),o.createElement(a.A.Item,{label:l("utm_content"),name:f,tooltip:{title:l("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:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("textlink")}))))};A.defaultProps={className:"",email:void 0};const _=A},86774:(e,t,l)=>{l.d(t,{A:()=>B});var o=l(98173),a=l(63719),i=l(37969),r=l(38927),n=l(8218),m=l(13785),d=l(2604),s=l(26298),c=l.n(s),u=l(12543),p=l(80772),g=l(8807),b=l(48956),E=l(23424),h=l(871),f=l(47014),v=l(84572),A=l(27941),_=l(32947),y=l(6969);const{Text:S}=a.A,B=({onChange:e,value:t,validateStatus:l,placeholder:a,disabled:s,name:B,elementSettings:k,imageInfo:x})=>{var w,R;const N=(0,d.d4)(f.C1),T=(0,d.d4)(f.B$),I=(0,d.d4)(v.yN),P=(0,A.rD)(),{__:C}=(0,u.s9)(),[L,O]=(0,o.useState)({width:"",height:"",size:""}),[F,D]=(0,o.useState)(!1),[M,V]=(0,o.useState)(0);let z=(0,d.wA)();const H=(0,d.d4)(p.js),G=(0,d.d4)(p.Uf),W=(0,d.d4)(p.Ac),j=(0,d.d4)(E.cL),[U]=(0,h.FQ)();let X=!T&&(null===(w=N.id)||void 0===w?void 0:w.toString())===(null===I||void 0===I||null===(R=I.members)||void 0===R?void 0:R.owner.ID)&&!0;(0,o.useEffect)((()=>{t&&U(t).then((({data:e})=>{e&&O({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,U]),(0,o.useEffect)((()=>{s||(B.startsWith("src")&&H&&((null===k||void 0===k?void 0:k.type)!==_.bV.CAROUSEL||G===B&&!j)?(e(H),z((0,p.BK)())):"backgroundImage"===B&&W&&((null===k||void 0===k?void 0:k.type)!==_.bV.CAROUSEL||G===B&&!j)&&(e(W),z((0,p.BK)())),j&&(null===k||void 0===k?void 0:k.type)===_.bV.CAROUSEL||!G||z((0,p.BK)()))}),[H,G,W,e,B,s,null===k||void 0===k?void 0:k.type,z,j]);const q=(e=null)=>{B.startsWith("src")?(z((0,p.Yw)(B)),z((0,p.tm)(t)),z((0,E.qf)(e||_.lx.UPLOAD_IMAGE_MODAL))):B.startsWith("backgroundImage")&&(z((0,p.Yw)(B)),z((0,p.e_)(t)),z((0,E.qf)(e||_.lx.UPLOAD_BACKGROUND_MODAL)))},$=[{label:C("Upload"),key:"Upload",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];P.imageCenterStockEnabled&&$.push({label:C("Stock"),key:"Stock",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_STOCK:_.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),P.imageCenterGifEnabled&&$.push({label:C("GIF"),key:"GIF",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_GIF:_.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),P.elementAIimageEnabled&&$.push({label:C("AI"),key:"AI",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_AI:_.lx.UPLOAD_BACKGROUND_MODAL_AI)});return o.createElement("div",{className:c()("upload-bg-image",{"upload-bg-image_disabled":s})},!t||t&&"error"===l?o.createElement(i.Ay,{type:"default",block:!0,onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},o.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),C("Add image")):o.createElement("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,l,o,a;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(l=e.target)&&void 0!==l&&l.closest(".upload-bg-image__edit-menu")||null!==(o=e.target)&&void 0!==o&&o.closest(".upload-bg-image__menu")||null!==(a=e.target)&&void 0!==a&&a.closest(".inputGroup")||q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}},o.createElement(r.A,{arrow:!0,dropdownRender:()=>P.imagePathDropdownEnabled?o.createElement("div",{className:"inputGroup"},o.createElement(n.A,{prefix:o.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:a,name:B,disabled:s,className:"upload-bg-image__input"})):o.createElement(o.Fragment,null),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")},o.createElement("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"}},o.createElement("div",{className:"upload-bg-image__uploader"},o.createElement("div",{className:"upload-bg-image__uploader-content"},o.createElement("div",{className:"upload-bg-image__uploader-content-inner"},o.createElement("div",{className:"upload-bg-image__uploader-img-wrap"},o.createElement("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})),o.createElement("div",{className:"upload-bg-image__uploader-icons-wrap"},o.createElement("div",{className:"upload-bg-image__uploader-content"}))))),L.width&&L.height?o.createElement("div",{className:"image-size"},L.width," \xd7 ",L.height,!!k&&(k.type===_.bV.IMG||k.type===_.bV.CAROUSEL)&&" \u2192 "+x.renderedWidth+" \xd7 "+x.renderedHeight,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,L.size," ",C("kB")),L.format&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:"image-size-format"},L.format))):o.createElement(S,{type:"secondary",className:"image-empty-text"},a))),o.createElement("div",{style:{flexGrow:1}}),"gif"!==L.format&&P.imageCenterEditorEnabled&&o.createElement(m.A,{title:C("Edit")},o.createElement(S,{type:"link",className:"upload-bg-image__edit"},o.createElement(y.A,{style:{fontSize:16},onClick:e=>{X?(D(!0),V(5)):(q(),z((0,E.Wz)(_.lx.IMAGE_EDITOR_MODAL)))}}))),o.createElement(r.A,{key:"Actions",arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:$},overlayClassName:"upload-bg-image__menu"},o.createElement(S,{type:"link",className:"upload-bg-image__edit-menu image-change"},!t||t&&"error"===l?C("Upload"):o.createElement(g.A,{style:{fontSize:20},icon:"Reload",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})))),o.createElement(b.A,{open:F,onCancel:()=>{D(!1)},initialSlide:M}))}},33932:(e,t,l)=>{l.d(t,{EQ:()=>m,YG:()=>s,Zs:()=>n,gb:()=>d});var o=l(14721),a=l(39539),i=l(58521);const r="Ai",n=(0,o.xP)({reducerPath:"AiApi",tagTypes:[r],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn:({body:e},t)=>(0,i.KU)(t).saveFile.ai_create(e,{type:a.cM.FormData})}),getDialog:e.query({queryFn:({entity_id:e,connection:t="chat"},l)=>(0,i.KU)(l).saveFile.ai_status_list({connection:t,entity_id:e}),providesTags:e=>null!==e&&void 0!==e&&e.documents?[...e.documents.map((({id:e})=>({type:r,id:e}))),{type:r,id:"LIST"}]:[{type:r,id:"LIST"}]})})}),{useSendMessageMutation:m,useGetDialogQuery:d,useLazyGetDialogQuery:s}=n},70875:(e,t,l)=>{l.d(t,{Ll:()=>g,MN:()=>E,Uu:()=>c,y4:()=>b});var o=l(14721),a=l(58521),i=l(32947),r=l(97404),n=l(79596),m=l(18987),d=l(12352),s=l(3792);const c=(0,o.xP)({reducerPath:"AiApiGenerator",baseQuery:r.i,endpoints:e=>({generateIdForTask:e.mutation({queryFn:(e,t)=>(0,a.u$)(t).tasks.tasksControllerCreateTask(e).then((e=>e))}),clearAiChat:e.query({queryFn:(e,t)=>(0,a.KU)(t).aiGenerator.clear_history_list(e).then((e=>e))}),getGeneratedContent:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({id:e,setError:t},l){const{updateCachedData:o,cacheEntryRemoved:r}=l;let c=(0,a.KU)(l).baseUrl.indexOf("emailmaker")>=0?i.e3.maker:i.e3.blocks;const u=i.EW.isPlugin?await s.di.getInstance(l,d.Y):m.A.get(i.A9.em_token),p=u?{Authorization:`Bearer ${u}`}:{},g=new n.EventSourcePolyfill(`${c}/tasks/${e}`,{headers:p});g.onmessage=e=>{const t=JSON.parse(e.data);o((e=>{e.push(t)}))},g.onerror=e=>{t("Error connecting to EventSource"),g.close()},await r,g.close()}}),getAiGenerateStatus:e.mutation({query:e=>({url:"/constructor/v1/ai-save-task",method:"POST",body:e})})})}),{useGenerateIdForTaskMutation:u,useGetGeneratedContentQuery:p,useLazyClearAiChatQuery:g,useLazyGetGeneratedContentQuery:b,useGetAiGenerateStatusMutation:E}=c},7026:(e,t,l)=>{l.d(t,{V:()=>m});var o=l(18987),a=l(3792),i=l(12352),r=l(32947),n=l(24527);async function m(e,t,l,m){const d={blocks:m,types:n.G,locale:t};l.current=d;try{const e=await async function(){return r.EW.isPlugin?await a.di.getInstance(null,i.Y):o.A.get(r.A9.em_token)||null}(),t=await fetch(n.M,{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}},body:JSON.stringify(d)});if(!t.ok||200!==t.status)throw new Error(`${t.statusText}`);return await t.json()}catch(s){throw s}}},8111:(e,t,l)=>{l.d(t,{Jg:()=>s,z2:()=>u,HI:()=>p,vn:()=>b,kk:()=>g,Cf:()=>c});var o=l(14721),a=l(39539),i=l(93778),r=l(31926);function n({id:e,post:t,parent:l,author:o,content:a,acf:{status:i,target_id:n},...m}){return{...m,id:(0,r.WY)(e),post:(0,r.WY)(t),parent:(0,r.WY)(l),author:(0,r.WY)(o),content:(0,r.vf)(a),target_id:n,comment_status:i}}var m=l(58521);const d="Comments",s=(0,o.xP)({reducerPath:"commentsApi",tagTypes:[d],baseQuery:(0,m.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(e,t){return(0,m.KU)(t).wp.comments_list({post:[(0,r.mQ)(e)],per_page:50,order:"asc"}).then((0,i.Ih)(n))},providesTags:e=>e?[...e.map((({id:e})=>({type:d,id:e}))),{type:d,id:"LIST"}]:[{type:d,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:e,author:t,parent:l,content:o,author_name:d,author_email:s,targetId:c},u){const p=(0,m.KU)(u),g={post:(0,r.mQ)(e),author:(0,r.mQ)(t),author_name:d,author_email:s},b={};return o&&(g.content=o),l&&(g.parent=(0,r.mQ)(l)),c&&(b["acf[target_id]"]=c),p.wp.comments_create(g,{type:a.cM.UrlEncoded,extraQuery:b}).then((0,i.SC)(n))},invalidatesTags:[{type:d,id:"LIST"}]}),deleteComment:e.mutation({queryFn:(e,t)=>(0,m.KU)(t).wp.comments_delete(e,{}).then((0,i.PI)(n)),invalidatesTags:[{type:d,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:e,content:t,status:l,targetId:o},r){const d=(0,m.KU)(r),s={},c={};return t&&(s.content=t),l&&(c["acf[status]"]=l),o&&(c["acf[targetId]"]=o),d.wp.comments_update(e,s,{type:a.cM.UrlEncoded,extraQuery:c}).then((0,i.SC)(n))},invalidatesTags:[{type:d,id:"LIST"}]}),deleteTarget:e.mutation({queryFn:(e,t)=>(0,m.KU)(t).wp.comments_delete(e,{},{extraQuery:{"acf[target_id]":""}}).then((0,i.PI)(n)),invalidatesTags:[{type:d,id:"LIST"}]})})}),{useGetCommentsQuery:c,useAddCommentMutation:u,useDeleteCommentMutation:p,useEditCommentMutation:g,useDeleteTargetMutation:b}=s},94160:(e,t,l)=>{l.d(t,{C:()=>r,F:()=>i});var o=l(14721),a=l(27943);const i=(0,o.xP)({reducerPath:"confirmationMailApi",baseQuery:(0,a.cw)({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:e,email:t})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${e}&user_email=${t}`)}`})})})}),{useLazyGetConfirmationMailQuery:r}=i},98845:(e,t,l)=>{l.d(t,{GY:()=>u,Kh:()=>v,Gr:()=>S,LX:()=>B,dN:()=>A,YV:()=>h,sl:()=>b,Xw:()=>p,PX:()=>g,YE:()=>f,_3:()=>E});var o=l(14721),a=l(39539),i=l(93207),r=l(31926);function n({id:e,title:t,acf:{html:l,common_styles:o},parent:a,excerpt:i,author:n,...m}){return{...m,author:(0,r.WY)(n),id:(0,r.WY)(e),parent:(0,r.WY)(a),title:(0,r.vf)(t)||"",html:l,common_styles:o,excerpt:(0,r.pT)(i)?i.rendered:i}}var m=l(58521),d=l(93778),s=l(50861),c=l(32947);const u=(0,o.xP)({reducerPath:"emailsApi",tagTypes:["Emails","Email","EmailAutosaves","TemplateEmail"],baseQuery:(0,m.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({queryFn(e,t){var l,o;const a=(0,m.KU)(t),r={order:"desc",orderby:"modified"},n={};if(e.notEmbed||(n._embed=""),e.projectId&&(n._embed="author",n._fields="id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template",r["filter[meta_key]"]="project",r["filter[meta_value]"]=e.projectId),e.fields&&(n._fields=e.fields),e.page&&(r.page=e.page),e.order&&(r.order=e.order),e.orderby&&(r.orderby=e.orderby),e.folderTag&&e.folderTag!==c.y2?(r["filter[tax_query][relation]"]="AND",r["filter[tax_query][0][taxonomy]"]="folder",r["filter[tax_query][0][field]"]="id",r["filter[tax_query][0][terms]"]=e.folderTag,r["filter[tax_query][0][include_children]"]="0"):e.folderTag===c.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(l=e.tags)&&void 0!==l&&l.length||!e.status||"trash"===e.status||(r["filter[tax_query][0][taxonomy]"]="folder",r["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(o=e.tags)||void 0===o?void 0:o.length)>0&&"trash"!==e.status){r["filter[tax_query][relation]"]="AND";for(let t=0,l=e.tags.length;t<l;t++){const l=e.tags[t];r[`filter[tax_query][${t+1}][taxonomy]`]="emailtags",r[`filter[tax_query][${t+1}][field]`]="id",r[`filter[tax_query][${t+1}][terms]`]=l}}return e.name&&(r.search=e.name),e.pageSize&&(r.per_page=e.pageSize),"trash"===e.status&&(n.status="trash"),a.wp.email_list(r,{extraQuery:n}).then((0,d.Ih)(i.V))},providesTags:(e,t,l,{response:o})=>{var a,i;const r=(null===o||void 0===o?void 0:o.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Emails",id:`${l.folderTag||(null===(t=l.tags)||void 0===t?void 0:t[0])||l.projectId}_${l.page}_${l.status}_${r}`}})),{type:"Emails",id:`${l.folderTag||(null===(a=l.tags)||void 0===a?void 0:a[0])||l.projectId}_${l.page}_${l.status}_${r}`}]:[{type:"Emails",id:`${l.folderTag||(null===(i=l.tags)||void 0===i?void 0:i[0])||l.projectId}_${l.page}_${l.status}_${r}`}]},keepUnusedDataFor:0}),getTemplateEmails:e.query({queryFn(e,t){var l,o,a;const r=(0,m.KU)(t);let n={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"};const s={_embed:"wp:term",_fields:"_embedded,id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"};if(e.emailId&&(n["filter[meta_query][0][key]"]="parent_email",n["filter[meta_query][0][value]"]=e.emailId),e.fields&&(s._fields=e.fields),(null===(l=e.group)||void 0===l?void 0:l.length)>0||(null===(o=e.projectGroup)||void 0===o?void 0:o.length)>0){const t=[...e.group||[],...e.projectGroup||[]].reduce(((e,{key:t,parentId:l})=>(e[l]||(e[l]=[]),e[l].push(String(t)),e)),{}),l=Object.values(t).map((e=>e.sort()));n["filter[tax_query][relation]"]="AND",l.forEach(((e,t)=>{n[`filter[tax_query][${t}][relation]`]="OR",e.forEach(((e,l)=>{n[`filter[tax_query][${t}][${l}][taxonomy]`]="group",n[`filter[tax_query][${t}][${l}][field]`]="id",n[`filter[tax_query][${t}][${l}][terms]`]=e}))}))}if((null===(a=e.tags)||void 0===a?void 0:a.length)>0){n["filter[tax_query][relation]"]="AND";for(let t=0,l=e.tags.length;t<l;t++){const l=e.tags[t];n[`filter[tax_query][${t}][taxonomy]`]="emailtags",n[`filter[tax_query][${t}][field]`]="id",n[`filter[tax_query][${t}][terms]`]=l}}if(e.type&&(n["filter[meta_query][2][key]"]="type",n["filter[meta_query][2][value]"]=e.type),e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),e.page){var u,p;n.page=e.page;const l=t.getState(),{groupsTemplateProjectTotal:o,groupsTemplateProjectTotalPages:a}=null===l||void 0===l?void 0:l.projectSlice;if((null===(u=e.projectGroup)||void 0===u||!u.length)&&(null===(p=e.group)||void 0===p||!p.length)&&a<e.page&&e.groupType===c.ti.ALL&&o&&a&&!e.projectId){const t=c.mU-o%c.mU+(e.page-(a+1))*c.mU;t&&(n.page=1,n.offset=t)}}return e.projectId&&(n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),r.wp.email_list(n,{extraQuery:s}).then((0,d.Ih)(i.V))},keepUnusedDataFor:0}),getEmail:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.email_detail({id:(0,r.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,d.SC)(i.V)),providesTags:(e,t,l)=>[{type:"Email",id:l}],keepUnusedDataFor:0}),getTemplateEmail:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.email_detail({id:(0,r.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,d.SC)(i.V)),providesTags:(e,t,l)=>[{type:"TemplateEmail",id:l}],keepUnusedDataFor:0}),getEmailHistory:e.query({queryFn:({emailId:e,page:t=1},l)=>(0,m.KU)(l).wp.email_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id,parent,date_gmt"}}).then((l=>(0,d.SA)(l,((l,o)=>({data:l.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(n),totalPages:+o.response.headers.get("X-WP-TotalPages"),args:{emailId:e,page:t}}))))),providesTags:e=>e?[...e.data.map((({id:e})=>({type:"EmailAutosaves",id:e}))),{type:"EmailAutosaves",id:"LIST"}]:[{type:"EmailAutosaves",id:"LIST"}],keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:(0,s.p)((e=>({source:t,...l})=>(0,m.KU)(e).wp.email_create({status:"publish",...(0,i.v)(l)},{type:a.cM.Json}).then((0,d.SC)(i.V)))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:(0,s.p)((e=>({emailId:t,source:l,...o})=>{const n=(0,m.KU)(e),s=(0,r.TB)((0,i.v)(o));return n.wp.email_partial_update(t,s,{type:a.cM.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then((0,d.SC)(i.V))}))}),deleteEmail:e.mutation({queryFn(e,t){const l=(0,m.KU)(t);let o,a;return"object"===typeof e?(o=e.id,a=e.force):(o=e,a=!1),l.wp.email_delete(o,{force:a}).then((0,d.PI)(i.V))},invalidatesTags:(e,t,l)=>[{type:"Emails",id:l}]}),addTag:e.mutation({queryFn:(e,t)=>(0,m.KU)(t).wp.emailtags_create({...e},{type:a.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],l)=>(0,m.KU)(l).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,emailtags:[t]},{extraQuery:{"_fields[]":"emailtags"}}).then((0,d.Ih)(i.V))}),autoSaveEmail:e.mutation({queryFn({emailId:e,body:t},l){const o=(0,m.KU)(l),i=function({parent:e,title:t,html:l,project:o,subject:a,preheader:i,common_styles:n,author:m,parent_email:d,...s}){return{...s,author:(0,r.mQ)(m),title:t,parent:(0,r.mQ)(e),"acf[html]":l,"acf[project]":o,"acf[parent_email]":d,"acf[common_styles]":n}}(t);return o.wp.email_autosaves_create(e,i,{type:a.cM.FormData}).then((0,d.SC)(n))}})})}),{useGetEmailsQuery:p,useGetTemplateEmailsQuery:g,useGetEmailQuery:b,useLazyGetEmailQuery:E,useGetEmailHistoryQuery:h,useLazyGetEmailHistoryQuery:f,useAddEmailMutation:v,useEditEmailMutation:A,useDeleteEmailMutation:_,useGetDeletableTagQuery:y,useAddTagMutation:S,useAutoSaveEmailMutation:B}=u},38251:(e,t,l)=>{l.d(t,{U8:()=>r,cA:()=>m,ri:()=>n});var o=l(27943),a=l(14721),i=l(40277);const r=(0,a.xP)({reducerPath:"exportPngApi",baseQuery:async(e,t,l)=>{try{const{notification:a,...i}=e,r=await(0,o.cw)({baseUrl:"https://racs.rest/v3"})(i,t,l);if(r.error)throw new Error;return r}catch(a){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(a,t),{error:a}}},endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:e,title:t,notification:l})=>{const o=new Blob([e],{type:"text/html"}),a=new FormData;return a.append("file",o,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:l}}}),deleteTemporaryMail:e.mutation({query:({id:e,notification:t})=>({url:`/${e}?resource=exportPngApi`,method:"DELETE",notification:t})})})}),{useMakeTemporaryMailForPngMutation:n,useDeleteTemporaryMailMutation:m}=r},30397:(e,t,l)=>{l.d(t,{C:()=>i,N:()=>r});var o=l(14721),a=l(27943);const i=(0,o.xP)({reducerPath:"webHookApi",baseQuery:(0,a.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:e,body:t})=>({url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t})})})}),{usePostDataByWebHookMutation:r}=i},64706:(e,t,l)=>{l.d(t,{N:()=>r,m:()=>n});var o=l(27943),a=l(14721),i=l(40277);const r=(0,a.xP)({reducerPath:"htmlToPdfPlusApi",baseQuery:async(e,t,l)=>{try{const{notification:a,...i}=e,r=await(0,o.cw)({baseUrl:"https://html2pdf.emcdn.ru/convert/html-to-pdf"})(i,t,l);if(r.error)throw new Error;return r}catch(a){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(a,t),{error:a}}},endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:e,notification:t})=>({url:"",method:"POST",body:e,notification:t,responseHandler:e=>e.blob()})})})}),{useGenerateHtmlToPdfMutation:n}=r},871:(e,t,l)=>{l.d(t,{CL:()=>c,FQ:()=>u,Jg:()=>_,Mv:()=>h,eo:()=>S,gg:()=>k,h4:()=>b});var o=l(14721),a=l(79596),i=l(39539),r=l(58521),n=l(18987),m=l(32947),d=l(12352),s=l(3792);const c=(0,o.xP)({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(e,t){try{var l,o;const a=(null===(l=t.getState().configSlice)||void 0===l||null===(o=l.config)||void 0===o?void 0:o.imageInfoToolUrl)||"https://scr.emcdn.ru/imageinfo",i=await fetch(`${a}?url=${encodeURIComponent(e)}`);return{data:await i.json()}}catch(a){}}}),getSearchImage:e.query({queryFn:async function({query:e,page:t}){const l=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let o=`https://api.unsplash.com/search/photos?client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o&lang=ru&per_page=18&query=${l}&page=${t}`;""!==e.color&&(o+=`&color=${e.color}`),""!==e.orientation&&(o+=`&orientation=${e.orientation}`);const a=await fetch(o);return{data:await a.json()}}catch(o){}}}),getUnsplashImage:e.query({queryFn:async function(e){try{const t=await fetch(`${e}&client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o`);return{data:await t.json()}}catch(t){}}}),sendAiImageRequest:e.query({queryFn:async function({body:e},t){try{const l=(0,r.KU)(t);return await l.saveFile.ai_create(e,{type:i.cM.FormData})}catch(l){throw new Error(l)}}}),getAiImage:e.query({queryFn:async function(e,t){try{const l=(0,r.KU)(t);return await l.saveFile.ai_status_list(e)}catch(l){}}}),getAiImageSSE:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({task_id:e,entity_id:t,setError:l},o){const{updateCachedData:i,cacheEntryRemoved:c}=o;let u=(0,r.KU)(o).baseUrl.indexOf("emailmaker")>=0?m.Rn.maker:m.Rn.blocks;const p=m.EW.isPlugin?await s.di.getInstance(o,d.Y):n.A.get(m.A9.em_token),g=p?{Authorization:`Bearer ${p}`}:{},b=new a.EventSourcePolyfill(` ${u}/wp-json/ai-generator/v1/ai-status?entity_id=${t}&stream=1&task_id=${e}`,{headers:g});b.onmessage=e=>{const t=JSON.parse(e.data);i((e=>{e.push(t)})),100===t.progress&&b.close()},b.onerror=e=>{b.close()},await c,b.close()}}),getSearchGif:e.query({queryFn:async function({query:e,page:t}){const l=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let e=`https://api.giphy.com/v1/gifs/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${l}&limit=25&offset=${t}&lang=en`;const o=await fetch(e);return{data:await o.json()}}catch(o){}}})})}),{useLazyGetImageInfoQuery:u,useGetImageInfoQuery:p,useGetSearchImageQuery:g,useLazyGetSearchImageQuery:b,useSendAiImageRequestQuery:E,useLazySendAiImageRequestQuery:h,useGetAiImageQuery:f,useLazyGetAiImageQuery:v,useGetUnsplashImageQuery:A,useLazyGetUnsplashImageQuery:_,useGetSearchGifQuery:y,useLazyGetSearchGifQuery:S,useGetAiImageSSEQuery:B,useLazyGetAiImageSSEQuery:k}=c},12005:(e,t,l)=>{l.d(t,{Ad:()=>n,HO:()=>c,Yj:()=>s});var o=l(14721),a=l(27943),i=l(58521);const r="LOCALES",n=(0,o.xP)({reducerPath:"localesApi",tagTypes:[r],baseQuery:(0,a.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/translations/v1"}),endpoints:e=>({getLocale:e.query({async queryFn({id:e},t){const l=(0,i.KU)(t);try{return await l.translations.get_translations3(e,"react_app")}catch(o){return l.translations.get_translations3("en_US","react_app")}},providesTags:(e,t,l)=>[{type:r,id:l}]}),getLocales:e.query({queryFn:function(e,t){return(0,i.KU)(t).translations.get_translations2("react_app")},providesTags:(e,t,l)=>[{type:r,id:"react_app"}]})})}),{useGetLocalesQuery:m,useGetLocaleQuery:d,useLazyGetLocaleQuery:s,useLazyGetLocalesQuery:c}=n},15422:(e,t,l)=>{l.d(t,{F:()=>r,Y:()=>i});var o=l(31926),a=l(39218);function i({id:e,type:t,title:l,excerpt:i,author:r,acf:{subject:n,description:m,html:d,project:s,related_email:c,tags:u,type:p,is_template:g,lock:b},...E}){return{...E,id:String(e),author:String(r),renderGuid:(0,a.l)(),description:m,html:d,excerpt:(0,o.vf)(l),project:(0,o.pT)(s)?s.ID:s,project_author:(0,o.pT)(s)?s.post_author:void 0,project_title:(0,o.pT)(s)?s.post_title:void 0,tags:u,is_template:g,type:p,related_email:(0,o.WY)((0,o.pT)(c)?c.ID:c),title:(0,o.vf)(l)||"",lock:b}}function r({title:e,subject:t,description:l,renderGuid:a,html:i,project:r,tags:n,type:m,related_email:d,is_template:s,lock:c,author:u,...p}){return{...p,author:(0,o.mQ)(u),title:e,acf:{description:l,related_email:(0,o.mQ)(d),html:i,project:r,tags:n,type:m,is_template:s,lock:c}}}},98664:(e,t,l)=>{l.d(t,{n:()=>a});var o=l(31926);function a({parent:e,title:t,html:l,project:a,author:i,...r}){return{...r,author:(0,o.mQ)(i),parent:(0,o.mQ)(e),title:(0,o.vf)(t),"acf[html]":l,"acf[project]":a}}},17487:(e,t,l)=>{l.d(t,{H:()=>a});var o=l(31926);function a({id:e,title:t,acf:{html:l},excerpt:a,parent:i,author:r,...n}){return{...n,id:(0,o.WY)(e),author:(0,o.WY)(r),parent:(0,o.WY)(i),title:(0,o.vf)(t)||"",html:l,excerpt:(0,o.pT)(a)?a.rendered:a}}},93207:(e,t,l)=>{l.d(t,{V:()=>i,v:()=>r});var o=l(31926),a=l(39218);function i({id:e,title:t,type:l,guid:i,acf:{lock:r,subject:n,description:m,html:d,project:s,tags:c,utm_parameters:u,parent_email:p,common_styles:g,is_template:b},author:E,...h}){return{...h,id:(0,o.WY)(e),author:(0,o.WY)(E),title:(0,o.vf)(t)||"",lock:r,renderGuid:(0,a.l)(),description:m,html:d,project:(0,o.pT)(s)?s.ID:s,project_author:(0,o.pT)(s)?s.post_author:void 0,project_title:(0,o.pT)(s)?s.post_title:void 0,tags:c,utm_parameters:u,parent_email:(0,o.WY)(p instanceof Array&&p[0]?p[0].ID:p),common_styles:g,is_template:b}}function r({title:e,lock:t,subject:l,description:a,html:i,project:r,tags:n,renderGuid:m,utm_parameters:d,parent_email:s,common_styles:c,is_template:u,author:p,...g}){return{...g,author:(0,o.mQ)(p),title:e,acf:{lock:t,description:a,html:i,project:r,tags:n,utm_parameters:d,parent_email:(0,o.mQ)(s),common_styles:c,is_template:u}}}},16618:(e,t,l)=>{l.d(t,{b:()=>i,d:()=>a});var o=l(31926);function a({title:e,acf:{members:t,projects_test_emails:l,ftp_settings:a,emails:i,blocks:r,webhook:n},...m}){return{...m,title:(0,o.vf)(e)||"",members:(0,o.pT)(t)?{admins:t.admins&&t.admins.map((e=>({...e,ID:(0,o.WY)(e.ID)}))),users:t.users&&t.users.map((e=>({...e,ID:(0,o.WY)(e.ID)}))),invited_users:t.invited_users&&t.invited_users.map((e=>({...e,ID:(0,o.WY)(e.ID)}))),owner:(0,o.pT)(t.owner)?{...t.owner,ID:(0,o.WY)(t.owner.ID)}:t.owner}:void 0,projects_test_emails:l,ftp_settings:a,webhook:n,emails:i,blocks:r}}function i({title:e,members:t,projects_test_emails:l,ftp_settings:a,webhook:i,emails:r,blocks:n,...m}){const d=e=>({ID:(0,o.mQ)(e.ID||e)}),s=e=>{return(t=e,Array.isArray(t)?t:t?[t]:[]).map(d);var t};return{...m,title:e,acf:{members:t&&{admins:s(t.admins),users:s(t.users),invited_users:s(t.invited_users),owner:t.owner&&d(t.owner)},webhook:i,projects_test_emails:l,ftp_settings:a,emails:r,blocks:n}}}},68936:(e,t,l)=>{l.d(t,{i:()=>a});var o=l(31926);function a({title:e,acf:{limits:t,price:l},...a}){return{...a,title:(0,o.vf)(e)||"",limits:t,price:l}}},71676:(e,t,l)=>{l.d(t,{F:()=>a,L:()=>i});var o=l(31926);function a({acf:{autosaves:e,hide_mergetags:t,theme:l,newsletter_consent:a,code_editor:i,counters:r,subscription:n,subscription_end:m,recurring_payments:d,subscription_id:s,promocode:c,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:b,privacy_policy_agreement:E,last_used_project:h,email_confirmation:f,email_builder_config:v},id:A,..._}){return{..._,id:(0,o.WY)(A),autosaves:e,hide_mergetags:t,theme:l,newsletter_consent:a,code_editor:i?{...i,font_size:Number(i.font_size)}:void 0,counters:Object.keys(r).reduce(((e,t)=>(e[t]=Number(r[t]),e)),{}),subscription:n,subscription_end:m,recurring_payments:d,subscription_id:s,promocode:c,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:b,privacy_policy_agreement:E,last_used_project:h,email_confirmation:f,email_builder_config:v}}function i({autosaves:e,theme:t,newsletter_consent:l,code_editor:a,counters:i,subscription:r,subscription_end:n,recurring_payments:m,subscription_id:d,promocode:s,subscription_amount:c,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:b,locale:E,last_used_project:h,email_confirmation:f,email_builder_config:v,id:A,..._}){return{..._,id:(0,o.mQ)(A),locale:E,acf:{autosaves:e,theme:t,newsletter_consent:l,code_editor:a?{...a,font_size:String(a.font_size)}:void 0,counters:i,subscription:r,subscription_end:n,recurring_payments:m,subscription_id:d,promocode:s,subscription_amount:c,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:b,last_used_project:h,email_confirmation:f,email_builder_config:v}}}},31926:(e,t,l)=>{function o(e,t=!1){const l={};for(const a of Object.keys(e)){let i=e[a];void 0===i||"number"===typeof i&&Number.isNaN(i)||(t&&"object"===typeof i&&null!==i&&(i=o(i)),l[a]=i)}return l}function a(e){return"object"===typeof e&&e}function i(e){const t=Number(e);return isNaN(t)?e:t}function r(e){return"number"===typeof e?String(e):e}function n(e){return"object"===typeof e?e.rendered:e}l.d(t,{TB:()=>o,WY:()=>r,mQ:()=>i,pT:()=>a,vf:()=>n})},705:(e,t,l)=>{l.d(t,{vx:()=>s,I9:()=>c,bw:()=>u});var o=l(14721),a=l(39539),i=l(93778),r=l(31926);function n({title:e,content:t,acf:{seen:l,type:o,event:a,data:i},...n}){return{...n,seen:l,type:o,event:a,data:i,title:(0,r.vf)(e),content:t}}var m=l(58521);const d="Notifications",s=(0,o.xP)({reducerPath:"notificationsApi",tagTypes:[d],baseQuery:(0,m.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.notification_list({author:[Number(e)]}).then((0,i.Ih)(n)),providesTags:e=>e?[...e.map((({id:e})=>({type:d,id:e}))),{type:d,id:"LIST"}]:[{type:d,id:"LIST"}]}),notificationShown:e.mutation({queryFn:({id:e,datetime:t},l)=>(0,m.KU)(l).wp.notification_create2(e,{},{type:a.cM.Json,extraQuery:{"acf[seen]":t}}).then((0,i.SC)(n)),invalidatesTags:[{type:d,id:"LIST"}]})})}),{useGetNotificationsQuery:c,useNotificationShownMutation:u}=s},2952:(e,t,l)=>{l.d(t,{Ju:()=>m,Sr:()=>d,ku:()=>n,tO:()=>r});var o=l(14721),a=l(58521);const i="Optimise",r=(0,o.xP)({reducerPath:"optimiseApi",tagTypes:[i],baseQuery:async(e,t,l)=>{const o=(0,a.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),i=(0,a.hI)({baseUrl:`${o}/optimization/v1/validate`});let r=await i(e,t,l);if(r.error){let e=r.error;if("function"===typeof e.json)try{e=await e.json()}catch{e=await e}return{error:e}}return r},endpoints:e=>({editLinks:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:e}),invalidatesTags:[i]}),editImages:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:e})}),editSpam:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:e})})})}),{useEditLinksMutation:n,useEditImagesMutation:m,useEditSpamMutation:d}=r},59089:(e,t,l)=>{l.d(t,{So:()=>i});var o=l(14721),a=l(58521);const i=(0,o.xP)({reducerPath:"promoApi",baseQuery:(0,a.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:e,type:t},l)=>(0,a.KU)(l).promo.set_code_create({code:e,type:t})}),getPromoInfo:e.query({queryFn:({code:e},t)=>(0,a.KU)(t).promo.get_code_info_list({code:e})})})}),{useCheckPromoMutation:r,useGetPromoInfoQuery:n}=i},92960:(e,t,l)=>{l.d(t,{Z8:()=>i,mI:()=>n});var o=l(14721),a=l(58521);const i=(0,o.xP)({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:(0,a.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:e,tryFetch:t=!0,type:l},o){const i=(0,a.KU)(o),r=t?fetch(e):Promise.reject(),n=e=>(e=>{switch(l){case"json":return e.json();case"text":return e.text();default:return e.blob()}})(e).then((e=>({data:e})));return r.then((e=>n(e))).catch((()=>i.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(e)}})))}})})}),{useGetFileQuery:r,useLazyGetFileQuery:n}=i},40835:(e,t,l)=>{l.d(t,{Zf:()=>d,dS:()=>n,lg:()=>m,tb:()=>s,yH:()=>r});var o=l(14721),a=l(39539),i=l(58521);const r=(0,o.xP)({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.upload_create(e,{type:a.cM.FormData})}),sendTestEmail:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.send_email_create(e,{type:a.cM.FormData})}),sendLivePreview:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.get_link_create(e,{type:a.cM.FormData})}),sendShortLink:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.shortener_create(e,{type:a.cM.FormData})})})}),{useUploadImageMutation:n,useSendTestEmailMutation:m,useSendLivePreviewMutation:d,useSendShortLinkMutation:s}=r},53774:(e,t,l)=>{l.d(t,{$:()=>a});const o={pro:{config:{mode:"pro",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,mergeTagsShow:!0,styles:"",revisionService:!1,headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,commonStylesEnabled:!0,emailResponsiveControlEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportTextEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!0,formFieldBorderRadiusEnabled:!0,formFieldBoxShadowEnabled:!0,formFieldVisibilityEnabled:!0,formFieldExportAsPictureEnabled:!0,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formButtonFieldReplacerEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!0,formImageFieldReplacerEnabled:!0,formImageFieldHeightEnabled:!0,formTextFieldTypografEnabled:!0,formTextFieldReplacerEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}},editor:{config:{mode:"editor",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,mergeTagsShow:!1,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!1,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!1,webversionEnabled:!1,commonStylesEnabled:!1,emailResponsiveControlEnabled:!1,emailDropdownMenuEnabled:!1,emailDropdownMenuClone:!0,emailDropdownMenuImport:!1,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportTextEnabled:!1,exportZipEnabled:!0,exportClipboardEnabled:!1,exportWebHookEnabled:!1,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!1,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!1,aiAssistentEnabled:!1,optimizeEnabled:!1,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!1,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!1,tagsEnabled:!0,isTemplateEnabled:!1,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!1,deleteButtonEnabled:!0,toggleSidePanel:!1,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!1,formFieldImageTitleEnabled:!1,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!1,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!1,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!1,formButtonFieldReplacerEnabled:!1,formCellFieldVerticalAlignEnabled:!1,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!1,formImageFieldReplacerEnabled:!1,formImageFieldHeightEnabled:!1,formTextFieldTypografEnabled:!1,formTextFieldReplacerEnabled:!1,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},simple:{config:{mode:"simple",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,mergeTagsShow:!1,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!1,commonStylesEnabled:!1,emailResponsiveControlEnabled:!1,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportTextEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!1,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!1,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formButtonFieldReplacerEnabled:!1,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!1,formImageFieldReplacerEnabled:!1,formImageFieldHeightEnabled:!1,formTextFieldTypografEnabled:!1,formTextFieldReplacerEnabled:!1,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!1,elementVideoEnabled:!1,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},blocks:{config:{mode:"freeUserBlocks",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,mergeTagsShow:!0,styles:"",revisionService:!1,headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,commonStylesEnabled:!0,emailResponsiveControlEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportTextEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!0,formFieldBorderRadiusEnabled:!0,formFieldBoxShadowEnabled:!0,formFieldVisibilityEnabled:!0,formFieldExportAsPictureEnabled:!0,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!0,formButtonFieldReplacerEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!0,formImageFieldReplacerEnabled:!0,formImageFieldHeightEnabled:!0,formTextFieldTypografEnabled:!0,formTextFieldReplacerEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}}},a=e=>{const t=o[e];return t||o.editor}},38540:(e,t,l)=>{l.d(t,{Ay:()=>s,M:()=>d,YT:()=>m,rI:()=>n});var o=l(1029);const a=(0,l(93778).ur)({isCollapsed:!0,isMonacoFocusing:!1}),i="defaultModePanesSlice",r=(0,o.createSlice)({name:i,initialState:a,reducers:{setMonacoFocusing:(e,t)=>{e.isMonacoFocusing=t.payload},resetPanes:()=>a}}),{resetPanes:n,setMonacoFocusing:m}=r.actions,d=e=>e[i].isMonacoFocusing,s=r},1047:(e,t,l)=>{l.d(t,{A9:()=>p,AJ:()=>v,Ay:()=>W,Bj:()=>k,Bu:()=>w,CT:()=>O,G_:()=>u,HO:()=>h,Hs:()=>F,M7:()=>g,RC:()=>N,S_:()=>R,UI:()=>z,Up:()=>I,VK:()=>_,VO:()=>B,VZ:()=>M,Wm:()=>S,dH:()=>H,eX:()=>c,iy:()=>L,mD:()=>G,no:()=>y,om:()=>b,pl:()=>f,ps:()=>x,qX:()=>C,rY:()=>V,rd:()=>D,ry:()=>E,ss:()=>A,uJ:()=>P,zn:()=>T});var o=l(1029),a=l(93778),i=l(98845),r=l(83027),n=l(65716);const m=(0,a.ur)({invalidateEmailId:null,editorThemeColor:"light",isSettingsDisabled:!1,settings:{backgroundColor:"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",textStrong:!1,textItalic:!1,textUnderline:!1},elementSettings:{},searchFilters:{},emailCommonStyles:"",saveTime:null,mobileViewActive:{shutdown:!0,styles:!0},email:{id:void 0,is_inited:!1,isNew:!1,subject:void 0,preheader:void 0,description:"",html:"",project:void 0,project_author:"",project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:null,emailtags:[],group:[],isAmp:!1},emailIsEdit:!1,isCodeMode:!1,codeModeDirection:void 0,emailViewType:void 0,changeKey:null,problemsList:[],activeProblemRange:null,emailGroups:{},parentGroupOfProject:null,projectGroups:[],isNeedUpdateAppearance:!1,isNeedUpdateContentAppearance:!1}),d="emailSlice",s=(0,o.createSlice)({name:d,initialState:m,reducers:{setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setEmailFromHistory:(e,{payload:t})=>{const l=e.email,o=void 0===(null===t||void 0===t?void 0:t.preheader),a=void 0===(null===t||void 0===t?void 0:t.subject);e.email={...l,html:null===t||void 0===t?void 0:t.html,preheader:o?l.preheader:null===t||void 0===t?void 0:t.preheader,subject:a?l.subject:null===t||void 0===t?void 0:t.subject,common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:l.common_styles||"{}"},e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setEmailSettings:(e,{payload:t})=>{Object.assign(e,{...e,settings:{...t},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,{payload:t})=>{e.elementSettings=t},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},updateSearchFilters:(e,t)=>{const l=e.searchFilters;e.searchFilters={...l,...t.payload}},setEmailHTML:(e,t)=>{e.email.html=t.payload},setEmailSubject:(e,t)=>{e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setEmailPreheader:(e,t)=>{e.email.preheader=t.payload},resetEmailSlice:()=>m,setEmailTitle:(e,t)=>{e.email.title=t.payload},setIsInited:(e,t)=>{e.email.is_inited=t.payload},setEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},setProblemsList:(e,t)=>{e.problemsList=t.payload},setActiveProblemRange:(e,t)=>{e.activeProblemRange=t.payload},setIsNeedUpdateContentAppearance:(e,t)=>{e.isNeedUpdateContentAppearance=t.payload},setIsNeedUpdateAppearance:(e,t)=>{e.isNeedUpdateAppearance=t.payload},setEmailGroups:(e,{payload:t})=>{const l=Object.keys(t)[0],o=e.emailGroups,a=e.parentGroupOfProject,i=e.projectGroups,r={};var n;a&&i.length&&(null===(n=t[l])||void 0===n||n.forEach((e=>{const t=i.find((e=>e.id===+l)),o=null===t||void 0===t?void 0:t.children.find((t=>t.id===+e));o?(r.hasOwnProperty(t.id)||(r[t.id]=[]),r[t.id].push({label:o.name,value:o.id})):(r.hasOwnProperty(l)||(r[l]=[]),r[l].push({label:e,value:null}))})),0===t[l].length&&(r[l]=[]));e.emailGroups={...o,...r}}},extraReducers:e=>{e.addMatcher((e=>"emailsApi/queries/queryResultPatched"===e.type),((e,t)=>{var l,o;const a=t.payload.queryCacheKey.match(/\("([0-9]+)"\)/),i=null===(l=t.payload)||void 0===l?void 0:l.patches[0];null!==i&&void 0!==i&&null!==(o=i.path)&&void 0!==o&&o[0]&&(e.email[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==a&&void 0!==a&&a[1]&&(e.invalidateEmailId=a[1]),e.emailIsEdit=!0})),e.addMatcher((e=>"emailsApi/invalidateTags"===e.type),((e,t)=>{if(t.payload[0].id===+e.invalidateEmailId)return m})),e.addMatcher(i.GY.endpoints.editEmail.matchFulfilled,((e,{payload:t})=>{e.invalidateEmailId=null,e.email={...e.email,...t,renderGuid:e.email.renderGuid}})),e.addMatcher(i.GY.endpoints.autoSaveEmail.matchFulfilled,((e,t)=>{var l,o;(null===(l=e.email.id)||void 0===l?void 0:l.toString())===(null===(o=t.payload.id)||void 0===o?void 0:o.toString())&&(e.email.html=t.payload.html)})),e.addMatcher(i.GY.endpoints.getEmail.matchFulfilled,((e,{payload:t})=>{var l,o;e.email={...m.email,...t,is_inited:t.is_inited||(t.id===(null===(l=e.email)||void 0===l?void 0:l.id)?null===(o=e.email)||void 0===o?void 0:o.is_inited:m.email.is_inited),common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:"{}"},e.emailIsEdit=!1})),e.addMatcher(r.kE.endpoints.getGroups.matchFulfilled,((e,{meta:t,payload:l})=>{const o=e.email.group,a=t.arg.originalArgs.parent,i=l;a&&(e.parentGroupOfProject=a,i.length>0&&(e.projectGroups=i));const r={};a&&o.length&&i.length&&(null===o||void 0===o||o.forEach((e=>{null===i||void 0===i||i.forEach((t=>{const l=t.children.find((t=>t.id===e));l&&(r.hasOwnProperty(t.id)||(r[t.id]=[]),r[t.id].push({label:l.name,value:l.id}))}))}))),e.emailGroups=r})),e.addMatcher(n.Nq.endpoints.getProject.matchFulfilled,((e,{meta:t,payload:l})=>{var o;e.parentGroupOfProject=(null===(o=l.group)||void 0===o?void 0:o[0])||null}))}}),{setEditorThemeColor:c,setEmailSettings:u,setElementSettings:p,setEmailSettingsDisable:g,setSearchFilters:b,updateSearchFilters:E,setEmailSubject:h,setEmailPreheader:f,setEmailHTML:v,resetEmailSlice:A,setEmailTitle:_,setEmailFromHistory:y,setIsInited:S,setEmailIsAmp:B,setProblemsList:k,setActiveProblemRange:x,setEmailGroups:w,setIsNeedUpdateAppearance:R,setIsNeedUpdateContentAppearance:N}=s.actions,T=e=>e[d].invalidateEmailId,I=e=>e[d].editorThemeColor,P=e=>e[d].settings,C=e=>e[d].elementSettings,L=e=>e[d].isSettingsDisabled,O=e=>e[d].searchFilters,F=e=>e[d].email,D=e=>e[d].problemsList,M=e=>e[d].activeProblemRange,V=e=>e[d].emailGroups,z=e=>e[d].projectGroups,H=e=>e[d].isNeedUpdateContentAppearance,G=e=>e[d].isNeedUpdateAppearance,W=s},80772:(e,t,l)=>{l.d(t,{Ac:()=>g,Ay:()=>b,BK:()=>c,Uf:()=>p,Yw:()=>d,e_:()=>s,js:()=>u,tm:()=>m});var o=l(1029),a=l(93778);const i="imageSlice",r=(0,a.ur)({currentImage:"",currentBackground:"",currentImageName:""}),n=(0,o.createSlice)({name:i,initialState:r,reducers:{setCurrentImageName(e,t){e.currentImageName=t.payload},setCurrentImage(e,t){e.currentImage=t.payload},setCurrentBackground(e,t){e.currentBackground=t.payload},clearCurrentImages(e,t){e.currentImage="",e.currentBackground="",e.currentImageName=""}}}),{setCurrentImage:m,setCurrentImageName:d,setCurrentBackground:s,clearCurrentImages:c}=n.actions,u=e=>e[i].currentImage,p=e=>e[i].currentImageName,g=e=>e[i].currentBackground,b=n},12741:(e,t,l)=>{l.d(t,{$S:()=>C,Ay:()=>L,BQ:()=>E,Et:()=>N,K3:()=>B,MZ:()=>b,P3:()=>x,TC:()=>A,TU:()=>h,Uh:()=>T,YG:()=>P,Zs:()=>v,aY:()=>_,lg:()=>I,mk:()=>w,ol:()=>k,x3:()=>f,yY:()=>S,zH:()=>R});var o=l(1029),a=l(98845),i=l(65716),r=l(32947),n=l(31557),m=l.n(n),d=l(93778),s=l(39218),c=l(40277);const u=(0,d.ur)({emailtags:[],email:{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:m(),project:void 0,project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:"",emailtags:[],isAmp:!1},hasChanged:!1}),p="newEmailSlice",g=(0,o.createSlice)({name:p,initialState:u,reducers:{setNewEmailAll:(e,{payload:{id:t,subject:l,description:o="",preheader:a,html:i=m(),utm_parameters:{utm_source:n="",utm_medium:d="",utm_campaign:s="",utm_term:u="",utm_content:p=""}={},common_styles:g="{}",emailtags:b=null,renderGuid:E,title:h,_embedded:f,isAmp:v=!1}})=>{var A;e.hasChanged||(e.hasChanged=!0),e.email.isAmp=v,e.email.title=h,e.emailtags=b,e.email.subject=l,e.email.description=o,e.email.common_styles=g||JSON.stringify(r.BD),e.email.preheader=a,e.email.is_template=!1,e.email.html=i,e.email.tags=(null===(A=(0,c._q)({_embedded:f},r.zh))||void 0===A?void 0:A.map((e=>e.name)))||[],e.email.renderGuid=E,e.email.parent_email=t,e.email.utm_parameters={utm_source:n,utm_medium:d,utm_campaign:s,utm_term:u,utm_content:p}},setNewEmailTitle:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.title=t.payload},setNewEmailSubject:(e,t)=>{e.hasChanged||e.email.subject===t.payload||(e.hasChanged=!0),e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setNewEmailPreheader:(e,t)=>{e.hasChanged||e.email.preheader===t.payload||(e.hasChanged=!0),e.email.preheader=t.payload},setNewEmailDescription:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.description=t.payload},setNewEmailIsTemplate:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.is_template=t.payload},setNewEmailHtml:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.html=t.payload)},setNewCommonStyles:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.common_styles=t.payload)},setNewEmailTags:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.tags=t.payload},setNewEmailUtmSource:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_source=t.payload},setNewEmailUtmMedium:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_medium=t.payload},setNewEmailUtmCampaign:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_campaign=t.payload},setNewEmailUtmTerm:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_term=t.payload},setNewEmailUtmContent:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_content=t.payload},setNewIsInited:(e,t)=>{e.email.is_inited=t.payload},setNewEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},resetNewEmailSlice:e=>({...u,email:{...u.email,guid:(0,s.l)(),project:e.email.project,project_title:e.email.project_title}})},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,t)=>{e.email.project=t.payload.id,e.email.project_title=t.payload.title})),e.addMatcher(a.GY.endpoints.getEmail.matchFulfilled,(e=>({...u,email:{...u.email,project:e.email.project,project_title:e.email.project_title}})))}}),{setNewEmailAll:b,setNewEmailTitle:E,setNewEmailSubject:h,setNewEmailPreheader:f,setNewEmailDescription:v,setNewEmailIsTemplate:A,setNewEmailHtml:_,setNewCommonStyles:y,setNewEmailTags:S,setNewEmailUtmSource:B,setNewEmailUtmMedium:k,setNewEmailUtmCampaign:x,setNewEmailUtmContent:w,setNewEmailUtmTerm:R,resetNewEmailSlice:N,setNewIsInited:T,setNewEmailIsAmp:I}=g.actions,P=e=>e[p].email,C=e=>e[p].hasChanged,L=g},84572:(e,t,l)=>{l.d(t,{AQ:()=>f,Ay:()=>A,BN:()=>u,GD:()=>b,RP:()=>h,Rw:()=>E,es:()=>c,mb:()=>p,od:()=>s,qV:()=>v,yN:()=>g});var o=l(1029),a=l(93778),i=l(65716),r=l(98845);const n=(0,a.ur)({project:null,activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),m="projectSlice",d=(0,o.createSlice)({name:m,initialState:n,reducers:{setProject:(e,{payload:t})=>{e.project=t},setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,{payload:t})=>{e.project={...n.project,...t}})),e.addMatcher(i.Nq.endpoints.editProject.matchFulfilled,((e,{payload:t})=>{e.project={...n.project,...t}})),e.addMatcher(r.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{payload:t,meta:l})=>{const{projectId:o}=l.arg.originalArgs;var a,i,r;o?(e.groupsTemplateProjectTotal=+(null===(a=l.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total")),e.groupsTemplateProjectTotalPages=+(null===(i=l.baseQueryMeta)||void 0===i?void 0:i.response.headers.get("X-WP-TotalPages"))):e.groupsTemplateTotal=+(null===(r=l.baseQueryMeta)||void 0===r?void 0:r.response.headers.get("X-WP-Total"))}))}}),{setProject:s,setActiveGroupsTags:c,setActiveProjectGroupsTags:u,resetAllTags:p}=d.actions,g=e=>e[m].project,b=e=>e[m].activeGroupsTags,E=e=>e[m].activeProjectGroupsTags,h=e=>e[m].groupsTemplateTotal,f=e=>e[m].groupsTemplateProjectTotal,v=e=>e[m].groupsTemplateProjectTotalPages,A=d},61058:(e,t,l)=>{l.d(t,{Ay:()=>p,RL:()=>u,p1:()=>c,qX:()=>d});var o=l(1029),a=l(98845),i=l(68984);const r=(0,l(93778).ur)({historyData:[],elementHistoryTotalPages:1}),n="revisionHistorySlice",m=(0,o.createSlice)({name:n,initialState:r,reducers:{resetElementHistorySlice:()=>({...r}),setElementHistory:(e,t)=>{0!==t.payload.length&&(e.historyData=t.payload)}},extraReducers:e=>{e.addMatcher(a.GY.endpoints.getEmailHistory.matchFulfilled,((e,{meta:t,payload:l})=>{var o;e.elementHistoryTotalPages=+(null===(o=t.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages")),t.arg.originalArgs.page&&1!==t.arg.originalArgs.page||(e.historyData=l.data||[])})),e.addMatcher(i.VM.endpoints.getBlockHistory.matchFulfilled,((e,{meta:t,payload:l})=>{var o;e.elementHistoryTotalPages=+(null===(o=t.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages")),l.args.page&&1!==l.args.page||(e.historyData=l.data||[])}))}}),{resetElementHistorySlice:d}=m.actions,{setElementHistory:s}=m.actions,c=e=>e[n].historyData,u=e=>e[n].elementHistoryTotalPages,p=m},47014:(e,t,l)=>{l.d(t,{Ay:()=>_,B:()=>E,B$:()=>A,C1:()=>h,hZ:()=>v,ko:()=>p,ku:()=>c,ww:()=>d,yf:()=>f});var o=l(1029),a=l(78915),i=l(32947),r=l(40277);const n=(0,l(93778).ur)({currentUser:{},currentSchema:{},monacoOptions:i.rW,monacoDidMount:!1}),m="userSlice",d=(0,o.createAsyncThunk)("user/setMonacoOptions",(async(e,{getState:t})=>{const l=t()[m],o="string"===typeof e.font_family?`${e.font_family}, sans-serif`:void 0,a=void 0!==e.word_wrap?e.word_wrap?"on":"off":void 0;return o&&l.monacoOptions.fontFamily!==o&&await(0,r.iV)(e.font_family),{tabSize:e.tab_size,fontFamily:o,fontSize:e.font_size,wordWrap:a,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}})),s=(0,o.createSlice)({name:m,initialState:n,reducers:{setMonacoDidMount:(e,{payload:t})=>{e.monacoDidMount=t},setTheme:(e,{payload:t})=>{e.currentUser.theme=t},setUserLocale:(e,{payload:t})=>{e.currentUser.locale=t},setUserAutosaves:(e,{payload:t})=>{e.currentUser.autosaves=t},setUser:(e,{payload:t})=>{e.currentUser={...e.currentUser,...t}}},extraReducers:e=>{e.addCase(d.fulfilled,((e,t)=>{const l=t.payload;e.monacoOptions=(0,r.i0)({...e.monacoOptions},l)})),e.addMatcher(a.Q2.endpoints.editMe.matchFulfilled,((e,t)=>{e.currentUser=t.payload})),e.addMatcher(a.Q2.endpoints.getMe.matchFulfilled,((e,t)=>{e.currentUser=t.payload})),e.addMatcher(a.Q2.endpoints.getSchema.matchFulfilled,((e,t)=>{e.currentSchema=t.payload.schema}))}}),{setMonacoDidMount:c,setTheme:u,setUserLocale:p,setUserAutosaves:g,setUser:b}=s.actions,E=e=>{var t;return null===(t=e[m].currentUser)||void 0===t?void 0:t.locale},h=e=>e[m].currentUser,f=e=>e[m].currentSchema,v=e=>e[m].monacoOptions,A=e=>{var t;return 3891!==(null===(t=e[m].currentUser.subscription)||void 0===t?void 0:t.ID)},_=s}}]);
|