@emailmaker/emailmaker 1.0.54 → 1.0.56

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.
Files changed (33) hide show
  1. package/README.md +1 -1
  2. package/asset-manifest.json +22 -22
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.d.ts +120 -99
  5. package/emailmaker.js +1 -1
  6. package/iframe/{iframe-eblock.b0f6ba78787fbb881698.html → iframe-eblock.afc9f1ce83dc7d6275f4.html} +1 -1
  7. package/iframe/{iframe.b0f6ba78787fbb881698.html → iframe.afc9f1ce83dc7d6275f4.html} +1 -1
  8. package/iframe/js/cssbeautify.js +1 -1
  9. package/iframe/sandbox-eblock.js +1 -1
  10. package/iframe/sandbox.js +1 -1
  11. package/package.json +1 -1
  12. package/plugin.html +271 -265
  13. package/plugin_blocks_test.html +1 -1
  14. package/plugin_default.html +1 -1
  15. package/plugin_idigital.html +1 -1
  16. package/plugin_s.html +1 -1
  17. package/static/css/{3062.52a0a40e.css → 2055.377300a1.css} +1 -1
  18. package/static/css/{5211.8f70ec84.css → 5211.45142985.css} +1 -1
  19. package/static/css/{8995.3b37ba81.css → 8995.d8d44365.css} +1 -1
  20. package/static/js/2055.5d000245.js +1 -0
  21. package/static/js/{2151.516911d8.js → 2151.fe35f394.js} +1 -1
  22. package/static/js/3430.b951243d.js +1 -0
  23. package/static/js/5211.638a9803.js +1 -0
  24. package/static/js/{1821.41877832.js → 7269.6683b194.js} +1 -1
  25. package/static/js/78.a4deb390.js +1 -0
  26. package/static/js/{8995.d8b7e9e5.js → 8995.6244768a.js} +1 -1
  27. package/static/js/{emailmaker_core.f53b7c8e.js → emailmaker_core.b6a49f02.js} +1 -1
  28. package/translations.pot +211 -188
  29. package/webpack/index.js +1 -2
  30. package/static/js/3062.6ce869e9.js +0 -1
  31. package/static/js/3430.81e9a5aa.js +0 -1
  32. package/static/js/5211.2afa2b82.js +0 -1
  33. package/static/js/78.dca8224c.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3430],{28316:(e,t,i)=>{i.d(t,{Kp:()=>s,Sb:()=>o,_1:()=>n});const s="SAVE",n="SHOW",o="NOTIFY"},85163:(e,t,i)=>{i.d(t,{A9:()=>l,BD:()=>pe,Bv:()=>B,CJ:()=>p,EW:()=>r,F3:()=>A,F5:()=>n,G$:()=>z,IE:()=>q,IJ:()=>g,JE:()=>$,Jy:()=>G,KI:()=>se,N7:()=>F,ND:()=>le,QV:()=>me,Qz:()=>Q,Rn:()=>Ee,Ru:()=>D,St:()=>K,T:()=>m,Tm:()=>J,UW:()=>_,Ug:()=>ue,V0:()=>d,VG:()=>v,Vp:()=>ce,Vv:()=>N,WU:()=>P,Y$:()=>ee,YY:()=>_e,_P:()=>c,aO:()=>Y,bV:()=>I,e3:()=>ge,eA:()=>Z,eG:()=>ie,ff:()=>o,gY:()=>W,hc:()=>U,iU:()=>oe,iV:()=>X,iW:()=>w,jg:()=>he,lx:()=>f,m3:()=>V,mU:()=>ae,mX:()=>C,nA:()=>x,nd:()=>h,oy:()=>a,p5:()=>ne,pe:()=>j,rW:()=>T,rY:()=>k,rb:()=>M,rl:()=>te,ti:()=>S,vd:()=>E,wF:()=>re,xz:()=>L,y2:()=>u,yI:()=>y,yo:()=>H,yy:()=>b,zh:()=>de,zx:()=>R});var s=i(19378);const n="LOADING",o="ERROR",a="useblocks",r={isPlugin:!1},c={isEditor:!1},l={em_token:"em_token",em_elements_view:"em_elements_view",em_new_block:"em_new_block",em_new_email:"em_new_email",em_id:"em_id",em_name:"em_name",em_email:"em_email",em_locale:"em_locale",em_carrotquest_hash:"em_carrotquest_hash",em_ducalis_hash:"em_ducalis_hash",em_email_subscription_consent:"em_email_subscription_consent",em_folder:"em_folder",promocode:"promocode",em_active_tab:"em_active_tab"},d={em_color_scheme:"em_color_scheme",em_code_mode_pane_sizes:"em_code_mode_pane_sizes",em_preview_pane_sizes:"em_preview_pane_sizes",em_default_sizes:"em_default_sizes",em_pane_sizes:"em_pane_sizes",em_test_emails:"em_test_emails",em_menu_is_locked:"em_menu_is_locked",em_code_mode_settings:"em_code_mode_settings",em_folder_is_open:"em_folder_is_open",em_active_tab:"em_active_tab",em_ai_settings:"em_ai_settings"},_="deleted",u="all",p="not all",m="light",h="dark",g="system",E="(prefers-color-scheme: light)",A="(prefers-color-scheme: dark)",v="#1890ff",f={ADD_NEW_PROJECT_MODAL:"ADD_NEW_PROJECT_MODAL",EDIT_PROJECT_MODAL:"EDIT_PROJECT_MODAL",BLOCKS_MODAL:"BLOCKS_MODAL",EDIT_PROFILE_MODAL:"EDIT_PROFILE_MODAL",SEND_TEST_EMAIL:"SEND_TEST_EMAIL",ADD_NEW_EBLOCK_MODAL:"ADD_NEW_EBLOCK_MODAL",ADD_NEW_EMAIL_MODAL:"ADD_NEW_EMAIL_MODAL",ADD_NEW_AI_EMAIL:"ADD_NEW_AI_EMAIL",SWITCH_TO_PLAN_MODAL:"SWITCH_TO_PLAN_MODAL",IMAGE_EDITOR_MODAL:"IMAGE_EDITOR_MODAL",ADD_NEW_FOLDER_MODAL:"ADD_NEW_FOLDER_MODAL",EDIT_FOLDER_NAME_MODAL:"EDIT_FOLDER_NAME_MODAL",ADD_NEW_GROUP_MODAL:"ADD_NEW_GROUP_MODAL",EDIT_GROUP_NAME_MODAL:"EDIT_GROUP_NAME_MODAL",UPLOAD_IMAGE_MODAL:"UPLOAD_IMAGE_MODAL",UPLOAD_BACKGROUND_MODAL:"UPLOAD_BACKGROUND_MODAL",UPLOAD_IMAGE_MODAL_AI:"UPLOAD_IMAGE_MODAL_AI",UPLOAD_BACKGROUND_MODAL_AI:"UPLOAD_BACKGROUND_MODAL_AI",UPLOAD_IMAGE_MODAL_STOCK:"UPLOAD_IMAGE_MODAL_STOCK",UPLOAD_BACKGROUND_MODAL_STOCK:"UPLOAD_BACKGROUND_MODAL_STOCK",UPLOAD_IMAGE_MODAL_GIF:"UPLOAD_IMAGE_MODAL_GIF",UPLOAD_BACKGROUND_MODAL_GIF:"UPLOAD_BACKGROUND_MODAL_GIF",UPLOAD_IMAGE_MODAL_EDIT:"UPLOAD_IMAGE_MODAL_EDIT",UPLOAD_BACKGROUND_MODAL_EDIT:"UPLOAD_BACKGROUND_MODAL_EDIT",UPLOAD_IMAGE_MODAL_UPLOAD:"UPLOAD_IMAGE_MODAL_UPLOAD",UPLOAD_BACKGROUND_MODAL_UPLOAD:"UPLOAD_BACKGROUND_MODAL_UPLOAD"};let O;!function(e){e[e.Amp=0]="Amp",e[e.HTML=1]="HTML",e[e.Everywhere=2]="Everywhere"}(O||(O={}));const D={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_PREVIEW:"update_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_SUBJECT_UPDATE:(0,s.Qm)("application_subject_update"),APPLICATION_PREHEADER_UPDATE:(0,s.Qm)("application_preheader_update"),APPLICATION_DOMPARSER_ERROR:(0,s.Qm)("application_domparser_error"),APPLICATION_UPDATE_ENTITY:(0,s.Qm)("application_update_entity"),APPLICATION_IFRAME_DRAG_EVENT:(0,s.Qm)("application_iframe_drag_event"),APPLICATION_HAS_AMP:(0,s.Qm)("application_has_amp"),SANDBOX_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:(0,s.Qm)("SANDBOX_READY"),SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:(0,s.Qm)("sandbox_subject_update"),SANDBOX_PREHEADER_UPDATE:(0,s.Qm)("sandbox_preheader_update"),SANDBOX_DRAG_EVENT:(0,s.Qm)("sandbox_drag_event"),SANDBOX_ADD_MERGETAG:(0,s.Qm)("sandbox_add_mergetag"),SANDBOX_TRANSLATIONS:(0,s.Qm)("sandbox_send_translations"),SANDBOX_SET_THEME_VARIABLES:(0,s.Qm)("sandbox_send_theme_variables"),SANDBOX_SET_ENTITY:(0,s.Qm)("sandbox_set_entity"),SANDBOX_INIT_START:(0,s.Qm)("sandbox_init_start"),SANDBOX_INITED:(0,s.Qm)("sandbox_inited"),SANDBOX_UPDATE_ENTITY:(0,s.Qm)("sandbox_update_entity"),RELOAD:(0,s.Qm)("reload"),SANDBOX_IS_EMAIL_EMPTY:(0,s.Qm)("sandbox_is_email_empty")},T={language:"html",detectIndentation:!1,wordWrap:"on",wrappingIndent:"same",smoothScrolling:!0,automaticLayout:!0,tabSize:2,indentSize:2};let I;!function(e){e.IMG="img",e.TEXT="text",e.LINK="a",e.TABLE="table",e.VINDENT="vindent",e.TD="td",e.STRUCTURE="structure",e.GROUP="group",e.BUTTON="button",e.DIV="div",e.FLOAT_BLOCK="floatBlock",e.VAR="var",e.EMPTY_TABLE="emptyTable",e.EMPTY_TD="emptyTd",e.COUNTDOWN="countdown",e.VIDEO="video",e.COLUMN="column",e.CAROUSEL="carousel",e.ACCORDION="accordion"}(I||(I={}));const S={ALL:"All",STANDARD:"Standard",PROJECT:"Project"},L="Appearance",C="Structure",b="Settings",y="Properties",N="History",M="Disabled_tab",P="Edit selected element",w="UTM parameters",R="Edit",B="Build",k="Styles",U="Discuss",j="TEXT_AI",x="Blocks",G="Atoms",F="Optimise",X={top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},H="Owner",K="Administrator",V="User",z="The invitation has been sent",W="Assign the project owner",Q="Change role to Administrator",Y="Change role to User",Z="Remove member",$="Revoke the invite",q="block",J="email",ee="cards",te="list",ie="pending",se="d41d8",ne="1865",oe=127017,ae=24,re={borderRadiusAll:"all",borderRadiusTopLeft:"topLeft",borderRadiusBottomLeft:"bottomLeft",borderRadiusTopRight:"topRight",borderRadiusBottomRight:"bottomRight"},ce="desktop",le="mobile",de="emailtags",_e="blocktags",ue="all_folders",pe={text:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",lineHeight:21,lineHeightDim:"px",color:"#5a5a5a",textAlign:"left",paddingBottom:10,paddingBottomDim:"px"},headings:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:24,fontSizeDim:"px",lineHeight:32,lineHeightDim:"px",color:"#333333",textAlign:"left",paddingTop:20,paddingTopDim:"px",paddingBottom:20,paddingBottomDim:"px",letterSpacing:0,letterSpacingDim:"px",bold:!0,italic:!1},links:{color:"#1C52DC",underline:!0},buttons:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",letterSpacing:0,letterSpacingDim:"px",color:"#FFFFFF",bold:!1,italic:!1,backgroundColor:"#1C52DC",marginTop:10,marginTopDim:"px",marginBottom:10,marginBottomDim:"px",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},textAlign:"center",padding:{all:null,top:null,right:null,bottom:null,left:null}},block:{backgroundColor:""},cards:{contrastBackgroundColor:"#1C52DC",contrastTextColor:"#FFFFFF",baseBackgroundColor:"#F8F8F8",baseTextColor:"#333333",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}}},me=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here")}),he={Applications:"Apps",Articles:"Article",Banners:"Banners",Buttons:"Buttons","Call to Action":"Call to Action",Contacts:"Contacts",Content:"Content","E-Commerce":"E-Commerce",Feature:"Features",Footer:"Footers",Header:"Headers",Lists:"Lists",Menu:"Menus",Other:"Others",Polls:"Polls",Promocodes:"Promocodes",Separators:"Separators"},ge={maker:"https://ai-mail.emcdn.ru",blocks:"https://ai-mail.useblocks.io"},Ee={maker:"https://app.emailmaker.ru/api",blocks:"https://app.useblocks.io/api"}},19378:(e,t,i)=>{function s(e){return e}i.d(t,{Qm:()=>s,bg:()=>c});const n="INIT_MESSAGE";function o(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}class a{constructor(){this._children=[],this._isDisposed=!1}isDisposed(){return this._isDisposed}addDisposable(e){return this._children.push(e),e.hasOwnProperty("addDisposable")&&e.addDisposable({dispose:()=>{const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}}),e}removeDisposable(e){const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}dispose(){this._isDisposed=!0;for(const e of this._children)e.dispose()}}class r extends a{constructor(...e){super(...e),this._listeners=Object.create(null),this.addListenerAsync=(e,t,i=0,s)=>{const n=this._listeners[e]||(this._listeners[e]=[]);s&&"function"===typeof t&&(t=t.bind(s));const o=n.findIndex((([e,t])=>i<=t)),a=[t,i];return this.isDisposed()||n.splice(o>=0?o:n.length,0,a),{dispose(){const e=n.indexOf(a);e>=0&&n.splice(e,1)}}},this.fireAsync=(e,t)=>{if(!this.isDisposed()){const i=this._listeners[e]||(this._listeners[e]=[]);let s;for(let e=0;e<i.length;e++){let t=i[e][0],n=s;s=e=>t(e,n)}if(s)return s(t)}},this.addListener=(e,t,i=0)=>this.addListenerAsync(e,((e,i)=>{try{t(e)}catch(s){console.log(s)}return i&&i(e)}),i)}}class c extends a{constructor(e,t){super(),this._singleton=t,this._target=void 0,this._guid=o(),this._targetGuid="",this._emitter=this.addDisposable(new r),this._onReceiveMessage=e=>{const t=e.data;if(i=t,s=this._guid,i&&"object"===typeof i&&i.guid===s||this._singleton&&function(e,t){return e&&"object"===typeof e&&e.operationId===t}(t,n)){const i=this._emitter.fireAsync(t.operationId||"",void 0===t.operationId?e:t.data),s=t.result,n=t.error;s&&n&&Promise.resolve(i).then((e=>this._sendMessage(s,e)),(e=>this._sendMessage(n,e)))}var i,s},window.addEventListener("message",this._onReceiveMessage),this.addListener(n,(e=>{this._targetGuid!==e&&(this._targetGuid=e,this.send(n,this._guid))})),e&&this.setTarget(e)}setTarget(e){this._target!==e&&(this._target=e,this._targetGuid="",e&&e.postMessage({operationId:n,data:this._guid},"*"))}getTarget(){return this._target}get target(){return this._target}_sendMessage(e,t,i=!0){if(!i&&!this.isInited())return;const s=this.addDisposable(this.onInit(((i,n)=>{const o=e?{operationId:e,data:t}:t;i.postMessage({...o,guid:n},"*"),s.dispose()})))}send(e,t,i){return"string"===typeof e?this._sendMessage(e,t,i):this._sendMessage("",e,t)}sendAsync(e,t,i=!0){if(!i&&!this.isInited())return Promise.resolve();const s=o(),n=o();return new Promise(((i,o)=>{const r=this.addDisposable(new a);r.addDisposable(this.onInit(((a,c)=>{a.postMessage({operationId:e,data:t,guid:c,result:s,error:n},"*"),r.addDisposable(this._onMessage(s,(e=>{i(e),r.dispose()}))),r.addDisposable(this._onMessage(n,(e=>{o(e),r.dispose()})))})))}))}_onMessage(e,t,i=0){return this._emitter.addListener(e,t,i)}addListener(e,t,i){return t?this._onMessage(e,t,i):this._onMessage("",e)}addListenerAsyncPipe(e,t,i=0){return this._emitter.addListenerAsync(e,t,i)}addListenerAsync(e,t,i=0){return this._emitter.addListenerAsync(e,(async(e,i)=>{const s=await t(e);return i?i(e):s}),i)}isInited(){return!!this._targetGuid}get inited(){return!!this._targetGuid}onInit(e,t=!0,i=0){const s=this.addDisposable(new a);return this._targetGuid&&this._target?t&&Promise.resolve().then((()=>{this._targetGuid&&this._target?e(this._target,this._targetGuid):s.addDisposable(this.onInit(e,t,i))})):s.addDisposable(this._onMessage(n,(()=>{e(this._target,this._targetGuid)}),i)),s}dispose(){window.removeEventListener("message",this._onReceiveMessage),super.dispose()}}},13329:(e,t,i)=>{i.d(t,{D3:()=>_,RS:()=>d});var s=i(45934),n=i(92810),o=i(41664),a=i(23397),r=i(23580),c=i(95152);const l=(0,o.Q)();function d(e,t,i){e instanceof c.m||(e=(0,r.My)(e));e.getOrCreateInstance(l,(()=>new a.v)).fire({id:t,payload:i})}const _=(e,t)=>{const i=function(e,t){return(0,r.My)(e).getOrCreateInstance(l,(()=>new a.v)).addEventListener}((0,s.Pj)());(0,n.useEffect)((()=>{const s=i((({id:i,payload:s})=>{i===e&&t(s)}));return()=>s.dispose()}),[i,e,t])}},95152:(e,t,i)=>{i.d(t,{m:()=>a});var s=i(23397),n=i(77509);function o(e){return`service_container_${e}`}class a extends n.j{constructor(e){super(),this._parent=e,this._injections=Object.create(null),this._emitter=this.addDisposable(new s.v)}inject(e,t,i){if("function"===typeof t){let s=this._injections[e],n="function"===typeof s?s():s;const o=this._injections[e]=()=>(n=t(this,n),n);i&&o()}else this._injections[e]=()=>t;this._emitter.fire(e)}_find(e){var t;return this._injections[e]||(null===(t=this._parent)||void 0===t?void 0:t._find(e))}_onInject(e,t,i=new n.j){return i.addDisposable(this._emitter.addEventListener((s=>{e===s&&(i.dispose(),t(this.getInstance(s)))}))),this._parent&&i.addDisposable(this._parent._onInject(e,t,i)),this.addDisposable(i),i}getInstance(e){const t=this._find(e);if("function"===typeof t)return t()}getOrCreateInstance(e,t){const i=this._find(e);if("function"===typeof i)return i();{const i=t(this);return this.inject(e,i),i}}getInstanceAsync(e){const t=this._find(e);return"function"===typeof t?Promise.resolve(t()):new Promise((t=>this._onInject(e,(()=>t(this.getInstance(e))))))}addService(e,t){const i=o(e);this.inject(i,((e,i=[])=>i.indexOf(t)<0?[...i,t]:i));const s=new n.j;return s.addDispose((()=>{this.inject(i,((e,i=[])=>i.filter((e=>e!==t))))})),s}getServices(e){var t;const i=o(e);return[...this.getInstance(i)||[],...(null===(t=this._parent)||void 0===t?void 0:t.getServices(e))||[]]}createChild(){return new a(this)}dispose(){this._injections=Object.create(null)}}},45695:(e,t,i)=>{i.d(t,{K9:()=>u,QC:()=>d,XW:()=>_,ur:()=>l});var s=i(19378),n=i(33288),o=i(45934),a=i(41664),r=i(92810);const c=(0,a.Q)("MESSAGE_SERVICE");function l(){const e=d();return(0,r.useCallback)((t=>{e.setTarget(t instanceof Element?t.contentWindow:t)}),[e])}function d(){const e=(0,o.Pj)();return(0,r.useMemo)((()=>function(e){return n.di.getOrCreateInstance(e,c,(()=>new s.bg))}(e)),[e])}function _(){const e=d();return(0,r.useCallback)((function(t){e.send(t)}),[e])}function u(){const e=d();return(0,r.useCallback)((function(t,i){e.send(t,i)}),[e])}},23397:(e,t,i)=>{i.d(t,{v:()=>n});var s=i(77509);class n extends s.j{constructor(e){super(),this._options=e,this._listeners=[],this.fire=e=>{if(!this.isDisposed()){let t;const i=[...this._listeners];for(const s of i){if(!1===t)return!1;t=t instanceof Promise?t.then((e=>!1!==e&&!this.isDisposed()&&s(e))).catch((e=>console.log(e))):s(e)}return t}},this.addEventListener=e=>{const t=this._listeners;var i;(t.push(e),1===t.length)&&((null===(i=this._options)||void 0===i?void 0:i.onFirstListenerAdd)&&this._options.onFirstListenerAdd());return{dispose:()=>{const i=t.indexOf(e);var s;i>=0&&(t.splice(i),t.length||(null===(s=this._options)||void 0===s?void 0:s.onFirstListenerAdd)&&this._options.onLastListenerRemove())}}},this.event=this.addEventListener}}let o;!function(e){function t(e){let t;const i=new n({onFirstListenerAdd(){t=e(i.fire)},onLastListenerRemove(){t.dispose()}});return i.event}e.snapshot=t,e.filter=function(e,i){return t((t=>e((e=>i(e)&&t(e)))))},e.map=function(e,i){return t((t=>e((e=>t(i(e))))))}}(o||(o={}))},32269:(e,t,i)=>{i.d(t,{Cb:()=>K,Cl:()=>m,DI:()=>w,Dx:()=>M,EU:()=>R,HT:()=>z,Hy:()=>W,Id:()=>p,Np:()=>N,Qi:()=>G,Tr:()=>Q,X7:()=>X,XZ:()=>j,Yq:()=>h,Z1:()=>H,_9:()=>x,_q:()=>V,au:()=>P,d_:()=>B,el:()=>O,ez:()=>D,fq:()=>g,gq:()=>y,i0:()=>k,iV:()=>U,jG:()=>l.j,ln:()=>Y,p6:()=>I,sh:()=>F,vl:()=>d.v,wB:()=>S});var s=i(74267),n=i(92810),o=i(85163),a=i(1741),r=i.n(a),c=i(45695),l=i(77509),d=i(23397),_=i(71210),u=i(70082);const p=e=>{Object.keys(o.A9).forEach((t=>{"onboarding_success"!==e.get(o.A9[t])&&e.remove(o.A9[t])}))};function m(e){const t=(0,s.A)(e);return isNaN(t)?new Date(e):t}const h=(e,t,i=!1)=>{Date;const s=new Date,n=e.getDate()===s.getDate()&&e.getMonth()===s.getMonth()&&e.getFullYear()===s.getFullYear();if(i&&n){const i=Math.floor((s-e)/1e3),n=Math.floor(i/60),o=Math.floor(n/60);if(i<60)return t("Just now");if(o>0){const e=n%60;return`${o} ${t("hour","hours",o)} ${e} ${t("minute","minutes",e)}`}return`${n} ${t("minute","minutes",n)}`}{const t=new Intl.DateTimeFormat(navigator.language,{dateStyle:"short"}),i=new Intl.DateTimeFormat(navigator.language,{timeStyle:"short"});return t.format(e)+" "+i.format(e)}},g=e=>{const t=e.match(/(\(copy\))( \d+)?$/),i=null===t||void 0===t?void 0:t[1],s=null===t||void 0===t?void 0:t[2];return i?s?`${e.slice(0,-s.length)} ${+s.slice(1)+1}`:`${e} 2`:`${e} (copy)`};function E(e,t,i){const s=new Map,n=new RegExp(`(${t})(.*?)(${i})`,"gis");return e=e.replaceAll(n,((e,t,i,n)=>{const o=(0,_.l)();return s.set(o,i),t+o+n})),{escapes:s,html:e}}function A(e,t){let i=[];for(const[s,n]of t){const{escapes:t,html:o}=E(e,s,n);e=o,i.push([s,n,t])}return{escapes:i,html:e}}function v(e,t,i,s){const n=new RegExp(`(${t})(.*?)(${i})`,"gis");return e.replaceAll(n,((e,t,i,n)=>{const o=s.get(i);return"string"===typeof o?t+o+n:e}))}const f=/<title>(.*)<\/title>/gm,O=(e,t)=>{let{escapes:i,html:s}=A(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return s=s.replaceAll(f,((e,i)=>i===t?`<title>${g(i)}</title>`:e)),function(e,t){for(const[i,s,n]of t)e=v(e,i,s,n);return e}(s,i.reverse())};function D(e){let{html:t}=A(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return[...t.matchAll(f)].map((e=>e[1])).find((e=>!!e))}const T="bottomRight",I=(e,t,i=T)=>{var s,n,o,a;t.error({innerException:e.error instanceof Error?e.error:void 0,message:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(s=e.error)||void 0===s||null===(n=s.data)||void 0===n?void 0:n.code)||(null===(o=e.error)||void 0===o?void 0:o.status)||e.error}}),description:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(a=e.error.data)||void 0===a?void 0:a.message)||e.error.error}}),placement:i})},S=(e,t,i=T)=>{t.success({message:e,placement:i})},L="ascend",C="descend",b="desc",y=e=>{switch(e){case L:return"asc";case C:return b;default:return""}},N=e=>{switch(e){case"asc":return L;case b:return C;default:return""}},M=e=>{const t=document.createElement("div");return t.className=e||"resizer",t},P=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,w=e=>new Promise(((t,i)=>{let s=new Image;s.src=e,s.addEventListener("load",(()=>{t("success")})),s.addEventListener("error",(()=>{i("error")})),s=null})),R=(e,t)=>{for(const i of t)"object"===typeof e.properties&&(e=e.properties[i]);return e},B=e=>e instanceof Array?e.map((e=>({label:e,value:e}))):Object.keys(e).map((t=>({label:e[t],value:t}))),k=(e,t,i=!0)=>{const s=Object.keys(t);for(const n of s){const s=t[n];void 0!==s&&null!==s&&(e[n]=i&&"object"===typeof s?k(e[n]||{},s,!0):s)}return e},U=e=>new Promise(((t,i)=>{r().load({google:{families:[e]},classes:!1,active:t,inactive:i})})),j=(e,t)=>{t&&e(t)},x=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i)=>{document.querySelectorAll(".block-search__preview").forEach((e=>e.remove()));const s=document.getElementById("iframe-scroll-top"),n=document.getElementById("iframe-scroll-bottom"),a=document.getElementById("email_iframe"),r=document.body.getBoundingClientRect().height,c=a.getClientRects()[0];c.top<0&&(s.style.display="block"),c.top+c.height>r&&(n.style.display="block");const l={operation:o.Ru.SANDBOX_BLOCK_INSERT,settings:{blockHTML:i||null,targetBlock:null,project:"emailmaker"}};t.dataTransfer.setData("Text",JSON.stringify(l)),e(l)}),[e])},G=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i,s)=>{const n=document.getElementById("iframe-scroll-top"),a=document.getElementById("iframe-scroll-bottom"),r=document.getElementById("email_iframe"),c=document.body.getBoundingClientRect().height,l=r.getClientRects()[0];l.top<0&&(n.style.display="block"),l.top+l.height>c&&(a.style.display="block");const d={operation:o.Ru.SANDBOX_ATOM_INSERT,settings:{atomHTML:i.html||null,targetBlock:null}};s(i)&&t.dataTransfer.setData("Text",JSON.stringify(d)),e(d)}),[e])},F=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i)=>{e({operation:o.Ru.SANDBOX_BLOCK_INSERT,action:"insert",settings:{blockHTML:i}})}),[e])},X=()=>{const e=(0,c.XW)();return(0,n.useCallback)(((t,i)=>{e({operation:o.Ru.SANDBOX_ATOM_INSERT,action:"insert",settings:{atomHTML:i}})}),[e])},H=(e,t)=>{t.success({maskClosable:!0,centered:!0,title:e("Coming soon"),content:e("The feature is under development."),okText:e("Ok. I'll be waiting"),onOk:()=>{}})},K=()=>{const e=(0,c.XW)();return(t,i)=>{e({operation:o.Ru.SANDBOX_ELEMENT_SETTINGS_SET,settings:t,type:i})}},V=(e,t="")=>{var i,s;const n=[];return null===(i=e._embedded)||void 0===i||null===(s=i["wp:term"])||void 0===s||s.filter((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})).forEach((e=>{const t=e[0].taxonomy;n[t]||(n[t]=[]),n[t]=e.map((e=>({id:e.id,name:e.name,children:e.children}))),n[n.length]=n[t]})),""!==t&&n.length?n[t]:n},z=(e,t="")=>{var i,s,n,o,a;return(null===(i=e._embedded)||void 0===i||null===(s=i["wp:term"])||void 0===s||null===(n=s.find((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})))||void 0===n||null===(o=n.find((e=>{var t;return null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.startsWith("project_")})))||void 0===o||null===(a=o.children)||void 0===a?void 0:a.map((e=>({id:e.id,name:e.name,count:e.count}))))||null},W=(e,t)=>{const i=e.target,s=t.getBoundingClientRect().height,n=i.getBoundingClientRect().height-s,o=e.clientY-t.getBoundingClientRect().top-30,a=-n*(Math.min(Math.max(o,0),s-60)/(s-60));i.style.transform=`translateY(${a}px)`},Q=({target:e})=>{e.style.transform="translateY(0)"};function Y(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""}},20116:(e,t,i)=>{function s(e){return t=>{const i=t.query,s=t.queryFn||((e,t,s,n)=>n(i(e)));if(s){let i;if("object"===typeof e){const{queryFn:s,...n}=e;i=s;for(const e of Object.keys(n))t[e]=n[e]}else i=e;t.query=void 0,t.queryFn=async(e,t,n,o)=>{try{let a=await i(e);return"function"===typeof a&&(a=await a((async(e,i=t,a=n,r=o)=>{const c=await s(e,i,a,r);if(c.error)throw c.error;return c.data}))),{data:a,error:null}}catch(a){return{error:a}}}}}}function n(){return s((()=>{}))}function o(e,t){const i={},n=Object.keys(t);for(const o of n)i[o]=s(t[o]);e.enhanceEndpoints({endpoints:i})}function a(e,t){for(const i of Object.keys(t))t[i](e)}i.d(t,{BD:()=>a,BX:()=>o,nM:()=>s,pl:()=>n})},98589:(e,t,i)=>{function s(e,t){if(e===t)return!0;if("object"===typeof e&&e&&"object"===typeof t&&t){const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(const o of i)if(!s(e[o],t[o]))return!1;return!0}return!1}function n(e,t){if(!e)return t;const i={};for(const n of Object.keys(t))s(t[n],e[n])||(i[n]=t[n]);return i}i.d(t,{g:()=>n})},88896:(e,t,i)=>{i.d(t,{X:()=>n});const s=Symbol("Error");function n(e){return Promise.all(e.map((e=>e instanceof Promise?e.catch((e=>(console.log(e),s))):e))).then((e=>e.filter((e=>e!==s))))}},91738:(e,t,i)=>{i.d(t,{AU:()=>d});var s=i(90854),n=i(58689),o=i(44824),a=i(26453),r=i(91391);const c=e=>function(e){var t;return function(e){return"___SCRIPT"===e.tagName}(e)&&(null===(t=e.src)||void 0===t?void 0:t.startsWith(r.gP))}(e)||(0,a.Nh)(e)||(0,s.BF)(e),l=e=>{if(c(e))return!0;if((0,s.vq)(e)||(0,s.wz)(e))for(const t of e.querySelectorAll("*"))if(c(t))return!0;return!1};async function d(e,t){"string"===typeof e&&(e={code:e});const i=e.code?await(0,n.PJ)(e.code||"",[n.qy],e.utm_parameters,(async e=>{void 0===t&&(t=l(e)),t&&await(0,o.e)(e,"html")})):"",s=e.code&&t?await(0,n.PJ)(e.code||"",[n.qy],e.utm_parameters,(async e=>{await(0,o.e)(e,"amp")})):"";return{...e,compiled:{html:i,ampHtml:s}}}},91366:(e,t,i)=>{i.d(t,{Qq:()=>g,PL:()=>A,KA:()=>E,wz:()=>v});var s=i(33288),n=i(41664),o=i(15230),a=i(32269),r=i(55654);class c extends r.IO{async execute([e],t){for(const i of t){const t=await i(e);t&&(void 0===t.id&&(t.id=e.value.id),e.value=t)}return e.value}}var l=i(98589);class d extends r.lt{}var _=i(56991);class u extends a.jG{constructor(...e){super(...e),this._items=new Map,this._onChangeEmitter=new r.HN,this.onChange=this._onChangeEmitter.event}async _getOrCreate(e,t){const i=this._items;let s;if(i.has(e))try{s=await i.get(e)}catch{t&&(s=await t())}else t&&(s=await t(),s&&this._onChangeEmitter.fire());return s}async _addOrUpdate(e,t){let i;const s=this._items;if(s.has(e))try{i=await s.get(e)}catch{}const n=await t(i);return(0,_.bD)(i,n)||this._onChangeEmitter.fire(),n}entries(){return Promise.all([...this._items.entries()].map((([e,t])=>t.then((t=>[e,t]))))).then((e=>e.filter((([e,t])=>!!t))))}values(){return Promise.all([...this._items.values()].map((e=>e)).filter((e=>!!e)))}getOrCreate(e,t){let i=this._getOrCreate(e,(()=>t(e)));return this._items.set(e,i),i}addOrUpdate(e,t){let i=this._addOrUpdate(e,t);return this._items.set(e,i),i}add(e,t){const i=Promise.resolve(t);return this._items.set(e,i),i}remove(e){if(this._items.has(e)){const t=this._items.get(e);return this._items.delete(e),this._onChangeEmitter.fire(),t}return Promise.resolve(void 0)}async setAll(e){try{this.suspendChange();const t=[],i=new Set(Array.from(e).map((([e,t])=>e))),s=(await this.entries()).filter((([e,t])=>!i.has(e)));for(const[n,o]of e)t.push(this.addOrUpdate(n,(()=>o))),i.add(n);for(const[e]of s)t.push(this.remove(e));return await Promise.all(t),s}finally{this.resumeChange()}}clear(){this._items.clear(),this._onChangeEmitter.fire()}suspendChange(){this._onChangeEmitter.suspend()}resumeChange(){this._onChangeEmitter.resume()}}var p=i(71210);class m extends a.jG{constructor(...e){super(...e),this._cache=new u,this._readEmitter=new r.lt,this._saveEmitter=this.addDisposable(new c),this._removeEmitter=this.addDisposable(new d),this._foreignCache=Object.create(null),this.handlerRead=this._readEmitter.event,this.onSave=this._saveEmitter.event,this.onRemove=this._removeEmitter.event,this.onChange=this._cache.onChange}async get(e){return this._cache.getOrCreate(e,(async t=>Object.assign({id:e},...(await this._readEmitter.fire(e)).filter((e=>!!e)))))}get cache(){return this._cache}byForeignKey(e){let t=this._foreignCache[e];if(!t){const i=this.addDisposable(new a.jG);i.addDispose((()=>delete this._foreignCache[e]));const s=i.addDisposable(new u),n=i.addDisposable(new r.lt);t=this._foreignCache[e]={get:async(t,i={})=>(await s.getOrCreate(t,(async()=>{try{const i=function(e=[]){if((e=e.filter((e=>e))).length<=1)return e[0];let t=new Map;for(const i of e)for(const e of i)if(void 0!==e.id){let i=t.get(e.id)||{};t.set(e.id,{...i,...e})}return[...t].map((([e,t])=>t))}(await n.fire(t))||[];for(const s of i)s[e]=t,await this._cache.add(s.id,s);return i}catch{return[]}})),function(e,{filter:t,order:i="asc",orderBy:s,page:n,pageSize:o=20}={}){const a=e.length;let r=e.length;if(void 0!==t){const i=Object.keys(t);r=(e=e.filter((e=>{for(const s of i){const i=e[s],n=t[s];return"id"===s||"string"!==typeof i?i===n:"string"===typeof n&&i.startsWith(n)}return!0}))).length}return s&&(e=e.sort(((e,t)=>(e[s]>t[s]?1:t[s]>e[s]?-1:0)*("asc"===i?1:-1)))),void 0!==n&&(e=e.slice(o*(n-1),o*n-1)),{data:e,filteredTotal:r,total:a,totalPages:Math.floor(a/o)}}(await this._cache.values()||[],i)),first:(e,i={})=>t.get(e,{...i,page:1,pageSize:1}).then((e=>e[0])),handleRead:n.event,clear(){s.clear()},dispose(){i.dispose()}}}return t}async create(e,{source:t="",silent:i}={}){let s=e;return i||(s=await this._saveEmitter.fire({prev:void 0,patch:e,value:s,source:t})),void 0===s.id&&(s.id=(0,p.l)()),await this._cache.addOrUpdate(s.id,(()=>s))}async update(e,t,{source:i="",silent:s}={}){return this._cache.addOrUpdate(e,(async e=>{let n=e?{...e,...t}:t;if(!s)return t=e?(0,l.g)(e,t):t,await this._saveEmitter.fire({prev:e,patch:t,value:n,source:i})}))}async remove(e,{source:t="",silent:i}={}){const s=await this._cache.remove(e);return i||await this._removeEmitter.fire({value:s,source:t}),s}refresh(){this._cache.clear();for(const e of Object.values(this._foreignCache))e.clear()}suspendChange(){this._cache.suspendChange()}resumeChange(){this._cache.resumeChange()}}i(18398);var h=i(39990);function g(){const e=(0,n.Q)();return t=>s.di.getOrCreateInstance(t,e,(()=>new m))}function E(e){const t=s.di.getInstance(e,o.ax);if(!t)throw new Error("Failed");return t}function A(e){const t=s.di.getInstance(e,o.Lz);if(!t)throw new Error("Failed");return t}async function v(e){const t=E(e),i=await t.dispatch(h.Q2.endpoints.getMe.initiate({},{forceRefetch:!0}));return Promise.resolve(i.data)}},13437:(e,t,i)=>{i.d(t,{A:()=>a,i:()=>o});var s=i(71210),n=i(814);function o({code:e,...t},i){var n,o;const a=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,s.l)(),project:null===(n=a.projectSlice)||void 0===n||null===(o=n.project)||void 0===o?void 0:o.id}}function a({html:e,renderGuid:t,...i},s){const o=s.getState(),{project:a}=o.configSlice;return(0,n.TB)({...i,code:e,project:void 0===a?i.project:a,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}},25181:(e,t,i)=>{function s(e,t){var i;return{severity:Number(t.severity),message:t.message,source:t.source,startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn,get startOffset(){return e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn})},get endOffset(){return e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn})},tags:null===(i=t.tags)||void 0===i?void 0:i.map((e=>Number(e)))}}i.d(t,{B:()=>s})},91253:(e,t,i)=>{i.d(t,{I:()=>o,y:()=>n});var s=i(814);function n(e,t,i){const s=t.getState();var n,o;void 0===i&&(i=void 0===e.post?null===(n=s.emailSlice)||void 0===n||null===(o=n.email)||void 0===o?void 0:o.id:e.post);return{...e,content:e.content?`<p>${e.content}</p>`:"",post:i}}function o(e,t){return(0,s.TB)({...e,link:void 0,comment_status:void 0})}},81304:(e,t,i)=>{i.d(t,{E:()=>a,I:()=>o});var s=i(71210),n=i(814);function o({code:e,...t},i){var n,o;const a=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,s.l)(),project:null===(n=a.projectSlice)||void 0===n||null===(o=n.project)||void 0===o?void 0:o.id,utm_parameters:t.utm_parameters||{},_embedded:void 0}}function a({html:e,renderGuid:t,...i},s){const o=s.getState(),{project:a,config:r}=o.configSlice;return(0,n.TB)({...i,code:e,project:void 0===a?i.project:a,utm_parameters:r.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0,compiled:(0,n.TB)({html:e,ampHtml:e&&""})})}},4453:(e,t,i)=>{i.d(t,{E:()=>o,_:()=>n});var s=i(814);function n({code:e,...t},i,s){const n=i.getState();var o,a;void 0===s&&(s=void 0===t.parent?null===(o=n.emailSlice)||void 0===o||null===(a=o.email)||void 0===a?void 0:a.id:t.parent);return{...t,...e?{html:e}:{},parent:s}}function o({html:e,...t},i){return(0,s.TB)({...t,code:e,guid:void 0,compiled:(0,s.TB)({html:e,ampHtml:e&&""})})}},23036:(e,t,i)=>{i.d(t,{Xy:()=>a,bg:()=>c,yc:()=>r});var s=i(20116),n=i(55701),o=i(91366);const a=(0,o.Qq)(),r=(0,o.Qq)();function c(e){const t=a(e),i=t.byForeignKey("project"),c=r(e),l=c.byForeignKey("parent"),{dispatch:d,getState:_}=(0,o.KA)(e),u=(0,o.PL)(e);u.addDisposable(t.onChange((()=>d(n.VM.util.invalidateTags(["Blocks"]))))),u.addDisposable(t.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.html===e.html&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE)),(0,s.BX)(n.VM,{async getBlocks(e){const t={};e.name&&(t.title=e.name),e.type&&(t.type=e.type);return await i.get(e.projectId,{filter:t,page:e.page,pageSize:e.pageSize,order:e.order,orderBy:e.orderby}).then((({data:e})=>e))},getBlocksSchema:()=>e=>e({}),getParentEmailBlocks:e=>t=>t(e),getTemplateBlocks:e=>t=>t(e),async getBlock(e){const t=_().projectSlice.project.id;return i.first(t,{filter:{id:e}})},getBlockHistory:async({blockId:e,page:t=1})=>({...await l.get(e,{page:t}),args:{blockId:e,page:t}}),addBlock:e=>async i=>{const s=await t.create(e);return _().configSlice.config.preventSendDataToEM||i(s).catch((e=>console.log(e))),s},editBlock:({blockId:e,...i})=>t.update(e,i),deleteBlock:e=>t.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveBlock:({blockId:e,body:t})=>c.create({...t,parent:e})})}},72788:(e,t,i)=>{i.d(t,{B:()=>c,D:()=>r});var s=i(18777),n=i(91366),o=i(68415),a=i(20116);const r=(0,n.Qq)();function c(e){const t=r(e),i=t.byForeignKey("post"),{dispatch:c}=(0,n.KA)(e);(0,n.PL)(e).addDisposable(t.onChange((()=>c(s.Jg.util.invalidateTags(["Comments"]))))),(0,a.BX)(s.Jg,{getComments:e=>i.get(e).then((({data:e})=>e)),addComment({subjectId:e,author:i,parent:s,content:n,author_name:a,author_email:r,targetId:c}){const l={post:e,author:i,author_name:a,author_email:r,content:n,parent:s,target_id:c,date:(0,o.A)(new Date),author_avatar_urls:{}};return t.create(l)},deleteComment:e=>t.remove(e),editComment:({commentId:e,...i})=>t.update(e,i),deleteTarget:e=>t.update(e,{target_id:""})})}},87265:(e,t,i)=>{i.d(t,{Av:()=>r,jw:()=>c,sE:()=>l});var s=i(86739),n=i(91366),o=i(71210),a=i(20116);const r=(0,n.Qq)(),c=(0,n.Qq)();function l(e){const t=r(e),i=c(e),l=i.byForeignKey("parent"),{dispatch:d,getState:_}=(0,n.KA)(e),u=(0,n.PL)(e);u.addDisposable(t.onChange((async()=>{d(s.GY.util.invalidateTags(["Email"]))}))),u.addDisposable(i.onChange((()=>{d(s.GY.util.invalidateTags(["EmailAutosaves"]))}))),u.addDisposable(t.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.subject===e.subject&&i.html===e.html&&i.preheader===e.preheader&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE)),(0,a.BX)(s.GY,{getEmails:e=>[],getTemplateEmails:e=>t=>t(e),getEmail:async e=>await t.get(e),getEmailHistory:({emailId:e,page:t=1})=>(l.clear(),async s=>{if(_().configSlice.config.revisionService){const n=await s({emailId:e,page:t});for(const e of n.data)i.cache.add(e.id,e);return n}return{...await l.get(e,{page:t}),args:{emailId:e,page:t}}}),async addEmail({source:e,...i}){const s=await t.create(i,{source:e});return s.renderGuid||(s.renderGuid=(0,o.l)()),s},editEmail:e=>async i=>{let{emailId:s,source:n,...o}=e;return _().configSlice.config.revisionService&&await i(e),t.update(s,o,{source:n})},deleteEmail:e=>t.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveEmail:({emailId:e,body:t})=>async s=>(_().configSlice.config.revisionService&&await s({emailId:e,body:t}),await i.create({...t,parent:e,modified:(new Date).toString()}))})}},55084:(e,t,i)=>{i.d(t,{A:()=>I});var s=i(20116),n=i(53200);var o=i(84612);var a=i(91366),r=i(39990);var c=i(15230),l=i(47036);var d=i(95679);var _=i(62689);var u=i(84568);var p=i(46312),m=i(93982),h=i(13522);var g=i(65119);var E=i(63531),A=i(33288);A.di.createIdentifier();var v=i(83351);var f=i(23036),O=i(72788),D=i(94381);var T=i(87265);const I={addUserToProjectApiMock:function(){n.B.enhanceEndpoints({endpoints:{addUserToProject:(0,s.pl)()}})},AiApiMock:function(){(0,s.BX)(o.Zs,{sendMessage:({body:e})=>t=>t({body:e}).catch((()=>new Promise((e=>setTimeout(e,1e3))))),getDialog:e=>t=>t(e)})},authorizationApiMock:function(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:(0,a.KA)(e).getState().userSlice.currentUser.locale,counters:{},avatar_urls:{},autosaves:!0};r.Q2.enhanceEndpoints({endpoints:{userRegistration:(0,s.pl)(),getSchema:(0,s.nM)((()=>e=>e({}))),getMe:(0,s.nM)((()=>t)),editMe:(0,s.nM)((e=>t={...t,...e})),getSubscriptions:(0,s.nM)((()=>[]))}})},blocksApiMock:f.bg,commentsApiMock:O.B,emailsApiMock:T.sE,emailRawApiMock:function(){(0,s.BX)(l.f,{getEmailRaw({emailId:e,secret_hash:t}){throw new Error(c.f5)}})},imageApiMock:function(){(0,s.BX)(d.CL,{sendAiImageRequest:function({body:e}){return t=>t({body:e})},getAiImage:e=>t=>t(e)})},localesApiMock:function(e){(0,s.BX)(D.Ad,{getLocale:async({id:e})=>t=>t({id:e}),getLocales:()=>async e=>e({})})},notificationsApiMock:function(){(0,s.BX)(_.vx,{getNotifications:e=>[],notificationShown({id:e,datetime:t}){throw new Error(c.f5)}})},projectsApiMock:function(e){let t;(0,s.BX)(u.Nq,{getProjects:(e={page:1})=>[],getProject:e=>i=>t||(t=i(e).then((t=>({...t,id:e})))),addProject(e){throw new Error},editProject:({projectId:e,...i})=>t=t.then((t=>({...t,...i,id:e}))),deleteProject(e){throw new Error}})},proxyApiMock:function(e){const t=(0,m.dB)(e,h.A.FILE_PROXY_EVENT_ID);(0,s.BX)(p.Z8,{getFile:async({url:i,tryFetch:s=!0,type:n})=>async o=>{const a=e.getState(),{project:r}=a.configSlice,c=(await t.fire({url:i,project:r})).filter((e=>e instanceof Blob))[0];if(!c)return o({url:i,tryFetch:s,type:n});switch(n){case"json":return JSON.parse(await c.text());case"text":return c.text();default:return c}}})},recoverPasswordApiMock:function(){(0,s.BX)(g.yR,{resetPassword(e){throw new Error(c.f5)},setPassword(e){throw new Error(c.f5)},validateRecoverPasswordCode(e){throw new Error(c.f5)}})},saveFileApiMock:function(e){if(!A.di.getInstance(e,c.Lz))throw new Error("Something was wrong");const t=(0,m.dB)(e,h.A.UPLOAD_EVENT_ID),i=(0,m.dB)(e,h.A.ON_SEND_TESTEMAIL_ID),n=(0,m.dB)(e,h.A.ON_SEND_LIVEPREVIEW_ID);(0,s.BX)(E.yH,{uploadImage:i=>async s=>{const n=e.getState(),{project:o}=n.configSlice,a="tmp"===i.folder?null:await t.fire({file:i.file,project:o}),r=a?a.find((e=>e)):null;return r?[{file_url:r,project:o}]:s({...i,user_id:String((await A.di.getInstanceAsync(e,c.sZ)).app_id)})},sendTestEmail:t=>async s=>{const n=e.getState(),{project:o}=n.configSlice;(await i.fire({project:o,email_id:t.email_id,subject:t.subject,email:t.email,html:t.html,from_name:t.from_name})).some((e=>!1===e))&&await s({...t,user_id:String((await A.di.getInstanceAsync(e,c.sZ)).app_id)})},async sendLivePreview(t){const i=e.getState(),{project:s}=i.configSlice;(await n.fire({project:s,id:t.email,subject:t.subject,html:t.content})).some((e=>!1===e))},sendShortLink:e=>t=>t(e)})},tokenApiMock:function(){(0,s.BX)(v.OV,{tokenCreate:e=>t=>t(e),tokenValidate:()=>e=>e({})})}}},62410:(e,t,i)=>{i.d(t,{r:()=>v});var s=i(33288),n=i(14386),o=i(18398),a=i(47358),r=i(86286),c=i(39990),l=i(99751),d=i(15230),_=i(13652);function u(e){var t;return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:"off"!==e.wordWrap,minimap:null===(t=e.minimap)||void 0===t?void 0:t.enabled,insertSpaces:e.insertSpaces}}var p=i(39217),m=i(32269),h=i(91366),g=i(93982),E=i(13522),A=i(48802);const v=(0,n.l)((e=>{const t=(0,h.PL)(e),i=(0,A.m)((0,g.Zc)(e,E.A.READ_LOCALE)),n=t.addDisposable(new A.U(i)),v=e.dispatch,f=s.di.getInstanceAsync(e,d.sZ).then((e=>(null===e||void 0===e?void 0:e.app_config)||{}),(e=>(console.log(e),{}))),O=(0,_.y)(),D=async(...t)=>{const i=Object.assign({},...t),s=Object.assign({},...t.map((e=>e.editor))),{locale:n="ru_RU",theme:r,codeModeDirection:l,...d}=i;void 0!==l&&("none"===l?v((0,a.N6)(!1)):(v((0,a.N6)(!0)),v((0,a.Uf)(l))));const _=await(0,h.wz)(e);var u;await v(c.Q2.endpoints.editMe.initiate({..._,code_editor:s?(u=s,{font_size:u.fontSize,font_family:u.fontFamily,tab_size:u.tabSize,word_wrap:u.wordWrap,minimap:u.minimap,insert_spaces:u.insertSpaces}):_.code_editor,locale:"string"===typeof n?n:_.locale,theme:"string"===typeof r?r:_.theme})),v((0,o._R)(d))};let T;return{setOptions:O.decorate((async({config:i={},project:a,user:r,advancedConfigs:d,handleReadLocale:_})=>{var u;n.setListener(_);let g=await f,E=d||g.advancedConfigs,A=localStorage.getItem("configSwither"),O=E&&E[(null===i||void 0===i?void 0:i.mode)||A||"pro"]||(null===(u=(0,l.$)((null===i||void 0===i?void 0:i.mode)||A||"pro"))||void 0===u?void 0:u.config);if(O={...O,configSwither:i.configSwither||!1},await D(O,g,i),v((0,o.bn)(String(a))),v((0,o.ee)(E)),T&&T.dispose(),T=new m.jG,r){let i={...await(0,h.wz)(e),email:"",password:"",...r,id:"number"===typeof r.id?String(r.id):r.id};void 0===r.id&&delete i.id,v(c.Q2.endpoints.editMe.initiate(i)),r.id&&t.addDisposable(s.di.addService(e,p.jY,{execute(e){e.headers.append("user_id",i.id)}}))}a&&t.addDisposable(s.di.addService(e,p.jY,{execute(e){e.headers.append("project_id",String(a))}}))})),instance:{setConfig:O.decorate((async e=>{var t;let i=null===(t=(0,l.$)((null===e||void 0===e?void 0:e.mode)||"pro"))||void 0===t?void 0:t.config;await D(i,await f,e)})),getConfig:()=>function(e){var t,i;const s=e.getState(),n=s[r.Ay.name],c=s[o.Ay.name],l=s[a.Ay.name];return{...c.config,theme:null===(t=n.currentUser)||void 0===t?void 0:t.theme,locale:null===(i=n.currentUser)||void 0===i?void 0:i.locale,codeModeDirection:l.isCodeMode?l.codeModeDirection:"none",editor:u(n.monacoOptions)}}(e),updateConfig:O.decorate((e=>D(e))),handleReadLocale:i}}}))},33746:(e,t,i)=>{i.d(t,{F:()=>c});var s=i(44141),n=i(33288),o=i(15230),a=i(14386),r=i(39217);const c=(0,a.l)((e=>{let t=!0;return{setOptions(i){if(i.hasOwnProperty("baseUrl")){const s=n.di.getInstance(e,r.eT),o=s.getOptions(),a=(0,r.qT)(i.baseUrl);o.baseUrl!==a&&(s.setOptions({baseUrl:a}),t=!0)}if(t){const i=n.di.getInstance(e,s.Pz);n.di.inject(e,o.sZ,(async(e,t)=>t||i.app.app_init_create({}).then((({data:e})=>e))),!0),t=!0}}}}))},19209:(e,t,i)=>{i.d(t,{F:()=>u});var s=i(14386),n=i(14315),o=i(33288),a=i(41664),r=i(39217),c=i(13652),l=i(85163);const d=(0,a.Q)(),_=(0,a.Q)(),u=(0,s.l)((e=>({setOptions(t){const i=(0,c.y)(),s=(0,r.mg)(e);o.di.addService(e,r.jY,{execute:i.decorate((async i=>{if(t.jwtAuth){let a=o.di.getInstance(e,d),r=o.di.getInstance(e,_);if(!r&&!a){const i=await s.jwtAuth.token_create({body:t.jwtAuth,type:n.cM.Json});if(i.error)throw r=l.ff,o.di.inject(e,_,l.ff),new Error(l.ff);a=i.data.token,o.di.inject(e,d,a)}r||i.headers.append("authorization",`Bearer ${a}`)}}))})}})))},1383:(e,t,i)=>{i.d(t,{Y:()=>l,h:()=>d});var s=i(14386),n=i(41664),o=i(33288),a=i(39217),r=i(47271),c=i(12264);const l=(0,n.Q)(),d=(0,s.l)((e=>{let t;return o.di.addService(e,a.jY,{execute:async i=>{if(t){const t=await o.di.getInstanceAsync(e,l);t&&i.headers.append("authorization",`Bearer ${t}`)}}}),{setOptions(i){t!==i.getAuthToken&&(t=i.getAuthToken,o.di.inject(e,l,void 0),o.di.inject(e,l,(async(e,i)=>{try{let e=await i;var s;return t?e&&1e3*(null===(s=(0,r.iU)(e))||void 0===s?void 0:s.exp)>(0,c.N)()?e:await t(e):""}catch(n){return console.log(n),""}}),!0))}}}))},14386:(e,t,i)=>{function s(e){return async function(t){return{setOptions:()=>{},instance:{},dispose:()=>{},...await e(t)||{}}}}function n(e){return async t=>{const i={},s=[];for(const n of e)s.push(await n(t));for(const e of s)Object.assign(i,e.instance);return{instance:i,setOptions:e=>{const t=s.map((t=>t.setOptions(e)));return t.some((e=>e instanceof Promise))?Promise.all(t).then((()=>{})):void 0},dispose:()=>{for(const e of s)e.dispose()}}}}i.d(t,{E:()=>n,l:()=>s})},893:(e,t,i)=>{i.d(t,{m:()=>c});var s=i(17126),n=i(92810),o=i(45934),a=i(18398),r=i(70082);const c=({children:e})=>{const[t,i]=(0,n.useState)(),c=(0,o.d4)(a.p5);return(0,r.jsxs)("div",{className:"App blocks-app blocks-plugin",children:[c&&(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:c}}),(0,r.jsx)(s.fh.Provider,{value:t,children:e}),(0,r.jsx)("div",{ref:i,className:"blocks-modal-container"})]})}},97001:(e,t,i)=>{i.d(t,{P:()=>S});var s=i(32269),n=i(93556),o=i(23580),a=i(71210),r=i(56991),c=i(13329),l=i(28316),d=i(18398),_=i(13437),u=i(81304),p=i(4453),m=i(91253),h=i(33288),g=i(15230),E=i(13652),A=i(13522),v=i(93982),f=i(91738),O=i(86739),D=i(39217),T=i(25181);const I="EXTERNAL";class S extends s.jG{constructor(e){super(),this._store=e,this._emailTemplateCache=Object.create(null),this._prevCommand=void 0,this._prevContent=void 0,this._dataSources=void 0,this._eventLock=void 0,this._queue=(0,E.y)(),this._model=void 0,this._currentEmail=void 0,this.show=this._queue.decorate(this._show,this),this.save=this._queue.decorate(this._save,this);const t=(0,o.My)(e);this._dataSources=(0,n.zC)(t),this._eventLock=(0,n.QQ)(t);const i=(0,v.Zc)(e,A.A.ON_MODEL_CHANGE),s=(0,v.Zc)(e,A.A.ON_EMAIL_CHANGED_ID);this.addDisposable(i((e=>{this._model=e}))),this.addDisposable(s((e=>{this._currentEmail=e}))),this.addDisposable(h.di.addService(e,D.jY,{execute:e=>{var t;null!==(t=this._currentEmail)&&void 0!==t&&t.id&&!this._currentEmail.isNew&&e.headers.append("email_id",this._currentEmail.id)}}))}async getProject(){const e=await h.di.getInstanceAsync(this._store,g.sZ);return null===e||void 0===e?void 0:e.project}async getTemplateEmail(e){e=String(e);let t=this._emailTemplateCache[e];if(!t){const i=await this._store.dispatch(O.GY.endpoints.getTemplateEmail.initiate(e));i.error?console.log(i.error):(t={...i.data,lock:!1,parent_email:e},delete t.id)}return t}async getBlocks(){const{cache:e}=this._dataSources.blocks,t=await this.getProject();return(await e.values()).filter((e=>e.project===t)).map((e=>(0,_.A)(e,this._store)))}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmail();return(await e.values()).filter((e=>e.post===t.id)).map((e=>(0,m.I)(e,this._store)))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmail();return(await e.values()).filter((e=>e.parent===t.id)).map((e=>(0,p.E)(e,this._store)))}async setBlocks(e=[]){const{cache:t}=this._dataSources.blocks;await t.setAll(e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,_.i)(e,this._store)])))}async setEmailRevisions(e=[],t){const{cache:i}=this._dataSources.emailRevisions,s=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,p._)(e,this._store,t)]));await i.setAll(s)}async setComments(e=[],t){const{cache:i}=this._dataSources.comments,s=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,m.y)(e,this._store,t)]));await i.setAll(s)}async getEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,f.AU)(i,t.isAmp)}async compileEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,f.AU)(i,t.isAmp)}async setEmail(e,t,i=!1){const s=this._dataSources.emails,n=s.cache,o=await this.getProject();e="string"===typeof e?{code:e}:{...e};let r=(0,u.I)(e,this._store);const c=r.id;let l=c;if(void 0!==c?r={...await s.get(c),...r,project:o}:(r={...r,project:o},l=(0,a.l)(),delete r.project),t){const e=await this.getTemplateEmail(String(t));e&&(r={...e,id:String(t),...r})}await n.setAll([[l,r]]),i&&this._runShowCommand({isNew:void 0===c,id:l,project:o})}_runShowCommand(e){const t={...e,type:"email"};this._prevCommand&&!(0,r.bD)(this._prevCommand,e)?(0,c.RS)(this._store,l._1,t):this._store.dispatch((0,d.Ir)(t)),this._prevCommand=e}async _show(e){try{if(!e)return;if(this._eventLock.suspendChange(),e!==this._prevContent){this._prevContent=e;const{email:t,blocks:i,autosaves:s,comments:o,templateId:a}=(0,n.Uw)(e),r=[];r.push(this.setBlocks(i)),void 0!==t.id&&(r.push(this.setComments(o)),r.push(this.setEmailRevisions(s))),r.push(this.setEmail(t,Number(a),!0)),await Promise.all(r)}}catch(t){console.log(t)}finally{this._eventLock.resumeChange()}return new Promise((e=>{(0,v.Zc)(this._store,A.A.ON_EMAIL_INIT_ID)((()=>e()))}))}_save(){return new Promise((async e=>{const t=this._dataSources.emails,i=this.addDisposable(t.onSave((({value:t,source:s})=>{s===I&&(i.dispose(),e((0,u.E)(t,this._store)))}),Number.MIN_VALUE));(0,c.RS)(this._store,l.Kp,I)}))}getCodeErrors(){var e;const t=this._store.getState(),i=this._model;return i?null===(e=t.emailSlice.problemsList)||void 0===e?void 0:e.map((e=>(0,T.B)(i,e))):void 0}}},44376:(e,t,i)=>{i.d(t,{y:()=>E});var s=i(23580),n=i(93556),o=i(81304),a=i(13437),r=i(91253),c=i(4453),l=i(32269),d=i(48802),_=i(13522),u=i(93982),p=i(18398),m=i(98589),h=i(55654),g=i(25181);class E extends l.jG{constructor(e){super(),this._store=e,this._events=void 0,this._model=void 0,this._listenersUpdaters=void 0;const t=(0,u.Zc)(e,_.A.ON_MODEL_CHANGE);this.addDisposable(t((e=>{this._model=e})))}_get(){const e=this._store,t=(0,s.My)(e),{blocks:i,emails:l,comments:E,emailRevisions:A}=(0,n.zC)(t),v=(0,u.Zc)(e,_.A.ON_SAVEBUTTON_CLICK_ID),f=(0,u.Zc)(e,_.A.ON_PREVIOUSBUTTON_CLICK_ID),O=(0,u.Zc)(e,_.A.ON_NEXTBUTTON_CLICK_ID),D=(0,u.Zc)(e,_.A.ON_EMAIL_INIT_ID),T=(0,u.Zc)(e,_.A.ON_EMAIL_CHANGED_ID),I=(0,u.Zc)(e,_.A.ON_CONTENT_CHANGED_ID),S=(0,u.Zc)(e,_.A.ON_SEND_TESTEMAIL_ID),L=(0,u.Zc)(e,_.A.ON_SEND_EMAIL_MODAL_ID),C=(0,u.Zc)(e,_.A.ON_EMAIL_CLONE_ID),b=(0,u.Zc)(e,_.A.ON_SHARE_ID),y=(0,u.Zc)(e,_.A.ON_SHOW_PREVIEW_ID),N=(0,u.Zc)(e,_.A.ON_SEND_LIVEPREVIEW_ID),M=(0,u.Zc)(e,_.A.ON_CODE_VALIDATE_ID);return{handleValidate:(0,d.m)(M,(e=>this._model?e.map((e=>(0,g.B)(this._model,e))):[])),handleReadEmail:(0,d.m)(l.handlerRead,(e=>e),(t=>t&&(0,o.I)(t,e))),handleSaveEmail:(0,d.m)(l.onSave,(function({prev:t,patch:i,value:s,source:n}){const a=t?(0,o.E)(t,e):void 0;return{prev:a,patch:(0,m.g)(a,(0,o.E)(i,e)),value:(0,o.E)(s,e),source:n}}),(t=>t?(0,o.I)(t,e):void 0)),handleRemoveEmail:(0,d.m)(l.onRemove,(({value:t,source:i})=>({value:(0,o.E)(t,e),source:i})),(()=>{})),handleReadBlocks:(0,d.m)(i.byForeignKey("project").handleRead,(t=>(0,p.jY)(e.getState())||String(t)),(t=>null===t||void 0===t?void 0:t.map((t=>(0,a.i)(t,e))))),handleSaveBlock:(0,d.m)(i.onSave,(function({prev:t,patch:i,value:s,source:n}){const o=t?(0,a.A)(t,e):void 0;return{prev:o,patch:(0,m.g)(o,(0,a.A)(i,e)),value:(0,a.A)(s,e),source:n}}),(t=>t?(0,a.i)(t,e):void 0)),handleRemoveBlock:(0,d.m)(i.onRemove,(({value:t,source:i})=>({value:(0,a.A)(t,e),source:i})),(()=>{})),handleReadComments:(0,d.m)(E.byForeignKey("post").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.y)(t,e))))),handleSaveComment:(0,d.m)(E.onSave,(function({prev:t,patch:i,value:s,source:n}){const o=t?(0,r.I)(t,e):void 0;return{prev:o,patch:(0,m.g)(o,(0,r.I)(i,e)),value:(0,r.I)(s,e),source:n}}),(t=>t?(0,r.y)(t,e):void 0)),handleRemoveComment:(0,d.m)(E.onRemove,(({value:t,source:i})=>({value:(0,r.I)(t,e),source:i})),(()=>{})),handleReadEmailRevisions:(0,d.m)(A.byForeignKey("parent").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,c._)(t,e))))),handleEmailAutosave:(0,d.m)(A.onSave,(function({prev:t,patch:i,value:s,source:n}){return{value:(0,c.E)(s,e),source:n}}),(t=>t?(0,c._)(t,e):void 0)),handleRemoveEmailAutoSave:(0,d.m)(A.onRemove,(({value:t,source:i})=>({value:(0,c.E)(t,e),source:i})),(()=>{})),handleEmailChanged:(0,d.m)((0,h.sg)(T,100),(t=>(0,o.E)(t,e))),handleEmailInit:(0,d.m)(D,(t=>(0,o.E)(t,e))),handlePreviousButtonClick:(0,d.m)(f,(t=>(0,o.E)(t,e))),handleNextButtonClick:(0,d.m)(O,(t=>(0,o.E)(t,e))),handleSaveButtonClick:(0,d.m)(v,(t=>(0,o.E)(t,e))),handleHtmlChanged:(0,d.m)((0,h.sg)(I,100)),handleTestEmailSend:(0,d.m)(S,(({html:e,...t})=>({...t,code:e,compiled:{html:e,ampHtml:""}}))),handleTestEmailModal:(0,d.m)(L,(t=>(0,o.E)(t,e))),handleCloneEmail:(0,d.m)(C,(t=>(0,o.E)(t,e))),handleShareEmail:(0,d.m)(b),handlePreviewEmail:(0,d.m)(y),handleLivePreviewEmail:(0,d.m)(N)}}get(){return this._events||(this._events=this._get())}setOptions(e={}){const t=this.get();let i=this._listenersUpdaters;if(!i){i=this._listenersUpdaters={};for(const e of Object.keys(t))i[e]=this.addDisposable(new d.U(t[e]))}for(const s of Object.keys(t))i[s].setListener(e[s])}}},93556:(e,t,i)=>{i.d(t,{QQ:()=>r,Uw:()=>c,zC:()=>a});var s=i(23036),n=i(72788),o=i(87265);function a(e){return{emails:(0,o.Av)(e),blocks:(0,s.Xy)(e),emailRevisions:(0,o.jw)(e),blocksRevision:(0,s.yc)(e),comments:(0,n.D)(e)}}function r(e){const t=Object.values(a(e));return{suspendChange(){t.forEach((e=>e.suspendChange()))},resumeChange(){t.forEach((e=>e.resumeChange()))}}}function c(e){return"string"===typeof e?{email:{code:e}}:function(e){return!e.hasOwnProperty("email")&&!e.hasOwnProperty("block")&&!e.hasOwnProperty("templateId")}(e)?{email:e}:{...e,email:"string"===typeof e.email?{code:e.email}:e.email||{}}}},8671:(e,t,i)=>{i.d(t,{e:()=>c});var s=i(14386),n=i(33288),o=i(15230),a=i(32269),r=i(48802);const c=(0,s.l)((e=>{const t=n.di.getInstance(e,o.Lz),i=t.addDisposable(new a.vl),s=(0,r.m)(i.event),c=t.addDisposable(new r.U(s));return{setOptions({handleDestroy:e}){c.setListener(e)},instance:{handleDestroy:s,destroy:()=>t.dispose()}}}))},63772:(e,t,i)=>{i.d(t,{Z:()=>l});var s=i(14386),n=i(33288),o=i(48802),a=i(15230),r=i(93982),c=i(13522);const l=(0,s.l)((e=>{const t=n.di.getInstance(e,a.Lz),i=(0,r.Zc)(e,c.A.UPLOAD_EVENT_ID),s=(0,r.Zc)(e,c.A.FILE_PROXY_EVENT_ID),l=(0,o.m)(i),d=(0,o.m)(s),_=t.addDisposable(new o.U(l)),u=t.addDisposable(new o.U(d));return{setOptions(e){_.setListener(e.handleLoadImage),u.setListener(e.handleFileProxy)},instance:{handleLoadImage:l,handleFileProxy:d}}}))},55853:(e,t,i)=>{i.d(t,{E:()=>c});var s=i(14386),n=i(33288),o=i(15230),a=i(55654),r=i(48802);const c=(0,s.l)((e=>{const t=n.di.getInstance(e,o.Lz),i=t.addDisposable(new a.vl),s=n.di.getInstanceAsync(e,o.Cd);s.then((({instance:e})=>i.fire(e)));const c=(0,r.m)(i.event),l=t.addDisposable(new r.U(c));return{setOptions({handleLoad:e}){l.setListener(e)},instance:{handleLoad:c,reset:e=>s.then((({instance:t,setOptions:i})=>Promise.resolve(i(e)).then((()=>t))))},destroy:()=>t.dispose()}}))},1281:(e,t,i)=>{i.d(t,{Z:()=>g});var s=i(14386),n=i(33288),o=i(15230),a=i(48802),r=i(13329),c=i(28316),l=(i(92810),i(814)),d=i(70082);function _(e){return"string"===typeof e?e:e?(0,d.jsx)("div",{ref:t=>null===t||void 0===t?void 0:t.replaceWith(e)}):void 0}function u(e,t="success"){return"string"===typeof e&&(e={message:e}),(0,l.TB)({type:e.type||t,data:e.data,innerException:e.innerException,message:_(e.message),description:_(e.description),btn:_(e.btn),onClose:e.onClose,duration:e.duration,icon:_(e.icon),placement:e.placement,style:e.style,closeIcon:"boolean"===typeof e.closeIcon||"undefined"===typeof e.closeIcon?e.closeIcon:_(e.closeIcon),props:e.props,role:e.role})}var p=i(13522),m=i(55654),h=i(93982);const g=(0,s.l)((e=>{const t=n.di.getInstance(e,o.Lz),i=(0,h.Zc)(e,p.A.ON_NOTIFICATION),s=(0,m.pb)(i,(e=>"error"===e.type)),l=(0,m.pb)(i,(e=>"success"===e.type)),d=(0,a.m)(i,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),_=(0,a.m)(s,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e,"error"):e)),g=(0,a.m)(l,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),E=t.addDisposable(new a.U(d)),A=t.addDisposable(new a.U(_)),v=t.addDisposable(new a.U(g));return{setOptions({handleNotify:e,handleSuccess:t,handleError:i}){E.setListener(e),A.setListener(i),v.setListener(t)},instance:{notify(t){(0,r.RS)(e,c.Sb,{placement:"bottomRight",...u(t)})},handleNotify:d,handleError:_,handleSuccess:g}}}))},89949:(e,t,i)=>{i.d(t,{R:()=>a});var s=i(92810),n=i(45934),o=i(39990);const a=({onLoad:e,children:t})=>{(0,s.useEffect)((()=>{e&&e()}),[e]);const i=(0,n.wA)();return(0,s.useMemo)((()=>i(o.Q2.endpoints.getMe.initiate({}))),[i]),t}},55654:(e,t,i)=>{i.d(t,{HN:()=>d,IO:()=>o,P9:()=>a,lt:()=>u,pb:()=>c,sg:()=>l,vl:()=>_});var s=i(32269);class n extends s.jG{constructor(...e){super(...e),this._listeners=[],this.event=this._addListener.bind(this)}getListeners(e){return this._listeners.flatMap((([t])=>"function"===typeof t?t:t.getListeners(e)))}hasListeners(){return this._listeners.length>0}_addListener(e,t=0,i){if(!this.isDisposed()){const s=this._listeners;i&&"function"===typeof e&&(e=e.bind(i));const n=s.findIndex((([e,i])=>t<i)),o=[e,t];return s.splice(n>=0?n:s.length,0,o),{dispose(){const e=s.indexOf(o);e>=0&&s.splice(e,1)}}}}dispose(){this._listeners.splice(0,this._listeners.length),super.dispose()}}class o extends n{constructor(...e){super(...e),this.fire=this._fire.bind(this)}execute(e,t){for(const s of t)try{s(...e)}catch(i){console.log(i)}}_fire(...e){if(!this.isDisposed())return this.execute(e,this.getListeners(e))||void 0}}function a(e,t=0){const i=new n;return i.addDisposable(e(i,t)),i.event}class r extends n{constructor(e){super(),this._filter=e}getListeners(e){return this._filter(...e)?super.getListeners(e):[]}}function c(e,t,i=0){const s=new r(t);return s.addDisposable(e(s,i)),s.event}function l(e,t=0,i=0){const s=new o;let n,a=0;return s.addDisposable(e(((...e)=>{n=e,a||(a=setTimeout((()=>{s.fire(...n),a=0}),t))}),i)),s.event}class d extends o{constructor(...e){super(...e),this._suspendCounter=0,this._wasFired=!1}proccessResult(){}execute([e],t){if(this._suspendCounter)this._wasFired=!0;else for(const s of t)try{s(e)}catch(i){console.log(i)}}suspend(){this._suspendCounter++}resume(){0===--this._suspendCounter&&(this._wasFired&&this.fire(),this._wasFired=!1)}}class _ extends o{execute([e],t){for(const s of t)try{s(e)}catch(i){console.log(i)}}}class u extends o{async execute([e],t){const i=[];for(const s of t){const t=await s(e);i.push(t)}return i}}},48802:(e,t,i)=>{i.d(t,{U:()=>o,m:()=>a});var s=i(32269),n=i(55654);class o extends s.jG{constructor(e){super(),this._event=e,this._listener=void 0,this._disposeEvent=void 0}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),this._disposeEvent=e?this._event(e):void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}}function a(e,t,i){const s=(0,n.P9)(e);return(e,n,o)=>{const a=s((async s=>{const n=t?t(s):s;o&&e.bind(o);const a=await e(n);return i?i(a):a}),n,o);return()=>a.dispose()}}},13652:(e,t,i)=>{i.d(t,{y:()=>s});const s=e=>{let t={current:Promise.resolve(),state:e,decorate:(e,i)=>(i&&(e=e.bind(i)),function(...i){const s=t.current.then((()=>e(...i)));return t.current=s.then((e=>{t.state=e}),(e=>{console.log(e)})),s})};return t}},18398:(e,t,i)=>{i.d(t,{Ay:()=>T,EV:()=>O,GH:()=>m,Ir:()=>h,Kj:()=>D,RP:()=>_,_R:()=>E,bn:()=>A,ee:()=>v,jY:()=>p,p5:()=>u,s0:()=>l,zg:()=>d});var s=i(90536),n=i(31770),o=i(99751);const a="configSlice",r=(0,n.ur)((0,o.$)("pro")),c=(0,s.createSlice)({name:a,initialState:{...r,initialMergeTags:void 0},reducers:{setPage:(e,t)=>{e.page=t.payload},setConfig:(e,t)=>{e.config={...r.config,...t.payload}},changeConfigMode:(e,t)=>{var i,s,n;const a=null!==(i=null===e||void 0===e||null===(s=e.advancedConfigs)||void 0===s?void 0:s[t.payload])&&void 0!==i?i:null===(n=(0,o.$)(t.payload))||void 0===n?void 0:n.config;if("simple"!==e.config.mode&&"simple"!==t.payload){const t={...e.config,...Object.fromEntries(Object.entries(a).filter((([e])=>o.i.includes(e))))};e.config=t}else e.config={...e.config,...(0,o.$)(t.payload).config}},setInitialMergeTags:(e,t)=>{e.initialMergeTags=t.payload},setMergeTags:(e,t)=>{e.config.mergeTags=t.payload},updateConfig:(e,t)=>{e.config={...e.config,...t.payload}},setProject:(e,t)=>{e.project=t.payload},setAdvancedConfigs:(e,t)=>{e.advancedConfigs=t.payload}},extraReducers:e=>{}}),l=e=>e[a].page,d=e=>e[a].config,_=e=>e[a].config.themes,u=e=>e[a].config.styles,p=e=>e[a].project,m=e=>e[a].config.mergeTags||e[a].initialMergeTags,{setPage:h,setConfig:g,updateConfig:E,setProject:A,setAdvancedConfigs:v,setMergeTags:f,changeConfigMode:O,setInitialMergeTags:D}=c.actions,T=c},47358:(e,t,i)=>{i.d(t,{Ay:()=>j,B:()=>b,Bp:()=>I,CS:()=>P,Ct:()=>M,Fk:()=>h,Fv:()=>R,M7:()=>L,N6:()=>D,NQ:()=>N,Oo:()=>p,PM:()=>m,Tn:()=>B,Uf:()=>v,V$:()=>k,Wm:()=>y,cL:()=>C,mi:()=>g,oG:()=>U,qf:()=>u,sy:()=>S,vc:()=>E,vs:()=>A,wW:()=>f,wr:()=>O,yy:()=>w});var s=i(90536),n=i(85163),o=i(31770),a=i(55701);const r=window.localStorage.getItem(n.V0.em_code_mode_settings),c=r&&JSON.parse(r),l=(0,o.ur)({activeModal:"",lastActiveSettingsTab:n.Bv,activeSettingsTab:n.Bv,isPanelHistoryCollapsed:!0,monacoHeight:0,isCodeMode:(null===c||void 0===c?void 0:c.isCodeMode)||n.EW.isPlugin,codeModeDirection:(null===c||void 0===c?void 0:c.codeModeDirection)||"left",emailWidth:"100%",emailViewType:n.Vp,mobileViewActive:{shutdown:!0,styles:!0},emailMaxWidthSize:425,propertiesPanelKey:n.WU,parentBlocks:[],isGlobalLoading:!1}),d="emailPageSlice",_=(0,s.createSlice)({name:d,initialState:l,reducers:{openModal:(e,t)=>{e.activeModal=t.payload},closeModal:e=>{e.activeModal=""},setActiveSettingsTab:(e,t)=>{e.lastActiveSettingsTab=e.activeSettingsTab,e.activeSettingsTab=t.payload,t.payload!==n.Vv&&(e.isPanelHistoryCollapsed=!0)},resetToLastActiveSettingsTab:e=>{"Properties"===e.lastActiveSettingsTab?e.activeSettingsTab="Build":e.activeSettingsTab=e.lastActiveSettingsTab,e.lastActiveSettingsTab!==n.Vv&&(e.isPanelHistoryCollapsed=!0)},switchIsPanelHistoryCollapsed:(e,t)=>{e.isPanelHistoryCollapsed=t.payload||!e.isPanelHistoryCollapsed},setEmailWidth:(e,{payload:t})=>{e.emailWidth=t,e.emailViewType=t>e.emailMaxWidthSize||"100%"===t?n.Vp:n.ND,window.localStorage.setItem(n.V0.em_default_sizes,JSON.stringify(t))},setEmailMaxWidthSize:(e,{payload:t})=>{e.emailMaxWidthSize=t},setEmailViewType:(e,t)=>{e.emailViewType=t.payload},switchCodeMode:e=>{const t=!e.isCodeMode;e.isCodeMode=t,window.localStorage.setItem(n.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:t}))},setCodeMode:(e,t)=>{const i=t.payload;e.isCodeMode!==i&&(e.isCodeMode=i,window.localStorage.setItem(n.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:i})))},switchCodeModeDirection:(e,t)=>{e.codeModeDirection=t.payload,window.localStorage.setItem(n.V0.em_code_mode_settings,JSON.stringify({isCodeMode:e.isCodeMode,codeModeDirection:t.payload}))},setMobileViewActive:(e,t)=>{e.mobileViewActive=t.payload},setPropertiesPanelKey:(e,t)=>{e.propertiesPanelKey=t.payload},resetParentBlocks:e=>{e.parentBlocks=[]},setParentBlocks:(e,t)=>{e.parentBlocks=t.payload},setIsGlobalLoading:(e,t)=>{e.isGlobalLoading=t.payload}},extraReducers:e=>{e.addMatcher(a.VM.endpoints.getParentEmailBlocks.matchFulfilled,((e,t)=>{e.parentBlocks=t.payload}))}}),{openModal:u,closeModal:p,setActiveSettingsTab:m,resetToLastActiveSettingsTab:h,switchIsPanelHistoryCollapsed:g,setEmailWidth:E,switchCodeMode:A,switchCodeModeDirection:v,setMobileViewActive:f,setEmailViewType:O,setCodeMode:D,setEmailMaxWidthSize:T,setPropertiesPanelKey:I,resetParentBlocks:S,setIsGlobalLoading:L}=_.actions,C=e=>e[d].activeModal,b=e=>e[d].activeSettingsTab,y=e=>e[d].isPanelHistoryCollapsed,N=e=>e[d].emailWidth,M=e=>e[d].emailViewType,P=e=>e[d].mobileViewActive,w=e=>e[d].codeModeDirection,R=e=>e[d].isCodeMode,B=e=>e[d].propertiesPanelKey,k=e=>e[d].parentBlocks,U=e=>e[d].isGlobalLoading,j=_},57964:()=>{}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[5211],{79381:(e,t,s)=>{s.d(t,{A:()=>se});var i=s(92810),r=s(64617),n=s(41919),a=s(95838),l=s(71157),o=s(98915),d=s(17590),c=s(21195),m=s(45934),u=s(38883),p=s.n(u),h=s(43005),g=s(24696),_=s(94822),v=s(23287),x=s(3824),j=s(75111),f=s(81325),y=s(74919),A=s(39475),b=s(8375),w=s(32293),N=s(9588),S=s(68631),k=s(84501),I=s(85025),C=s(94219),T=s(81577),E=s(64936),L=s(36404),z=s(86286),D=s(39990),O=s(32269),M=s(90070),R=s(85163),F=s(70082);const B=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:s})=>{var n;const{__:a}=(0,v.s9)();let l=(0,m.wA)(),o=(0,r.Zp)();const{projectId:d}=(0,r.g)(),{pathname:c}=(0,r.zy)(),[u,B]=(0,i.useState)(""),P=(0,m.d4)(L.yN),H=(0,m.d4)(z.C1),q=(0,M.p6)(),$=(0,i.useCallback)((()=>{c.includes("blocks")?B("Blocks"):c.includes("emails")?B("Emails"):c.includes("members")&&B("Members"),!s&&t(!0)}),[c,t,s]);(0,i.useEffect)((()=>{$()}),[$]);let V=[],W=[];const U=(null===P||void 0===P?void 0:P.title)||"";let X=[{label:(0,F.jsx)("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer",children:a("Help")}),key:"Help center",icon:(0,F.jsx)(x.A,{style:{fontSize:"16px"}}),className:"help-center"},{label:a("Chat support"),key:"Support chat",icon:(0,F.jsx)(j.A,{style:{fontSize:"16px"}}),className:"open-support-chat",onClick:()=>{try{window.carrotquest.open()}catch(e){console.log(e)}}}],Y=[{label:a("Account settings"),key:"Account settings",icon:(0,F.jsx)(f.A,{style:{fontSize:"16px"}}),className:"em-analytics__account-settings",onClick:()=>{l((0,E.qf)(R.lx.EDIT_PROFILE_MODAL)),!s&&t(!0)}},{label:(0,F.jsx)(_.N_,{to:"/billing",children:a("Billing")}),key:"Billing",icon:(0,F.jsx)(y.A,{style:{fontSize:"16px"}}),className:"em-analytics__billing"},{label:a("Sign out"),icon:(0,F.jsx)(A.A,{style:{fontSize:"16px"}}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{(0,O.Id)(q),l(D.Q2.util.resetApiState()),o("/auth",{replace:!0})}}];const Z="/projects"+(d?"/"+d+"/emails?page=1":""),J=[{label:(0,F.jsx)(_.N_,{style:{fontSize:16},to:Z,children:U}),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:d?(0,F.jsx)(_.N_,{to:Z,className:"project-menu__block",style:{fontSize:"18px",zIndex:99},children:(0,F.jsx)(h.Ay,{type:"primary",className:"project-menu__block-button",children:null===U||void 0===U?void 0:U.split(" ").slice(0,2).map((e=>Array.from(e)[0]))})}):(0,F.jsxs)(_.N_,{to:Z,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"28px"},children:[(0,F.jsxs)("b",{children:[(0,F.jsx)("span",{className:"letters",children:"E"}),(!e||s)&&(0,F.jsx)("span",{className:"hidden-text",children:"mail"})]}),(0,F.jsx)("span",{className:"letters",children:"M"}),(!e||s)&&(0,F.jsx)("span",{className:"hidden-text",children:"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:a("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:(0,F.jsx)(b.A,{style:{fontSize:"16px"}}),onClick:()=>{l((0,E.qf)(R.lx.EDIT_PROJECT_MODAL)),!s&&t(!0)}},{label:(0,F.jsx)(_.N_,{to:"/projects",children:a("List of projects")}),key:"List of projects",icon:(0,F.jsx)(w.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}]},{type:"divider"}];return V.push({icon:(0,F.jsx)(N.A,{style:{fontSize:20}}),label:(0,F.jsx)(_.N_,{to:`/projects/${d}/emails`,rel:"noopener noreferrer",children:a("Emails")}),key:"Emails",className:"project-menu__list-item em-analytics__project-menu-emails"},{icon:(0,F.jsx)(S.A,{style:{fontSize:20}}),label:(0,F.jsx)(_.N_,{to:`/projects/${d}/blocks`,rel:"noopener noreferrer",children:a("Blocks")}),key:"Blocks",className:"project-menu__list-item em-analytics__project-menu-blocks"},{icon:(0,F.jsx)(k.A,{style:{fontSize:20}}),label:(0,F.jsx)(_.N_,{to:`/projects/${d}/members`,rel:"noopener noreferrer",children:a("Members")}),key:"Members",className:"project-menu__list-item em-analytics__project-menu-members"}),"community"===H.subscription.post_name&&d&&H.counters.emails_counter>2&&W.push({icon:(0,F.jsx)(I.A,{style:{fontSize:20,lineHeight:"44px"}}),label:(0,F.jsx)(_.N_,{to:"/billing",rel:"noopener noreferrer",style:{fontSize:16,color:"white"},children:a("Upgrade")}),key:"Emails",className:"project-menu__list-item"}),W.push({icon:(0,F.jsx)(C.A,{style:{fontSize:18}}),label:a("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:X},{icon:(0,F.jsx)(T.A,{style:{fontSize:18}}),label:a("What's new"),key:"What's new",className:"project-menu__list-item ducalis-changelog-widget em-analytics__project-menu-ducalis"},{icon:(0,F.jsx)("span",{style:{width:"20px",height:"20px",fontSize:"20px"},className:"user-profile__avatar anticon",children:null!==H&&void 0!==H&&null!==(n=H.avatar_urls)&&void 0!==n&&n[24]?[(0,F.jsx)("img",{style:{width:"100%"},src:null===H||void 0===H?void 0:H.avatar_urls[24],alt:null!==H&&void 0!==H&&H.name?`${null===H||void 0===H?void 0:H.name} avatar`:"User avatar",className:"user-profile__avatar-img"},"img"),(0,F.jsx)(f.A,{style:{position:"absolute",fontSize:20,borderRadius:100,overflow:"hidden",height:20,width:20,lineHeight:0,zIndex:-1}},"UserOutlined")]:(0,F.jsx)(f.A,{style:{color:"white"}})}),label:(null===H||void 0===H?void 0:H.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:Y}),(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)("div",{className:"project-menu",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)(g.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:J,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),d&&(0,F.jsx)(g.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[u],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:V,triggerSubMenuAction:"hover"})]}),(0,F.jsx)(g.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:W,triggerSubMenuAction:"hover"})]})})};var P=s(35285),H=s(65052),q=s(70656),$=s(62689),V=s(65983),W=s(7760),U=s(19366),X=s(3289),Y=s(78451),Z=s(32411),J=s(69156),G=s(13329),K=s(56991),Q=s(28316);const{Sider:ee}=n.A,{useToken:te}=a.A,se=()=>{const{token:e}=te();let t=(0,r.zy)();const s=(0,m.wA)(),a=(0,r.Zp)(),{emailId:u,blockId:h}=(0,r.g)(),g=(0,m.d4)(z.C1),_=(0,m.d4)(E.cL),v=(0,i.useRef)(),[x]=(0,$.bw)(),j=(0,l.hN)();v.current||(v.current=(0,Z.$Z)()),(0,i.useEffect)((()=>{(0,J.FN)(e)}),[e]);const{data:f=[],isSuccess:y}=(0,$.I9)(g.id,{pollingInterval:3e4,skip:_});(0,i.useEffect)((()=>{const e=f.filter((e=>""===e.seen||null===e.seen));setTimeout((()=>{e.length&&y&&e.forEach((e=>{var t,s;j[e.type]({message:(0,F.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(t=e.title)||void 0===t?void 0:t.rendered)||e.title||""}}),description:(0,F.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(s=e.content)||void 0===s?void 0:s.rendered)||""}}),placement:"bottomRight"});const i=(new Date).toLocaleString();x({id:e.id,datetime:i}).unwrap()}))}),5e3)}),[y,x,f,j]),(0,U.A)(),(0,X.A)(),(0,Y.A)(),(0,i.useEffect)((()=>{h||s((0,W.nJ)()),u||s((0,V.ss)())}),[h,u,s,t.pathname]);let A=null;u||h||t.pathname.endsWith("/new")?A=v.current:v.current&&v.current.getValue()&&setTimeout((()=>v.current.setValue("")),1e3);const b=JSON.parse(localStorage.getItem(R.V0.em_menu_is_locked)),[w,N]=(0,i.useState)((null===b||void 0===b?void 0:b.isLocked)||!1),[S,k]=(0,i.useState)(!0);return(0,i.useEffect)((()=>{const e=()=>localStorage.setItem(R.V0.em_menu_is_locked,JSON.stringify({isLocked:w}));return e(),e()}),[w]),(0,G.D3)(Q._1,(0,i.useCallback)((e=>{const t=(0,K.Mu)(e);a(t)}),[a])),(0,F.jsx)("div",{className:"main",children:(0,F.jsx)(Z.kx.Provider,{value:A,children:(0,F.jsx)("div",{className:"main__pane main__pane_main",children:(0,F.jsx)("div",{className:"main__pane-content",id:"pane-content-iframe",children:(0,F.jsxs)(n.A,{className:"main__pane-layout",hasSider:!0,children:[!R.EW.isPlugin&&(0,F.jsx)(ee,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed"},collapsible:!0,collapsed:!w&&S,defaultCollapsed:!0,reverseArrow:!w&&!S||w&&!S,trigger:(0,F.jsxs)("div",{className:"main__pane-trigger",children:[w?(0,F.jsx)(c.A,{style:{fontSize:18}}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(o.A,{style:{fontSize:18}}),(0,F.jsx)(d.A,{style:{fontSize:18}})]}),(0,F.jsx)(q.A,{})]}),className:p()("main__menu",{main__menu_lock:w}),width:260,onCollapse:(e,t)=>{e?!w&&k(!0):k(!e),N(!w)},onMouseEnter:()=>!w&&k(!1),onMouseLeave:()=>!w&&k(!0),children:(0,F.jsx)(B,{isMenuCollapsed:S,setIsMenuCollapsed:k,isLocked:w})}),(0,F.jsx)(P.A,{isModalVisible:_===R.lx.EDIT_PROJECT_MODAL}),(0,F.jsx)(H.A,{isModalVisible:_===R.lx.EDIT_PROFILE_MODAL}),(0,F.jsx)(r.sv,{})]})})})})})}},24495:(e,t,s)=>{s.d(t,{A:()=>E});var i=s(92810),r=s(76662),n=s(41919),a=s(43005),l=s(71157),o=s(20258),d=s(64617),c=s(12280),m=s(55039),u=s(45934),p=s(23287),h=s(4800),g=s(21349),_=s(8114),v=s(85163);const x=(e,t,s,i,r,n)=>{var a,l;const o=n("Owner","member"),d=n("Administrator","member"),c=r("The invitation has been sent");let m=[];e.role===c?m.push({label:r("Revoke the invite"),key:v.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>i(t,e)}):(e.role!==o&&m.push({label:r("Assign the project owner"),key:v.gY,className:"em-analytics__members-owner",onClick:({key:t})=>i(t,e)}),e.role!==d&&m.push({label:r("Change role to Administrator"),key:v.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>i(t,e)}),e.role===d&&m.push({label:r("Change role to User"),key:v.aO,className:"em-analytics__members-user",onClick:({key:t})=>i(t,e)}),m.push({label:r("Remove member"),key:v.eA,onClick:({key:t})=>i(t,e)}));let u=[];(null===(a=e.ID)||void 0===a?void 0:a.toString())===(null===(l=s.id)||void 0===l?void 0:l.toString())&&u.push({label:r("Change role to User"),key:v.aO,className:"em-analytics__members-user",onClick:({key:t})=>i(t,e)}),e.role===v.m3&&u.push({label:r("Change role to Administrator"),key:v.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>i(t,e)}),e.role===v.G$?u.push({label:r("Revoke the invite"),key:v.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>i(t,e)}):u.push({label:r("Remove member"),key:v.eA,className:"em-analytics__members-remove",onClick:({key:t})=>{i(t,e)}});let p=[{label:r("Remove member"),key:v.eA,className:"em-analytics__members-remove",onClick:({key:t})=>i(t,e)}];switch(t){case v.yo:return m;case v.St:return u;case v.m3:return p;default:return null}};x.propTypes={};const j=x;var f=s(86286),y=s(84568),A=s(31844),b=s(32269),w=s(70082);const N=()=>{const{__:e,_x:t}=(0,p.s9)(),s=(0,u.d4)(f.C1),{owner:r,admin:n}=(0,A.A)();let a=(0,d.Zp)();const o=(0,l.hN)(),[c,m]=(0,i.useState)(""),x=t("Owner","member"),N=t("Administrator","member"),S=e("user"),k=e("The invitation has been sent");(0,i.useEffect)((()=>{r||n||m(v.m3),r&&m(v.yo),n&&m(v.St)}),[r,n,s]);const{data:I,isFetching:C,refetch:T}=(0,d.KC)(),[E,L]=(0,i.useState)([]);(0,i.useEffect)((()=>{const{owner:s,admins:i,users:r,invited_users:n}=I.members||{};L([s&&{...s,role:t("Owner","member")},i&&Array.isArray(i)&&i.map((e=>({...e,role:t("Administrator","member")}))),r&&Array.isArray(r)&&r.map((t=>({...t,role:e("user")}))),n&&Array.isArray(n)&&n.filter((e=>null===e||void 0===e?void 0:e.invited_user_email)).map((t=>({role:e("The invitation has been sent"),user_email:t.invited_user_email,user_firstname:" ",user_lastname:" "})))].filter((e=>e)).flat(1))}),[I.members,e,t]);const[z,D]=(0,y.OD)(),O=(i,{role:r,...n})=>{var l,d;let c,m={};switch(i){case v.gY:if(r===N){const e=I.members.admins,t=I.members.owner;m={admins:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)),t.ID]:0,owner:n.ID}}if(r===S){const e=I.members.users,t=I.members.owner;m={users:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)),t.ID]:0,owner:n.ID}}c=e("You changed the role of ")+n.display_name+t(" to ","member")+e("owner")+".";break;case v.Qz:if(r===S){const s=I.members.users,i=I.members.admins;m={users:s&&Array.isArray(s)&&s.length>1?s.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0,admins:i&&Array.isArray(i)&&i.length>0?[...i.map((e=>e.ID)),n.ID]:[n.ID]},c=e("You changed the role of ")+n.display_name+t(" to ","member")+e("Administrator")+"."}break;case v.aO:if(r===N){const s=I.members.admins,i=I.members.users;m={admins:s&&Array.isArray(s)&&s.length>1?s.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0,users:i&&Array.isArray(i)&&i.length>0?[...i.map((e=>e.ID)),n.ID]:[n.ID]},c=e("You changed the role of ")+n.display_name+t(" to ","member")+e("user")+"."}break;case v.eA:if(r===N){const e=I.members.admins;m={admins:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0}}if(r===S){const e=I.members.users;m={users:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0}}c=(null===(l=s.id)||void 0===l?void 0:l.toString())===(null===(d=n.ID)||void 0===d?void 0:d.toString())?e("You deleted yourself from the project successfully."):e("You deleted ")+n.display_name+" "+e(" from the project successfully.");break;case v.JE:const i=I.members.invited_users;m={invited_users:!!(i&&Array.isArray(i)&&i.length>0)&&i.filter((e=>e.invited_user_email&&e.invited_user_email!==n.user_email))},c=e("You revoke invite for ")+n.user_email+" "+e(" from the project successfully.");break;default:return}z({projectId:I.id,members:{...I.members,...m}}).then((e=>{var t,i;if(e.error)return(null===(t=s.id)||void 0===t?void 0:t.toString())===(null===(i=n.ID)||void 0===i?void 0:i.toString())?((0,b.wB)(c,o),void a("/projects")):void(0,b.p6)(e,o);T(),(0,b.wB)(c,o)}))},M=[{width:"25%",title:e("Email"),dataIndex:["user_email"]},{width:"25%",title:e("Name"),dataIndex:["user_firstname"],render:(e,{user_lastname:t})=>(0,w.jsx)(w.Fragment,{children:e||t?`${e} ${t}`:"-"})},{width:"25%",title:e("Role"),dataIndex:["role"],render:(e,t,s)=>e},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(i,a)=>{const l=j(a,c,s,O,e,t);return a.role===x||!r&&!n&&a.role===N||n&&a.role===N&&s.id!==a.ID||!r&&!n&&a.role===S&&s.id!==a.ID||!r&&!n&&a.role===k?null:(0,w.jsx)(h.A,{arrow:"true",placement:"bottomRight",menu:{items:l},trigger:["hover"],children:(0,w.jsx)("span",{className:"members-table__actions",children:(0,w.jsx)(_.A,{})})})}}];return(0,w.jsx)("div",{children:(0,w.jsx)(g.A,{bordered:!0,className:"members-table",rowClassName:e=>e.role===k?"members-table__invite_member_row":"",rowKey:e=>`${e.role}_${e.ID||e.user_email}`,dataSource:E,columns:M,loading:D.isLoading||C,showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomLeft"]}})})};var S=s(20757),k=s(53200),I=s(22197);const{Paragraph:C}=r.A,{Content:T}=n.A,E=()=>{const{__:e}=(0,p.s9)(),t=(0,u.wA)(),{owner:s,admin:r}=(0,A.A)(),[h]=c.A.useForm(),g=(0,l.hN)(),[_,v]=(0,k.N)(),{data:x,refetch:j}=(0,d.KC)();(0,I.A)(e("Members")),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}));const f=(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(C,{className:"ant-page-header-heading-title",children:e("Members")})}),E=(0,w.jsx)(w.Fragment,{children:s||r?[(0,w.jsxs)(c.A,{form:h,name:"search-members-form",initialValues:{remember:!0},onFinish:({email:e})=>{_({email:e,project_id:x.id}).then((e=>{var s,i,r;e.isError?(0,b.p6)(e,g):(null===(s=e.data)||void 0===s||null===(i=s.data)||void 0===i?void 0:i.status)<400?(h.resetFields(),j(),(0,b.wB)(null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.message,g),t(y.Nq.util.invalidateTags([{type:"Projects",id:x.id}]))):g.error({message:(0,w.jsx)("div",{dangerouslySetInnerHTML:{__html:e.data.code}}),description:(0,w.jsx)("div",{dangerouslySetInnerHTML:{__html:e.data.message}}),placement:"bottomRight"})}))},autoComplete:"off",layout:"inline",validateTrigger:"onSubmit",onValuesChange:()=>{h.setFields([{errors:[],name:["email"]}])},className:"members-page__search-form",children:[(0,w.jsx)(c.A.Item,{className:"members-page__search-form-item members-page__search-form-item_input-item",name:"email",rules:[{required:!0,message:e("Please enter the correct email address."),type:"email"}],children:(0,w.jsx)(m.A,{placeholder:e("Email of a new member"),disabled:v.isLoading})}),(0,w.jsx)(c.A.Item,{className:"members-page__search-form-item",children:(0,w.jsx)(a.Ay,{type:"primary",className:"em-analytics__members-add",htmlType:"submit",disabled:v.isLoading,icon:(0,w.jsx)(o.A,{}),children:e("Add a member")})})]},"search-members-form")]:[]});return(0,w.jsxs)(n.A,{className:"members-page",children:[(0,w.jsx)(S.A,{leftBlock:f,rightBlock:E}),(0,w.jsx)(T,{className:"members-page__container",children:(0,w.jsx)("div",{className:"members-page__content container",children:(0,w.jsx)(N,{})})})]})}},92779:(e,t,s)=>{s.d(t,{A:()=>m});var i=s(92810),r=s(14852),n=s(89831),a=s(43005),l=s(23287),o=s(64617),d=s(47381),c=s(70082);const m=({open:e,sideOnOk:t,onCancel:s,initialSlide:m=0})=>{const{__:u}=(0,l.s9)(),p=(0,o.Zp)(),[h,g]=(0,i.useState)(m),_=(0,i.useRef)(null),v=(0,d.u)();(0,i.useEffect)((()=>{e&&_.current&&(_.current.goTo(m,!0),g(m))}),[e,m]);const x=(0,i.useMemo)((()=>[{image:u("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--blue-2)",title:u("More editing functions"),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 \xabCode\xbb mode and see the changes in real time. Blocks has no restrictions on the code: 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 Blocks! 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, heavy images, and other obstacles 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("Add your team members and work on your project simultaneously. Attach comments to individual email blocks and discuss necessary edits right in the editor.")},{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 will look like 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,i.useEffect)((()=>{if(e&&_.current){_.current.goTo(m,!0),g(m);const e=x[m];v({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:e.title})}}),[e,x,m,v]),(0,c.jsxs)(r.A,{open:e,footer:null,onCancel:s,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%"},children:[(0,c.jsx)(n.A,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:h,ref:_,children:x.map(((e,t)=>(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:"carousel-slide",style:{background:`${e.backgroundColor}`},children:[(0,c.jsx)("div",{className:"slide-item-image",children:(0,c.jsx)("img",{src:e.image,alt:`slide-${t}`})}),(0,c.jsxs)("div",{className:"slide-item-content",children:[(0,c.jsx)("h3",{className:"slide-title",children:e.title}),(0,c.jsx)("p",{className:"slide-description",children:e.description})]})]})},t)))}),(0,c.jsx)("div",{className:"modal-subtitle",children:u("This and other features are available for you on any paid billing plan.")}),(0,c.jsxs)("div",{className:"modal-buttons",children:[(0,c.jsx)(a.Ay,{size:"large",onClick:()=>s(!1),children:u("Cancel")}),(0,c.jsx)(a.Ay,{type:"primary",size:"large",onClick:()=>{t&&t(),p("/billing"),s(!1)},style:{padding:"0 30px"},children:u("Select plan")})]})]})}},84e3:(e,t,s)=>{s.d(t,{A:()=>S});var i=s(92810),r=s(71503),n=s(45934),a=s(887),l=s(45695),o=s(44396),d=s(86286),c=s(65983),m=s(7760),u=s(53204),p=s(64037),h=s(60382),g=s(85163),_=s(8685),v=s(32411),x=s(56991),j=s(93982),f=s(13522),y=s(19911),A=s(79716),b=s(19493),w=s(24293),N=s(70082);h.languages.html.htmlDefaults.options.format.wrapLineLength=0,r.wG.config({monaco:h}),(0,o.Q)(),(0,_.Gr)(h),(0,_.Wz)(h,["html"]);const S=({email:e,readOnly:t,setOtherUsers:s})=>{const o=(0,v.fn)(),_=(0,j.ml)(f.A.ON_CODE_VALIDATE_ID),S=(0,l.XW)(),k=(0,n.d4)(c.Up),I=(0,n.d4)(m.Up),C=(0,n.d4)(c.VZ),T=null!==e&&void 0!==e&&e.hasOwnProperty("type")?I:k,E=(0,n.d4)(d.hZ),L=(0,n.wA)(),z=(0,i.useRef)(null),D=(0,i.useRef)(null),O=(0,i.useRef)(null),M=(0,i.useRef)([]),R=(0,x.rD)(),F=(0,i.useCallback)((()=>{L((0,d.ku)(!1))}),[L]),[B,P]=(0,i.useState)(!1),[,H,q]=(0,y.useCollaborateEditor)({emailId:null===e||void 0===e?void 0:e.id,editorRef:D,setIsSpin:P});M.current=H,(0,i.useEffect)((()=>{t||s(M.current)}),[null===H||void 0===H?void 0:H.length,s,t]),(0,i.useEffect)((()=>F()),[F]),(0,i.useEffect)((()=>{if(C){const{current:e}=z;e&&(e.revealRangeInCenterIfOutsideViewport(C),e.setSelection(C))}}),[C]);(0,i.useEffect)((()=>{matchMedia(g.F3).addEventListener("change",(t=>{const s=window.localStorage.getItem(g.V0.em_color_scheme),i=t.matches?g.nd:g.T;e.hasOwnProperty("type")?L(s?(0,m.eX)(s===g.nd?`vs-${s}`:g.T):(0,m.eX)(i===g.nd?`vs-${i}`:g.T)):L(s?(0,c.eX)(s===g.nd?`vs-${s}`:g.T):(0,c.eX)(i===g.nd?`vs-${i}`:g.T))}))}),[L,e]),(0,i.useEffect)((()=>{const t=window.localStorage.getItem(g.V0.em_color_scheme),s=matchMedia(g.F3).matches?g.nd:g.T;null!==e&&void 0!==e&&e.hasOwnProperty("type")?L(t?(0,m.eX)(t===g.nd?`vs-${t}`:g.T):(0,m.eX)(s===g.nd?`vs-${s}`:g.T)):L(t?(0,c.eX)(t===g.nd?`vs-${t}`:g.T):(0,c.eX)(s===g.nd?`vs-${s}`:g.T))}),[L,e]);(0,p.A)((e=>{const t=e.data.operation,s=e.data;O.current=t,t===g.Ru.UPDATE_EDITOR_POSITION_FROM_IFRAME&&(e=>{const{current:t}=z;if(t&&!t.hasTextFocus()){const s=t.getModel(),i=s.getPositionAt(e.start),r=s.getPositionAt(e.end),n={startColumn:i.column,startLineNumber:i.lineNumber,endColumn:r.column,endLineNumber:r.lineNumber};t.revealRangeInCenterIfOutsideViewport(n),t.setSelection(n)}})(s.data)}));const $=(0,i.useMemo)((()=>document.createElement("div")),[]),V=(0,i.useMemo)((()=>({...E,domReadOnly:t,readOnly:t,unusualLineTerminators:"off",mouseWheelZoom:!0,wordWrap:R.onlyCodeModeInMobile?"off":E.wordWrap,ariaContainerElement:$})),[E,R.onlyCodeModeInMobile,t,$]);return(null===o||void 0===o?void 0:o.uri)&&(0,N.jsxs)(N.Fragment,{children:[B&&(0,N.jsx)(b.A,{className:"monaco-editor__spin",children:(0,N.jsx)(w.A,{indicator:(0,N.jsx)(A.A,{spin:!0,rev:void 0,style:{fontSize:48}})})}),(0,N.jsx)(r.Ay,{theme:T,className:"monaco-editor",defaultLanguage:"html",onMount:(e,t)=>{z.current=e,D.current=e;const s=e.getContribution("editor.linkDetector").openerService,i=s.open.bind(s),r=document.createElement("div"),n=new a.Ay(e,h,{"doctype-html5":!1,"html-lang-require":!1,"head-script-disabled":!1,"style-disabled":!1,"script-disabled":!1,"attr-lowercase":!1,"attr-value-single-quotes":!1,"attr-value-not-empty":!1,"attr-sorted":!1,"attr-whitespace":!1,"input-requires-label":!1,"tag-self-close":!1,"tagname-lowercase":!1,"href-abs-or-rel":!1,"inline-style-disabled":!1,"space-tab-mixed-disabled":!1,"attr-no-unnecessary-whitespace":!0,"tags-check":{img:{selfclosing:!1,attrsRequired:["src","alt"]},a:{selfclosing:!1,attrsRequired:["href"]}},"empty-tag-not-self-closed":!1,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0,"alt-require":!0,"inline-script-disabled":!0,"id-class-value":!1,"id-class-ad-disabled":!0,"attr-unsafe-chars":!0,csslint:{"display-property-grouping":!0,"known-properties":!0}});g._P.isEditor&&D.current&&q(D.current),n.watch(),e.getContribution("editor.linkDetector").openerService.open=e=>(r.innerHTML=e,i(r.textContent)),L((0,d.ku)(!0)),e.onMouseUp((()=>{const t=e.getSelection();t.startColumn===t.endColumn&&t.startLineNumber===t.endLineNumber&&(async e=>{const{current:t}=z;if(t){const s=t.getModel();S({operation:g.Ru.UPDATE_EDITOR_POSITION_FROM_EDITOR,data:s.getOffsetAt(e)})}})(e.getPosition())})),e.onDidBlurEditorWidget((()=>{S({operation:g.Ru.EDITOR_CHANGE_FOCUS,data:!1}),L((0,u.YT)(!1))})),e.onDidFocusEditorWidget((()=>{S({operation:g.Ru.EDITOR_CHANGE_FOCUS,data:!0}),L((0,u.YT)(!0))}))},options:V,keepCurrentModel:!0,path:o.uri.toString(),onValidate:function(e){var t;"Doctype must be declared first."!==(null===(t=e[0])||void 0===t?void 0:t.message)&&(g.EW.isPlugin&&_.fire(e),L((0,c.Bj)(e)))}})]})}},21999:(e,t,s)=>{s.d(t,{A:()=>n});s(92810);var i=s(64617),r=s(70082);const n=({lastProjectId:e})=>{const{pathname:t,search:s}=(0,i.zy)();return!1===e?(0,r.jsx)(i.C5,{to:"/projects"}):e&&(0,r.jsx)(i.C5,{to:`/projects/${e+t+s}`})}},32983:(e,t,s)=>{s.d(t,{A:()=>n});s(92810);var i=s(64617),r=s(70082);const n=({to:e})=>(0,r.jsx)(i.C5,{to:e})},24239:(e,t,s)=>{s.d(t,{A:()=>m});s(92810);var i=s(41919),r=s(25072),n=s(43005),a=s(64617),l=s(23287),o=s(32269),d=s(70082);const{Content:c}=i.A,m=()=>{const{__:e}=(0,l.s9)();let t=(0,a.Zp)();return(0,d.jsx)(i.A,{children:(0,d.jsx)(c,{className:"container",children:(0,d.jsx)(r.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:(0,d.jsx)(n.Ay,{type:"primary",onClick:()=>(0,o.XZ)(t,"/projects"),children:e("Back Home")})})})})}},26201:(e,t,s)=>{s.d(t,{A:()=>Y});var i=s(92810),r=s(45934),n=s(64617),a=s(94822),l=s(76662),o=s(81e3),d=s(66522),c=s(43005),m=s(71086),u=s(2018),p=s(7744),h=s(29234),g=s(57806),_=s(67661),v=s(66726),x=s(31022),j=s(3329),f=s(13932),y=s(69825),A=s(58133),b=s(38883),w=s.n(b),N=s(88528),S=s(65983),k=s(84568),I=s(32269),C=s(71157),T=s(45695),E=s(23287),L=s(32411),z=s(56991),D=s(85163),O=s(70082);const{Text:M,Link:R,Title:F}=l.A,B="Links",P="Images",H="Spam assassin",q="Problems",$="valid",V="warnings",W="errors",U=[$,W,V],X=({summary:e,__:t,selectedTags:s,setSelectedTags:i})=>(0,O.jsx)(F,{level:5,style:{margin:0,fontSize:"14px"},children:(0,O.jsx)(o.A,{style:{flexWrap:"wrap"},gap:"6",children:U.map(((r,n)=>(0,O.jsxs)(d.A.CheckableTag,{checked:null===s||void 0===s?void 0:s.includes(r),onChange:e=>((e,t)=>{const r=t?2===s.length?[]:[...s,e]:s.filter((t=>t!==e));i(r)})(r,e),className:w()(`${r} optimise__button`,{[`${r}_active`]:s.includes(r)}),children:[t(r===$?"Valid":r===V?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[r])||0]},r+n)))})}),Y=()=>{var e,t,s,l,o;const{__:d,_n:b}=(0,E.s9)(),U=(0,r.wA)(),{emailId:Y,projectId:Z}=(0,n.g)(),J=(0,C.hN)(),G=(0,T.QC)(),K=(0,L.fn)(),Q=(0,r.d4)(S.rd),ee=(0,z.rD)(),[te,se]=(0,N.ku)(),[ie,re]=(0,N.Ju)(),[ne,ae]=(0,N.Sr)(),{data:le,isSuccess:oe,refetch:de}=(0,k.fo)(+Z,{skip:!!D.EW.isPlugin||!+Z}),{limits:ce}=le&&!D.EW.isPlugin?le:{limits:{optimization_limit:0}},{optimization_limit:me}=ce,ue=me>0,[pe,he]=(0,i.useState)([]),[ge,_e]=(0,i.useState)([]),[ve,xe]=(0,i.useState)([]),[je,fe]=(0,i.useState)([]),[ye,Ae]=(0,i.useState)([]),[be,we]=(0,i.useState)([]),[Ne,Se]=(0,i.useState)(),[ke,Ie]=(0,i.useState)(0);(0,i.useEffect)((()=>{var e;oe&&(null===le||void 0===le||null===(e=le.counters)||void 0===e?void 0:e.optimization_counter)&&Ie(le.counters.optimization_counter)}),[oe,le]),(0,i.useEffect)((()=>{var e,t;Ne===B&&pe.links&&Ae(je.length>0?null===(e=pe.links)||void 0===e?void 0:e.filter((e=>je.includes(e.status))):pe.links);Ne===P&&ge.images&&we(je.length>0?null===(t=ge.images)||void 0===t?void 0:t.filter((e=>je.includes(e.status))):ge.images)}),[pe.links,ge.images,je,Ne]);const Ce=()=>{if(!Y)return void J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;const t=K.getValue(),s=(new DOMParser).parseFromString(t,"text/html"),i={},r={};s.querySelectorAll("a[href]").forEach(((e,t)=>{i[`link_${t}`]=e.getAttribute("href"),r[`link_${t}`]=e.innerText})),G.send({operation:"sandbox_set_attr_to_links"}),te({entity_id:Y,data:i}).then((({data:t,error:s})=>{if(s)(0,I.p6)({error:s},J);else if(null!==t&&void 0!==t&&t.result){let s=[...t.result];null===s||void 0===s||s.sort(((e,t)=>e.linkId-t.linkId));const i=e=>{var t,s,i,r;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(s=e.page)||void 0===s?void 0:s.secure)||void 0===t||t):"invalid"!==e.type)?$:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(i=null===(r=e.page)||void 0===r?void 0:r.secure)||void 0===i||i))&&"invalid"!==e.type?V:W};e={links:s.map((e=>({...e,text:r[e.linkId],status:i(e)}))),summary:{valid:s.filter((e=>i(e)===$)).length||0,warnings:s.filter((e=>i(e)===V)).length||0,errors:s.filter((e=>i(e)===W)).length||0}},he(e),(0,I.wB)(d("Links validation was successfully completed"),J),!D.EW.isPlugin&&de()}else t.statusCode>300||!t.success?(0,I.p6)({error:{data:t}},J):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!pe.links&&Le("")})).catch((e=>{(0,I.p6)({error:e},J)}))},Te=()=>{if(!Y)return void J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});const e=K.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let s={};t.querySelectorAll("img").forEach(((e,t)=>s[`image_${t}`]=e.src)),G.send({operation:"sandbox_set_attr_to_images"}),ie({entity_id:Y,data:s}).then((({data:e,error:t})=>{let s;if(t)(0,I.p6)({error:t},J);else if(null!==e&&void 0!==e&&e.result){let t=Object.values(e.result);t.sort(((e,t)=>e.imageId-t.imageId));let i=t.reduce(((e,t)=>e+Math.round(t.image.bytes/1024)),0);const r=e=>null!==e.statusCode&&e.statusCode<300?$:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?V:W;s={images:t.map((e=>({...e,status:r(e)})))||[],summary:{valid:t.filter((e=>r(e)===$)).length||0,warnings:t.filter((e=>r(e)===V)).length||0,errors:t.filter((e=>r(e)===W)).length||0},summaryTime:{value:(i>1200?i/1e3:i).toFixed(1),name:d(i>1200?"MB":"KB")}},s&&_e(s),(0,I.wB)(d("Images validation was successfully completed"),J),!D.EW.isPlugin&&de()}else{var i;e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},J):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===ge||void 0===ge||null===(i=ge.images)||void 0===i||!i.length)&&Le("")}})).catch((e=>{(0,I.p6)({error:e},J)}))},Ee=()=>{Y?ne({entity_id:Y,data:{html:K.getValue()}}).then((({data:e,error:t})=>{if(t)(0,I.p6)({error:t},J);else if(e&&e.success){const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort(((e,t)=>e.score-t.score)),xe({...e.result,report:t})),(0,I.wB)(d("Spam validation was successfully completed"),J),!D.EW.isPlugin&&de()}else e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},J):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}}),placement:"bottomRight"}),(null===ve||void 0===ve||!ve.length)&&Le("")})).catch((e=>{(0,I.p6)({error:e},J)})):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},Le=e=>{Se(e!==Ne?e:""),fe([])};let ze=null;return(0,i.useEffect)((()=>{ue&&ke>=+me&&J.error({message:d("The usage limit has been exceeded"),description:d("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[ke,me,d,J,ue]),(0,O.jsxs)("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize",children:[(0,O.jsxs)("div",{className:"optimise__couter-wrapper",children:[!D.EW.isPlugin&&(0,O.jsx)(c.Ay,{className:w()("optimise__counter-bar",{"optimise__counter-bar_full":ue&&ke>=+me}),size:"small",children:ke+" "+d("of")+" "+(ue?me:"\u221e")+" "+b("test","tests",me)+" "+d(" were used")}),ue&&(0,O.jsx)(a.N_,{style:{fontSize:14,textDecoration:"underline"},to:"/billing",children:d("Need more?")})]}),ee.optimizeLinksEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("Links validation")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Le(B),null!==pe&&void 0!==pe&&null!==(e=pe.links)&&void 0!==e&&e.length||Ne===B||Ce()},loading:se.isLoading,children:!se.isLoading&&(Ne===B?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{}))})})]}),Ne===B&&!(null===pe||void 0===pe||!pe.links)&&(0===(null===pe||void 0===pe||null===(e=pe.links)||void 0===e?void 0:e.length)?(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(h.A,{message:d("No links found."),type:"info"})}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(u.A,{style:{marginBottom:14},children:(0,O.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,O.jsx)(X,{__:d,summary:pe.summary,setSelectedTags:fe,selectedTags:je}),(0,O.jsx)(c.Ay,{loading:se.isLoading,onClick:Ce,icon:(0,O.jsx)(f.A,{}),children:d("Refresh")})]})}),(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{itemLayout:"horizontal",dataSource:ye,renderItem:(e,t)=>{var s;return(0,O.jsx)(g.A.Item,{style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{avatar:e.status===$?(0,O.jsx)(y.A,{className:$}):e.status===V?(0,O.jsx)(y.A,{className:V}):(0,O.jsx)(A.A,{className:W}),title:(0,O.jsx)(R,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,s=600>e.statusCode>399||!e.statusCode,void G.send({operation:D.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:s}});var t,s},children:""===e.url?d("empty link"):e.url}),description:(0,O.jsxs)(O.Fragment,{children:[!(null===(s=e.text)||void 0===s||!s.length)&&(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(M,{type:"secondary",children:e.text})}),e.page.title&&e.page.title,e.page.secure&&e.status===$&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,O.jsx)("span",{className:$,children:d("secure")})]}),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,O.jsx)(M,{type:"secondary",children:d("Failed to load")})]})]})})},t+"_"+e.id)}})})})]}))]}),ee.optimizeImagesEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("Images validation")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Le(P),null!==ge&&void 0!==ge&&null!==(e=ge.images)&&void 0!==e&&e.length||Ne===P||Te()},loading:re.isLoading,children:!re.isLoading&&(Ne===P?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{}))})})]}),Ne===P&&!(null===ge||void 0===ge||!ge.images)&&(0===(null===ge||void 0===ge||null===(t=ge.images)||void 0===t?void 0:t.length)?(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(h.A,{message:d("No images found."),type:"info"})}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(u.A,{style:{marginBottom:16},children:(0,O.jsx)(h.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:(0,O.jsxs)("div",{className:"optimise__summary",children:[(0,O.jsxs)("div",{children:[(0,O.jsxs)(F,{level:4,style:{marginBottom:"0"},children:[ge.images.length," "]}),(0,O.jsx)("span",{style:{fontSize:"12px"},children:d("images")})]}),(0,O.jsxs)("div",{children:[(0,O.jsxs)(F,{level:4,style:{marginBottom:"0"},children:[null===(s=ge.summaryTime)||void 0===s?void 0:s.value,null===(l=ge.summaryTime)||void 0===l?void 0:l.name]}),(0,O.jsx)("span",{style:{fontSize:"12px"},children:d("total size")})]}),(0,O.jsxs)("div",{children:[(0,O.jsx)(F,{level:4,style:{marginBottom:"0"},children:(Math.max(...ge.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+d("s")}),(0,O.jsx)("span",{style:{fontSize:"12px"},children:d("time to load")})]})]}),type:"warning"})}),(0,O.jsx)(u.A,{style:{marginBottom:12},children:(0,O.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,O.jsx)(X,{__:d,summary:ge.summary,setSelectedTags:fe,selectedTags:je}),(0,O.jsx)(c.Ay,{loading:re.isLoading,onClick:()=>Te(),icon:(0,O.jsx)(f.A,{}),children:d("Refresh")})]})}),(0,O.jsx)(u.A,{style:{marginBottom:12},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:be,renderItem:(e,t)=>(0,O.jsx)(g.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{className:w()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:(0,O.jsx)(_.A,{className:w()("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(ze);let s=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,i=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(s=document.createElement("div"),s.classList.add("img-preview"),i=document.createElement("div"),i.classList.add("img-preview-content"),s.append(i),document.querySelector(".email-pane__col_settings-inner").append(s)),i.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"!==s.style.opacity&&setTimeout((function(){s.style.opacity="1",s.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&&(ze=setTimeout((()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout((function(){e.remove()}),300)}),300))})()}),title:e.url?(0,O.jsx)(v.A,{placement:"top",title:e.message,children:(0,O.jsx)(R,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,s=600>e.statusCode>399||!e.statusCode,void G.send({operation:D.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:s}});var t,s},children:""===(null===e||void 0===e?void 0:e.url)?d("empty src"):e.url})}):e.message,description:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"image-size",children:[e.image.dimensions&&(0,O.jsxs)(O.Fragment,{children:[e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsxs)("span",{children:[Math.round(e.image.bytes/1024),d("kB")]}),(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsxs)("span",{children:[e.image.responseTime,d("ms")]}),(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsx)("span",{className:"image-size-format",children:e.image.contentType})]}),e.image.secure&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsx)("span",{className:$,children:d("secure")})]}),e.resolvedUrl&&!e.valid&&(0,O.jsx)(M,{type:"danger",children:d("not valid")})]})," ",!e.resolvedUrl&&!e.statusCode&&(0,O.jsx)(M,{type:"danger",children:d("Failed to load")})]})})},t)})})})]}))]}),ee.optimizeSpamAssassinEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("SpamAssassin")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:ae.isLoading,onClick:()=>{var e;Le(H),null!==(e=ve.report)&&void 0!==e&&e.length||Ee()},children:!ae.isLoading&&(Ne===H?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{}))})})]}),Ne===H&&!(null===(o=ve.report)||void 0===o||!o.length)&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(u.A,{style:{marginBottom:8},children:[(0,O.jsxs)("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam",children:[(0,O.jsxs)(F,{level:1,style:{margin:0},type:ve.spamScore<2||!ve.spamScore||ve.spamScore<=ve.baseSpamScore-1?"success":ve.spamScore<ve.baseSpamScore-1?"warning":"danger",children:[(0,O.jsx)("span",{style:{marginRight:"12px"},children:ve.spamScore||0}),(0,O.jsx)(M,{style:{marginRight:"12px",fontSize:"20px"},children:"Score"})]}),(0,O.jsx)(c.Ay,{icon:(0,O.jsx)(f.A,{}),loading:ae.isLoading,onClick:Ee,children:d("Refresh")})]}),ve.spamScore>ve.baseSpamScore-1&&(0,O.jsx)(M,{children:d("Lower scores are better. Aim for a score less than ")+(ve.baseSpamScore-1)+"."})]}),(0,O.jsx)(u.A,{style:{marginBottom:8},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{itemLayout:"horizontal",dataSource:ve.report,renderItem:e=>(0,O.jsx)(g.A.Item,{style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{title:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(M,{style:{fontSize:"20px"},children:e.score}),(0,O.jsx)("span",{style:{marginLeft:"12px"},children:e.description})]})})})})})})]})]}),ee.optimizeCheckCodeEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("Source code validation")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>Le(q),children:Ne===q?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{})})})]}),Ne===q&&(0,O.jsx)(O.Fragment,{children:null!==Q&&void 0!==Q&&Q.length?(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(u.A,{style:{marginBottom:8},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{itemLayout:"horizontal",dataSource:Q,renderItem:e=>(0,O.jsx)(g.A.Item,{style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{avatar:e.severity<6?(0,O.jsx)(A.A,{className:V}):(0,O.jsx)(A.A,{className:W}),title:(0,O.jsx)(O.Fragment,{children:(0,O.jsxs)(M,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};U((0,S.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error",children:["Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber]})}),description:(0,O.jsx)(M,{children:e.message})})})})})})}):(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(h.A,{message:d("No problems found."),type:"info"})})})]})]})}},72981:(e,t,s)=>{s.d(t,{A:()=>l});s(92810);var i=s(81e3),r=s(24293),n=s(79716),a=s(70082);const l=({small:e=!1,style:t,wrap:s=!1})=>{const l={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},o=(0,a.jsx)(n.A,{style:{fontSize:48},spin:!0});return(0,a.jsx)(i.A,{size:"large",style:l,wrap:s,children:(0,a.jsx)(r.A,{indicator:o})})}},53765:(e,t,s)=>{s.d(t,{A:()=>te});var i=s(92810),r=s(64617),n=s(29218),a=s(76662),l=s(66726),o=s(29234),d=s(81e3),c=s(43005),m=s(2018),u=s(7744),p=s(86889),h=s(73035),g=s(85677),_=s(38587),v=s(45934),x=s(23287),j=s(38883),f=s.n(j),y=s(84e3),A=s(79060),b=s(4800),w=s(79304),N=s(94822),S=s(8375),k=s(32293),I=s(35285),C=s(64936),T=s(36404),E=s(85163),L=s(70082);const z=({title:e})=>{const{__:t}=(0,x.s9)();let s=(0,v.wA)();const{projectId:n}=(0,r.g)(),a=(0,v.d4)(C.cL),l=(0,v.d4)(T.yN);let o=[{label:t("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:(0,L.jsx)(S.A,{style:{fontSize:"16px"}}),onClick:()=>{s((0,C.qf)(E.lx.EDIT_PROJECT_MODAL))}},{label:(0,L.jsx)(N.N_,{to:"/projects",children:t("List of projects")}),key:"List of projects",icon:(0,L.jsx)(k.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}];const d=(null===l||void 0===l?void 0:l.title)||e;return(0,i.useEffect)((()=>{if(n){const e=document.querySelector(".header__project");null===e||void 0===e||e.setAttribute("data-project-id",n)}}),[n]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b.A,{menu:{items:o},arrow:"true",overlayStyle:{minWidth:0},getPopupContainer:()=>document.querySelector("header"),children:(0,L.jsxs)(N.N_,{to:"/projects/"+n+"/emails?page=1",className:"header__project",children:[(0,L.jsxs)(w.A,{size:28,style:{backgroundColor:"#777",marginRight:8,fontWeight:700,fontSize:18,textTransform:"uppercase"},children:[null===d||void 0===d?void 0:d[0],null!==d&&void 0!==d&&d.split(" ")[1]?d.split(" ")[1][0]:""]}),d]})}),(0,L.jsx)(I.A,{isModalVisible:a===E.lx.EDIT_PROJECT_MODAL})]})};var D=s(97562),O=s(57918),M=s(47358),R=s(7760),F=s(8493),B=s(64037),P=s(18777),H=s(86739),q=s(32269),$=s(45695),V=s(69106);const W=[50,50],U=[420,420],X=[45,10,45],Y=[0,100,0],Z=[50,420,50],J="all 0.5s ease 0s",{Paragraph:G}=a.A,K="code",Q="view",ee=({email:e,viewMode:t="view",isLoggedIn:s})=>{const{__:a,_x:j}=(0,x.s9)(),b=(0,v.wA)(),w=(0,v.d4)(M.Fv),{emailId:N,blockId:S}=(0,r.g)(),k=(0,$.QC)(),[I,C]=(0,i.useState)(t),[T,ee]=(0,i.useState)(I===Q?Y:W),[te,se]=(0,i.useState)(I===Q?Z:U),[ie,re]=(0,i.useState)([]),[ne,ae]=(0,i.useState)(!1),[le,oe]=(0,i.useState)(!1),de=(0,i.useRef)(null),ce=(0,i.useRef)(),me=(0,i.useRef)(),ue=(0,i.useRef)(),pe=N||S,{data:he=[],refetch:ge}=(0,P.Cf)(pe);(0,i.useEffect)((()=>{pe&&ge(pe)}),[I,pe,ge]),(0,V.f)(e);(0,B.A)((e=>{const t=e.data.operation,s=document.querySelector(".preview-mode__pane_editor")?document.getElementById("pane-content-iframe"):document.querySelector(".preview-mode__row > .preview-mode__col_preview");t===E.Ru.APPLICATION_SCROLL_TO&&setTimeout((()=>{s.scrollTo({top:e.data.settings.value,behavior:"smooth"})}),100),t===E.Ru.APPLICATION_IFRAME_SET_HEIGHT&&(document.querySelector(".preview-mode__iframe").style.height=e.data.settings.height+"px")}));const _e=e=>{e.target.classList.contains("preview-mode__resizer")&&(ce.current&&(ce.current.style.transition="none"),me.current&&(me.current.style.transition="none"),ue.current&&(ue.current.style.transition="none"))},ve=()=>{const e=I===Q?J:"none";ce.current.style.transition!==J&&(ce.current&&(ce.current.style.transition=e),me.current&&(me.current.style.transition=e),ue.current&&(ue.current.style.transition=e))};(0,i.useEffect)((()=>(document.addEventListener("mousedown",_e),document.addEventListener("mouseup",ve),()=>{document.removeEventListener("mousedown",_e),document.removeEventListener("mouseup",ve)}))),(0,i.useEffect)((()=>{const e=k.onInit((()=>{k.send({operation:E.Ru.SANDBOX_LOCK_EDIT,data:t===Q}),k.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:ne})}));return()=>e.dispose()}),[t,I,ne,k]),(0,i.useEffect)((()=>{ee(I===Q?Y:W),se(I===Q?Z:U)}),[I]);const xe=({key:e,domEvent:t})=>{switch(t.preventDefault(),ce.current.style.transition=J,me.current.style.transition=J,ue.current.style.transition=J,de.current.resize(),e){case"Desktop":default:ee(I===Q?Y:W);break;case"Mobile":ee(X)}setTimeout((()=>{k.send({operation:E.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:ce.current.getBoundingClientRect().width}}),de.current.resize()}),550)};(0,i.useEffect)((()=>{const e=new q.jG;if(ie.length<2){var t,s;const i=null===(t=ce.current)||void 0===t?void 0:t.getBoundingClientRect(),r=null===(s=document.getElementById("pane-content-iframe"))||void 0===s?void 0:s.getBoundingClientRect(),n=setInterval(l,50);re((e=>[...e,n]));const a=t=>{e.addDisposable(k.onInit((()=>{k.send({operation:E.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:t})})))};function l(){a({iframeOffsetTop:i.top-r.top,scrollTop:r.top?-r.top:0,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,mode:K})}}return e.addDispose((()=>clearInterval(ie[ie.length-1]))),()=>e.dispose()}),[ie,k]),(0,i.useEffect)((()=>{if(I===K){const e=window.localStorage.getItem(E.V0.em_code_mode_pane_sizes);e&&ee(JSON.parse(e))}}),[I]);const je=e=>{if(I===K&&window.localStorage.setItem(E.V0.em_code_mode_pane_sizes,JSON.stringify(e)),I===Q){const t=(e[2]+e[0])/2;ee([t,e[1],t])}else ee(e);k.send({operation:E.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:ce.current.getBoundingClientRect().width}}),de.current.resize()},fe=()=>{de.current.resize()},ye=(0,i.useCallback)((()=>{e.hasOwnProperty("type")?b((0,R.vs)()):b((0,M.vs)())}),[b,e]);let Ae;const be=()=>{var e,t;const s=null===(e=ce.current)||void 0===e?void 0:e.getBoundingClientRect(),i=null===(t=document.getElementById("pane-content-iframe"))||void 0===t?void 0:t.getBoundingClientRect();Ae&&window.clearTimeout(Ae),Ae=window.setTimeout((function(){k.send({operation:E.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:s.top-i.top,scrollTop:document.getElementById("pane-content-iframe").scrollTop,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,CODE:K}})}),100)};(0,i.useEffect)((()=>(document.addEventListener("scroll",be,!0),()=>{document.removeEventListener("scroll",be,!0)})));const we=()=>{ae((e=>!e)),k.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:!ne})},Ne=()=>{C(le?Q:K),oe((e=>!e))};let Se=[{key:E.yI,children:(0,L.jsx)("div",{className:"preview-mode__collapse-wrapper"})},{label:(0,L.jsxs)(l.A,{placement:"right",title:j("Discuss","tab"),children:[(0,L.jsx)(h.A,{}),!!he.length&&(0,L.jsx)("span",{className:"email-pane__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]}),key:E.hc,className:"preview-mode__tab-discuss em-analytics__email-tab-discuss",style:{overflow:"hidden"},children:(0,L.jsx)("div",{className:"email-pane__collapse-wrapper",children:pe?(0,L.jsx)("div",{className:"ant-tabs-content discuss-wrapper",children:(0,L.jsx)(D.A,{email:e,comments:he,subjectId:pe,isLoggedIn:!0})}):(0,L.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,L.jsx)(o.A,{description:a("Save the block before commenting."),type:"info",showIcon:!0}):(0,L.jsx)(o.A,{description:a("Save the email before commenting."),type:"info",showIcon:!0})})})}];return(0,L.jsxs)("div",{className:f()("preview-mode",{"preview-mode_view":I===Q}),children:[(0,L.jsx)("div",{style:{display:"none"},children:(0,L.jsx)(y.A,{email:e,readOnly:t===Q})}),(0,L.jsxs)("div",{className:"preview-mode__header",children:[(0,L.jsxs)("div",{className:"preview-mode__header__title",children:[(0,L.jsx)(z,{style:{float:"left",cursor:"none"},title:null===e||void 0===e?void 0:e.project_title}),(0,L.jsx)(G,{editable:w&&{icon:(0,L.jsx)(g.A,{className:"email-page-header__icon-edit"}),onChange:t=>{e.isNew?b((0,F.BQ)(t)):b(H.GY.util.updateQueryData("getEmail",e.id,(e=>{Object.assign(e,{title:t})})))}},children:null===e.title?a("New email title"):e.title})]}),(0,L.jsx)("div",{children:(0,L.jsx)("div",{className:"preview-mode__buttons",children:(0,L.jsx)(d.A,{size:10,children:(s||w)&&(0,L.jsx)(l.A,{placement:"bottom",title:a("Close"),children:(0,L.jsx)(c.Ay,{className:"preview-mode__close-btn",onClick:w?ye:()=>{window.close(),window.location.href="/"},children:(0,L.jsx)(_.A,{})})})})})})]}),t!==K&&(0,L.jsx)("div",{className:"preview-mode__wrapper",children:(0,L.jsxs)(m.A,{className:"preview-mode__row",children:[(0,L.jsx)(u.A,{xl:{span:ne?6:0},lg:{span:ne?6:0},md:{span:ne?10:0},sm:{span:0},xs:{span:0},className:f()("preview-mode__col preview-mode__col_settings comment-block",{"preview-mode__col_settings-collapsed":!ne,"preview-mode__col_code-mode":I===K}),children:ne&&(0,L.jsx)(p.A,{className:"preview-mode__col_settings-inner",size:"middle",animated:{inkBar:!1,tabPane:!0},activeKey:E.hc,onTabClick:we,renderTabBar:(e,t)=>(0,L.jsx)(t,{className:"preview-mode__tab-bar",...e}),tabPosition:"left",items:Se})}),I===K&&(0,L.jsxs)(u.A,{xl:{span:ne?18:24},lg:{span:ne?18:24},md:{span:ne?14:24},sm:{span:24},xs:{span:24},className:f()("preview-mode__col preview-mode__col_preview preview-mode__code-mode",{"preview-mode__col_preview-collapsed":!ne}),children:[!ne&&(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu",children:(0,L.jsx)("div",{className:"preview-mode__comments-icon-wrapper",onClick:we,children:(0,L.jsxs)(l.A,{placement:"right",title:j("Discuss","tab"),children:[(0,L.jsx)(h.A,{style:{fontSize:"20px"}}),!!he.length&&(0,L.jsx)("span",{className:"preview-mode__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]})})}),(0,L.jsxs)(n.A,{className:"preview-mode__panes",direction:"horizontal",gutterSize:0,snapOffset:0,sizes:T,minSize:te,gutter:()=>(0,q.Dx)("preview-mode__panes-resizer"),onDragEnd:je,onDrag:fe,children:[(0,L.jsx)("div",{className:"preview-mode__pane preview-mode__pane_editor",children:(0,L.jsx)("div",{className:"preview-mode__pane-content",children:(0,L.jsx)(y.A,{email:e,readOnly:t===Q})})}),(0,L.jsx)("div",{className:"preview-mode__pane preview-mode__pane_main",ref:ce,children:(0,L.jsxs)("div",{className:"preview-mode__pane-content",id:"pane-content-iframe",children:[(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),(0,L.jsx)(A.A,{ref:de,email:e}),(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]})})]}),(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right",children:(0,L.jsx)(O.A,{setSizes:xe,sizes:[T[1]],codeModeShow:Ne,codeModeIsVisible:le,email:e})})]}),I===Q&&(0,L.jsx)(u.A,{xl:{span:ne?18:24},lg:{span:ne?18:24},md:{span:ne?14:24},sm:{span:24},xs:{span:24},className:f()("preview-mode__col preview-mode__col_preview",{"preview-mode__col_preview-collapsed":!ne}),children:(0,L.jsxs)(n.A,{className:"preview-mode__content",sizes:T,minSize:Z,snapOffset:0,gutter:()=>(0,q.Dx)("preview-mode__resizer"),onDragEnd:je,onDrag:fe,expandToMin:!0,gutterAlign:"center",dragInterval:1,children:[(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu",ref:me,children:!ne&&(0,L.jsx)("div",{className:"element-preview-menu",style:{width:"100%"},children:(0,L.jsx)("div",{className:"preview-mode__comments-icon-wrapper",onClick:we,children:(0,L.jsxs)(l.A,{placement:"right",title:j("Discuss","tab"),children:[(0,L.jsx)(h.A,{style:{fontSize:"20px"}}),!!he.length&&(0,L.jsx)("span",{className:"preview-mode__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]})})})}),(0,L.jsxs)("div",{className:"preview-mode__content-col preview-mode__pane-content preview-mode__content-col_main",ref:ce,id:"pane-content-iframe",children:[(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),(0,L.jsx)(A.A,{ref:de,className:"preview-mode__iframe",email:e,handlerSendPosition:be}),(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right",ref:ue,children:(0,L.jsx)(O.A,{setSizes:xe,sizes:[T[1]],codeModeShow:Ne,codeModeIsVisible:le,email:e})})]})})]})}),(0,L.jsx)("div",{className:"preview-mode__footer"})]})};ee.defaultProps={viewMode:K,sendOptionsHandler:()=>{}};const te=ee},19817:(e,t,s)=>{s.d(t,{A:()=>h});var i=s(92810),r=s(71157),n=s(64617),a=s(94822),l=s(39990),o=s(32269),d=s(90070),c=s(47381),m=s(85163),u=s(70082);const p="emailmaker.ru",h=({children:e})=>{const t=(0,n.zy)(),s=(0,r.hN)(),h=(0,d.p6)(),[g,_]=(0,a.ok)(),v=(0,c.u)(),[x,{isError:j,isSuccess:f,error:y,data:A}]=(0,l.i2)(),{isError:b,isUninitialized:w,isLoading:N,isSuccess:S,error:k,data:I,refetch:C}=(0,l.CR)("",{skip:m.EW.isPlugin||!h.get(m.A9.em_token)}),T=(0,i.useMemo)((()=>({email:g.get("email"),hash:g.get("hash"),event:"confirmation"===g.get("event")})),[g]);if((0,i.useEffect)((()=>{j?(0,o.p6)({error:y},s):f&&(v({event:"email_confirmation",user_email:null===A||void 0===A?void 0:A.email}),(0,o.wB)(A.message,s),I&&C())}),[A,y,j,f,s,I,C,v]),(0,i.useEffect)((()=>{!(T.email&&T.hash&&T.event)||!1!==(null===I||void 0===I?void 0:I.email_confirmation)&&h.get(m.A9.em_token)||A||x({hash:T.hash,email:T.email,event:T.event}).catch((e=>{console.warn("e",e)})).finally((()=>_("")))}),[T,x,I,h,_,A]),(0,i.useEffect)((()=>{b&&k&&((0,o.p6)({error:k},s),(0,o.Id)(h))}),[I,b,k,s,h]),m.EW.isPlugin)return e;if(!m.EW.isPlugin&&!h.get(m.A9.em_token)&&!t.pathname.includes("auth"))return(0,u.jsx)(n.C5,{to:"/auth",state:{from:t}});if((w||N)&&!t.pathname.includes("auth"))return(0,u.jsx)(u.Fragment,{});if(b&&!t.pathname.includes("auth"))return(0,u.jsx)(n.C5,{to:"/auth",state:{from:t}});if(S){const{id:s,email:i,name:r,locale:a,carrotquest_hash:l,ducalis_hash:o,email_subscription_consent:d,last_used_project:c}=I;return h.set(m.A9.em_id,s,{domain:p}),h.set(m.A9.em_email,i,{domain:p}),h.set(m.A9.em_name,r,{domain:p}),h.set(m.A9.em_locale,a,{domain:p}),h.set(m.A9.em_carrotquest_hash,l,{domain:p}),h.set(m.A9.em_ducalis_hash,o,{domain:p}),h.set(m.A9.em_email_subscription_consent,d,{domain:p}),c&&"/"===t.pathname?(0,u.jsx)(n.C5,{to:`/projects/${c}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},19263:(e,t,s)=>{s.d(t,{A:()=>k});var i=s(92810),r=s(41919),n=s(37005),a=s(66726),l=s(32085),o=s(32293),d=s(64617),c=s(94822),m=s(45934),u=s(23287),p=s(29067),h=s(30961),g=s(20757),_=s(32398),v=s(34524),x=s(7760),j=s(85163),f=s(22197),y=s(90070),A=s(32269),b=s(93563),w=s(64936),N=s(70082);const{Content:S}=r.A,k=()=>{var e,t,s;const{__:k}=(0,u.s9)(),I=(0,m.wA)(),C=(0,y.p6)(),T=C.get(j.A9.em_elements_view),{data:E}=(0,d.KC)(),[L]=(0,c.ok)(),z=(0,m.d4)(x.b9),D=(0,m.d4)(w.o8),O=L.get("folder"),M=+L.get("tag"),R=(0,A.HT)(E,j.YY),[F,B]=(0,i.useState)(O||(M?null:j.y2)),[P,H]=(0,i.useState)(M||null),[q,$]=(0,i.useState)(T||j.Y$),{data:V,refetch:W}=(0,b.Jz)({parent:null===(e=E.blockfolder)||void 0===e?void 0:e[0]},{skip:!(null!==(t=E.blockfolder)&&void 0!==t&&t[0])});(0,i.useEffect)((()=>{I((0,w.sB)(V||[]))}),[I,V]);const U=(e=!1,t=null)=>{H(t),B(e),I((0,x.om)({...z,tags:t?[t]:[],folderTag:e}))};(0,i.useEffect)((()=>{var e;M&&null!==R&&void 0!==R&&R.find((e=>e.id===M))&&(null===z||void 0===z||null===(e=z.tags)||void 0===e?void 0:e[0])!==P&&I((0,x.om)({...z,tags:[M],folderTag:F}))}),[R,M,P,I,z,F]);(0,f.A)(k("Blocks")+" "+E.title),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const X=(0,N.jsx)(h.A,{isBlocks:!0}),Y=(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(n.A,{defaultValue:q,onChange:e=>{$(e),I((0,v.NK)(e)),C.set(j.A9.em_elements_view,e)},value:q,options:[{value:j.Y$,label:(0,N.jsx)(a.A,{title:k("Cards view"),placement:"top",children:(0,N.jsx)(l.A,{})})},{value:j.rl,label:(0,N.jsx)(a.A,{title:k("Table view"),placement:"top",children:(0,N.jsx)(o.A,{})})}]},"Switch radio")});return(0,N.jsxs)(r.A,{className:"project-blocks-page",children:[(0,N.jsx)(g.A,{leftBlock:X,rightBlock:Y}),(0,N.jsx)(S,{className:"project-blocks-page__container",children:(0,N.jsxs)("div",{className:"project-blocks-page__content container",children:[(0,N.jsx)("div",{className:"project-blocks-page__menu-wrapper",children:(0,N.jsx)(_.A,{currentFolderId:F,setCurrentFolderId:B,activeTagId:P,setActiveTagHandler:U,projectTags:R,folderTaxonomy:"blockfolder"})}),(0,N.jsx)(p.A,{projectId:E.id,projectEmailsCounter:+(null===E||void 0===E||null===(s=E.counters)||void 0===s?void 0:s.blocks_counter),emailsView:q,currentFolderId:F,foldersList:D,refetchProjectFolders:D.length?W:()=>{},projectTags:R,activeTagId:P,setActiveTagHandler:U})]})})]})}},6099:(e,t,s)=>{s.d(t,{A:()=>_});var i=s(92810),r=s(64617),n=s(45934),a=s(41919),l=s(25072),o=s(43005),d=s(23287),c=s(84568),m=s(36404),u=s(72981),p=s(32269),h=s(70082);const{Content:g}=a.A,_=()=>{var e;const{__:t}=(0,d.s9)(),{projectId:s}=(0,r.g)();let _=(0,r.Zp)(),v=(0,r.zy)();const x=(0,n.wA)(),j=(0,c.fo)(+s,{skip:!s}),{isLoading:f,isError:y,error:A,isSuccess:b,data:w}=j;return(0,i.useEffect)((()=>{b&&(null===w||void 0===w?void 0:w.id)!==s&&x((0,m.od)(w))}),[b,w,x,s]),(0,i.useEffect)((()=>{b&&s&&v.pathname.endsWith(s)&&_(`${v.pathname}/emails`)}),[b,v,_,s]),(0,h.jsxs)(h.Fragment,{children:[f&&(0,h.jsx)(u.A,{}),y&&A&&(0,h.jsx)(a.A,{className:"project-outlet",children:(0,h.jsx)(g,{className:"project-outlet__container container",children:(0,h.jsx)(l.Ay,{status:A.status,title:A.status,subTitle:null===(e=A.data)||void 0===e?void 0:e.message,extra:(0,h.jsx)(o.Ay,{type:"primary",onClick:()=>(0,p.XZ)(_,"/projects"),children:t("Back To Projects")})})})}),b&&(0,h.jsx)(r.sv,{context:{...j}})]})}},44338:(e,t,s)=>{s.d(t,{A:()=>V});var i=s(92810),r=s(41919),n=s(37005),a=s(66726),l=s(43005),o=s(71157),d=s(32085),c=s(32293),m=s(3625),u=s(52360),p=s(64617),h=s(94822),g=s(45934),_=s(23287),v=s(44335),x=s(29718),j=s(30961),f=s(28288),y=s(72981),A=s(32398),b=s(20757),w=s(47358),N=s(94925),S=s(86286),k=s(64936),I=s(65983),C=s(39990),T=s(46312),E=s(86739),L=s(63531),z=s(93563),D=s(85163),O=s(22197),M=s(14598),R=s(58689),F=s(47381),B=s(32269),P=s(90070),H=s(7205),q=s(70082);const{Content:$}=r.A,V=()=>{var e;const{__:t,_n:s}=(0,_.s9)(),V=(0,g.wA)(),W=(0,p.Zp)(),U=(0,P.p6)(),X=(0,o.hN)();let Y=(0,p.zy)();const Z=(0,g.d4)(I.CT),J=(0,g.d4)(S.C1),G=(0,g.d4)(w.cL),K=(0,g.d4)(k.o8),Q=(0,g.d4)(k.uM),[ee]=(0,C.on)(),[te]=(0,E.Kh)(),[se]=(0,L.dS)(),[ie]=(0,T.mI)(),[re]=(0,h.ok)(),{data:ne}=(0,p.KC)(),ae=(0,F.u)(),[le,oe]=(0,i.useState)(!1),de=re.get("folder"),ce=(0,B.HT)(ne,D.zh),{data:me,refetch:ue}=(0,z.Jz)({parent:null===ne||void 0===ne?void 0:ne.folder[0]},{skip:!(null!==ne&&void 0!==ne&&ne.folder[0])}),[pe,he]=(0,i.useState)(de||(Q?null:D.y2));(0,i.useEffect)((()=>{V((0,k.sB)(me||[]))}),[V,me]);const[ge,_e]=(0,i.useState)(U.get(D.A9.em_elements_view)||D.Y$);(0,O.A)(t("Emails")+" "+ne.title),(0,i.useEffect)((()=>{(null===J||void 0===J?void 0:J.last_used_project)!==ne.id&&V(C.Q2.endpoints.editMe.initiate({last_used_project:ne.id}))}),[V,ne.id,null===J||void 0===J?void 0:J.last_used_project]);const[ve,xe]=(0,i.useState)(null);const je=async e=>{if(1===e.length){const t=e[0];try{oe(!0);const e=await(0,M.q2)(t,(async(e,t)=>{let s;if("string"===typeof e)try{var i;e=(0,H.A)(e),s=null===(i=await ie({url:e}))||void 0===i?void 0:i.data}catch(l){return e}else s=e;if(s){if(t.split(".").length<2){const e=v.extension(s.type);e&&(t=`${t}.${e}`)}const e=new File([s],t.toLowerCase()),i=await se({user_id:J.id,folder:ne.id,file:e});var r,n,a;if(!i.error)if(400!==(null===(r=i.data.data)||void 0===r?void 0:r.status))return null===(n=i.data)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.file_url}return"string"===typeof e?e:""})),[s]=(0,R.Ay)(t.name),i=(0,B.ez)(e)||s||"";return te({title:i,project:ne.id,subject:i,description:"",html:e,parent_email:D.iU,folder:de!==D.y2?[+de]:[]}).then((e=>{e&&(e.error?X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}):(me&&ue(),W(`/projects/${ne.id}/emails/${e.data.id}`),ae({event:"upload_file",action:"import_email"})))})).finally((()=>oe(!1)))}catch(i){oe(!1);const e=i instanceof Error?i.message:i;X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),placement:"bottomRight"})}}else{const r=[];oe(!0);for(let s=0;s<e.length;s++){let n=e[s];const a=await(0,M.q2)(n,(async(e,t)=>{let s;if("string"===typeof e)try{var r;e=(0,H.A)(e),s=null===(r=await ie({url:e}))||void 0===r?void 0:r.data}catch(i){return e}else s=e;if(t.split(".").length<2){const e=v.extension(s.type);e&&(t=`${t}.${e}`)}const n=new File([s],t.toLowerCase()),a=await se({user_id:J.id,folder:ne.id,file:n});var l,o,d;if(!a.error&&400!==(null===(l=a.data.data)||void 0===l?void 0:l.status))return null===(o=a.data)||void 0===o||null===(d=o[0])||void 0===d?void 0:d.file_url;return"string"===typeof e?e:""})),[l]=(0,R.Ay)(n.name),o=(0,B.ez)(a)||l||"",d=te({title:o,project:ne.id,subject:o,description:"",html:a,parent_email:D.iU,folder:de!==D.y2?[+de]:[]}).then((e=>{if(e)return e.error?(X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}),null):(X.success({message:t("The email \u201c")+e.data.title+t("\u201d was successfully imported."),placement:"bottomRight"}),e.data)})).catch((e=>{const t=e instanceof Error?e.message:e;return X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:t}}),placement:"bottomRight"}),null}));r.push(d)}let n=await Promise.all(r);oe(!1),n=n.filter((e=>!!e)),n.length&&X.success({message:n.length+s(" email was"," emails were",n.length)+t(" successfully imported."),placement:"bottomRight"}),ve&&ve.refetch()}},[fe,ye]=(0,i.useState)(!1);(0,i.useEffect)((()=>{!fe&&J.counters.emails_counter<3&&(ee(),ye(!0))}),[ee,J.counters.emails_counter,fe]),(0,i.useEffect)((()=>{document.body.classList.remove("editor"),U.remove(D.A9.em_folder)}),[V,U]);const Ae=(e=!1,t=null)=>{V((0,k.Cj)(t)),he(e),V((0,I.om)({...Z,tags:t?[t]:[],folderTag:e}))},be=(0,q.jsx)(j.A,{isBlocks:!1}),we=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(n.A,{defaultValue:ge,onChange:e=>{U.set(D.A9.em_elements_view,e),_e(e),V((0,N.NK)(e))},value:ge,options:[{value:D.Y$,label:(0,q.jsx)(a.A,{title:t("Cards view"),placement:"top",children:(0,q.jsx)(d.A,{})})},{value:D.rl,label:(0,q.jsx)(a.A,{title:t("Table view"),placement:"top",children:(0,q.jsx)(c.A,{})})}]},"Switch radio"),(0,q.jsx)(a.A,{title:t("Available formats: HTML, EML, ZIP"),placement:"top",children:(0,q.jsx)(l.Ay,{className:"em-analytics__project-page__import",type:"default",icon:(0,q.jsx)(m.A,{}),onClick:()=>{ae({event:"click",action:"import_email"}),(0,M.QM)("application/zip, message/rfc822, text/html",je)},children:t("Import email")},"Import email from file")},"Import email from file tooltip"),(0,q.jsx)(l.Ay,{className:"em-analytics__email-create",type:"primary",icon:(0,q.jsx)(u.A,{}),onClick:()=>{V((0,I.om)({tags:[]})),U.set(D.A9.em_folder,"deleted"===de?D.y2:de),(0,B.XZ)(W,`${Y.pathname}/create/`),ae({event:"click",action:"create_new_email",description:"Go to the email template selection"})},children:t("Create a new email")},"Create new email")]});return(0,q.jsxs)(r.A,{className:"project-page",children:[(0,q.jsx)(b.A,{leftBlock:be,rightBlock:we}),(0,q.jsx)($,{className:"project-page__container",children:(0,q.jsxs)("div",{className:"project-page__content container",children:[(0,q.jsx)("div",{className:"project-page__menu-wrapper",children:(0,q.jsx)(A.A,{currentFolderId:pe,setCurrentFolderId:he,activeTagId:Q,setActiveTagHandler:Ae,projectTags:ce,folderTaxonomy:"folder"})}),(0,q.jsx)(x.A,{projectId:ne.id,projectEmailsCounter:+(null===ne||void 0===ne||null===(e=ne.counters)||void 0===e?void 0:e.emails_counter),emailsView:ge,currentFolderId:pe,foldersList:K,refetchProjectFolders:K.length?ue:()=>{},projectTags:ce,activeTagId:Q,setActiveTagHandler:Ae,registerFunction:xe})]})}),le&&(0,q.jsx)(y.A,{wrap:!0,style:{position:"fixed",width:"100%",height:"100%",top:0,left:0}}),(0,q.jsx)(f.A,{isModalVisible:G===D.lx.ADD_NEW_EMAIL_MODAL})]})}},24420:(e,t,s)=>{s.d(t,{A:()=>M});var i=s(92810),r=s(41919),n=s(43005),a=s(45934),l=s(23287),o=s(68919),d=s(33206),c=s(4800),m=s(49246),u=s(29234),p=s(21349),h=s(71157),g=s(9452),_=s(22339),v=s(8375),x=s(45130),j=s(8114),f=s(74267),y=s(64617),A=s(94822),b=s(35285),w=s(84568),N=s(64936),S=s(32269),k=s(85163),I=s(70082);const C=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/emails?page=1`,T=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/members`,E=()=>{const{__:e,_x:t}=(0,l.s9)();let s=(0,a.d4)(N.vW),r=(0,y.zy)(),n=(0,a.wA)(),o=(0,a.d4)(N.cL);const{modal:E}=d.A.useApp(),L=(0,h.hN)(),{confirm:z}=E,D=(0,a.Pj)(),O=s=>{z({maskClosable:!0,centered:!0,title:t("Are you sure to delete \u201c","project")+s.title+e("\u201d project?"),icon:(0,I.jsx)(g.A,{}),okText:e("Yes"),cancelText:e("No"),onOk:()=>(t=>D.dispatch(w.Nq.endpoints.deleteProject.initiate(t.id)).then((t=>{t.error?(0,S.p6)(t,L):t.data&&(0,S.wB)(e("The project \u201c")+t.data.title+e("\u201d was successfully removed."),L)})))(s)})},[M,R]=(0,i.useState)({page:1}),{isLoading:F,isSuccess:B,isError:P,isFetching:H,data:q=[]}=(0,w.su)(M),[$,V]=(0,i.useState)(null),W=[{width:"35%",title:e("Project"),dataIndex:"title",render:(e,t,s)=>(0,I.jsx)(A.N_,{to:C(r,t),children:e})},{width:"16%",title:e("Owner"),dataIndex:["members","owner","nickname"],render:(e,t,s)=>e||t.members.owner.user_email},{width:"12%",title:t("Created","block"),dataIndex:"date",render:(t,s,i)=>(0,S.Yq)((0,f.A)(t),e),sorter:!0,sortOrder:(0,S.Np)(M.order)},{width:"10%",title:e("Emails"),dataIndex:"emails",sorter:!0,render:(e,t,s)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"10%",title:e("Blocks"),dataIndex:"blocks",render:(e,t,s)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(t,s)=>{let i=[];return i.push({label:(0,I.jsx)(A.N_,{to:C(r,s),children:e("Open")}),key:"Enter",icon:(0,I.jsx)(_.A,{style:{fontSize:"16px"}}),className:"em-analytics__open"},{label:e("Settings"),key:"Edit",icon:(0,I.jsx)(v.A,{style:{fontSize:"16px"}}),className:"em-analytics__edit",onClick:()=>(V(s),void n((0,N.qf)(k.lx.EDIT_PROJECT_MODAL)))},{label:(0,I.jsx)(A.N_,{to:T(r,s),children:e("Members")}),key:"Members",icon:(0,I.jsx)(x.A,{style:{fontSize:"16px"}}),className:"em-analytics__members"},{label:e("Remove"),key:"Remove",icon:(0,I.jsx)(g.A,{style:{fontSize:"16px"}}),className:"em-analytics__remove",style:{color:"#ff4d4f"},onClick:()=>O(s)}),(0,I.jsx)(c.A,{arrow:"true",placement:"bottom",menu:{items:i},trigger:["hover"],children:(0,I.jsx)("span",{className:"projects-table__actions",children:(0,I.jsx)(j.A,{})})})}}];return(0,I.jsxs)("div",{className:"container",children:[F&&(0,I.jsx)(m.A,{active:!0}),P&&(0,I.jsx)(u.A,{message:e("Error"),description:e("Error when receiving data. Try again (reload page) or contact support."),type:"error",showIcon:!0}),B&&0===q.length&&(0,I.jsx)(u.A,{message:e("You don't have any projects yet."),description:e("Click the Add a new project button to add your first project."),type:"info",showIcon:!0}),B&&q.length>0&&(0,I.jsx)(p.A,{rowKey:e=>e.id,dataSource:q,bordered:!0,columns:W,loading:H,onChange:(e,t,{order:s,field:i},{action:r})=>{"sort"===r&&R(s?{page:1,order:(0,S.gq)(s),orderby:i}:{page:1})},showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomCenter"],current:M.page,total:s,onChange:(e,t)=>{R({page:e})}},className:"projects-table"}),(0,I.jsx)(b.A,{isModalVisible:o===k.lx.EDIT_PROJECT_MODAL,selectedProject:$})]})};var L=s(20757),z=s(47381),D=s(22197);const{Content:O}=r.A,M=()=>{const{__:e}=(0,l.s9)(),t=(0,a.d4)(N.cL),s=(0,a.wA)(),d=(0,z.u)();(0,D.A)(e("Projects")),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const c=(0,I.jsx)("div",{className:"ant-page-header-heading-title",children:e("Projects")}),m=(0,I.jsx)(n.Ay,{className:"em-analytics__add-project",type:"primary",onClick:()=>{d({event:"open_modal",action:"create_new_project"}),s((0,N.qf)(k.lx.ADD_NEW_PROJECT_MODAL))},children:e("Add a new project")},"Add a new project");return(0,I.jsxs)(r.A,{className:"projects-page",children:[(0,I.jsx)(L.A,{leftBlock:c,rightBlock:m}),(0,I.jsxs)(O,{className:"projects-page__container",children:[(0,I.jsx)(E,{}),(0,I.jsx)(o.A,{isModalVisible:t===k.lx.ADD_NEW_PROJECT_MODAL})]})]})}},36852:(e,t,s)=>{s.d(t,{A:()=>N});var i=s(92810),r=s(59297),n=s(76662),a=s(12280),l=s(55039),o=s(43005),d=s(71157),c=s(9588),m=s(82013),u=s(48236),p=s(64617),h=s(94822),g=s(38883),_=s.n(g),v=s(23287),x=s(65119),j=s(85163),f=s(47381),y=s(70082);const{Title:A,Text:b}=n.A,w=({className:e})=>{const{__:t}=(0,v.s9)();let s=(0,p.Zp)();const r=(0,d.hN)(),n=(0,f.u)(),[g,w]=(0,i.useState)(!1),N={name:"email",rules:[{required:!0,message:t("Please type your email address."),type:"email"}],placeholder:t("email"),prefix:(0,y.jsx)(c.A,{style:{color:j.VG}})},S={name:"password",rules:[{required:!0,message:t("Please type your password.")},()=>({validator:(e,s)=>s.length>=8&&/[0-9]/.test(s)&&/[a-z]/.test(s)&&/[A-Z]/.test(s)&&/\W+|_/g.test(s)?Promise.resolve():Promise.reject(new Error(t("The password is too simple.")))})],placeholder:t("password"),prefix:(0,y.jsx)(m.A,{style:{color:j.VG}})},k={name:"code",rules:[{required:!0,message:t("Please type your password confirmation code.")}],placeholder:t("confirmation code"),prefix:(0,y.jsx)(u.A,{style:{color:j.VG}})},[I,C]=(0,x.Lv)(),[T,E]=(0,x.kg)(),[L,z]=(0,i.useState)("");(0,i.useEffect)((()=>{C.isError&&r.error({message:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:C.error.data.code}}),description:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:C.error.data.message}}),placement:"bottomRight"})}),[C,r]),(0,i.useEffect)((()=>{E.isError&&r.error({message:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:E.error.data.code}}),description:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:E.error.data.message}}),placement:"bottomRight"}),E.isSuccess&&(r.success({message:t("Your password successfully reset."),description:t("Try sign in with your new password."),placement:"bottomRight"}),s("/auth",{replace:!0}))}),[E,s,t,r]);return(0,y.jsxs)("div",{className:_()("recover-password-form",{[e]:e}),children:[!C.isSuccess&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"recover-password-form__heading",children:[(0,y.jsx)(A,{level:2,style:{fontWeight:500,fontSize:24},children:t("Forgot the password?")}),(0,y.jsx)(b,{className:"recover-password-form__sub-title",children:t("Enter your email address and we will send you password reset instructions.")})]}),(0,y.jsxs)(a.A,{name:"recover_password_form",initialValues:{remember:!0},onFinish:e=>{z(e.email),n({event:"submit_form",action:"password_recovery",label:e.email}),I({email:e.email})},onFinishFailed:()=>{},autoComplete:"off",children:[(0,y.jsx)(a.A.Item,{name:N.name,rules:N.rules,children:(0,y.jsx)(l.A,{size:"large",disabled:C.isLoading,placeholder:N.name,prefix:N.prefix})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(o.Ay,{size:"large",loading:C.isLoading,block:!0,type:"primary",htmlType:"submit",className:"em-analytics__password-reset",children:t("Send")})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(h.N_,{to:"/auth",children:t("Back to Log In")})})]})]}),C.isSuccess&&!E.isSuccess&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"recover-password-form__heading",children:[(0,y.jsx)(A,{level:2,style:{fontWeight:500,fontSize:24},children:t("Set new password")}),(0,y.jsx)(b,{className:"recover-password-form__sub-title",children:t("Enter the confirmation code from the email and set a new password.")})]}),(0,y.jsxs)(a.A,{name:"set_new_password_form",initialValues:{remember:!0},onFinish:e=>{T({email:L,password:e.password,code:e.code})},onFinishFailed:()=>{},autoComplete:"off",children:[(0,y.jsx)(a.A.Item,{name:S.name,rules:S.rules,extra:t("At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters."),children:(0,y.jsx)(l.A.Password,{readOnly:!g,onFocus:()=>w(!0),size:"large",type:"password",disabled:E.isLoading,placeholder:t("new password"),prefix:S.prefix})}),(0,y.jsx)(a.A.Item,{name:k.name,rules:k.rules,children:(0,y.jsx)(l.A,{size:"large",disabled:E.isLoading,placeholder:k.placeholder,prefix:k.prefix})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(o.Ay,{size:"large",loading:E.isLoading,block:!0,type:"primary",htmlType:"submit",children:t("Recover password")})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(h.N_,{to:"/auth",children:t("Back to Log In")})})]})]})]})},N=()=>(0,y.jsx)(r.A,{className:"recover-password-page",children:(0,y.jsx)(w,{className:"recover-password-page__form"})})},70431:(e,t,s)=>{s.d(t,{A:()=>g});var i=s(92810),r=s(12280),n=s(14852),a=s(43005),l=s(55039),o=s(71157),d=s(45934),c=s(23287),m=s(93563),u=s(64936),p=s(85163),h=s(70082);const g=({folder:e,refetch:t})=>{const{__:s,_x:g}=(0,c.s9)(),_=(0,d.wA)(),[v]=r.A.useForm(),x=(0,i.useRef)(null),j=(0,d.d4)(u.cL)===p.lx.EDIT_FOLDER_NAME_MODAL,f=(0,o.hN)(),{folderId:y=null,folderName:A=""}=e,b=()=>_((0,u.Oo)()),[w,N]=(0,m.$s)();(0,i.useEffect)((()=>{j&&v.setFieldsValue({name:A})}),[j,A,v]);const S=()=>{v.validateFields().then((({name:e})=>{w({id:y,data:{name:e}}).then((({data:e,error:i})=>{i?(f.error({message:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i.data.code}}),description:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i.data.message}}),placement:"bottomRight"}),v.setFieldValue("name",A)):(t().then((({data:e})=>{if(e){var t,s,i;const r=null===(t=e[0])||void 0===t||null===(s=t.children)||void 0===s||null===(i=s.find((e=>e.id===y)))||void 0===i?void 0:i.name;v.setFieldValue("name",r)}})),b(),f.success({message:s("The folder \u201c")+A+g("\u201d was successfully changed to \u201c","folder")+e.name+s("\u201d."),placement:"bottomRight"}))}))}))};return(0,h.jsx)(n.A,{title:s("Change folder name"),open:j,onOk:S,onCancel:b,className:"new-folder-name-modal",centered:!0,footer:[(0,h.jsx)(a.Ay,{type:"primary",size:"large",loading:N.isLoading,onClick:S,children:s("Change name")},"submit")],children:(0,h.jsx)(r.A,{form:v,layout:"vertical",name:"rename_folder_form",onFinish:S,initialValues:{remember:!1,name:A},autoComplete:"off",style:{paddingTop:10},children:(0,h.jsx)(r.A.Item,{name:"name",rules:[{required:!0,message:s("Please enter the folder name")}],children:(0,h.jsx)(l.A,{disabled:N.isLoading,size:"large",placeholder:s("Enter the folder name"),ref:x,style:{marginBottom:5}})})})})}},35825:(e,t,s)=>{s.d(t,{A:()=>g});var i=s(92810),r=s(12280),n=s(14852),a=s(43005),l=s(55039),o=s(71157),d=s(45934),c=s(23287),m=s(93563),u=s(64936),p=s(85163),h=s(70082);const g=({group:e,refetch:t})=>{const{__:s,_x:g}=(0,c.s9)(),_=(0,d.wA)(),[v]=r.A.useForm(),x=(0,i.useRef)(null),j=(0,d.d4)(u.cL)===p.lx.EDIT_GROUP_NAME_MODAL,f=(0,o.hN)(),{id:y=null,name:A=""}=e,b=()=>_((0,u.Oo)()),[w,N]=(0,m.CE)();(0,i.useEffect)((()=>{j&&v.setFieldsValue({name:A})}),[j,A,v]);const S=()=>{v.validateFields().then((({name:e})=>{w({id:y,data:{name:e}}).then((({data:i,error:r})=>{r?(f.error({message:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:r.data.code}}),description:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:r.data.message}}),placement:"bottomRight"}),v.setFieldValue("name",e)):(t().then((({data:e})=>{if(e){var t,s,i;const r=null===(t=e[0])||void 0===t||null===(s=t.children)||void 0===s||null===(i=s.find((e=>e.id===y)))||void 0===i?void 0:i.name;v.setFieldValue("name",r)}})),b(),f.success({message:s("The group \u201c")+e+g("\u201d was successfully changed to \u201c","group")+i.name+s("\u201d."),placement:"bottomRight"}))}))}))};return(0,h.jsx)(n.A,{title:s("Change group name"),open:j,onOk:S,onCancel:b,className:"new-group-name-modal",centered:!0,footer:[(0,h.jsx)(a.Ay,{type:"primary",size:"large",loading:N.isLoading,onClick:S,children:s("Change name")},"submit")],children:(0,h.jsx)(r.A,{form:v,layout:"vertical",name:"rename_group_form",onFinish:S,initialValues:{remember:!1,name:A},autoComplete:"off",style:{paddingTop:10},children:(0,h.jsx)(r.A.Item,{name:"name",rules:[{required:!0,message:s("Please enter the group name")}],children:(0,h.jsx)(l.A,{disabled:N.isLoading,size:"large",placeholder:s("Enter the group name"),ref:x,style:{marginBottom:5}})})})})}},33284:(e,t,s)=>{s.d(t,{A:()=>p});var i=s(92810),r=s(43005),n=s(45934),a=s(33206),l=s(56920),o=s(86286),d=s(62303),c=s(32269),m=s(23287),u=s(70082);const p=()=>{const{__:e}=(0,m.s9)(),{notification:t}=a.A.useApp(),s=(0,n.d4)(o.C1),[p]=(0,l.C)(),[h,g]=(0,i.useState)(!1);(0,i.useEffect)((()=>{s.hasOwnProperty("email_confirmation")&&g(s.email_confirmation)}),[s,h]);return null!==s&&void 0!==s&&s.email_confirmation||null===s||void 0===s||!s.privacy_policy_agreement?null:(0,u.jsx)("div",{className:"main__ribbon",children:(0,u.jsxs)("span",{children:[(0,u.jsx)(d.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}})," ",e("Confirmation email was sent to"),"\xa0",(0,u.jsx)("em",{children:s.email}),".\xa0",e("Didn't receive an email?"),"\xa0",(0,u.jsxs)(r.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{p({userId:s.id,email:s.email}).then((({data:i,error:r})=>{i?(0,c.wB)(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",s.email),t):r&&(0,c.p6)(r,t)}))},children:[e("Resend")," ",(0,u.jsx)(d.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}})]})]})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[78],{7760:(e,a,l)=>{l.d(a,{A9:()=>p,Ay:()=>F,DL:()=>b,Dz:()=>c,Fv:()=>v,JV:()=>k,Up:()=>y,b9:()=>S,eX:()=>m,gm:()=>M,iy:()=>f,nJ:()=>E,om:()=>g,qX:()=>T,rc:()=>u,vs:()=>r});var t=l(90536),o=l(31770),i=l(55701);const d=(0,o.ur)({invalidateBlockId:null,isCodeMode:!1,codeModeDirection:"right",editorThemeColor:"light",isSettingsDisabled:!1,settings:{width:""},elementSettings:{},searchFilters:{},block:{id:void 0,isNew:!1,subject:"",description:"",html:"",project:void 0,project_title:"",project_author:void 0,tags:[],type:"Other",title:null,isAmp:!1},monacoDidMount:!1}),n="blockSlice",s=(0,t.createSlice)({name:n,initialState:d,reducers:{switchCodeMode:e=>{e.isCodeMode=!e.isCodeMode},setEditorThemeColor:(e,a)=>{e.editorThemeColor=a.payload},setBlockSettings:(e,a)=>{Object.assign(e,{...e,settings:a.payload,isSettingsDisabled:!1})},setBlockSettingsDisable:(e,a)=>{e.isSettingsDisabled=a.payload},setElementSettings:(e,a)=>{e.elementSettings=a.payload},setSearchFilters:(e,a)=>{e.searchFilters=a.payload},setBlockHtml:(e,a)=>{e.block.html=a.payload},resetBlockSlice:()=>d,setBlockIsAmp:(e,a)=>{e.block.isAmp=a.payload}},extraReducers:e=>{e.addMatcher((e=>"blocksApi/queries/queryResultPatched"===e.type),((e,a)=>{var l,t;const o=a.payload.queryCacheKey.match(/\(([0-9]+)\)/),i=null===(l=a.payload)||void 0===l?void 0:l.patches[0];if(null!==i&&void 0!==i&&null!==(t=i.path)&&void 0!==t&&t[0]&&(e.block[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==o&&void 0!==o&&o[1]&&(e.invalidateBlockId=o[1]),a.payload.queryCacheKey.startsWith("getBlock")){var d,n;const l=null===(d=a.payload)||void 0===d?void 0:d.patches[0];null!==l&&void 0!==l&&null!==(n=l.path)&&void 0!==n&&n[0]&&(e.block[null===l||void 0===l?void 0:l.path[0]]=l.value)}})),e.addMatcher((e=>"blocksApi/invalidateTags"===e.type),((e,a)=>{if(a.payload[0].id===+e.invalidateBlockId)return{...d,isCodeMode:null===e||void 0===e?void 0:e.isCodeMode,codeModeDirection:e.codeModeDirection}})),e.addMatcher(i.VM.endpoints.editBlock.matchFulfilled,((e,{payload:a})=>{e.invalidateBlockId=null,e.block={...e.block,...a,renderGuid:e.block.renderGuid}})),e.addMatcher(i.VM.endpoints.autoSaveBlock.matchFulfilled,((e,a)=>{var l,t;(null===e||void 0===e||null===(l=e.block.id)||void 0===l?void 0:l.toString())===(null===(t=a.payload.id)||void 0===t?void 0:t.toString())&&(e.block.html=a.payload.html)})),e.addMatcher(i.VM.endpoints.getBlock.matchFulfilled,((e,{payload:a})=>{e.block={...d.block,...a}}))}}),{switchCodeMode:r,setEditorThemeColor:m,setBlockSettings:c,setElementSettings:p,setBlockSettingsDisable:u,setSearchFilters:g,setBlockHtml:b,resetBlockSlice:E,setBlockIsAmp:h}=s.actions,v=e=>e[n].isCodeMode,y=e=>e[n].editorThemeColor,k=e=>e[n].settings,T=e=>e[n].elementSettings,f=e=>e[n].isSettingsDisabled,S=e=>e[n].searchFilters,M=e=>e[n].block,F=s},34524:(e,a,l)=>{l.d(a,{Ay:()=>k,D2:()=>g,FC:()=>c,LZ:()=>b,NK:()=>p,NP:()=>E,dV:()=>y,qM:()=>h,ux:()=>v,wK:()=>u});var t=l(90536),o=l(55701),i=l(49211),d=l(85163);const n=(0,l(31770).ur)({blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:!d.EW.isPlugin&&i.A.get(d.A9.em_elements_view)||d.Y$,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]}),s="blocksPageSlice",r=(0,t.createSlice)({name:s,initialState:n,reducers:{resetPagesAndTotal:()=>n,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,a)=>{e.elementsView=a.payload},removeBlockFromList:(e,{payload:a})=>{var l;let t=e.customFolders;a.folder!==d.y2&&null!==(l=t[a.folder])&&void 0!==l&&l.list&&(t[a.folder]={...t[a.folder],list:t[a.folder].list.filter((e=>e.id!==a.emailId)),total:t[a.folder].total-1},e.customFolders=t)}},extraReducers:e=>{e.addMatcher(o.VM.endpoints.getBlocks.matchFulfilled,((e,{meta:a,payload:l})=>{var t,o,i,d,n,s,r,m;const c=null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"),p="trash"===(null===(o=a.arg.originalArgs)||void 0===o?void 0:o.status),u=!(null===(i=a.arg.originalArgs)||void 0===i||null===(d=i.name)||void 0===d||!d.length),g=null===(n=a.arg.originalArgs)||void 0===n?void 0:n.page,b=(null===(s=a.arg.originalArgs)||void 0===s?void 0:s.folderTag)||(null===(r=a.arg.originalArgs)||void 0===r||null===(m=r.tags)||void 0===m?void 0:m[0]);p?(u||(e.blocksTrashTotal=c),e.elementsTrashList=l):b?e.customFolders={...e.customFolders,[b]:{list:l,page:g,total:c}}:(a.arg.originalArgs.tags||u||(e.blocksTotal=c),e.elementsList=l)})),e.addMatcher(o.VM.endpoints.getParentEmailBlocks.matchFulfilled,((e,{meta:a})=>{var l,t;const o=null===(l=a.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-Total"),i=null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages");e.parentEmailBlocksTotal=o,e.parentEmailBlocksTotalPages=i})),e.addMatcher(o.VM.endpoints.getTemplateBlocks.matchFulfilled,((e,{meta:a,payload:l})=>{var t,o;const i=null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"),d=null===(o=a.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages");e.templateBlocks=l,e.templateBlocksTotal=i,e.templateBlocksTotalPages=d})),e.addMatcher(o.VM.endpoints.editBlock.matchFulfilled,((e,{payload:a})=>{e.elementsList.map((e=>{var l,t;return(null===(l=e.id)||void 0===l?void 0:l.toString())===(null===(t=a.id)||void 0===t?void 0:t.toString())?Object.assign(e,{lock:a.lock,title:a.title,blocktags:a.blocktags}):e}))}))}}),{resetPagesAndTotal:m,resetElementsList:c,toggleElementsView:p,removeBlockFromList:u}=r.actions,g=e=>e[s].blocksTotal,b=e=>e[s].templateBlocks,E=e=>e[s].customFolders,h=e=>e[s].elementsList,v=e=>e[s].elementsTrashList,y=e=>e[s].blocksTrashTotal,k=r},99751:(e,a,l)=>{l.d(a,{i:()=>i,$:()=>o});const t={pro:{config:{mode:"pro",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 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,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!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,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,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,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},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}},editor:{config:{mode:"editor",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,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:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!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:!1,editImageControlEnabled:!0,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:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,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},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},simple:{config:{mode:"simple",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,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,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!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,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,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,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},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}}},o=e=>{const a=t[e];return a||t.editor},i=["mode","formFieldBorderEnabled","formFieldBorderRadiusEnabled","formFieldBoxShadowEnabled","formFieldVisibilityEnabled","formFieldExportAsPictureEnabled","formButtonFieldInsertImageEnabled","formButtonFieldVerticalAlignEnabled","formButtonFieldTextAlignEnabled","formButtonFieldBackgroundImageEnabled","formButtonFieldPaddingsEnabled","formCellFieldVerticalAlignEnabled","formCellFieldBackgroundImageEnabled","formCellFieldPaddingsEnabled","formLinkFieldInsertImageEnabled","formTableFieldBackgroundImageEnabled","formDivFieldBackgroundImageEnabled","formEmailFieldBackgroundImageEnabled"]},53204:(e,a,l)=>{l.d(a,{Ay:()=>m,M:()=>r,YT:()=>s,rI:()=>n});var t=l(90536);const o=(0,l(31770).ur)({isCollapsed:!0,isMonacoFocusing:!1}),i="defaultModePanesSlice",d=(0,t.createSlice)({name:i,initialState:o,reducers:{setMonacoFocusing:(e,a)=>{e.isMonacoFocusing=a.payload},resetPanes:()=>o}}),{resetPanes:n,setMonacoFocusing:s}=d.actions,r=e=>e[i].isMonacoFocusing,m=d},65983:(e,a,l)=>{l.d(a,{A9:()=>u,AJ:()=>y,Ay:()=>R,Bj:()=>F,Bu:()=>B,CT:()=>x,G_:()=>p,HO:()=>h,Hs:()=>D,M7:()=>g,RC:()=>C,S_:()=>P,UI:()=>V,Up:()=>I,VK:()=>T,VO:()=>M,VZ:()=>G,Wm:()=>S,dH:()=>O,eX:()=>c,iy:()=>N,mD:()=>H,no:()=>f,om:()=>b,pl:()=>v,ps:()=>w,qX:()=>_,rY:()=>U,rd:()=>L,ry:()=>E,ss:()=>k,uJ:()=>j,zn:()=>A});var t=l(90536),o=l(31770),i=l(86739),d=l(93563),n=l(84568);const s=(0,o.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,hasAmp:!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}),r="emailSlice",m=(0,t.createSlice)({name:r,initialState:s,reducers:{setEditorThemeColor:(e,a)=>{e.editorThemeColor=a.payload},setEmailFromHistory:(e,{payload:a})=>{const l=e.email,t=void 0===(null===a||void 0===a?void 0:a.preheader),o=void 0===(null===a||void 0===a?void 0:a.subject);e.email={...l,html:null===a||void 0===a?void 0:a.html,preheader:t?l.preheader:null===a||void 0===a?void 0:a.preheader,subject:o?l.subject:null===a||void 0===a?void 0:a.subject,common_styles:void 0===(null===a||void 0===a?void 0:a.common_styles)?l.common_styles:null===a||void 0===a?void 0:a.common_styles},e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setEmailSettings:(e,{payload:a})=>{Object.assign(e,{...e,settings:{...a},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,a)=>{e.isSettingsDisabled=a.payload},setElementSettings:(e,{payload:a})=>{e.elementSettings=a},setSearchFilters:(e,a)=>{e.searchFilters=a.payload},updateSearchFilters:(e,a)=>{const l=e.searchFilters;e.searchFilters={...l,...a.payload}},setEmailHTML:(e,a)=>{e.email.html=a.payload},setEmailSubject:(e,a)=>{e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=a.payload),e.email.subject=a.payload},setEmailPreheader:(e,a)=>{e.email.preheader=a.payload},resetEmailSlice:e=>s,setEmailTitle:(e,a)=>{e.email.title=a.payload},setIsInited:(e,a)=>{e.email.is_inited=a.payload},setEmailIsAmp:(e,a)=>{e.email.isAmp=a.payload},setProblemsList:(e,a)=>{e.problemsList=a.payload},setActiveProblemRange:(e,a)=>{e.activeProblemRange=a.payload},setIsNeedUpdateContentAppearance:(e,a)=>{e.isNeedUpdateContentAppearance=a.payload},setIsNeedUpdateAppearance:(e,a)=>{e.isNeedUpdateAppearance=a.payload},setEmailGroups:(e,{payload:a})=>{const l=Object.keys(a)[0],t=e.emailGroups,o=e.parentGroupOfProject,i=e.projectGroups;let d={};var n;o&&i.length&&(null===(n=a[l])||void 0===n||n.forEach((e=>{const a=i.find((e=>e.id===+l));let t=null===a||void 0===a?void 0:a.children.find((a=>a.id===+e));t?(d.hasOwnProperty(a.id)||(d[a.id]=[]),d[a.id].push({label:t.name,value:t.id})):(d.hasOwnProperty(l)||(d[l]=[]),d[l].push({label:e,value:null}))})),0===a[l].length&&(d[l]=[]));e.emailGroups={...t,...d}}},extraReducers:e=>{e.addMatcher((e=>"emailsApi/queries/queryResultPatched"===e.type),((e,a)=>{var l,t;const o=a.payload.queryCacheKey.match(/\("([0-9]+)"\)/),i=null===(l=a.payload)||void 0===l?void 0:l.patches[0];null!==i&&void 0!==i&&null!==(t=i.path)&&void 0!==t&&t[0]&&(e.email[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==o&&void 0!==o&&o[1]&&(e.invalidateEmailId=o[1]),e.emailIsEdit=!0})),e.addMatcher((e=>"emailsApi/invalidateTags"===e.type),((e,a)=>{if(a.payload[0].id===+e.invalidateEmailId)return s})),e.addMatcher(i.GY.endpoints.editEmail.matchFulfilled,((e,{payload:a})=>{e.invalidateEmailId=null,e.email={...e.email,...a,renderGuid:e.email.renderGuid}})),e.addMatcher(i.GY.endpoints.autoSaveEmail.matchFulfilled,((e,a)=>{var l,t;(null===(l=e.email.id)||void 0===l?void 0:l.toString())===(null===(t=a.payload.id)||void 0===t?void 0:t.toString())&&(e.email.html=a.payload.html)})),e.addMatcher(i.GY.endpoints.getEmail.matchFulfilled,((e,{payload:a})=>{var l,t;e.email={...s.email,...a,is_inited:a.is_inited||(a.id===(null===(l=e.email)||void 0===l?void 0:l.id)?null===(t=e.email)||void 0===t?void 0:t.is_inited:s.email.is_inited)},e.emailIsEdit=!1})),e.addMatcher(d.kE.endpoints.getGroups.matchFulfilled,((e,{meta:a,payload:l})=>{const t=e.email.group,o=a.arg.originalArgs.parent,i=l;o&&(e.parentGroupOfProject=o,i.length>0&&(e.projectGroups=i));let d={};o&&t.length&&i.length&&(null===t||void 0===t||t.forEach((e=>{null===i||void 0===i||i.forEach((a=>{let l=a.children.find((a=>a.id===e));l&&(d.hasOwnProperty(a.id)||(d[a.id]=[]),d[a.id].push({label:l.name,value:l.id}))}))}))),e.emailGroups=d})),e.addMatcher(n.Nq.endpoints.getProject.matchFulfilled,((e,{meta:a,payload:l})=>{var t;e.parentGroupOfProject=(null===(t=l.group)||void 0===t?void 0:t[0])||null}))}}),{setEditorThemeColor:c,setEmailSettings:p,setElementSettings:u,setEmailSettingsDisable:g,setSearchFilters:b,updateSearchFilters:E,setEmailSubject:h,setEmailPreheader:v,setEmailHTML:y,resetEmailSlice:k,setEmailTitle:T,setEmailFromHistory:f,setIsInited:S,setEmailIsAmp:M,setProblemsList:F,setActiveProblemRange:w,setEmailGroups:B,setIsNeedUpdateAppearance:P,setIsNeedUpdateContentAppearance:C}=m.actions,A=e=>e[r].invalidateEmailId,I=e=>e[r].editorThemeColor,j=e=>e[r].settings,_=e=>e[r].elementSettings,N=e=>e[r].isSettingsDisabled,x=e=>e[r].searchFilters,D=e=>e[r].email,L=e=>e[r].problemsList,G=e=>e[r].activeProblemRange,U=e=>e[r].emailGroups,V=e=>e[r].projectGroups,O=e=>e[r].isNeedUpdateContentAppearance,H=e=>e[r].isNeedUpdateAppearance,R=m},94925:(e,a,l)=>{l.d(a,{Ay:()=>y,FC:()=>p,MY:()=>g,NK:()=>c,NP:()=>v,X:()=>u,aO:()=>h,ff:()=>m,qM:()=>b,ux:()=>E});var t=l(90536),o=l(86739),i=l(49211),d=l(85163);const n=(0,l(31770).ur)({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:!d.EW.isPlugin&&i.A.get(d.A9.em_elements_view)||d.Y$}),s="emailsPageSlice",r=(0,t.createSlice)({name:s,initialState:n,reducers:{resetPagesAndTotal:()=>n,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,a)=>{e.elementsView=a.payload},removeEmailFromList:(e,{payload:a})=>{var l;let t=e.customFolders;a.folder!==d.y2&&null!==(l=t[a.folder])&&void 0!==l&&l.list&&(t[a.folder]={...t[a.folder],list:t[a.folder].list.filter((e=>e.id!==a.emailId)),total:t[a.folder].total-1},e.customFolders=t)}},extraReducers:e=>{e.addMatcher(o.GY.endpoints.getEmails.matchFulfilled,((e,{meta:a,payload:l})=>{var t,o,i,d,n,s,r,m;const c=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"))||0,p="trash"===(null===(o=a.arg.originalArgs)||void 0===o?void 0:o.status),u=!(null===(i=a.arg.originalArgs)||void 0===i||null===(d=i.name)||void 0===d||!d.length),g=null===(n=a.arg.originalArgs)||void 0===n?void 0:n.page,b=(null===(s=a.arg.originalArgs)||void 0===s?void 0:s.folderTag)||(null===(r=a.arg.originalArgs)||void 0===r||null===(m=r.tags)||void 0===m?void 0:m[0]);p?(u||(e.emailsTrashTotal=c),e.elementsTrashList=l):b?e.customFolders={...e.customFolders,[b]:{list:l,page:g,total:c}}:(a.arg.originalArgs.tags||u||(e.emailsTotal=c),e.elementsList=l)})),e.addMatcher(o.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{meta:a,payload:l})=>{var t;const o=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"))||0;e.elementsList=l,e.emailsTotal=o;const{projectGroup:i,projectId:d,tags:n}=a.arg.originalArgs;!(null!==i&&void 0!==i&&i.length&&d||null!==n&&void 0!==n&&n.length)&&(null!==n&&void 0!==n&&n.length||null!==i&&void 0!==i&&i.length)||(e.emailsTotal=o)})),e.addMatcher(o.GY.endpoints.editEmail.matchFulfilled,((e,{payload:a})=>{e.elementsList.map((e=>{var l,t;return(null===(l=e.id)||void 0===l?void 0:l.toString())===(null===(t=a.id)||void 0===t?void 0:t.toString())?Object.assign(e,{lock:a.lock,title:a.title,emailtags:a.emailtags}):e}))}))}}),{resetPagesAndTotal:m,toggleElementsView:c,resetElementsList:p,removeEmailFromList:u}=r.actions,g=e=>e[s].emailsTotal,b=e=>e[s].elementsList,E=e=>e[s].elementsTrashList,h=e=>e[s].emailsTrashTotal,v=e=>e[s].customFolders,y=r},77532:(e,a,l)=>{l.d(a,{Ac:()=>g,Ay:()=>b,BK:()=>c,Uf:()=>u,Yw:()=>r,e_:()=>m,js:()=>p,tm:()=>s});var t=l(90536),o=l(31770);const i="imageSlice",d=(0,o.ur)({currentImage:"",currentBackground:"",currentImageName:""}),n=(0,t.createSlice)({name:i,initialState:d,reducers:{setCurrentImageName(e,a){e.currentImageName=a.payload},setCurrentImage(e,a){e.currentImage=a.payload},setCurrentBackground(e,a){e.currentBackground=a.payload},clearCurrentImages(e,a){e.currentImage="",e.currentBackground="",e.currentImageName=""}}}),{setCurrentImage:s,setCurrentImageName:r,setCurrentBackground:m,clearCurrentImages:c}=n.actions,p=e=>e[i].currentImage,u=e=>e[i].currentImageName,g=e=>e[i].currentBackground,b=n},87790:(e,a,l)=>{l.d(a,{AS:()=>u,Ay:()=>k,Bp:()=>c,Sl:()=>y,TB:()=>b,X8:()=>E,ah:()=>v,qT:()=>p});var t=l(90536),o=l(55701),i=l(84568),d=l(35880),n=l.n(d);const s=(0,l(31770).ur)({block:{isNew:!0,subject:"",description:"",html:'<table cellspacing="0" cellpadding="0" border="0" width="100%">'+n()+"</table>",project:void 0,project_title:"",tags:[],type:"Other",title:null},hasChanged:!1}),r="newBlockSlice",m=(0,t.createSlice)({name:r,initialState:s,reducers:{setNewBlockAll:(e,{payload:{subject:a="",description:l="",renderGuid:t,html:o='<table cellspacing="0" cellpadding="0" border="0" width="100%">'+n()+"</table>",tags:i=[],type:d="Other",title:s,isAmp:r=!1}})=>{e.hasChanged||(e.hasChanged=!0),e.block.title=s,e.block.subject=a,e.block.description=l,e.block.html=o,e.block.tags=i,e.block.type=d,e.block.renderGuid=t,e.block.isAmp=r},setNewBlockTitle:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.title=a.payload},setNewBlockDescription:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.description=a.payload},setNewBlockHtml:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.html=a.payload},setNewBlockTags:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.tags=a.payload},resetNewBlockSlice:e=>({...s,block:{...s.block,project:e.block.project,project_title:e.block.project_title}}),setBlockIsAmp:(e,a)=>{e.block.isAmp=a.payload}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,a)=>{e.block.project=a.payload.id,e.block.project_title=a.payload.title})),e.addMatcher(o.VM.endpoints.getBlock.matchFulfilled,(e=>({...s,block:{...s.block,project:e.block.project,project_title:e.block.project_title}})))}}),{setNewBlockAll:c,setNewBlockTitle:p,setNewBlockDescription:u,setNewBlockHtml:g,setNewBlockTags:b,resetNewBlockSlice:E,setBlockIsAmp:h}=m.actions,v=e=>e[r].block,y=e=>e[r].hasChanged,k=m},8493:(e,a,l)=>{l.d(a,{$S:()=>_,Ay:()=>N,BQ:()=>E,Et:()=>C,K3:()=>M,MZ:()=>b,P3:()=>w,TC:()=>k,TU:()=>h,Uh:()=>A,YG:()=>j,Zs:()=>y,aY:()=>T,lg:()=>I,mk:()=>B,ol:()=>F,x3:()=>v,yY:()=>S,zH:()=>P});var t=l(90536),o=l(86739),i=l(84568),d=l(85163),n=l(573),s=l.n(n),r=l(31770),m=l(71210),c=l(32269);const p=(0,r.ur)({emailtags:[],email:{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:s(),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}),u="newEmailSlice",g=(0,t.createSlice)({name:u,initialState:p,reducers:{setNewEmailAll:(e,{payload:{id:a,subject:l,description:t="",preheader:o,html:i=s(),utm_parameters:{utm_source:n="",utm_medium:r="",utm_campaign:m="",utm_term:p="",utm_content:u=""}={},common_styles:g={},emailtags:b=null,renderGuid:E,title:h,_embedded:v,isAmp:y=!1}})=>{var k;e.hasChanged||(e.hasChanged=!0),e.email.isAmp=y,e.email.title=h,e.emailtags=b,e.email.subject=l,e.email.description=t,e.email.common_styles=JSON.stringify(g),e.email.preheader=o,e.email.is_template=!1,e.email.html=i,e.email.tags=(null===(k=(0,c._q)({_embedded:v},d.zh))||void 0===k?void 0:k.map((e=>e.name)))||[],e.email.renderGuid=E,e.email.parent_email=a,e.email.utm_parameters={utm_source:n,utm_medium:r,utm_campaign:m,utm_term:p,utm_content:u},e.email.common_styles=JSON.stringify(d.BD)},setNewEmailTitle:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.title=a.payload},setNewEmailSubject:(e,a)=>{e.hasChanged||e.email.subject===a.payload||(e.hasChanged=!0),e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=a.payload),e.email.subject=a.payload},setNewEmailPreheader:(e,a)=>{e.hasChanged||e.email.preheader===a.payload||(e.hasChanged=!0),e.email.preheader=a.payload},setNewEmailDescription:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.description=a.payload},setNewEmailIsTemplate:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.is_template=a.payload},setNewEmailHtml:(e,a)=>{e.hasChanged||(e.hasChanged=!0),a.payload&&(e.email.html=a.payload)},setNewCommonStyles:(e,a)=>{e.hasChanged||(e.hasChanged=!0),a.payload&&(e.email.common_styles=a.payload)},setNewEmailTags:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.tags=a.payload},setNewEmailUtmSource:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_source=a.payload},setNewEmailUtmMedium:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_medium=a.payload},setNewEmailUtmCampaign:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_campaign=a.payload},setNewEmailUtmTerm:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_term=a.payload},setNewEmailUtmContent:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_content=a.payload},setNewIsInited:(e,a)=>{e.email.is_inited=a.payload},setNewEmailIsAmp:(e,a)=>{e.email.isAmp=a.payload},resetNewEmailSlice:e=>({...p,email:{...p.email,guid:(0,m.l)(),project:e.email.project,project_title:e.email.project_title}})},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,a)=>{e.email.project=a.payload.id,e.email.project_title=a.payload.title})),e.addMatcher(o.GY.endpoints.getEmail.matchFulfilled,(e=>({...p,email:{...p.email,project:e.email.project,project_title:e.email.project_title}})))}}),{setNewEmailAll:b,setNewEmailTitle:E,setNewEmailSubject:h,setNewEmailPreheader:v,setNewEmailDescription:y,setNewEmailIsTemplate:k,setNewEmailHtml:T,setNewCommonStyles:f,setNewEmailTags:S,setNewEmailUtmSource:M,setNewEmailUtmMedium:F,setNewEmailUtmCampaign:w,setNewEmailUtmContent:B,setNewEmailUtmTerm:P,resetNewEmailSlice:C,setNewIsInited:A,setNewEmailIsAmp:I}=g.actions,j=e=>e[u].email,_=e=>e[u].hasChanged,N=g},36404:(e,a,l)=>{l.d(a,{AQ:()=>v,Ay:()=>k,BN:()=>p,GD:()=>b,RP:()=>h,Rw:()=>E,es:()=>c,mb:()=>u,od:()=>m,qV:()=>y,yN:()=>g});var t=l(90536),o=l(31770),i=l(84568),d=l(86739);const n=(0,o.ur)({project:null,activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),s="projectSlice",r=(0,t.createSlice)({name:s,initialState:n,reducers:{setProject:(e,{payload:a})=>{e.project=a},setActiveGroupsTags:(e,{payload:a})=>{e.activeGroupsTags=a,a.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:a})=>{e.activeProjectGroupsTags=a,a.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,{payload:a})=>{e.project={...n.project,...a}})),e.addMatcher(i.Nq.endpoints.editProject.matchFulfilled,((e,{payload:a})=>{e.project={...n.project,...a}})),e.addMatcher(d.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{payload:a,meta:l})=>{const{projectId:t}=l.arg.originalArgs;var o,i,d;t?(e.groupsTemplateProjectTotal=+(null===(o=l.baseQueryMeta)||void 0===o?void 0:o.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===(d=l.baseQueryMeta)||void 0===d?void 0:d.response.headers.get("X-WP-Total"))}))}}),{setProject:m,setActiveGroupsTags:c,setActiveProjectGroupsTags:p,resetAllTags:u}=r.actions,g=e=>e[s].project,b=e=>e[s].activeGroupsTags,E=e=>e[s].activeProjectGroupsTags,h=e=>e[s].groupsTemplateTotal,v=e=>e[s].groupsTemplateProjectTotal,y=e=>e[s].groupsTemplateProjectTotalPages,k=r},64936:(e,a,l)=>{l.d(a,{Ay:()=>B,Cj:()=>k,Oo:()=>E,Os:()=>v,Wz:()=>h,YF:()=>b,cL:()=>T,gU:()=>w,o8:()=>M,qf:()=>g,sB:()=>y,sK:()=>f,uM:()=>F,vW:()=>S});var t=l(90536),o=l(31770),i=l(84568),d=l(93563),n=l(85163);const s=new URLSearchParams(window.location.search),r=s.get("tag"),m=s.get("folder"),c=(0,o.ur)({activeModal:"",secondModal:"",projectsTotal:"",projectsTotalPages:"",folders:[],activeTagId:r||null,activeFolderId:m||(r?null:n.y2),activeTab:null}),p="projectsPageSlice",u=(0,t.createSlice)({name:p,initialState:c,reducers:{openModal(e,a){e.activeModal=a.payload},setActiveTab(e,a){e.activeTab=a.payload},closeModal(e){e.activeModal=""},openSecondModal(e,a){e.secondModal=a.payload},closeSecondModal(e){e.secondModal=""},setFolders(e,{payload:a}){e.folders=a},setActiveTagId(e,{payload:a}){e.activeTagId=a}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProjects.matchFulfilled,((e,{meta:a})=>{var l,t;const o=null===(l=a.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-Total"),i=null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages");e.projectsTotal=o,e.projectsTotalPages=i})),e.addMatcher(d.kE.endpoints.getFolders.matchFulfilled,((e,{payload:a})=>{e.folders=a}))}}),{openModal:g,setActiveTab:b,closeModal:E,openSecondModal:h,closeSecondModal:v,setFolders:y,setActiveTagId:k}=u.actions,T=e=>e[p].activeModal,f=e=>e[p].secondModal,S=e=>e[p].projectsTotal,M=e=>e[p].folders,F=e=>e[p].activeTagId,w=e=>e[p].activeTab,B=u},39738:(e,a,l)=>{l.d(a,{Ay:()=>u,RL:()=>p,p1:()=>c,qX:()=>r});var t=l(90536),o=l(86739),i=l(55701);const d=(0,l(31770).ur)({historyData:[],elementHistoryTotalPages:1}),n="revisionHistorySlice",s=(0,t.createSlice)({name:n,initialState:d,reducers:{resetElementHistorySlice:()=>({...d}),setElementHistory:(e,a)=>{0!==a.payload.length&&(e.historyData=a.payload)}},extraReducers:e=>{e.addMatcher(o.GY.endpoints.getEmailHistory.matchFulfilled,((e,{meta:a,payload:l})=>{var t;e.elementHistoryTotalPages=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages")),a.arg.originalArgs.page&&1!==a.arg.originalArgs.page||(e.historyData=l.data||[])})),e.addMatcher(i.VM.endpoints.getBlockHistory.matchFulfilled,((e,{meta:a,payload:l})=>{var t;e.elementHistoryTotalPages=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages")),l.args.page&&1!==l.args.page||(e.historyData=l.data||[])}))}}),{resetElementHistorySlice:r}=s.actions,{setElementHistory:m}=s.actions,c=e=>e[n].historyData,p=e=>e[n].elementHistoryTotalPages,u=s},86286:(e,a,l)=>{l.d(a,{Ay:()=>T,B:()=>E,B$:()=>k,C1:()=>h,hZ:()=>y,ko:()=>u,ku:()=>c,ww:()=>r,yf:()=>v});var t=l(90536),o=l(39990),i=l(85163),d=l(32269);const n=(0,l(31770).ur)({currentUser:{},currentSchema:{},monacoOptions:i.rW,monacoDidMount:!1}),s="userSlice",r=(0,t.createAsyncThunk)("user/setMonacoOptions",(async(e,{getState:a})=>{const l=a()[s],t="string"===typeof e.font_family?`${e.font_family}, sans-serif`:void 0,o=void 0!==e.word_wrap?e.word_wrap?"on":"off":void 0;return t&&l.monacoOptions.fontFamily!==t&&await(0,d.iV)(e.font_family),{tabSize:e.tab_size,fontFamily:t,fontSize:e.font_size,wordWrap:o,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}})),m=(0,t.createSlice)({name:s,initialState:n,reducers:{setMonacoDidMount:(e,{payload:a})=>{e.monacoDidMount=a},setTheme:(e,{payload:a})=>{e.currentUser.theme=a},setUserLocale:(e,{payload:a})=>{e.currentUser.locale=a},setUserAutosaves:(e,{payload:a})=>{e.currentUser.autosaves=a},setUser:(e,{payload:a})=>{e.currentUser={...e.currentUser,...a}}},extraReducers:e=>{e.addCase(r.fulfilled,((e,a)=>{const l=a.payload;e.monacoOptions=(0,d.i0)({...e.monacoOptions},l)})),e.addMatcher(o.Q2.endpoints.editMe.matchFulfilled,((e,a)=>{e.currentUser=a.payload})),e.addMatcher(o.Q2.endpoints.getMe.matchFulfilled,((e,a)=>{e.currentUser=a.payload})),e.addMatcher(o.Q2.endpoints.getSchema.matchFulfilled,((e,a)=>{e.currentSchema=a.payload.schema}))}}),{setMonacoDidMount:c,setTheme:p,setUserLocale:u,setUserAutosaves:g,setUser:b}=m.actions,E=e=>{var a;return null===(a=e[s].currentUser)||void 0===a?void 0:a.locale},h=e=>e[s].currentUser,v=e=>e[s].currentSchema,y=e=>e[s].monacoOptions,k=e=>{var a;return 3891!==(null===(a=e[s].currentUser.subscription)||void 0===a?void 0:a.ID)},T=m}}]);