Your IP : 216.73.216.240


Current Path : /home/j/u/v/juvelize/martine/tmp/install_61b0f5c54c150/media/js/
Upload File :
Current File : /home/j/u/v/juvelize/martine/tmp/install_61b0f5c54c150/media/js/editor_wysid_utils.min.js

"use strict";var acym_helperBlockSeparator={$container:"",onePartContainer:"",rightBorder:"",leftBorder:"",xAxis:10,maxXAxis:10,newXAxis:"",distanceMax:5,blockName:{0:"A",1:"B",2:"C",3:"D"},initBlockSeparator:function(){if(acym_helperBlockSeparator.$container=jQuery(".acym__wysid__context__modal__container__block-settings"),acym_helperBlockSeparator.$container.length<1)return!0;acym_helperBlockSeparator.$container.html(acym_helperBlockSeparator.areaGrid()),setTimeout(function(){acym_helperBlockSeparator.initRows(),acym_helperBlockSeparator.onePartContainer=acym_helperBlockSeparator.$container[0].offsetWidth/12,acym_helperBlockSeparator.initMouseDown()},500)},initRows:function(){var e=jQuery(".acym__wysid__row__element--focus").find(".acym__wysid__row__element__th"),t=jQuery(".acym__wysid__context__modal__container--structure");if(e.length<=1)return t.hide(),!0;acym_helperBlockSeparator.initPadding(),acym_helperBlockSeparator.initBackgroundColor(),t.show(),e.each(function(t){var i=acym_helperBlockSeparator.getLargeClass(jQuery(this)),_=void 0!==e[t+1],a=void 0!==e[t-1];acym_helperBlockSeparator.$container.append(acym_helperBlockSeparator.generateArea(i[1],_,a,t))})},elasticSVG:function(e){var t=jQuery(".separator_grabbed").find("path"),i=t.offset().left,_=e.clientX>i,a=_?e.clientX-i:i-e.clientX,o=a>acym_helperBlockSeparator.distanceMax?acym_helperBlockSeparator.maxXAxis:a*acym_helperBlockSeparator.maxXAxis/acym_helperBlockSeparator.distanceMax;acym_helperBlockSeparator.newXAxis=_?acym_helperBlockSeparator.xAxis+o:acym_helperBlockSeparator.xAxis-o,t.attr("d","M 10,10 C 10 10, "+acym_helperBlockSeparator.newXAxis+" 50, 10 90")},releaseSVG:function(){var e=acym_helperBlockSeparator.newXAxis>acym_helperBlockSeparator.xAxis?acym_helperBlockSeparator.xAxis-6:acym_helperBlockSeparator.xAxis+6,t=jQuery(".separator_grabbed");t.find("path").attr("d","M 10,10 C 10 10, "+e+" 50, 10 90"),setTimeout(function(){t.find("path").attr("d","M 10,10 C 10 10, "+acym_helperBlockSeparator.xAxis+" 50, 10 90")},150)},initMouseDown:function(){jQuery(".separator_right, .separator_left").off("mousedown").on("mousedown",function(e){jQuery(".acym__wysid__row__selector, .acym__wysid__element__toolbox").remove();var t=jQuery(this);t.addClass("separator_grabbed"),acym_helperBlockSeparator.$container.find(".acym__wysid__context__modal__container__block-settings--grid").addClass("grid-visible");var i=jQuery(this).closest(".cell"),_=i.next(),a=i.prev(".acym__block__separator__area");acym_helperBlockSeparator.initMouseMove(i,_,a,-1!==t.attr("class").indexOf("left")),acym_helperBlockSeparator.setMouseUp(t)})},setMouseUp:function(e){jQuery(document).off("mouseup").on("mouseup",function(){jQuery(document).off("mousemove"),acym_helperBlockSeparator.releaseSVG(),e.removeClass("separator_grabbed"),acym_helperBlockSeparator.$container.find(".grid-visible").removeClass("grid-visible"),acym_editorWysidRowSelector.setRowSelector()})},setRightBorder:function(e){acym_helperBlockSeparator.rightBorder=parseInt(e.offset().left)+parseInt(e.width())-20},setLeftBorder:function(e){acym_helperBlockSeparator.leftBorder=parseInt(e.offset().left)},changeLength:function(e,t){e.find(".area__length").html(t)},getLargeClass:function(e){var t=e.attr("class").match(/(large\-)([0-9]*)/);return null!==t&&[t[1],parseInt(t[2])]},initMouseMove:function(e,t,i,_){acym_helperBlockSeparator.setRightBorder(e),acym_helperBlockSeparator.setLeftBorder(e),jQuery(document).off("mousemove").on("mousemove",function(a){acym_helperBlockSeparator.elasticSVG(a);var o=a.clientX;o>acym_helperBlockSeparator.rightBorder?!_&&acym_helperBlockSeparator.rightBorder+acym_helperBlockSeparator.onePartContainer<o&&acym_helperBlockSeparator.up(e,t,i,!1):o<acym_helperBlockSeparator.rightBorder&&!_&&acym_helperBlockSeparator.rightBorder-acym_helperBlockSeparator.onePartContainer>o&&acym_helperBlockSeparator.down(e,t,i,!1),o>acym_helperBlockSeparator.leftBorder?_&&acym_helperBlockSeparator.leftBorder+acym_helperBlockSeparator.onePartContainer<o&&acym_helperBlockSeparator.down(e,t,i,!0):o<acym_helperBlockSeparator.leftBorder&&_&&acym_helperBlockSeparator.leftBorder-acym_helperBlockSeparator.onePartContainer>o&&acym_helperBlockSeparator.up(e,t,i,!0)})},up:function(e,t,i,_){var a=_?i:t,o=acym_helperBlockSeparator.getLargeClass(e),r=acym_helperBlockSeparator.getLargeClass(a);if(1===r[1])return!0;o[1]++,r[1]--;var s=o[0]+o[1],n=r[0]+r[1];e.attr("class","cell acym__block__separator__area "+s),a.attr("class","cell acym__block__separator__area "+n),acym_helperBlockSeparator.changeLength(e,o[1]),acym_helperBlockSeparator.changeLength(a,r[1]),acym_helperBlockSeparator.changeInTemplate(),acym_helperBlockSeparator.initMouseMove(e,t,i,_)},down:function(e,t,i,_){var a=_?i:t,o=acym_helperBlockSeparator.getLargeClass(e),r=acym_helperBlockSeparator.getLargeClass(a);if(1===o[1])return!0;o[1]--,r[1]++;var s=o[0]+o[1],n=r[0]+r[1];e.attr("class","cell acym__block__separator__area "+s),a.attr("class","cell  acym__block__separator__area "+n),acym_helperBlockSeparator.changeLength(e,o[1]),acym_helperBlockSeparator.changeLength(a,r[1]),acym_helperBlockSeparator.changeInTemplate(),acym_helperBlockSeparator.initMouseMove(e,t,i,_)},generateArea:function(e,t,i,_){var a='<svg width="20" height="100" class="sidebar" viewBox="0 0 20 100"><path class="s-path" fill="none" d="M 10,10 C 10 10, 10 50, 10 90" stroke-linecap="round"/></svg>',o=t?'<div class="separator_right">'.concat(a,"</div>"):"",r=i?'<div class="separator_left">'.concat(a,"</div>"):"";return'<div class="cell large-'.concat(e,' acym__block__separator__area"><p class="area__name">').concat(acym_helperBlockSeparator.blockName[_],'</p><p class="area__length">').concat(e,"</p>").concat(o).concat(r,"</div>")},changeInTemplate:function(){var e=jQuery(".acym__wysid__row__element--focus").find(".acym__wysid__row__element__th"),t={};acym_helperBlockSeparator.$container.find(" > .acym__block__separator__area").each(function(e){var i=acym_helperBlockSeparator.getLargeClass(jQuery(this));t[e]=i[0]+i[1]}),e.each(function(e){var i=acym_helperBlockSeparator.getLargeClass(jQuery(this));jQuery(this).removeClass(i[0]+i[1]),jQuery(this).addClass(t[e])})},areaGrid:function(){for(var e='<div class="cell grid-x acym-grid-margin-x acym__wysid__context__modal__container__block-settings--grid">',t=0;t<12;t++)e+='<div class="cell large-1"></div>';return e+="</div>"},initPadding:function(){var e=jQuery(".acym__wysid__row__element--focus .acym__wysid__row__element__th"),t=jQuery(".acym__wysid__context__modal__block-padding"),i='<h6 class="cell margin-top-1 acym__wysid__context__block__padding__title">'.concat(ACYM_JS_TXT.ACYM_SPACE_BETWEEN_BLOCK,"</h6>");t.html(i);for(var _="",a="",o=0;o<e.length-1;o++){var r=acym_helper.getIntValueWithoutPixel(e[o].style.paddingRight),s=acym_helper.getIntValueWithoutPixel(e[o+1].style.paddingLeft)+r,n=acym_helperBlockSeparator.blockName[o],c=acym_helperBlockSeparator.blockName[o+1],l=acym_helper.sprintf(ACYM_JS_TXT.ACYM_X1_AND_X2,n,c),d='<div class="cell grid-x acym_vcenter margin-bottom-1"><p class="cell shrink">'.concat(l,"</p>");d+='<input type="number" min="0" id="acym__wysid__context__block__padding-'.concat(o,'" value="').concat(s,'" class="cell margin-bottom-0 small-4 margin-left-1 acym__wysid__context__block__padding--input">'),_+=d+="</div>";var y='<div class="cell grid-x acym_vcenter margin-bottom-1"><p class="cell shrink">'.concat(l,"</p>");y+='<input type="number" min="0" id="acym__wysid__context__block__vertical__padding-'.concat(o,'" value="0" class="cell margin-bottom-0 small-4 margin-left-1 acym__wysid__context__block__vertical__padding--input">'),a+=y+="</div>"}i+='<div class="cell grid-x small-6 acym__wysid__context__block__padding__horizontal">',i+='<p class="cell margin-bottom-1">'.concat(ACYM_JS_TXT.ACYM_HORIZONTAL_PADDING," ").concat(acym_helperTooltip.addInfo(ACYM_JS_TXT.ACYM_HORIZONTAL_PADDING_DESC),"</p>"),i+=_,i+="</div>",i+='<div class="cell grid-x small-6">',i+='<p class="cell margin-bottom-1">'.concat(ACYM_JS_TXT.ACYM_VERTICAL_PADDING," ").concat(acym_helperTooltip.addInfo(ACYM_JS_TXT.ACYM_VERTICAL_PADDING_DESC),"</p>"),i+=a,i+="</div>",t.html(i),acym_helperTooltip.setTooltip(),acym_helperBlockSeparator.setPadding(e),acym_helperBlockSeparator.setVerticalPadding(e)},setPadding:function(e){jQuery(".acym__wysid__context__block__padding--input").off("change").on("change",function(t){var i=jQuery(this),_=i.val();_<0&&i.val(0);var a=i.attr("id").split("-");if(void 0===a[1])return!1;var o=Math.round(_/2);a[1]=parseInt(a[1]),jQuery(e[a[1]]).css("padding-right",o+"px"),jQuery(e[a[1]+1]).css("padding-left",o+"px")})},setVerticalPadding:function(e){var t=jQuery(e[0]).closest(".acym__wysid__row__element");""!==t.attr("id")&&void 0!==t.attr("id")||t.attr("id",this.generatedNewIdParentTable());for(var i=jQuery('[data-vertical-padding="'.concat(t.attr("id"),'"]')),_=0;_<e.length;_++)if(-1===jQuery(e[_]).attr("class").indexOf("acym__wysid__row__element__th__vertical__padding"))jQuery(e[_]).addClass("acym__wysid__row__element__th__vertical__padding-"+_);else if(i.length>0){var a=i.html(),o="acym__wysid__row__element__th__vertical__padding-".concat(_,"{padding-top: ([0-9]*)px"),r="acym__wysid__row__element__th__vertical__padding-".concat(_,"{padding-bottom: ([0-9]*)px"),s=new RegExp(o,"g"),n=new RegExp(r,"g"),c=s.exec(a),l=n.exec(a);if(null!==c){var d=jQuery("#acym__wysid__context__block__vertical__padding-".concat(_-1));d.val(parseInt(d.val())+parseInt(c[1]))}if(null!==l){var y=jQuery("#acym__wysid__context__block__vertical__padding-".concat(_));y.val(parseInt(y.val())+parseInt(l[1]))}}jQuery(".acym__wysid__context__block__vertical__padding--input").off("change").on("change",function(){var e=jQuery(this);if(e.val()<0)e.val(0);else{(i=jQuery('[data-vertical-padding="'.concat(t.attr("id"),'"]'))).length>0&&i.remove();var _="";jQuery(".acym__wysid__context__block__vertical__padding--input").each(function(e,i){i=jQuery(i);var a=e+1,o=Math.round(i.val()/2);_+="#".concat(t.attr("id")," .acym__wysid__row__element__th__vertical__padding-").concat(e,"{padding-bottom: ").concat(o,"px !important}"),_+="#".concat(t.attr("id")," .acym__wysid__row__element__th__vertical__padding-").concat(a,"{padding-top: ").concat(o,"px !important}")}),t.prepend('<style data-vertical-padding="'.concat(t.attr("id"),'">\n                                            @media screen and (max-width: 480px){\n                                                ').concat(_,"\n                                            }\n                                         </style>"))}})},generatedNewIdParentTable:function(){var e="acym__wysid__row__element"+Math.floor(Math.random()*Math.floor(9999999));return jQuery("#".concat(e)).length>0?this.generatedNewIdParentTable():e},changeIdOnduplicate:function(e){var t=this.generatedNewIdParentTable(),i=e.attr("id");if(void 0===i)return e;e.attr("id",t);var _=e.find("[data-vertical-padding]");if(0===_.length)return e;var a=_.html();_.attr("data-vertical-padding",t);var o=new RegExp(i,"g");return _.html(a.replace(o,t)),e},initBackgroundColor:function(){for(var e=jQuery(".acym__wysid__row__element--focus .acym__wysid__row__element__th"),t=jQuery(".acym__wysid__context__modal__block-background"),i='<h6 class="cell shrink acym__wysid__context__block__background__title margin-right-1">\n                        '.concat(ACYM_JS_TXT.ACYM_BACKGROUND_COLOR).concat(acym_helperTooltip.addInfo(ACYM_JS_TXT.ACYM_BACKGROUND_COLOR_DESC),":\n                    </h6>"),_=0;_<e.length;_++)i+='<div class="cell large-2 grid-x acym_vcenter">\n                        <span class="cell shrink">'.concat(this.blockName[_],':</span>\n                        <input class="cell shrink acym__wysid__context__block__background__color-picker" data-acym-block="').concat(_,'">\n                      </div>');t.html(i),acym_helperTooltip.setTooltip(),this.setBackgroundColor(e)},setBackgroundColor:function(e){jQuery(".acym__wysid__context__block__background__color-picker").each(function(){var t=jQuery(e[jQuery(this).attr("data-acym-block")]);acym_editorWysidColorPicker.setColorPickerForContextModal(jQuery(this),"background",t,t,"background",!0)})}},acym_editorWysidColorPicker={setColorPickerForContextModal:function(e,t,i,_,a){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]&&arguments[6];e.spectrum({color:_.css(t),preferredFormat:"hex",showButtons:!1,showInput:!0,allowEmpty:o,showAlpha:r,move:function(e){i.css(a,acym_editorWysidColorPicker.getHexStringFromColor(e,r))},change:function(e){i.css(a,acym_editorWysidColorPicker.getHexStringFromColor(e,r))},containerClassName:"acym__context__color__picker"})},getHexStringFromColor:function(e,t){return null===e?"rgba(0,0,0,0)":t?e.toRgbString():e.toHexString()},setRowColorPickerWYSID:function(e){jQuery("#acym__wysid__context__block__background-color").spectrum({color:e.css("background-color"),preferredFormat:"hex",showButtons:!1,showInput:!0,showInitial:!0,showPalette:!0,palette:[["#fff"],["#000"]],maxSelectionSize:1,move:function(t){e.css("background-color",t.toHexString()).attr("bgcolor",t.toHexString()),e.css("background-image","")},change:function(t){e.css("background-color",t.toHexString()).attr("bgcolor",t.toHexString()),e.css("background-image","")}})},setGeneralColorPickerWYSID:function(){var e=jQuery(".acym__wysid__template__content");jQuery("#acym__wysid__background-colorpicker").spectrum({color:e.css("background-color"),preferredFormat:"hex",showButtons:!1,showInput:!0,showPalette:!0,palette:[["#fff"],["#000"]],maxSelectionSize:1,move:function(e){acym_editorWysidFontStyle.setSettingsElementStyle("#acym__wysid__background-colorpicker","background-color",e.toHexString())},change:function(e){acym_editorWysidFontStyle.setSettingsElementStyle("#acym__wysid__background-colorpicker","background-color",e.toHexString())}})},setSettingsColorPickerWYSID:function(e){var t=jQuery("#acym__wysid__right__toolbar__settings__color"),i=jQuery("#acym__wysid__right__toolbar__settings__font--select").val();t.spectrum({color:""!=e?e:"black",preferredFormat:"hex",showButtons:!1,showInput:!0,showPalette:!0,palette:[["#fff"],["#000"]],maxSelectionSize:1,move:function(e){acym_editorWysidFontStyle.setSettingsElementStyle(i,"color",e.toHexString())},change:function(e){acym_editorWysidFontStyle.setSettingsElementStyle(i,"color",e.toHexString())}})}},acym_editorWysidContextModal={clickedOnScrollbar:function(e){var t=jQuery("#acym__wysid__right-toolbar"),i=t.offset(),_=Math.round(i.left);return i.left<=e&&e<=_+t.width()},hideContextModal:function(e,t){e.hide(),jQuery(".acym__wysid__right__toolbar__current-block__empty").show(),void 0!==t&&acym_editorWysidContextModal.isOpeningContextModal(t)||jQuery("#acym__wysid__right__toolbar__design__tab").click()},isOpeningContextModal:function(e){var t=!1;return jQuery.each(["acymailing_content","acym__wysid__tinymce--image","acym__wysid__column__element__separator","acym__wysid__column__element__share","acym__wysid__column__element__follow","acy-editor__space","acym__wysid__column__element__button","acym__wysid__row__selector","acym__wysid__right__toolbar__tabs","acym__wysid__tinymce--text"],function(i,_){e.closest("."+_).length>0&&(t=!0)}),t},showContextModal:function(e){jQuery(".acym__wysid__context__modal").hide(),jQuery("#acym__wysid__right__toolbar__block__tab").click(),e.show(),jQuery(".acym__wysid__right__toolbar__current-block__empty").hide(),jQuery("#acym__wysid__right__toolbar__current-block").off("mousedown").on("mousedown",function(e){e.stopPropagation()}),acym_editorWysidToolbar.setRightToolbarWYSID()},setBlockContextModalWYSID:function(){jQuery(".acym__wysid__row__selector").off("click").on("click",function(e){e.stopPropagation(),e.preventDefault();var t="#ffffff";jQuery(".acym__wysid__row__selector--focus").removeClass("acym__wysid__row__selector--focus"),jQuery(".acym__wysid__row__element--focus").removeClass("acym__wysid__row__element--focus");var i=jQuery(this).closest(".acym__wysid__row__element"),_=jQuery(this);_.addClass("acym__wysid__row__selector--focus"),_.closest(".acym__wysid__row__element").addClass("acym__wysid__row__element--focus"),acym_editorWysidColorPicker.setColorPickerForContextModal(jQuery("#acym__wysid__context__block__background-color"),"background-color",i,i,"background-color"),acym_editorWysidColorPicker.setColorPickerForContextModal(jQuery("#acym__wysid__context__block__border__color"),"border-color",i,i,"border-color"),acym_editorWysidColorPicker.setRowColorPickerWYSID(i),acym_editorWysidImage.addBackgroundImgToRows(i),"transparent"===i.css("background-color")&&jQuery(".acym__wysid__context__block__transparent__bg").click(),jQuery('[name="transparent_background"]').next().off("change").on("change",function(){jQuery(this).is(":checked")?(t=i.css("background-color"),i.css("background-color","transparent").attr("bgcolor","transparent")):i.css("background-color",t).attr("bgcolor",t)}),acym_helperBlockSeparator.initBlockSeparator();var a=jQuery("#acym__wysid__context__block__custom_id");a.val(i.attr("id")),a.off("keyup").on("keyup",function(e){32===e.which&&e.preventDefault(),i.attr("id",jQuery(this).val())}),jQuery("[data-block-padding]").each(function(){jQuery(this).val(i.css("padding-"+jQuery(this).attr("data-block-padding")).replace(/[^-\d\.]/g,"")),jQuery(this).off("change").on("change",function(e){i.css("padding-"+jQuery(this).attr("data-block-padding"),jQuery(this).val()+"px"),"top"!==jQuery(this).attr("data-block-padding")&&"bottom"!==jQuery(this).attr("data-block-padding")||_.css("height",i.height()+parseInt(i.css("padding-top").replace(/[^-\d\.]/g,""))+parseInt(i.css("padding-bottom").replace(/[^-\d\.]/g,""))+"px")})}),jQuery(".acym__wysid__context__block__border__actions").each(function(){jQuery(this).val(i.css(jQuery(this).attr("data-css")).replace(/[^-\d\.]/g,"")),jQuery(this).off("change").on("change",function(e){if(jQuery(this).val()>parseInt(jQuery(this).attr("max"))&&(jQuery(this).val(parseInt(jQuery(this).attr("max"))),e.stopPropagation()),i.css(jQuery(this).attr("data-css"),jQuery(this).val()+"px"),"border-width"===jQuery(this).attr("data-css")){i.css("border-style",0===jQuery(this).val()?"none":"solid");var t=jQuery(".acym__wysid__template__content").offset(),a=_.closest(".acym__wysid__row__element").offset(),o=i.height()+parseInt(i.css("padding-top").replace(/[^-\d\.]/g,""))+parseInt(i.css("padding-bottom").replace(/[^-\d\.]/g,""))+2*parseInt(i.css("border-width").replace(/[^-\d\.]/g,""));_.css({left:"-"+(a.left-t.left+parseInt(_.closest(".acym__wysid__row__element").css("border-width").replace(/[^-\d\.]/g,"")))+"px",height:o,top:0-parseInt(i.css("border-width").replace(/[^-\d\.]/g,""))+"px"})}})}),jQuery("#acym__wysid__context__block__edit-html").off("click").on("click",function(){var e=new Event("editor_change"),t=document.getElementById("acym__wysid__block__html__content"),_=i.find("> tbody");_.find(".acym__wysid__element__toolbox").remove(),t.value=_.html(),t.dispatchEvent(e),jQuery("#acym__wysid__editor__source, #acym__wysid__right-toolbar__overlay").addClass("acym__wysid__visible")});var o=jQuery("#acym__wysid__context__block");acym_editorWysidContextModal.showContextModal(o),o.off("mousedown").on("mousedown",function(e){jQuery(".sp-container").addClass("sp-hidden").attr("style",""),e.stopPropagation()}),jQuery(window).off("mousedown").on("mousedown",function(e){return!!acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,o)||(!!jQuery(e.target).hasClass("acym__wysid__row__toolbox__edit")||void(!jQuery(e.target).hasClass("acym__wysid__row__selector")&&!jQuery(".sp-container").is(":visible")&&!jQuery(e.target).closest("#acym__wysid__editor__source").length>0&&(jQuery("#acym__wysid__editor__source, #acym__wysid__right-toolbar__overlay").removeClass("acym__wysid__visible"),jQuery(".acym__wysid__row__selector--focus").removeClass("acym__wysid__row__selector--focus"),jQuery(".acym__wysid__row__element--focus").removeClass("acym__wysid__row__element--focus"),t="#ffffff",jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(o,jQuery(e.target)),jQuery(".acym__wysid__context__modal__container--structure").hide(),jQuery(e.target).parent().hasClass("acym__wysid__tinymce--text")||acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave())))})})},setImageContextModal:function(e){jQuery(".acym__wysid__media__inserted--selected").removeClass("acym__wysid__media__inserted--selected"),e.addClass("acym__wysid__media__inserted--selected");var t=jQuery("#acym__wysid__context__image"),i=jQuery(".acym__wysid__context__image__align"),_=jQuery("#acym__wysid__context__image__link"),a=jQuery("#acym__wysid__context__image__url");i.css("background-color","inherit"),jQuery('[data-float="'+jQuery(".acym__wysid__media__inserted--selected").css("float")+'"]').css("background-color",""),i.each(function(){jQuery(this).off("click").on("click",function(){var e=jQuery(".acym__wysid__media__inserted--selected"),t=acym_helper.parseJson(jQuery(this).attr("data-css")),i="none"===jQuery(this).attr("data-float")?"center":jQuery(this).attr("data-float");e.css(t),e.closest("div").find(".acym__wysid__media_caption").css(t),e.closest("div").css("text-align",i),jQuery(".acym__wysid__context__image__align").css("background-color","inherit"),jQuery(this).css("background-color","")})});var o=jQuery(".acym__wysid__media__inserted--selected").closest(".acym__wysid__link__image");_.val(o.length>0?o.attr("href"):""),a.val(jQuery(".acym__wysid__media__inserted--selected").attr("src")),jQuery("#acym__wysid__context__image__change").off("click").on("click",function(){var e=jQuery(".acym__wysid__media__inserted--selected");e.hasClass("acym__wysid__media__giphy")?acym_editorWysidNewContent.addGiphyWYSID(e.closest(".acym__wysid__column__element")):acym_editorWysidImage.openMediaManage(e.closest(".acym__wysid__column__element"))}),a.off("keyup").on("keyup",function(){jQuery(".acym__wysid__media__inserted--selected").attr("src",this.value)}),_.off("keyup").on("keyup",function(){var e=jQuery(".acym__wysid__media__inserted--selected").closest(".acym__wysid__link__image");if(e.length>0&&""===jQuery(this).val())e.replaceWith(jQuery(".acym__wysid__media__inserted--selected")[0].outerHTML);else if(0===e.length&&""===jQuery(this).val())return!0;0===e.length?jQuery(".acym__wysid__media__inserted--selected").replaceWith('<a href="'+jQuery(this).val()+'" target="_blank" class="acym__wysid__link__image">'+jQuery(".acym__wysid__media__inserted--selected")[0].outerHTML+"</a>"):e.attr("href",jQuery(this).val())}),acym_editorWysidContextModal.showContextModal(t),t.off("mousedown").on("mousedown",function(e){e.stopPropagation()}),jQuery(window).off("mousedown").on("mousedown",function(i){if(acym_editorWysidContextModal.clickedOnScrollbar(i.clientX,t)||jQuery(i.target).hasClass("acym__wysid__media__inserted"))return!0;jQuery(".acym__wysid__media__inserted--selected").removeClass("acym__wysid__media__inserted--selected"),jQuery(this).off("mousedown"),(new Date).getTime()<acym_helperEditorWysid.timeClickImage+100&&acym_editorWysidImage.doubleClickImage(e),acym_editorWysidContextModal.hideContextModal(t,jQuery(i.target)),acym_helperEditorWysid.setColumnRefreshUiWYSID(!1),acym_editorWysidVersioning.setUndoAndAutoSave()})},setTextContextOptions:function(){jQuery(".acym__wysid__tinymce--text").off("click").on("click",function(e){var t=jQuery("#acym__wysid__context__text");if(t.is(":visible"))return!0;acym_editorWysidContextModal.showContextModal(t);jQuery(this).closest(".acym__wysid__column__element__td");jQuery(window).off("mousedown").on("mousedown",function(e){return!!acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,t)||(jQuery(e.target).closest(".acym__wysid__tinymce--text").length>0||(jQuery(e.target).closest("#acym__wysid__text__tinymce__editor").length>0||(jQuery(e.target).closest(".mce-floatpanel").length>0||(jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(t,jQuery(e.target)),jQuery(window).unbind("click"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),void acym_editorWysidVersioning.setUndoAndAutoSave()))))})})},setButtonContextModalWYSID:function(){jQuery(".acym__wysid__column__element__button").off("click").on("click",function(e){e.stopPropagation(),e.preventDefault(),jQuery(".acym__context__color__picker").remove(),jQuery(".acym__wysid__column__element__button--focus").removeClass("acym__wysid__column__element__button--focus"),jQuery(this).addClass("acym__wysid__column__element__button--focus"),jQuery(this).hasClass("acym__wysid__content-no-settings-style")||jQuery(this).addClass("acym__wysid__content-no-settings-style");var t=jQuery(this);acym_editorWysidColorPicker.setColorPickerForContextModal(jQuery("#acym__wysid__context__button__background-color"),"background-color",t,t,"background-color",!1,!0),acym_editorWysidColorPicker.setColorPickerForContextModal(jQuery("#acym__wysid__context__button__border-color"),"border-left-color",t,t,"border-color"),acym_editorWysidColorPicker.setColorPickerForContextModal(jQuery("#acym__wysid__context__button__color"),"color",t,t,"color");var i=jQuery(".acym__wysid__context__button__link__container"),_=jQuery(".acym__wysid__context__button__text__container"),a=jQuery(".acym__wysid__context__button--type").addClass("button-radio-unselected").removeClass("button-radio-selected");-1!==t.attr("href").indexOf("{confirm}")?(jQuery('[acym-data-type="confirm"]').removeClass("button-radio-unselected").addClass("button-radio-selected"),i.hide()):-1!==t.attr("href").indexOf("{unsubscribe}")?(jQuery('[acym-data-type="unsubscribe"]').removeClass("button-radio-unselected").addClass("button-radio-selected"),i.hide()):(jQuery('[acym-data-type="call-action"]').removeClass("button-radio-unselected").addClass("button-radio-selected"),i.show()),a.off("click").on("click",function(){var e=jQuery(this);if(e.hasClass("button-radio-unselected")){a.addClass("button-radio-unselected").removeClass("button-radio-selected"),e.removeClass("button-radio-unselected").addClass("button-radio-selected");var t=e.attr("acym-data-type");if(-1!==t.indexOf("call-action"))i.find("#acym__wysid__context__button__link, .acym__wysid__context__button__link").val("#").trigger("change"),_.find("#acym__wysid__context__button__text").val(ACYM_JS_TXT.ACYM_BUTTON).trigger("change"),i.show();else{var o="{".concat(t,"}{/").concat(t,"}");i.find("#acym__wysid__context__button__link, .acym__wysid__context__button__link").val(o).trigger("change"),_.find("#acym__wysid__context__button__text").val(ACYM_JS_TXT["ACYM_".concat(t.toUpperCase())]).trigger("change"),i.hide()}}});var o=jQuery("#acym__wysid__context__button");jQuery("#acym__wysid__context__button__border-radius").val(t.css("border-radius").replace(/[^-\d\.]/g,"")).off("change paste keyup").on("change paste keyup",function(){t.css("border-radius",jQuery(this).val()+"px")}),jQuery("#acym__wysid__context__button__border-width").val(t.css("border-left-width").replace(/[^-\d\.]/g,"")).off("change paste keyup").on("change paste keyup",function(){t.css("border-width",jQuery(this).val()+"px")}),jQuery("#acym__wysid__context__button__font-family").val(t.css("font-family").replace(/['"]/g,"")).off("change").on("change",function(){t.css("font-family",jQuery(this).val())}),jQuery("#acym__wysid__context__button__font-size").val(t.css("font-size").replace(/[^-\d\.]/g,"")).off("change").on("change",function(){t.css("font-size",jQuery(this).val()+"px")}),jQuery("#acym__wysid__context__button__text").val(t.text()).off("change paste keyup").on("change paste keyup",function(){t.text(jQuery(this).val())}),jQuery("#acym__wysid__context__button__link, .acym__wysid__context__button__link").val(t.attr("href")).off("change paste keyup").on("change paste keyup",function(){jQuery(this).val(jQuery(this).val().trim()),t.attr("href",jQuery(this).val())}),jQuery("#acym__wysid__context__button__bold").css("background-color",700==t.css("font-weight")?"":"inherit").off("click").on("click",function(){700==t.css("font-weight")?(jQuery("#acym__wysid__context__button__bold").css("background-color","inherit"),t.css("font-weight","inherit")):(jQuery("#acym__wysid__context__button__bold").css("background-color",""),t.css("font-weight",700))}),jQuery("#acym__wysid__context__button__italic").css("background-color","italic"===t.css("font-style")?"":"inherit").off("click").on("click",function(){"italic"===t.css("font-style")?(jQuery("#acym__wysid__context__button__italic").css("background-color","inherit"),t.css("font-style","inherit")):(jQuery("#acym__wysid__context__button__italic").css("background-color",""),t.css("font-style","italic"))}),jQuery(".acym__wysid__context__button__align").each(function(){jQuery(this).css("background-color","acym__wysid__context__button__align__"+t.closest("div").css("text-align")===jQuery(this).attr("id")?"":"inherit"),jQuery(this).off("click").on("click",function(){t.closest("div").css("text-align",jQuery(this).attr("data-align")),jQuery(".acym__wysid__context__button__align").css("background-color","inherit"),jQuery(this).css("background-color","")})}),jQuery(".acym__button__padding__input").each(function(){jQuery(this).val(t.css(jQuery(this).attr("name")).replace(/[^-\d\.]/g,"")),jQuery(this).off("change").on("change",function(){t.css(jQuery(this).attr("name"),jQuery(this).val()+"px")})}),ACYM_IS_ADMIN&&(jQuery("#acym__wysid__context__button__font-family").select2({theme:"foundation",width:"40%"}),jQuery("#acym__wysid__context__button__font-size").select2({theme:"foundation",width:"15%",minimumResultsForSearch:1/0}),jQuery("#acym__wysid__context__button__border-width").select2({theme:"foundation",width:"15%",minimumResultsForSearch:1/0}),jQuery("#acym__wysid__context__button__border-radius").select2({theme:"foundation",width:"15%",minimumResultsForSearch:1/0})),o.find(".switch-input").off("change"),("100%"===document.getElementsByClassName("acym__wysid__column__element__button--focus")[0].style.width&&!o.find(".switch-input").is(":checked")||"100%"!==document.getElementsByClassName("acym__wysid__column__element__button--focus")[0].style.width&&o.find(".switch-input").is(":checked"))&&o.find(".switch-paddle").click(),o.find(".slider-handle").each(function(){var e,i,_;"slider__output__button__width"===jQuery(this).attr("aria-controls")?(e="left",_=90*(i=t.css("padding-right").replace(/[^-\d\.]/g,""))/100,jQuery(this).next().css("width",i+"%")):(e="top",_=77*(i=t.css("padding-top").replace(/[^-\d\.]/g,""))/100,jQuery(this).next().css("height",i+"%")),jQuery(this).css(e,_+"%"),jQuery("#"+jQuery(this).attr("aria-controls")).val(i)}),o.find(".switch-input").off("change").on("change",function(){var e,i;jQuery(this).is(":checked")?(e="100%",i="0"):(e="auto",i=jQuery("#slider__output__button__width").val()+"px"),t.css({width:e,"padding-right":i,"padding-left":i})}),jQuery(".acym__wysid__context__button__slider").off("moved.zf.slider").on("moved.zf.slider",function(){var e=jQuery("#"+jQuery(this).attr("data-output")).val(),i="slider__output__button__width"!==jQuery(this).attr("data-output")?{"padding-top":e+"px","padding-bottom":e+"px"}:{"padding-right":e+"px","padding-left":e+"px"};t.css(i)}),acym_editorWysidContextModal.showContextModal(o),acym_helperTooltip.setTooltip(),o.off("mousedown").on("mousedown",function(e){jQuery(".sp-container").addClass("sp-hidden").attr("style",""),e.stopPropagation()}),jQuery(window).on("mousedown",function(e){jQuery(".sp-container").is(":visible")||acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,o)||(jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(o,jQuery(e.target)),jQuery(window).unbind("click"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave())})})},setSpaceContextModalWYSID:function(){jQuery(".acy-editor__space").off("click").on("click",function(e){e.stopPropagation(),jQuery(".acym__context__color__picker").remove();var t=jQuery(this),i=jQuery("#acym__wysid__context__space"),_=i.find(".slider-handle");acym_editorWysidContextModal.showContextModal(i);var a=t.closest(".acym__wysid__column__element__td"),o=a.css("height").replace(/[^-\d\.]/g,"");t.css("height","100%"),a.css("height",o+"px"),_.css("left",o+"%"),i.find(".slider-fill").css("width",o+"%"),jQuery("#sliderOutput1").val(o);var r=jQuery("#acym__wysid__context__space__slider");r.off("moved.zf.slider").on("moved.zf.slider",function(){a.css("height",jQuery("#sliderOutput1").val()+"px")}),r.off("changed.zf.slider").on("changed.zf.slider",function(){acym_helperEditorWysid.setColumnRefreshUiWYSID()}),i.off("mousedown").on("mousedown",function(e){a.css("height",jQuery("#sliderOutput1").val()+"px"),e.stopPropagation()}),jQuery(window).on("mousedown",function(e){if(acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,i))return!0;a.css("height",jQuery("#sliderOutput1").val()+"px"),jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(i,jQuery(e.target)),jQuery(window).unbind("click"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()})})},setFollowContextModalWYSID:function(){jQuery(".acym__wysid__column__element__follow").off("click").on("click",function(e){e.stopPropagation(),jQuery(".acym__wysid__column__element__follow--focus").removeClass("acym__wysid__column__element__follow--focus"),jQuery(this).addClass("acym__wysid__column__element__follow--focus"),jQuery("#acym__wysid__context__follow__list").empty(),jQuery("#acym__wysid__context__follow__select").html("<option></option>");var t,i=jQuery(".acym__wysid__column__element__follow--focus img").eq(0);if(i.length){var _=i.css("width").replace(/[^-\d\.]/g,"");t=_<=80?_>=30?_:30:80}else t=40;jQuery("#acym__wysid__context__social__width").val(t);for(var a=acym_helper.parseJson(ACYM_SOCIAL_MEDIA),o=jQuery("#acym__wysid__context__follow__select"),r=function(e,t){var i=0;jQuery(".acym__wysid__column__element__follow--focus a").each(function(){if(-1!==jQuery(this).attr("class").indexOf(a[e])){var t=a[e];i=1;var _='<div class="grid-x small-12 cell acym__wysid__context__follow__list__item">';_+='<div class="small-3 cell">',_+='<img style="height: auto;  box-sizing: border-box; width: 42px; padding: 5px; margin-left: 5px" src="'+acym_helperEditorWysid.socialMedia[t].src+'" alt="">',_+="</div>",_+='<div class="small-7 cell">',_+='<div class="input-group small-12 cell">',_+='<input class="input-group-field acym__wysid__context__button__link acym__wysid__context__button__link--'+t+'" type="text" placeholder="https://" value="'+jQuery(this).attr("href")+'">',_+="</div>",_+="</div>",_+='<div class="auto cell">',_+='<p class="acym__wysid__context__follow__list__remove acym__wysid__context__follow__list__remove--'+t+'" aria-hidden="true">×</p>',_+="</div>",_+="</div>",jQuery("#acym__wysid__context__follow__list").append(_),jQuery(".acym__wysid__context__follow__list__remove--"+t).off("click").on("click",function(){var e=jQuery(".acym__wysid__column__element__follow--focus");e.find(".acym__wysid__column__element__follow__"+t).remove(),jQuery(this).closest(".acym__wysid__context__follow__list__item").remove(),acym_editorWysidContextModal.setFollowContextModalWYSID(),e.click()}),jQuery(".acym__wysid__context__button__link--"+t).off("change paste keyup").on("change paste keyupe",function(){jQuery(".acym__wysid__column__element__follow--focus").find(".acym__wysid__column__element__follow__"+t).attr("href",jQuery(this).val())})}}),0==i&&o.append(new Option(ACYM_IS_ADMIN?"":a[e],a[e],!1,!1)).trigger("change")},s=0,n=a.length;s<n;s++)r(s);var c=jQuery(this),l=c.innerWidth(),d=jQuery("#acym__wysid__context__follow");jQuery(".acym__wysid__context__follow__align").each(function(){jQuery(this).css("background-color","acym__wysid__context__follow__align__"+c.css("text-align")===jQuery(this).attr("id")?"":"inherit"),jQuery(this).off("click").on("click",function(){var e=jQuery(this).attr("data-align");c.css("text-align",e),"center"===e?c.find("img").removeAttr("align").removeAttr("hspace"):c.find("img").attr("align",e).attr("hspace","3"),jQuery(".acym__wysid__context__follow__align").css("background-color","inherit"),jQuery(this).css("background-color","")})}),acym_editorWysidContextModal.showContextModal(d),ACYM_IS_ADMIN?(o.select2({theme:"foundation",minimumResultsForSearch:-1,placeholder:"+",selectOnClose:!1,closeOnSelect:!0,width:"50px",templateResult:acym_editorWysidContextModal.getFollowDataFormatWYSID,templateSelection:acym_editorWysidContextModal.getFollowDataFormatWYSID}),o.off("select2:select").on("select2:select",function(e){var t=e.params.data.id;acym_editorWysidContextModal.addContentFollowContext(jQuery(".acym__wysid__column__element__follow--focus"),t)})):o.off("change").on("change",function(){acym_editorWysidContextModal.addContentFollowContext(jQuery(".acym__wysid__column__element__follow--focus"),jQuery(this).val())}),d.off("mousedown").on("mousedown",function(e){e.stopPropagation()}),jQuery(window).on("mousedown",function(e){if(acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,d))return!0;jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(d,jQuery(e.target)),jQuery(window).unbind("click"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}),jQuery("#acym__wysid__context__social__width__slider").off("moved.zf.slider").on("moved.zf.slider",function(){l=jQuery("#acym__wysid__context__social__width").val()<=80?jQuery("#acym__wysid__context__social__width").val()>=30?jQuery("#acym__wysid__context__social__width").val():30:80,jQuery(".acym__wysid__column__element__follow--focus img").css("width",l).attr("width",l)})}),jQuery(".acym__wysid__column__element__follow a").unbind("click").click(function(e){e.preventDefault()})},setPoweredByContextModal:function(){jQuery("#acym__powered_by_acymailing").off("click").on("click",function(e){e.stopPropagation(),e.preventDefault();var t=jQuery("#acym__wysid__context__poweredby");acym_editorWysidContextModal.showContextModal(t),jQuery(window).off("mousedown").on("mousedown",function(e){if(acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,t))return!0;"poweredby"!==e.target.title&&0===jQuery(e.target).children().children('[title="poweredby"]').length&&(jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(t,jQuery(e.target)),jQuery(".acym__wysid__context__modal__container--structure").hide(),acym_editorWysidVersioning.setUndoAndAutoSave())})})},getFollowDataFormatWYSID:function(e){return e.id?jQuery('<span><img src="'+acym_helperEditorWysid.socialMedia[e.element.value.toLowerCase()].src+'"/>'+e.text+"</span>"):e.text},addContentFollowContext:function(e,t){if(""!==t){var i=jQuery("#acym__wysid__context__social__width"),_=i.val()<=80?i.val()>=30?i.val():30:80,a='<a class="acym__wysid__column__element__follow__'+t+'" href="">';a+='<img style="display: inline-block; max-width: 100%; height: auto; box-sizing: border-box; width: '+_+'px; padding: 3px;" src="'+acym_helperEditorWysid.socialMedia[t].src+'" width="'+_+'" alt="'+t+'">',a+="</a>",e.append(a),acym_editorWysidContextModal.setFollowContextModalWYSID(),e.click()}},setSeparatorContextModalWYSID:function(){jQuery(".acym__wysid__column__element__separator").off("click").on("click",function(e){e.stopPropagation(),jQuery(".acym__context__color__picker").remove();var t=jQuery(this).find("hr:first");jQuery("#sliderOutput2").val(t.css("border-bottom-width").replace(/[^-\d\.]/g,""));var i=t.css("border-bottom-width").replace(/[^-\d\.]/g,"")+"%";jQuery('[aria-controls="sliderOutput2"]').css("left",i).next().css("width",i);var _=Math.round(100*t.width()/t.parent().width());jQuery("#sliderOutput3").val(_),_+="%",jQuery('[aria-controls="sliderOutput3"]').css("left",_).next().css("width",_);var a=t.css("margin-top").replace(/[^-\d\.]/g,"");a=100*parseInt(a)/50+"%",jQuery("#sliderOutput4").val(t.css("margin-top").replace(/[^-\d\.]/g,"")),jQuery('[aria-controls="sliderOutput4"]').css("left",a).next().css("width",a);var o=jQuery("#acym__wysid__context__separator__color");acym_editorWysidColorPicker.setColorPickerForContextModal(o,"border-bottom-color",t,t,"border-bottom-color"),o.on("change",function(){t.css("color",this.value)});var r=jQuery(".acym__wysid__context__separator__kind");r.removeClass("separator-selected"),r.each(function(){jQuery(this).find("hr").attr("data-kind")==t.css("border-bottom-style")&&jQuery(this).addClass("separator-selected")}),r.off("click").on("click",function(){r.removeClass("separator-selected"),jQuery(this).addClass("separator-selected"),t.css("border-bottom-style",jQuery(this).find("hr").attr("data-kind"))});var s=jQuery("#acym__wysid__context__separator__slide"),n=jQuery("#acym__wysid__context__separator__slide__width"),c=jQuery("#acym__wysid__context__separator__slide__space");s.off("moved.zf.slider").on("moved.zf.slider",function(){"none"!==s.css("display")&&(t.css("border-bottom-width",jQuery("#sliderOutput2").val()+"px"),t.css("size",jQuery("#sliderOutput2").val()+"px"))}),n.off("moved.zf.slider").on("moved.zf.slider",function(){"none"!==s.css("display")&&t.css("width",jQuery("#sliderOutput3").val()+"%")}),c.off("moved.zf.slider").on("moved.zf.slider",function(){if("none"!==s.css("display")){var e=jQuery("#sliderOutput4").val();t.css("margin-top",e+"px"),t.css("margin-bottom",e+"px")}});var l=jQuery("#acym__wysid__context__separator");acym_editorWysidContextModal.showContextModal(l),l.off("mousedown").on("mousedown",function(e){jQuery(".sp-container").addClass("sp-hidden").attr("style",""),e.stopPropagation()}),jQuery(window).on("mousedown",function(e){jQuery(".sp-container").is(":visible")||acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,l)||(jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(l,jQuery(e.target)),jQuery(window).off("click"),o.off("change"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave())})})}},acym_editorWysidDragDrop={setNewRowElementDraggableWYSID:function(){jQuery(".acym__wysid__row__element--new").draggable({cursor:"move",helper:"clone",cursorAt:{top:12,left:40},connectToSortable104:".acym__wysid__row",revert:function(e){if(!e)return acym_editorWysidRowSelector.setRowSelector(),!0},revertDuration:300,start:function(e,t){jQuery(t.helper).css({width:jQuery(this).width()+"px",opacity:1}),jQuery(".acym__wysid__column__element").off("mouseenter mouseleave"),jQuery(".acym__wysid__row__element").off("mouseenter mouseleave")}})},setRowElementSortableWYSID:function(){jQuery(".acym__wysid__row").sortable({axis:"y",cursorAt:{top:20},scroll:!1,placeholder:"acym__wysid__row__element--placeholder",handle:".acym__wysid__row__element__toolbox__move",forcePlaceholderSize:!0,tolerance:"intersect",start:function(e,t){jQuery(".acym__wysid__row__selector, .acym__wysid__element__toolbox").remove(),t.helper.first().addClass("acym__wysid__row__element--sortable"),jQuery(t.placeholder).css({height:"75px"}),jQuery(".acym__wysid__column__element").off("mouseenter mouseleave"),jQuery(".acym__wysid__row__element").off("mouseenter mouseleave")},stop:function(e,t){jQuery(".acym__wysid__row__element--sortable").removeClass("acym__wysid__row__element--sortable");var i=t.item;i.hasClass("acym__wysid__row__element--new--1")?acym_editorWysidNewRow.addRow1WYSID(i):i.hasClass("acym__wysid__row__element--new--2")?acym_editorWysidNewRow.addRow2WYSID(i):i.hasClass("acym__wysid__row__element--new--3")?acym_editorWysidNewRow.addRow3WYSID(i):i.hasClass("acym__wysid__row__element--new--4")?acym_editorWysidNewRow.addRow4WYSID(i):i.hasClass("acym__wysid__row__element--new--5")?acym_editorWysidNewRow.addRow5WYSID(i):!i.hasClass("acym__wysid__row__element--new--6")||acym_editorWysidNewRow.addRow6WYSID(i),acym_editorWysidDragDrop.setColumnSortableWYSID(),acym_helperEditorWysid.checkForEmptyTbodyWYSID(),acym_editorWysidRowSelector.setRowSelector()}})},setColumnElementDraggableWYSID:function(){jQuery(".acym__wysid__column__element").draggable({cursor:"move",helper:"clone",revert:"invalid",handle:".acym__wysid__column__element__toolbox__move",cursorAt:{top:20,left:50},connectToSortable104:".acym__wysid__column tbody",revertDuration:300,start:function(e,t){t.helper.first().addClass("acym__wysid__column__element--helper"),jQuery(this).addClass("acym__wysid__column__element__original--helper"),jQuery(".acym__wysid__column").addClass("acym__wysid__column--drag-start")},stop:function(){jQuery(".acym__wysid__column__element--helper").removeClass("acym__wysid__column__element--helper"),jQuery(".acym__wysid__column__element__original--helper").removeClass("acym__wysid__column__element__original--helper"),jQuery(".acym__wysid__column").removeClass("acym__wysid__column--drag-start"),jQuery(".acym__wysid__column__element").css({position:"relative",top:"inherit",left:"inherit",right:"inherit",bottom:"inherit",height:"auto"}),acym_editorWysidRowSelector.setRowSelector()}})},setColumnSortableWYSID:function(){jQuery(".acym__wysid__column tbody").sortable({scroll:!1,handle:".acym__wysid__column__element__toolbox__move",placeholder:"acym__wysid__column__element--placeholder",forcePlaceholderSize:!0,cursorAt:{top:20,left:50},stop:function(e,t){var i=jQuery("#acym__wysid__default");i.closest(".columns").height("auto").find("table").height("auto").find("tbody").height("auto"),i.remove(),jQuery(".acym__wysid__column__first").removeClass("acym__wysid__column__first");var _=t.item,a=_.attr("data-plugin");a?(acym_helperEditorWysid.$focusElement=jQuery(_),acym_editorWysidDynamic.openDContentModal(a,acym_helperEditorWysid.$focusElement.attr("data-dynamic"))):_.hasClass("acym__wysid__column__element--new--title")?acym_editorWysidNewContent.addTitleWYSID(_):_.hasClass("acym__wysid__column__element--new--text")?acym_editorWysidNewContent.addTextWYSID(_):_.hasClass("acym__wysid__column__element--new--picture")?acym_editorWysidNewContent.addMediaWysid(_):_.hasClass("acym__wysid__column__element--new--button")?acym_editorWysidNewContent.addButtonWYSID(_):_.hasClass("acym__wysid__column__element--new--follow")?acym_editorWysidNewContent.addFollowWYSID(_):_.hasClass("acym__wysid__column__element--new--share")?acym_editorWysidNewContent.addShareWYSID(_):_.hasClass("acym__wysid__column__element--new--space")?acym_editorWysidNewContent.addSpaceWYSID(_):_.hasClass("acym__wysid__column__element--new--video")?acym_editorWysidNewContent.addVideoWYSID(_):_.hasClass("acym__wysid__column__element--new--separator")?acym_editorWysidNewContent.addSeparatorWysid(_):_.hasClass("acym__wysid__column__element--new--giphy")&&acym_editorWysidNewContent.addGiphyWYSID(_)},change:function(){acym_helperEditorWysid.checkForEmptyTbodyWYSID()},out:function(){setTimeout(function(){acym_helperEditorWysid.checkForEmptyTbodyWYSID()},1)},receive:function(e,t){t.item.hasClass("acym__wysid__column__element--new")||(t.item.remove(),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave())},start:function(){jQuery(".acym__wysid__column__element--placeholder").html(""),jQuery(".acym__wysid__row__selector, .acym__wysid__element__toolbox").remove()}})},setNewColumnElementDraggableWYSID:function(){jQuery(".acym__wysid__column__element--new").draggable({cursor:"move",helper:"clone",cursorAt:{top:12,left:40},connectToSortable104:".acym__wysid__column > tbody",revert:function(e){if(!e)return acym_editorWysidRowSelector.setRowSelector(),!0},revertDuration:300,start:function(e,t){if(jQuery(t.helper).css({width:jQuery(this).width()+"px",opacity:1}),jQuery(".acym__wysid__column").addClass("acym__wysid__column--drag-start"),jQuery(".acym__wysid__column__element").off("mouseenter mouseleave"),jQuery(".acym__wysid__row__element").off("mouseenter mouseleave"),jQuery("#acym__wysid__default").length){jQuery("#acym__wysid__default__start").hide();var i=jQuery("#acym__wysid__default__dragging");i.closest(".columns").height(),i.show(),i.closest("#acym__wysid__default").attr("height","auto").closest(".columns").height(i.height()).find("table").height(i.height()).find("tbody").height(i.height())}},stop:function(){jQuery(".acym__wysid__column").removeClass("acym__wysid__column--drag-start");var e=jQuery("#acym__wysid__default");if(e.length>0){e.find("#acym__wysid__default__start").show(),e.find("#acym__wysid__default__dragging").hide();var t=jQuery("#acym__wysid__default__start");t.closest("#acym__wysid__default").attr("height","auto").closest(".columns").height(t.height()).find("table").height(t.height()).find("tbody").height(t.height())}}})},setFixJquerySortableWYSID:function(){jQuery.ui.plugin.add("draggable","connectToSortable104",{start:function(e,t,i){var _=jQuery(this).data("ui-draggable"),a=(_.options,jQuery.extend({},t,{item:_.element}));_.sortables=[],jQuery(i.options.connectToSortable104).each(function(){var t=jQuery(this).sortable("instance");t&&!t.options.disabled&&(_.sortables.push({instance:t,shouldRevert:t.options.revert}),t.refreshPositions(),t._trigger("activate",e,a))})},stop:function(e,t,i){var _=jQuery(this).data("ui-draggable"),a=jQuery.extend({},t,{item:_.element});jQuery.each(_.sortables,function(){this.instance.isOver?(this.instance.isOver=0,_.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===_.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,a))})},drag:function(e,t,i){var _=jQuery(this).data("ui-draggable"),a=this;jQuery.each(_.sortables,function(){var i=!1,o=this;this.instance.positionAbs=_.positionAbs,this.instance.helperProportions=_.helperProportions,this.instance.offset.click=_.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(i=!0,jQuery.each(_.sortables,function(){return this.instance.positionAbs=_.positionAbs,this.instance.helperProportions=_.helperProportions,this.instance.offset.click=_.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&jQuery.contains(o.instance.element[0],this.instance.element[0])&&(i=!1),i})),i?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=jQuery(a).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return t.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=_.offset.click.top,this.instance.offset.click.left=_.offset.click.left,this.instance.offset.parent.left-=_.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=_.offset.parent.top-this.instance.offset.parent.top,_._trigger("toSortable",e),_.dropped=this.instance.element,_.currentItem=_.element,this.instance.fromOutside=_),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),_._trigger("fromSortable",e),_.dropped=!1)})}})}},acym_editorWysidDynamic={inCall:!1,getUniqueId:function(e){var t;if(void 0===e||void 0===e.attr("id")){t="dynamicContent";for(var i=0;jQuery("#"+t+i).length;)i++;t+=i}else t=e.attr("id");return t},endDContentInsertion:function(e,t,i,_,a){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=this.getUniqueId(e);t=t.replace(/"/g,'\\"');var s='<span class="acym__tooltip acym__dynamics__preview">'+ACYM_JS_TXT.ACYM_PREVIEW;s+='<span class="acym__tooltip__text wysid_tooltip">'+ACYM_JS_TXT.ACYM_PREVIEW_DESC+"</span>",s+="</span>",o&&(s='<span class="acym__tooltip acym__dynamics__preview">\n                                  '.concat(ACYM_JS_TXT.ACYM_PREVIEW_CUSTOM_VIEW,'\n                                  <span class="acym__tooltip__text wysid_tooltip">').concat(ACYM_JS_TXT.ACYM_PREVIEW_DESC,"<br>").concat(ACYM_JS_TXT.ACYM_CUSTOM_VIEW_EDITOR_DESC,"</span>\n                               </span>")),0===i.length&&(i='<div class="acym_default_dcontent"><span class="acym_default_dcontent_text">'+ACYM_JS_TXT.ACYM_NO_DCONTENT_TEXT+"</span></div>");var n='<tr id="'+r+'" class="acym__wysid__column__element ui-draggable" data-dynamic="'+t+'" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;" data-plugin="'+_+'">';n+='<td class="large-12 acym__wysid__column__element__td">'+s,n+=i,n+='<div class="plugin_loader" style="display: none;"><i class="fa acymicon-spin acymicon-circle-o-notch">&zwj;</i></div>',n+='<i style="display: none;">&zwj;</i></td></tr>',e.replaceWith(n),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave(a),acym_helperTooltip.setTooltip(),acym_helperEditorWysid.$focusElement=jQuery("#"+r),acym_helperEditorWysid.$focusElement.find(".plugin_loader").css("display","none")},insertDContent:function(e,t){var i,_,a=void 0!==t;if(a?(i=jQuery(t.get(0)),t.splice(0,1),_=i.attr("data-plugin"),e=i.attr("data-dynamic")):(i=acym_helperEditorWysid.$focusElement,_=jQuery("#currentPlugin").val()),0!==e.length){acym_helperEditorWysid.dynamicPreviewIdentifier++;var o=acym_helperEditorWysid.dynamicPreviewIdentifier;i.find(".plugin_loader").css("display","flex");var r=jQuery('input[name="editor_autoSave"]').val(),s=ACYM_AJAX_URL+"&page=acymailing_dynamics&ctrl="+acym_helper.ctrlDynamics+"&task=replaceDummy";jQuery.ajax({url:s,type:"POST",data:{mailId:r,code:e,language:acym_editorWysidMultilingual.currentLanguage,previewBody:jQuery("#acym__wysid__template").html()}}).then(function(r){if(o===acym_helperEditorWysid.dynamicPreviewIdentifier){var s,n=!1;r&&(r=acym_helper.parseJson(r)),r.data.content&&0!==r.data.content.length?(s=r.data.content,n=r.data.custom_view):s="",acym_editorWysidDynamic.endDContentInsertion(i,e,s,_,a,n),void 0!==t&&t.length>0&&acym_editorWysidDynamic.insertDContent("",t)}})}else acym_editorWysidDynamic.endDContentInsertion(i,e,"",_,a)},openDContentModal:function(e,t){var i=jQuery("#acym__wysid__context__plugins");i.html('<i class="acymicon-circle-o-notch acymicon-spin centered_spinner text-center" style="margin-top: 2rem;"/>'),acym_editorWysidContextModal.showContextModal(i),jQuery(window).on("mousedown",function(e){if(!acym_editorWysidContextModal.clickedOnScrollbar(e.clientX,i)){var t=jQuery(e.target);if(t.closest(".c-scrim").length||t.closest(".c-datepicker--open").length)return!1;if(t.closest("tr[data-plugin]").length)return!1;jQuery(this).off("mousedown"),acym_editorWysidContextModal.hideContextModal(i,t),jQuery(window).unbind("click"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}}),void 0!==t&&t&&t.length||(t="");var _=ACYM_AJAX_URL;_+="&page=acymailing_lists",_+="&action=acymailing_router",_+="&noheader=1",_+="&ctrl="+acym_helper.ctrlDynamics,_+="&task=trigger",_+="&trigger=insertionOptions",_+="&plugin="+e,_+="&shortcode="+encodeURIComponent(t),_+="&campaignId="+jQuery("#acym__campaign__recipients__form__campaign").val(),acym_helper.empty(acym_editorWysidMultilingual)||(_+="&language="+acym_editorWysidMultilingual.selectedLanguage);var a=jQuery('[name="campaign_type"]');a.length>0&&(_+="&campaign_type="+a.val()),jQuery.ajax({url:_,success:function(_){_+='<input type="hidden" id="currentPlugin" name="currentPlugin" value="'+e+'"/>',i.html(_),jQuery("#acym_pagination__ajax__load-more").val(1),acym_helperRadio.setRadioIconsGlobal(),acym_editorWysidDynamic.setPluginFilters(),acym_editorWysidDynamic.setPluginPagination(),jQuery(document).foundation(),jQuery(".reveal-overlay").not("#acym_form .reveal-overlay").appendTo("#acym__wysid__context__plugins"),acym_editorWysidDynamic.selectFirstTab(),acym_helperDatePicker.setDatePickerGlobal(),acym_helperTooltip.setTooltip(),acym_helperDatePicker.setRSDateChoice(),acym_helper.setButtonRadio(),acym_editorWysidToolbar.setRightToolbarWYSID(),0===t.length&&acym_editorWysidDynamic.insertDContent(""),jQuery(document).trigger("acym_plugins_installed_loaded"),acym_editorWysidDynamic.setRefreshCustomViewChanged()}})},setPluginFilters:function(){jQuery("#plugin_listing_filters select").off("change").on("change",function(){acym_editorWysidDynamic.setAjaxDynamic()}),jQuery('#plugin_listing_filters input[type="text"]').off("keyup").on("keyup",function(){jQuery("#plugin_listing").off("scroll");var e=jQuery(this).val();clearTimeout(acym_helperEditorWysid.typingTimer),e.length>=2?acym_helperEditorWysid.typingTimer=setTimeout(function(){acym_editorWysidDynamic.setAjaxDynamic()},1e3):""==e&&acym_editorWysidDynamic.setAjaxDynamic()}),ACYM_IS_ADMIN&&jQuery("#acym__wysid__context__plugins select").select2({theme:"foundation",width:"160px"})},setAjaxDynamic:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.inCall)return!0;this.inCall=!0;var i=ACYM_AJAX_URL+"&page=acymailing_dynamics&ctrl="+acym_helper.ctrlDynamics+"&task=trigger&trigger=displayListing";jQuery("#plugin_listing_filters input, #plugin_listing_filters select").each(function(){i+="&"+jQuery(this).attr("name")+"="+jQuery(this).val()});var _=jQuery("#acym_pagination__ajax__load-more");if(t?i+="&loadMore=1":_.val(1),i+="&pagination_page_ajax="+_.val(),i+="&plugin="+jQuery('input[name="plugin"]').val(),"undefined"!=typeof _selectedRows){var a=[];for(var o in _selectedRows)_selectedRows.hasOwnProperty(o)&&a.push(o);i+="&selected="+a.join(",")}jQuery.post(i,function(i){var _=jQuery("#plugin_listing");t?(_.find(".acym__loader").remove(),_.append(i)):_.replaceWith(i),e.inCall=!1,acym_editorWysidDynamic.setPluginPagination()})},setPluginPagination:function(){var e=jQuery("#plugin_listing");if(e.find(".acym__listing__empty__load-more").length>0||e.find(".acym__listing__empty__search__modal").length>0)return!0;e.on("scroll",function(){var e=jQuery(this)[0].scrollHeight-80;if(jQuery(this).height()+jQuery(this).scrollTop()>=e){jQuery(this).off("scroll"),jQuery(this).append('<div class="cell text-center acym__loader"><i class="acymicon-spin acymicon-circle-o-notch"></i></div>');var t=jQuery("#acym_pagination__ajax__load-more"),i=parseInt(t.val());t.val(i+1),acym_editorWysidDynamic.setAjaxDynamic(!0)}})},selectFirstTab:function(){jQuery(".tabs").each(function(){var e=jQuery(this).attr("id"),t=localStorage.getItem("acy"+e),i=jQuery("#"+e).find('a[data-tab-identifier="'+t+'"]');if(i.length)i.click();else{var _=jQuery("#"+e).find('a[data-selected="true"]');_.length?_.click():jQuery("#"+e+" .acym_tab:first").click()}})},setDynamicsActions:function(){jQuery(".acym_dynamic").off("click").on("click",function(e){var t=window.getSelection();t.removeAllRanges();var i=document.createRange();i.selectNode(this),t.addRange(i),jQuery("#dtextcode").val("")}),jQuery(".acym_remove_dynamic").off("click").on("click",function(){jQuery(this).closest("span").remove(),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}),jQuery("tr[data-dynamic]").off("click").on("click",function(){acym_helperEditorWysid.$focusElement=jQuery(this),acym_editorWysidDynamic.openDContentModal(jQuery(this).attr("data-plugin"),jQuery(this).attr("data-dynamic"))})},setTagPWordBreak:function(){jQuery("#acym__wysid__template").find("p").css("word-break","break-word")},setTagPreInserted:function(){var e=navigator.userAgent;e.toLowerCase().indexOf("chrome")>-1||e.toLowerCase().indexOf("firefox")>-1?(jQuery("p").find("code").css("white-space","pre-wrap"),jQuery("pre").css("white-space","pre-wrap"),jQuery("code").css("white-space","pre-wrap")):e.indexOf("MSIE ")>-1||e.indexOf("Trident/")>-1?(jQuery("pre").css("word-wrap","break-word"),jQuery("code").css("word-wrap","break-word")):e.toLowerCase().indexOf("opera")>-1&&(jQuery("pre").css("white-space","-o-pre-wrap"),jQuery("code").css("white-space","-o-pre-wrap"))},setRefreshCustomViewChanged:function(){jQuery(document).off("acym_custom_view_modal_closed").on("acym_custom_view_modal_closed",function(){var e=document.getElementById("acym__dynamic__update__function").value;"function"==typeof window[e]&&window[e]()})},setDTexts:function(){jQuery("#dtext_options").hide()}};function setTag(e,t){jQuery(".acym__listing__row__popup").removeClass("selected_row"),t.addClass("selected_row"),window.document.getElementById("dtextcode").value=e}var acym_editorWysidFontStyle={allTags:["p","a","span.acym_link","li","h1","h2","h3","h4","h5","h6"],setAllHtmlElementStyleWYSID:function(){this.allTags.map(function(e){acym_editorWysidFontStyle.setAllSettingsOfHtmlElementWYSID(e)}),jQuery(".acym__wysid__template__content").css("background-color",acym_editorWysidFontStyle.getSettingsOfHtmlElementWYSID("#acym__wysid__background-colorpicker","background-color"))},setAllSettingsOfHtmlElementWYSID:function(e){jQuery.each(acym_helperEditorWysid.defaultMailsSettings[e],function(t){jQuery(".acym__wysid__column__element "+e+":not(.acym__wysid__content-no-settings-style)").css(t,acym_editorWysidFontStyle.getSettingsOfHtmlElementWYSID(e,t))})},getSettingsOfHtmlElementWYSID:function(e,t){return void 0!==acym_helperEditorWysid.mailsSettings[e]&&acym_helperEditorWysid.mailsSettings[e][t]&&void 0!==acym_helperEditorWysid.mailsSettings[e][t]?acym_helperEditorWysid.mailsSettings[e][t]:acym_helperEditorWysid.defaultMailsSettings[e][t]},setSettingsElementStyle:function(e,t,i){var _=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];void 0!==acym_helperEditorWysid.mailsSettings[e]||(acym_helperEditorWysid.mailsSettings[e]={}),(_||acym_helper.empty(acym_helperEditorWysid.mailsSettings[e].overridden)||acym_helper.empty(acym_helperEditorWysid.mailsSettings[e].overridden[t]))&&(acym_helperEditorWysid.mailsSettings[e][t]=i,_&&(acym_helper.empty(acym_helperEditorWysid.mailsSettings[e].overridden)&&(acym_helperEditorWysid.mailsSettings[e].overridden={}),acym_helperEditorWysid.mailsSettings[e].overridden[t]=!0),acym_editorWysidFontStyle.setAllHtmlElementStyleWYSID())},setSettingsWYSID:function(){var e=jQuery("#acym__wysid__right__toolbar__settings__bold"),t=jQuery("#acym__wysid__right__toolbar__settings__italic"),i=jQuery("#acym__wysid__right__toolbar__settings__font--select").val(),_=jQuery("#acym__wysid .acym__wysid__template__content"),a=jQuery("#acym__wysid__background-image__template-delete");jQuery("#acym__wysid__right__toolbar__settings__font-family").val(acym_editorWysidFontStyle.getSettingsOfHtmlElementWYSID(i,"font-family")).trigger("change"),jQuery("#acym__wysid__right__toolbar__settings__font-size").val(acym_editorWysidFontStyle.getSettingsOfHtmlElementWYSID(i,"font-size")).trigger("change"),e.val("bold"==acym_editorWysidFontStyle.getSettingsOfHtmlElementWYSID(i,"font-weight")?e.addClass("acym__wysid__right__toolbar__settings__bold--selected"):e.removeClass("acym__wysid__right__toolbar__settings__bold--selected")),t.val("italic"==acym_editorWysidFontStyle.getSettingsOfHtmlElementWYSID(i,"font-style")?t.addClass("acym__wysid__right__toolbar__settings__italic--selected"):t.removeClass("acym__wysid__right__toolbar__settings__italic--selected")),acym_editorWysidColorPicker.setSettingsColorPickerWYSID(acym_editorWysidFontStyle.getSettingsOfHtmlElementWYSID(i,"color")),acym_editorWysidFontStyle.setAllSettingsOfHtmlElementWYSID(i),jQuery("#acym__wysid__background-image__template").off("click").on("click",function(){acym_editorWysidImage.openMediaManage(_,!0)}),"none"!==_.css("background-image")&&a.css("display","flex"),a.off("click").on("click",function(){_.css("background-image","none"),jQuery(this).hide()});var o=jQuery("#acym__wysid__padding__top__content");o.val(_.css("padding-top").replace(/[^-\d\.]/g,"")),o.off("change").on("change",function(){_.css("padding-top",jQuery(this).val()+"px")});var r=jQuery("#acym__wysid__padding__bottom__content");r.val(_.css("padding-bottom").replace(/[^-\d\.]/g,"")),r.off("change").on("change",function(){_.css("padding-bottom",jQuery(this).val()+"px")})},setSettingsControlsWYSID:function(){var e=jQuery("#acym__wysid__right__toolbar__settings__bold"),t=jQuery("#acym__wysid__right__toolbar__settings__italic"),i=jQuery("#acym__wysid__right__toolbar__settings__font--select");i.on("change",function(){acym_editorWysidFontStyle.setSettingsWYSID()}),jQuery("#acym__wysid__right__toolbar__settings__font-family").off("select2:select").on("change select2:select",function(e){acym_editorWysidFontStyle.setSettingsElementStyle(jQuery("#acym__wysid__right__toolbar__settings__font--select").val(),"font-family",jQuery(this).val(),"change"!==e.type)}),jQuery("#acym__wysid__right__toolbar__settings__font-size").on("change",function(){acym_editorWysidFontStyle.setSettingsElementStyle(jQuery("#acym__wysid__right__toolbar__settings__font--select").val(),"font-size",jQuery(this).val())}),e.off("click").on("click",function(){e.hasClass("acym__wysid__right__toolbar__settings__bold--selected")?e.removeClass("acym__wysid__right__toolbar__settings__bold--selected")&&acym_editorWysidFontStyle.setSettingsElementStyle(i.val(),"font-weight","normal"):e.addClass("acym__wysid__right__toolbar__settings__bold--selected")&&acym_editorWysidFontStyle.setSettingsElementStyle(i.val(),"font-weight","bold")}),t.off("click").on("click",function(){t.hasClass("acym__wysid__right__toolbar__settings__italic--selected")?t.removeClass("acym__wysid__right__toolbar__settings__italic--selected")&&acym_editorWysidFontStyle.setSettingsElementStyle(i.val(),"font-style","normal"):t.addClass("acym__wysid__right__toolbar__settings__italic--selected")&&acym_editorWysidFontStyle.setSettingsElementStyle(i.val(),"font-style","italic")})},setApplyStylesheetSettings:function(){jQuery("#acym__wysid__right__toolbar__settings__stylesheet__apply").off("click").on("click",function(){var e=jQuery("#acym__wysid__right__toolbar__settings__stylesheet__textarea").val();jQuery(".acym__wysid__hidden__save__stylesheet").val(e),jQuery("#acym__wysid__edit").append('<style id="acym__wysid__custom__style">'+acym_helperEditorWysid.parseTextToCss(e)+"</style>"),jQuery("#acym__wysid__right__toolbar__settings__stylesheet__modal").foundation("close")})},setOpenStylesheet:function(){jQuery("#acym__wysid__right__toolbar__settings__stylesheet__open").on("click",function(){acym_helperEditorWysid.stylesheetTemp=jQuery("#acym__wysid__right__toolbar__settings__stylesheet__textarea").val()})},setCancelStylesheet:function(){jQuery("#acym__wysid__right__toolbar__settings__stylesheet__cancel").on("click",function(){jQuery("#acym__wysid__right__toolbar__settings__stylesheet__textarea").val(acym_helperEditorWysid.stylesheetTemp),jQuery("#acym__wysid__right__toolbar__settings__stylesheet__modal").foundation("close")})},setSocialIconImport:function(){var e=acym_helper.parseJson(jQuery("#acym__mail__edit__editor__social__icons").val());void 0!==e&&(jQuery.each(Object.keys(e),function(t,i){acym_helperEditorWysid.socialMedia[i].src=e[i]}),jQuery(".acym__wysid__social__icons__import__text").off("click").on("click",function(){var e=jQuery(this),t=e.closest(".acym__wysid__right__toolbar__design__social__icons__one").find("input");t.click(),t.off("change").on("change",function(){var t=jQuery(this).val().split("\\").pop();e.closest(".acym__wysid__right__toolbar__design__social__icons__one").find(".acym__wysid__social__icons__import__delete").remove(),void 0===t||""===t?(e.html(ACYM_JS_TXT.ACYM_SELECT_NEW_ICON),e.closest(".acym__wysid__right__toolbar__design__social__icons__one").find("button").attr("disabled","disabled")):(e.html(t).after('<i class="acymicon-close cell shrink acym__wysid__social__icons__import__delete cursor-pointer"></i>'),e.closest(".acym__wysid__right__toolbar__design__social__icons__one").find("button").removeAttr("disabled")),jQuery(".acym__wysid__social__icons__import__delete").off("click").on("click",function(){jQuery(this).closest(".acym__wysid__right__toolbar__design__social__icons__one").find("button").attr("disabled","disabled"),jQuery(this).closest(".acym__wysid__right__toolbar__design__social__icons__one").find("input").val("").trigger("change"),jQuery(this).remove()})})}),jQuery(".acym__wysid__social__icons__import").off("click").on("click",function(){jQuery(this).closest("div").find(".acym__wysid__social__icons__import__delete").html("").attr("class","acymicon-circle-o-notch acymicon-spin acym__wysid__social__icons__import__delete").css("color","#303e46");var e=jQuery(this).closest(".acym__wysid__right__toolbar__design__social__icons__one").find("input"),t=e.prop("files")[0],i=new FormData;i.append("file",t);var _=e.attr("name").replace("icon_",""),a=ACYM_AJAX_URL+"&ctrl="+acym_helper.ctrlMails+"&task=setNewIconShare&social="+_;jQuery.ajax({url:a,dataType:"text",cache:!1,contentType:!1,processData:!1,data:i,type:"post",success:function(t){if(!(t=acym_helper.parseJson(t)).error){var i=jQuery("img").filter('[src^="'+t.data.url+'"]'),a=t.data.url+"."+t.data.extension;jQuery.each(i,function(){var e=new Date;jQuery(this).removeAttr("src").attr("src",a+"?d="+e.getTime())}),acym_helperEditorWysid.socialMedia[_].src=a}e.val("").trigger("change"),acym_editorWysidNotifications.addEditorNotification({message:t.message,level:t.error?"error":"success"})}})}))},initDefaultFont:function(){var e=this,t=acym_helperEditorWysid.defaultMailsSettings.default["font-family"];acym_helper.empty(acym_helperEditorWysid.mailsSettings.default)||acym_helper.empty(acym_helperEditorWysid.mailsSettings.default["font-family"])||(t=acym_helperEditorWysid.mailsSettings.default["font-family"]);var i=jQuery('[name="default_font"]');i.on("change",function(t){var i=jQuery(this).val();acym_helper.empty(acym_helperEditorWysid.mailsSettings.default)&&(acym_helperEditorWysid.mailsSettings.default={}),acym_helperEditorWysid.mailsSettings.default["font-family"]=i,e.allTags.map(function(t){e.setSettingsElementStyle(t,"font-family",i,!1)})}),i.val(t).trigger("change")}},acym_editorWysidFormAction={saveAjaxMail:function(e,t,i){return-1!==e.indexOf("mails")||i?jQuery.when(acym_helperThumbnail.setAjaxSaveThumbnail()).done(function(){return acym_editorWysidFormAction._ajaxCall(e,t,i)}).fail(function(_){return console.log(_),acym_editorWysidFormAction._ajaxCall(e,t,i)}):acym_editorWysidFormAction._ajaxCall(e,t,i)},saveTemplate:function(e,t){if(!jQuery("#acym__wysid__warning__thumbnail").is(":visible")){var i=window.innerHeight-jQuery("#acym__wysid__top-toolbar").offset().top-jQuery("#acym__wysid__wrap").height();jQuery("#acym__wysid__warning__thumbnail").css("bottom","-"+i+"px").toggle()}var _=jQuery("#acym__wysid__template");return _.css({overflow:"hidden","overflow-y":"auto"}),jQuery(".acym__wysid__row__selector, .acym__wysid__element__toolbox").remove(),jQuery(".acym__wysid__tinymce--text--placeholder--empty").removeClass("acym__wysid__tinymce--text--placeholder--empty"),jQuery("#acym__wysid__template img").each(function(){var e=jQuery(this).width(),t=jQuery(this).outerWidth();jQuery(this).attr("width",e).attr("height",jQuery(this).height()).css("width",t)}),jQuery('[id^="template_version_"]').remove(),jQuery("#acym__wysid__template *").contents().each(function(){this.nodeType===Node.COMMENT_NODE&&jQuery(this).remove()}),_.find(".acym__wysid__column__element__td").css("outline-width","0px"),_.find("[contenteditable]").attr("contenteditable","false"),jQuery("#acym__wysid__template a.acym__wysid__column__element__button").each(function(){var e=acym_editorWysidOutlook.setButtonOutlook(jQuery(this));jQuery(this).before(e),jQuery(this).after("\x3c!-- <![endif]--\x3e")}),jQuery("#acym__wysid__template .acym__wysid__row__element").each(function(){""!==jQuery(this).css("background-image")&&"none"!==jQuery(this).css("background-image")&&acym_editorWysidOutlook.setBackgroundOutlook(jQuery(this))}),e||t||(jQuery(".mce-edit-focus").removeClass("mce-edit-focus"),_.find('[name^="mce_"]').remove(),_.find("#acym__wysid__default").remove()),t?(jQuery(".acym__wysid__hidden__save__content__template").val('<div id="acym__wysid__template" class="cell">'+_.html()+"</div>"),jQuery(".acym__wysid__hidden__save__settings__template").val(JSON.stringify(acym_helperEditorWysid.mailsSettings)),jQuery(".acym__wysid__hidden__save__stylesheet__template").val(jQuery("#acym__wysid__right__toolbar__settings__stylesheet__textarea").val())):(jQuery(".acym__wysid__hidden__save__content").val('<div id="acym__wysid__template" class="cell">'+_.html()+"</div>").trigger("change"),jQuery(".acym__wysid__hidden__save__settings").val(JSON.stringify(acym_helperEditorWysid.mailsSettings)),jQuery(".acym__wysid__hidden__save__stylesheet").val(jQuery("#acym__wysid__right__toolbar__settings__stylesheet__textarea").val())),acym_editorWysidFormAction.saveAjaxMail(jQuery('[name="ctrl"]').val(),e,t)},_ajaxCall:function(e,t,i){acym_editorWysidMultilingual.storeCurrentValues();var _=ACYM_AJAX_URL+"&ctrl="+e;return i?(jQuery('input[name="task"]').val("saveAsTmplAjax"),_+="&saveAsTmpl=1"):jQuery('input[name="task"]').val("saveAjax"),acym_helper.post(_,jQuery("#acym_form").serialize()).done(function(_){_.error?acym_helperNotification.addNotification(_.message,"error"):(i?acym_editorWysidNotifications.addEditorNotification({message:ACYM_JS_TXT.ACYM_TEMPLATE_CREATED,level:"success"},3e3,!1):(jQuery("mail"===e?'[name="id"]':'[name="id"], [name="mail[id]"]').val(_.data.result),t||(jQuery("#acym_header").css("display",""),jQuery(".acym__content").css("display",""),jQuery("#acym__wysid").css("display","none"),jQuery("#acym__wysid__edit").css("display",""))),t&&acym_editorWysidTest.sendTest(_.data.result),jQuery("#acym__wysid__warning__thumbnail").toggle()),jQuery("#acym__wysid__save__button").removeAttr("disabled")}).fail(function(e,t){alert("Request failed: "+t)})},setSaveButtonWYSID:function(){jQuery("#acym__wysid__save__button").off("click").on("click",function(){if(-1!==jQuery('[name="ctrl"]').val().indexOf("campaigns")||"followup"===jQuery("#acym__mail__type").val())return acym_editorWysidFormAction.saveTemplate(!1,!1),!0;acym_editorWysidFormAction.setSaveTmpl(!1)})},setSaveAsTmplButtonWYSID:function(){jQuery("#acym__wysid__saveastmpl__button").off("click").on("click",function(){acym_helper.confirm(ACYM_JS_TXT.ACYM_SAVE_AS_TEMPLATE_CONFIRMATION)&&acym_editorWysidFormAction.setSaveTmpl(!0)})},setSaveTmpl:function(e){var t=jQuery("#acym__wysid__wrap"),i=window.innerHeight-jQuery("#acym__wysid__top-toolbar").offset().top-t.height();jQuery("#acym__wysid__warning__thumbnail").css("bottom","-"+i+"px").toggle(),setTimeout(function(){acym_editorWysidFormAction.setThumbnailPreSave().then(function(t){jQuery("#editor_thumbnail").attr("value",t),acym_editorWysidFormAction.saveTemplate(!1,e)}).catch(function(t){console.error("Error generating template thumbnail: "+t),acym_editorWysidFormAction.saveTemplate(!1,e)})},10)},setThumbnailPreSave:function(){jQuery("#acym__wysid__template").css({overflow:"unset","overflow-y":"unset"});var e=jQuery(".acym__wysid__template__content").height(),t=document.getElementById("acym__wysid__template");return html2canvas(t,{height:e,logging:!1}).then(function(e){return e.toDataURL("image/png")})},setEditButtonWYSID:function(){jQuery("#acym__wysid__edit__button").off("click").on("click",function(){"none"!==jQuery("#acym__wysid .acym__wysid__template__content").css("background-image")&&jQuery("#acym__wysid__background-image__template-delete").hide(),jQuery(".acym__wysid__row__element__toolbox__colorpicker").spectrum("destroy"),jQuery(".sp-container").remove(),jQuery("#acym_header").css("display","none"),jQuery(".acym__content").css("display","none");var e={display:"inherit"};"joomla"===ACYM_CMS&&(e.top=jQuery(".navbar-fixed-top").height()+"px"),jQuery("#acym__wysid").css(e),jQuery("#acym__wysid__edit").css("display","none"),""!==jQuery(".acym__wysid__hidden__save__content").val()&&jQuery("#acym__wysid__template").replaceWith(jQuery(".acym__wysid__hidden__save__content").val()),acym_helperEditorWysid.saveSettings=""!==jQuery(".acym__wysid__hidden__save__settings").val()?jQuery(".acym__wysid__hidden__save__settings").val():"",acym_helperEditorWysid.mailsSettings=""===acym_helperEditorWysid.saveSettings?{}:acym_helper.parseJson(acym_helperEditorWysid.saveSettings),""!==jQuery(".acym__wysid__hidden__save__stylesheet").val()&&(acym_helperEditorWysid.savedStylesheet=jQuery(".acym__wysid__hidden__save__stylesheet").val(),jQuery("#acym__wysid__right__toolbar__settings__stylesheet__textarea").val(acym_helperEditorWysid.savedStylesheet));var t=jQuery("#acym__wysid #acym__wysid__template img"),i=t.length;if(i>0){var _=0;t.on("load",function(){i===++_&&acym_editorWysidRowSelector.setRowSelector()})}else acym_editorWysidRowSelector.setRowSelector();var a=jQuery("#acym__wysid__template");a.find("[contenteditable]").attr("contenteditable","true"),a.find('[id^="mce_"]').removeAttr("id"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_helperEditorWysid.setInitFunctionsOnEdtionStart(),acym_editorWysidVersioning.setUndoAndAutoSave(!0);var o=jQuery("tr[data-dynamic]");o.length>0&&acym_editorWysidDynamic.insertDContent("",o)})},setCancelButtonWYSID:function(){jQuery("#acym__wysid__cancel__button").off("click").on("click",function(){jQuery("#acym_header").css("display",""),jQuery(".acym__content").css("display",""),jQuery("#acym__wysid").css("display","none"),jQuery("#acym__wysid__edit").css("display",""),jQuery(".acym__wysid__hidden__save__stylesheet").val(acym_helperEditorWysid.savedStylesheet)})}},isSearching=!1,lastSearch="",defaultSearch="hello",limitSearch=24,acym_editorWysidGiphy={loadGif:function(){var e=this;isSearching=!0,lastSearch=acym_helperEditorWysid.queryGiphy;var t=jQuery("#acym__wysid__modal__giphy--results");t=t.masonry({itemSelector:"img"}),jQuery.ajax({url:"https://api.giphy.com/v1/gifs/search?limit="+limitSearch+"&offset="+acym_helperEditorWysid.offsetGiphy+"&q="+acym_helperEditorWysid.queryGiphy+"&api_key=6hR2IN2Db2aw4XdtNxLELKtOh66F5XSo&rating=PG",dataType:"json"}).then(function(i){if(0===i.data.length&&0===acym_helperEditorWysid.offsetGiphy){t.data("masonry")&&t.masonry("destroy");var _=jQuery("#acym__wysid__modal__giphy--error_message");_.html(ACYM_JS_TXT.ACYM_NO_RESULTS_FOUND),_.show(),t.html(""),t.hide(),jQuery("#acym__wysid__modal__giphy--low-res-message").hide()}else{t.show(),jQuery(".acym__wysid__modal__giphy__results--img--new").removeClass("acym__wysid__modal__giphy__results--img--new");var a=jQuery("#acym__wysid__modal__giphy--error_message");a.html(""),a.hide(),jQuery("#acym__wysid__modal__giphy--low-res-message").show(),0===acym_helperEditorWysid.offsetGiphy&&(t.masonry("remove",t.find(".acym__wysid__modal__giphy__results--img")),jQuery(".acym__wysid__modal__giphy__results__container").scrollTop(0));var o="",r=t.width()/4;jQuery.each(i.data,function(e,t){var i=parseInt(100*r/parseInt(t.images.preview_gif.width))/100,_=parseInt(t.images.preview_gif.height*i);o+='<img class="acym__wysid__modal__giphy__results--img acym__wysid__modal__giphy__results--img--new" style="height: '.concat(_,'px" src="').concat(t.images.preview_gif.url,'" data-full-res-src="').concat(t.images.downsized.url,'">')});var s=jQuery(o);t.append(s).masonry("appended",s),t.masonry("layout"),e.loadMoreGif(),e.setSelectGif(),e.setResearchInput()}}).fail(function(){t.data("masonry")&&t.masonry("destroy");var e=jQuery("#acym__wysid__modal__giphy--error_message");e.html(ACYM_JS_TXT.ACYM_COULD_NOT_LOAD_GIF_TRY_FEW_MINUTES),e.show(),t.html(""),t.hide(),jQuery("#acym__wysid__modal__giphy--low-res-message").hide()}).always(function(){isSearching=!1})},setSelectGif:function(){jQuery(".acym__wysid__modal__giphy__results--img").off("click").on("click",function(){jQuery(".acym__wysid__modal__giphy__results--img--selected").removeClass("acym__wysid__modal__giphy__results--img--selected"),jQuery(this).toggleClass("acym__wysid__modal__giphy__results--img--selected"),jQuery("#acym__wysid__modal__giphy--insert").removeAttr("disabled")})},loadMoreGif:function(){jQuery(".acym__wysid__modal__giphy__results__container").on("scroll",function(){var e=jQuery(this)[0].scrollHeight-80;jQuery(this).height()+jQuery(this).scrollTop()>=e&&(jQuery(this).off("scroll"),acym_helperEditorWysid.offsetGiphy+=limitSearch,acym_editorWysidGiphy.loadGif())})},setResearchInput:function(){var e=this;jQuery("#acym__wysid__modal__giphy--search--button").off("click").on("click",function(){e.makeNewResearch(jQuery("#acym__wysid__modal__giphy--search").val())}),jQuery("#acym__wysid__modal__giphy--search").off("keyup").on("keyup",function(e){var t=jQuery(this).val();""===t&&lastSearch===defaultSearch||isSearching||lastSearch===t||(clearTimeout(acym_helperEditorWysid.typingTimerGiphy),13===e.which?acym_editorWysidGiphy.makeNewResearch(t):t.length>=2?acym_helperEditorWysid.typingTimerGiphy=setTimeout(function(){acym_editorWysidGiphy.makeNewResearch(t)},1e3):""===t&&acym_editorWysidGiphy.makeNewResearch(t))})},makeNewResearch:function(e){acym_helperEditorWysid.offsetGiphy=0,acym_helperEditorWysid.queryGiphy=""===e?defaultSearch:e;var t=jQuery("#acym__wysid__modal__giphy--results");t.data("masonry")&&t.masonry("destroy"),this.loadGif()},insertGif:function(){jQuery("#acym__wysid__modal__giphy--insert").off("click").on("click",function(){var e=jQuery(".acym__wysid__modal__giphy__results--img--selected");if(0===e.length)return!1;var t='<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;">';t+='<td class="large-12 acym__wysid__column__element__td">',t+='<div class="acym__wysid__tinymce--image">',t+='<img class="acym__wysid__media__inserted acym__wysid__media__inserted--focus acym__wysid__media__giphy" src="'+e.attr("data-full-res-src")+'" style="max-width: 100%; height: auto;  box-sizing: border-box; padding: 0 5px;display:block; margin-left: auto; margin-right: auto;"/>',t+="</div>",t+="</td>",t+="</tr>",acym_helperEditorWysid.$focusElement.replaceWith(t),jQuery("#acym__wysid__modal").css("display","none"),jQuery(".acym__wysid__media__inserted--focus").on("load",function(){jQuery(this).removeClass("acym__wysid__media__inserted--focus"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()})})}},acym_editorWysidImage={setDoubleClickImage:function(){jQuery(".acym__wysid__tinymce--image img").off("dblclick").on("dblclick",function(){jQuery(this).hasClass("acym__wysid__media__giphy")?acym_editorWysidNewContent.addGiphyWYSID(jQuery(this).closest(".acym__wysid__column__element")):acym_editorWysidImage.doubleClickImage(jQuery(this))})},doubleClickImage:function(e){this.openMediaManage(e.closest(".acym__wysid__column__element"))},addBackgroundImgToRows:function(e){var t=jQuery("#acym__wysid__context__block__background-image__remove");"none"!==e.css("background-image")?t.show():t.hide(),jQuery("#acym__wysid__context__block__background-image").off("click").on("click",function(){acym_editorWysidImage.openMediaManage(e,!0)}),t.off("click").on("click",function(){e.css({"background-image":"none"}),jQuery(this).hide()})},setImageWidthHeightOnInsert:function(){jQuery(".acym__wysid__media__inserted").length>0&&setTimeout(function(){jQuery(".acym__wysid__media__inserted").each(function(){jQuery(this).attr("height",jQuery(this).height()).attr("width",jQuery(this).width())})},200)},openMediaManage:function(e,t){"wordpress"===ACYM_CMS?acym_editorWysidWordpress.addMediaWPWYSID(e,t):acym_editorWysidJoomla.addMediaJoomlaWYSID(e,t)},setChangeBuiltWithImage:function(){jQuery('[name="acym__wysid__built-with__text__color"]').on("change",function(){var e=jQuery('[title="poweredby"]'),t=jQuery(this).val(),i="white"===t?"black":"white";e.attr("src",e.attr("src").replace(i,t))})}},acym_editorWysidJoomla={addMediaJoomlaWYSID:function(e,t){t=void 0!==t&&t,acym_helperEditorWysid.$focusElement=jQuery(e);var i=jQuery("#acym__wysid__modal__joomla-image__ui__iframe"),_=jQuery("#acym__wysid__modal__joomla-image__ui__actions").length>0;i.css({height:_?"90%":"100%",width:"100%"}),i.contents().find(".chzn-container-single").attr("style","").css("width","150px"),acym_editorWysidJoomla.setInsertMediaJoomlaWYSID(i,t),i.on("load",function(){acym_editorWysidJoomla.setInsertMediaJoomlaWYSID(i,t)}),jQuery("#acym__wysid__modal__joomla-image").css("display","inherit")},cancelMediaSelection:function(e){jQuery("#acym__wysid__modal__joomla-image").hide(),e||(acym_helperEditorWysid.$focusElement.length&&-1!==acym_helperEditorWysid.$focusElement.html().indexOf("insert_photo")&&acym_helperEditorWysid.$focusElement.replaceWith(""),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.checkForEmptyTbodyWYSID())},validateMediaSelection:function(e,t,i,_,a){if(acym_helper.empty(t))alert(ACYM_JS_TXT.ACYM_SELECT_A_PICTURE);else{if(e){var o=t.pop();if(o.indexOf("..")>=0&&!confirm(ACYM_JS_TXT.ACYM_INSERT_IMG_BAD_NAME))return;var r=acym_helperEditorWysid.$focusElement.css("padding-top");acym_helperEditorWysid.$focusElement.hasClass("acym__wysid__template__content")?(acym_helperEditorWysid.$focusElement.attr("style","background-image: url('"+o+"'); background-size: cover; background-position: center; background-repeat: no-repeat; padding: "+r+" 0 40px 0"),"none"!==acym_helperEditorWysid.$focusElement.css("background-image")&&jQuery("#acym__wysid__background-image__template-delete").css("display","flex")):(acym_helperEditorWysid.$focusElement.css("background-color","").attr("bgcolor",""),acym_helperEditorWysid.$focusElement.attr("style","background-image: url('"+o+"'); background-size: cover; background-position: center; background-repeat: no-repeat; padding: "+r+" 0").attr("width",acym_helperEditorWysid.$focusElement.width())),acym_editorWysidNotifications.addEditorNotification({message:ACYM_JS_TXT.ACYM_BECARFUL_BACKGROUND_IMG,level:"warning"})}else{var s="",n=acym_helperEditorWysid.$focusElement.find(".acym__wysid__link__image");for(var c in t)if(t.hasOwnProperty(c)){var l=t[c];if(l.indexOf("..")>=0&&!confirm(ACYM_JS_TXT.ACYM_INSERT_IMG_BAD_NAME))return;var d="",y="";void 0!==i&&(d=i),void 0!==_&&(y=_);var m=0===parseInt(c)?"acym__wysid__media__inserted--selected":"";s+='<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;">',s+='<td class="large-12 acym__wysid__column__element__td">',s+='<div class="acym__wysid__tinymce--image">',s+='<div style="text-align: center; " data-mce-style="text-align: center">',n.length>0&&0===parseInt(c)&&(s+='<a href="'+n.attr("href")+'" class="acym__wysid__link__image" target="_blank">'),s+='<img class="acym__wysid__media__inserted '+m+'" style="max-width: 100%; height: auto; box-sizing: border-box; padding: 0 5px; display:block; margin-left: auto; margin-right: auto;" src="'+l+'" alt="'+acym_helper.escape(d)+'" title="'+acym_helper.escape(y)+'" hspace="0"/>',void 0!==a&&a.length>0&&(s+='<div class="acym__wysid__media_caption" style="width: 100%; height: auto; box-sizing: border-box; padding: 0 5px; display:block;">'+acym_helper.escape(a)+"</div>"),n.length>0&&(s+="</a>"),s+="</div>",s+="</div>",s+="</td>",s+="</tr>"}acym_helperEditorWysid.$focusElement.replaceWith(s)}jQuery("#acym__wysid__modal__joomla-image").hide(),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}},setInsertMediaJoomlaWYSID:function(e,t){jQuery("#acym__wysid__modal__joomla-image__ui__actions__cancel").off("click").on("click",function(){acym_editorWysidJoomla.cancelMediaSelection(t)}),jQuery("#acym__wysid__modal__joomla-image__ui__actions__select").off("click").on("click",function(){var i=ACYM_ROOT_URI;e.contents().find(".media-breadcrumb-item a").each(function(){i+=jQuery(this).text().trim()+"/"});var _=[];e.contents().find(".media-browser-grid .media-browser-item.selected .media-browser-image .media-browser-item-info").each(function(){_.push(i+jQuery(this).text().trim())}),0===_.length&&e.contents().find(".media-browser .media-browser-item.selected").each(function(){acym_helper.empty(jQuery(this).find(".size").text().trim())||_.push(i+jQuery(this).find(".name").text().trim())}),acym_editorWysidJoomla.validateMediaSelection(t,_,"","","")}),e.contents().find(".button-cancel").attr("onclick","").off("click").on("click",function(){acym_editorWysidJoomla.cancelMediaSelection(t)}),e.contents().find(".pull-right .btn-success, .pull-right .btn-primary").attr("onclick","").off("click").on("click",function(){var i=e.contents().find("#f_url").val(),_=e.contents().find("#f_alt").val(),a=e.contents().find("#f_title").val(),o=e.contents().find("#f_caption").val(),r=[];acym_helper.empty(i)||((i.match("^"+ACYM_JOOMLA_MEDIA_FOLDER)||i.match("^"+ACYM_JOOMLA_MEDIA_FOLDER_IMAGES))&&(i=ACYM_JOOMLA_MEDIA_IMAGE+i),r.push(i)),acym_editorWysidJoomla.validateMediaSelection(t,r,_,a,o)})}},acym_editorWysidModal={setModalWindowWYSID:function(){jQuery(".acym__wysid__modal--close").click(function(){jQuery(".acym__wysid__modal").hide(),acym_helperEditorWysid.$focusElement.length&&"TR"!=acym_helperEditorWysid.$focusElement.prop("tagName")&&acym_helperEditorWysid.$focusElement.replaceWith(""),acym_helperEditorWysid.checkForEmptyTbodyWYSID()}),"joomla"==ACYM_CMS&&jQuery(".acym__wysid__modal__joomla-image--close").click(function(){jQuery("#acym__wysid__modal__joomla-image").hide(),acym_helperEditorWysid.$focusElement.length&&"TR"!=acym_helperEditorWysid.$focusElement.prop("tagName")&&!acym_helperEditorWysid.$focusElement.hasClass("acym__wysid__template__content")&&acym_helperEditorWysid.$focusElement.replaceWith(""),acym_helperEditorWysid.checkForEmptyTbodyWYSID()})},setSelectOneTemplate:function(){jQuery(".acym__template__choose__ajax").off("DOMSubtreeModified").on("DOMSubtreeModified",function(){jQuery(".acym__template__choose__list .acym__templates__oneTpl").off("click").on("click",function(e){e.preventDefault();var t=jQuery(this).find("a").attr("href"),i=ACYM_AJAX_URL+"&page=acymailing_mails&ctrl="+acym_helper.ctrlMails+"&task=getMailContent&from="+jQuery(this).attr("id");jQuery.post(i,function(e){return"error"==e?(alert(ACYM_JS_TXT.ACYM_ERROR),!1):(window.location.href=t,!1)})})})},setDynamicsModal:function(){var e=null;jQuery("#insertButton").off("click").on("click",function(){var t=jQuery("#dtextcode").val();if(t){var i=jQuery('input[name="editor_autoSave"]').val(),_=ACYM_AJAX_URL+"&page=acymailing_dynamics&ctrl="+acym_helper.ctrlDynamics+"&task=replaceDummy";acym_helper.get(_,{mailId:i,code:t}).then(function(i){i||(i={data:{content:t}});var _='<span id="acymRangeId" class="acym_dynamic mceNonEditable" data-dynamic="'+t+'">';if(_+=i.data.content,_+='<em class="acym_remove_dynamic acymicon-close">&zwj;</em></span> &zwj;',!acym_helper.empty(e)&&!acym_editorWysidModal.isSelectionInEditor()){var a=window.getSelection();a.removeAllRanges(),a.addRange(e)}tinyMCE.activeEditor.selection.setContent(_),acym_helperEditorWysid.setColumnRefreshUiWYSID(!1),acym_editorWysidVersioning.setUndoAndAutoSave();var o=document.getElementById("acymRangeId");jQuery(o).attr("contenteditable","false"),o.removeAttribute("id")})}}),jQuery(document).on("selectionchange",function(){acym_editorWysidModal.isSelectionInEditor()&&(e=window.getSelection().getRangeAt(0))})},isSelectionInEditor:function(){var e=jQuery(document.getSelection().anchorNode);return e.hasClass("acym__wysid__tinymce--text")||e.closest(".acym__wysid__tinymce--text").length>0}},acym_editorWysidMultilingual={currentLanguage:"main",selectedLanguage:"",forceReload:!1,setLanguageSelection:function(){jQuery(".acym__wysid__edit__languages__selection img, .acym__wysid__edit__languages__selection__check").off("click").on("click",function(){if(acym_editorWysidMultilingual.selectedLanguage=jQuery(this).parent().find("img").attr("acym-data-lang"),"main"===acym_editorWysidMultilingual.selectedLanguage&&"main"===acym_editorWysidMultilingual.currentLanguage)return!1;var e=jQuery('input[name="mail[subject]"]').val(),t=jQuery('input[name="mail[preheader]"]').val(),i=jQuery("#editor_content").val();if(jQuery("#acym__wysid__edit__multilingual__creation").hasClass("is-hidden")&&acym_helper.empty(e)&&(!acym_helper.empty(t)||!acym_helper.empty(i)))return acym_editorWysidMultilingual.selectedLanguage!==acym_editorWysidMultilingual.currentLanguage&&acym_helper.alert(ACYM_JS_TXT.ACYM_ENTER_SUBJECT),!1;if(acym_editorWysidMultilingual.selectedLanguage===acym_editorWysidMultilingual.currentLanguage&&!acym_editorWysidMultilingual.forceReload)return!1;acym_editorWysidMultilingual.forceReload=!1,"main"===acym_editorWysidMultilingual.selectedLanguage?jQuery(".acym__wysid__edit__preview__reset").addClass("is-hidden"):jQuery(".acym__wysid__edit__preview__reset").removeClass("is-hidden"),jQuery(".acym__wysid__edit__languages-selected").removeClass("acym__wysid__edit__languages-selected"),jQuery('[acym-data-lang="'+acym_editorWysidMultilingual.selectedLanguage+'"]').closest(".acym__wysid__edit__languages__selection").addClass("acym__wysid__edit__languages-selected");var _=jQuery('input[name="multilingual['+acym_editorWysidMultilingual.selectedLanguage+'][subject]"]').val(),a=jQuery('input[name="multilingual['+acym_editorWysidMultilingual.selectedLanguage+'][preview]"]').val(),o=jQuery('input[name="multilingual['+acym_editorWysidMultilingual.selectedLanguage+'][content]"]').val(),r=jQuery('input[name="multilingual['+acym_editorWysidMultilingual.selectedLanguage+'][autosave]"]').val(),s=jQuery('input[name="multilingual['+acym_editorWysidMultilingual.selectedLanguage+'][settings]"]').val(),n=jQuery('input[name="multilingual['+acym_editorWysidMultilingual.selectedLanguage+'][stylesheet]"]').val();"main"!==acym_editorWysidMultilingual.selectedLanguage&&acym_helper.empty(_)&&acym_helper.empty(a)&&acym_helper.empty(o)?(jQuery(this).closest(".acym__content").find("> div").addClass("is-hidden"),jQuery("#acym__wysid__edit__languages, #acym__wysid__edit__multilingual__creation").removeClass("is-hidden"),acym_editorWysidMultilingual.switchLanguage("","","","")):(acym_editorWysidMultilingual.switchLanguage(_,a,o,r,s,n),acym_editorWysidMultilingual.showEdition())}),jQuery("#acym__wysid__edit__multilingual__creation__default").off("click").on("click",function(){acym_editorWysidMultilingual.switchLanguage(jQuery('input[name="multilingual[main][subject]"]').val(),jQuery('input[name="multilingual[main][preview]"]').val(),jQuery('input[name="multilingual[main][content]"]').val(),"",jQuery('input[name="multilingual[main][settings]"]').val(),jQuery('input[name="multilingual[main][stylesheet]"]').val()),acym_editorWysidMultilingual.showEdition()}),jQuery("#acym__wysid__edit__multilingual__creation__scratch").off("click").on("click",function(){acym_editorWysidMultilingual.switchLanguage("","",jQuery("#default_template").val(),""),acym_editorWysidMultilingual.showEdition()}),jQuery("#acym__wysid__edit__preview__reset__content").off("click").on("click",function(){acym_helper.confirm(ACYM_JS_TXT.ACYM_RESET_TRANSLATION)&&(jQuery('input[name="multilingual['+acym_editorWysidMultilingual.currentLanguage+'][subject]"]').val(""),jQuery('input[name="multilingual['+acym_editorWysidMultilingual.currentLanguage+'][preview]"]').val(""),jQuery('input[name="multilingual['+acym_editorWysidMultilingual.currentLanguage+'][content]"]').val(""),jQuery('input[name="multilingual['+acym_editorWysidMultilingual.currentLanguage+'][settings]"]').val(""),jQuery('input[name="multilingual['+acym_editorWysidMultilingual.currentLanguage+'][stylesheet]"]').val(""),jQuery('input[name="mail[subject]"]').val(""),jQuery('input[name="mail[preheader]"]').val(""),jQuery("#editor_content").val(""),acym_editorWysidMultilingual.forceReload=!0,jQuery('img[acym-data-lang="'+acym_editorWysidMultilingual.currentLanguage+'"]').click().closest(".acym__wysid__edit__languages__selection").removeClass("acym__wysid__edit__languages__selection-done"))})},storeCurrentValues:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=jQuery('input[name="mail[subject]"]').val();return!!acym_helper.empty(t)||(jQuery('img[acym-data-lang="'+this.currentLanguage+'"]').closest(".acym__wysid__edit__languages__selection").addClass("acym__wysid__edit__languages__selection-done"),jQuery('input[name="multilingual['+this.currentLanguage+'][subject]"]').val(t),jQuery('input[name="multilingual['+this.currentLanguage+'][preview]"]').val(jQuery('input[name="mail[preheader]"]').val()),jQuery('input[name="multilingual['+this.currentLanguage+'][content]"]').val(jQuery("#editor_content").val()),jQuery('input[name="multilingual['+this.currentLanguage+'][autosave]"]').val(jQuery("#editor_autoSave").val()),jQuery('input[name="multilingual['+this.currentLanguage+'][settings]"]').val(jQuery("#editor_settings").val()),jQuery('input[name="multilingual['+this.currentLanguage+'][stylesheet]"]').val(jQuery("#editor_stylesheet").val()),e&&jQuery('img[acym-data-lang="main"]').click(),!0)},switchLanguage:function(e,t,i,_){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";this.storeCurrentValues(),jQuery('input[name="mail[subject]"]').val(e),jQuery('input[name="mail[preheader]"]').val(t),jQuery("#editor_content").val(i),jQuery("#editor_autoSave").val(_),""!==a&&jQuery("#editor_settings").val(a),""!==a&&jQuery("#editor_stylesheet").val(o),acym_editorWysidVersioning.checkForUnsavedVersion(),this.currentLanguage=this.selectedLanguage},showEdition:function(){jQuery("#acym__wysid__edit .acym__content > div").removeClass("is-hidden"),jQuery("#acym__wysid__edit__multilingual__creation").addClass("is-hidden"),acym_helperPreview.loadIframe("acym__wysid__preview__iframe__acym__wysid__email__preview",!1)},setClickStartFromTemplate:function(){acym_helperModal.isMultilingualEdition&&(jQuery(".acym__templates__oneTpl a").off("click").on("click",function(e){e.preventDefault()}),jQuery(".acym__templates__oneTpl").off("click").on("click",function(e){var t=this;e.preventDefault();var i=jQuery(".acym__template__choose__modal__loader");i.css("display","flex");var _={ctrl:ACYM_IS_ADMIN?"mails":"frontmails",task:"getMailByIdAjax",id:this.getAttribute("id")};acym_helper.get(ACYM_AJAX_URL,_).then(function(e){e.error?acym_helperNotification.addNotification(e.message,"error",!0):(acym_editorWysidMultilingual.switchLanguage(e.data.subject,e.data.preheader,e.data.body,"",e.data.settings,e.data.stylesheet),acym_editorWysidMultilingual.showEdition(),jQuery(t).closest("#acym__template__choose__modal").find(".close-button").click(),i.css("display","none"))})}))}},acym_editorWysidNewContent={addTitleWYSID:function(e){jQuery(e).replaceWith('<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td"><div class="acym__wysid__tinymce--text"><h1 class="acym__wysid__tinymce--title--placeholder">&zwj;</h1></div></td></tr>'),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()},addTextWYSID:function(e){jQuery(e).replaceWith('<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td"><div class="acym__wysid__tinymce--text"><p class="acym__wysid__tinymce--text--placeholder">&zwj;</p></div></td></tr>'),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()},addMediaWysid:function(e){var t='<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;">';t+='<td class="large-12 acym__wysid__column__element__td">',t+='<div class="acym__wysid__tinymce--image acym__wysid__media__inserted--focus">',t+='<div style="text-align: center" data-mce-style="text-align: center">',t+='<img class="acym__wysid__media__inserted" src="'+ACYM_MEDIA_URL+'images/default_image.png" title="image" hspace="0" alt="" style="max-width: 100%; height: auto;  box-sizing: border-box; padding: 0 5px;display:inline-block; margin-left: auto; margin-right: auto;"/>',t+="</div>",t+="</div>",t+="</td>",t+="</tr>",jQuery(e).replaceWith(t),jQuery(".acym__wysid__media__inserted--focus img").off("load").on("load",function(){var e=jQuery(this).closest(".acym__wysid__media__inserted--focus");e.removeClass("acym__wysid__media__inserted--focus"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave(),setTimeout(function(){e.find("img").click(),document.querySelector(".acym__wysid__media__inserted--selected").click()},500)})},addButtonWYSID:function(e){var t='<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;">';t+='<td class="large-12 acym__wysid__column__element__td">',t+='<div style="text-align: center;box-sizing: inherit;">',t+='<a class="acym__wysid__column__element__button acym__wysid__content-no-settings-style" style="background-color: #222222; color: white; padding: 25px 30px; max-width: 100%; overflow: unset; border: 1px solid white; text-overflow: ellipsis; text-align: center; text-decoration: none; word-break: break-word;display: inline-block; box-shadow: none;font-family: Arial; font-size: 14px; cursor: pointer; line-height: 1; border-radius: 0" href="#" target="_blank">'+ACYM_JS_TXT.ACYM_BUTTON+"</a>",t+="</div>",t+="</td>",t+="</tr>",jQuery(e).replaceWith(t),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()},addFollowWYSID:function(e){var t='<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;">';t+='<td class="large-12 acym__wysid__column__element__td">',t+='<div style="text-align: center;">',t+='<p class="acym__wysid__column__element__follow" style="text-align: center; cursor: pointer; padding: 0;margin: 0;">',t+='<a class="acym__wysid__column__element__follow__facebook" href="">',t+='<img hspace="0" style="display: inline-block; max-width: 100%; height: auto;  box-sizing: border-box; width: 40px; padding: 3px;" src="'+acym_helperEditorWysid.socialMedia.facebook.src+'" width="40" alt="facebook">',t+="</a>",t+='<a class="acym__wysid__column__element__follow__twitter" href="">',t+='<img hspace="0" style="display: inline-block; max-width: 100%; height: auto;  box-sizing: border-box; width: 40px; padding: 3px;" src="'+acym_helperEditorWysid.socialMedia.twitter.src+'"  width="40" alt="twitter">',t+="</a>",t+="</p>",t+="</div>",t+="</td>",t+="</tr>",jQuery(e).replaceWith(t),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()},addSpaceWYSID:function(e){jQuery(e).replaceWith('<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="height: 50px"><span class="acy-editor__space" style="display:block; padding: 0;margin: 0; height: 100%"></span></td></tr>'),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()},addVideoWYSID:function(e){acym_helperEditorWysid.$focusElement=jQuery(e),acym_editorWysidNewContent.setModalVideoWYSID(),jQuery("#acym__wysid__modal").css("display","inherit"),acym_helperEditorWysid.setColumnRefreshUiWYSID()},addGiphyWYSID:function(e){acym_helperEditorWysid.$focusElement=jQuery(e),acym_editorWysidNewContent.setModalGiphyWYSID(),jQuery("#acym__wysid__modal").css("display","inherit"),acym_helperEditorWysid.setColumnRefreshUiWYSID()},addSeparatorWysid:function(e){jQuery(e).replaceWith('<tr class="acym__wysid__column__element acym__wysid__column__element__separator cursor-pointer" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td"><hr style="color: black; size: 3px; border-bottom: 3px solid black; width: 100%; border-top: none; border-left: none; border-right: none;" class="acym__wysid__row__separator"></td></tr>'),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()},addShareWYSID:function(e){var t='<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;">';t+='<td class="large-12 acym__wysid__column__element__td">',t+='<div class="acym__wysid__column__element__share acym__wysid__column__element__share--add acy" style="text-align: center; margin-top: 10px; margin-bottom: 10px;">',t+='<a style="display: inline-block" class="acym__wysid__column__element__share__social acym__wysid__column__element__share__facebook" href="'+acym_helperEditorWysid.socialMedia.facebook.link+'">',t+='<img hspace="0" style="vertical-align: middle; width: 30px; display: inline; margin-right: 5px;" src="'+acym_helperEditorWysid.socialMedia.facebook.src+'" alt="'+acym_helperEditorWysid.socialMedia.facebook.src+'">',t+='<span style="color: #303e46; vertical-align: middle; margin-right: 10px; font-size: 15px">'+acym_helperEditorWysid.socialMedia.facebook.text+"</span>",t+="</a>",t+='<a style="display: inline-block" class="acym__wysid__column__element__share__social acym__wysid__column__element__share__twitter" href="'+acym_helperEditorWysid.socialMedia.twitter.link+'">',t+='<img hspace="0" style="vertical-align: middle; width: 30px; display: inline; margin-right: 5px;" src="'+acym_helperEditorWysid.socialMedia.twitter.src+'" alt="'+acym_helperEditorWysid.socialMedia.twitter.src+'">',t+='<span style="color: #303e46; vertical-align: middle; margin-right: 10px; font-size: 15px">'+acym_helperEditorWysid.socialMedia.twitter.text+"</span>",t+="</a>",t+="</div>",t+="</td>",t+="</tr>",jQuery(e).replaceWith(t),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()},setModalGiphyWYSID:function(){var e='<div class="grid-container"><div class="cell grid-x align-center grid-padding-x">';e+='<img hspace="0" class="cell" id="acym__wysid__modal__giphy--image" src="'+ACYM_MEDIA_URL+'images/giphy.png" alt="">',e+='<div class="cell grid-x grid-margin-x"><input class="cell auto" type="text" id="acym__wysid__modal__giphy--search" placeholder="'+ACYM_JS_TXT.ACYM_SEARCH_FOR_GIFS+'">',e+='<button type="button" class="cell shrink button button-secondary" id="acym__wysid__modal__giphy--search--button">'+ACYM_JS_TXT.ACYM_SEARCH_GIFS+"</button></div>",e+='<p class="cell text-center" id="acym__wysid__modal__giphy--low-res-message">'+ACYM_JS_TXT.ACYM_GIPHY_LOW_RES_TEXT+"</p>",e+="</div></div>",jQuery("#acym__wysid__modal__ui__fields").html(e),e='<div class="grid-container acym__wysid__modal__giphy__results__container">',e+='<h3 class="cell text-center acym__title__primary__color" id="acym__wysid__modal__giphy--error_message" style="display: none"></h3>',e+='<div class="cell grid-x grid-padding-x grid-margin-x grid-margin-y margin-top-1" id="acym__wysid__modal__giphy--results"></div></div>',jQuery("#acym__wysid__modal__ui__display").html(e),e='<div class="grid-container"><div class="cell grid-x align-right grid-padding-x">',e+='<button class="button" type="button" id="acym__wysid__modal__giphy--insert" disabled="disabled">'+ACYM_JS_TXT.ACYM_INSERT_GIF+"</button>",e+="</div></div>",jQuery("#acym__wysid__modal__ui__search").html(e),acym_editorWysidGiphy.makeNewResearch(""),acym_editorWysidGiphy.insertGif()},setModalVideoWYSID:function(){var e='<div class="grid-container">';e+='<div class="grid-x grid-padding-x grid-padding-y">',e+='<div class="auto cell"></div>',e+='<div class="small-3 medium-3 cell" style="display: inline-flex">',e+='<img alt="" style="display: block; margin: auto; max-height: 50px" src="'+ACYM_MEDIA_URL+'images/vimeo.png">',e+="</div>",e+='<div class="small-3 medium-3 cell" style="display: inline-flex">',e+='<img alt="" style="display: block; margin: auto; max-height: 50px" src="'+ACYM_MEDIA_URL+'images/youtube.png">',e+="</div>",e+='<div class="small-4 medium-3 cell" style="display: inline-flex; padding: 15px 0 0 30px;">',e+='<img alt="" style="display: block; margin: auto; max-height: 50px" src="'+ACYM_MEDIA_URL+'images/dailymotion.png">',e+="</div>",e+='<div class="auto cell"></div>',e+='<div class="small-8 medium-10 cell">',e+='<input id="acym__wysid__modal__video__search" type="text" placeholder="Url">',e+="</div>",e+='<div class="small-4 medium-2 cell">',e+='<button type="button" id="acym__wysid__modal__video__load" class="button primary expanded " href="#">Load</button>',e+="</div>",e+="</div>",e+="</div>",jQuery("#acym__wysid__modal__ui__fields").html(e),e='<div class="grid-container">',e+='<div class="grid-x grid-padding-x">',e+='<div id="acym__wysid__modal__video__result" class="medium-12 cell"></div>',e+="</div>",e+="</div>",jQuery("#acym__wysid__modal__ui__display").html(e),e='<div class="grid-container">',e+='<div class="grid-x grid-padding-x">',e+='<div class="small-8 medium-10 cell"></div>',e+='<div class="small-4 medium-2 cell">',e+='<button type="button" id="acym__wysid__modal__video__insert" class="button primary expanded disabled" href="#">Insert</button>',e+="</div>",e+="</div>",e+="</div>",jQuery("#acym__wysid__modal__ui__search").html(e);var t=jQuery("#acym__wysid__modal__video__load"),i=jQuery("#acym__wysid__modal__video__insert"),_=jQuery("#acym__wysid__modal__video__search"),a=jQuery("#acym__wysid__modal__video__result");t.off("click").on("click",function(){var e=_.val();i.unbind("click").click(function(){acym_helperEditorWysid.$focusElement.replaceWith('<tr class="acym__wysid__column__element"><td class="large-12 acym__wysid__column__element__td"><div class="acym__wysid__tinymce--image"><p>'+a.html()+"</p></div></td></tr>"),acym_editorWysidTinymce.addTinyMceWYSID(),jQuery("#acym__wysid__modal").css("display","none"),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.setColumnRefreshUiWYSID()});var t=e.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/),o=e.match(/^(?:(?:http|https):\/\/)?(?:www.)?(dailymotion\.com|dai\.ly)\/((video\/([^_]+))|(hub\/([^_]+)|([^\/_]+)))$/),r=e.match(/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/);if(null!=t)a.html('<a href="https://www.youtube.com/watch?v='+t[1]+'" target="_blank"><img alt="" src="https://img.youtube.com/vi/'+t[1]+'/0.jpg" style="max-width: 100%; height: auto; box-sizing: border-box; padding: 0 5px; display: block;margin-left: auto; margin-right: auto; float: none;"/></a>'),i.removeClass("disabled");else if(null!=o)null!==o&&(void 0!==o[4]?a.html('<a href="https://www.dailymotion.com/video/'+o[4]+'"><img alt="" src="https://www.dailymotion.com/thumbnail/video/'+o[4]+'" style="max-width: 100%; height: auto; box-sizing: border-box; padding: 0 5px; display: block; margin-left: auto; margin-right: auto; float: none;"/></a>'):a.html('<a href="https://www.dailymotion.com/video/'+o[2]+'"><img alt="" src="https://www.dailymotion.com/thumbnail/video/'+o[2]+'" style="max-width: 100%; height: auto; box-sizing: border-box; padding: 0 5px; display: block; margin-left: auto; margin-right: auto; float: none;"/></a>')),i.removeClass("disabled");else if(null!=r){var s=document.createElement("script");s.id="vimeothumb",s.type="text/javascript",s.src="https://vimeo.com/api/v2/video/"+r[5]+".json?callback=showThumb",jQuery("#acym__wysid__modal__video__search").before(s),jQuery("#vimeothumb").remove()}else a.html('<div class="acym__wysid__error_msg" style="text-align: center; margin-top: 100px;">'+ACYM_JS_TXT.ACYM_NON_VALID_URL+"</div>"),i.addClass("disabled").off("click");a.unbind("click").click(function(e){e.preventDefault()})}),_.keyup(function(e){var i=e.which;13==i&&e.preventDefault(),13!=i&&188!=i&&186!=i||t.click()})}};function showThumb(e){var t="https://i.vimeocdn.com/filter/overlay?src="+encodeURIComponent(e[0].thumbnail_large);t+="&src="+encodeURIComponent("https://f.vimeocdn.com/p/images/crawler_play.png");var i='<a href="https://vimeo.com/'+e[0].id+'">';i+='<img alt="" src="'+t+'" style="max-width: 100%; height: auto; box-sizing: border-box; padding: 0 5px; display: block; margin-left: auto; margin-right: auto; float: none;"/>',i+="</a>",jQuery("#acym__wysid__modal__video__result").html(i),jQuery("#acym__wysid__modal__video__insert").removeClass("disabled")}var acym_editorWysidNewRow={addRow1WYSID:function(e){jQuery(e).replaceWith('<table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255);" cellpadding="0" cellspacing="0" border="0"><tbody><tr><th class="small-12 medium-12 large-12 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th></tr></tbody></table>'),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.setColumnRefreshUiWYSID()},addRow2WYSID:function(e){jQuery(e).replaceWith('<table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255);" cellpadding="0" cellspacing="0" border="0"><tbody><tr><th class="small-12 medium-6 large-6 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-6 large-6 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th></tr></tbody></table>'),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.setColumnRefreshUiWYSID()},addRow3WYSID:function(e){jQuery(e).replaceWith('<table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255);" cellpadding="0" cellspacing="0" border="0"><tbody><tr><th class="small-12 medium-4 large-4 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-4 large-4 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-4 large-4 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th></tr></tbody></table>'),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.setColumnRefreshUiWYSID()},addRow4WYSID:function(e){jQuery(e).replaceWith('<table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255);" cellpadding="0" cellspacing="0" border="0"><tbody><tr><th class="small-12 medium-3 large-3 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-3 large-3 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-3 large-3 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-3 large-3 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th></tr></tbody></table>'),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.setColumnRefreshUiWYSID()},addRow5WYSID:function(e){jQuery(e).replaceWith('<table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255);" cellpadding="0" cellspacing="0" border="0"><tbody><tr><th class="small-12 medium-8 large-8 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-4 large-4 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th></tr></tbody></table>'),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.setColumnRefreshUiWYSID()},addRow6WYSID:function(e){jQuery(e).replaceWith('<table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255);" cellpadding="0" cellspacing="0" border="0"><tbody><tr><th class="small-12 medium-4 large-4 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th><th class="small-12 medium-8 large-8 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table></th></tr></tbody></table>'),acym_editorWysidVersioning.setUndoAndAutoSave(),acym_helperEditorWysid.setColumnRefreshUiWYSID()}},acym_editorWysidNotifications={hideNotification:function(){jQuery("#acym__wysid__top-toolbar__notification").removeClass("acym__toolbar__message__visible"),jQuery("#acym__wysid__top-toolbar__notification__message").html(""),jQuery("#acym__wysid__top-toolbar__actions").show(),jQuery("#acym__wysid__top-toolbar__notification__close").show()},addEditorNotification:function(e,t,i,_){t=void 0!==t&&t,i=void 0!==i&&i,_=void 0!==_&&_;var a="";a="success"===e.level?"acymicon-check-circle":"info"===e.level?"acymicon-bell":"warning"===e.level?"acymicon-exclamation-triangle":"acymicon-exclamation-circle";var o=jQuery("#acym__wysid__top-toolbar"),r=o.find("#acym__wysid__top-toolbar__notification");o.find("#acym__wysid__top-toolbar__actions").hide(),r.addClass("acym__toolbar__message__visible").find("#acym__wysid__top-toolbar__notification__icon").addClass(a),r.find("#acym__wysid__top-toolbar__notification__message").html(e.message),r.find("#acym__wysid__top-toolbar__notification__close").off("click").on("click",function(){acym_editorWysidNotifications.hideNotification()}),i&&r.find("#acym__wysid__top-toolbar__notification__close").hide(),_||r.find("#acym__wysid__top-toolbar__keep").hide(),t&&setTimeout(function(){acym_editorWysidNotifications.hideNotification()},t)}},acym_editorWysidOutlook={setButtonOutlook:function(e){var t,i;t=navigator.userAgent.toLowerCase().indexOf("firefox")>-1?e.css("borderBottomLeftRadius"):e.css("borderRadius"),t=' arcsize="'+2*parseInt(t.replace(/[^-\d\.]/g,""))+'%"';var _=e.css("border-top-width");0===_.indexOf("0")?(i=' strokecolor="'+e.css("background-color")+'"',_="0"):i=' strokecolor="'+e.css("border-top-color")+'"',_=' strokeweight="'+_+'"';var a=' fillcolor="'+e.css("background-color")+'"',o=' href="'+e.attr("href")+'"',r='style="width: '+(Math.ceil(e.outerWidth())+"px")+"; height:"+(e.css("height").replace(/[^-\d\.]/g,"")+"px")+';v-text-anchor:middle;"',s="color :"+e.css("color")+";";return s+=" font-family:"+e.css("font-family")+";",s+=" font-size:"+e.css("font-size")+";",'\x3c!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word"'+r+o+t+i+_+a+'><w:anchorlock/><center style="'+(s+=" font-weight:"+e.css("font-weight")+";")+'">'+e.html()+"</center></v:roundrect><![endif]--\x3e\x3c!--[if !mso]> --\x3e"},setBackgroundOutlook:function(e){var t='\x3c!--[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width: '+e.width()+"px;height: "+e.height()+'px"><v:fill type="frame" src="'+e.css("background-image")+'" /><v:textbox inset="0,0,0,0"><![endif]--\x3e';t=t.replace('url("',"").replace('")',""),e.prepend(t).append("\x3c!--[if gte mso 9]></v:textbox></v:rect><![endif]--\x3e")}},acym_editorWysidRowSelector={setRowSelector:function(){setTimeout(function(){if(jQuery(".mce-tinymce-inline").is(":visible"))return!0;jQuery(".acym__wysid__row__selector, .acym__wysid__element__toolbox").remove(),jQuery(".acym__wysid__row__element").css("z-index","100").each(function(){var e=jQuery(this).find("> tbody");""!==e.css("background-color")&&void 0!==e.css("background-color")&&"inherit"!==e.css("background-color")&&"rgba(0, 0, 0, 0)"!==e.css("background-color")&&(jQuery(this).css("background-color",e.css("background-color")),e.css("background-color","inherit").attr("bgcolor","")),jQuery(this).prepend('<div class="acym__wysid__row__selector"></div>')});var e=jQuery(".acym__wysid__template__content"),t=e.css("width").replace(/[^-\d\.]/g,""),i=e.offset();jQuery(".acym__wysid__row__selector").each(function(){var e=jQuery(this).closest(".acym__wysid__row__element"),_=e.offset(),a=""===e.css("border-width")?0:parseInt(e.css("border-width").replace(/[^-\d\.]/g,"")),o=""===e.css("padding-bottom")?0:parseInt(e.css("padding-bottom").replace(/[^-\d\.]/g,"")),r=e.height()+parseInt(e.css("padding-top").replace(/[^-\d\.]/g,""))+o+2*a,s="-"+(Math.round(_.left)-Math.round(i.left)+a)+"px";jQuery(this).css({width:t+"px",height:r,left:s,top:0-a+"px"}),jQuery(this).attr("style",jQuery(this).attr("style")+"width: "+t+"px; height: "+r+"px; left: "+s+";top: "+(0-a)+"px");jQuery(this).append('<div  class="acym__wysid__row__toolbox"><i class="acymicon-pencil acym__wysid__row__toolbox__edit acym__wysid__row__toolbox__actions"></i><i class="acymicon-content_copy acym__wysid__row__toolbox__copy acym__wysid__row__toolbox__actions"></i><i class="acymicon-arrows acym__wysid__row__element__toolbox__move acym__wysid__row__toolbox__actions"></i><i class="acymicon-delete acym__wysid__row__toolbox__actions acym__wysid__row__toolbox__delete__row"></i></div><div class="acym__wysid__row__height__container"><i class="acymicon-code acym__wysid__row__toolbox__height"></i></div>')}),jQuery(".acym__wysid__column__element").each(function(){jQuery(this).append('<div class="acym__wysid__element__toolbox"><i class="acymicon-content_copy acym__wysid__element__toolbox__copy acym__wysid__element__toolbox__actions"></i><i class="acymicon-arrows acym__wysid__column__element__toolbox__move acym__wysid__element__toolbox__actions"></i><i class="acymicon-delete acym__wysid__element__toolbox__actions acym__wysid__element__toolbox__delete"></i></div>')}),acym_editorWysidToolbox.setRefreshAfterToolbox(),acym_editorWysidContextModal.setBlockContextModalWYSID()},150)}},acym_editorWysidTest={toggleSendTest:function(){var e=jQuery("#acym__wysid__send__test"),t=jQuery("#acym__wysid__right-toolbar");jQuery("#acym__wysid__test__button").off("click").on("click",function(){acym_editorWysidTest.toggleSendTestAndRightToolbar(e,t),jQuery(window).on("mousedown",function(i){if(jQuery(i.target).closest("#acym__wysid__send__test").length>0)return!0;acym_editorWysidTest.toggleSendTestAndRightToolbar(e,t)})}),jQuery(".acym__wysid__send__test-close").off("click").on("click",function(){acym_editorWysidTest.toggleSendTestAndRightToolbar(e,t)})},toggleSendTestAndRightToolbar:function(e,t){jQuery(window).off("mousedown"),e.hasClass("acym__wysid__show")?(e.removeClass("acym__wysid__show"),t.removeClass("acym__wysid__hidden")):(e.addClass("acym__wysid__show"),t.addClass("acym__wysid__hidden"))},sendTestAjax:function(){jQuery("#acym__wysid__send__test__button").off("click").on("click",function(){return jQuery(this).attr("disabled","true"),jQuery(".acym__wysid__send__test__icon").hide(),jQuery(".acym__wysid__send__test__icon__loader").show(),-1!==jQuery('[name="ctrl"]').val().indexOf("campaigns")?(acym_editorWysidFormAction.saveTemplate(!0,!1),!0):(acym_editorWysidFormAction.setThumbnailPreSave().then(function(e){jQuery("#editor_thumbnail").attr("value",e),acym_editorWysidFormAction.saveTemplate(!0,!1)}).catch(function(e){acym_editorWysidFormAction.saveTemplate(!0,!1),console.error("Error generating template thumbnail: "+e)}),!0)})},sendTest:function(e){var t=ACYM_AJAX_URL;t+="&page=acymailing_mails",t+="&ctrl="+acym_helper.ctrlMails,t+="&task=sendTest",t+="&id="+e,t+="&controller="+jQuery('[name="ctrl"]').val(),t+="&test_note="+encodeURIComponent(jQuery("#acym__wysid__send__test__note").val()),ACYM_IS_ADMIN?t+="&test_emails="+encodeURIComponent(jQuery(".acym__multiselect__email").val().join(",")):t+="&test_emails="+encodeURIComponent(jQuery('input[name="emails_test"]').val()),t+="&lang_version="+acym_editorWysidMultilingual.currentLanguage,jQuery.post(t,function(e){(e=acym_helper.parseJson(e)).data.message=e.data.message.replace(/<.*?>/gm," "),acym_editorWysidNotifications.addEditorNotification(e.data,!e.error&&3e3,!e.error),jQuery(".acym__wysid__send__test__icon").show(),jQuery(".acym__wysid__send__test__icon__loader").hide(),jQuery("#acym__wysid__send__test__button").removeAttr("disabled"),"info"===e.data.level&&jQuery(".acym__wysid__send__test-close").click(),acym_helperEditorWysid.setColumnRefreshUiWYSID()})}},acym_editorWysidTinymce={addTinyMceWYSID:function(){tinymce.remove(),tinymce.baseURL=ACYM_MEDIA_URL+"js/tinymce",tinymce.init({convert_urls:!1,relative_urls:!1,selector:".acym__wysid__tinymce--text",inline:!0,menubar:!1,plugins:"textcolor colorpicker lists link code noneditable lineheight table",image_class_list:[{title:"Responsive",value:"img-responsive"}],fixed_toolbar_container:"#acym__wysid__text__tinymce__editor",fontsize_formats:"10px=10px 12px=12px 14px=14px 16px=16px 18px=18px 20px=20px 22px=22px 24px=24px 26px=26px 28px=28px 30px=30px 32px=32px 34px=34px 36px=36px",lineheight_formats:"100% 110% 120% 130% 140% 150% 160% 170% 180% 190% 200% 210% 220% 230% 240%",toolbar:["undo redo formatselect fontselect fontsizeselect","alignmentsplit | listsplit lineheightselect | table","bold italic underline strikethrough removeformat | forecolor backcolor | link unlink | code"],link_class_list:[{title:"None",value:""},{title:ACYM_JS_TXT.ACYM_DONT_APPLY_STYLE_TAG_A,value:"acym__wysid__content-no-settings-style"}],formats:{removeformat:[{selector:"b,strong,em,i,font,u,strike,pre,code",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]},preview_styles:!1,block_formats:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6",init_instance_callback:function(e){acym_editorWysidDynamic.setDynamicsActions(),e.on("keydown",function(t){var i=jQuery(e.getElement()).find(">:first-child");if(acym_editorWysidTinymce.isCurrentTextEmpty(i)&&8===t.which&&1===jQuery(e.getElement()).children().length)return t.preventDefault(),!0}),e.on("keyup",function(){var t=jQuery(e.getElement()).find(">:first-child");acym_editorWysidTinymce.isCurrentTextEmpty(t)?t.addClass("acym__wysid__tinymce--text--placeholder acym__wysid__tinymce--text--placeholder--empty"):t.removeClass("acym__wysid__tinymce--text--placeholder--empty"),acym_editorWysidTinymce.checkForEmptyText(),jQuery(e.getElement()).trigger("click")}),e.on("click",function(){acym_editorWysidToolbox.setDeleteAlltoolbox()}),e.off("change").on("change",function(t){void 0!==t.lineheight&&jQuery(e.getElement()).find(".acym__wysid__tinymce--text--placeholder, .acym__wysid__tinymce--title--placeholder").css("line-height",t.lineheight);acym_editorWysidFontStyle.setAllHtmlElementStyleWYSID()}),e.on("blur",function(e){e.target.startContent!==e.target.bodyElement.innerHTML&&acym_editorWysidVersioning.setUndoAndAutoSave(),acym_editorWysidRowSelector.setRowSelector(),acym_editorWysidTinymce.checkForEmptyText()}),e.on("ExecCommand",function(t){var i=jQuery(e.getElement()).find(">:first-child");"mceTableDelete"===t.command&&acym_editorWysidTinymce.isCurrentTextEmpty(i)&&(t.target.bodyElement.innerHTML='<p class="acym__wysid__tinymce--text--placeholder">&zwj;</p>',jQuery(":focus").blur())}),e.on("BeforeSetContent",function(t){if(0===t.content.indexOf('<table id="__mce"')){var i=jQuery(e.getElement()).find(">:first-child");acym_editorWysidTinymce.isCurrentTextEmpty(i)&&i.remove(),navigator.userAgent.indexOf("Firefox")>-1&&acym_editorWysidTinymce.cleanForFirefox(jQuery(e.getElement()),0)}}),e.addButton("listsplit",{type:"splitbutton",text:"",icon:"bullist",onclick:function(e){tinyMCE.execCommand(this.value)},menu:[{icon:"bullist",text:"Bullet list",onclick:function(){tinyMCE.execCommand("InsertUnorderedList"),this.parent().parent().icon("bullist"),this.parent().parent().value="InsertUnorderedList"}},{icon:"numlist",text:"Ordered List",onclick:function(){tinyMCE.execCommand("InsertOrderedList"),this.parent().parent().icon("numlist"),this.parent().parent().value="InsertOrderedList"}}],onPostRender:function(){this.value="InsertUnorderedList"}}),e.addButton("alignmentsplit",{type:"splitbutton",text:"",icon:"alignleft",onclick:function(e){tinyMCE.execCommand(this.value)},menu:[{icon:"alignleft",text:"Align Left",onclick:function(){tinyMCE.execCommand("JustifyLeft"),this.parent().parent().icon("alignleft"),this.parent().parent().value="JustifyLeft"}},{icon:"alignright",text:"Align Right",onclick:function(){tinyMCE.execCommand("JustifyRight"),this.parent().parent().icon("alignright"),this.parent().parent().value="JustifyRight"}},{icon:"aligncenter",text:"Align Center",onclick:function(){tinyMCE.execCommand("JustifyCenter"),this.parent().parent().icon("aligncenter"),this.parent().parent().value="JustifyCenter"}},{icon:"alignjustify",text:"Justify",onclick:function(){tinyMCE.execCommand("JustifyFull"),this.parent().parent().icon("alignjustify"),this.parent().parent().value="JustifyFull"}}],onPostRender:function(){this.value="JustifyLeft"}})}}),tinymce.execCommand("mceAddEditor",!0,""),tinymce.init({selector:".acym__wysid__tinymce--image",inline:!0,menubar:!1,plugins:"image nonbreaking",toolbar:[],relative_urls:!1,remove_script_host:!1,image_class_list:[{title:"Responsive",value:"img-responsive"}],preview_styles:!1,init_instance_callback:function(e){acym_editorWysidImage.setDoubleClickImage(),e.on("click",function(t){var i=jQuery(e.getElement()).find("img");acym_helperEditorWysid.timeClickImage=(new Date).getTime(),acym_editorWysidToolbox.setDeleteAlltoolbox(),acym_editorWysidContextModal.setImageContextModal(i)}),e.on("blur",function(){acym_editorWysidRowSelector.setRowSelector(),acym_helperEditorWysid.removeBlankCharacters()})},formats:{alignleft:{selector:"img",styles:{float:"left",marginTop:"-10px",marginBottom:"10px"}},alignright:{selector:"img",styles:{float:"right",marginTop:"-10px",marginBottom:"10px"}}},style_formats:[{title:"Align left",format:"alignleft"},{title:"Align right",format:"alignright"}],themes:"modern"}),tinymce.execCommand("mceAddEditor",!0,"")},isCurrentTextEmpty:function(e){return e.is(":empty")||"&nbsp;<br>"===e.html()||"<br>"===e.html()||"%u200D"==escape(e.html())||'<br data-mce-bogus="1">'==e.html()},checkForEmptyText:function(){jQuery(".acym__wysid__tinymce--text--placeholder, .acym__wysid__tinymce--title--placeholder").each(function(){var e=jQuery(this).closest(".acym__wysid__tinymce--text").find(".acym__wysid__tinymce--text--placeholder, .acym__wysid__tinymce--title--placeholder").length>1;acym_editorWysidTinymce.isCurrentTextEmpty(jQuery(this))&&!e?jQuery(this).addClass("acym__wysid__tinymce--text--placeholder acym__wysid__tinymce--text--placeholder--empty"):jQuery(this).removeClass("acym__wysid__tinymce--text--placeholder--empty")})},cleanForFirefox:function(e,t){var i=e.find(">p");0==i.length&&t<1e3?setTimeout(function(){acym_editorWysidTinymce.cleanForFirefox(e,t+50)},50):1==i.length&&acym_editorWysidTinymce.isCurrentTextEmpty(i)&&i.remove()}},acym_editorWysidToolbar={setRightToolbarWYSID:function(){jQuery(".acym__wysid__right__toolbar__tabs").off("click").on("click",function(){acym_editorWysidToolbar.setSlideRightToolbarWYSID(jQuery(this))}),jQuery(".acym__wysid__right__toolbar--menu .acym__wysid__right__toolbar__p").off("click").on("click",function(){jQuery(this).next().slideToggle(200),jQuery(this).hasClass("acym__wysid__right__toolbar__p__open")?(jQuery(this).removeClass("acym__wysid__right__toolbar__p__open"),jQuery(this).find("i").removeClass("acymicon-keyboard_arrow_up").addClass("acymicon-keyboard_arrow_down")):(jQuery(this).addClass("acym__wysid__right__toolbar__p__open"),jQuery(this).find("i").removeClass("acymicon-keyboard_arrow_down").addClass("acymicon-keyboard_arrow_up")),jQuery(this).toggleClass("acym__wysid__right__toolbar__last--text")})},setSlideRightToolbarWYSID:function(e){var t=jQuery("#"+jQuery(".acym__wysid__right__toolbar__selected").attr("data-attr-show")),i=jQuery("#"+e.attr("data-attr-show"));if(t.attr("id")!==i.attr("id")){var _=jQuery(".acym__wysid__right__toolbar__tabs");_.removeClass("acym__wysid__right__toolbar__selected");var a={hide:"",show:""};_.each(function(){return jQuery(this).attr("data-attr-show")===t.attr("id")?(a.hide="left",a.show="right",!1):jQuery(this).attr("data-attr-show")===i.attr("id")?(a.hide="right",a.show="left",!1):void 0}),e.addClass("acym__wysid__right__toolbar__selected"),t.hide("slide",{direction:a.hide},75,function(){i.show("slide",{direction:a.show},75,function(){acym_editorWysidToolbar.setRightToolbarWYSID()})})}}},acym_editorWysidToolbox={setRefreshAfterToolbox:function(){jQuery(".acym__wysid__row__toolbox__copy").unbind("click").click(function(){var e=jQuery(this).closest(".acym__wysid__row__element").clone();acym_helperBlockSeparator.changeIdOnduplicate(e).insertAfter(jQuery(this).closest(".acym__wysid__row__element")),e.find("tr[data-dynamic]").each(function(){jQuery(this).attr("id",acym_editorWysidDynamic.getUniqueId())}),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}),jQuery(".acym__wysid__row__toolbox__delete__row").off("click").on("click",function(){jQuery(this).closest(".acym__wysid__row__element").remove(),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}),jQuery(".acym__wysid__element__toolbox__copy").off("click").on("click",function(){var e=jQuery(this).closest(".acym__wysid__column__element"),t=e.clone();void 0!==t.attr("data-dynamic")&&t.attr("id",acym_editorWysidDynamic.getUniqueId()),t.insertAfter(e),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}),jQuery(".acym__wysid__element__toolbox__delete").off("click").on("click",function(){var e=jQuery(this).closest(".acym__wysid__column__element");acym_editorWysidContextModal.hideContextModal(jQuery(".acym__wysid__context__modal")),e.remove(),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()}),acym_editorWysidToolbox.resizeRows(),acym_editorWysidDragDrop.setRowElementSortableWYSID(),acym_editorWysidDragDrop.setColumnElementDraggableWYSID()},resizeRows:function(){jQuery(".acym__wysid__row__toolbox__height").off("mousedown").on("mousedown",function(){acym_helperEditorWysid.clicking=!0,acym_helperEditorWysid.$resizingElement=jQuery(this).closest("table").css({"border-collapse":"initial","border-spacing":""}),jQuery(document).on("mousemove",function(e){if(acym_helperEditorWysid.clicking){var t=acym_helperEditorWysid.$resizingElement.offset().top,i=e.pageY-(t-10);acym_helperEditorWysid.$resizingElement.find("th:first").height(i).attr("height",i),acym_helperEditorWysid.$resizingElement.find(".acym__wysid__row__selector").css("height",acym_helperEditorWysid.$resizingElement.css("height"))}}),jQuery(document).off("mouseup").on("mouseup",function(){acym_helperEditorWysid.clicking=!1,jQuery(this).off("mousdown"),acym_editorWysidRowSelector.setRowSelector()})})},setDeleteAlltoolbox:function(){jQuery(".acym__wysid__row__selector, .acym__wysid__element__toolbox").remove()}},acym_editorWysidVersioning={keepOldVersion:function(e){var t='<div id="acym__wysid__template" class="cell">'+e+"</div>";jQuery("#editor_autoSave").val(""),jQuery("#acym__wysid__top-toolbar__keep").off("click").on("click",function(){jQuery(".acym__wysid__hidden__save__content").val(t),jQuery("#acym__wysid #acym__wysid__template").replaceWith(t),acym_helperEditorWysid.setColumnRefreshUiWYSID(),jQuery("#acym__wysid__top-toolbar__notification__close").click()})},setUndoAndAutoSave:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!e&&jQuery(".acym__autosave__notification").length&&acym_editorWysidNotifications.hideNotification();var t=jQuery('[id^="template_version_"]');t.length>=10&&t[0].remove();for(var i=acym_helperEditorWysid.versionControl+1;jQuery("#template_version_"+i).length>0;)jQuery("#template_version_"+i).remove(),i++;acym_helperEditorWysid.versionControl++,jQuery('[name^="mce_"]').remove(),jQuery(".acym__wysid__column--drag-start").removeClass("acym__wysid__column--drag-start"),jQuery(".acym__editor__area").append('<input type="hidden" value="" id="template_version_'+acym_helperEditorWysid.versionControl+'">');var _=jQuery("#acym__wysid__template"),a=_.html();if(jQuery("#template_version_"+(acym_helperEditorWysid.versionControl-1)).val()===a)return!1;jQuery("#template_version_"+acym_helperEditorWysid.versionControl).val(a);var o=jQuery("#acym__campaign__recipients__form__campaign");if(0===o.length||o.length>0&&"0"!==o.val()){var r=_.clone();r.find(".acym__wysid__row__selector, .acym__wysid__element__toolbox").remove(),r.find(".acym__wysid__tinymce--text--placeholder--empty").removeClass("acym__wysid__tinymce--text--placeholder--empty"),r=r.wrap('<div id="acym__wysid__template-save" class="cell">').html();var s=jQuery("#editor_mailid").val();if(!acym_helper.empty(s)&&"-1"!==s&&!1===e){var n=ACYM_AJAX_URL+"&ctrl="+acym_helper.ctrlMails+"&task=autoSave";n+="&language="+acym_editorWysidMultilingual.currentLanguage,jQuery.ajax({type:"POST",url:n,data:{autoSave:r,mailId:s},success:function(e){},error:function(){console.log(ACYM_JS_TXT.ACYM_ERROR_SAVING)}})}}},checkForUnsavedVersion:function(){var e=jQuery("#editor_autoSave").val();null!=e&&""!=e&&(acym_editorWysidNotifications.addEditorNotification({message:'<div class="cell auto acym__autosave__notification">'+ACYM_JS_TXT.ACYM_AUTOSAVE_USE+"</div>",level:"info"},!1,!1,!0),acym_editorWysidVersioning.keepOldVersion(e))},setVersionControlCtrlZ:function(){jQuery(document).keydown(function(e){jQuery("#acym__wysid__editor__source").height()>0||void 0!==tinyMCE.focusedEditor&&null!==tinyMCE.focusedEditor||jQuery("#acym__wysid__context__button").is(":visible")||jQuery("#acym__wysid__context__follow").is(":visible")||jQuery("#acym__wysid__context__separator").is(":visible")||jQuery("#acym__wysid__context__share").is(":visible")||90!==e.which||!e.ctrlKey&&!e.metaKey||acym_helperEditorWysid.versionControl<=0||(e.shiftKey?e.shiftKey&&acym_editorWysidVersioning.makeVersionControlChangement(!1):acym_editorWysidVersioning.makeVersionControlChangement(!0))}),jQuery("#acym__wysid__top-toolbar__undo").off("click").on("click",function(){acym_editorWysidVersioning.makeVersionControlChangement(!0)}),jQuery("#acym__wysid__top-toolbar__redo").off("click").on("click",function(){acym_editorWysidVersioning.makeVersionControlChangement(!1)})},makeVersionControlChangement:function(e){var t=jQuery("#template_version_"+(acym_helperEditorWysid.versionControl+1)),i=jQuery("#template_version_"+(acym_helperEditorWysid.versionControl-1));if(e){if(i.length>0&&0===i.val().length)return;acym_helperEditorWysid.versionControl--,jQuery("#acym__wysid__template").html(jQuery("#template_version_"+acym_helperEditorWysid.versionControl).val()),0===acym_helperEditorWysid.versionControl&&acym_editorWysidVersioning.setUndoAndAutoSave()}else{if(t.length>0&&0===t.val().length)return;acym_helperEditorWysid.versionControl++,jQuery("#acym__wysid__template").html(jQuery("#template_version_"+acym_helperEditorWysid.versionControl).val())}acym_helperEditorWysid.setColumnRefreshUiWYSID()}},acym_editorWysidWordpress={addMediaWPWYSID:function(e,t){var i,_=jQuery(e).html();t=void 0!==t&&t,(i=wp.media.frames.file_frame=wp.media({title:ACYM_JS_TXT.ACYM_SELECT_IMAGE_TO_UPLOAD,button:{text:ACYM_JS_TXT.ACYM_USE_THIS_IMAGE},multiple:!1})).on("select",function(){var _=i.state().get("selection").first().toJSON(),a=!0;if(_.url.indexOf("..")>=0&&(a=confirm(ACYM_JS_TXT.ACYM_INSERT_IMG_BAD_NAME)),a)if(t){var o=jQuery(e).css("padding-top");jQuery(e).hasClass("acym__wysid__template__content")?(jQuery(e).attr("style","background-image: url('"+_.url+"'); background-size: cover; background-position: center top; background-repeat: no-repeat; padding: "+o+" 0 40px 0"),"none"!==jQuery(e).css("background-image")&&jQuery("#acym__wysid__background-image__template-delete").css("display","flex")):(jQuery(e).css("background-color","").attr("bgcolor",""),jQuery(e).attr("style","background-image: url('"+_.url+"'); background-size: cover; background-position: center; background-repeat: no-repeat; padding: "+o+" 0").attr("width",jQuery(e).width())),acym_editorWysidNotifications.addEditorNotification({message:ACYM_JS_TXT.ACYM_BECARFUL_BACKGROUND_IMG,level:"warning"})}else{var r=jQuery(e).find(".acym__wysid__link__image"),s='<tr class="acym__wysid__column__element" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;">';s+='<td class="large-12 acym__wysid__column__element__td">',s+='<div class="acym__wysid__tinymce--image">',s+='<div style="text-align: center" data-mce-style="text-align: center">',r.length>0&&(s+='<a href="'+r.attr("href")+'" class="acym__wysid__link__image" target="_blank">'),s+='<img hspace="0" class="acym__wysid__media__inserted acym__wysid__media__inserted--focus acym__wysid__media__inserted--selected" src="'+_.url+'" title="'+acym_helper.escape(_.title)+'" alt="'+acym_helper.escape(_.alt)+'" style="max-width: 100%; height: auto;  box-sizing: border-box; padding: 0 5px;display:inline-block; margin-left: auto; margin-right: auto;"/>',void 0!==_.caption&&_.caption.length>0&&(s+='<div class="acym__wysid__media_caption" style="width: 100%; height: auto; box-sizing: border-box; padding: 0 5px; display:block;">'+acym_helper.escape(_.caption)+"</div>"),r.length>0&&(s+="</a>"),s+="</div>",s+="</div>",s+="</td>",s+="</tr>",jQuery(e).replaceWith(s),jQuery(".acym__wysid__media__inserted--focus").on("load",function(){jQuery(this).removeClass("acym__wysid__media__inserted--focus"),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave()})}else t||(jQuery(e).replaceWith(""),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave())}),i.on("escape",function(){t||(-1!==_.indexOf("insert_photo")&&jQuery(e).replaceWith(""),acym_helperEditorWysid.setColumnRefreshUiWYSID(),acym_editorWysidVersioning.setUndoAndAutoSave())}),i.open()}};