You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
317 KiB
JavaScript
1 line
317 KiB
JavaScript
!function(e){var t={};function i(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(o,n,function(t){return e[t]}.bind(null,n));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=151)}({0:function(e,t){e.exports=jQuery},151:function(e,t,i){"use strict";(function(e,t){var o,n=(o=i(23))&&o.__esModule?o:{default:o};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s=s||{};window.ET_PageBuilder=s,window.wp=window.wp||{},window.et_builder_version="4.23.4",window.et_builder_product_name="Divi";var l=window.et_error_modal_shown,d=!1,r=!1,c=0,p=0,b=0,u="et_pb_templates_",g={},h={},f=[],m={s:!1,r:!1,c:!1};function v(e,t){if(_.isUndefined(t))return e;return e.replace(/<!-- (\d+) -->/g,(function(e,i){return t[i]}))}function w(){return new Promise((function(t,i){e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_builder_library_get_layouts_data",postId:et_pb_options.postId,nonce:et_pb_options.library_get_layouts_data_nonce}}).then((function(e){t(S(e,"data",""))}))}))}var y=w();function k(){var e,t,i=et_pb_options.product_version;e="et_forced_localstorage_clear",(t=localStorage.getItem(e))||(t=wpCookies.get(e)),t!==i&&(localStorage.clear(),wpCookies.set(e,i),localStorage.setItem(e,i),setTimeout((function(){window.location.reload()}),100))}function C(t){var i,o=0,n=new Date,a="".concat(n.getYear(),"_").concat(n.getMonth(),"_").concat(n.getDate()),s="".concat(et_pb_options.et_builder_module_parent_shortcodes,"|").concat(et_pb_options.et_builder_module_child_shortcodes).split("|"),c=et_pb_options.product_version,g=et_pb_options.active_plugins.join("|"),h="",f=0,m={missing_modules_array:[]};if((t=!_.isUndefined(t)&&t)||(e('script[src="'.concat(et_pb_options.builder_js_src,'"]')).length||e(".et-pb-cache-update").show(),e("body").on("click",".et_builder_increase_memory",(function(){var t=e(this);return e.ajax({type:"POST",dataType:"json",url:et_pb_options.ajaxurl,data:{action:"et_pb_increase_memory_limit",et_admin_load_nonce:et_pb_options.et_admin_load_nonce},success:function(e){_.isUndefined(e.success)?t.addClass("et_builder_modal_action_button_fail").prop("disabled",!0).text(et_pb_options.memory_limit_not_increased):t.addClass("et_builder_modal_action_button_success").text(et_pb_options.memory_limit_increased)}}),!1})),e("body").on("click",".et_pb_reload_builder",(function(){return location.reload(),!1}))),function(){if(!$())return!1;if(!_.isUndefined(et_pb_options.force_cache_purge)&&"true"===et_pb_options.force_cache_purge)return!1;var e=localStorage.getItem("".concat(u,"settings_date")),t=localStorage.getItem("".concat(u,"settings_product_version")),i=localStorage.getItem("".concat(u,"settings_active_plugins"));if(_.isUndefined(e)||_.isNull(e))return!1;if(_.isUndefined(t)||_.isNull(t))return!1;if(i!==g)return!1;if(a!=e||c!=t)return function(){if(!$())return!1;_.forEach(_.keys(localStorage),(function(e){j(e,"et_pb_templates_")&&localStorage.removeItem(e)}))}(),!1;return!0}()){if(r)return;for(var w in s){var y=s[w],S=u+y,x=LZString.decompressFromUTF16(localStorage.getItem(S));f++,_.isUndefined(x)||_.isNull(x)||""===x?m.missing_modules_array.push(y):h+=LZString.decompressFromUTF16(localStorage.getItem(S)),!d&&(m.missing_modules_array.length===parseInt(et_pb_options.et_builder_templates_amount)||m.missing_modules_array.length&&s.length===f)&&(d=!0,e.ajax({type:"POST",dataType:"json",url:et_pb_options.ajaxurl,data:{action:"et_pb_get_backbone_template",et_post_type:et_pb_options.post_type,et_modules_slugs:JSON.stringify(m),et_admin_load_nonce:et_pb_options.et_admin_load_nonce},success:function(t){var i;d=!1,!_.isUndefined(t.templates)&&t.templates.length&&_.each(t.templates,(function(o){i=v(o.template,t.unique);try{localStorage.setItem(u+o.slug,LZString.compressToUTF16(i))}catch(e){k()}e("body").append(i)}))}}),m.missing_modules_array=[])}e("body").append(h)}else i=setInterval((function(){if(o===Math.ceil(et_pb_options.et_builder_modules_count/et_pb_options.et_builder_templates_amount))return clearInterval(i),!1;var t;r=!0,p++,t=o*et_pb_options.et_builder_templates_amount,e.ajax({type:"POST",dataType:"json",url:et_pb_options.ajaxurl,data:{action:"et_pb_get_backbone_templates",et_post_type:et_pb_options.post_type,et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_templates_start_from:t},error:function(){var t=e("#et-builder-failure-notice-template");l||t.length&&(e(".et_pb_failure_notification_modal").length||($()&&(localStorage.removeItem("".concat(u,"settings_date")),localStorage.removeItem("".concat(u,"settings_product_version")),localStorage.removeItem("".concat(u,"settings_active_plugins"))),e("body").addClass("et_pb_stop_scroll").append(t.html())))},success:function(t){var i;for(var o in t.templates){if(i=v(t.templates[o],t.unique),$())try{localStorage.setItem("et_pb_templates_".concat(o),LZString.compressToUTF16(i))}catch(e){k()}e("body").append(i)}b++,p>0&&p===b&&(r=!1,C())}}),o++}),800),function(){if(!$())return!1;try{localStorage.setItem("".concat(u,"settings_date"),a),localStorage.setItem("".concat(u,"settings_product_version"),c),localStorage.setItem("".concat(u,"settings_active_plugins"),g)}catch(e){}}();function $(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}}function S(e,t,i){if(!_.isObject(e))return i;var o=_.reduce(t.split("."),(function(e,t){return e?e[t]:void 0}),e);return _.isUndefined(o)?i:o}function x(e,t){if(!t)return!0;var i=t.split("."),o=_.first(i);return _.has(e,o)&&x(e[o],_.rest(i).join("."))}function j(e,t){return e.substr(0,t.length)===t}C(),s.isDynamicContent=function(e){if("string"!=typeof e)return!1;var t=new RegExp(/^<p>(.*)<\/p>$/,"i"),i=/^\s+|\s+$/,o=e.replace(i,"");o=(o=o.replace(t,"$1")).replace(i,"");try{if(/^@ET-DC@(.*?)@$/.test(o))return!0;var n=JSON.parse(o);if(void 0!==n.dynamic&&!0===n.dynamic)return!0}catch(e){}return!1},document.addEventListener("DOMContentLoaded",(function(){function i(){e("#et-builder-right-click-controls").remove(),e("#et_pb_layout_right_click_overlay").remove()}function o(t){t.on("click",(function(t){var i=e(this);t.preventDefault(),(u=wp.media.frames.et_pb_file_frame=new wp.media.view.MediaFrame.ETSelect({title:i.data("choose"),library:{type:i.data("type")},button:{text:i.data("update")},multiple:!1})).on("select",(function(){var e=u.state().props.get("url"),t=i.siblings(".et-pb-upload-field");t.val(e),t.trigger("change"),p(i)})),u.on("insert",(function(){var e=u.state().get("selection").models[0];if(!_.isUndefined(e)){var t=i.siblings(".et-pb-upload-field");t.val(e.get("url")),t.trigger("change"),p(i)}})),u.open()})),t.siblings(".et-pb-upload-field").on("input",(function(){p(e(this).siblings(".et-pb-upload-button"))})),t.siblings(".et-pb-upload-field").each((function(){p(e(this).siblings(".et-pb-upload-button"))}))}function l(t){t.on("click",(function(i){e(this);var o=t.next(".et-pb-gallery"),n=t.closest(".et-pb-options-tab").find("#et_pb_gallery_orderby");if(i.preventDefault(),"undefined"!=typeof wp&&wp.media&&wp.media.gallery){var a=o.val().length?' ids="'.concat(o.val(),'"'):"",s=n.val().length?' orderby="'.concat(n.val(),'"'):"",l="[gallery".concat(a).concat(s,"]");u=wp.media.frames.et_pb_file_frame=wp.media.gallery.edit(l),a||u.setState("gallery-library"),_(u.$el),u.on("content:render:browse",(function(e){_(e.$el)})),u.state("gallery-edit").on("update",(function(e){var t=wp.media.gallery.shortcode(e).attrs.named;t.ids&&o.val(t.ids),t.orderby?n.val(t.orderby):n.val("")}))}function _(t){setTimeout((function(){t.find(".gallery-settings").find("label.setting").each((function(){e(this).find(".link-to, .columns, .size").length?e(this).remove():e(this).has("input[type=checkbox]").length&&e(this).children("input[type=checkbox]").css("margin","11px 5px")}))}),10)}}))}function d(e){return e.siblings("input").attr("id").replace("et_pb_","").replace("_list","")}function r(t){t.on("click",(function(t){var i=e(this),o=e("#et_pb_src.et-pb-upload-field").val().trim();t.preventDefault(),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_video_get_oembed_thumbnail",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_video_url:o},success:function(t){t.length?e("#et_pb_image_src").val(t).trigger("input"):(i.after('<div class="et-pb-error">'.concat(et_pb_options.video_module_image_error,"</div>")),i.siblings(".et-pb-error").delay(5e3).fadeOut(800))}})}))}function p(t){if(!(t.length<1)){var i=t.siblings(".et-pb-upload-field"),o=i.siblings(".et-pb-upload-preview"),n=i.closest(".et-pb-option").find(".et-pb-option-preview"),a=n.length,s=i.val().trim(),l=t.data("type"),d=t.closest(".et_pb_module_settings").attr("data-module_type"),r=t.closest(".et-pb-options-tabs").find("#et_pb_featured_image").val(),c=t.closest(".et-pb-options-tabs").find("#et_pb_featured_placement").val(),p=e("#postimagediv img").attr("src"),b=_.contains(et_pb_options.et_builder_modules_featured_image_background,d)&&"on"===r&&"background"===c,u=i.closest(".et-pb-option-container-inner").attr("data-base_name"),g="background"===u?"":"".concat(u,"_");if(b?(s=p,n.addClass("et-pb-featured-image-background")):n.removeClass("et-pb-featured-image-background"),"image"===l||"video"===l&&a){if(""===s)return a?void n.addClass("et-pb-option-preview--empty").find(".et-pb-preview-content").remove():void(o.length&&o.remove());if(a){n.find(".et-pb-preview-content").remove();var h=t.closest(".et-pb-option-container--background"),f=h.find("input, select"),m=h.attr("data-column-index"),v=["url(".concat(s,")")],w=ke(h.find(".et_pb_background-tab--gradient"),u),y={},k="",C=!1,S=!1;if(w&&(C=!0,v.push(w)),f.each((function(){if(void 0!==e(this).attr("id")){var t=e(this).attr("id").replace("et_pb_",""),i=e(this).val(),o=void 0!==e(this).attr("data-default")?e(this).attr("data-default"):"",n=""!==i&&void 0!==i;void 0!==m&&(t=t.replace("_".concat(m),"")),y[t]=n?i:o}})),"image"===l){var x={position:"absolute",top:"0px",right:"0px",bottom:"0px",left:"0px"};"on"===y["".concat(g,"parallax")]?(x.backgroundImage="url(".concat(s,")"),x.backgroundRepeat="no-repeat",x.backgroundSize="cover",x.backgroundPosition="center"):(void 0===y["".concat(u,"_position")]&&(y["".concat(u,"_position")]=""),"on"===y["".concat(u,"_color_gradient_overlays_image")]&&v.reverse(),S=!0,x.backgroundImage=v.join(", "),x.backgroundSize=y["".concat(u,"_size")],x.backgroundPosition=y["".concat(u,"_position")].replace("_"," "),x.backgroundRepeat=y["".concat(u,"_repeat")],x.backgroundBlendMode=y["".concat(u,"_blend")],x.backgroundColor=C&&S?"initial":y["".concat(u,"_color")]),k=e("<div />",{class:"et-pb-preview-content"}).css(x)}else"video"===l&&(k=e("<video />",{class:"et-pb-preview-content",src:s,loop:!0,controls:!0,height:190}));n.removeClass("et-pb-option-preview--empty").prepend(k)}else o.length||(t.siblings(".description").before("".concat('<div class="et-pb-upload-preview"><strong class="et-pb-upload-preview-title">').concat(et_pb_options.preview_image,"</strong>")+'<img src="" width="408" /></div>'),o=i.siblings(".et-pb-upload-preview"));o.find("img").attr("src",s)}}}function b(e){var t=e.closest(".et-pb-option-container"),i=parseInt(t.find(".iris-square-value.ui-draggable").width()),o=parseInt(t.find(".iris-square-value.ui-draggable").css("left"))+i/2,n=parseInt(t.width());""!==e&&o>n-50?t.addClass("on-right-corner"):t.removeClass("on-right-corner")}_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},s.Helpers={},s.Helpers.getSettingValue=function(t){var i,o,n=[],a=t.is("#et_pb_content_main")?"et_pb_content":t.attr("id");if(t.is(":checkbox"))a=t.attr("name"),t.closest(".et-pb-option-container").find('[name="'.concat(a,'"]:checked')).each((function(){n.push(e(this).val())})),i=n.join(",");else if(t.is("#et_pb_content_main"))i=(i=t.html()).replace(/\^\^/g,"%22");else if(t.closest(".et-pb-custom-css-option").length)i=""!==(o=t.val())?o.replace(/(?:\r\n|\r|\n)/g,"||").replace(/\\/g,"%92"):"";else if(t.hasClass("et-pb-range-input"))i=fe(t),t.hasClass("et-pb-validate-unit")&&(i=Se(i.toString(),!1,"no_default_unit"));else if(t.hasClass("et-pb-range")){var s=t.siblings(".et-pb-range-input");i=fe(s),s.hasClass("et-pb-validate-unit")&&(i=Se(i.toString(),!1,"no_default_unit"))}else t.hasClass("et-pb-validate-unit")?i=Se(t.val(),!1,""):t.hasClass("et-pb-text-align-select")?t.closest(".et-pb-option-container").find(".et_text_align_active").length&&(i=t.val()):t.is(":checkbox")||(i=t.is("textarea.wp-editor-area")?ee(a):t.val(),t.hasClass("et-pb-range-input")&&"px"===i&&(i=""));return _.isNull(i)&&(i=""),i},s.Helpers.hasValue=function(e){return!_.isUndefined(e)&&""!==e},s.Helpers.isOn=function(e){return!_.isUndefined(e)&&"on"===e},s.Helpers.moduleHasBackground=function(e,t){var i=this,o=_.isUndefined(t)?["color","gradient","image","video"]:t,n=!1;return _.forEach(o,(function(t){var o=!1;switch(t){case"color":o=i.hasValue(e.et_pb_background_color);break;case"gradient":o=i.isOn(e.et_pb_use_background_color_gradient);break;case"image":o=i.hasValue(e.et_pb_background_image);break;case"video":var a=i.hasValue(e.et_pb_background_video_mp4),s=i.hasValue(e.et_pb_background_video_webm);o=a||s}o&&(n=!0)})),n},s.Module=Backbone.Model.extend({defaults:{type:"element",_builder_version:et_pb_options.product_version}}),s.SavedTemplate=Backbone.Model.extend({defaults:{title:"template",ID:0,shortcode:"",is_global:"false",layout_type:"",module_type:"",categories:[],unsynced_options:[]}}),s.History=Backbone.Model.extend({defaults:{timestamp:_.now(),shortcode:"",current_active_history:!1,verb:"did",noun:"something"},max_history_limit:100,validate:function(e,t){t.collection.length;var i=t.collection.findWhere({current_active_history:!0}),o=e.shortcode,n=_.isUndefined(i)?t.collection.at(t.collection.length-1):i;if(o===(!_.isUndefined(n)&&n.get("shortcode")))return"duplicate";V.enable_history=!1;var a=t.collection.models.length-(this.max_history_limit-1);if(a>0)for(var s=1;s<=a;s++)t.collection.shift()}}),s.Layout=Backbone.Model.extend({defaults:{moduleNumber:0,forceRemove:!1,modules:JSON.parse(et_pb_options.et_builder_modules),views:[]},initialize:function(){_.each(this.get("modules"),(function(e){e.title=e.title.replace(/%%/g,'"'),e.title=e.title.replace(/\|\|/g,"'")}))},addView:function(e,t){var i=this.get("views");i[e]=t,this.set({views:i})},getView:function(e){return this.get("views")[e]},getChildViews:function(e){var t=this.get("views"),i={};return _.each(t,(function(t,o){void 0!==t&&t.model.attributes.parent===e&&(i[o]=t)})),i},getChildrenViews:function(e){var t,i=this,o=i.get("views"),n={};return _.each(o,(function(o,a){void 0!==o&&o.model.attributes.parent===e&&(t=i.getChildrenViews(o.model.attributes.cid),_.isEmpty(t)||_.extend(n,t),n[a]=o)})),n},getParentViews:function(e){for(var t=this.getView(e),i={};!_.isUndefined(t);)i[t.model.attributes.cid]=t,t=this.getView(t.model.attributes.parent);return i},getSectionView:function(e){var t,i=this.getParentViews(e);return t=_.filter(i,(function(e){return"section"===e.model.attributes.type})),!_.isUndefined(t[0])&&t[0]},setNewParentID:function(e,t){var i=this.get("views");i[e].model.attributes.parent=t,this.set({views:i})},removeView:function(e){var t=this.get("views"),i={};_.each(t,(function(t,o){o!=e&&(i[o]=t)})),this.set({views:i})},generateNewId:function(){var e=this.get("moduleNumber")+1;return this.set({moduleNumber:e}),e},generateTemplateName:function(t){return-1!==e.inArray(t,["row","row_inner","section","column","column_inner"])&&(t="et_pb_".concat(t)),"#et-builder-".concat(t,"-module-template")},getModuleOptionsNames:function(e){var t=this.get("modules");return this.addAdminLabel(_.findWhere(t,{label:e}).options)},getNumberOf:function(e,t){var i=this.get("views"),o=0;return _.each(i,(function(i){if(void 0!==i){var n=i.model.attributes.type;i.model.attributes.parent!==t||n!==e&&n!=="".concat(e,"_inner")||o++}})),o},getNumberOfModules:function(e){var t=this.get("views"),i=0;return _.each(t,(function(t){void 0!==t&&t.model.attributes.type===e&&i++})),i},getTitleByShortcodeTag:function(e){var t=this.get("modules"),i=_.findWhere(t,{label:e});return _.isUndefined(i)?e:i.title},getDefaultAdminLabel:function(t){return e.inArray(t,["section","row","column","row_inner","column_inner"])>-1?void 0!==et_pb_options.noun[t]?et_pb_options.noun[t]:t:this.getTitleByShortcodeTag(t)},isModuleFullwidth:function(e){var t=this.get("modules");return"on"===_.findWhere(t,{label:e}).fullwidth_only},isChildrenLocked:function(e){var t=this.getChildrenViews(e),i=!1;return _.each(t,(function(e){"on"!==e.model.get("et_pb_locked")&&"on"!==e.model.get("et_pb_parent_locked")||(i=!0)})),i},addAdminLabel:function(e){return _.union(e,["admin_label"])},removeGlobalAttributes:function(e,t){var i=this,o=(t=!_.isUndefined(t)&&t,_.isUndefined(e.model.attributes.global_parent_cid)?e.model.attributes.cid:e.model.attributes.global_parent_cid),n=this.getView(o),a=this.getChildrenViews(o);this.is_global(n.model)&&(t&&n.model.set("et_pb_temp_global_module",n.model.get("et_pb_global_module")),n.model.unset("et_pb_global_module")),_.each(a,(function(e){i.is_global_children(e.model)&&(t&&e.model.set("et_pb_temp_global_parent",e.model.get("et_pb_global_parent")),e.model.unset("et_pb_global_parent")),i.has_global_parent_cid(e.model)&&(t&&e.model.set("et_pb_temp_global_parent_cid",e.model.get("global_parent_cid")),e.model.unset("global_parent_cid"))}))},removeTemporaryGlobalAttributes:function(e,t){var i=this,o=(t=!_.isUndefined(t)&&t,(_.isUndefined(e.model.attributes.et_pb_temp_global_module)?$.findWhere({et_pb_temp_global_module:e.model.attributes.et_pb_temp_global_parent}):e.model).attributes.cid),n=k.getView(o),a=k.getChildrenViews(o);this.is_temp_global(n.model)&&(t&&n.model.set("et_pb_global_module",n.model.get("et_pb_temp_global_module")),n.model.unset("et_pb_temp_global_module")),_.each(a,(function(e){i.is_temp_global_children(e.model)&&(t&&e.model.set("et_pb_global_parent",e.model.get("et_pb_temp_global_parent")),e.model.unset("et_pb_temp_global_parent")),i.has_temp_global_parent_cid(e.model)&&(t&&e.model.set("global_parent_cid",e.model.get("et_pb_temp_global_parent_cid")),e.model.unset("et_pb_temp_global_parent_cid"))})),t&&Ie(o)},is_app:function(e){return"app"===e.attributes.type},is_global:function(e){return!this.is_app(e)&&!(!e.has("et_pb_global_module")||""===e.get("et_pb_global_module"))},is_global_children:function(e){return!this.is_app(e)&&!(!e.has("et_pb_global_parent")||""===e.get("et_pb_global_parent"))},has_global_parent_cid:function(e){return!(!e.has("global_parent_cid")||""===e.get("global_parent_cid"))},is_temp_global:function(e){return!(!e.has("et_pb_temp_global_module")||""===e.get("et_pb_temp_global_module"))},is_temp_global_children:function(e){return!(!e.has("et_pb_temp_global_parent")||""===e.get("et_pb_temp_global_parent"))},has_temp_global_parent_cid:function(e){return!(!e.has("et_pb_temp_global_parent_cid")||""===e.get("et_pb_temp_global_parent_cid"))},changeColumnStructure:function(t,i,o,n){var a=i.layout.split(","),s=i.specialty_columns,l=i.layout_specialty,d=_.size(a),r=t.options.view,c=Pe(t);if(i.is_structure_change){var p=k.getChildViews(t.model.get("cid")),b=[],u=0;_.each(p,(function(e){b[u]=e.model.get("cid"),u+=1}))}if(_.each(a,(function(e,i){var o=d==i+1?"true":"false",n={type:"column",cid:k.generateNewId(),parent:t.model.get("cid"),layout:e,view:r};void 0!==t.model.get("et_pb_global_parent")&&""!==t.model.get("et_pb_global_parent")&&(n.et_pb_global_parent=t.model.get("et_pb_global_parent"),n.global_parent_cid=t.model.get("global_parent_cid")),void 0!==l[i]&&"1"===l[i]&&(n.layout_specialty=l[i],n.specialty_columns=parseInt(s)),void 0!==t.model.get("specialty_row")&&(t.model.set("module_type","row_inner",{silent:!0}),t.model.set("type","row_inner",{silent:!0})),t.collection.add([n],{update_shortcodes:o})})),i.is_structure_change){var g=[];p=k.getChildViews(t.model.get("cid")),u=0,_.each(p,(function(e){g[u]=e.model.get("cid"),u+=1})),g.splice(0,b.length);for(var h=0;h<b.length;h++){var f,m=!!(b.length>g.length&&h>g.length-1),w=b[h],y=m?g[g.length-1]:g[h],C=k.getView(w).$el.html(),S=k.getChildViews(w),x="";k.getView(w).model.destroy(),k.getView(w).remove(),k.removeView(w),f=e('.et-pb-column[data-cid="'.concat(y,'"]')),m?(f.find(".et-pb-insert-module").remove(),x=f.html(),f.html(x+C)):f.html(C),_.each(S,(function(e){e.model.set("parent",y,{silent:!0})}))}V.allowHistorySaving("edited","column")}(void 0!==t.model.get("template_type")&&"section"===t.model.get("template_type")&&"on"===t.model.get("et_pb_specialty")||!o)&&Ue(),void 0!==t.model.get("et_pb_template_type")&&"row"===t.model.get("et_pb_template_type")&&De("_et_pb_row_layout",i.layout),void 0!==c&&""!==c&&Ie(c),n||V.allowHistorySaving("added","column"),v.trigger("et-add:columns")}}),s.Modules=Backbone.Collection.extend({model:s.Module}),s.SavedTemplates=Backbone.Collection.extend({model:s.SavedTemplate}),s.Histories=Backbone.Collection.extend({model:s.History}),s.TemplatesView=window.wp.Backbone.View.extend({className:"et_pb_saved_layouts_list",tagName:"ul",render:function(){var t="",i=void 0===this.options.category?"all":this.options.category;return this.collection.each((function(o){if("all"===i||-1!==e.inArray(i,o.get("categories"))){var n=new s.SingleTemplateView({model:o});this.$el.append(n.el),t=void 0!==n.model.get("is_global")&&"global"===n.model.get("is_global")?"global":""}}),this),"global"===t&&this.$el.addClass("et_pb_global"),this}}),s.SingleTemplateView=window.wp.Backbone.View.extend({tagName:"li",template:_.template(e("#et-builder-saved-entry").html()),events:{click:"insertSection"},initialize:function(){this.render()},render:function(){this.$el.html(this.template(this.model.toJSON())),void 0!==this.model.get("module_type")&&""!==this.model.get("module_type")&&"module"===this.model.get("layout_type")&&this.$el.addClass(this.model.get("module_type"))},insertSection:function(t){var i=e(t.target),o=void 0!==i.closest(".et_pb_modal_settings").data("parent_cid")?i.closest(".et_pb_modal_settings").data("parent_cid"):"",n=void 0!==e(".et-pb-settings-heading").data("current_row")?e(".et-pb-settings-heading").data("current_row"):"",a="global"===this.model.get("is_global")?this.model.get("ID"):"",s=void 0!==e(".et-pb-saved-modules-switcher").data("specialty_columns")?"on":"off",l=this.model.get("shortcode"),_=this.model.get("unsynced_options"),d=!1,r="row"===this.model.get("layout_type")?n:o,c=k.getView(r),p="row_inner"===this.options.model.get("layout_type")?"saved_row":"saved_".concat(this.options.model.get("layout_type")),b=i.closest(".et_pb_modal_settings_container"),u=Pe(c);"on"===s&&(r=c.model.get("parent"),c=k.getView(r)),"section"!==this.model.get("layout_type")&&""!==u&&(d=!0,a=""),V.allowHistorySaving("added",p),t.preventDefault(),l=V.codeModuleContentPrep(l),void 0!==window.switchEditors&&(l=qe(window.switchEditors.wpautop(l))),l=V.codeModuleContentUnPrep(l),V.createLayoutFromContent(l,o,"",{ignore_template_tag:"ignore_template",current_row_cid:n,global_id:a,after_section:o,is_reinit:"reinit",unsynced_options:_}),Ue(),!0===d&&Ie(u),b.length&&b.find(".et-pb-modal-close").trigger("click")}}),s.TemplatesModal=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-load_layout-template").html()),events:{"click .et-pb-options-tabs-links li a":"switchTab"},render:function(){return this.$el.html(this.template({display_switcher:"off"})),this.$el.addClass("et_pb_modal_no_tabs"),this},switchTab:function(t){var i=e(t.currentTarget).parent();t.preventDefault(),Ee(i,"section","")}}),s.SectionView=window.wp.Backbone.View.extend({className:"et_pb_section",template:_.template(e("#et-builder-section-template").html()),events:{"click .et-pb-settings-section":"showSettings","click .et-pb-clone-section":"cloneSection","click .et-pb-remove-section":"removeSection","click .et-pb-section-add-main":"addSection","click .et-pb-section-add-fullwidth":"addFullwidthSection","click .et-pb-section-add-specialty":"addSpecialtySection","click .et-pb-section-add-saved":"addSavedSection","click .et-pb-expand":"expandSection","click .et-pb-insert-row":"addFirstRow","contextmenu .et-pb-section-add":"showRightClickOptions","click.et_pb_section > .et-pb-controls .et-pb-unlock":"unlockSection","contextmenu.et_pb_section > .et-pb-controls":"showRightClickOptions","contextmenu.et_pb_row > .et-pb-right-click-trigger-overlay":"showRightClickOptions","click.et_pb_section > .et-pb-controls":"hideRightClickOptions","click.et_pb_row > .et-pb-right-click-trigger-overlay":"hideRightClickOptions","click > .et-pb-locked-overlay":"showRightClickOptions","contextmenu > .et-pb-locked-overlay":"showRightClickOptions",click:"setABTesting"},initialize:function(){this.child_views=[],this.listenTo(this.model,"change:admin_label",this.renameModule),this.listenTo(this.model,"change:et_pb_disabled",this.toggleDisabledClass)},render:function(){return this.$el.html(this.template(this.model.toJSON())),"on"===this.model.get("et_pb_specialty")&&(this.$el.addClass("et_pb_section_specialty"),"true"===this.model.get("et_pb_specialty_placeholder")&&this.$el.addClass("et_pb_section_placeholder")),"on"!==this.model.get("et_pb_specialty")&&"on"!==this.model.get("et_pb_fullwidth")||this.$el.find(".et-pb-insert-row").remove(),(void 0!==this.model.get("et_pb_global_module")||void 0!==this.model.get("et_pb_template_type")&&"section"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&this.$el.addClass("et_pb_global"),void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")&&this.$el.addClass("et_pb_disabled"),void 0!==this.model.get("et_pb_locked")&&"on"===this.model.get("et_pb_locked")&&this.$el.addClass("et_pb_locked"),void 0!==this.model.get("et_pb_collapsed")&&"on"===this.model.get("et_pb_collapsed")&&this.$el.addClass("et_pb_collapsed"),void 0!==this.model.get("pasted_module")&&this.model.get("pasted_module")&&Y(this.$el),_.isUndefined(this.model.get("et_pb_temp_global_module"))||this.$el.addClass("et_pb_global_temp"),J.is_active()&&(J.is_subject(this.model)&&(this.$el.addClass("et_pb_ab_subject"),J.set_subject_rank_coloring(this)),J.is_goal(this.model)&&this.$el.addClass("et_pb_ab_goal"),J.is_user_has_permission(this.model.get("cid"),"section")||this.$el.addClass("et_pb_ab_no_permission")),this.makeRowsSortable(),this},showSettings:function(t){var i,o,n=this,a=void 0!==t?e(t.currentTarget):"",l={model:this.model,collection:this.collection,attributes:{"data-open_view":"module_settings"},triggered_by_right_click:this.triggered_by_right_click,do_preview:this.do_preview};if(void 0!==t&&t.preventDefault(),!this.isSectionLocked()&&!V.isLoading&&!J.is_selecting())if(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"section")){if(""!==a&&a.closest(".et_pb_section_specialty").length){var _=a.closest(".et_pb_section_specialty").find(".et-pb-section-content > .et-pb-column"),d="";_.length&&_.each((function(){d+=""===d?"1_1":",1_1"})),l.model.attributes.columns_layout=d}if(!1===(o=(i=new s.ModalView(l)).render()))return C(!0),setTimeout((function(){n.showSettings()}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(o.el),(void 0!==i.model.get("et_pb_global_module")&&""!==i.model.get("et_pb_global_module")||void 0!==this.model.get("et_pb_template_type")&&"section"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal"),void 0!==this.model.get("et_pb_specialty")&&"on"===this.model.get("et_pb_specialty")&&e(".et_pb_modal_settings_container").addClass("et_pb_specialty_section_settings"),Re()}else J.alert("has_no_permission")},addSection:function(e){var t=k.generateNewId();e.preventDefault(),i(),V.isLoading||J.is_selecting()||(V.allowHistorySaving("added","section"),this.collection.add([{type:"section",module_type:"section",et_pb_fullwidth:"off",et_pb_specialty:"off",cid:t,view:this,created:"auto",admin_label:et_pb_options.noun.section}]))},addFullwidthSection:function(e){var t=k.generateNewId();e.preventDefault(),i(),V.isLoading||J.is_selecting()||(V.allowHistorySaving("added","fullwidth_section"),this.collection.add([{type:"section",module_type:"section",et_pb_fullwidth:"on",et_pb_specialty:"off",cid:t,view:this,created:"auto",admin_label:et_pb_options.noun.section}]))},addSpecialtySection:function(t){var o=k.generateNewId(),n=e(t.target),a=void 0!==n&&void 0!==n.data("is_template")?"section":"";t.preventDefault(),i(),V.isLoading||J.is_selecting()||(V.allowHistorySaving("added","specialty_section"),this.collection.add([{type:"section",module_type:"section",et_pb_fullwidth:"off",et_pb_specialty:"on",cid:o,template_type:a,view:this,created:"auto",admin_label:et_pb_options.noun.section}]))},addSavedSection:function(t){var o={attributes:{"data-open_view":"saved_templates","data-parent_cid":this.model.get("cid")},view:this},n=new s.ModalView(o);i(),V.isLoading||J.is_selecting()||(e("body").append(n.render().el),Ae("include_global","","section",e(".et-pb-saved-modules-tab"),"regular",0,"all"),t.preventDefault())},expandSection:function(e){e.preventDefault(),this.$el.closest(".et_pb_section").removeClass("et_pb_collapsed"),this.options.model.attributes.et_pb_collapsed="off",J.is_active()&&"on"===this.model.get("et_pb_ab_subject")&&J.subject_carousel(this.model.get("cid")),V.allowHistorySaving("expanded","section"),V.saveAsShortcode()},unlockSection:function(e){if(e.preventDefault(),!V.isLoading&&!J.is_selecting()){var t,i=this,o=i.$el.closest(".et_pb_section");He().done((function(e){!0===e?(o.removeClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="off",t=k.getChildrenViews(i.model.get("cid")),_.each(t,(function(e,t){e.$el.removeClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","off",{silent:!0})})),V.allowHistorySaving("unlocked","section"),V.saveAsShortcode()):alert(et_pb_options.locked_section_permission_alert)}))}},addFirstRow:function(){if(!V.isLoading){var e=k.generateNewId(),t=void 0!==this.model.get("et_pb_global_module")&&""!==this.model.get("et_pb_global_module")?this.model.get("et_pb_global_module"):"",i=""!==t?this.model.get("cid"):"";this.collection.add([{type:"row",module_type:"row",cid:e,parent:this.model.get("cid"),view:this,et_pb_global_parent:t,global_parent_cid:i,admin_label:et_pb_options.noun.row}]),k.getView(e).displayColumnsOptions()}},addRow:function(e){if(!V.isLoading){var t=k.generateNewId(),i=void 0!==this.model.get("et_pb_global_module")&&""!==this.model.get("et_pb_global_module")?this.model.get("et_pb_global_module"):"",o=""!==i?this.model.get("cid"):"";this.collection.add([{type:"row",module_type:"row",cid:t,parent:this.model.get("cid"),view:this,appendAfter:e,et_pb_global_parent:i,global_parent_cid:o,admin_label:et_pb_options.noun.row}]),k.getView(t).displayColumnsOptions()}},cloneSection:function(e){if(e.preventDefault(),!this.isSectionLocked()&&!V.isLoading&&!J.is_selecting()){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid"),"section"))return void J.alert("has_no_permission");if(J.has_goal(this.model)&&!J.is_subject(this.model))return void J.alert("cannot_clone_section_has_goal")}this.$el.clone();var t,i={model:this.model,view:this.$el,view_event:e};t=new s.RightClickOptionsView(i,!0),V.allowHistorySaving("cloned","section"),t.copy(e),t.pasteAfter(e)}},makeRowsSortable:function(){var t=this,o="on"!==t.model.get("et_pb_fullwidth")?".et-pb-section-content":".et_pb_fullwidth_sortable_area",n=":not(.et_pb_locked) > ".concat(o);"on"!==t.model.get("et_pb_specialty")&&(J.is_active()&&!J.is_user_has_permission(this.model.get("cid"),"section")||t.$el.find(o).sortable({connectWith:n,delay:100,cancel:".et-pb-settings, .et-pb-clone, .et-pb-remove, .et-pb-row-add, .et-pb-insert-module, .et-pb-insert-column, .et-pb-insert-row, .et_pb_locked, .et-pb-disable-sort",update:function(i,n){var a=t.$el.find(o);if(V.isLoading)a.sortable("cancel");else{if(J.is_active()){if(!J.is_user_has_permission(e(n.item).children(".et-pb-row-content").attr("data-cid"),"row"))return J.alert("has_no_permission"),a.sortable("cancel"),void Ue();var s=e(n.item),l=_.isEmpty(e(n.sender))?e(i.target).parents(".et_pb_section"):e(n.sender).parents(".et_pb_section"),d=_.isEmpty(e(n.sender))?e(i.toElement).parents(".et_pb_section"):e(i.target).parents(".et_pb_section"),r=s.hasClass("et_pb_ab_subject"),c=s.hasClass("et_pb_ab_goal"),p=s.find(".et_pb_ab_subject").length,b=s.find(".et_pb_ab_goal").length,u=l.closest(".et_pb_ab_subject").length,g=d.closest(".et_pb_ab_subject").length,h=d.closest(".et_pb_ab_goal").length;if(c&&!r&&g)return J.alert("cannot_move_goal_into_subject"),a.sortable("cancel"),void Ue();if(b&&g)return J.alert("cannot_move_goal_into_subject"),a.sortable("cancel"),void Ue();if(r&&!c&&h)return J.alert("cannot_move_subject_into_goal"),a.sortable("cancel"),void Ue();if(p&&h)return J.alert("cannot_move_subject_into_goal"),a.sortable("cancel"),void Ue();c&&u&&(J.alert("cannot_move_row_goal_out_from_subject"),a.sortable("cancel"),Ue())}if(!e(n.item).closest(i.target).length)return e(i.target).find(".et_pb_row").length||(e(this).sortable("cancel"),alert(et_pb_options.section_only_row_dragged_away)),void(e(n.item).closest(".et-pb-disable-sort").length&&e(i.target).sortable("cancel"));var f=e(n.item).find(".et-pb-row-content").data("cid"),m=t.collection.find((function(e){return e.get("cid")==f}));if(e(n.item).closest(".et_pb_section.et_pb_global").length&&e(n.item).hasClass("et_pb_global"))e(n.sender).sortable("cancel"),alert(et_pb_options.global_row_alert);else if((e(n.item).closest(".et_pb_section.et_pb_global").length||e(n.sender).closest(".et_pb_section.et_pb_global").length)&&""===et_pb_options.template_post_id){var w,y,C;if((y=e(n.sender).closest(".et_pb_section.et_pb_global"))===(C=e(n.item).closest(".et_pb_section.et_pb_global")))Ie(w=m.get("global_parent_cid")),Ue();else{var S=y;0!==C.length||(_.isUndefined(m.get("et_pb_global_parent"))||""===m.get("et_pb_global_parent"))&&_.isUndefined(m.get("global_parent_cid"))||(m.unset("et_pb_global_parent"),m.unset("global_parent_cid"),k.removeGlobalAttributes(k.getView(m.get("cid"))));for(var x=1;x<=2;x++)void 0!==(w=S.find(".et-pb-section-content").data("cid"))&&""!==w&&(Ie(w),Ue()),S=C}}k.setNewParentID(n.item.find(".et-pb-row-content").data("cid"),t.model.attributes.cid),V.allowHistorySaving("moved","row"),v.trigger("et-sortable:update");var j=parseInt(e(this).attr("data-cid")),T=0;e(this).find(".et-pb-row-content").each((function(){T++;var t=parseInt(e(this).data("cid")),i=j+T;$.findWhere({cid:t}).set({layout_index:i})})),$.comparator="layout_index",$.sort()}},start:function(t,o){if(i(),t.altKey){var n=k.getView(e(o.item).children(".et-pb-row-content").data("cid")),a={model:n.model,view:n.$el,view_event:t},l=new s.RightClickOptionsView(a,!0);l.copy(t,!0),l.pasteAfter(t,void 0,void 0,void 0,!0,!0),V.allowHistorySaving("cloned","row")}}}))},addChildView:function(e){this.child_views.push(e)},removeChildViews:function(){var e=k.getChildViews(this.model.attributes.cid);_.each(e,(function(e){void 0!==e.model&&e.model.destroy(),e.remove()}))},removeSection:function(e,t){var i,o=!1;if(e&&e.preventDefault(),!this.isSectionLocked()&&!k.isChildrenLocked(this.model.get("cid"))&&(!V.isLoading||!_.isUndefined(t)||k.get("forceRemove"))&&(!J.is_selecting()||!_.isUndefined(t)||k.get("forceRemove"))){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid"),"section"))return void J.alert("has_no_permission");if(J.is_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return;if(J.has_goal(this.model)&&!J.is_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_section_has_goal");if(J.has_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_section_has_unremovable_subject")}"on"===this.model.get("et_pb_fullwidth")?this.removeChildViews():(i=k.getChildViews(this.model.get("cid")),_.each(i,(function(e){"column"===e.model.get("type")?e.removeColumn():e.removeRow(!1,!0)}))),k.get("forceRemove")||"on"!==this.model.get("et_pb_specialty")&&"on"!==this.model.get("et_pb_fullwidth")||1!==k.getNumberOfModules("section")||(o=!0),(k.get("forceRemove")||o||k.getNumberOfModules("section")>1)&&(this.model.destroy(),k.removeView(this.model.get("cid")),this.remove()),o?V.removeAllSections(!0):(_.isUndefined(t)?V.allowHistorySaving("removed","section"):V.allowHistorySaving("cleared","layout"),e&&v.trigger("et-module:removed"),J.update())}},isSectionLocked:function(){return"on"===this.model.get("et_pb_locked")},showRightClickOptions:function(e){e.preventDefault();var t={model:this.model,view:this.$el,view_event:e};new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()},renameModule:function(){this.$(".et-pb-section-title").html(this.model.get("admin_label"))},toggleDisabledClass:function(){void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")?this.$el.addClass("et_pb_disabled"):this.$el.removeClass("et_pb_disabled")},setABTesting:function(e){e.preventDefault(),e.stopPropagation(),J.set(this,e)}}),s.RowView=window.wp.Backbone.View.extend({className:"et_pb_row",template:_.template(e("#et-builder-row-template").html()),events:{"click .et-pb-settings-row":"showSettings","click .et-pb-insert-column":"displayColumnsOptions","click .et-pb-clone-row":"cloneRow","click .et-pb-row-add":"addNewRow","click .et-pb-remove-row":"removeRow","click .et-pb-change-structure":"changeStructure","click .et-pb-expand":"expandRow","contextmenu .et-pb-row-add":"showRightClickOptions","click.et_pb_row > .et-pb-controls .et-pb-unlock":"unlockRow","contextmenu.et_pb_row > .et-pb-controls":"showRightClickOptions","contextmenu.et_pb_row > .et-pb-right-click-trigger-overlay":"showRightClickOptions","contextmenu .et-pb-column":"showRightClickOptions","click.et_pb_row > .et-pb-controls":"hideRightClickOptions","click.et_pb_row > .et-pb-right-click-trigger-overlay":"hideRightClickOptions","click > .et-pb-locked-overlay":"showRightClickOptions","contextmenu > .et-pb-locked-overlay":"showRightClickOptions",click:"setABTesting"},initialize:function(){this.listenTo(v,"et-add:columns",this.toggleInsertColumnButton),this.listenTo(this.model,"change:admin_label",this.renameModule),this.listenTo(this.model,"change:et_pb_disabled",this.toggleDisabledClass)},render:function(){var e=k.getParentViews(this.model.get("parent"));return void 0!==this.model.get("view")&&void 0!==this.model.get("view").model.get("layout_specialty")&&this.model.set("specialty_row","1",{silent:!0}),this.$el.html(this.template(this.model.toJSON())),(void 0!==this.model.get("et_pb_global_module")||void 0!==this.model.get("et_pb_template_type")&&"row"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&this.$el.addClass("et_pb_global"),void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")&&this.$el.addClass("et_pb_disabled"),void 0!==this.model.get("et_pb_locked")&&"on"===this.model.get("et_pb_locked")&&(this.$el.addClass("et_pb_locked"),_.each(e,(function(e){e.$el.addClass("et_pb_children_locked")}))),void 0!==this.model.get("et_pb_parent_locked")&&"on"===this.model.get("et_pb_parent_locked")&&this.$el.addClass("et_pb_parent_locked"),void 0!==this.model.get("et_pb_collapsed")&&"on"===this.model.get("et_pb_collapsed")&&this.$el.addClass("et_pb_collapsed"),void 0!==this.model.get("pasted_module")&&this.model.get("pasted_module")&&Y(this.$el),k.is_temp_global(this.model)&&this.$el.addClass("et_pb_global_temp"),J.is_active()&&(J.is_subject(this.model)&&(this.$el.addClass("et_pb_ab_subject"),J.set_subject_rank_coloring(this)),J.is_goal(this.model)&&this.$el.addClass("et_pb_ab_goal"),J.is_user_has_permission(this.model.get("cid"),"row")||this.$el.addClass("et_pb_ab_no_permission")),this},showSettings:function(t){var i,o,n=this,a={model:this.model,collection:this.collection,attributes:{"data-open_view":"module_settings"},triggered_by_right_click:this.triggered_by_right_click,do_preview:this.do_preview};if(void 0!==t&&t.preventDefault(),!this.isRowLocked()&&!V.isLoading&&!J.is_selecting())if(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"row")){if(!1===(o=(i=new s.ModalView(a)).render()))return C(!0),setTimeout((function(){n.showSettings()}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(o.el),(void 0!==i.model.get("et_pb_global_module")&&""!==i.model.get("et_pb_global_module")||k.getView(i.model.get("cid")).$el.closest(".et_pb_global").length||void 0!==this.model.get("et_pb_template_type")&&"row"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal")}else J.alert("has_no_permission")},displayColumnsOptions:function(t){if(t&&t.preventDefault(),!this.isRowLocked()&&!V.isLoading&&!J.is_selecting()){var i;this.model.set("open_view","column_settings",{silent:!0}),i=new s.ModalView({model:this.model,collection:this.collection,attributes:{"data-open_view":"column_settings"},view:this}),e("body").append(i.render().el),this.toggleInsertColumnButton()}},changeStructure:function(t){var i;t.preventDefault();this.isRowLocked()||V.isLoading||J.is_selecting()||(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"row")?(this.model.set("change_structure","true",{silent:!0}),this.model.set("open_view","column_settings",{silent:!0}),s.Events=v,i=new s.ModalView({model:this.model,collection:this.collection,attributes:{"data-open_view":"column_settings"},view:this}),e("body").append(i.render().el)):J.alert("has_no_permission"))},expandRow:function(e){e.preventDefault(),this.$el.closest(".et_pb_row").removeClass("et_pb_collapsed"),this.options.model.attributes.et_pb_collapsed="off",J.is_active()&&"on"===this.model.get("et_pb_ab_subject")&&J.subject_carousel(this.model.get("cid")),V.allowHistorySaving("expanded","row"),V.saveAsShortcode()},unlockRow:function(e){if(e.preventDefault(),!V.isLoading&&!J.is_selecting()){var t,i,o=this,n=o.$el.closest(".et_pb_row");He().done((function(e){!0===e?(n.removeClass("et_pb_locked"),o.options.model.attributes.et_pb_locked="off",t=k.getChildrenViews(o.model.get("cid")),_.each(t,(function(e,t){e.$el.removeClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","off",{silent:!0})})),i=k.getParentViews(o.model.get("parent")),_.each(i,(function(e,t){k.isChildrenLocked(e.model.get("cid"))||e.$el.removeClass("et_pb_children_locked")})),V.allowHistorySaving("unlocked","row"),V.saveAsShortcode()):alert(et_pb_options.locked_row_permission_alert)}))}},toggleInsertColumnButton:function(){if(void 0!==this.model){var e,t=this.model.get("cid");e=this.collection.find((function(e){return("column"===e.get("type")||"column_inner"===e.get("type"))&&e.get("parent")===t})),_.isUndefined(e)||(this.$(".et-pb-insert-column").hide(),this.$(".et-pb-change-structure").show())}},addNewRow:function(t){var o=this.$el.closest(".et-pb-section-content"),n=e(t.currentTarget),a=n.closest(".et-pb-column-specialty").length?n.closest(".et-pb-column-specialty").data("cid"):o.data("cid"),s=k.getView(a),l="";t.preventDefault(),V.isLoading||(i(),"on"!==this.model.get("et_pb_parent_locked")&&(this.$el.closest(".et_pb_section.et_pb_global").length&&void 0===s.model.get("et_pb_template_type")&&(l=Pe(this)),!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"add_row")?(V.allowHistorySaving("added","row"),s.addRow(this.$el),""!==l&&Ie(l)):J.alert("has_no_permission")))},cloneRow:function(e){var t,i="",o=k.getView(this.model.get("parent")),n={model:this.model,view:this.$el,view_event:e};if(e.preventDefault(),!this.isRowLocked()&&!V.isLoading&&!J.is_selecting()){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid")))return void J.alert("has_no_permission");if(J.has_goal(this.model)&&!J.is_subject(this.model))return void J.alert("cannot_clone_row_has_goal")}this.$el.closest(".et_pb_section.et_pb_global").length&&void 0===o.model.get("et_pb_template_type")&&(i=Pe(this)),t=new s.RightClickOptionsView(n,!0),V.allowHistorySaving("cloned","row"),t.copy(e),t.pasteAfter(e),""!==i&&Ie(i)}},removeRow:function(e,t){var i,o="",n=k.getView(this.model.get("parent"));if(!this.isRowLocked()&&!k.isChildrenLocked(this.model.get("cid"))&&!V.isLoading&&(!J.is_selecting()||!_.isUndefined(t)||k.get("forceRemove"))){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid")))return void J.alert("has_no_permission");if(J.is_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return;if(J.has_goal(this.model)&&!J.is_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_row_has_goal");if(J.has_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_row_has_unremovable_subject")}e&&(e.preventDefault(),this.$el.closest(".et-pb-column-specialty").length&&e.stopPropagation(),this.$el.closest(".et_pb_section.et_pb_global").length&&void 0===n.model.get("et_pb_template_type")&&(o=Pe(this))),i=k.getChildViews(this.model.get("cid")),_.each(i,(function(e){e.removeColumn()})),k.get("forceRemove")||k.getNumberOf("row",this.model.get("parent"))>1?(this.model.destroy(),k.removeView(this.model.get("cid")),this.remove()):(this.$(".et-pb-insert-column").show(),this.$(".et-pb-change-structure").hide(),Ue()),V.allowHistorySaving("removed","row"),e&&v.trigger("et-module:removed"),""!==o&&Ie(o),J.update()}},isRowLocked:function(){return"on"===this.model.get("et_pb_locked")||"on"===this.model.get("et_pb_parent_locked")},showRightClickOptions:function(t){t.preventDefault();var i,o=e(t.target);o.closest(".et-pb-insert-module").length||o.closest(".et-pb-insert-row").length||o.hasClass("et_pb_module_block")||o.closest(".et_pb_module_block").length||(i={model:this.model,view:this.$el,view_event:t},new s.RightClickOptionsView(i))},hideRightClickOptions:function(e){e.preventDefault(),i()},renameModule:function(){this.$(".et-pb-row-title").html(this.model.get("admin_label"))},toggleDisabledClass:function(){void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")?this.$el.addClass("et_pb_disabled"):this.$el.removeClass("et_pb_disabled")},setABTesting:function(e){e.preventDefault(),e.stopPropagation(),J.set(this,e)}}),s.ModalView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings_container",template:_.template(e("#et-builder-modal-template").html()),events:{"click .et-pb-modal-save":"saveSettings","click .et-pb-modal-preview-template":"preview","click .et-pb-preview-mobile":"resizePreviewScreen","click .et-pb-preview-tablet":"resizePreviewScreen","click .et-pb-preview-desktop":"resizePreviewScreen","click .et-pb-modal-close":"closeModal","click .et-pb-modal-save-template":"saveTemplate","change #et_pb_select_category":"applyFilter"},initialize:function(e){this.listenTo(v,"et-add:columns",this.removeView),this.listenTo(v,"et-new_module:show_settings",this.removeView),this.listenTo(v,"et-saved_layout:loaded",this.removeView),this.options=e},render:function(){var t,i={model:this.model,collection:this.collection,view:this.options.view},o=!1;if(this.$el.attr("tabindex",0),void 0===this.model||void 0===this.model.get("view")||"row_inner"!==this.model.get("module_type")&&"row"!==this.model.get("module_type")||this.model.get("parent")===this.model.get("view").$el.data("cid")||this.model.set("view",k.getView(this.model.get("parent")),{silent:!0}),"all_modules"===this.attributes["data-open_view"]&&"section"===this.model.get("module_type")&&"on"===this.model.get("et_pb_fullwidth")&&(this.model.set("type","column",{silent:!0}),o=!0),void 0!==this.model){var n=k.getView(this.model.get("parent"));"column_specialty_settings"===this.attributes["data-open_view"]&&this.model.set("open_view","column_specialty_settings",{silent:!0}),this.$el.html(this.template(this.model.toJSON())),"column_specialty_settings"===this.attributes["data-open_view"]&&this.model.unset("open_view","column_specialty_settings",{silent:!0})}else this.$el.html(this.template());if(o&&this.model.set("type","section",{silent:!0}),this.container=this.$(".et-pb-modal-container"),"column_settings"===this.attributes["data-open_view"])t=new s.ColumnSettingsView(i);else if("all_modules"===this.attributes["data-open_view"])i.attributes={"data-parent_cid":this.model.get("cid")},t=new s.ModulesView(i);else if("module_settings"===this.attributes["data-open_view"]){var l=this.model.get("module_type");"row"!==l||_.isUndefined(n)||"column"!==n.model.get("type")||(l="row_inner"),i.attributes={"data-module_type":l},i.view=this,t=new s.ModuleSettingsView(i)}else"save_layout"===this.attributes["data-open_view"]?t=new s.SaveLayoutSettingsView(i):"column_specialty_settings"===this.attributes["data-open_view"]?t=new s.ColumnSettingsView(i):"saved_templates"===this.attributes["data-open_view"]?t=new s.TemplatesModal({attributes:{"data-parent_cid":this.attributes["data-parent_cid"]}}):"help"===this.attributes["data-open_view"]&&(t=new s.HelpView);if(void 0!==t.attributes&&"no_template"===t.attributes["data-no_template"])return!1;if(this.container.append(t.render().el),"column_settings"===this.attributes["data-open_view"]&&this.model.unset("open_view",{silent:!0}),"all_modules"===this.attributes["data-open_view"]){var d=e(t.render().el);d.find("li.et_pb_post_content, li.et_pb_fullwidth_post_content").remove(),"section"===this.model.get("module_type")&&a("undefined"!==this.model.get("et_pb_fullwidth"))&&"on"===this.model.get("et_pb_fullwidth")?d.find(".et-pb-all-modules li:not(.et_pb_fullwidth_only_module)").remove():d.find("li.et_pb_fullwidth_only_module").remove()}if(e(".et_pb_modal_overlay").length&&(e(".et_pb_modal_overlay").remove(),e("body").removeClass("et_pb_stop_scroll")),e("body").hasClass("et_pb_modal_fade_in")?e("body").append('<div class="et_pb_modal_overlay et_pb_no_animation"></div>'):e("body").append('<div class="et_pb_modal_overlay"></div>'),e("body").addClass("et_pb_stop_scroll"),this.isABTestingModule()){var r=e(t.render().el).closest(".et_pb_modal_settings_container");r.addClass("has_ab_testing_module"),r.find(".et-pb-modal-save-template").remove()}return this},closeModal:function(t){t.preventDefault(),e(".et_modal_on_top").length?e(".et_modal_on_top").remove():(void 0!==this.model&&"module"===this.model.get("type")&&this.$(".wp-editor-area").length&&(se("et_pb_content"),se("et_pb_description"),se("et_pb_footer_content")),Te(this),X(this,"trigger_event"))},removeView:function(){if(void 0===this.model||"row"===this.model.get("type")||"column"===this.model.get("type")||"row_inner"===this.model.get("type")||"column_inner"===this.model.get("type")||"section"===this.model.get("type")&&("on"===this.model.get("et_pb_fullwidth")||"on"===this.model.get("et_pb_specialty")))if(void 0!==this.model&&void 0!==this.model.get("type")&&("column"===this.model.get("type")||"column_inner"===this.model.get("type")||"section"===this.model.get("type")&&"on"===this.model.get("et_pb_fullwidth"))){var t=this;e(t.el).find(".et-pb-main-settings.active-container").hasClass("et-pb-saved-modules-tab")?X(t):(t.remove(),e("body").addClass("et_pb_modal_fade_in"),e(".et_pb_modal_overlay").addClass("et_pb_no_animation"),setTimeout((function(){e(".et_pb_modal_settings_container").addClass("et_pb_no_animation"),e("body").removeClass("et_pb_modal_fade_in")}),500))}else X(this);else this.removeOverlay()},saveSettings:function(t,i){var o=this,n="",a=k.getView(o.model.get("cid")),s=(_.isUndefined(o.model.get("parent"))||k.getView(o.model.get("parent")),a),l=(i=!!_.isUndefined(i)||i,"not-allowed"===e(t.target).css("cursor"));if(_.isUndefined(s.model.get("et_pb_global_module")))for(;!_.isUndefined(s.model.get("parent"))&&""===n;)s=k.getView(s.model.get("parent")),n=""!==n||_.isUndefined(s.model.get("et_pb_global_module"))?n:s.model.get("cid");else n=s.model.get("cid");t.preventDefault(),l||(e("#publish").addClass("disabled"),V.disable_publish=!0,(void 0!==s.model.get("global_parent_cid")&&""!==s.model.get("global_parent_cid")||void 0!==s.model.get("et_pb_global_module")&&""!==s.model.get("et_pb_global_module"))&&(n=void 0!==s.model.get("global_parent_cid")?s.model.get("global_parent_cid"):s.model.get("cid")),o.performSaving(),""!==n&&Ie(n),V.allowHistorySaving("edited",o.model.get("type"),o.model.get("admin_label")),i&&(se("et_pb_content"),se("et_pb_description"),se("et_pb_footer_content"),Te(o),X(o,"trigger_event"),J.is_active()&&J.set_subject_rank_coloring(a)))},preview:function(t){var i,o,n,a=this.model.get("cid"),s=e(t.target).is("a")?e(t.target):e(t.target).parent("a"),l=e(t.target).parents(".et-pb-modal-container"),d=document.documentMode;if(t.preventDefault(),_.isUndefined(this.options.triggered_by_right_click)?this.saveSettings(t,!1):delete this.options.triggered_by_right_click,_.isUndefined(this.options.do_preview)||delete this.options.do_preview,"1"===et_pb_options.is_divi_library&&e.inArray(et_pb_options.layout_type,["row","module"])>-1?a=void 0:"section"!==this.model.get("type")&&(n=k.getSectionView(this.model.get("parent")),_.isUndefined(n)||(a=n.model.attributes.cid)),i=V.generateCompleteShortcode(a),o={et_pb_preview_nonce:et_pb_options.et_pb_preview_nonce,shortcode:i,post_title:e("#title").val(),post_id:et_pb_options.postId},s.toggleClass("active"),l.toggleClass("et-pb-item-previewing"),s.hasClass("active")){var r=e("<iframe />",{id:"et-pb-preview-screen",src:"".concat(et_pb_options.preview_url,"&et_pb_preview_nonce=").concat(et_pb_options.et_pb_preview_nonce)}),c=!1;e(".et-pb-preview-tab").html(r),e("#et-pb-preview-screen").on("load",(function(){if(!c){var e=document.getElementById("et-pb-preview-screen");!_.isUndefined(d)&&d<10&&(o=JSON.stringify(o)),e.contentWindow.postMessage(o,et_pb_options.preview_url),c=!0}}))}else e(".et-pb-preview-tab").empty(),e(".et-pb-preview-screensize-switcher a").removeClass("active"),e(".et-pb-preview-desktop").addClass("active")},resizePreviewScreen:function(t){t.preventDefault();var i=e(t.target),o=_.isUndefined(i.data("width"))?"100%":i.data("width");e(".et-pb-preview-screensize-switcher a").removeClass("active"),i.addClass("active"),e("#et-pb-preview-screen").animate({width:o})},getAttr:function(e,t){return _.isUndefined(e[t])?"":e[t]},performSaving:function(t){var i,o=this,n={},l=[],d={},r=void 0!==t&&""!==t?t:"input, select, textarea, #et_pb_content_main",c=o.model.get("module_type"),p=o.model.get("_address");if(c=-1===c.indexOf("et_pb_")?"et_pb_".concat(c):c,(i=e(this)[0].$el.find("form.validate")).length){var b=i.validate();if(!b.form())return Ve("failed form validation"),Ve("failed elements: "),Ve(b.errorList),void b.focusInvalid();Ve("passed form validation")}var u="global"===et_pb_options.is_global_template?et_pb_options.template_post_id:this.model.get("et_pb_global_module");if(e(".et_pb_global_sync_switcher").length>0&&void 0!==u&&""!==u){var g=[];e(".et_pb_global_unsynced").length>0&&e(".et_pb_global_unsynced").each((function(){var t=e(this),i=t.data("option_name");i=_.includes(["content","raw_content"],i)?"et_pb_content_field":i,g.push(i),_.isUndefined(t.data("additional_options"))||"mobile"!==t.data("additional_options")||(g.push("".concat(i,"_tablet")),g.push("".concat(i,"_phone")))})),h[u]=g,"global"===et_pb_options.is_global_template&&0!==e("#et_pb_unsynced_global_attrs").length&&e("#et_pb_unsynced_global_attrs").val(JSON.stringify(g))}s.Events.trigger("et-modal-settings:save",this);var f=!_.isUndefined(et_pb_options.et_pb_module_settings_migrations)&&et_pb_options.et_pb_module_settings_migrations,m=!_.isUndefined(f.name_changes)&&f.name_changes;m&&!_.isUndefined(m[p])&&(_.forEach(m[p],(function(e,t){l.push("et_pb_".concat(t))})),delete et_pb_options.et_pb_module_settings_migrations.name_changes[p]),this.$(r).each((function(){var t=e(this),i=ve(t)||"",o=t.is("#et_pb_content_main")?"et_pb_content":t.attr("id");if(t.is(":checkbox")&&(o=t.attr("name")),void 0===o||-1!==o.indexOf("qt_")&&"button"===t.attr("type"))return!0;if(t.hasClass("et-pb-helper-field"))return!0;if(t.is(":checkbox")&&void 0!==n[o])return!0;var a=o.indexOf("divider_color")>-1;t.hasClass("et-pb-color-picker-hex")&&new Color(t.val()).error&&!t.hasClass("et-pb-is-cleared")&&!a&&t.val(t.data("selected-value")),""!==(i="".concat(i))&&(d[o]=i);var r,c,p=s.Helpers.getSettingValue(t);r=p,c=i,(t.hasClass("et-pb-range-input")?_.isEqual(parseFloat(r),parseFloat(c)):_.isEqual(r,c))?l.push(o):n[o]=p})),n.module_defaults=d;var v=this.model.attributes,w=this.model._previousAttributes,y=v.type,k=_.isUndefined(n.et_pb_custom_padding_last_edited)?[]:n.et_pb_custom_padding_last_edited.split("|"),C="object"===a(k)&&"on"===k[0],S=o.getAttr(n,"et_pb_custom_padding")!==o.getAttr(w,"et_pb_custom_padding"),x=C&&o.getAttr(n,"et_pb_custom_padding_tablet")!==o.getAttr(w,"et_pb_custom_padding_tablet"),j=C&&o.getAttr(n,"et_pb_custom_padding_phone")!==o.getAttr(w,"et_pb_custom_padding_phone"),$=S||x||j;if("section"===y&&(C||$)&&(n.et_pb_padding_mobile=""),"row"===y||"row_inner"===y){(C||$)&&(n.et_pb_padding_mobile="");for(var T=void 0===v.columns_layout?0:v.columns_layout.split(",").length,V=1;V<=T;V++){var U=n["et_pb_padding_".concat(V,"_last_edited")],O=void 0===U?[]:U.split("|"),A="object"===a(O)&&"on"===O[0],M=o.getAttr(n,"et_pb_padding_top_".concat(V))!==o.getAttr(w,"et_pb_padding_top_".concat(V)),L=o.getAttr(n,"et_pb_padding_right_".concat(V))!==o.getAttr(w,"et_pb_padding_right_".concat(V)),E=o.getAttr(n,"et_pb_padding_bottom_".concat(V))!==o.getAttr(w,"et_pb_padding_bottom_".concat(V)),D=o.getAttr(n,"et_pb_padding_left_".concat(V))!==o.getAttr(w,"et_pb_padding_left_".concat(V)),I=M||L||E||D,P=A&&o.getAttr(n,"et_pb_padding_".concat(V,"_tablet"))!==o.getAttr(w,"et_pb_padding_".concat(V,"_tablet")),R=A&&o.getAttr(n,"et_pb_padding_".concat(V,"_phone"))!==o.getAttr(w,"et_pb_padding_".concat(V,"_phone"));if(A||(I||P||R)){n.et_pb_column_padding_mobile="";break}}}this.model.set(n),l.map(this.model.unset.bind(this.model))},isABTestingModule:function(){var e=this.model;return J.is_active()&&(J.is_subject(e)||J.has_subject(e)||J.is_goal(e)||J.has_goal(e))},saveTemplate:function(t){var i=-1!==this.model.get("module_type").indexOf("fullwidth")?"fullwidth":"regular",o=void 0!==this.model.get("columns_layout")?this.model.get("columns_layout"):"0",n="not-allowed"===e(t.target).css("cursor")||this.isABTestingModule();t.preventDefault(),n||G("save_template",this,i,o)},removeOverlay:function(){var t=e(".et_pb_modal_overlay");if(t.length&&(t.addClass("et_pb_overlay_closing"),setTimeout((function(){t.remove(),e("body").removeClass("et_pb_stop_scroll")}),600)),!_.isUndefined(V.disable_publish))setTimeout((function(){_.isUndefined(V.disable_publish)||(e("#publish").removeClass("disabled"),delete V.disable_publish)}),3e3)},applyFilter:function(t){var i=e(t.target),o=i.data("attr"),n=i.val();o.append_to.html(""),Ae(o.include_global,"",o.layout_type,o.append_to,o.module_width,o.specialty_cols,n)}}),s.ColumnView=window.wp.Backbone.View.extend({template:_.template(e("#et-builder-column-template").html()),templateAddRow:_.template(e("#et-builder-specialty-column-template").html()),events:{"click .et-pb-insert-module":"addModule","click .et-pb-insert-row":"addModule","contextmenu > .et-pb-insert-module":"showRightClickOptions",click:"hideRightClickOptions"},initialize:function(){this.$el.attr("data-cid",this.model.get("cid"))},render:function(){var t=this,o="section"===this.model.get("module_type")&&"on"===this.model.get("et_pb_fullwidth"),n=o?".et_pb_fullwidth_sortable_area":".et-pb-column:not(.et-pb-column-specialty, .et_pb_parent_locked)";return this.$el.html(this.template(this.model.toJSON())),void 0!==this.model.attributes.specialty_columns&&this.$el.html(this.templateAddRow(this.model.toJSON())),o&&this.$el.addClass("et_pb_fullwidth_sortable_area"),"1"===this.model.get("layout_specialty")&&(n=".et-pb-column-specialty:not(.et_pb_parent_locked)"),"manually"!==this.model.get("created")||_.isUndefined(this.model.get("et_pb_specialty_columns"))||this.$el.addClass("et-pb-column-specialty"),this.isColumnParentLocked(this.model.get("parent"))&&(this.$el.addClass("et_pb_parent_locked"),this.model.set("et_pb_parent_locked","on",{silent:!0})),J.is_active()&&!J.is_user_has_permission(this.model.get("cid"),"column")||this.$el.sortable({cancel:".et-pb-settings, .et-pb-clone, .et-pb-remove, .et-pb-insert-module, .et-pb-insert-column, .et-pb-insert-row, .et_pb_locked, .et-pb-disable-sort",connectWith:n,delay:100,items:"1"!==this.model.get("layout_specialty")?".et_pb_module_block":".et_pb_row",receive:function(t,i){var o,n,a=e(this),s=!1;a.hasClass("et-pb-column-specialty")&&(!e(i.sender).find(".et_pb_row").length||e(i.item).is(".et_pb_module_block")?(alert(et_pb_options.section_only_row_dragged_away),s=!0):(o=e(i.item).find(".et-pb-row-container > .et-pb-column").length,((n="2_3"===k.getView(a.data("cid")).model.get("layout"))&&3===o||!n&&4===o)&&(alert(et_pb_options.stop_dropping_3_col_row),s=!0))),e(i.item).closest(".et-pb-disable-sort").length&&(s=!0),(e(i.item).closest(".et_pb_section.et_pb_global").length||e(i.item).closest(".et_pb_row.et_pb_global").length)&&e(i.item).hasClass("et_pb_global")&&(alert(et_pb_options.global_module_alert),s=!0),s&&(e(i.sender).sortable("cancel"),Ue()),a.is(".et-pb-column-specialty")&&a.find(".et_pb_row").length<=1&&a.find(".et-pb-insert-row").length&&a.find(".et-pb-insert-row").remove()},update:function(i,o){if(V.isLoading)t.$el.sortable("cancel");else{if(J.is_active()){var n=e(o.item).hasClass("et_pb_row")?e(o.item).children(".et-pb-row-content").attr("data-cid"):e(o.item).attr("data-cid");if(!J.is_user_has_permission(n))return J.alert("has_no_permission"),t.$el.sortable("cancel"),void Ue();var a=e(o.item),s=_.isEmpty(e(o.sender))?e(i.target):e(o.sender),l=_.isEmpty(e(o.sender))?e(i.toElement).parent():e(i.target),d=a.hasClass("et_pb_ab_subject"),r=a.hasClass("et_pb_ab_goal"),c=s.closest(".et_pb_ab_subject").length,p=l.closest(".et_pb_ab_subject").length,b=l.closest(".et_pb_ab_goal").length;if(r&&!d&&c)return J.alert("cannot_move_module_goal_out_from_subject"),e(t.$el).sortable("cancel"),void Ue();if(r&&!d&&!c&&p)return J.alert("cannot_move_goal_into_subject"),e(t.$el).sortable("cancel"),void Ue();if(d&&!r&&b)return J.alert("cannot_move_subject_into_goal"),e(t.$el).sortable("cancel"),void Ue()}var u,g,h=o.item.data("cid");g=e(o.item),void 0===h&&e(i.target).is(".et-pb-column-specialty")&&(g=e(o.item).closest(".et_pb_row").find(".et-pb-row-content"),h=g.data("cid")),!e(i.target).is(".et-pb-column-specialty")&&e(o.item).closest(i.target).length&&1===e(i.target).find(".et_pb_module_block").length&&(e(i.target).find(".et-pb-insert-module").length?g.insertBefore(e(i.target).find(".et-pb-insert-module")):e(i.target).append(g)),u=t.collection.find((function(e){return e.get("cid")==h})),V.allowHistorySaving("moved","module",u.get("admin_label")),u.get("parent")===t.model.attributes.cid&&e(o.item).closest(i.target).length?v.trigger("et-model-changed-position-within-column"):u.set("parent",t.model.attributes.cid);var f=parseInt(e(this).attr("data-cid")),m=0;if(e(this).find(".et_pb_module_block").each((function(){m++;var t=parseInt(e(this).data("cid")),i=f+m;$.findWhere({cid:t}).set({layout_index:i})})),$.comparator="layout_index",$.sort(),(e(o.item).closest(".et_pb_section.et_pb_global").length||e(o.item).closest(".et_pb_row.et_pb_global").length||e(o.sender).closest(".et_pb_row.et_pb_global").length||e(o.sender).closest(".et_pb_section.et_pb_global").length)&&""===et_pb_options.template_post_id){h=o.item.data("cid");var w,y,C=e(o.sender).closest(".et_pb_row.et_pb_global"),S=e(o.item).closest(".et_pb_row.et_pb_global");if((w=C.length>0?C:e(o.sender).closest(".et_pb_section.et_pb_global"))===(y=S.length>0?S:e(o.item).closest(".et_pb_section.et_pb_global"))){var x;Ie(x=C.length>0?e(o.sender).closest(".et-pb-row-content").data("cid"):e(o.sender).closest(".et-pb-section-content").data("cid")),Ue()}else{var j=w;0!==y.length||(_.isUndefined(u.get("et_pb_global_parent"))||""===u.get("et_pb_global_parent"))&&_.isUndefined(u.get("global_parent_cid"))||(u.unset("et_pb_global_parent"),u.unset("global_parent_cid"),k.removeGlobalAttributes(k.getView(u.get("cid"))));for(var T=1;T<=2;T++)void 0!==(x=void 0!==j.find(".et-pb-section-content").data("cid")?j.find(".et-pb-section-content").data("cid"):j.find(".et-pb-row-content").data("cid"))&&""!==x&&(Ie(x),Ue()),j=y}}}},start:function(t,o){if(i(),t.altKey){var n=e(o.item).hasClass("et_pb_row")?e(o.item).children(".et-pb-row-content").attr("data-cid"):e(o.item).attr("data-cid"),a=k.getView(n),l={model:a.model,view:a.$el,view_event:t},_=new s.RightClickOptionsView(l,!0);_.copy(t,!0),_.pasteAfter(t,void 0,void 0,void 0,!0,!0),V.allowHistorySaving("cloned","module",a.model.get("admin_label"))}}}),this},addModule:function(t){var o,n=e(t.target),a=n.is("span")?n.parent(".et-pb-insert-module"):n;(t.preventDefault(),t.stopPropagation(),this.isColumnLocked())||(V.isLoading||J.is_selecting()||(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"add_module")?a.parent().is(t.delegateTarget)&&(i(),e(t.target).is(".et-pb-insert-row")?this.addRow():(o=new s.ModalView({model:this.model,collection:this.collection,attributes:{"data-open_view":"all_modules"},view:this}),e("body").append(o.render().el))):J.alert("has_no_permission")))},addRow:function(e){var t=k.generateNewId(),i=void 0!==this.model.get("et_pb_global_parent")&&""!==this.model.get("et_pb_global_parent")?this.model.get("et_pb_global_parent"):"",o=""!==i?this.model.get("global_parent_cid"):"";V.isLoading||this.isColumnLocked()||(this.collection.add([{type:"row",module_type:"row",cid:t,parent:this.model.get("cid"),view:this,appendAfter:e,et_pb_global_parent:i,global_parent_cid:o,admin_label:et_pb_options.noun.row}]),k.getView(t).displayColumnsOptions())},removeColumn:function(){var e;e=k.getChildViews(this.model.get("cid")),_.each(e,(function(e){"row"===e.model.get("type")||"row_inner"===e.model.get("type")?e.removeRow():e.removeModule()})),k.removeView(this.model.get("cid")),this.model.destroy(),this.remove()},isColumnLocked:function(){return"on"===this.model.get("et_pb_locked")||"on"===this.model.get("et_pb_parent_locked")},isColumnParentLocked:function(e){var t=k.getView(e);return!(_.isUndefined(t)||"on"!==t.model.get("et_pb_locked")&&"on"!==t.model.get("et_pb_parent_locked"))},showRightClickOptions:function(e){e.preventDefault();var t={model:this.model,view:this.$el,view_event:e};t.model.attributes.is_insert_module=!0,new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()}}),s.ColumnSettingsView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-column-settings-template").html()),events:{"click .et-pb-column-layouts li":"addColumns","click .et-pb-options-tabs-links li a":"switchTab"},initialize:function(e){this.listenTo(v,"et-add:columns",this.removeView),this.listenTo(v,"et-modal-view-removed",this.removeViewAndEmptySection),this.options=e},render:function(){return this.$el.html(this.template(this.model.toJSON())),k.getView(this.model.get("cid")).$el.closest(".et_pb_global").length&&this.$el.addClass("et_pb_no_global"),(void 0!==this.model.get("et_pb_specialty")&&"on"===this.model.get("et_pb_specialty")||void 0!==this.model.get("change_structure")&&"true"===this.model.get("change_structure"))&&this.$el.addClass("et_pb_modal_no_tabs"),this},addColumns:function(t){t.preventDefault();var i=this,o=e(t.target).is("li")?e(t.target):e(t.target).closest("li"),n={layout:o.data("layout"),layout_specialty:"section"===i.model.get("type")&&"on"===i.model.get("et_pb_specialty")?o.data("specialty").split(","):"",is_structure_change:void 0!==i.model.get("change_structure")&&"true"===i.model.get("change_structure"),specialty_columns:o.data("specialty_columns")};k.changeColumnStructure(i,n)},removeView:function(){var e=this;setTimeout((function(){e.remove()}),300)},switchTab:function(t){var i=e(t.currentTarget).parent();t.preventDefault(),Ee(i,"row","")},removeViewAndEmptySection:function(){"on"===this.model.get("et_pb_specialty")&&(this.options.view.model.destroy(),k.removeView(this.options.view.model.get("cid")),this.options.view.remove()),this.remove()}}),s.SaveLayoutSettingsView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-load_layout-template").html()),events:{"click .et_pb_layout_button_load":"legacyLoadLayout","click .et_pb_layout_button_delete":"deleteLayout","click .et-pb-options-tabs-links li a":"switchTab"},initialize:function(t){this.options=t,this.layoutIsLoading=!1,this.back_button_template=_.template(e("#et-builder-library-back-button-template").html()),this.current_page={},this.account_status_error=!1,this.account_status_error_template=_.template(e("#et-builder-library-account-status-error-template").html()),this.listenTo(v,"et-modal-view-removed",this.remove),this.listenTo(v,"et-pb-loading:ended",this.onLoadingEnded),this.listenTo(this,"after-render",this.afterRender)},render:function(){this.$el.html(this.template({display_switcher:"on"}));var t=e("#post_type").val();return"layout"===t&&(this.isCategoryBuilder=!0,Le("predefined","et-pb-all-modules-tab",this.$el,t),Le("not_predefined","et-pb-saved-modules-tab",this.$el,t)),setTimeout(_.bind((function(){this.trigger("after-render")}),this),150),this},remove:function(){e(window).off("et_cloud_page_changed",this.onPageChanged.bind(this)),e(window).off("et_cloud_use_item",this.onUseLayout.bind(this)),e(window).off("et_cloud_download_progress",this.onDownloadProgress.bind(this)),window.wp.Backbone.View.prototype.remove.apply(this)},afterRender:function(){this.$modal=this.$el.parents(".et_pb_modal_settings_container"),this.isCategoryBuilder||(this.$modal.addClass("et_pb_library_modal"),this.emitLoadingStarted(),this.loadLibrary(),Promise.all([y]).then(_.bind((function(t){this.local_layouts=t[0].layouts_data,this.custom_layouts=t[0].custom_layouts_data,e(window).on("et_cloud_page_changed",this.onPageChanged.bind(this)),e(window).on("et_cloud_use_item",this.onUseLayout.bind(this)),e(window).on("et_cloud_download_progress",this.onDownloadProgress.bind(this)),this.emitLoadingEnded()}),this)),this.$modal.find(".et_pb_modal_settings").on("click",".et-pb-library-back-button",this.onClickBackButton.bind(this)),e("<ul><li><span>").addClass("et-pb-load-layouts").hide(0).find("span").addClass("et_pb_layout_button_load").on("click",_.bind((function(t){this.onUseLayout(e(t.target).parent().data("layout_id"))}),this)).parents("ul").appendTo(this.$modal.find(".et-pb-all-modules-tab")))},emitLoadingStarted:function(){this.layoutIsLoading=!0,v.trigger("et-pb-loading:started")},emitLoadingEnded:function(){this.layoutIsLoading=!1,v.trigger("et-pb-loading:ended")},deleteLayout:function(t){t.preventDefault();var i=e(t.currentTarget).closest("li");i.hasClass("et_pb_deleting_layout")||(i.addClass("et_pb_deleting_layout"),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_delete_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_id:i.data("layout_id")},beforeSend:function(){v.trigger("et-pb-loading:started"),i.css("opacity","0.5")},complete:function(){v.trigger("et-pb-loading:ended")},success:function(e){1==i.closest("ul").find("> li").length&&i.closest("ul").prev("h3").hide(),i.remove()}}))},getLayout:function(t){return new Promise((function(i,o){e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_builder_library_get_layout",nonce:et_pb_options.library_get_layout_nonce,id:t,is_BB:!0}}).then((function(e){i({content:S(e,"data.savedShortcode",""),migrations:S(e,"data.migrations","")})}))}))},importLayout:function(t){var i=window.etCore.portability,o=i.importFB.bind(i),n=e(window);return new Promise((function(i,a){(t=new Blob([t],{type:"application/json"})).lastModified=Date.now(),t.name="layout.json",n.on("et_fb_layout_import_finished.et_bb",(function(){i({content:S(window.et_fb_import_layout_response,"data.postContent.post_content",S(window.et_fb_import_layout_response,"data.postContent","")),migrations:S(window.et_fb_import_layout_response,"data.migrations","")}),n.off("et_fb_layout_import_finished.et_bb")})),o(t,e("#post_ID").val())}))},isCurrentLayoutEmpty:function(){return _.isEmpty(V.collection.findWhere({type:"module"}))},legacyLoadLayout:function(t){if(t.preventDefault(),!this.layoutIsLoading){this.layoutIsLoading=!0,this.$el.find(".et-pb-main-settings").css({opacity:"0.5"});var i=e(t.currentTarget).closest("li"),o=i.closest(".et-pb-main-settings").find("#et_pb_load_layout_replace").is(":checked"),n=ee("content");e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_load_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_id:i.data("layout_id"),et_replace_content:o?"on":"off"},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){v.trigger("et-pb-loading:ended"),v.trigger("et-saved_layout:loaded")},success:function(e){n=o?e:e+n,V.removeAllSections(),""!==n&&V.allowHistorySaving("loaded","layout"),V.createNewLayout(n,"load_layout")}})}},loadLibrary:function(){var t={context:"layout",initialTab:"et-pb-all-modules-tab",predefinedTab:"et-pb-all-modules-tab",cloudTab:"et-pb-saved-modules-tab",globalSupport:!1,animation:"on",showHelpButton:!1,showLoadOptions:!this.isCurrentLayoutEmpty()};e(window).trigger("et_cloud_container_ready",[t])},onAccountStatusError:function(t){this.account_status_error=!0;var i={expired:"expired"===t};this.$library.hide(),e(this.account_status_error_template(i)).insertBefore(this.$library).on("click",".button",this.onClickAccountSubmitButton.bind(this))},onAuthenticationComplete:function(t){this.account_status_error&&(this.emitLoadingEnded(),t.authenticated?(this.account_status_error=!1,this.onClickBackButton(),this.library.call("retryUseLayout"),et_pb_options.et_account.et_username=this.account.et_username,et_pb_options.et_account.et_api_key=this.account.et_api_key,e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_builder_library_update_account",nonce:et_pb_options.library_update_account_nonce,et_username:this.account.et_username,et_api_key:this.account.et_api_key,status:t.status}})):this.$el.find("et-pb-library-account-status-error").addClass("et-pb-library-account-status-error--auth-failed"))},onClickAccountSubmitButton:function(e){this.account={et_username:this.$el.find("#et_username").val(),et_api_key:this.$el.find("#et_api_key").val()},this.emitLoadingStarted(),this.library.call("authenticate",this.account)},onClickBackButton:function(){window.ETCloudApp.goTo("back")},onDownloadProgress:function(e,t){this.layoutIsLoading||(this.layoutIsLoading=!0,this.$el.find(".et-pb-main-settings").css({opacity:"0.5"}),this.emitLoadingStarted())},onLoadingEnded:function(){!this.isCategoryBuilder&&this.layoutIsLoading&&v.trigger("et-pb-loading:started")},onMouseEnterIFrame:function(e){this.inside_iframe=!0,this.windowX=window.scrollX,this.windowY=window.scrollY},onMouseLeaveIFrame:function(e){this.inside_iframe=!1},onPageChanged:function(e,t){t?this.removeBackButton():this.showBackButton()},onUseLayout:function(e,t){var i,o=!0;_.isObject(t)?(i=t.item,o="on"===t.replace_content):i=t;var n=_.isString(i)?this.importLayout:this.getLayout,a=this;this.emitLoadingStarted(),n(i).then(_.bind((function(e){var t=e.content;o||(t=ee("content")+t),_.isUndefined(e.migrations)||(et_pb_options.et_pb_module_settings_migrations=e.migrations),V.removeAllSections(),t&&V.allowHistorySaving("loaded","layout"),V.createNewLayout(t,"load_layout"),this.emitLoadingEnded(),v.trigger("et-saved_layout:loaded"),a.layoutIsLoading=!1}),this)).catch(_.bind((function(e){this.emitLoadingEnded(),v.trigger("et-saved_layout:loaded"),console.error(e),a.layoutIsLoading=!1}),this))},removeBackButton:function(){this.$modal.find(".et_pb_modal_settings").find(".et-pb-library-back-button").remove(),this.isBackButtonShown=!1},showBackButton:function(){this.isBackButtonShown||(this.isBackButtonShown=!0,this.$modal.find(".et_pb_modal_settings").prepend(this.back_button_template()))},switchTab:function(t){t.preventDefault();var i=e(t.currentTarget).parent(),o=i.data("open_tab"),n={},a=this.$modal.find(".active-container");if(this.isCategoryBuilder)Ee(i,"layout","");else if(o!==this.current_tab){if(this.account_status_error&&(this.account_status_error=!1,this.$el.find(".et-pb-library-account-status-error").remove()),this.removeBackButton(),j(o,"et-pb-")){if(i.addClass("et-pb-options-tabs-links-active").siblings().removeClass("et-pb-options-tabs-links-active"),"et-pb-all-modules-tab"!==o){var s=i.data("custom_tab_id"),l=_.isUndefined(s)||""===s?this.local_layouts:this.custom_layouts[s];n=e.extend(l,{filters:{type:"layout"},load_options:{show:!this.isCurrentLayoutEmpty()}})}a.hasClass("et-pb-all-modules-tab")||(a.removeClass("active-container").fadeOut(),a.siblings(".et-pb-all-modules-tab").addClass("active-container").css("opacity","").fadeIn()),o!==this.current_tab&&window.ETCloudApp.toggleTab({items:n,tab:o})}else Ee(i,"layout","");this.current_tab=o}}}),s.ModulesView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-modules-template").html()),events:{"click .et-pb-all-modules li":"addModule","click .et-pb-options-tabs-links li a":"switchTab"},initialize:function(e){this.options=e,this.listenTo(v,"et-modal-view-removed",this.remove)},render:function(){var e=void 0!==k.getView(this.model.get("parent"))?k.getView(this.model.get("parent")):this;return this.$el.html(this.template(k.toJSON())),(k.getView(this.model.get("cid")).$el.closest(".et_pb_global").length||void 0!==e.model.get("et_pb_template_type")&&"module"===e.model.get("et_pb_template_type"))&&this.$el.addClass("et_pb_no_global"),this},addModule:function(t){var i=e(t.currentTarget),o=i.find(".et_module_title").text(),n=i.attr("class").replace(" et_pb_fullwidth_only_module",""),a="",s=k.getView(this.model.get("parent")),l=void 0!==s?s:this;t.preventDefault(),void 0!==this.model.get("et_pb_global_parent")&&""!==this.model.get("et_pb_global_parent")&&(a=this.model.get("global_parent_cid")),V.allowHistorySaving("added","module",o),this.collection.add([{type:"module",cid:k.generateNewId(),module_type:n,admin_label:o,parent:this.attributes["data-parent_cid"],view:this.options.view,global_parent_cid:a}]),this.remove(),""!==a&&Ie(a),void 0!==l.model.get("et_pb_template_type")&&"module"===l.model.get("et_pb_template_type")&&De("_et_pb_module_type",n),Re()},switchTab:function(t){var i=e(t.currentTarget).parent(),o=a(this.model.get("et_pb_fullwidth"))&&"on"===this.model.get("et_pb_fullwidth")?"fullwidth":"regular";t.preventDefault(),Ee(i,"module",o)}}),s.ModuleSettingsView=window.wp.Backbone.View.extend({className:"et_pb_module_settings",initialize:function(){var t=S(JSON.parse(et_pb_options.et_builder_modules_with_children),this.attributes["data-module_type"],!1),i=!!t&&"#et-builder-advanced-setting-".concat(t,"-title"),o=k.generateTemplateName(this.attributes["data-module_type"]);e(o).length<1||i&&e(i).length<1?this.attributes["data-no_template"]="no_template":(this.template=_.template(e(k.generateTemplateName(this.attributes["data-module_type"])).html()),this.listenTo(v,"et-modal-view-removed",this.removeModule),this.listenTo(v,"et-advanced-module:saved",this.renderMap))},events:{},render:function(){var t,i,n,a,c,p,u,g,h,f,m,w,y,C,S,x,j,$,T,V,U,A,M,L,E=this,D=this.$el,I=[],P=this.model.attributes.cid,R=!1,H=["et_pb_font_icon","et_pb_button_one_icon","et_pb_button_two_icon","et_pb_button_icon"];(E.model.set("et_pb__builder_version",et_pb_options.product_version),_.each(this.model.attributes,(function(t,i,o){if("string"==typeof t&&"et_pb_content"!==i&&-1===e.inArray(i,H)&&!/^\%\%\d+\%\%$/.test(t.trim()))return o[i]=t.replace(/%22/g,'"')})),this.$el.html(this.template(this.model.attributes)),t=this.$el.find("#et_pb_content, .et_pb_tiny_mce_field"),c=this.$el.find(".et-pb-color-picker-hex"),p=this.$el.find(".et-builder-color-picker-alpha"),g=this.$el.find(".et-pb-upload-button"),x=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview"),j=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--add"),$=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--edit"),T=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--delete"),h=this.$el.find(".et-pb-video-image-button"),f=this.$el.find(".et-pb-gallery-button"),u=this.$el.find(".et-pb-date-time-picker"),m=this.$el.find(".et_font_icon"),w=D.find(".et-validate-number"),C=D.find("form.validate"),y=D.find(".et-pb-option--warning"),S=D.find(".et_pb_email_add_account"),C.length&&(Ve("validation enabled"),C.validate({debug:!0})),c.length)&&c.each((function(){var t=e(this),i=function(){setTimeout((function(){t.attr("data-color-type",t.attr("value").match(/^rgba?/i)?"rgb":"hex")}),1)};i(),t.on("keypress",i),t.wpColorPicker({defaultColor:t.data("default-color"),palettes:""!==et_pb_options.page_color_palette?et_pb_options.page_color_palette.split("|"):et_pb_options.default_color_palette.split("|"),change:function(t,o){var n,a=e(this),s=a.closest(".et-pb-option-container"),l=s.find(".et-pb-reset-setting"),d=a.closest(".et-pb-custom-color-container"),r=s.find(".et-pb-option-preview"),c=a.hasClass("et-pb-color-picker-hex-has-preview"),p=a.closest(".et_pb_background-tab--gradient").length>0,u=o.color.toString().toLowerCase();d.length&&(d.find(".et-pb-custom-color-picker").val(o.color.toString()),s.hasClass("et-pb-option-container--font")&&d.find(".et-pb-custom-color-picker").trigger("change")),n=ve(a).toLowerCase(),s.hasClass("et-pb-option-container--font")||(u!==n?l.length&&l.addClass("et-pb-reset-icon-visible"):(l.length&&l.removeClass("et-pb-reset-icon-visible"),c&&r.addClass("et-pb-option-preview--empty")),c&&""!==u&&r.removeClass("et-pb-option-preview--empty")),c&&r.css({backgroundColor:u}),p&&ye(a),_.has(t,"originalEvent")&&_.has(t.originalEvent,"type")&&"square"===t.originalEvent.type&&(s.find(".button-confirm").css("backgroundColor","".concat(u," !important")),s.hasClass("is-dragging")||s.addClass("is-dragging"),clearTimeout(V),V=setTimeout((function(){b(a),s.find(".button-confirm").css("backgroundColor",""),s.removeClass("is-dragging")}),300)),clearTimeout(U),U=setTimeout((function(){a.trigger("focus")}),300),a.hasClass("et-pb-is-cleared")&&a.removeClass("et-pb-is-cleared"),a.trigger("et_pb_setting:color_picker:change",[u]),i()},clear:function(){e(this).val(et_pb_options.invalid_color),e(this).closest(".et-pb-option-container").find(".et-pb-main-setting").val(""),e(this).siblings(".et-pb-color-picker-hex").trigger("et_pb_setting:color_picker:change",[""])},width:t.closest(".et-pb-option--background").length?660:300,height:190,diviColorpicker:!!t.closest(".et-pb-option--background").length});var o=t.data("default-color")||"",n=t.closest(".et-pb-option-container").find(".et-pb-reset-setting");if(t.hasClass("et-pb-color-picker-hex-has-preview")){var a=t.closest(".et-pb-option-container");a.find(".et-pb-option-preview-button--add, .et-pb-option-preview-button--edit, .et-pb-option-preview").on("click",(function(e){e.stopPropagation(),t.wpColorPicker("open")})),a.find(".et-pb-option-preview-button--delete").on("click",(function(e){e.stopPropagation();var i=ve(t).toLowerCase();t.wpColorPicker("color",i).val(i).addClass("et-pb-is-cleared"),""===i&&a.find(".et-pb-option-preview").removeAttr("style").addClass("et-pb-option-preview--empty")}))}if(!n.length)return!0;var s="".concat(t.val());o.toLowerCase()!==s.toLowerCase()&&n.addClass("et-pb-reset-icon-visible")}));if(p.length&&p.each((function(){var t=e(this),i=t.data("value").split("|"),o=i[0]||"#444444",n=i[2]||1;t.attr("data-opacity",n),t.val(o),t.minicolors({control:"hue",defaultValue:e(this).data("default-color")||"",opacity:!0,changeDelay:200,show:function(){t.minicolors("opacity",t.data("opacity"))},change:function(i,o){if(i){var n,a=t.minicolors("rgbObject"),s=e(t.data("field")),l=[];l.push(i),l.push("".concat(a.r,", ").concat(a.g,", ").concat(a.b)),l.push(o),n=l.join("|"),s.length&&s.val(n)}},theme:"bootstrap"})})),g.length&&o(g),j.length||$.length||x){var N=function(t){t.preventDefault(),t.stopPropagation(),e(this).hasClass("et-pb-option-preview")&&!e(this).hasClass("et-pb-option-preview--empty")&&"video"===e(this).siblings(".button").attr("data-type")||Ge(e(this))||e(this).closest(".et-pb-option").find(".et-pb-upload-button").trigger("click")};x.on("click",N),j.on("click",N),$.on("click",N)}if(T.length&&T.on("click",(function(t){if(t.preventDefault(),t.stopPropagation(),!Ge(e(this))){var i=e(this).closest(".et-pb-option"),o=i.find(".et-pb-upload-field"),n=i.find(".et-pb-option-preview");o.val(""),n.addClass("et-pb-option-preview--empty").find(".et-pb-preview-content").remove()}})),h.length&&r(h),f.length&&l(f),S.length&&(A=S,M=this,L=window.et_pb_module_field_dependencies.et_pb_signup,A.each((function(){var t=e(this),i=t.siblings("select"),o=t.siblings(".et_pb_email_force_fetch_lists"),n=t.siblings(".et_pb_email_remove_account"),a=e(this).siblings("input").closest(".et-pb-option").data("option_name"),s=_.keys(L[a].affects);s=_.map(s,(function(e){return"#et_pb_".concat(e)})).join(", "),e(this).closest(".et-pb-options-tab").find(s).one("et-pb-option-field-shown",(function(){!function(t,i,o){t.on("click",(function(){e(this).hasClass("et_pb_email_submit")?(v.trigger("et-pb-loading:started"),function(t,i){var o=d(t),n=t.closest(".et-pb-option--select_with_option_groups").parent().find('[class*="et_pb_email_'.concat(o,'"]:visible')),a={},s="et_builder_email_add_account_nonce";function l(e){t.val(t.data("previous_value")).trigger("change"),n.val(""),v.trigger("et-pb-loading:ended"),"error"in e&&e.error&&alert(e.message)}n.each((function(){var t,i,o=e(this).attr("id").replace("pb_","");i="_list",(t=o).substr(t.length-i.length,t.length)!==i&&(a[o]=e(this).val())})),a.action="et_builder_email_add_account",a[s]=et_pb_options.et_builder_email_add_account_nonce,a.et_bb=!0,a.et_provider=o,e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:a}).done((function(e,o,n){e=JSON.parse(e),t.html(_.template(e.accounts_list).bind(i)(i.model.attributes)),l(e)})).fail(l)}(i,o)):i.val(i.data("previous_value")).trigger("change")})),t.appendTo(t.parent())}(e(this).siblings("button"),i,M)})),o.data("original_text",o.text()),n.data("original_text",n.text()),i.on("change",(function(){var a=e(this).val();if("add_new_account"!==a||i.parent().hasClass("new_account_in_progress"))if("fetch_lists"!==a||i.parent().hasClass("fetch_lists_in_progress"))if("remove_account"!==a||i.parent().hasClass("remove_account_in_progress"))i.parent().removeClass("new_account_in_progress remove_account_in_progress fetch_lists_in_progress"),M.$el.prev().find(".et-pb-modal-save, .et-pb-modal-save-template").css("cursor",""),"none"===a?i.parent().addClass("no_account_selected"):i.parent().removeClass("no_account_selected"),t.show(),n.text(n.data("original_text")),o.text(o.data("original_text")),a&&"none"!==a?(n.show(),o.show()):(n.hide(),o.hide()),t.siblings("span").remove(),t.siblings("p").show(),i.show();else{i.parent().addClass("remove_account_in_progress"),t.hide().siblings("p").hide(),n.text(n.data("confirm_text")),o.text(o.data("cancel_text"));var s="".concat(i.data("confirm_remove_text")," ").concat(i.data("selected_account"));e("<span>").text(s).insertAfter(i).addClass("et_pb_email_account_message"),i.hide()}else i.parent().addClass("fetch_lists_in_progress"),v.trigger("et-pb-loading:started"),function(t,i,o){var n=d(t),a=t.data("selected_account");function s(e){t.val(t.data("previous_value")).trigger("change"),i.removeClass("fetch_lists_in_progress"),v.trigger("et-pb-loading:ended"),"error"in e&&e.error&&alert(e.message)}e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_builder_email_get_lists",et_builder_email_fetch_lists_nonce:et_pb_options.et_builder_email_fetch_lists_nonce,et_provider:n,et_account:a,et_bb:!0}}).done((function(e,i,n){e=JSON.parse(e),t.html(_.template(e.accounts_list).bind(o)(o.model.attributes)),s(e)})).fail(s)}(i,t,M);else i.parent().addClass("new_account_in_progress"),e("<span>").text(i.data("adding_new_account_text")).insertAfter(i).addClass("et_pb_email_account_message"),t.hide().siblings().not("span").hide(),i.siblings("#et_pb_aweber_list").length>0&&window.open("https://auth.aweber.com/1.0/oauth/authorize_app/b17f3351")})),t.on("click",(function(){M.$el.prev().find(".et-pb-modal-save, .et-pb-modal-save-template").css("cursor","not-allowed"),i.data("previous_value",i.val()).val("add_new_account").trigger("change")})),o.on("click",(function(){if(i.parent().hasClass("remove_account_in_progress"))i.val(i.data("previous_value")).trigger("change");else{var e=i.find(":selected").parent().attr("label");i.data("selected_account",e),i.data("previous_value",i.val()).val("fetch_lists").trigger("change")}})),n.on("click",(function(){if(i.parent().hasClass("remove_account_in_progress"))return v.trigger("et-pb-loading:started"),void function(t,i){var o=d(t),n=t.data("selected_account");function a(e){t.val("none").trigger("change"),v.trigger("et-pb-loading:ended"),"error"in e&&e.error&&alert(e.message)}e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_builder_email_remove_account",et_builder_email_remove_account_nonce:et_pb_options.et_builder_email_remove_account_nonce,et_provider:o,et_account:n,et_bb:!0}}).done((function(e,o,n){e=JSON.parse(e),t.html(_.template(e.accounts_list).bind(i)(i.model.attributes)),a(e)})).fail(a)}(i,M);var t=i.find(":selected").parent().attr("label");t&&(i.data("selected_account",t),i.data("previous_value",i.val()).val("remove_account").trigger("change"))})),setTimeout((function(){i.trigger("change")}),200)}))),u.length&&u.datetimepicker({dateFormat:"yy-mm-dd",beforeShow:function(){var t=e("#ui-datepicker-div");t.closest(".et-fb-option--date-picker").length<1&&t.wrap('<span class="et-fb-option--date-picker"></span>')}}),w.length&&w.on("keyup",(function(){var t=e(this);(t.val()<0||!e.isNumeric(t.val())&&""!==t.val())&&t.val(0),t.val()>100&&t.val(100),""!==t.val()&&t.val(Math.round(t.val()))})),m.length){var B=this;m.each((function(){var t,i,o,n=e(this),a=n.siblings(".et-pb-font-icon"),s=a.val().trim(),l=n.find("li"),_="et_active";function d(){""!==s&&(-1!==(s=(s=s.replace("[","%91")).replace("]","%93")).search(/^%%/)?(o=parseInt(s.replace(/%/g,"")),t=n.find("li").eq(o)):t='"'===s?n.find("li").eq(0):n.find('li[data-icon="'.concat(s,'"]')),t.addClass(_),n.is(":visible")&&setTimeout((function(){(i=t.offset().top-n.offset().top)>0&&n.animate({scrollTop:i},0)}),110))}d(),B.$el.find(".et-pb-options-tabs-links").on("et_pb_main_tab:changed",d),l.on("click",(function(){var t=e(this),i=t.index();if(t.hasClass(_))return!1;t.siblings(".".concat(_)).removeClass(_).end().addClass(_),i="%%".concat(i,"%%"),a.val(i)}))}))}return t.length&&t.each((function(){var t=e(this),o=t.attr("id");if((n=t.closest(".et-pb-option")).hasClass("et-pb-option-advanced-module")&&(R=!0),R){var l=k.generateNewId();E.view_cid=l,n.hide(),t.attr("id","et_pb_content_main"),a=new s.AdvancedModuleSettingsView({model:E,el:E.$el.find(".et-pb-option-advanced-module-settings"),attributes:{cid:l,value_changes:E.model.get("value_changes")}}),k.addView(l,a),n.before(a.render()),""!==t.html()&&(a.generateAdvancedSortableItems(t.html(),E.$el.find(".et-pb-option-advanced-module-settings").data("module_type")),v.trigger("et-advanced-module:updated_order",E.$el))}else i=t.closest(".et-pb-option-container"),I[o]=t.html(),t.remove(),i.prepend(O.find("#".concat(o,"_editor")).html()),setTimeout((function(){void 0!==window.switchEditors&&window.switchEditors.go(o,ie());var e="et_pb_content"!==o?"load_secondary_editor":"";ae(o,I[o],e),window.wpActiveEditor=o}),100)})),y.length&&y.each((function(){var t=e(this),i=t.find(".et-pb-option-warning"),o=i.attr("data-display_if"),n=i.attr("data-name");et_pb_options[n]===o&&t.addClass("et-pb-option--warning-active")})),this.renderMap(),pe(this.$el,P),R||setTimeout((function(){D.find("select, input, textarea, radio").eq(0).trigger("focus")}),1),this},removeModule:function(){this.remove()},is_latlng:function(e){var t=e.split(","),i=!_.isUndefined(t[0])&&parseFloat(t[0]),o=!_.isUndefined(t[1])&&parseFloat(t[1]);return!("undefined"==typeof google||!i||_.isNaN(i)||!o||_.isNaN(o))&&new google.maps.LatLng(i,o)},renderMap:function(){var e=this,t=this.$el.find(".et-pb-map");if("undefined"!=typeof google&&t.length){var i=this.view_cid,o=this.$el.find(".et_pb_address"),n=this.$el.find(".et_pb_address_lat"),a=this.$el.find(".et_pb_address_lng"),s=this.$el.find(".et_pb_find_address"),l=this.$el.find(".et_pb_zoom_level"),d=new google.maps.Geocoder,r={},c=isNaN(parseInt(l.val()))?18:parseInt(l.val()),p=function(e){t.map.setCenter(e)},b=function(){t.map.setZoom(c)};o.on("blur",(function(){var t=o.val();t.length<=0||d.geocode({address:t},(function(i,s){if(s==google.maps.GeocoderStatus.OK){var l=i[0],_=l.geometry.location,d=e.is_latlng(t);d&&(_=d),isNaN(_.lat())||isNaN(_.lng())?alert(et_pb_options.map_pin_address_invalid):(o.val(l.formatted_address),n.val(_.lat()),a.val(_.lng()),p(_))}else alert("".concat(et_pb_options.geocode_error,": ").concat(s))}))})),s.on("click",(function(e){e.preventDefault()})),l.on("blur",b),setTimeout((function(){t.map=new google.maps.Map(t[0],{zoom:c,mapTypeId:google.maps.MapTypeId.ROADMAP}),""!==n.val()&&""!==a.val()&&p(new google.maps.LatLng(n.val(),a.val())),""!==l&&b(),setTimeout((function(){var e=k.getChildViews(i);_.size(e)&&_.each(e,(function(e,i){_.isUndefined(e.model.get("et_pb_pin_address_lat"))||_.isUndefined(e.model.get("et_pb_pin_address_lng"))||(r[i]=new google.maps.Marker({map:t.map,position:new google.maps.LatLng(parseFloat(e.model.get("et_pb_pin_address_lat")),parseFloat(e.model.get("et_pb_pin_address_lng"))),title:e.model.get("et_pb_title"),icon:{url:"".concat(et_pb_options.images_uri,"/marker.png"),size:new google.maps.Size(46,43),anchor:new google.maps.Point(16,43)},shape:{coord:[1,1,46,43],type:"rect"}}))}))}),500),google.maps.event.addListener(t.map,"center_changed",(function(){var e=t.map.getCenter();n.val(e.lat()),a.val(e.lng())})),google.maps.event.addListener(t.map,"zoom_changed",(function(){var e=t.map.getZoom();l.val(e)}))}),200)}}}),s.AdvancedModuleSettingsView=window.wp.Backbone.View.extend({initialize:function(){this.listenTo(v,"et-advanced-module:updated",this.generateContent),this.listenTo(v,"et-modal-view-removed",this.removeModule),this.module_type=this.$el.data("module_type"),s.Events=v,this.child_views=[],this.$el.attr("data-cid",this.attributes.cid),this.$sortable_options=this.$el.find(".et-pb-sortable-options"),this.$content_textarea=this.$el.siblings(".et-pb-option-main-content").find("#et_pb_content_main"),_.includes(["et_pb_column","et_pb_column_inner"],this.module_type)?this.$sortable_options.addClass("et-pb-sortable-options--disabled"):this.$sortable_options.sortable({axis:"y",cancel:".et-pb-advanced-setting-remove, .et-pb-advanced-setting-options",update:function(e,t){v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:updated_order")}}),this.$add_sortable_item=this.$el.find(".et-pb-add-sortable-option").addClass("et-pb-add-sortable-initial")},events:{"click .et-pb-add-sortable-option":"addModule","click .et-pb-advanced-setting-clone":"cloneModule"},render:function(){return this},addModule:function(e){e.preventDefault(),this.model.collection.add([{type:"module",module_type:this.module_type,cid:k.generateNewId(),view:this,created:"manually",mode:"advanced",parent:this.attributes.cid,parent_cid:this.model.model.attributes.cid}],{update_shortcodes:"false"}),this.$add_sortable_item.removeClass("et-pb-add-sortable-initial"),v.trigger("et-advanced-module:updated_order")},cloneModule:function(t){t.preventDefault();var i=e(t.target).closest("li").data("cid"),o=V.collection.find((function(e){return e.get("cid")==i})),n=_.clone(o.attributes);n.created="manually",n.cloned_cid=i,n.cid=k.generateNewId(),this.model.collection.add(n),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:saved"),v.trigger("et-advanced-module:updated_order")},generateContent:function(){var t="";this.$sortable_options.find("li").each((function(){var i=e(this);t+=V.generateModuleShortcode(i,!1)})),t=t.replace(/%22/g,"^^"),this.$content_textarea.html(t),this.$sortable_options.find("li").length?this.$add_sortable_item.removeClass("et-pb-add-sortable-initial"):this.$add_sortable_item.addClass("et-pb-add-sortable-initial")},generateAdvancedSortableItems:function(t,i){var o=this,n=V.getShortCodeChildTags(),a=window.wp.shortcode.regexp(n),s=V.wp_regexp_not_global(n),l=t.match(a);""!==t&&this.$add_sortable_item.removeClass("et-pb-add-sortable-initial"),_.each(l,(function(t,n){var l,d=t.match(s),r=d[2],c=""!==d[3]?window.wp.shortcode.attrs("".concat(d[3]," ").concat(n)):"",p=d[5],b=k.generateNewId(),u={},g=void 0!==p&&""!==p&&p.match(a),h=et_pb_options.et_pb_module_settings_migrations.name_changes,f=_.includes(["et_pb_column","et_pb_column_inner"],r);l={type:"module",module_type:i,cid:b,view:o,created:"auto",mode:"advanced",parent:o.attributes.cid,parent_cid:o.model.model.attributes.cid};var m=k.getView(o.model.model.attributes.cid);if(f){var v=e(m.$el).find(".et-pb-column");_.isUndefined(v[n])||(l.column_cid=e(v[n]).data("cid"))}if(_.isObject(c.named)){for(var w in c.named){var y,C="admin_label"!==w?"et_pb_".concat(w):w;f&&"et_pb_type"===C&&(C="layout"),y=(y=c.named[w]).replace(/\^\^/g,'"'),u[C]=y}l.et_pb_content=p,l=_.extend(l,u)}g||(l.et_pb_content=p),_.isEmpty(h)||_.isEmpty(h[o.module_type])||_.forEach(h[o.module_type],(function(e,t){_.isUndefined(l["et_pb_".concat(t)])||(l["et_pb_".concat(e)]=l["et_pb_".concat(t)],delete l["et_pb_".concat(t)])})),_.isUndefined(o.attributes.value_changes)||_.isUndefined(o.attributes.value_changes[n])||_.forEach(o.attributes.value_changes[n],(function(e,t){l["et_pb_".concat(t)]=e})),o.model.collection.add([l],{update_shortcodes:"false"})}))},removeModule:function(){_.each(this.child_views,(function(e){e.removeView()})),this.remove()}}),s.AdvancedModuleSettingView=window.wp.Backbone.View.extend({tagName:"li",initialize:function(){this.template=_.template(e("#et-builder-advanced-setting").html())},events:{"click .et-pb-advanced-setting-options":"showSettings","click .et-pb-advanced-setting-remove":"removeView"},render:function(){var e;return this.$el.html(this.template(this.model.attributes)),e=new s.AdvancedModuleSettingTitleView({model:this.model,view:this}),this.$el.prepend(e.render().el),this.child_view=e,void 0!==this.model.get("cloned_cid")&&""!==this.model.get("cloned_cid")||this.showSettings(),this},showSettings:function(t){var i;t&&t.preventDefault(),i=new s.AdvancedModuleSettingEditViewContainer({view:this,attributes:{show_settings_clicked:!!t,"data-module_type":this.model.get("module_type")}}),e(".et_pb_modal_settings_container").after(i.render().el),Re()},removeView:function(e){e&&e.preventDefault(),_.isUndefined(this.child_view)||this.child_view.remove(),this.remove(),this.model.destroy(),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:updated_order")}}),s.AdvancedModuleSettingTitleView=window.wp.Backbone.View.extend({tagName:"span",className:"et-sortable-title",initialize:function(){var t="et_pb_column_inner"===this.model.get("module_type")?"et_pb_column":this.model.get("module_type"),i="#et-builder-advanced-setting-".concat(t,"-title");this.template=_.template(e(i).html()),this.listenTo(v,"et-advanced-module:updated",this.render)},render:function(){return _.isUndefined(this.model.attributes.et_pb_admin_title)||""!==this.model.attributes.et_pb_admin_title||delete this.model.attributes.et_pb_admin_title,this.$el.html(this.template(this.model.attributes)),this}}),s.AdvancedModuleSettingEditViewContainer=window.wp.Backbone.View.extend({className:"et_pb_modal_settings_container",initialize:function(){this.template=_.template(e("#et-builder-advanced-setting-edit").html()),this.model=this.options.view.model,this.listenTo(v,"et-modal-view-removed",this.removeView)},events:{"click .et-pb-modal-save":"saveSettings","click .et-pb-modal-close":"removeView"},is_latlng:function(e){var t=e.split(","),i=!_.isUndefined(t[0])&&parseFloat(t[0]),o=!_.isUndefined(t[1])&&parseFloat(t[1]);return!(!i||_.isNaN(i)||!o||_.isNaN(o))&&new google.maps.LatLng(i,o)},render:function(){var t,i,n,a,d,c,p,u,g,h,f,m,v,w,y,k=this.model.attributes.cid,C=this;(this.$el.html(this.template()),this.$el.addClass("et_pb_modal_settings_container_step2"),this.$el.attr("data-parent-cid",k),("auto"!==this.model.get("created")||this.attributes.show_settings_clicked)&&(t=new s.AdvancedModuleSettingEditView({view:this}),this.$el.append(t.render().el),this.child_view=t),this.model.set("et_pb__builder_version",et_pb_options.product_version),s.Events.trigger("et-advanced-module-settings:render",this),i=this.$el.find(".et-pb-color-picker-hex"),g=this.$el.find(".et-builder-color-picker-alpha"),i.length)&&i.each((function(){var t=e(this);if(t.wpColorPicker({defaultColor:t.data("default-color"),palettes:""!==et_pb_options.page_color_palette?et_pb_options.page_color_palette.split("|"):et_pb_options.default_color_palette.split("|"),change:function(t,i){var o=e(this),n=o.closest(".et-pb-option-container"),a=n.find(".et-pb-reset-setting"),s=o.closest(".et-pb-custom-color-container"),l=n.find(".et-pb-option-preview"),d=o.hasClass("et-pb-color-picker-hex-has-preview"),r=o.closest(".et_pb_background-tab--gradient").length>0,c=i.color.toString().toLowerCase();s.length&&s.find(".et-pb-custom-color-picker").val(i.color.toString()),(a.length||d||r)&&(c!==ve(o).toLowerCase()?a.addClass("et-pb-reset-icon-visible"):(a.removeClass("et-pb-reset-icon-visible"),d&&l.addClass("et-pb-option-preview--empty")),d&&""!==c&&l.removeClass("et-pb-option-preview--empty"),d&&l.css({backgroundColor:c}),r&&ye(o),(d||r)&&(_.has(t,"originalEvent")&&_.has(t.originalEvent,"type")&&"square"===t.originalEvent.type&&(n.find(".button-confirm").css("backgroundColor","".concat(c," !important")),n.hasClass("is-dragging")||n.addClass("is-dragging"),clearTimeout(w),w=setTimeout((function(){b(o),n.find(".button-confirm").css("backgroundColor",""),n.removeClass("is-dragging")}),300)),clearTimeout(y),y=setTimeout((function(){o.trigger("focus")}),300)),o.hasClass("et-pb-is-cleared")&&o.removeClass("et-pb-is-cleared"),o.trigger("et_pb_setting:color_picker:change",[c]))},width:t.closest(".et-pb-option--background").length?660:300,height:190,diviColorpicker:!!t.closest(".et-pb-option--background").length}),t.hasClass("et-pb-color-picker-hex-has-preview")){var i=t.closest(".et-pb-option-container");i.find(".et-pb-option-preview-button--add, .et-pb-option-preview-button--edit, .et-pb-option-preview").on("click",(function(e){e.stopPropagation(),t.wpColorPicker("open")})),i.find(".et-pb-option-preview-button--delete").on("click",(function(e){e.stopPropagation();var o=ve(t).toLowerCase();t.wpColorPicker("color",o).val(o).addClass("et-pb-is-cleared"),""===o&&i.find(".et-pb-option-preview").removeAttr("style").addClass("et-pb-option-preview--empty")}))}}));if(g.length&&g.each((function(){var t=e(this),i=t.data("value").split("|"),o=i[0]||"#444444",n=i[2]||1;t.attr("data-opacity",n),t.val(o),t.minicolors({control:"hue",defaultValue:e(this).data("default-color")||"",opacity:!0,changeDelay:200,show:function(){t.minicolors("opacity",t.data("opacity"))},change:function(i,o){if(i){var n,a=t.minicolors("rgbObject"),s=e(t.data("field")),l=[];l.push(i),l.push("".concat(a.r,", ").concat(a.g,", ").concat(a.b)),l.push(o),n=l.join("|"),s.length&&s.val(n)}},theme:"bootstrap"})})),n=this.$el.find(".et-pb-upload-button"),u=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview"),f=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--add"),m=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--edit"),v=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--delete"),n.length&&o(n),f.length||m.length||u.length){var x=function(t){t.preventDefault(),t.stopPropagation(),e(this).hasClass("et-pb-option-preview")&&!e(this).hasClass("et-pb-option-preview--empty")||e(this).closest(".et-pb-option").find(".et-pb-upload-button").trigger("click")};u.on("click",x),f.on("click",x),m.on("click",x)}if(v.length&&v.on("click",(function(t){t.preventDefault(),t.stopPropagation();var i=e(this).closest(".et-pb-option"),o=i.find(".et-pb-upload-field"),n=i.find(".et-pb-option-preview");o.val(""),n.addClass("et-pb-option-preview--empty").find(".et-pb-preview-content").remove()})),(a=this.$el.find(".et-pb-video-image-button")).length&&r(a),d=this.$el.find(".et-pb-map"),"undefined"!=typeof google&&d.length){var j,T,V=this.$el.find(".et_pb_pin_address"),U=this.$el.find(".et_pb_pin_address_lat"),O=this.$el.find(".et_pb_pin_address_lng"),A=this.$el.find(".et_pb_find_address"),M=this.$el.find(".et_pb_zoom_level"),L=new google.maps.Geocoder,E=function(e){T.setPosition(e),j.setCenter(e)};V.on("change",(function(){var e=V.val().trim();e.length<=0||L.geocode({address:e},(function(t,i){if(i==google.maps.GeocoderStatus.OK){var o=t[0],n=o.geometry.location,a=C.is_latlng(e);a&&(n=a),isNaN(n.lat())||isNaN(n.lng())?alert(et_pb_options.map_pin_address_invalid):(V.val(o.formatted_address),U.val(n.lat()),O.val(n.lng()),E(n))}else alert("".concat(et_pb_options.geocode_error,": ").concat(i))}))})),A.on("click",(function(e){e.preventDefault()})),setTimeout((function(){j=new google.maps.Map(d[0],{zoom:parseInt(M.val()),mapTypeId:google.maps.MapTypeId.ROADMAP}),T=new google.maps.Marker({map:j,draggable:!0,icon:{url:"".concat(et_pb_options.images_uri,"/marker.png"),size:new google.maps.Size(46,43),anchor:new google.maps.Point(16,43)},shape:{coord:[1,1,46,43],type:"rect"}}),google.maps.event.addListener(T,"dragend",(function(){var e=T.getPosition();U.val(e.lat()),O.val(e.lng()),E(e);var t=new google.maps.LatLng(e.lat(),e.lng());L.geocode({latLng:t},(function(e,t){t==google.maps.GeocoderStatus.OK?e[0]?V.val(e[0].formatted_address):alert(et_pb_options.no_results):alert("".concat(et_pb_options.geocode_error_2,": ").concat(t))}))})),""!=U.val()&&""!=O.val()&&E(new google.maps.LatLng(U.val(),O.val()))}),200)}if((h=this.$el.find(".et-pb-gallery-button")).length&&l(h),(c=this.$el.find(".et-pb-social-network")).length){var D=this.$el.find(".reset-default-color"),I=this.$el.find("#et_pb_background_color");D.length&&D.on("click",(function(){var e=D.parents(".et-pb-main-settings");c=e.find(".et-pb-social-network"),(I=e.find("#et_pb_background_color")).length&&(I.wpColorPicker("color",c.find("option:selected").data("color")),D.css("display","none"))})),c.on("change",(function(){var e=c.parents(".et-pb-main-settings");if(!c.data("is_rendering_setting_view")&&c.val().length){var t=e.find("#et_pb_content"),i=e.find("#et_pb_background_color");if(t.length&&t.val(c.find("option:selected").text()),i.length){var o=c.find("option:selected").data("color");i.val(o).wpColorPicker("color",o),i.closest(".et-pb-option-container").find(".et-pb-option-preview").css({backgroundColor:o})}}})),I.val()!==c.find("option:selected").data("color")&&D.css("display","inline")}if((p=this.$el.find(".et_font_icon")).length){var P=this;p.each((function(){var t,i,o,n=e(this),a=n.siblings(".et-pb-font-icon"),s=a.val().trim(),l=n.find("li"),_="et_active";function d(){""!==s&&(-1!==s.search(/^%%/)?(o=parseInt(s.replace(/%/g,"")),t=n.find("li").eq(o)):t=n.find('li[data-icon="'.concat(s,'"]')),t.addClass(_),n.is(":visible")&&setTimeout((function(){(i=t.offset().top-n.offset().top)>0&&n.animate({scrollTop:i},0)}),110))}d(),P.$el.find(".et-pb-options-tabs-links").on("et_pb_main_tab:changed",d),l.on("click",(function(){var t=e(this),i=t.index();if(t.hasClass(_))return!1;t.siblings(".".concat(_)).removeClass(_).end().addClass(_),i="%%".concat(i,"%%"),a.val(i)}))}))}return function(t,i){var o=t.find(".et-pb-options-tab-advanced"),n=o.find(".et-pb-main-setting"),a=(e(".et_pb_modal_settings_container:not(.et_pb_modal_settings_container_step2)").find(".et-pb-options-tab-advanced"),$.findWhere({cid:i})),s=_.includes(["et_pb_column","et_pb_column_inner"],S(a,"attributes.module_type","")),l=function(t){var i=me(e(t)),o=e(t).data(i);return _.isArray(o)&&_.isObject(o[1])};if(s)return;o.length&&n.each((function(){var t=e(this),i=t.attr("id"),o="",n="";if(t.hasClass("et-pb-range")){var s=t.siblings(".et-pb-range-input");n=s.data(o)||"",s.each((function(){var t=e(this),i=t.attr("id"),s=void 0!==t.data("device")?t.data("device"):"all",_=e("#".concat(i));if(_.length&&!l(t)){if(a.attributes.module_defaults=a.attributes.module_defaults||[],a.attributes.module_defaults[i]=_.val(),"all"!==s){var d=t.siblings(".et-pb-main-setting.et_pb_setting_mobile_".concat(s));d.data("default_inherited",_.val()),d.data("default",_.val())}o=me(_),n=_.data(o)||"",t.data("default_inherited",n),t.data("default",_.val())}}))}else if(t.closest(".et-presets").length);else{var _=e("#".concat(i));if(_.length){var d=_.val();a.attributes.module_defaults=a.attributes.module_defaults||[],a.attributes.module_defaults[i]=d,o=me(_),n=_.data(o)||"",t.data("default_inherited",n),t.data(o,d)}}}))}(this.$el,k),pe(this.$el,k),this},removeView:function(e){e&&e.preventDefault(),this.$el.find("#et_pb_content")&&e&&se("et_pb_content"),Te(this),this.child_view&&this.child_view.remove(),this.remove()},saveSettings:function(t){var i=this,o={},n=this.model.get("module_defaults")||"";if(t.preventDefault(),this.$("input, select, textarea").each((function(){var t,a=e(this),s=a.attr("id"),l=[];if(a.is(":checkbox")&&(s=a.attr("name")),void 0===s||-1!==s.indexOf("qt_")&&"button"===a.attr("type"))return!0;if(a.is(":checkbox")||(s=a.attr("id").replace("data.","")),a.is(":checkbox")&&void 0!==o[s])return!0;if(t=a.is("#et_pb_content")?ee("et_pb_content"):a.val(),a.is(".et-pb-text-align-select")&&!a.parent().find(".et_text_align_active").length)return!0;if(_.isEmpty(a.data("check_attr_default"))||"yes"!==a.data("check_attr_default")){if(""!==n&&void 0!==n[s]&&n[s]===t){if(!a.hasClass("yes_no_button"))return i.model.unset(s),!0;delete n[s],i.model.set("module_defaults",n)}}else if(we(a))return i.model.unset(s),!0;a.is(":checkbox")&&void 0===o[s]&&(a.closest(".et-pb-option-container").find('[name="'.concat(s,'"]:checked')).each((function(){l.push(e(this).val())})),t=l.join(",")),a.closest(".et-pb-custom-css-option").length&&(t=""!==t?t.replace(/(?:\r\n|\r|\n)/g,"||"):""),o[s]=t})),_.isUndefined(o.et_pb_pin_address)||_.isUndefined(o.et_pb_pin_address_lat)||_.isUndefined(o.et_pb_pin_address_lng)||""!==o.et_pb_pin_address&&""!==o.et_pb_pin_address_lat&&""!==o.et_pb_pin_address_lng){var a=k.getView(i.model.attributes.view.model.model.attributes.cid);if(_.isUndefined(a.model.get("value_changes"))||a.model.unset("value_changes"),!_.isUndefined(i.model.attributes.column_cid))k.getView(i.model.attributes.column_cid).model.set(o,{silent:!0});this.model.set(o,{silent:!0}),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:saved"),se("et_pb_content"),this.removeView()}else alert(et_pb_options.map_pin_address_error)}}),s.AdvancedModuleSettingEditView=window.wp.Backbone.View.extend({className:"et_pb_module_settings",initialize:function(){this.model=this.options.view.options.view.model;var t="et_pb_column_inner"===this.model.get("module_type")?"et_pb_column":this.model.get("module_type");this.template=_.template(e("#et-builder-advanced-setting-".concat(t)).html())},events:{},render:function(){var e,t,i=this.$el;if(this.$el.html(this.template({data:this.model.toJSON()})),this.$el.find(".et-pb-main-settings").addClass("et-pb-main-settings-advanced"),(e=this.$el.find("div#et_pb_content")).length){t=e.closest(".et-pb-option-container");var o=e.html();e.remove(),t.prepend(O.find("#et_pb_content_editor").html()),setTimeout((function(){void 0!==window.switchEditors&&window.switchEditors.go("et_pb_content",ie()),ae("et_pb_content",o),window.wpActiveEditor="et_pb_content"}),300)}return setTimeout((function(){i.find("select, input, textarea, radio").eq(0).trigger("focus")}),1),this}}),s.BlockModuleView=window.wp.Backbone.View.extend({className:function(){var e="et_pb_module_block";return void 0!==this.model.attributes.className&&(e+=this.model.attributes.className),e},template:_.template(e("#et-builder-block-module-template").html()),initialize:function(){this.listenTo(this.model,"change:admin_label",this.renameModule),this.listenTo(this.model,"change:et_pb_disabled",this.toggleDisabledClass),this.listenTo(this.model,"change:et_pb_global_module",this.removeGlobal)},events:{"click .et-pb-settings":"showSettings","click .et-pb-clone-module":"cloneModule","click .et-pb-remove-module":"removeModule","click .et-pb-unlock":"unlockModule",contextmenu:"showRightClickOptions","click.et-pb-right-click":"hideRightClickOptions","click.et-ab-testing":"setABTesting"},render:function(){var e=k.getParentViews(this.model.get("parent"));return this.$el.html(this.template(this.model.attributes)),(void 0!==this.model.attributes.et_pb_global_module||void 0!==this.model.attributes.et_pb_template_type&&"module"===this.model.attributes.et_pb_template_type&&"global"===et_pb_options.is_global_template)&&this.$el.addClass("et_pb_global"),void 0!==this.model.get("et_pb_locked")&&"on"===this.model.get("et_pb_locked")&&_.each(e,(function(e){e.$el.addClass("et_pb_children_locked")})),void 0!==this.model.get("et_pb_parent_locked")&&"on"===this.model.get("et_pb_parent_locked")&&this.$el.addClass("et_pb_parent_locked"),J.is_active()&&(J.is_subject(this.model)&&(this.$el.addClass("et_pb_ab_subject"),J.set_subject_rank_coloring(this)),J.is_goal(this.model)&&this.$el.addClass("et_pb_ab_goal"),J.is_user_has_permission(this.model.get("cid"),"module",this.model)||this.$el.addClass("et_pb_ab_no_permission")),"removed"===this.model.get("component_status")||(k.isModuleFullwidth(this.model.get("module_type"))&&this.$el.addClass("et_pb_fullwidth_module"),void 0!==this.model.get("pasted_module")&&this.model.get("pasted_module")&&Y(this.$el)),this},cloneModule:function(e){var t,i="",o={model:this.model,view:this.$el,view_event:e};e.preventDefault(),V.isLoading||J.is_selecting()||this.isModuleLocked()||(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"module")?((this.$el.closest(".et_pb_section.et_pb_global").length||this.$el.closest(".et_pb_row.et_pb_global").length)&&""===et_pb_options.template_post_id&&(i=Pe(this)),t=new s.RightClickOptionsView(o,!0),V.allowHistorySaving("cloned","module",this.model.get("admin_label")),t.copy(e),t.pasteAfter(e),""!==i&&Ie(i)):J.alert("has_no_permission"))},renameModule:function(){this.$(".et-pb-module-title").html(this.model.get("admin_label"))},removeGlobal:function(){this.isModuleLocked()||void 0===this.model.get("et_pb_global_module")&&this.$el.removeClass("et_pb_global")},toggleDisabledClass:function(){void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")?this.$el.addClass("et_pb_disabled"):this.$el.removeClass("et_pb_disabled")},showSettings:function(t){var o=this,n={model:this.model,collection:this.collection,attributes:{"data-open_view":"module_settings"},triggered_by_right_click:this.triggered_by_right_click,do_preview:this.do_preview};if(void 0!==t&&t.preventDefault(),i(),!this.isModuleLocked()&&!V.isLoading&&!J.is_selecting())if(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"module")){if(void 0!==this.model.get("et_pb_global_module")&&""!==this.model.get("et_pb_global_module"))!function(t){var i,o=t.model.get("et_pb_global_module"),n="html"===ie()?"skip":"apply";e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_get_global_module",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_global_id:o,et_global_autop:n},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){v.trigger("et-pb-loading:ended")},success:function(n){if(!n||n.error)k.removeGlobalAttributes(t);else{var a=V.getShortCodeParentTags(),l=window.wp.shortcode.regexp(a),d=V.wp_regexp_not_global(a),r=qe(n.shortcode).match(l),c=n.sync_status,p="updated"===c?JSON.parse(n.excluded_options):[];"updated"===c?h[o]=0<p.length?p:[]:f[o]=[],_.each(r,(function(i,n){var a=i.match(d),s=a[2],r=""!==a[3]?window.wp.shortcode.attrs(a[3]):"",p=a[5],b=(void 0!==p&&""!==p&&p.match(l),r.named.saved_tabs||t.model.get("et_pb_saved_tabs")),u="updated"!==c&&"all"!==b&&-1===b.indexOf("general"),g="updated"===c?-1===h[o].indexOf("et_pb_content_field"):""!==b&&(-1!==b.indexOf("general")||"all"===b);if("all"===b&&"updated"!==c&&(h[o]=[],c="updated"),_.isObject(r.named))for(var m in r.named)if("template_type"!==m&&("admin_label"!==m||"admin_label"===m&&!u)){if("updated"===c&&-1!==h[o].indexOf(m))continue;var v="admin_label"!==m?"et_pb_".concat(m):m;""!==m&&t.model.set(v,r.named[m],{silent:!0}),"updated"!==c&&f[o].push(m)}if(g){var w="et_pb_content",y=V.getShortCodeRawContentTags();e.inArray(s,y)>-1&&(w="et_pb_raw_content",p=p.replace(/<!-- \[et_pb_line_break_holder\] -->/g,"\n")),t.model.set(w,p,{silent:!0}),"updated"!==c&&f[o].push("et_pb_content_field")}"updated"!==c&&t.model.set("legacy_synced_options",f[o],{silent:!0})}))}i=new s.ModalView(t),e("body").append(i.render().el),!0===t.triggered_by_right_click&&!0===t.do_preview&&e(".et-pb-modal-preview-template").trigger("click"),n&&!n.error&&(e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal et_pb_modal_selective_sync"),Je(e(".et_pb_modal_settings_container"),o))}})}(n),this.triggered_by_right_click=void 0,this.do_preview=void 0;else{var a=new s.ModalView(n).render();if(!1===a)return C(!0),setTimeout((function(){o.showSettings()}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(a.el)}Re(),(void 0!==this.model.get("et_pb_global_parent")&&""!==this.model.get("et_pb_global_parent")||k.getView(this.model.get("cid")).$el.closest(".et_pb_global").length)&&(e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal"),"module"===et_pb_options.global_module_type&&(Je(e(".et_pb_modal_settings_container"),et_pb_options.template_post_id),e(".et_pb_modal_settings_container").addClass("et_pb_modal_selective_sync")))}else J.alert("has_no_permission")},removeModule:function(e){var t="";if(!this.isModuleLocked()&&!V.isLoading&&(!J.is_selecting()||k.get("forceRemove"))){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid"),"module"))return void J.alert("has_no_permission");if(J.is_unremovable_subject(this.model)&&!k.get("forceRemove"))return}e&&(e.preventDefault(),(this.$el.closest(".et_pb_section.et_pb_global").length||this.$el.closest(".et_pb_row.et_pb_global").length)&&""===et_pb_options.template_post_id&&(t=Pe(this))),this.model.destroy(),V.allowHistorySaving("removed","module",this.model.get("admin_label")),k.removeView(this.model.get("cid")),this.remove(),e&&v.trigger("et-module:removed"),""!==t&&Ie(t),J.update()}},unlockModule:function(e){if(e.preventDefault(),!V.isLoading&&!J.is_selecting()){var t,i=this,o=i.$el.closest(".et_pb_module_block");He().done((function(e){!0===e?(o.removeClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="off",t=k.getParentViews(i.model.get("parent")),_.each(t,(function(e,t){k.isChildrenLocked(e.model.get("cid"))||e.$el.removeClass("et_pb_children_locked")})),V.allowHistorySaving("unlocked","module",i.options.model.get("admin_label")),V.saveAsShortcode()):alert(et_pb_options.locked_module_permission_alert)}))}},isModuleLocked:function(){return"on"===this.model.get("et_pb_locked")||"on"===this.model.get("et_pb_parent_locked")},showRightClickOptions:function(e){e.preventDefault();var t={model:this.model,view:this.$el,view_event:e};new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()},setABTesting:function(e){e.preventDefault(),e.stopPropagation(),J.set(this,e)}}),s.HelpView=window.wp.Backbone.View.extend({tagName:"div",id:"et-builder-help",className:"et_pb_modal_settings",template:_.template(e("#et-builder-help-template").html()),isOSX:-1!=navigator.userAgent.indexOf("Mac OS X"),renderKbd:function(t){var i=t;return"super"===i&&(i=this.isOSX?"cmd":"ctrl"),e("<kbd />",{class:"key-".concat(i)}).html(i)},render:function(){var t=this,o=this.$el;i(),o.html(this.template());var n=o.find(".et-pb-shortcuts-tab");return _.each(et_pb_help_options.shortcuts,(function(i){_.each(i,(function(i){if(_.isUndefined(i.title)){var o=e("<p />",{class:"et-pb-shortcut-item"}),a=e("<span />",{class:"et-pb-shortcut-keys"});_.each(i.kbd,(function(i,o){o>0&&a.append(" + "),_.isArray(i)?_.each(i,(function(t,i){i>0&&a.append(" / "),a.append(e("<kbd />").html(t))})):a.append(t.renderKbd(i))})),o.append(a),o.append(e("<span />",{class:"et-pb-shortcut-desc"}).html(i.desc)),n.append(o)}else n.append(e("<h2 />",{class:"et-pb-shortcut-subtitle"}).html(i.title))}))})),this}}),s.RightClickOptionsView=window.wp.Backbone.View.extend({tagName:"div",id:"et-builder-right-click-controls",template:_.template(e("#et-builder-right-click-controls-template").html()),events:{"click .et-pb-right-click-rename":"rename","click .et-pb-right-click-start-ab-testing":"startABTesting","click .et-pb-right-click-end-ab-testing":"endABTesting","click .et-pb-right-click-save-to-library":"saveToLibrary","click .et-pb-right-click-undo":"undo","click .et-pb-right-click-redo":"redo","click .et-pb-right-click-disable":"disable","click .et_pb_disable_on_option":"disable_device","click .et-pb-right-click-lock":"lock","click .et-pb-right-click-collapse":"collapse","click .et-pb-right-click-copy":"copy","click .et-pb-right-click-paste-after":"pasteAfter","click .et-pb-right-click-paste-app":"pasteApp","click .et-pb-right-click-paste-column":"pasteColumn","click .et-pb-right-click-preview":"preview","click .et-pb-right-click-disable-global":"disableGlobal"},initialize:function(t,i){var o;i=!_.isUndefined(i)&&i;if(this.type=this.options.model.attributes.type,this.et_pb_has_storage_support=Ne(),this.has_compatible_clipboard_content=Ye.get(this.getClipboardType()),this.history_noun="row_inner"===this.type?"row":this.type,!V.isLoading&&!J.is_selecting()){if("1"===et_pb_options.is_divi_library&&!1!==this.has_compatible_clipboard_content){switch(et_pb_options.layout_type){case"module":o=[];break;case"row":o=["module"];break;case"section":o=["module","row"];break;default:o=["module","row","section"]}-1==e.inArray(this.type,o)&&(this.has_compatible_clipboard_content=!1)}!1===i&&this.render()}},render:function(){var t=e(this.options.view),i=this.$el.html(this.template()),o=this.options.view.offset(),n=this.options.view_event.pageX-o.left-100,a=this.options.view_event.pageY-o.top;this.closeAllRightClickOptions(),e(this.options.view_event.toElement).is("#et-builder-right-click-controls a")||i.find("li").length<1||(t.append(i),i.find(".options").css({top:"".concat(a,"px"),left:"".concat(n,"px"),"margin-top":"".concat(0-i.find(".options").height()-40,"px")}).animate({"margin-top":0-i.find(".options").height()-10,opacity:1},300),e("#et_pb_layout").prepend('<div id="et_pb_layout_right_click_overlay" />'))},closeAllRightClickOptions:function(){return i(),!1},rename:function(e){e.preventDefault();this.$el.parent();G("rename_admin_label",this.options.model.attributes.cid),this.closeAllRightClickOptions()},startABTesting:function(t){this.closeAllRightClickOptions(),J.toggle_status(!0),V.disable_publish=!0,e("#publish").addClass("disabled"),J.check_create_db(),V.is_selecting_ab_testing_subject=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_subject")},endABTesting:function(e){this.closeAllRightClickOptions(),J.toggle_status(!1),V.is_selecting_ab_testing_subject=!1,J.count_subjects()>0&&G("turn_off_ab_testing")},disableGlobal:function(e){e.preventDefault(),this.closeAllRightClickOptions(),k.removeGlobalAttributes(this),Ue()},saveToLibrary:function(t){t.preventDefault();var i=this.options.model,o=i.attributes.type,n={model:i,collection:$,attributes:{"data-open_view":"module_settings"}};if(this.closeAllRightClickOptions(),!J.is_active()||!J.is_ab_testing_item(i)&&"app"!==o)if("app"===this.type)G("save_layout");else{var a=new s.ModalView(n);e("body").append(a.render().el),Re(),a.saveTemplate(t)}else J.alert("cannot_save_".concat(o,"_layout_has_ab_testing"))},undo:function(e){e.preventDefault(),V.undo(e),this.closeAllRightClickOptions()},redo:function(e){e.preventDefault(),V.redo(e),this.closeAllRightClickOptions()},disable:function(t){t.preventDefault();var i,o,n,a=e(t.target).hasClass("et-pb-right-click-disable")?e(t.target):e(t.target).closest("a"),s=a.closest("li").find("span.et_pb_disable_on_options"),l=s.find("span.et_pb_disable_on_option"),_=!(void 0===this.options.model.attributes.et_pb_disabled||"on"!==this.options.model.attributes.et_pb_disabled),d=void 0!==this.options.model.attributes.et_pb_disabled_on?this.options.model.attributes.et_pb_disabled_on:"";return a.addClass("et_pb_right_click_hidden"),s.addClass("et_pb_right_click_visible"),_?l.addClass("et_pb_disable_on_active"):""!==d&&(i=d.split("|"),o=0,n="phone",l.each((function(){var t=e(this);t.hasClass("et_pb_disable_on_".concat(n))&&"on"===i[o]&&t.addClass("et_pb_disable_on_active"),o++,n=1===o?"tablet":"desktop"}))),!1},disable_device:function(t){var i,o,n,a,s=e(t.target),l=(e(this),s.hasClass("et_pb_disable_on_active")?"off":"on"),_=void 0!==this.options.model.attributes.et_pb_disabled_on?this.options.model.attributes.et_pb_disabled_on:"",d=this.$el.parent();return s.hasClass("et_pb_disable_on_phone")?(n=0,a="phone"):s.hasClass("et_pb_disable_on_tablet")?(n=1,a="tablet"):(n=2,a="desktop"),(o=""!==_?_.split("|"):["","",""])[n]=l,this.options.model.attributes.et_pb_disabled_on="".concat(o[0],"|").concat(o[1],"|").concat(o[2]),"on"===o[0]&&"on"===o[1]&&"on"===o[2]?(d.addClass("et_pb_disabled"),this.options.model.attributes.et_pb_disabled="on",i="disabled"):(d.removeClass("et_pb_disabled"),this.options.model.attributes.et_pb_disabled="off",i="off"===l?"enabled":"disabled"),s.toggleClass("et_pb_disable_on_active"),this.updateGlobalModule(),V.allowHistorySaving(i,this.history_noun,void 0,a),V.saveAsShortcode(),!1},lock:function(e){e.preventDefault(),this.$el.parent().hasClass("et_pb_locked")?(this.unlockItem(),V.allowHistorySaving("unlocked",this.history_noun)):(this.lockItem(),V.allowHistorySaving("locked",this.history_noun)),this.closeAllRightClickOptions(),V.saveAsShortcode()},unlockItem:function(){var e,t,i=this,o=i.$el.parent();He().done((function(n){!0===n?(o.removeClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="off","module"!==i.options.model.get("type")&&(e=k.getChildrenViews(i.model.get("cid")),_.each(e,(function(e,t){e.$el.removeClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","off",{silent:!0})}))),"section"!==i.options.model.get("type")&&(t=k.getParentViews(i.model.get("parent")),_.each(t,(function(e,t){k.isChildrenLocked(e.model.get("cid"))||e.$el.removeClass("et_pb_children_locked")}))),V.allowHistorySaving("unlocked",i.history_noun),V.saveAsShortcode(),i.updateGlobalModule()):alert(et_pb_options.locked_item_permission_alert)}))},lockItem:function(){var e,t,i=this,o=i.$el.parent();He().done((function(n){!0===n?(o.addClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="on","module"!==i.options.model.get("type")&&(e=k.getChildrenViews(i.model.get("cid")),_.each(e,(function(e,t){e.$el.addClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","on",{silent:!0})}))),"section"!==i.options.model.get("type")&&(t=k.getParentViews(i.model.get("parent")),_.each(t,(function(e,t){e.$el.addClass("et_pb_children_locked")}))),V.allowHistorySaving("locked",i.history_noun),V.saveAsShortcode(),i.updateGlobalModule()):alert(et_pb_options.locked_item_permission_alert)}))},collapse:function(e){e.preventDefault();var t,i=this.$el.parent(),o=this.options.model.attributes.cid;i.toggleClass("et_pb_collapsed"),i.hasClass("et_pb_collapsed")?(this.options.model.attributes.et_pb_collapsed="on",t="collapsed"):(this.options.model.attributes.et_pb_collapsed="off",t="expanded"),J.is_active()&&"on"===this.model.get("et_pb_ab_subject")&&J.subject_carousel(o),this.updateGlobalModule(),this.closeAllRightClickOptions(),V.allowHistorySaving(t,this.history_noun),V.saveAsShortcode()},copy:function(e,t){t||e.preventDefault();var i,o=_.clone(this.model.attributes),n=o.type;"row_inner"===n&&(n="row"),_.isUndefined(o.view)||delete o.view,_.isUndefined(o.appendAfter)||delete o.appendAfter,"row"!==n&&"section"!==n||(o.childviews=this.getChildViews(o.cid)),delete o.className,delete o.et_pb_locked,i=JSON.stringify(o),Ye.set(this.getClipboardType(),i),this.closeAllRightClickOptions()},pasteAfter:function(e,t,i,o,n,a){if(n||e.preventDefault(),Fe(this.model)){t=_.isUndefined(t)?this.model.get("parent"):t,i=_.isUndefined(i)?this.getClipboardType():i,o=!!_.isUndefined(o)||o;var s,l=k.getView(t);s=Ye.get(i),s=JSON.parse(s),_.isUndefined(s.et_pb_ab_subject)&&"on"!==s.et_pb_ab_subject||(s.et_pb_ab_subject_id=J.get_subject_id()),o&&(s.cloned_cid=this.model.get("cid")),this.setPasteViews(s,t,"main_parent"),!J.is_active()||"row"!==s.type&&"row_inner"!==s.type&&"section"!==s.type||"on"!==s.et_pb_ab_subject||J.subject_carousel(s.cid),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:saved"),_.isUndefined(l)||!k.is_global(l.model)&&!k.is_global_children(l.model)||this.updateGlobalModule(),this.closeAllRightClickOptions(),"did"!==U.verb||a||V.allowHistorySaving("copied",this.history_noun),n||V.saveAsShortcode()}},pasteApp:function(e){e.preventDefault();var t=$.where({type:"section"}),i=_.last(t);this.model=i,this.options.model=i,this.pasteAfter(e,void 0,"et_pb_clipboard_section",!1)},pasteColumn:function(e){e.preventDefault();var t=this.model.get("cid"),i="section"===this.model.get("type")?"et_pb_clipboard_module_fullwidth":"et_pb_clipboard_module";this.pasteAfter(e,t,i,!1)},getClipboardType:function(){var e=this.model.attributes.type,t=_.isUndefined(this.model.attributes.module_type)?this.model.attributes.type:this.model.attributes.module_type,i="et_pb_clipboard_".concat(e),o="et_pb_fullwidth";return t.substr(0,o.length)===o&&(i+="_fullwidth"),i},getChildViews:function(e){var t,i=this,o=$.models,n=[];return _.each(o,(function(o,a){o.attributes.parent===e&&(t=o.attributes,_.isUndefined(t.view)||delete t.view,_.isUndefined(t.appendAfter)||delete t.appendAfter,t.created="manually",t.childviews=i.getChildViews(o.attributes.cid),n.push(t))})),n},setPasteViews:function(e,t,i){var o=this,n=k.generateNewId(),a=this.model.collection.indexOf(this.model),s=!(_.isUndefined(e.childviews)||!_.isArray(e.childviews))&&e.childviews;e.cid=n,e.parent=t,e.created="manually",e.pasted_module=void 0!==i&&"main_parent"===i,_.isUndefined(e.et_pb_global_parent)||""===e.et_pb_global_parent||(e.et_pb_global_parent=Pe(k.getView(t))),!_.isUndefined(e.et_pb_global_module)&&_.isUndefined(e.global_parent_cid)&&_.isUndefined(this.set_global_parent_cid)&&(this.global_parent_cid=n,this.set_global_parent_cid=!0),_.isUndefined(e.global_parent_cid)||(e.global_parent_cid=this.global_parent_cid),_.each(["et_pb_global_parent","global_parent_cid"],(function(t){!_.isUndefined(o.options.model.get(t))&&_.isUndefined(e[t])&&(e[t]=o.options.model.get(t))})),_.isUndefined(e.et_pb_template_type)||delete e.et_pb_template_type,_.isUndefined(e.et_pb_ab_subject)&&"on"!==e.et_pb_ab_subject||(e.et_pb_ab_subject_id=J.get_subject_id()),delete e.childviews,_.isUndefined(e.admin_label)&&(e.admin_label=_.isUndefined(e.module_type)?"":k.getDefaultAdminLabel(e.module_type)),this.model.collection.add(e,{at:a}),s&&_.each(s,(function(e){o.setPasteViews(e,n)}))},updateGlobalModule:function(){var e;k.is_global(this.model)?e=this.options.model.get("cid"):k.is_global_children(this.model)&&(e=this.options.model.get("global_parent_cid")),_.isUndefined(e)||Ie(e)},hasOption:function(e){var t="function"==typeof this.model.get&&this.model.get("cid"),i=!1,o=this.options.model.attributes.type,n=J.is_active(),a=!!n&&J.is_goal(this.model),s=!!n&&J.is_goal_children(this.model),l=!!n&&J.has_goal(this.model),d=!!n&&J.is_subject(this.model),r=!!n&&J.is_subject_children(this.model),c=!n||J.is_user_has_permission(t,"right_click_change"),p=!n||J.is_user_has_permission(t,"copy"),b=!n||J.is_user_has_permission(t,"paste");switch(e){case"rename":this.hasOptionSupport(["module","section","row_inner","row"])&&"on"!==this.options.model.attributes.et_pb_locked&&c&&(i=!0);break;case"save-to-library":!this.hasOptionSupport(["app","section","row_inner","row","module"])||k.is_global(this.options.model)||k.is_global_children(this.options.model)||"on"===this.options.model.attributes.et_pb_locked||J.is_active()&&(J.is_ab_testing_item(this.options.model)||"app"===o)||"1"===et_pb_options.is_divi_library||(i=!0);break;case"start-ab-testing":this.hasOptionSupport(["section","row_inner","row","module"])&&!n&&(i=!0);break;case"end-ab-testing":this.hasOptionSupport(["section","row_inner","row","module"])&&(d||a||r||s)&&n&&(i=!0);break;case"disable-global":this.hasOptionSupport(["section","row_inner","row","module"])&&(k.is_global(this.options.model)||k.is_global_children(this.options.model))&&(i=!0);break;case"undo":this.hasOptionSupport(["app","section","row_inner","row","column","column_inner","module"])&&this.hasUndo()&&(i=!0);break;case"redo":this.hasOptionSupport(["app","section","row_inner","row","column","column_inner","module"])&&this.hasRedo()&&(i=!0);break;case"disable":this.hasOptionSupport(["section","row_inner","row","module"])&&"on"!==this.options.model.attributes.et_pb_locked&&!1===this.hasDisabledParent()&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&c&&(i=!0);break;case"lock":this.hasOptionSupport(["section","row_inner","row","module"])&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&c&&(i=!0);break;case"collapse":this.hasOptionSupport(["section","row_inner","row"])&&"on"!==this.options.model.attributes.et_pb_locked&&(!J.is_active()||"on"!==this.options.model.get("et_pb_ab_subject")||"off"!==this.options.model.get("et_pb_collapsed")&&!_.isUndefined(this.options.model.get("et_pb_collapsed")))&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&(i=!0);break;case"copy":this.hasOptionSupport(["section","row_inner","row","module"])&&this.et_pb_has_storage_support&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&p&&!a&&!l&&(i=!0);break;case"paste-after":this.hasOptionSupport(["section","row_inner","row","module"])&&this.et_pb_has_storage_support&&this.has_compatible_clipboard_content&&b&&Fe(this.options.model)&&(i=!0);break;case"paste-app":this.hasOptionSupport(["app"])&&this.et_pb_has_storage_support&&Ye.get("et_pb_clipboard_section")&&(i=!0);break;case"paste-column":!_.isUndefined(this.model.attributes.is_insert_module)&&(("column"===this.type||"column_inner"==this.type)&&Ye.get("et_pb_clipboard_module")||"section"===this.type&&Ye.get("et_pb_clipboard_module_fullwidth"))&&this.et_pb_has_storage_support&&(i=!0);break;case"preview":this.hasOptionSupport(["section","row_inner","row","module"])&&"on"!==this.options.model.attributes.et_pb_locked&&(i=!0)}return i},hasOptionSupport:function(e){return!_.isUndefined(_.findWhere(e,this.type))},hasUndo:function(){return V.hasUndo()},hasRedo:function(){return V.hasRedo()},hasDisabledParent:function(){for(var e=k.getView(this.model.attributes.parent),t={},i=!1;!_.isUndefined(e);)_.isUndefined(e.model.attributes.et_pb_disabled)||"on"!==e.model.attributes.et_pb_disabled||(i=!0),t[e.model.attributes.cid]=e,e=k.getView(e.model.attributes.parent);return i},preview:function(t){t.preventDefault();var i=k.getView(this.model.get("cid"));this.closeAllRightClickOptions(),i.triggered_by_right_click=!0,i.do_preview=!0,i.showSettings(t),e(".et-pb-modal-preview-template").trigger("click")}}),s.visualizeHistoriesView=window.wp.Backbone.View.extend({el:"#et-pb-histories-visualizer",template:_.template(e("#et-builder-histories-visualizer-item-template").html()),events:{"click li":"rollback"},verb:"did",noun:"module",noun_alias:void 0,addition:"",getItemID:function(e){return"#et-pb-history-".concat(e.get("timestamp"))},getVerb:function(){var e=this.verb;return _.isUndefined(et_pb_options.verb[e])||(e=et_pb_options.verb[e]),e},getNoun:function(){var e=this.noun;return _.isUndefined(this.noun_alias)?_.isUndefined(et_pb_options.noun[e])||(e=et_pb_options.noun[e]):e=this.noun_alias,e},getAddition:function(){var e=this.addition;return _.isUndefined(et_pb_options.addition[e])||(e=et_pb_options.addition[e]),e},addItem:function(e){this.options=e,this.$el.prepend(this.template()),this.setHistoriesHeight()},changeItem:function(t){var i=this.getItemID(t),o=e(i),n=t.collection.findWhere({current_active_history:!0}),a=t.collection.indexOf(n),s=t.collection.indexOf(t);this.options=t,this.$el.find("li").removeClass("undo redo active"),a===s?(o.addClass("active"),this.$el.find("li").slice(0,o.index()).addClass("redo"),this.$el.find("li").slice(o.index()+1).addClass("undo")):this.$el.find("li:not( .active, .redo )").addClass("undo"),this.setHistoriesHeight()},removeItem:function(e){var t=this.getItemID(e);this.$el.find(t).remove(),this.setHistoriesHeight()},setHistoryMeta:function(e,t,i,o){_.isUndefined(e)||(this.verb=e),_.isUndefined(t)||(this.noun=t),_.isUndefined(i)?this.noun_alias=void 0:this.noun_alias=i,_.isUndefined(o)||(this.addition=o)},setHistoriesHeight:function(){var t=this;setTimeout((function(){var i=e("#et_pb_layout"),o=i.find(".hndle"),n=e("#et_pb_layout_controls"),a=i.outerHeight()-o.outerHeight()-n.outerHeight();t.$el.css({"max-height":"".concat(a,"px")})}),200)},rollback:function(t){t.preventDefault();var i=e(t.target),o=(i.is("li")?i:i.parent("li")).data("timestamp"),n=this.options.collection.findWhere({timestamp:o}),a=n.get("shortcode");V.resetCurrentActiveHistoryMarker(),n.set({current_active_history:!0}),v.trigger("et-pb-loading:started"),ae("content",a,"saving_to_content"),setTimeout((function(){var t=e("#et_pb_layout"),i=t.innerHeight();t.css({height:"".concat(i,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),V.enable_history=!1,V.createLayoutFromContent(Oe(a),"","",{is_reinit:"reinit"}),J.is_active_based_on_models()?(J.toggle_status(!0),Ue()):J.toggle_status(!1),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),V.updateHistoriesButtonState()}),600)}}),s.AppView=window.wp.Backbone.View.extend({el:e("#et_pb_main_container"),template:_.template(e("#et-builder-app-template").html()),template_button:_.template(e("#et-builder-add-specialty-section-button").html()),events:{"click .et-pb-layout-buttons-save":"saveLayout","click .et-pb-layout-buttons-load":"loadLayout","click .et-pb-layout-buttons-clear":"clearLayout","click .et-pb-layout-buttons-history":"toggleHistory","click #et-pb-histories-visualizer-overlay":"closeHistory","contextmenu #et-pb-histories-visualizer-overlay":"closeHistory","click .et-pb-layout-buttons-redo":"redo","click .et-pb-layout-buttons-undo":"undo","click .et-pb-layout-buttons-view-ab-stats":"viewABStats","click .et-pb-layout-buttons-settings":"settings","contextmenu .et-pb-layout-buttons-save":"showRightClickOptions","contextmenu .et-pb-layout-buttons-load":"showRightClickOptions","contextmenu .et-pb-layout-buttons-clear":"showRightClickOptions","contextmenu .et-pb-layout-buttons-redo":"showRightClickOptions","contextmenu .et-pb-layout-buttons-undo":"showRightClickOptions","contextmenu #et_pb_main_container_right_click_overlay":"showRightClickOptions","click #et_pb_main_container_right_click_overlay":"hideRightClickOptions"},initialize:function(){this.listenTo(this.collection,"add",this.addModule),this.listenTo(T,"add",this.addVisualizeHistoryItem),this.listenTo(T,"change",this.changeVisualizeHistoryItem),this.listenTo(T,"remove",this.removeVisualizeHistoryItem),this.listenTo(v,"et-sortable:update",_.debounce(this.saveAsShortcode,128)),this.listenTo(v,"et-model-changed-position-within-column",_.debounce(this.saveAsShortcode,128)),this.listenTo(v,"et-module:removed",_.debounce(this.saveAsShortcode,128)),this.listenTo(v,"et-pb-loading:started",this.startLoadingAnimation),this.listenTo(v,"et-pb-loading:ended",this.endLoadingAnimation),this.listenTo(v,"et-pb-content-updated",this.recalculateModulesOrder),this.listenTo(v,"et-advanced-module:updated_order",this.updateAdvancedModulesOrder),this.listenTo(v,"et-pb-content-updated",_.debounce(this.updateYoastContent,500)),this.$builder_toggle_button=e("body").find("#et_pb_toggle_builder"),this.$builder_toggle_button_wrapper=e("body").find(".et_pb_toggle_builder_wrapper"),this.render(),this.maybeGenerateInitialLayout(),e("#et_builder_version").val("BB|".concat(window.et_builder_product_name,"|").concat(window.et_builder_version))},render:function(){return this.$el.html(this.template()),this.makeSectionsSortable(),this.addLoadingAnimation(),e("#et_pb_main_container_right_click_overlay").remove(),this.$el.prepend('<div id="et_pb_main_container_right_click_overlay" />'),this.updateHistoriesButtonState(),this},addLoadingAnimation:function(){e("body").append('<div id="et_pb_loading_animation"></div>'),this.$loading_animation=e("#et_pb_loading_animation").hide()},startLoadingAnimation:function(){this.pageBuilderIsActive()&&(this.$loading_animation.next().length&&(e("body").append(this.$loading_animation),this.$loading_animation=e("#et_pb_loading_animation")),this.$loading_animation.show(),this.isLoading=!0)},endLoadingAnimation:function(){this.$loading_animation.hide(),this.isLoading=!1;try{var e=window.localStorage.getItem("et_page_loading");e&&(console.log("Builder load : %c%f","color: red",parseInt((Date.now()-parseInt(e,10))/10,10)/100),window.localStorage.removeItem("et_page_loading"))}catch(e){}},pageBuilderIsActive:function(){return this.$builder_toggle_button.hasClass("et_pb_builder_is_used")||this.$builder_toggle_button_wrapper.hasClass("et_pb_builder_is_used")},saveLayout:function(e){e.preventDefault(),J.is_active()?J.alert("cannot_save_app_layout_has_ab_testing"):(i(),G("save_layout"))},loadLayout:function(t){var o;t.preventDefault(),i(),J.is_active()?J.alert("cannot_load_layout_has_ab_testing"):(o=new s.ModalView({attributes:{"data-open_view":"save_layout"},view:this}),e("body").append(o.render().el))},clearLayout:function(e){e.preventDefault(),i(),J.is_active()?J.alert("cannot_clear_layout_has_ab_testing"):G("clear_layout")},getHistoriesCount:function(){return this.options.history.length},getHistoriesIndex:function(){var e=this.options.history.findWhere({current_active_history:!0});return _.isUndefined(e)?this.options.history.models.length-1:this.options.history.indexOf(e)},isDoingCombination:function(){return!_.isUndefined(this.is_doing_combination)&&this.is_doing_combination},enableHistory:function(){return!_.isUndefined(this.enable_history)&&this.enable_history},allowHistorySaving:function(e,t,i,o){this.enable_history=!0,U.setHistoryMeta(e,t,i,o)},codeModuleContentPrepCB:function(e,t){var i=t;return i=(i=(i=(i=i.replace(/<br[\s]?[\/]?>/g,"<!\u2013- [et_pb_br_holder] -\u2013>")).replace(/<p /g,"<pee ")).replace(/<p>/g,"<pee>")).replace(/<\/p>/g,"</pee>"),e.replace(t,i)},codeModuleContentPrep:function(e){return e=(e=e.replace(/\[et_pb_code.*?\]([^]*)\[\/et_pb_code\]/g,this.codeModuleContentPrepCB)).replace(/\[et_pb_fullwidth_code.*?\]([^]*)\[\/et_pb_fullwidth_code\]/g,this.codeModuleContentPrepCB)},codeModuleContentUnPrepCB:function(e,t){var i=t;return i=(i=(i=(i=(i=(i=i.replace(/\n/g,"")).replace(/<p>/g,"")).replace(/<\/p>/g,"")).replace(/<!\u2013- \[et_pb_br_holder\] -\u2013>/g,"<br />")).replace(/<pee/g,"<p")).replace(/<\/pee>/g,"</p>"),e.replace(t,i)},codeModuleContentUnPrep:function(e){return e=(e=e.replace(/\[et_pb_code.*?\]([^]*)\[\/et_pb_code\]/g,this.codeModuleContentUnPrepCB)).replace(/\[et_pb_fullwidth_code.*?\]([^]*)\[\/et_pb_fullwidth_code\]/g,this.codeModuleContentUnPrepCB)},reviseHistories:function(){var e,t=this;if(this.hasRedo()){var i=_.range(this.getHistoriesIndex()+1,this.getHistoriesCount()).reverse();_.each(i,(function(i){e=t.options.history.at(i),t.options.history.remove(e)}))}this.updateHistoriesButtonState()},resetCurrentActiveHistoryMarker:function(){var e=this.options.history.where({current_active_history:!0});_.isEmpty(e)||_.each(e,(function(e){e.set({current_active_history:!1})}))},hasUndo:function(){return this.getHistoriesIndex()>0},hasRedo:function(){return this.getHistoriesCount()-this.getHistoriesIndex()>1},hasOverlayRendered:function(){return!!e(".et_pb_modal_overlay").length},updateHistoriesButtonState:function(){this.hasUndo()?e(".et-pb-layout-buttons-undo").removeClass("disabled"):e(".et-pb-layout-buttons-undo").addClass("disabled"),this.hasRedo()?e(".et-pb-layout-buttons-redo").removeClass("disabled"):e(".et-pb-layout-buttons-redo").addClass("disabled"),this.hasUndo()||this.hasRedo()?e(".et-pb-layout-buttons-history").removeClass("disabled"):e(".et-pb-layout-buttons-history").addClass("disabled")},getUndoModel:function(){var e=this.options.history.at(this.getHistoriesIndex()-1);return!_.isUndefined(e)&&e},undo:function(t){t.preventDefault();var i,o=this,n=this.getUndoModel();this.hasUndo()&&(_.isUndefined(n)||this.hasOverlayRendered()||(i=n.get("shortcode"),this.resetCurrentActiveHistoryMarker(),n.set({current_active_history:!0}),v.trigger("et-pb-loading:started"),ae("content",i,"saving_to_content"),setTimeout((function(){var t=e("#et_pb_layout"),n=t.innerHeight();t.css({height:"".concat(n,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),o.enable_history=!1,V.createLayoutFromContent(Oe(i),"","",{is_reinit:"reinit"}),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),o.updateHistoriesButtonState()}),600)))},viewABStats:function(e){e.preventDefault(),"1"!==et_pb_options.is_divi_library&&G("view_ab_stats")},settings:function(e){e.preventDefault(),"1"!==et_pb_options.is_divi_library&&G("open_settings")},getRedoModel:function(){var e=this.options.history.at(this.getHistoriesIndex()+1);return!_.isUndefined(e)&&e},toggleHistory:function(t){t.preventDefault();var i=e("#et-pb-histories-visualizer");i.hasClass("active")&&(i.addClass("fadeout"),setTimeout((function(){i.removeClass("fadeout")}),500)),e(".et-pb-layout-buttons-history, #et-pb-histories-visualizer, #et-pb-histories-visualizer-overlay").toggleClass("active")},closeHistory:function(e){e.preventDefault(),this.toggleHistory(e)},redo:function(t){t.preventDefault();var i,o=this,n=this.getRedoModel();this.hasRedo()&&!_.isUndefined(n)&&n&&(this.hasOverlayRendered()||(this.options.history.indexOf(n),i=n.get("shortcode"),this.resetCurrentActiveHistoryMarker(),n.set({current_active_history:!0}),v.trigger("et-pb-loading:started"),ae("content",i,"saving_to_content"),setTimeout((function(){var t=e("#et_pb_layout"),n=t.innerHeight();t.css({height:"".concat(n,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),o.enable_history=!1,V.createLayoutFromContent(Oe(i),"","",{is_reinit:"reinit"}),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),o.updateHistoriesButtonState()}),600)))},addHistory:function(e){if(this.enableHistory()&&!this.isDoingCombination()){var t=new Date,i=t.getHours()>12?t.getHours()-12:t.getHours(),o=t.getMinutes(),n=t.getHours()>12?"PM":"AM";this.hasRedo()&&this.reviseHistories(),this.resetCurrentActiveHistoryMarker(),this.options.history.add({timestamp:_.now(),datetime:"".concat("0".concat(i).slice(-2),":").concat("0".concat(o).slice(-2)," ").concat(n),shortcode:e,current_active_history:!0,verb:U.verb,noun:U.noun},{validate:!0}),U.setHistoryMeta("did","something")}this.updateHistoriesButtonState()},addVisualizeHistoryItem:function(e){U.addItem(e)},changeVisualizeHistoryItem:function(e){U.changeItem(e)},removeVisualizeHistoryItem:function(e){U.removeItem(e)},maybeGenerateInitialLayout:function(){k.generateNewId();var t=this;v.trigger("et-pb-loading:started"),setTimeout((function(){var i="";if(void 0===window.tinyMCE||!window.tinyMCE.get("content")||window.tinyMCE.get("content").isHidden()||e("iframe#content_ifr").length)""!==(i=ee("content",!0))&&t.allowHistorySaving("loaded","page"),t.addHistory(i),t.pageBuilderIsActive()?-1!==i.indexOf("[et_pb_")||"1"===et_pb_options.is_divi_library&&"module"===et_pb_options.layout_type?-1!==i.indexOf("specialty_placeholder")?(t.createLayoutFromContent(Oe(i)),e(".et_pb_section_specialty").append(t.template_button())):t.createLayoutFromContent(Oe(i)):V.reInitialize():t.createLayoutFromContent(i),function(e,t){if(void 0===window.switchEditors)return;var i=tinyMCEPreInit.mceInit.et_pb_content.tadv_noautop;if(void 0!==i&&!0===i)return;_.each(V.collection.models,(function(i){var o=JSON.parse(et_pb_options.et_builder_modules_with_children);if(!_.includes(_.keys(o),i.get("module_type"))){var n=i.get("et_pb_content");if(void 0!==n){if("tinymce"===e)n=window.switchEditors.wpautop(n.replace(/<p>\xa0<\/p>/g,"<p> </p>"));else{if(!_.isUndefined(t)&&"initial_load"===t)return;n=window.switchEditors.pre_wpautop(n)}i.set("et_pb_content",n,{silent:!0})}}}))}(ie(),"initial_load"),v.trigger("et-pb-content-updated"),v.trigger("et-pb-loading:ended"),e("#et_pb_main_container").addClass("et_pb_loading_animation"),setTimeout((function(){e("#et_pb_main_container").removeClass("et_pb_loading_animation")}),500),t.listenTo(t.collection,"change reset add",_.debounce(t.saveAsShortcode,128)),J.update();else{if(30<++c){var o=e("#et-builder-failure-notice-template");return v.trigger("et-pb-loading:ended"),e("#et_pb_main_container").removeClass("et_pb_loading_animation"),void e("body").addClass("et_pb_stop_scroll").append(o.html())}t.maybeGenerateInitialLayout()}}),500)},wp_regexp_not_global:_.memoize((function(e){return new RegExp("\\[(\\[?)(".concat(e,")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)"))})),getShortCodeParentTags:function(e){var t="et_pb_section|et_pb_row|et_pb_column|et_pb_column_inner|et_pb_row_inner".split("|");if(t=t.concat(et_pb_options.et_builder_module_parent_shortcodes.split("|")),!_.isUndefined(e)&&""!==e){var i=e.split("|"),o=_.difference(i,t);_.isEmpty(o)||(t=_.union(t,o))}return t=t.join("|")},getShortCodeChildTags:function(){return et_pb_options.et_builder_module_child_shortcodes},getShortCodeRawContentTags:function(){return et_pb_options.et_builder_module_raw_content_shortcodes.split("|")},createLayoutFromContent:function(t,i,o,n,a){var s=this,l=_.isUndefined(t)||""===t?"":t.match(/\[([^\W\/\[\]\x00-\x20=]+)/g),d=l&&_.isArray(l)?l.join("|").replace(/\[/g,""):"",r=this.getShortCodeParentTags().split("|"),c=void 0===o||""===o?this.getShortCodeParentTags(d):this.getShortCodeChildTags(),p=window.wp.shortcode.regexp(c),b=this.wp_regexp_not_global(c),u=t.match(p),g=this.getShortCodeRawContentTags(),m=void 0===n?{}:n;_.each(u,(function(t,o){var n,l=t.match(b),d=l[2],c=l[2],u=""!==l[3]?window.wp.shortcode.attrs(l[3]):"",v=l[5],w=k.generateNewId(),y={},C=e.inArray(c,["et_pb_section","et_pb_row","et_pb_column","et_pb_row_inner","et_pb_column_inner"])>-1,S=C&&void 0!==v&&""!==v&&v.match(p),x="",j=!C&&-1===_.indexOf(r,c);if(C&&(c=c.replace("et_pb_","")),n={type:c,cid:w,created:"manually",module_type:c,component_status:""},void 0!==m.current_row_cid&&""!==m.current_row_cid&&(n.current_row=m.current_row_cid),void 0!==m.global_parent&&""!==m.global_parent&&(n.et_pb_global_parent=m.global_parent,n.global_parent_cid=m.global_parent_cid),"section"===c&&void 0!==m.after_section&&""!==m.after_section&&(n.after_section=m.after_section),"section"!==c&&(n.parent=i),-1!==c.indexOf("et_pb_")&&(n.type="module"),d===n.type&&(n.type="module"),n.admin_label=j?c:k.getDefaultAdminLabel(c),n._address=_.isUndefined(m.predefined_address)?o.toString():m.predefined_address,_.isUndefined(a)||(n._address="".concat(a,".").concat(n._address)),_.isObject(u.named)){var $=!1;for(var T in"global"!==et_pb_options.is_global_template||C||void 0===u.named.template_type||"module"!==u.named.template_type||("updated"===et_pb_options.selective_sync_status?h[et_pb_options.template_post_id]=et_pb_options.excluded_global_options:($=!0,f[et_pb_options.template_post_id]=[])),x=void 0!==u.named.global_module&&""===x?u.named.global_module:x,"reinit"===m.is_reinit&&("migrate"!==m.migrate_global_modules||""===x&&""===m.global_parent)||(u=function(e,t,i,o){var n=!_.isUndefined(et_pb_options.et_pb_module_settings_migrations)&&et_pb_options.et_pb_module_settings_migrations,a=!_.isUndefined(n.name_changes)&&n.name_changes,s=!_.isUndefined(n.value_changes)&&n.value_changes;a&&!_.isUndefined(a[i])&&_.forEach(a[i],(function(t,i){!_.isUndefined(e.named[i])&&_.isUndefined(e.named[t])&&(e.named[t]=e.named[i])}));s&&!_.isUndefined(s[t])&&_.forEach(s[t],(function(t,i){e.named[i]=t}));if(_.includes(["module","row"],o)){var l={},d=t.length;_.forEach(s,(function(e,i){"".concat(t,".")===String(i).substr(0,d+1)&&(l[i.substr(t.length+1)]=e)})),_.isEmpty(l)||(e.named.value_changes=l)}return e}(u,n._address,n.type,c)),u.named)if(void 0===m.ignore_template_tag||""===m.ignore_template_tag||"ignore_template"===m.ignore_template_tag&&"template_type"!==T){var U="admin_label"!==T&&"specialty_columns"!==T&&"value_changes"!==T?"et_pb_".concat(T):T,O=!1;"et_pb_signup"===c&&-1!==e.inArray(T,["description","footer_content"])&&(u.named[T]=u.named[T].replace(/%91/g,"[").replace(/%93/g,"]"),u.named[T]=u.named[T].replace(/%22/g,'"')),$&&f[et_pb_options.template_post_id].push(T),"column"!==c&&"column_inner"!==c||"et_pb_type"!==U||(U="layout"),_.isEmpty(m.unsynced_options)||-1===_.indexOf(m.unsynced_options,T)||(O=!0),O||(y[U]=u.named[T],"value_changes"===T&&delete u.named[T])}n=_.extend(n,y)}if("section"===c&&"on"===n.et_pb_specialty&&(v=function(e){return e.replace(/(\[et_pb_(row |row_inner) [\s\S]*?\][\s\S]*\[\/et_pb_(row |row_inner)\])/im,te)}(v)),void 0!==n.specialty_columns&&(n.layout_specialty="1",n.specialty_columns=parseInt(n.specialty_columns)),S||!_.isUndefined(m.unsynced_options)&&!_.isEmpty(m.unsynced_options)&&-1!==_.indexOf(m.unsynced_options,"et_pb_content_field")||(e.inArray(c,g)>-1?(n.et_pb_raw_content=n.et_pb_raw_content||v||"",n.et_pb_raw_content=n.et_pb_raw_content.replace(/<!-- \[et_pb_line_break_holder\] -->/g,"\n")):n.et_pb_content=v),_.includes(["row","row_inner"],c)&&(n.et_pb_content=v),"et_pb_contact_form"===c&&void 0!==n.et_pb_custom_message&&(n.et_pb_custom_message=_.unescape(n.et_pb_custom_message.replace(/\|\|et_pb_line_break_holder\|\|/g,"\r\n"))),"undefined"!==!n.et_pb_disabled&&"on"===n.et_pb_disabled&&(n.className=" et_pb_disabled"),"undefined"!==!n.et_pb_locked&&"on"===n.et_pb_locked&&(n.className=" et_pb_locked"),void 0!==m.global_id&&""!==m.global_id&&(n.et_pb_global_module=m.global_id),!C&&-1===_.indexOf(r,c))return n.title=c,n.component_status="removed",void s.collection.add([n]);if(s.collection.add([n]),"reinit"===m.is_reinit||""===x||""!==x&&"row"!==c&&"row_inner"!==c&&"section"!==c){if(S){var A=void 0===m.global_parent||""===m.global_parent?x:m.global_parent,M=void 0===m.global_parent_cid||""===m.global_parent_cid?void 0!==x&&""!==x?w:"":m.global_parent_cid,L=C?"":S;s.createLayoutFromContent(v,w,L,{is_reinit:m.is_reinit,global_parent:A,global_parent_cid:M,migrate_global_modules:m.migrate_global_modules},n._address)}}else B++,function(t,i,o,n){e("body").find(".et_pb_global_loading_overlay").length||e("body").append('<div class="et_pb_global_loading_overlay"></div>');var a="html"===ie()?"skip":"apply";e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_get_global_module",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_global_id:t,et_global_autop:a},success:function(a){var s=!1;if(!a||a.error){var l=k.getView(i);if(!l)return void e("body").find(".et_pb_global_loading_overlay").remove();var d=l.$el.find("[data-cid]");l.model.unset("et_pb_global_module"),d.length&&d.each((function(){var t=e(this).data("cid");if(void 0!==t&&""!==t){var i=k.getView(t);void 0!==i&&i.model.unset("et_pb_global_parent")}}))}else{var r=o.replace(/ global_parent="\S+"/g,""),c=qe(a.shortcode.replace(/template_type="\S+"/,'global_module="'.concat(t,'"')));c=(c=c.replace(/]\s?\n\s?\n\s?/g,"] ").replace(/\s?\n\s?\n\s?\[/g," [")).replace(/]\s+/g,"]").replace(/\s+\[/g,"["),r=r.replace(/]\s+/g,"]").replace(/\s+\[/g,"["),oe("content")&&(c=c.replace(/\r?\n|\r/g,"")),_.unescape(c)!==_.unescape(r)&&(s=!0,V.createLayoutFromContent(a.shortcode,"","",{ignore_template_tag:"ignore_template",current_row_cid:i,global_id:t,is_reinit:"reinit",predefined_address:n}))}if(z++,B===z){var p=!_.isUndefined(et_pb_options.et_pb_module_settings_migrations)&&et_pb_options.et_pb_module_settings_migrations;(s||!1!==p)&&Ue(!0,"migrate"),setTimeout((function(){e("body").find(".et_pb_global_loading_overlay").remove()}),650)}}})}(x,w,t,n._address),s.createLayoutFromContent(v,w,"",{is_reinit:"reinit"},n._address)}))},addModule:function(t){var i,o,n,a={model:t,collection:$},l=void 0!==t.get("cloned_cid")&&t.get("cloned_cid");switch(t.get("type")){case"section":if(i=new s.SectionView(a),k.addView(t.get("cid"),i),_.isUndefined(t.get("view"))?void 0!==t.get("after_section")&&""!==t.get("after_section")?k.getView(t.get("after_section")).$el.after(i.render().el):void 0!==t.get("current_row")?this.replaceElement(t.get("current_row"),i):l?this.$el.find('div[data-cid="'.concat(l,'"]')).closest(".et_pb_section").after(i.render().el):this.$el.append(i.render().el):t.get("view").$el.after(i.render().el),"on"===t.get("et_pb_fullwidth")){e(i.render().el).addClass("et_pb_section_fullwidth");var d=new s.ColumnView(a);i.addChildView(d),e(i.render().el).find(".et-pb-section-content").append(d.render().el)}var r;if("on"===t.get("et_pb_specialty")&&"auto"===t.get("created")&&!t.get("pasted_module"))e(i.render().el).addClass("et_pb_section_specialty"),r=new s.ModalView({model:a.model,collection:a.collection,attributes:{"data-open_view":"column_specialty_settings"},et_view:i,view:i}),e("body").append(r.render().el);t.get("pasted_module")||"manually"===t.get("created")||"on"===t.get("et_pb_fullwidth")||"on"===t.get("et_pb_specialty")||i.addRow();break;case"row":case"row_inner":i=new s.RowView(a),""!==t.get("parent")&&k.getView(t.get("parent")).$el.find(".et-pb-insert-row").hide(),k.addView(t.get("cid"),i),_.isUndefined(t.get("current_row"))?_.isUndefined(t.get("appendAfter"))?l?k.getView(t.get("parent")).$el.find('div[data-cid="'.concat(l,'"]')).parent().after(i.render().el):k.getView(t.get("parent")).$el.find(".et-pb-section-content").length?k.getView(t.get("parent")).$el.find(".et-pb-section-content").append(i.render().el):k.getView(t.get("parent")).$el.find("> .et-pb-insert-module, > .et-pb-insert-row").hide().end().append(i.render().el):t.get("appendAfter").after(i.render().el):this.replaceElement(t.get("current_row"),i),t.unset("columns_layout"),"manually"===t.get("created")&&"row_inner"===t.get("module_type")&&t.set("view",k.getView(t.get("parent")),{silent:!0});break;case"column":case"column_inner":a.className="et-pb-column et-pb-column-".concat(t.get("layout")),_.isUndefined(t.get("layout_specialty"))||"1"!==t.get("layout_specialty")||(a.className+=" et-pb-column-specialty"),i=new s.ColumnView(a),k.addView(t.get("cid"),i),_.isUndefined(t.get("layout_specialty"))?(n=void 0!==(o=k.getView(t.get("parent"))).model.get("columns_layout")?"".concat(o.model.get("columns_layout"),",").concat(t.get("layout")):t.get("layout"),o.model.set("columns_layout",n),"on"!==k.getView(t.get("parent")).model.get("et_pb_specialty")?(k.getView(t.get("parent")).$el.find(".et-pb-row-container").append(i.render().el),k.getView(t.get("parent")).toggleInsertColumnButton()):k.getView(t.get("parent")).$el.find(".et-pb-section-content").append(i.render().el)):(k.getView(t.get("parent")).$el.find(".et-pb-section-content").append(i.render().el),"1"===t.get("layout_specialty")&&("manually"!==t.get("created")&&this.collection.add([{type:"row",module_type:"row",cid:k.generateNewId(),parent:t.get("cid"),view:i,admin_label:et_pb_options.noun.row}]),k.getView(t.get("parent")).model.set("specialty_columns",parseInt(t.get("specialty_columns")))));break;case"module":if(a.attributes={"data-cid":t.get("cid")},"advanced"!==t.get("mode")&&"manually"===t.get("created")&&"column_inner"===k.getView(t.get("parent")).model.get("module_type")){var c=k.getView(t.get("parent")).model.get("parent");k.getView(c).$el.find(".et-pb-insert-column").hide()}if(void 0!==t.get("mode")&&"advanced"===t.get("mode"))i=new s.AdvancedModuleSettingView(a),t.attributes.view.child_views.push(i),void 0!==t.get("cloned_cid")&&""!==t.get("cloned_cid")?k.getView(t.get("cloned_cid")).$el.after(i.render().el):k.getView(t.get("parent")).$el.find(".et-pb-sortable-options").append(i.render().el),k.addView(t.get("cid"),i);else{var p="";if(v.trigger("et-new_module:show_settings"),i=new s.BlockModuleView(a),void 0!==t.attributes.view&&"on"===t.attributes.view.model.get("et_pb_fullwidth")?(k.getView(t.get("parent")).addChildView(i),p=k.getView(t.get("parent")).model.get("et_pb_template_type")):void 0!==t.attributes.view&&(p=k.getView(k.getView(t.get("parent")).model.get("parent")).model.get("et_pb_template_type")),l)k.getView(t.get("parent")).$el.find('div[data-cid="'.concat(l,'"]')).after(i.render().el);else if(k.getView(t.get("parent")).$el.find(".et-pb-insert-module").length)k.getView(t.get("parent")).$el.find(".et-pb-insert-module").before(i.render().el);else{var b=k.getView(t.get("parent"));void 0!==b.model.get("et_pb_fullwidth")&&"on"===b.model.get("et_pb_fullwidth")?b.$el.find(".et_pb_fullwidth_sortable_area").append(i.render().el):b.$el.append(i.render().el)}k.addView(t.get("cid"),i),void 0!==p&&"module"===p&&t.set("template_type","module",{silent:!0}),"manually"!==t.get("created")&&(a.attributes={"data-open_view":"module_settings"},this.openModuleSettings(a))}}t.unset("cloned_cid")},openModuleSettings:function(t){var i=this,o=new s.ModalView(t).render();if(!1===o)return setTimeout((function(){i.openModuleSettings(t)}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(o.el)},saveAsShortcode:function(e,t,i){var o=arguments.length>0&&"object"===a(arguments[0])&&arguments[0].et_action||"";if(ne(),!i||"false"!==i.update_shortcodes){var n=this.generateCompleteShortcode();this.addHistory(n),J.update();var s=o||"";ae("content",n,s),v.trigger("et-pb-content-updated")}},getDefaultSectionBackgroundColor:function(){var t=e("#_et_pb_section_background_color").val();return""!==t&&t||(t="#ffffff"),t},getSectionsBackgroundColor:function(){var t=this,i=[];return this.$el.find(".et_pb_section").each((function(){var o=e(this).find(".et-pb-data-cid").data("cid"),n=S($.find((function(e){return e.get("cid")==o})),"attributes.et_pb_background_color","");""!==n&&n||(n=t.getDefaultSectionBackgroundColor()),i.push(n)})),i},generateCompleteShortcode:function(t,i,o,n,a){var s="",l=this,_=void 0===t;i=void 0===i?"":i;return this.$el.find(".et_pb_section").each((function(){var d=e(this).find(".et-pb-section-content"),r=!1,c=void 0!==d.data("skip")&&d.data("skip");(!1===_&&t===d.data("cid")||!0===_)&&!0!==c&&(s+=l.generateModuleShortcode(e(this),!0,i,o),r=!0),d.closest(".et_pb_section").hasClass("et_pb_section_fullwidth")?d.find(".et_pb_module_block").each((function(){var a=e(this).data("cid");(!1!==_||t!==a&&!0!==r)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n))})):!d.closest(".et_pb_section").hasClass("et_pb_section_specialty")||!0!==r&&!0!==_&&"module"!==i&&"row"!==i||!0===c?d.find(".et_pb_row").each((function(){var d=e(this),c=d.find(".et-pb-row-content"),p=c.data("cid"),b=!1,u=void 0!==c.data("skip")&&c.data("skip");(!1!==_||t!==p&&!0!==r)&&!0!==_||!0===u||(s+=l.generateModuleShortcode(e(this),!0,i,o),b=!0),d.find(".et-pb-column").each((function(){var d=e(this),c=d.data("cid");$.findWhere({cid:c});(!1!==_||!0!==r&&!0!==b)&&!0!==_||!0===u||(s+=l.generateModuleShortcode(e(this),!0,i,o,"column")),d.find(".et_pb_module_block").each((function(){var d=e(this).data("cid");(!1!==_||t!==d&&!0!==r&&!0!==b)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n,a))})),(!1!==_||!0!==r&&!0!==b)&&!0!==_||!0===u||(s+="[/et_pb_column]")})),(!1!==_||t!==p&&!0!==r)&&!0!==_||!0===u||(s+="[/et_pb_row]")})):d.find("> .et-pb-column").each((function(){var d=e(this),c=d.data("cid"),p=$.findWhere({cid:c}),b="1"===p.get("layout_specialty")?' specialty_columns="'.concat(p.get("specialty_columns"),'"'):"",u=p.get("layout");!0!==r&&!0!==_||(s+='[et_pb_column type="'.concat(u,'"').concat(b,"]")),d.hasClass("et-pb-column-specialty")?d.find(".et_pb_row").each((function(){var a=e(this),d=a.find(".et-pb-row-content").data("cid"),c=($.findWhere({cid:d}),!1);(!0===r||!0===_||"row"===i&&d===t)&&(c=!0,s+=l.generateModuleShortcode(e(this),!0,i,o,"row_inner")),a.find(".et-pb-column").each((function(){var a=e(this),d=a.data("cid");$.findWhere({cid:d});!0===c&&(s+=l.generateModuleShortcode(e(this),!0,i,o,"column_inner",!1,!1,u)),a.find(".et_pb_module_block").each((function(){var a=e(this).data("cid");(!1!==_||t!==a&&!0!==r&&!0!==c)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n))})),!0===c&&(s+="[/et_pb_column_inner]")})),(!0===r||!0===_||"row"===i&&d===t)&&(s+="[/et_pb_row_inner]")})):d.find(".et_pb_module_block").each((function(){var d=e(this).data("cid");(!1!==_||t!==d&&!0!==r)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n,a))})),!0!==r&&!0!==_||(s+="[/et_pb_column]")})),(!1===_&&t===d.data("cid")||!0===_)&&!0!==c&&(s+="[/et_pb_section]")})),s},generateModuleShortcode:function(t,i,o,n,a,l,d,r){var c,p,b,u,g="",f="",m=t,v=!(m.is(".et_pb_section")||m.is(".et_pb_row")||m.is(".et_pb_row_inner")||m.is(".et_pb_column")||m.is(".et_pb_column_inner")),w=m.is(".et_pb_section")||m.is(".et_pb_row")||m.is(".et_pb_row_inner")?"et_pb_":"",y=void 0===m.data("cid")?m.find(".et-pb-data-cid").data("cid"):m.data("cid"),C=$.find((function(e){return e.get("cid")==y})),S=void 0!==C?C.get("module_type"):"undefined",x=[];if(void 0!==a&&""!==a&&(S=a),void 0!==C){if("section"===(p=C.attributes).type){var j=parseInt(C.attributes._address),T=j-1,V=j+1,U=this.getSectionsBackgroundColor(),O=_.isUndefined(p.et_pb_background_color)?this.getDefaultSectionBackgroundColor():p.et_pb_background_color,A=_.isUndefined(U[T])?"":U[T],M=_.isUndefined(U[V])?"":U[V],L=s.Helpers.moduleHasBackground(p,["gradient","image","video"]);A!==O||L||(A="#000000"),p.et_pb_prev_background_color=A,M!==O||L||(M="#000000"),p.et_pb_next_background_color=M}for(var E in c="module"===et_pb_options.layout_type&&"global"===et_pb_options.is_global_template||d&&v&&!_.isUndefined(p.et_pb_global_module),d&&v&&void 0!==p.et_pb_global_module&&(x=_.isEmpty(h[p.et_pb_global_module])?[]:h[p.et_pb_global_module]),p){if(!_.isEmpty(x)){var D=-1!==e.inArray(E,["et_pb_content","et_pb_raw_content"])?"et_pb_content_field":E.replace("et_pb_","");if(-1!==e.inArray(D,x))continue}if((void 0===n||"ignore_global"!==n||void 0!==n&&"ignore_global"===n&&"et_pb_global_module"!==E&&"et_pb_global_parent"!==E)&&(void 0===l||"ignore_global_tabs"!==l||void 0!==l&&"ignore_global_tabs"===l&&"et_pb_saved_tabs"!==E)){var I,P=E;if(_.includes(["et_pb_fb_built","et_pb_bb_built","_address"],P))continue;if(-1===P.indexOf("et_pb_")&&"admin_label"!==P)continue;if(I=void 0!==C.get(P)?C.get(P):"","et_pb_content"===P||"et_pb_raw_content"===P){f=I,"et_pb_raw_content"===P&&(f=f.replace(/\r?\n|\r/g,"\x3c!-- [et_pb_line_break_holder] --\x3e")),f=f.trim();var R=JSON.parse(et_pb_options.et_builder_modules_with_children);_.includes(_.keys(R),C.get("module_type"))||""===f||"et_pb_content"!==P||(f="\n\n".concat(f,"\n\n"))}else if(""!==I||c){if(void 0!==p.module_defaults&&void 0!==p.module_defaults[P])if(p.module_defaults[P]==="".concat(I)&&!c){delete C.attributes[P];continue}P=P.replace("et_pb_",""),"string"==typeof I&&(I=(I=I.replace(/\"/g,"%22").replace(/\\/g,"%92")).replace(/\[/g,"%91").replace(/\]/g,"%93")),"et_pb_contact_form"===S&&"custom_message"===P&&(I=_.escape(I.replace(/\r?\n|\r/g,"||et_pb_line_break_holder||")));/^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/.test(I)&&(I=_.escape(_.unescape(I))),"admin_label"===P?I!==k.getDefaultAdminLabel(p.module_type)&&(g=" ".concat(P,'="').concat(I,'"').concat(g)):g+=" ".concat(P,'="').concat(I,'"')}}}return u="section"!==S&&"row"!==S?"module":S,u="row_inner"===S?"row":u,void 0!==o&&o===u&&(g+=' template_type="'.concat(o,'"')),void 0!==p.template_type&&(g+=' template_type="'.concat(p.template_type,'"')),"section"===S&&(g=' bb_built="1"'.concat(g)),_.includes(["column","column_inner"],S)&&(g=' type="'.concat(C.get("layout"),'"').concat(g),w="et_pb_","column_inner"===S&&(g+=' saved_specialty_column_type="'.concat(r,'"'))),b="[".concat(w).concat(S).concat(g),""===f&&void 0!==p.type&&"module"===p.type?(i=!0,b+=" /]"):b+="]",i||(b+="".concat(f,"[/").concat(w).concat(S,"]")),b}},makeSectionsSortable:function(){var t=this;this.$el.sortable({items:"> *:not(#et_pb_layout_controls, #et_pb_main_container_right_click_overlay, #et-pb-histories-visualizer, #et-pb-histories-visualizer-overlay)",cancel:".et-pb-settings, .et-pb-clone, .et-pb-remove, .et-pb-section-add, .et-pb-row-add, .et-pb-insert-module, .et-pb-insert-column, .et_pb_locked, .et-pb-disable-sort",delay:100,update:function(i,o){if(V.isLoading)t.$el.sortable("cancel");else{if(J.is_active()){var n=e(o.item).children(".et-pb-section-content").attr("data-cid");if(!J.is_user_has_permission(n,"section"))return J.alert("has_no_permission"),t.$el.sortable("cancel"),void Ue()}t.allowHistorySaving("moved","section"),v.trigger("et-sortable:update")}},start:function(t,o){if(i(),t.altKey){var n=k.getView(e(o.item).children(".et-pb-section-content").data("cid")),a={model:n.model,view:n.$el,view_event:t},l=new s.RightClickOptionsView(a,!0);l.copy(t,!0),l.pasteAfter(t,void 0,void 0,void 0,!0,!0),V.allowHistorySaving("cloned","section")}}})},reInitialize:function(){var e=ee("content"),t=""==e,i=et_pb_options.default_initial_column_type,o=et_pb_options.default_initial_text_module;v.trigger("et-pb-loading:started"),this.removeAllSections(),-1===e.indexOf("[et_pb_section")&&(t||(e='[et_pb_column type="'.concat(i,'"][').concat(o,"]").concat(e,"[/").concat(o,"][/et_pb_column]")),e="[et_pb_section][et_pb_row]".concat(e,"[/et_pb_row][/et_pb_section]")),this.createNewLayout(e),v.trigger("et-pb-loading:ended")},removeAllSections:function(t){k.set("forceRemove",!0),this.$el.find(".et-pb-section-content").each((function(){var t=e(this),i=k.getView(t.data("cid"));void 0!==i&&i.removeSection(!1,!0)})),k.set("forceRemove",!1),t&&("[et_pb_section][et_pb_row][/et_pb_row][/et_pb_section]",this.createNewLayout("[et_pb_section][et_pb_row][/et_pb_row][/et_pb_section]"))},createNewLayout:function(e,t){t=t||"";this.stopListening(this.collection,"change reset add",this.saveAsShortcode),e=V.codeModuleContentPrep(e),"load_layout"===t&&void 0!==window.switchEditors&&(e=qe(window.switchEditors.wpautop(e))),e=V.codeModuleContentUnPrep(e),this.createLayoutFromContent(e),this.saveAsShortcode({et_action:t}),this.listenTo(this.collection,"change reset add",_.debounce(this.saveAsShortcode,128))},replaceElement:function(e,t){var i=k.getView(e);i.$el.after(t.render().el),i.model.destroy(),k.removeView(e),i.remove()},showRightClickOptions:function(e){e.preventDefault();var t={model:{attributes:{type:"app",module_type:"app"}},view:this.$el,view_event:e};new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()},recalculateModulesOrder:function(){this.collection;this.order_modules_array=[],this.order_modules_array.children_count=[],this.$el.find(".et_pb_section").each((function(t){var i=e(this).find(".et-pb-section-content"),o=i.data("cid");V.setModuleOrder(o),V.setModuleAddresses(o,t),i.closest(".et_pb_section").hasClass("et_pb_section_fullwidth")?i.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t)})):i.closest(".et_pb_section").hasClass("et_pb_section_specialty")?i.find("> .et-pb-column").each((function(){var t=e(this),i=t.data("cid");V.setModuleOrder(i),t.hasClass("et-pb-column-specialty")?t.find(".et_pb_row").each((function(){var t=e(this),i=t.find(".et-pb-row-content").data("cid");V.setModuleOrder(i),t.find(".et-pb-column").each((function(){var t=e(this),i=t.data("cid");V.setModuleOrder(i),t.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t)}))}))})):t.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t,"specialty")}))})):i.find(".et_pb_row").each((function(){var t=e(this),i=t.find(".et-pb-row-content").data("cid");V.setModuleOrder(i),t.find(".et-pb-column").each((function(){var t=e(this),i=t.data("cid");V.setModuleOrder(i),t.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t)}))}))}))}))},parseShortcode:function(i,o,n){var a=document.documentMode,s="et-fb-preview-".concat(Date.now(),"-").concat(Math.floor(1e3*Math.random()+1)),l="".concat(et_pb_options.preview_url,"&et_pb_preview=true&et_pb_preview_nonce=").concat(et_pb_options.et_pb_preview_nonce,"&iframe_id=").concat(s);setTimeout((function(){var d=e('*[data-shortcode-id="'.concat(n,'"]')),r=d.length?"".concat(d.width(),"px"):"100%",c=t("<iframe />",{id:s,src:l,style:"position: absolute; bottom: 0; left: 0; opacity: 0; pointer-events: none; width:".concat(r,"; height: 100%;")}),p=!1,b={et_pb_preview_nonce:et_pb_options.et_pb_preview_nonce,shortcode:i,post_title:e("#title").val(),post_id:et_pb_options.postId};e("body").append(c),c.on("load",(function(){if(!p){var e=document.getElementById(s);!_.isUndefined(a)&&a<10&&(b=JSON.stringify(b)),e.contentWindow.postMessage(b,l),p=!0;var t=window.addEventListener?"addEventListener":"attachEvent";(0,window[t])("attachEvent"==t?"onmessage":"message",(function(e){e.data.iframe_id===s&&_.isString(e.data.html)&&(o(e.data),c.remove())}),!1)}}))}),0)},updateYoastContent:function(){if(Be()){var t=ee("content",!0),i=e("#yoast-readability-analysis-collapsible-metabox");e(".et-pb-yoast-loading").remove(),i.find("svg").first().after('<svg class="yoast-svg-icon et-pb-yoast-loading yoast-svg-icon-loading-spinner SvgIcon__StyledSvg-jBzRth mPAyu" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 66 66" fill="#64a60a" style="position: absolute; background: #fff; border-radius: 5px; max-width: 18px;"><circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle></svg>'),this.parseShortcode(t,(function(e){var t=_.isUndefined(e.html)?"":e.html;F=t,YoastSEO.app.pluginReloaded("ET_PB_Yoast_Content")}),"yoast_preview_content")}},setModuleOrder:function(e,t){var i,o,n,a,s,l,_=JSON.parse(et_pb_options.et_builder_modules_with_children);if(void 0!==(i=$.findWhere({cid:e}))){if("column"!==(a=void 0!==i.attributes.module_type?i.attributes.module_type:i.attributes.type)&&"column_inner"!==a&&"specialty"!==t||(n=$.findWhere({cid:i.attributes.parent}),"column"===a&&"row_inner"===n.attributes.module_type&&(a="column_inner")),o=void 0!==this.order_modules_array[a]?this.order_modules_array[a]:0,i.attributes.module_order=o,"row"!==a&&"row_inner"!==a&&"section"!==a||void 0===i.attributes.columns_order||(i.attributes.columns_order=[]),"column"!==a&&"column_inner"!==a&&"specialty"!==t||(void 0!==n.attributes.columns_order?n.attributes.columns_order.push(o):n.attributes.columns_order=[o]),void 0!==_[a]){if(l=_[a],s=void 0!==this.order_modules_array.children_count[l]?this.order_modules_array.children_count[l]:0,i.attributes.child_start_from=s,void 0!==i.attributes.et_pb_content&&""!==i.attributes.et_pb_content){var d=V.getShortCodeChildTags(),r=window.wp.shortcode.regexp(d),c=i.attributes.et_pb_content.match(r);s+=null!==c?c.length:0}this.order_modules_array.children_count[l]=s}this.order_modules_array[a]=o+1}},setModuleAddresses:function(e,t,i){var o=$.findWhere({cid:e}),n=$.where({parent:e});if(!_.isUndefined(o)){var a=_.isUndefined(o.attributes.module_type)?o.attributes.type:o.attributes.module_type,s=o.get("_address"),l="section"===a?t.toString():"".concat(i,".").concat(t.toString()),d=!_.isUndefined(s)&&"et_pb_module_settings_migrations.value_changes.".concat(s),r=!!d&&x(et_pb_options,d),c=x(et_pb_options,"et_pb_module_settings_migrations.name_changes")&&!_.isUndefined(et_pb_options.et_pb_module_settings_migrations.name_changes[s]);l!==s&&(r&&(et_pb_options.et_pb_module_settings_migrations.value_changes[l]=_.clone(et_pb_options.et_pb_module_settings_migrations.value_changes[s]),delete et_pb_options.et_pb_module_settings_migrations.value_changes[s]),c&&(et_pb_options.et_pb_module_settings_migrations.name_changes[l]=_.clone(et_pb_options.et_pb_module_settings_migrations.name_changes[s]),delete et_pb_options.et_pb_module_settings_migrations.name_changes[s])),o.set({_address:l}),!_.isUndefined(n)&&n.length>0&&_.forEach(n,(function(e,t){V.setModuleAddresses(e.attributes.cid,t,l)}))}},updateAdvancedModulesOrder:function(t){var i,o=void 0!==t?t.find(".et-pb-option-advanced-module-settings"):e(".et-pb-option-advanced-module-settings"),n=0;o.length&&(i=o.find(".et-pb-sortable-options > li")).length&&i.each((function(){var t,i,o,a=e(this).data("cid");t=$.findWhere({cid:a}),o=void 0!==(i=$.findWhere({cid:t.attributes.parent_cid})).attributes.child_start_from?i.attributes.child_start_from:0,t.attributes.module_order=n+o,n++}))}}),s.Controls={},s.Controls.BorderRadiusControl=function(e){this.initialize(e)},e.extend(s.Controls.BorderRadiusControl.prototype,{initialize:function(e){if(this._container=e,this._setting_field=e.siblings(".et-pb-main-setting"),!this._setting_field.length)return!1;this._link_button=e.find(".et-pb-border-radius-wrap-link-button > a"),this._radius_fields=e.find(".et-pb-border-radius-option-input"),this._radius_preview=e.find(".et-pb-border-radius-preview"),this._defalut_value=_.isUndefined(this._setting_field.data("default_inherited"))?this._setting_field.data("default"):this._setting_field.data("default_inherited");var t=this._setting_field.val();if(_.isEmpty(t)){t=this._defalut_value,this._setting_field.val(this._defalut_value);var i=this._setting_field;setTimeout((function(){i.trigger("et_pb_setting:change")}),100)}var o=t;this._values=this._splitValue(o),this._lastValue="",this._setting_field.on("change",this._onSettingChange.bind(this)),this._radius_fields.on("change",this._onFieldChange.bind(this)),this._link_button.on("click",this._onClickLink.bind(this)),this._render()},_onClickLink:function(e){if(e.preventDefault(),e.stopPropagation(),this._getSettingValue("border-link")){var t=this._getValues();t["border-link"]=!1,this._onChange(this._combineValues(t))}else{""===this._lastValue&&(this._lastValue=this._getSettingValue("top-left"));var i=this._spreadValue(this._lastValue);this._onChange(this._combineValues(i))}},_onSettingChange:function(e){var t=_.isUndefined(e.target.value)||""===e.target.value?this._getDefaultValue():e.target.value;this._values=this._splitValue(t),this._render()},_onChange:function(t){var i=_.isUndefined(t)?this._getDefaultValue():t;e(this._setting_field).val(i),this._values=this._splitValue(i),e(this._setting_field).trigger("et_pb_setting:change"),this._render()},_isOn:function(e){return"on"===e},_isLinkedMode:function(){return this._getSettingValue("border-link")},_spreadValue:function(e){return{"border-link":!0,"top-left":e,"top-right":e,"bottom-right":e,"bottom-left":e}},_onFieldChange:function(e){var t,i=Se(e.target.value,!1);if(this._lastValue=i,this._isLinkedMode())t=this._spreadValue(i);else{var o=e.target.getAttribute("data-corner");(t=this._getValues())[o]=i}this._onChange(this._combineValues(t))},_getDefaultValue:function(){return _.isUndefined(this._defalut_value)||""===this._defalut_value?"on||||":this._setting_field.val()},_getValues:function(){return this._values},_getSettingValue:function(e){return this._getValues()[e]},_splitValue:function(e){var t=e.split("|");return{"border-link":!!_.isUndefined(t[0])||this._isOn(t[0]),"top-left":_.isUndefined(t[1])||""===t[1]?"0px":t[1],"top-right":_.isUndefined(t[2])||""===t[2]?"0px":t[2],"bottom-right":_.isUndefined(t[3])||""===t[3]?"0px":t[3],"bottom-left":_.isUndefined(t[4])||""===t[4]?"0px":t[4]}},_combineValues:function(e){return"".concat(e["border-link"]?"on":"off","|").concat(e["top-left"],"|").concat(e["top-right"],"|").concat(e["bottom-right"],"|").concat(e["bottom-left"])},_render:function(){_.each(this._radius_fields,(function(t){e(t).val(this._getSettingValue(e(t).data("corner")))}),this),e(this._link_button).toggleClass("active",this._getSettingValue("border-link")),e(this._radius_preview).css("border-top-left-radius",this._getSettingValue("top-left")),e(this._radius_preview).css("border-top-right-radius",this._getSettingValue("top-right")),e(this._radius_preview).css("border-bottom-right-radius",this._getSettingValue("bottom-right")),e(this._radius_preview).css("border-bottom-left-radius",this._getSettingValue("bottom-left"))}}),s.Controls.BorderRadius=function(t){var i=t.find(".et-pb-border-radius-wrap");i.length&&i.each((function(){new s.Controls.BorderRadiusControl(e(this))}))},s.Controls.TabbedControl=function(e){this.initialize(e)},e.extend(s.Controls.TabbedControl.prototype,{_getByPath:function(e,t){return _.reduce(t.split("."),(function(e,t){return e?e[t]:void 0}),e)},initialize:function(t){var i=t.find(".et-pb-settings-tab"),o=t.find(".et-pb-settings-tab-content");if(!i.length||!o.length)return!1;var n=this;this._$container=t,this._suffix=t.data("attr-suffix"),this._tabs={},this._tab_content={},this._first_tab=null,this._active_tab=null,this._tab_settings_map=null,this._outside_preview=t.find(".et-pb-outside-preview-container"),this._reset_button=t.closest(".et-pb-composite-tabbed-wrapper").siblings(".et-pb-composite-tabbed-reset-setting"),this._is_child_settings_container=t.parents(".et_pb_modal_settings_container").hasClass("et_pb_modal_settings_container_step2"),i.each((function(){var t=e(this).find(".et-pb-settings-tab-title");n._tabs[e(t).data("tab")]=t,t.length&&t.on("click",n._onClickTab.bind(n))})),o.each((function(t,i){var o=e(i).data("tab");n._tab_content[o]={content:this,"preview-area":e(i).find(".et-pb-tab-preview-container")},0===t&&(n._first_tab=o,n._active_tab=o)})),setTimeout((function(){n._buildTabSettingsMap(),e(o).on("et_pb_setting:change et_pb_setting:color_picker:change",n._onChangeHandler.bind(n)),e(o).on("change","select",n._onChangeHandler.bind(n)),e(n._reset_button).on("click",n._onClickReset.bind(n)),n._render()}),100)},_buildTabSettingsMap:function(){var t={};_.map(this._tab_content,(function(i,o){t[o]={};var n=!1;e(i.content).find(".et-pb-main-setting").each((function(i,a){var l=ve(e(a)),_=e(a).parents(".et-pb-composite-tabbed-option").data("control-index");t[o][_]={},t[o][_].default=l,t[o][_].value=s.Helpers.getSettingValue(e(a)),n=n||!we(e(a))})),_.contains(["top_divider","bottom_divider"],o)?t[o].modified=t[o]["".concat(o,"_style")].value!==t[o]["".concat(o,"_style")].default:t[o].modified=n})),this._tab_settings_map=t},_isAnySettingModified:function(){var e=!1;return _.map(this._tab_settings_map,(function(t){this._getByPath(t,"modified")&&(e=!0)}),this),e},_onChangeHandler:function(e){setTimeout(this._onSettingChange.bind(this),100)},_onSettingChange:function(){this._buildTabSettingsMap(),this._render()},_onClickTab:function(e){e.preventDefault();var t=e.target.getAttribute("data-tab");this._makeTabActive(t),this._render()},_onClickReset:function(){var e=this;_.map(this._tab_settings_map,(function(t){_.map(t,(function(t,i){e._$container.find('[data-control-index="'.concat(i,'"]')).find(".et-pb-reset-setting").trigger("click")}),this)})),this._active_tab=this._first_tab},_makeTabActive:function(e){this._active_tab=e},_showTab:function(t){e(this._tabs[t]).closest(".et-pb-settings-tab").addClass("active"),e(this._tab_content[t].content).show()},_hideTab:function(t){e(this._tabs[t]).closest(".et-pb-settings-tab").removeClass("active"),e(this._tab_content[t].content).hide()},_renderOutsidePreviewArea:function(e){return!1},_renderTabPreviewArea:function(e,t){return!1},_render:function(){this._renderOutsidePreviewArea(this._outside_preview),this._renderTabPreviewArea(this._active_tab,this._tab_content[this._active_tab]["preview-area"]),_.map(this._tabs,(function(t,i){i===this._active_tab?this._showTab(i):this._hideTab(i),this._tab_settings_map[i].modified?e(this._tabs[i]).closest(".et-pb-settings-tab").addClass("modified"):e(this._tabs[i]).closest(".et-pb-settings-tab").removeClass("modified")}),this),this._isAnySettingModified()?e(this._reset_button).addClass("et-pb-reset-icon-visible"):e(this._reset_button).removeClass("et-pb-reset-icon-visible")}}),s.Controls.Tabbed=function(t){var i=t.find(".et-pb-composite-tabbed");i.length&&i.each((function(){new s.Controls.TabbedControl(e(this))}))},s.Controls.BorderStylesControl=function(e){this._setting_values=null,this._had_previously_resetted=!1,this.initialize(e)},e.extend(s.Controls.BorderStylesControl.prototype,s.Controls.TabbedControl.prototype,{_processWidth:function(e){var t=parseInt(e);return t>50&&(t=50),Se(t.toString(),!1,"px")},_setControlInitials:function(e){var t=e.parents(".et-pb-composite-tabbed-option").data("control-index");this._setting_values[t]={};var i=e.data("saved_value"),o=me(e),n="",a="",s="";if(e.hasClass("et-pb-range")){var l=e.siblings(".et-pb-range-input");a=l.data(o),s=l.data("default_inherited"),n=l.val(),l.data("check_attr_default","yes")}else n=e.val(),a=e.data(o),s=e.data("default_inherited"),e.data("check_attr_default","yes");var d=_.isUndefined(a)?"":a,r="",c=(r=_.isUndefined(i)?n:_.isEmpty(i)?n===a?a:"":i)!==d;_.isEmpty(s)||(_.isEmpty(r)||r===s)&&(c=!1),_.isEmpty(s)||a===s||c||this._updateControl(e,a,!1),this._setting_values[t].saved_value=c?r:"",this._setting_values[t].default_value=a,this._setting_values[t].default_inherited=s,this._setting_values[t].control=e;var p=t.replace(this._suffix,"").lastIndexOf("_"),b=t.substr(p).replace(this._suffix,"");this._setting_values[t].tab="border".concat(b);var u=this._tab_settings_map["border".concat(b)].modified;this._tab_settings_map["border".concat(b)].modified=u||c},_recalculateEdgeSettings:function(e){if(-1!==e.indexOf("all")){var t=e.replace(this._suffix,"").lastIndexOf("_"),i=e.substr(0,t),o=this;_.map(this._setting_values,(function(t,n){if(-1!==n.indexOf(i)&&-1===n.indexOf("all")){var a=t.control,s=_.isEmpty(o._setting_values[e].saved_value)?o._setting_values[e].default_value:o._setting_values[e].saved_value;if(_.isEmpty(t.default_inherited))t.default_value=s,_.isEmpty(t.saved_value)?o._updateControl(a,s,s):o._updateControl(a,!1,s);else{s=o._setting_values[e].saved_value;var l=o._setting_values[e].default_value;if(_.isEmpty(t.saved_value))if(_.isEmpty(s))if(_.isEmpty(t.saved_default))t.default_value===t.default_inherited?(t.default_value=l,o._updateControl(a,l,l)):o._updateControl(a,t.default_value,!1);else{var d=t.saved_default;t.default_value=d,o._updateControl(a,d,d),t.saved_default=""}else _.isEmpty(t.saved_default)&&(t.saved_default=t.default_value),t.default_value=s,o._updateControl(a,s,s);else{var r=_.isEmpty(s)?l:s;t.default_value=r,o._updateControl(a,t.saved_value,r)}}}}))}},_onSettingChange:function(e,t,i){var o=i?"":s.Helpers.getSettingValue(e);this._updateSetting(t,o),this._recalculateEdgeSettings(t)},_onChangeHandler:function(t,i){if(_.isUndefined(i)||"et_pb_from_all_tab"!==i){var o=e(t.target),n=o.parents(".et-pb-composite-tabbed-option").data("control-index"),a=!_.isUndefined(i)&&"et_pb_reset_setting"===i;this._had_previously_resetted?this._had_previously_resetted=!1:(a&&(this._had_previously_resetted=!0),"et_pb_setting:color_picker:change"===t.type?(this._updateSetting(n,i),this._recalculateEdgeSettings(n)):-1===n.indexOf("color")&&this._onSettingChange(o,n,a),this._render())}},_updateSetting:function(e,t){var i=this,o=this._setting_values[e],n=t!==o.default_value;o.saved_value=n?t:"";var a=o.tab,s=!1;_.map(this._tab_settings_map[a],(function(e,t){if("modified"!==t){var o=i._setting_values[t].saved_value,a=i._setting_values[t].default_value;n=!_.isEmpty(o)&&o!==a,s=s||n}})),this._tab_settings_map[a].modified=s},_updateControl:function(e,t,i){var o=me(e),n=e.hasClass("et-pb-range"),a=null;n&&(a=e.siblings(".et-pb-range-input")),i&&(n?(a.data(o,i),e.data(o,parseFloat(i)||0)):e.data(o,i)),t&&(n&&(e.val(parseFloat(t)||0),e=a),e.val(t).trigger("change",["et_pb_from_all_tab"]))},_resetAllTab:function(){var e=this;_.map(this._setting_values,(function(t,i){-1!==i.indexOf("all")&&(t.saved_value="",e._updateControl(t.control,t.default_value,!1),e._recalculateEdgeSettings(i))}))},_resetEdgeTabs:function(){_.map(this._setting_values,(function(e,t){-1===t.indexOf("all")&&(_.isEmpty(e.default_inherited)?e.default_value="":_.isEmpty(e.saved_default)||(e.default_value=e.saved_default,e.saved_default=""),e.saved_value="")}))},_onClickReset:function(){this._is_child_settings_container?(this._resetAllTab(),this._resetEdgeTabs()):(this._resetEdgeTabs(),this._resetAllTab()),this._active_tab=this._first_tab,this._render()},_buildTabSettingsMap:function(){var t=this,i={};_.map(this._tab_content,(function(t,o){i[o]={},e(t.content).find(".et-pb-main-setting").each((function(t,n){var a=e(n).parents(".et-pb-composite-tabbed-option").data("control-index");i[o][a]={}})),i[o].modified=!1})),this._tab_settings_map=i,null===this._setting_values&&(this._setting_values={},_.map(this._tab_content,(function(i,o){"border_all"!==o&&e(i.content).find(".et-pb-main-setting").each((function(i,o){t._setControlInitials(e(o))}))})),e(this._tab_content.border_all.content).find(".et-pb-main-setting").each((function(i,o){t._setControlInitials(e(o));var n=e(o).parents(".et-pb-composite-tabbed-option").data("control-index");t._recalculateEdgeSettings(n)})))},_renderTabPreviewArea:function(e,t){var i=["width","style","color"],o={};_.forEach(["top","right","bottom","left"],(function(e){var t="";_.forEach(i,(function(i){var o="border_".concat(i,"_").concat(e).concat(this._suffix),n=_.isEmpty(this._setting_values[o].saved_value)?this._setting_values[o].default_value:this._setting_values[o].saved_value;"width"==i&&(n=this._processWidth(n)),t+=" ".concat(n)}),this),o["border-".concat(e)]=t}),this),_.map(o,(function(e,i){t.find(".et-pb-tab-preview-container-preview").css(i,e)}),this)}}),s.Controls.BorderStyles=function(t){var i=t.find(".et-pb-composite-tabbed-border-style");i.length&&i.each((function(){new s.Controls.BorderStylesControl(e(this))}))},e("body").on("click contextmenu","#et_pb_layout_right_click_overlay",(function(e){e.preventDefault(),i()}));var u,v=_.extend({},Backbone.Events),k=new s.Layout,$=new s.Modules,T=new s.Histories,V=new s.AppView({model:s.Module,collection:$,history:T}),U=new s.visualizeHistoriesView,O=e("#et_pb_hidden_editor"),A=(O.html(),e("#et_pb_toggle_builder")),M=e(".et_pb_toggle_builder_wrapper"),L=e("#et_pb_layout"),E=e("#et_pb_old_content"),D=e("#formatdiv"),I=e("#et_pb_use_builder"),P=e("#et_pb_main_editor_wrap"),R=e(".et_pb_page_setting"),H=e(".et_pb_page_layout_settings"),N=[],B=0,z=0,F=!1,W={};s.Events=v;var J={is_active:function(){return!(!e("#et_pb_use_ab_testing").length||"on"!==e("#et_pb_use_ab_testing").val())},toggle_status:function(t){var i=e("#et_pb_use_ab_testing"),o=i.val();t=!_.isUndefined(t)&&t;("on"===o&&!t||("off"===o||""===o)&&t)&&i.addClass("et_pb_value_updated"),ne(),t?(i.val("on"),this.toggle_portability(!1)):i.val("off")},toggle_portability:function(t){var i=e(".et-pb-app-portability-button"),o="et-core-disabled",n=i.hasClass(o);_.isUndefined(t)&&(t=!!n),t?i.removeClass(o):i.addClass(o)},get_stats_refresh_interval:function(){return e("#et_pb_ab_stats_refresh_interval").length?e("#et_pb_ab_stats_refresh_interval").val():"hourly"},get_shortcode_tracking_status:function(){return e("#_et_pb_enable_shortcode_tracking").length&&""!==e("#_et_pb_enable_shortcode_tracking").val()?e("#_et_pb_enable_shortcode_tracking").val():"off"},is_active_based_on_models:function(){var e=$.where({et_pb_ab_subject:"on"}),t=$.where({et_pb_ab_goal:"on"});return e.length>1&&t.length>0},has_permission:function(){return"1"===et_pb_ab_js_options.has_permission},check_create_db:function(){return"exists"!==et_pb_options.ab_db_status&&e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_create_ab_tables",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce},success:function(e){if(!e.length||"success"!==e)return!1;et_pb_options.ab_db_status="exists"}}),!0},is_selecting_subject:function(){return!_.isUndefined(V.is_selecting_ab_testing_subject)&&!0===V.is_selecting_ab_testing_subject},is_selecting_goal:function(){return!_.isUndefined(V.is_selecting_ab_testing_goal)&&!0===V.is_selecting_ab_testing_goal},is_selecting_winner:function(){return!_.isUndefined(V.is_selecting_ab_testing_winner)&&!0===V.is_selecting_ab_testing_winner},is_selecting:function(){return!!(this.is_selecting_subject()||this.is_selecting_goal()||this.is_selecting_winner())},is_subject:function(e){return!(!this.is_active()||k.is_app(e)||!e.has("et_pb_ab_subject")||"on"!==e.get("et_pb_ab_subject"))},is_subject_children:function(e){var t=k.getParentViews(e.attributes.parent),i=!1;return _.isEmpty(t)||_.each(t,(function(e){_.isUndefined(e.model.get("et_pb_ab_subject"))||"on"!==e.model.get("et_pb_ab_subject")||(i=!0)})),i},is_unremovable_subject:function(e){return!!(this.is_active()&&this.is_subject(e)&&this.subjects().length<3)},is_goal:function(e){return!(!this.is_active()||k.is_app(e)||!e.has("et_pb_ab_goal")||"on"!==e.get("et_pb_ab_goal"))},is_goal_children:function(e){var t=k.getParentViews(e.attributes.parent),i=!1;return _.isEmpty(t)||_.each(t,(function(t){!k.is_app(e)&&t.model.has("et_pb_ab_goal")&&"on"===t.model.get("et_pb_ab_goal")&&(i=!0)})),i},is_user_has_permission:function(e,t,i){if(!e)return!1;var o,n=k.getView(e),a=(i=_.isUndefined(i)?n.model:i,J.has_permission()),s=J.is_subject(i),l=J.is_subject_children(i),d=J.has_subject(i),r=J.is_goal(i),c=J.is_goal_children(i),p=J.has_goal(i);return o="section"===t?s||d||r||p:"module"===t||"add_module"===t?s||l||r||c:"add_row"===t||"paste"===t?l||c:"copy"===t?s||d||r||p:s||l||d||r||c||p,!(!a&&o)},is_ab_testing_item:function(e){return!!(this.is_subject(e)||this.is_subject_children(e)||this.has_subject(e)||this.is_goal(e)||this.is_goal_children(e)||this.has_goal(e))},filter_goals:function(e){return _.filter(e,(function(e){return!(!e.has("et_pb_ab_goal")||"on"!==e.get("et_pb_ab_goal"))}))},filter_subjects:function(e){return _.filter(e,(function(e){return!(!e.has("et_pb_ab_subject")||"on"!==e.get("et_pb_ab_subject"))}))},filter_models_by_cids:function(t,i){return i=_.isUndefined(i)?$.models:i,_.filter(i,(function(i){return-1!==e.inArray(i.get("parent"),t)}))},pluck_cids_from_models:function(e){var t=[];return _.each(e,(function(e){t.push(e.get("cid"))})),t},has_goal:function(e){var t="function"==typeof e.get&&e.get("cid"),i=!1;return this.is_active()&&!1!==t&&_.each(k.getChildrenViews(t),(function(e){"on"===e.model.get("et_pb_ab_goal")&&(i=!0)})),i},has_subject:function(e){var t="function"==typeof e.get&&e.get("cid"),i=!1;return this.is_active()&&_.each(k.getChildrenViews(t),(function(e){"on"===e.model.get("et_pb_ab_subject")&&(i=!0)})),i},has_unremovable_subject:function(e){var t,i,o,n,a,s,l=e.get("cid"),d=e.get("type"),r=[],c=[];if(this.is_active()){if("section"===d){if(t=$.where({parent:l}),i=this.filter_subjects(t),this.count_subjects()-i.length<2)return!0;if(r=this.pluck_cids_from_models(t),!_.isUndefined(e.get("et_pb_specialty"))&&"on"===e.get("et_pb_specialty")){o=this.filter_models_by_cids(r);var p=this.filter_subjects(o);if(this.count_subjects()-p.length<2)return!0;r=this.pluck_cids_from_models(o)}}if("row"!==d&&"row_inner"!==d||(r=[l]),("section"===d||"row_inner"===d||"row"===d)&&(n=this.filter_models_by_cids(r),c=this.pluck_cids_from_models(n),a=this.filter_models_by_cids(c),s=this.filter_subjects(a),this.count_subjects()-s.length<2))return!0}return!1},subjects:function(){var e=$.where({et_pb_ab_subject:"on"});return e},subject_ids:function(){var e=this.subjects(),t=[];return e.length>0&&_.each(e,(function(e){e.has("et_pb_ab_subject_id")&&t.push(e.get("et_pb_ab_subject_id"))})),t},count_subjects:function(){return this.subjects().length},get_subject_id:function(){if(0===this.count_subjects())return 0;var e=this.subjects(),t=[];return _.each(e,(function(e){e.has("et_pb_ab_subject_id")?t.push(parseInt(e.get("et_pb_ab_subject_id"))):t.push(0)})),(Math.max.apply(Math,t)+1).toString()},set_subject:function(t,i){var o=this;if("removed"!==t.model.get("component_status")){if("exists"!==et_pb_options.ab_db_status)return setTimeout((function(){o.set_subject(t,"waiting")}),500),void v.trigger("et-pb-loading:started");void 0!==i&&"waiting"===i&&v.trigger("et-pb-loading:ended"),t.model.set("et_pb_ab_subject","on"),t.model.set("et_pb_ab_subject_id",o.get_subject_id()),t.$el.addClass("et_pb_ab_subject"),V.is_selecting_ab_testing_subject=!1,e("#et_pb_layout").removeClass("et_pb_select_ab_testing_subject"),J.count_subjects()<2&&(V.is_selecting_ab_testing_goal=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_goal"),J.alert("select_ab_testing_goal")),V.saveAsShortcode()}},set_subject_rank_coloring:function(t){var i=et_pb_ab_js_options.subjects_rank,o=!!t.model.has("et_pb_ab_subject_id")&&"subject_".concat(t.model.get("et_pb_ab_subject_id")),n=t.model.get("type"),a=".et-pb-module-title";switch(n){case"section":a=".et-pb-section-title";break;case"row_inner":case"row":a=".et-pb-row-title"}!o||_.isUndefined(i[o])||_.isUndefined(i[o].rank)||_.isUndefined(i[o].percentage)||(t.$el.addClass("rank-".concat(i[o].rank)),t.$el.find(a).append(" (".concat(i[o].percentage,")"))),t.model.has("et_pb_ab_subject_id")&&("module"===n?(t.$el.find(".et-pb-ab-subject-id").remove(),t.$el.find(".et-pb-remove").after(e("<span />",{class:"et-pb-ab-subject-id"}).text(t.model.get("et_pb_ab_subject_id")))):(t.$el.find(".et-pb-ab-subject-id").remove(),t.$el.find(a).append(e("<span />",{class:"et-pb-ab-subject-id"}).text(t.model.get("et_pb_ab_subject_id")))))},set:function(t,i){if(this.is_selecting_subject()){if(!_.isUndefined(t.model.get("et_pb_global_parent")))return void J.alert("cannot_select_global_children_as_subject");(k.is_global(t.model)||k.is_global_children(t.model))&&k.removeGlobalAttributes(t,!0),this.set_subject(t),setTimeout((function(){V.disable_publish=!0,e("#publish").addClass("disabled")}),750)}else if(this.is_selecting_goal()){if(!_.isUndefined(t.model.get("et_pb_global_parent")))return void J.alert("cannot_select_global_children_as_goal");if("removed"===t.model.get("component_status"))return;if(this.has_subject(t.model))return void this.alert("cannot_select_subject_parent_as_goal");V.is_doing_combination=!0,(k.is_global(t.model)||k.is_global_children(t.model))&&k.removeGlobalAttributes(t,!0),t.model.set("et_pb_ab_goal","on"),t.$el.addClass("et_pb_ab_goal"),V.is_selecting_ab_testing_goal=!1,e("#et_pb_layout").removeClass("et_pb_select_ab_testing_goal"),e("#et_pb_ab_goal_module").val(t.options.model.attributes.module_type);var o=$.findWhere({et_pb_ab_subject:"on"}),n=!_.isUndefined(o.cid)&&k.getView(o.get("cid"));if(n){var a,l={model:n.model,view:n.$el,view_event:i};(a=new s.RightClickOptionsView(l,!0)).copy(i),a.pasteAfter(i),J.alert("configure_ab_testing_alternative"),this.update()}Ue(),setTimeout((function(){V.is_doing_combination=!1,V.allowHistorySaving("turnon","abtesting"),e("#et_pb_layout .et-pb-app-view-ab-stats-button").addClass("active"),delete V.disable_publish,e("#publish").removeClass("disabled")}),650)}else if(this.is_selecting_winner())if(t.options.model.has("et_pb_ab_subject")&&"on"===t.options.model.get("et_pb_ab_subject")){var d,r=$.where({et_pb_ab_subject:"on"});if(V.is_doing_combination=!0,V.is_selecting_ab_testing_winner=!1,_.each(r,(function(e){t.model.attributes.cid!==e.attributes.cid&&(n=k.getView(e.attributes.cid),"section"===(d=n.model.get("type"))?n.removeSection():"row"===d||"row_inner"===d?n.removeRow():"module"===d&&n.removeModule())})),t.model.unset("et_pb_ab_subject"),t.model.unset("et_pb_ab_subject_id"),t.model.has("et_pb_collapsed")&&"on"===t.model.get("et_pb_collapsed")&&t.model.unset("et_pb_collapsed"),k.is_temp_global(t.model)||k.is_temp_global_children(t.model))return void G("set_global_subject_winner",void 0,void 0,void 0,{view:t});this.turn_off_ab_testing_sequence()}else J.alert("select_ab_testing_winner_first")},turn_off_ab_testing_sequence:function(){et_pb_ab_js_options.subjects_rank={},Ue(),setTimeout((function(){V.is_doing_combination=!1,V.allowHistorySaving("turnoff","abtesting"),delete V.disable_publish,e("#publish").removeClass("disabled")}),650),e("#et_pb_layout").removeClass("et_pb_select_ab_testing_winner"),e("#et_pb_layout .et-pb-app-view-ab-stats-button").removeClass("active"),this.toggle_portability(!0),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_clear_stats",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_test_id:et_pb_ab_js_options.test_id},success:function(e){et_pb_ab_js_options.has_report=!1,V.ab_stats={}}})},update_saved_subject_ids:function(){var t=this.subject_ids().join();e("#et_pb_ab_subjects").val()!==t&&e("#et_pb_ab_subjects").val(t).addClass("et_pb_value_updated"),ne()},update_layout:function(){if(this.is_active()){setTimeout((function(){var t=e("#et_pb_layout");J.count_subjects()<3?t.addClass("et_pb_ab_disable_subject_removal"):t.removeClass("et_pb_ab_disable_subject_removal")}),100),e(".et_pb_section.et_pb_ab_subject").length&&(e(".et_pb_ab_subject_first").removeClass("et_pb_ab_subject_first"),e(".et_pb_ab_subject_last").removeClass("et_pb_ab_subject_last"),e(".et_pb_section").each((function(){var t=e(this);t.find(".et_pb_section.et_pb_ab_subject").first().addClass("et_pb_ab_subject_first"),t.find(".et_pb_section.et_pb_ab_subject").last().addClass("et_pb_ab_subject_last")})),e(".et_pb_section.et_pb_ab_subject").each((function(){var t=e(this);t.prev().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_first"),t.next().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_last")}))),e(".et_pb_row.et_pb_ab_subject").length&&(e(".et_pb_ab_subject_first").removeClass("et_pb_ab_subject_first"),e(".et_pb_ab_subject_last").removeClass("et_pb_ab_subject_last"),e(".et_pb_section").each((function(){var t=e(this);t.find(".et_pb_row.et_pb_ab_subject").first().addClass("et_pb_ab_subject_first"),t.find(".et_pb_row.et_pb_ab_subject").last().addClass("et_pb_ab_subject_last")})),e(".et_pb_row.et_pb_ab_subject").each((function(){var t=e(this);t.prev().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_first"),t.next().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_last")}))),(e(".et_pb_row.et_pb_ab_subject.et_pb_ab_no_permission").length||e(".et_pb_row.et_pb_ab_goal.et_pb_ab_no_permission").length)&&e(".et_pb_row.et_pb_ab_subject.et_pb_ab_no_permission, .et_pb_row.et_pb_ab_goal.et_pb_ab_no_permission").each((function(){e(this).closest(".et_pb_section").addClass("et_pb_ab_no_permission_parent")})),e(".et_pb_module_block.et_pb_ab_subject").length&&(e(".et_pb_ab_subject_first").removeClass("et_pb_ab_subject_first"),e(".et_pb_ab_subject_last").removeClass("et_pb_ab_subject_last"),e(".et-pb-column").each((function(){var t=e(this);t.find(".et_pb_module_block.et_pb_ab_subject").first().addClass("et_pb_ab_subject_first"),t.find(".et_pb_module_block.et_pb_ab_subject").last().addClass("et_pb_ab_subject_last")})),e(".et_pb_module_block.et_pb_ab_subject").each((function(){var t=e(this);t.prev().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_first"),t.next().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_last")}))),(e(".et_pb_module_block.et_pb_ab_subject.et_pb_ab_no_permission").length||e(".et_pb_module_block.et_pb_ab_goal.et_pb_ab_no_permission").length)&&e(".et_pb_module_block.et_pb_ab_subject.et_pb_ab_no_permission, .et_pb_module_block.et_pb_ab_goal.et_pb_ab_no_permission").each((function(){var t=e(this);t.closest(".et_pb_row").addClass("et_pb_ab_no_permission_parent"),t.closest(".et_pb_section").addClass("et_pb_ab_no_permission_parent")}));var t,i,o,n=!0;_.each(this.subjects(),(function(e){e.has("et_pb_collapsed")&&"off"!==e.get("et_pb_collapsed")||(n=!1)})),n&&(i=(t=e(".et_pb_ab_subject").first()).children(".et-pb-data-cid").attr("data-cid"),o=k.getView(i),t.length&&!_.isUndefined(o)&&(t.removeClass("et_pb_collapsed"),o.model.set("et_pb_collapsed","off")))}},update:function(){this.update_saved_subject_ids(),this.update_layout()},is_alert_valid:function(e){return!(!_.isUndefined(V.ab_last_visible_alert)&&V.ab_last_visible_alert===e)&&(V.ab_last_visible_alert=e,!0)},alert:function(e){this.is_alert_valid(e)&&G("ab_testing_alert",void 0,void 0,void 0,{id:e})},alert_yes_no:function(e){this.is_alert_valid(e)&&G("ab_testing_alert_yes_no",void 0,void 0,void 0,{id:e})},get_all_subjects_stats_settings:function(t){var i,o=e('.view-stats-tab[data-analysis="'.concat(t,'"]')),n=o.find(".et-pb-ab-view-stats-subjects-filter"),a=o.find(".et-pb-ab-view-stats-time-filter"),s=(o.find(".et-pb-options-tabs-links"),["first","second","third","fourth","fifth"]),l={subject_statuses:[],subject_ids:[],table:{thead:[],tbody:{},tfoot:[]}};a.find(".active").length||a.find('a[data-duration="'.concat(et_pb_ab_js_options.refresh_interval_duration,'"]')).addClass("active"),i=V.ab_stats[a.find(".active").attr("data-duration")],n.find("a").each((function(){var t=e(this),i=!t.hasClass("inactive"),o=!t.parent("li").hasClass("et-pb-no-data"),n=t.attr("data-subject-id");o&&l.subject_statuses.push(i),i&&o&&l.subject_ids.push(parseInt(n))}));for(var d=0;d<5;d++)l.table.thead[s[d]]=et_pb_ab_js_options.view_stats_thead_titles[t][d];return _.isUndefined(i)||(_.each(i.subjects_id,(function(o){var n="subject_".concat(o),a=$.findWhere({et_pb_ab_subject_id:o}),s=!(_.isUndefined(a)||!a.has("admin_label"))&&a.get("admin_label");s&&-1!==e.inArray(parseInt(o),l.subject_ids)&&(l.table.tbody[n]={first:o,second:s,third:i.subjects_totals[n][et_pb_ab_js_options.analysis_formula[t].denominator],fourth:i.subjects_totals[n][et_pb_ab_js_options.analysis_formula[t].numerator],fifth:"".concat(i.subjects_totals[n][t],"%")})})),l.table.tfoot={first:et_pb_ab_js_options.total_title,second:null,third:i.events_totals[et_pb_ab_js_options.analysis_formula[t].denominator],fourth:i.events_totals[et_pb_ab_js_options.analysis_formula[t].numerator],fifth:"".concat(i.events_totals[t],"%")}),l},switch_view_stats_tab:function(){var t=e(".et-pb-options-tabs-links"),i=e(".et-pb-ab-view-stats-content.has-data"),o=t.find("li.et-pb-options-tabs-links-active").attr("data-analysis");i.find(".view-stats-tab").removeClass("active"),i.find('.view-stats-tab[data-analysis="'.concat(o,'"]')).addClass("active")},display_stats_tabs:function(t){var i=this,o=_.template("<tr><th><%= first %></th><th><%= second %></th><th><%= third %></th><th><%= fourth %></th><th><%= fifth %></th></tr>"),n=_.template("<tr><td><%= first %></td><td><%= second %></td><td><%= third %></td><td><%= fourth %></td><td><%= fifth %></td></tr>"),a=_.template("<tr><td colspan='2'><%= first %></td></td><td><%= third %></td><td><%= fourth %></td><td><%= fifth %></td></tr>"),s=e(".et_pb_prompt_modal.et_pb_ab_view_stats"),l=$.findWhere({et_pb_ab_goal:"on"}).get("module_type"),d=e("#et_pb_ab_subjects").val().split(",");!_.isEmpty(t.subjects_totals)||et_pb_ab_js_options.has_report?(-1===e.inArray(l,et_pb_ab_js_options.have_conversions)?(e(".et_pb_options_tab_ab_stat_conversion, .view-stats-tab.tab-conversions").remove(),e(".et_pb_options_tab_ab_stat_clicks").addClass("et-pb-options-tabs-links-active")):"et_pb_shop"===l&&e(".et_pb_options_tab_ab_stat_conversion a").text(et_pb_ab_js_options.sales_title),"on"!==J.get_shortcode_tracking_status()&&e(".et_pb_options_tab_ab_stat_shortcode_conversions").remove(),s.find(".view-stats-tab").each((function(){var s,l,r,c,p=e(this),b=p.attr("data-analysis"),u=e("#ab-testing-stats-".concat(b)),g=e("#ab-testing-stats-pie-".concat(b)),h=e("#view-stats-table-".concat(b)),f=h.find("thead"),m=h.find("tbody"),w=h.find("tfoot"),y=p.find(".et-pb-ab-view-stats-subjects-filter"),k=p.find(".et-pb-ab-view-stats-time-filter"),C=p.find(".ab-testing-stats-pie-legends"),S=e(".et_pb_ab_view_stats .et-pb-options-tabs-links");t.dates;if(_.each(d,(function(t){"subject_".concat(t);var i=$.findWhere({et_pb_ab_subject_id:t}),o=!(_.isUndefined(i)||!i.has("admin_label"))&&i.get("admin_label");if(o){var n=e("<li />").append(e("<a />",{href:"#","data-subject-id":t}).text(o)),a=e("<li />",{"data-subject-id":t}).append(e("<a />",{href:"#"}).text(o)).prepend(e("<span />"));y.append(n),C.append(a)}})),_.isEmpty(t)||_.isUndefined(t)||!t){k.find('a[data-duration="'.concat(et_pb_ab_js_options.refresh_interval_duration,'"]')).addClass("active"),p.addClass("no-tab-data")}else{var x=i.draw_graphs(b,t,s,r,u,g,h,f,m,w,o,n,a,!0);s=x.line_chart,r=x.pie_chart,x.line_chart_data,x.pie_chart_data,l=x.line_chart_datasets,c=x.pie_chart_segments}y.on("click","a",(function(t){t.preventDefault();var _=e(this).attr("data-subject-id");e(this).toggleClass("inactive"),C.find('li[data-subject-id="'.concat(_,'"]')).toggleClass("inactive");var d=i.filter_stats_subject(b,s,r,l,c,h,f,m,w,o,n,a);s=d.line_chart,r=d.pie_chart})),C.on("click","a",(function(t){t.preventDefault();var i=e(this).parent("li").attr("data-subject-id");y.find('a[data-subject-id="'.concat(i,'"]')).trigger("click")})),S.on("click","a",(function(t){t.preventDefault(),e(this).hasClass("et-pb-ab-refresh-stats")||(S.find("li").removeClass("et-pb-options-tabs-links-active"),e(this).parent("li").addClass("et-pb-options-tabs-links-active"),i.switch_view_stats_tab())})),k.on("click","a",(function(d){d.preventDefault();var y=e(this),C=y.attr("data-duration");e(".et_pb_prompt_modal.et_pb_ab_view_stats");if(k.find("a").removeClass("active"),y.addClass("active"),_.isUndefined(V.ab_stats[C])||!V.ab_stats[C])v.trigger("et-pb-loading:started"),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_builder_data",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_ab_test_id:et_pb_ab_js_options.test_id,et_pb_ab_duration:C},success:function(e){if(p.removeClass("no-tab-data"),v.trigger("et-pb-loading:ended"),"false"!==e){e=JSON.parse(e),V.ab_stats[C]=e;var t=i.draw_graphs(b,e,s,r,u,g,h,f,m,w,o,n,a);s=t.line_chart,r=t.pie_chart,t.line_chart_data,t.pie_chart_data,l=t.line_chart_datasets,c=t.pie_chart_segments}else p.addClass("no-tab-data")}});else{p.removeClass("no-tab-data"),t=V.ab_stats[C];var S=i.draw_graphs(b,t,s,r,u,g,h,f,m,w,o,n,a);s=S.line_chart,r=S.pie_chart,S.line_chart_data,S.pie_chart_data,l=S.line_chart_datasets,c=S.pie_chart_segments}}))})),s.on("click",".et-pb-ab-refresh-stats",(function(){v.trigger("et-pb-loading:started"),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_clear_cache",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_test_id:et_pb_ab_js_options.test_id},success:function(t){V.ab_stats={},e(".et-pb-ab-view-stats-time-filter").find("a.active").trigger("click")}})})),s.addClass("et-pb-loaded").find(".et-pb-ab-view-stats-content.has-data, .et-pb-options-tabs-links").css({opacity:1}),i.switch_view_stats_tab()):(s.find(".et-pb-ab-view-stats-content.has-data, .et-pb-options-tabs-links").hide(),s.find(".et-pb-ab-view-stats-content.no-data").css({opacity:1,display:"block"}))},draw_graphs:function(t,i,o,n,a,s,l,d,r,c,p,b,u,g){var h={labels:i.dates,datasets:[]},f=[],m=a.closest(".view-stats-tab"),v=m.find(".et-pb-ab-view-stats-subjects-filter"),w=m.find(".ab-testing-stats-pie-legends");_.each(i.subjects_id,(function(e){var o="subject_".concat(e),n=$.findWhere({et_pb_ab_subject_id:e}),a=!_.isUndefined(n)&&!_.isUndefined(n.attributes.admin_label)&&n.attributes.admin_label,s=v.find('a[data-subject-id="'.concat(e,'"]')),l=w.find('li[data-subject-id="'.concat(e,'"] span'));a&&(_.isUndefined(s.attr("style"))&&s.css({backgroundColor:i.subjects_totals[o].color}),_.isUndefined(l.attr("style"))&&l.css({backgroundColor:i.subjects_totals[o].color}),h.datasets.push({subject_id:e,label:a,fillColor:"transparent",strokeColor:i.subjects_totals[o].color,pointColor:i.subjects_totals[o].color,pointStrokeColor:"#fff",data:_.values(i.subjects_analysis[o][t])}),f.push({value:i.subjects_totals[o][t],color:i.subjects_totals[o].color,label:"#".concat(e,": ").concat(a)}))})),v.find("li").removeClass("et-pb-no-data"),w.find("li").removeClass("et-pb-no-data"),_.each(e("#et_pb_ab_subjects").val().split(","),(function(t){-1===e.inArray(t,i.subjects_id)&&(v.find('a[data-subject-id="'.concat(t,'"]')).parent("li").addClass("et-pb-no-data"),w.find('li[data-subject-id="'.concat(t,'"]')).addClass("et-pb-no-data"))}));var y=this.get_all_subjects_stats_settings(t);if(d.empty().html(e(p(y.table.thead))),r.empty(),_.each(y.table.tbody,(function(t){r.append(e(b(t)))})),c.empty().html(e(u(y.table.tfoot))),_.size(y.table.tbody)>1){l.tablesorter();var k=l.find("thead th").first();k.hasClass(".headerSortDown")||setTimeout((function(){k.trigger("click")}),500)}_.isUndefined(o)||o.destroy(),a.closest(".view-stats-tab").addClass("et_pb_ab_visible_tab");var C,S=(o=new Chart(a.get(0).getContext("2d")).Line(h,{scaleFontSize:13,scaleFontColor:"#a1a9b1",scaleLabel:"<%=value%>%",scaleGridLineWidth:2,scaleLineWidth:2,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>%",multiTooltipTemplate:"<%= value %>%",datasetStrokeWidth:4,pointDotStrokeWidth:2,pointDotRadius:7})).datasets;if(_.isUndefined(n)||n.destroy(),s.is(":visible")&&(C=(n=new Chart(s.get(0).getContext("2d")).Pie(f,{animationEasing:"easeInCubic",animationSteps:50,tooltipTemplate:"<%if (label){%><%=label%><%}%>"})).segments),_.isUndefined(g)){var x=this.filter_stats_subject(t,o,n,S,C,l,d,r,c,p,b,u);o=x.line_chart,n=x.pie_chart}return a.closest(".view-stats-tab").removeClass("et_pb_ab_visible_tab"),{line_chart:o,pie_chart:n,line_chart_data:h,pie_chart_data:f,line_chart_datasets:S,pie_chart_segments:C}},filter_stats_subject:function(t,i,o,n,a,s,l,d,r,c,p,b){var u,g=this.get_all_subjects_stats_settings(t),h=_.compact(_.map(n,(function(e,t){return!!g.subject_statuses[t]&&e}))),f=_.compact(_.map(a,(function(e,t){return!!g.subject_statuses[t]&&e})));if(i.datasets=h,i.update(),l.empty(),d.empty(),r.empty(),l.html(e(c(g.table.thead))),_.each(g.table.tbody,(function(t){d.append(e(p(t)))})),(u=_.size(g.table.tbody))>1){s.tablesorter();var m=s.find("thead th").first();m.hasClass(".headerSortDown")||setTimeout((function(){m.trigger("click")}),500)}if(u>0){var v=_.pluck(g.table.tbody,"third"),w=_.pluck(g.table.tbody,"fourth"),y=_.map(_.pluck(g.table.tbody,"fifth"),(function(e){return parseFloat(e)})),k=_.reduce(v,(function(e,t){return e+t}),0),C=_.reduce(w,(function(e,t){return e+t}),0),S="".concat((_.reduce(y,(function(e,t){return e+t}),0)/_.size(y)).toFixed(2),"%");r.html(e(b({first:et_pb_ab_js_options.total_title,second:null,third:k,fourth:C,fifth:S})))}return o.segments=f,o.update(),{line_chart:i,pie_chart:o}},delete_post_meta:function(){this.toggle_status(!1),e("#et_pb_ab_subjects").val(""),ne()},subject_carousel:function(e){var t=k.getView(e),i=$.where({et_pb_ab_subject:"on"}),o=t.model.get("et_pb_collapsed"),n="on"===o?"off":"on";_.each(i,(function(e){var i=k.getView(e.attributes.cid);i.model.get("cid")===t.model.get("cid")?"on"===o&&i.model.set("et_pb_collapsed","off"):"on"===o?i.model.set("et_pb_collapsed","on"):i.model.set("et_pb_collapsed",n),"on"===i.model.get("et_pb_collapsed")?i.$el.addClass("et_pb_collapsed"):i.$el.removeClass("et_pb_collapsed")}))}};function K(){var t,i=e("body");e("#et_pb_fb_cta").removeClass("et_pb_ready"),ae("content",E.val()),window.wpActiveEditor="content","html"!==et_pb_options.wp_default_editor&&e("#content-tmce").trigger("click"),I.val("off"),L.hide(),A.text(A.data("builder")).toggleClass("et_pb_builder_is_used"),P.toggleClass("et_pb_post_body_hidden"),function(){var t=H.closest("#et_settings_meta_box").find(".et_pb_page_layout_settings");if(H.show().closest("#et_settings_meta_box").show(),H.closest("#et_settings_meta_box").find(".et_pb_side_nav_settings").hide(),H.closest("#et_settings_meta_box").find(".et_pb_single_title").hide(),D.length){D.show();var i=D.find('input[type="radio"]:checked').val();e(".et_divi_format_setting.et_divi_".concat(i,"_settings")).show()}if(t.length>0){var o=t.find("#et_pb_page_layout").val(),n=t.find('option[value="et_full_width_page"]');n.length>0&&n.hide(),"et_full_width_page"===o&&t.find("#et_pb_page_layout").val("et_no_sidebar")}"project"===et_pb_options.post_type&&H.closest("#et_settings_meta_box").find(".et_pb_project_nav").hide()}(),t=i.scrollTop(),i.scrollTop(t+1),v.trigger("et-deactivate-builder"),J.is_active()&&J.delete_post_meta(),e("form#post").append('<input type="hidden" name="et_pb_show_page_creation" value="off" />'),e(window).trigger("resize")}function G(t,o,a,s,l){var d,r=-1!==e.inArray(t,["save_template","reset_advanced_settings"])?" et_modal_on_top":"",c="reset_advanced_settings"===t?" et_modal_on_top_both_actions":"",p=e('<div class="et_pb_modal_overlay'.concat(r).concat(c,'" data-action="').concat(t,'"></div>')),b=e("#et-builder-prompt-modal-".concat(t)).length?e("#et-builder-prompt-modal-".concat(t)).html():e("#et-builder-prompt-modal").html(),u=_.template(e("#et-builder-prompt-modal-".concat(t,"-text")).html()),g=!0,h={};if(i(),e("body").addClass("et_pb_stop_scroll"),"save_template"===t){var f=void 0!==(x=k.getView(o.model.get("cid"))).model.get("parent")?k.getView(x.model.get("parent")):"",m=x.$el.find(".et_pb_global"),C=x.$el.is(".et_pb_global"),S=m.length?"has_global":"no_globals";h.is_global=void 0!==x.model.get("et_pb_global_module")&&""!==x.model.get("et_pb_global_module")?"global":"regular",h.is_global_child=""!==f&&(void 0!==f.model.get("et_pb_global_module")&&""!==f.model.get("et_pb_global_module")||void 0!==f.model.get("global_parent_cid")&&""!==f.model.get("global_parent_cid"))?"global":"regular",h.module_type=x.model.get("type")}if("delete_font"===t&&(h.font_name=o),_.isUndefined(l)||e.extend(h,l),p.append(b),p.find(".et_pb_prompt_modal").prepend(u(h)),"upload_font"===t&&(p.find('.et-core-portability-import-form input[type="file"]').on("change",(function(t){var i=e(this).get(0).files,o="",n=et_pb_options.supported_font_formats;_.isEmpty(i)||_.each(i,(function(e){var t=_.isUndefined(e.name)?"":e.name.toLowerCase();_.each(n,(function(e){".".concat(e);t.match("".concat(e,"$"))&&(o+='<div class="et-fb-font-files-list-item" data-file_format="'.concat(e,'" data-file_name="').concat(t,'"><span class="et-fb-font-files-list-item-remove"></span>').concat(t,"</div>"))}))})),""!==o&&(e(".et-font-uploader-selected-fonts").html(""),e(".et-font-uploader-selected-fonts").removeClass("et-font-uploader-hidden-field").append(o))})),p.find(".et-core-portability-import-form button").on("click",(function(t){t.preventDefault(),e(this).closest(".et-core-portability-import-form").find('input[type="file"]').trigger("click")})),p.on("click",".et-fb-font-files-list-item-remove",(function(t){e(t.target).closest(".et-fb-font-files-list-item").remove()})),p.find(".et-font-uploader-all-weights").on("change",(function(t){var i=e(this).prop("checked"),o=p.find(".et-font-uploader-weight-values");i?o.addClass("et-font-uploader-hidden-section"):o.removeClass("et-font-uploader-hidden-section")}))),"open_settings"===t&&(p.addClass("et_pb_builder_settings"),d='[et_pb_split_track id="'.concat(et_pb_ab_js_options.test_id,'" /]'),setTimeout((function(){e("#et_pb_ab_current_shortcode").val(d)}),100),p.find(".et_pb_prompt_field_list").each((function(){var t=e(this),i=t.attr("data-id"),o=t.attr("data-type"),n=(t.attr("data-autoload"),{et_pb_enable_ab_testing:"et_pb_use_ab_testing"}),a=e(void 0!==n[i]?"#".concat(n[i]):"#_".concat(i)).val();switch(o){case"yes_no_button":var s=t.find(".et_pb_yes_no_button_wrapper"),l=s.find(".et_pb_yes_no_button"),d=s.find("select");d.val(a),d.trigger("change"),l.on("click",(function(){var t=e(this);t.hasClass("et_pb_off_state")?(t.removeClass("et_pb_off_state").addClass("et_pb_on_state"),d.val("on")):(t.removeClass("et_pb_on_state").addClass("et_pb_off_state"),d.val("off")),d.trigger("change")})),d.on("change",(function(){var i=e(this).val();if("on"===i?l.removeClass("et_pb_off_state").addClass("et_pb_on_state"):l.removeClass("et_pb_on_state").addClass("et_pb_off_state"),""!==t.data("affects")){var o=t.attr("data-affects").split("|");_.each(o,(function(e){var o=p.find('.et_pb_prompt_field_list[data-id="'.concat(e,'"]')),n=o.attr("data-visibility-dependency");if(i===n&&t.hasClass("et-pb-visible"))o.addClass("et-pb-visible"),o.find("select").trigger("change");else if(o.removeClass("et-pb-visible"),""!==o.data("affects")){var a=o.data("affects").split("|");_.each(a,(function(e){p.find('.et_pb_prompt_field_list[data-id="'.concat(e,'"]')).removeClass("et-pb-visible")}))}}))}})),d.trigger("change");break;case"color-alpha":t.find(".input-colorpicker").val(a).wpColorPicker({width:313});break;case"colorpalette":var r=e(this),c=r.find(".input-colorpalette-colorpicker"),b=0,u=a.split("|");c.each((function(){var t=e(this),i=u[b];t.val(i).wpColorPicker({hide:!1,default:e(this).data("default-color"),width:313,palettes:!1,change:function(t,i){var o=e(this),n=o.attr("data-index"),a=p.find(".colorpalette-item-".concat(n)),s=i.color.toString();o.val(s),a.css({backgroundColor:s}),ne()}}),t.trigger("change"),t.siblings(".wp-picker-clear").on("click",(function(e){e.preventDefault(),t.wpColorPicker("color",i)})),t.closest(".wp-picker-container").find(".wp-color-result").attr("title",et_pb_options.select_text),t.closest(".wp-picker-container").on("click",".wp-color-result",(function(e){r.find(".colorpalette-colorpicker").removeClass("active")})),b++})),r.on("click",".colorpalette-item",(function(t){t.preventDefault();var i=e(this).attr("data-index");r.find(".colorpalette-colorpicker").removeClass("active"),r.find('.colorpalette-colorpicker[data-index="'.concat(i,'"]')).addClass("active")}));break;case"range":var g,h=t.find('input[type="range"]'),f=h.val(),m=h.attr("min"),v=h.attr("max"),w=h.parent("div"),y=e("<input />",{type:"number",step:1,class:"et-pb-range-input",min:m,max:v,value:f});h.val(a),w.append(y),g=w.find(".et-pb-range-input"),h.on("change input",(function(){var t=e(this).val();g.val(t)})),g.on("change keydown",(function(){var t=e(this).val();h.val(t)})),h.trigger("change");break;case"select":e(this).find("select").val(a);break;case"codemirror":case"textarea":e(this).find("textarea").val(a)}}))),"view_ab_stats"===t){if(e(".et-pb-ab-view-stats-content").length)return;v.trigger("et-pb-loading:started"),_.isUndefined(V.ab_stats)&&(V.ab_stats={}),_.isUndefined(V.ab_stats[et_pb_ab_js_options.refresh_interval_duration])?e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_builder_data",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_ab_test_id:et_pb_ab_js_options.test_id,et_pb_ab_duration:et_pb_ab_js_options.refresh_interval_duration},success:function(e){v.trigger("et-pb-loading:ended"),e=JSON.parse(e),V.ab_stats[et_pb_ab_js_options.refresh_interval_duration]=e,J.display_stats_tabs(e)}}):setTimeout((function(){v.trigger("et-pb-loading:ended"),J.display_stats_tabs(V.ab_stats[et_pb_ab_js_options.refresh_interval_duration])}),500)}if("ab_testing_alert_yes_no"!==t||_.isUndefined(l.id)||p.attr({"data-action":"".concat(t,"_").concat(l.id)}),e("body").append(p),"auto"===e(".et_pb_prompt_modal").css("bottom")&&(0,n.default)(p.find(".et_pb_prompt_modal"),".et_pb_prompt_buttons"),setTimeout((function(){p.find("select, input, textarea, radio").eq(0).trigger("focus")}),1),"rename_admin_label"===t){var x,j=p.find("input#et_pb_new_admin_label"),T=(x=k.getView(o)).model.get("admin_label").trim();""!==T&&j.val(T)}e(".et_pb_modal_overlay .et_pb_prompt_proceed").on("click",(function(t){t.preventDefault();var i=e(this).closest(".et_pb_modal_overlay");switch(i.data("action").trim()){case"deactivate_builder":K();break;case"clear_layout":V.removeAllSections(!0);break;case"rename_admin_label":var n=i.find("#et_pb_new_admin_label").val().trim(),d=k.getView(o);if(""==n)return void i.find("#et_pb_new_admin_label").trigger("focus");d.model.set("admin_label",n,{silent:!0}),d.renameModule(),V.allowHistorySaving("renamed","module",n),Ue();break;case"reset_advanced_settings":o.each((function(){Ce(e(this))}));break;case"save_layout":var r=i.find("#et_pb_new_layout_name").val().trim();if(""==r)return void i.find("#et_pb_new_layout_name").trigger("focus");e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_save_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_name:r,et_layout_content:ee("content"),et_layout_type:"layout",et_post_type:et_pb_options.post_type},success:function(e){"layout"!==et_pb_options.post_type?y=w():Le("not_predefined","","",et_pb_options.post_type,!0)}});break;case"save_template":var c=i.find("#et_pb_new_template_name").val().trim(),b=i.find(e("#et_pb_template_global")).is(":checked")?"global":"not_global",u=e(".et_pb_module_settings").data("module_type"),h="section"===u||"row"===u?u:"module",f=void 0!==a?a:"regular",v=o.model.get("cid"),x="",j="",T=i.find("#et_pb_new_cat_name").val(),U=C||void 0!==S&&"has_global"===S&&"global"===b?"ignore_global":"include_global",O="ignore_global"===U?"ignore_global_tabs":"",A=e(".et_pb_modal_settings_container"),M=e(".et_pb_modal_overlay");if(h="row_inner"===u?"row":h,""==c)return void i.find("#et_pb_new_template_name").trigger("focus");e(".layout_cats_container input").is(":checked")&&e(".layout_cats_container input").each((function(){var t=e(this);t.is(":checked")&&(j+=""!==j?",".concat(t.val()):t.val())})),"module"===h&&o.model.set("et_pb_saved_tabs","all",{silent:!0}),o.performSaving(),x=V.generateCompleteShortcode(v,h,U,O),"row_inner"===u&&(x=(x=x.replace(/et_pb_row_inner/g,"et_pb_row")).replace(/et_pb_column_inner/g,"et_pb_column")),A.addClass("et_pb_modal_closing"),M.addClass("et_pb_overlay_closing"),setTimeout((function(){"module"===h&&se("et_pb_content"),A.remove(),M.remove(),e("body").removeClass("et_pb_stop_scroll")}),600),e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_save_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_name:c,et_layout_content:x,et_layout_scope:b,et_layout_type:h,et_module_width:f,et_columns_layout:s,et_selected_tabs:"all",et_module_type:u,et_layout_cats:j,et_layout_new_cat:T,et_post_type:et_pb_options.post_type},beforeSend:function(t){"global"===b&&(e("body").find(".et_pb_global_loading_overlay").length||e("body").append('<div class="et_pb_global_loading_overlay"></div>'))},success:function(t){"global"===b&&(V.collection.find((function(e){return e.get("cid")==v})).set("et_pb_global_module",t.post_id),"ignore_global"===U&&m.length&&m.each((function(){var t=e(this).data("cid");if(void 0!==t&&""!==t){var i=V.collection.find((function(e){return e.get("cid")==t}));i.unset("et_pb_global_module"),i.unset("et_pb_saved_tabs")}})),Ue(),setTimeout((function(){e("body").find(".et_pb_global_loading_overlay").remove()}),650));N={}}});break;case"open_settings":var L=p.find("#et_pb_enable_ab_testing"),E=p.find("#et_pb_ab_stats_refresh_interval").val(),D="on"===L.val(),I=p.find("#et_pb_enable_shortcode_tracking").val(),P=e("#_et_pb_ab_stats_refresh_interval"),R=e("#et_pb_enable_shortcode_tracking");p.find(".et_pb_prompt_field_list").each((function(){var t=e(this),i=t.attr("data-id"),o="1"===t.attr("data-autoload"),n=e("#_".concat(i)),a=[],s=n.val();o&&(t.hasClass("colorpalette")?(t.find(".input-colorpalette-colorpicker").each((function(){a.push(e(this).val())})),n.val(a.join("|")),s!==a.join("|")&&(n.addClass("et_pb_value_updated"),ne()),et_pb_options.page_color_palette=a.join("|")):(n.val(t.find("#".concat(i)).val()),s!==t.find("#".concat(i)).val()&&(n.addClass("et_pb_value_updated"),ne()),"et_pb_section_background_color"===n.attr("id")&&(et_pb_options.page_section_bg_color=t.find("#".concat(i)).val()),"et_pb_page_gutter_width"===n.attr("id")&&(et_pb_options.page_gutter_width=t.find("#".concat(i)).val())))})),J.toggle_status(D),P.val(E),R.val(I),et_pb_ab_js_options.refresh_interval_duration=_.isUndefined(et_pb_ab_js_options.refresh_interval_durations[E])?"day":et_pb_ab_js_options.refresh_interval_durations[E],J.is_active()?J.count_subjects()<2&&(V.disable_publish=!0,e("#publish").addClass("disabled"),J.check_create_db(),J.alert_yes_no("select_ab_testing_subject"),V.is_selecting_ab_testing_subject=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_subject")):(V.is_selecting_ab_testing_subject=!1,J.count_subjects()>0&&G("turn_off_ab_testing")),V.saveAsShortcode();break;case"turn_off_ab_testing":var H,B=$.where({et_pb_ab_goal:"on"});_.each(B,(function(e){delete e.attributes.et_pb_ab_goal,_.isUndefined(e.attributes.et_pb_temp_global_module)&&_.isUndefined(e.attributes.et_pb_temp_global_parent)||(H=k.getView(e.attributes.cid),k.removeTemporaryGlobalAttributes(H,!0))})),V.disable_publish=!0,e("#publish").addClass("disabled"),V.is_selecting_ab_testing_winner=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_winner");break;case"set_global_subject_winner":k.removeTemporaryGlobalAttributes(l.view),J.turn_off_ab_testing_sequence();break;case"ab_testing_alert":_.isUndefined(V.ab_last_visible_alert)||delete V.ab_last_visible_alert;break;case"view_ab_stats":J.toggle_status(!1),V.is_selecting_ab_testing_subject=!1,J.count_subjects()>0&&G("turn_off_ab_testing");break;case"delete_font":g=!1,e(this).hasClass("et-font-uploader-disabled")||q("remove",{font_name:o},i,e(this));break;case"upload_font":var z=p.find("#et-font-uploader-name").val(),F=p.find('.et-core-portability-import-form input[type="file"]').get(0).files,W=p.find(".et-font-uploader-all-weights").prop("checked")?"all":"",Y={},X="";if(p.find(".et-font-uploader-error").html(""),g=!1,"all"!==W){var Q=p.find(".et-font-uploader-weight-values input"),te=["100","200","300","400","500","600","700","800","900"],ie=[];e.each(Q,(function(t,i){e(i).prop("checked")&&ie.push(te[t])})),W=ie.join(",")}""===z&&(X+="".concat(et_pb_options.font_name_error,"\n")),_.isUndefined(F)&&(X+="".concat(et_pb_options.font_file_error,"\n")),""===W&&(X+="".concat(et_pb_options.font_weight_error,"\n")),""!==X?p.find(".et-font-uploader-error").html(X):(Y={font_name:z,font_weight:W,generic_family:"sans-serif",font_files:F},e(this).hasClass("et-font-uploader-disabled")||q("add",Y,i,e(this),o))}g&&Z(e(this))})),e(".et_pb_modal_overlay .et_pb_prompt_proceed_alternative").on("click",(function(t){switch(t.preventDefault(),e(this).closest(".et_pb_modal_overlay").data("action").trim()){case"set_global_subject_winner":k.removeTemporaryGlobalAttributes(l.view,!0),J.turn_off_ab_testing_sequence();break;case"ab_testing_alert_yes_no_select_ab_testing_subject":J.toggle_status(!1),J.toggle_portability(!0),V.disable_publish=!1,e("#publish").removeClass("disabled"),V.is_selecting_ab_testing_subject=!1,e("#et_pb_layout").removeClass("et_pb_select_ab_testing_subject"),delete V.ab_last_visible_alert}Z(e(this))})),e(".et_pb_modal_overlay .et_pb_prompt_dont_proceed").on("click",(function(t){switch(t.preventDefault(),e(this).closest(".et_pb_modal_overlay").data("action").trim()){case"ab_testing_alert":_.isUndefined(V.ab_last_visible_alert)||delete V.ab_last_visible_alert;break;case"turn_off_ab_testing":J.toggle_status(!0)}Z(e(this))}))}function q(t,i,o,n,a){var s={};"add"===t&&(s=JSON.stringify({font_weights:i.font_weight,generic_family:i.generic_family}));var l=new FormData,d={action:"et_pb_process_custom_font",et_pb_font_action:t,et_fb_upload_font_nonce:et_pb_options.upload_font_nonce,et_pb_font_name:i.font_name,et_pb_font_settings:s};_.each(i.font_files,(function(t,i){var o=e(".et-font-uploader-selected-fonts").find("[data-file_name='".concat(t.name.toLowerCase(),"']"));if(o.length>0){var n=o.data("file_format");d["et_pb_font_file_".concat(n)]=t}})),_.each(d,(function(e,t){l.append(t,e)})),e.ajax({type:"POST",url:et_pb_options.ajaxurl,contentType:!1,processData:!1,data:l,beforeSend:function(){o.append('<div id="et_pb_loading_animation"></div>'),n.addClass("et-font-uploader-disabled")},complete:function(){o.find("#et_pb_loading_animation").remove()},success:function(s){var l=JSON.parse(s);if(_.isEmpty(l.error)){if("remove"===t&&!_.isUndefined(et_pb_options.user_fonts[i.font_name])){delete et_pb_options.user_fonts[i.font_name];var d=".select-option-item-".concat(i.font_name.replace(/ /g,"_"));e(d).length>0&&e(d).each((function(){var t=e(this),o=t.hasClass("et_pb_selected_menu_item"),n=o?t.closest(".et-pb-option-container--font"):"";t.remove(),o&&($e(i.font_name,"remove"),ue(n,"default"),je(n,!1))}))}if("add"===t&&!_.isEmpty(l.updated_fonts)){et_pb_options.user_fonts=l.updated_fonts;var r=l.uploaded_font;if(!_.isUndefined(r)){var c=r.replace(/ /g,"_"),p=e(".et-pb-option-subgroup-uploaded .et-pb-option-subgroup-container"),b='<li class="select-option-item select-option-item-custom-font select-option-item-'.concat(c,'" data-value="').concat(r,'">').concat(r,'<span class="et-pb-user-font-marker"></span></li>');p.length>0&&p.append(b);var u=_.isUndefined(a)?"":e('[data-option_name="'.concat(a,'"]')).find('.select-option-item-custom-font[data-value="'.concat(r,'"]'));""!==u&&u.length>0&&u.trigger("click")}}Z(o)}else n.removeClass("et-font-uploader-disabled"),o.find(".et-font-uploader-error").html(l.error)}})}function Y(e){e.addClass("et_pb_animate_clone"),setTimeout((function(){e.length&&e.removeClass("et_pb_animate_clone")}),500)}function Z(t){var i=t.closest(".et_pb_modal_overlay"),o=e("body");o.removeClass("et_pb_stop_scroll"),o.removeClass("et_pb_advanced_menu_opened"),i.addClass("et_pb_modal_closing"),setTimeout((function(){i.remove()}),600)}function X(t,i){t.removeOverlay(),e(".et_pb_modal_settings_container").addClass("et_pb_modal_closing"),setTimeout((function(){t.remove(),"trigger_event"===i&&v.trigger("et-modal-view-removed")}),600)}function Q(){var t=H.closest("#et_settings_meta_box").find(".et_pb_page_layout_settings");if(R.filter(":visible").length>1?(t.hide(),H.find(".et_pb_side_nav_settings").show()):("post"!==et_pb_options.post_type&&"no"===et_pb_options.is_third_party_post_type&&t.hide(),H.closest("#et_settings_meta_box").find(".et_pb_side_nav_settings").show(),H.closest("#et_settings_meta_box").find(".et_pb_single_title").show()),t.length>0){t.find("#et_pb_page_layout").val();var i=t.find('option[value="et_full_width_page"]');i.length>0&&i.show()}if(D.length){D.hide();var o=D.find('input[type="radio"]:checked').val();e(".et_divi_format_setting.et_divi_".concat(o,"_settings")).hide()}"project"===et_pb_options.post_type&&H.closest("#et_settings_meta_box").find(".et_pb_project_nav").show()}function ee(t,i){var o;i=void 0!==i&&i;return o=void 0!==window.tinyMCE&&window.tinyMCE.get(t)&&!window.tinyMCE.get(t).isHidden()?window.tinyMCE.get(t).getContent():e("#".concat(t)).val(),i&&void 0!==window.tinyMCE&&(o=(o=o.replace(/<p>\[/g,"[")).replace(/\]<\/p>/g,"]")),o.trim()}function te(e){var t=e.replace(/et_pb_row /g,"et_pb_row_inner ").replace(/et_pb_row\]/g,"et_pb_row_inner]");return t=t.replace(/et_pb_column /g,"et_pb_column_inner ").replace(/et_pb_column\]/g,"et_pb_column_inner]")}function ie(){var e="tinymce";return"html"===getUserSetting("editor")&&(e="html"),e}function oe(e){return!(void 0===window.tinyMCE||!window.tinyMCE.get(e)||window.tinyMCE.get(e).isHidden())}function ne(){var t=e("#post_ID").val(),i="https:"===window.location.protocol;wpCookies.set("et-editor-available-post-".concat(t,"-bb"),"bb",1800,et_pb_options.cookie_path,!1,i),wpCookies.set("et-editing-post-".concat(t,"-bb"),"bb",300,et_pb_options.cookie_path,!1,i),wpCookies.remove("et-saving-post-".concat(t,"-bb"),et_pb_options.cookie_path,!1,i),wpCookies.remove("et-saved-post-".concat(t,"-bb"),et_pb_options.cookie_path,!1,i)}function ae(t,i,o){o=o||"",oe("content");var n=oe(t),a=i.trim();if("load_secondary_editor"===o&&(a=_.unescape(a)),void 0!==window.tinyMCE&&window.tinyMCE.get(t)&&n){var s=window.tinyMCE.get(t);"load_secondary_editor"===o&&(a=window.switchEditors.wpautop(a)),s.setContent(a,{format:"html"})}e("#".concat(t)).length&&e("#".concat(t)).val(a),W[t]||"content"===t||(void 0!==tinyMCEPreInit.mceInit[t]?quicktags({id:t}):quicktags(tinyMCEPreInit.qtInit[t]),QTags._buttonsInit(),W[t]=!0),wp.heartbeat&&wp.heartbeat.hasConnectionError()||(e("#publish").removeClass("disabled"),delete V.disable_publish)}function se(e){void 0!==window.tinyMCE&&(window.tinyMCE.execCommand("mceRemoveEditor",!1,e),void 0!==window.tinyMCE.get(e)&&window.tinyMCE.remove("#".concat(e)),W[e]=!1)}function le(t){t.length&&t.each((function(){e(this).trigger("change")}))}function _e(t){if(0!==t.length){var i=t.closest(".et-pb-options-toggle-container");if(0!==i.length){var o=!1;i.find(".et-pb-option").length>0&&i.find(".et-pb-option").each((function(){"none"!==e(this).css("display")&&(o=!0)})),o?i.removeClass("et-pb-options-toggle-empty"):i.addClass("et-pb-options-toggle-empty")}}}function de(e,t){var i=void 0===e.data("device")?"all":e.data("device");if("all"!==i&&"phone"!==i){var o,n,a=void 0!==t?t:e.val(),s=e.hasClass("et-pb-range-input")||e.hasClass("et-pb-range"),l=e.hasClass("et_custom_margin_main"),d=s?".et-pb-range-input":".et-pb-main-setting",r=e.siblings("".concat(d,".et_pb_setting_mobile_tablet")),c=e.siblings("".concat(d,".et_pb_setting_mobile_phone")),p=void 0===r.data("default")?"":r.data("default"),b=void 0===c.data("default")?"":c.data("default"),u=_.isNaN(parseFloat(a))?0:parseFloat(a),g=!1;s?(o=e.siblings(".et-pb-range.et_pb_setting_mobile_tablet"),n=e.siblings(".et-pb-range.et_pb_setting_mobile_phone")):e.hasClass("et_custom_margin_main")||(a=Se(a,!1,"")),"desktop"===i?("no"===r.data("has_saved_value")&&r.val()===p&&(r.val(a).trigger("change"),g=!0,s&&o.val(u)),r.data("default",a),s&&o.data("default",u),l&&xe(r)):g=!0,g&&("no"===c.data("has_saved_value")&&c.val()===b&&(c.val(a).trigger("change"),s&&n.val(u),l&&xe(c)),c.data("default",a),s&&n.data("default",u))}}function re(e){var t=e.find(".et-pb-main-setting.et_pb_setting_mobile_active"),i="".concat(t.val()),o=t.hasClass("et-pb-range"),n=void 0===t.data("default")?"":"".concat(t.data("default")),a=e.find(".et-pb-reset-setting");i!==(o&&""!==n?"".concat(parseFloat(n)):n)?a.addClass("et-pb-reset-icon-visible"):a.removeClass("et-pb-reset-icon-visible")}function ce(e,t){e.find(".et_pb_setting_mobile").removeClass("et_pb_setting_mobile_active"),e.find(".et_pb_setting_mobile_".concat(t)).addClass("et_pb_setting_mobile_active"),e.find(".et_pb_mobile_settings_tab").removeClass("et_pb_mobile_settings_active_tab"),e.find('.et_pb_mobile_settings_tab[data-settings_tab="'.concat(t,'"]')).addClass("et_pb_mobile_settings_active_tab"),re(e)}function pe(t,i){$.findWhere({cid:i});var o=t.find(".et-pb-options-tabs-links"),n=t.find(".et-pb-options-tab"),a=t.find(".et-pb-affects"),l=t.find(".et-pb-responsive-affects"),d=t.find(".et_custom_margin_main"),r=t.find(".et_custom_margin"),c=t.find(".et-pb-option--font"),b=t.find(".et_builder_font_style"),u=t.find(".et_builder_font_weight, .et_pb_font_line_style_select, .et-pb-font-line-color-value"),g=t.find(".et_pb_select_placeholder"),h=t.find("select.et-pb-text-align-select"),f=t.find(".et_builder_text_align"),m=t.find(".et_pb_multiple_buttons_wrapper input"),v=t.find(".et_builder_multiple_buttons_button"),w=t.find(".et-pb-range"),y=t.find(".et-pb-range-input"),k=t.find(".et-pb-options-tab-advanced").find(".et-pb-main-setting"),C=t.find(".et-pb-custom-color-picker"),S=t.find(".et-pb-choose-custom-color-button"),j=t.find(".et-pb-option-container--select_with_option_groups select"),T=t.find(".et_pb_yes_no_button_wrapper"),V=t.find(".et_pb_yes_no_button"),U=t.find(".et_pb_yes_no_button_wrapper select"),O=t.find(".et-pb-validate-unit"),A=t.find(".et_options_list:not(.et_conditional_logic)"),M=t.find(".et_conditional_logic"),L=t.find(".et_select_animation"),E=t.find(".et-preset-container"),D=t.find(".et-pb-option--background, .et-pb-option--background-field"),I=t.find("input.regular-text.et_pb_setting_mobile"),P="et_pb_hidden",R=t.find(".et-pb-options-tab-custom_css .et-pb-option"),H=t.find(".et-pb-mobile-settings-toggle"),N=t.find(".et_pb_mobile_settings_tabs"),B=t.find(".et_pb_checkboxes_wrapper"),z=B.find('input[type="checkbox"]'),F="section"===t.data("module_type")?t.find("#et_pb_background_color"):"",W=t.find("#et_pb_gutter_width"),J=t.find("#et_pb_google_api_key"),K=t.find(".et_pb_update_google_key"),q=t.find("#et_pb_field_id"),Y=t.find(".et_pb_contains_tabbed_subtoggle");function Z(e,t,i){var o=e.parents(".et_options_list_row");t&&(o=e.parent().find(".et_options_list_row").last());var n=o.clone();n.find(".et_options_list_checked").removeClass("et_options_list_checked"),i&&n.find("input[type=text]").val(""),n.insertAfter(o),n.find("input[type=text]").trigger("focus")}function X(t,i){var o=[];i.val(""),t.find("input[type=text]").each((function(){var t=e(this),i=t.prev(".et_options_list_checked").length>0,n={value:t.val(),checked:0};""!==n.value&&(i&&(n.checked=1),o.push(n))})),i.val(JSON.stringify(o))}function Q(t,i,o,n){var a=null;switch(t){case"checkbox":case"radio":case"select":var s;switch(t){case"checkbox":s=o.et_pb_checkbox_options;break;case"radio":s=o.et_pb_radio_options;break;case"select":s=o.et_pb_select_options}var l=function(e){""===e&&(e="[]");var t;return t=(t=(t=(t=e.replace(/%22/g,'"')).replace(/%91/g,"[")).replace(/%92/g,"\\")).replace(/%93/g,"]"),JSON.parse(t)}(s);a=e("<select></select>"),e.each(l,(function(t,o){var n=e('<option value="'.concat(o.value,'">').concat(o.value,"</option>"));a.append(n),""!==i&&a.val(i)}));break;default:a=e('<input type="text" value="'.concat(i,'" />'))}return a.addClass("et_conditional_logic_value"),a}function ee(t){var i=t.find("textarea"),o=[];t.find(".et_options_list_row").each((function(){var t=e(this),i=t.find(".et_conditional_logic_field").val(),n=t.find(".et_conditional_logic_condition").val(),a=t.find(".et_conditional_logic_value"),s=a.val(),l=t.find(".et_conditional_logic_field").find("option:selected").data("type"),d=!_.includes(["radio","select","checkbox"],l)&&s,r={field:i,condition:n,value:s};!1!==d&&t.attr("data-selected-value",d),o.push(r),a.prop("disabled",!1),_.includes(["is empty","is not empty"],n)&&a.prop("disabled",!0)})),i.val(JSON.stringify(o))}J.length&&(K.attr("href",et_pb_options.options_page_url),""===et_pb_options.google_api_key?(J.addClass("et_pb_hidden_field"),K.text(K.data("empty_text")).addClass("et_pb_no_field_visible")):J.val(et_pb_options.google_api_key)),""!==F&&""!==et_pb_options.page_section_bg_color&&(""===F.val()&&(F.val(et_pb_options.page_section_bg_color),F.trigger("change")),F.data("default",et_pb_options.page_section_bg_color)),W&&""!==et_pb_options.page_gutter_width&&(W.siblings(".et-pb-main-setting").data("default",et_pb_options.page_gutter_width),W.data("default",et_pb_options.page_gutter_width)),Y.length&&Y.each((function(){var t=e(this),i=t.find(".subtoggle_tabs_nav");if(!(i.length<1||i.find(".subtoggle_tabs_nav_item").length<1)){var o="".concat(100/i.find(".subtoggle_tabs_nav_item").length,"%");i.find(".subtoggle_tabs_nav_item").css({width:o}),e(i.find(".subtoggle_tabs_nav_item a")[0]).addClass("et-bb-active-sub-tab"),e(t.find(".et_pb_tabbed_subtoggle")[0]).addClass("et-bb-active-subtoggle"),i.find(".subtoggle_tabs_nav_item a").on("click",(function(i){i.preventDefault();var o=e(this),n=o.data("tab_id");t.find(".subtoggle_tabs_nav_item a").removeClass("et-bb-active-sub-tab"),o.addClass("et-bb-active-sub-tab"),t.find(".et_pb_tabbed_subtoggle").removeClass("et-bb-active-subtoggle"),t.find("[data-tab_id='".concat(n,"']")).addClass("et-bb-active-subtoggle")}))}})),N.length&&N.each((function(){var t=e(this).closest(".et-pb-option"),i=t.find(".et_pb_mobile_last_edited_field").val(),o=t.find(".et_pb_setting_mobile");if(o.length&&o.each((function(){var t=e(this),i=t.data("device"),o="desktop"!==i&&void 0!==t.data("has_saved_value")?t.data("has_saved_value"):"no",n=t.attr("type"),a="tablet"===i?t.siblings('input[type="'.concat(n,'"].et_pb_setting_mobile_desktop')).val():t.siblings('input[type="'.concat(n,'"].et_pb_setting_mobile_tablet')).val();"desktop"!==i&&("no"===o&&t.val(a),t.data("default",a))})),void 0!==i&&""!==i){var n=i.split("|");if(void 0===n[0]||"on"!==n[0])return;t.find(".et-pb-mobile-settings-toggle").addClass("et-pb-mobile-icon-visible et-pb-mobile-settings-active"),t.toggleClass("et_pb_has_mobile_settings"),void 0!==n[1]&&""!==n[1]&&ce(t,n[1])}})),H.on("click",(function(){var t=e(this),i=t.closest(".et-pb-option"),o=i.find(".et_pb_mobile_last_edited_field"),n=o.val(),a=""!==n?n.split("|"):[],s=void 0!==a[1]&&""!==a[1]?a[1]:"desktop",l=i.find(".et-pb-reset-setting");return t.toggleClass("et-pb-mobile-settings-active"),i.toggleClass("et_pb_has_mobile_settings"),ce(i,s),i.addClass("et_pb_animate_options"),setTimeout((function(){i.removeClass("et_pb_animate_options")}),500),i.hasClass("et_pb_has_mobile_settings")?(l.data("device",s),a[0]="on"):(l.data("device","all"),a[0]="off",ce(i,"desktop")),a[1]=void 0!==a[1]?a[1]:"",o.val("".concat(a[0],"|").concat(a[1])).trigger("et_pb_setting:change"),!1})),N.find("a").on("click",(function(){var t=e(this),i=t.closest(".et-pb-option-container"),o=t.data("settings_tab"),n=i.find(".et_pb_mobile_last_edited_field");return t.closest(".et_pb_mobile_settings_tabs").find("a").removeClass("et_pb_mobile_settings_active_tab"),t.addClass("et_pb_mobile_settings_active_tab"),i.find(".et_pb_setting_mobile").removeClass("et_pb_setting_mobile_active"),i.find(".et_pb_setting_mobile_".concat(o)).addClass("et_pb_setting_mobile_active"),i.find(".et-pb-reset-setting").data("device",o),n.val("on|".concat(o)),re(i),!1})),B.length&&B.each((function(){var t,i,o=e(this),n=o.find("input.et-pb-main-setting").val(),a=o.find('input[type="checkbox"]');""!==n&&(t=n.split("|"),i=0,a.each((function(){"on"===t[i]&&e(this).prop("checked",!0);i++})))})),z.on("click",(function(){var t,i,o=e(this),n=e(this).attr("class"),a=o.closest(".et_pb_checkboxes_wrapper"),s=a.find(".et_pb_disabled_option"),l=a.find('input[type="checkbox"]'),_=a.find("input.et-pb-main-setting"),d=!0===o.prop("checked")?"on":"off",r=0,c=[];l.each((function(){e(this).hasClass(n)&&(t=r),r++,c.push("")})),(i=""!==_.val()?_.val().split("|"):c)[t]=d,_.val(i.join("|")),s.length&&("on"===i[0]&&"on"===i[1]&&"on"===i[2]?s.val("on"):s.val("off"))})),I.on("input change",(function(){de(e(this))})),C.each((function(){var t=e(this),i=t.val(),o=t.closest(".et-pb-custom-color-container"),n=t.closest(".et-pb-options-tab"),a=o.siblings(".et-pb-choose-custom-color-button"),s=void 0!==t.data("old-option-ref")&&""!==t.data("old-option-ref")?t.data("old-option-ref"):"",l=""!==s?n.find(".et-pb-option-".concat(s)):"",_=""!==l&&l.length?l.find("input"):"",d=o.find(".et-pb-color-picker-hex"),r=ve(d).toLowerCase();if(""!==_&&(""===i&&""!==_.val()&&(i=_.val()),_.val("")),""===i||i===r)return!0;o.removeClass(P),a.addClass(P),d.wpColorPicker("color",i)})),S.on("click",(function(){var t=e(this),i=t.siblings(".et-pb-custom-color-container"),o=i.find(".et-pb-color-picker-hex"),n=i.find(".et-pb-custom-color-picker");return t.addClass(P),i.removeClass(P),i.find(".wp-color-result").trigger("click"),n.val(o.wpColorPicker("color")),!1})),j.each((function(){var t=e(this).siblings("input.et-pb-main-setting"),i=t.val().split("|"),o=i.length>1?i[0]:"",n=i.length>1?i[1]:i[0];""===o&&(o=e(this).find(":selected").parent().attr("label"),t.val("".concat(o,"|").concat(n)).trigger("change")),e(this).val(n),e(this).on("change",(function(){var i=e(this).find(":selected").parent().attr("label")||"";t.val("".concat(i,"|").concat(e(this).val())).trigger("change")}))})),T.each((function(){var t=e(this),i=t.find(".et_pb_yes_no_button");"on"===t.find("select").val()?(i.removeClass("et_pb_off_state"),i.addClass("et_pb_on_state")):(i.removeClass("et_pb_on_state"),i.addClass("et_pb_off_state"))})),A.each((function(){var t,i=e(this),o=i.find("textarea"),n=o.val();if(i.on("keydown","input[type=text]",(function(e){"Enter"===e.key&&e.stopPropagation()})),i.on("keyup","input[type=text]",(function(n){clearTimeout(t),"Enter"===n.key&&Z(e(this),!1,!0),t=setTimeout((function(){X(i,o)}),500)})),i.on("click",".et-pb-add-sortable-option",(function(t){t.preventDefault(),Z(e(this),!0,!0)})),i.on("click",".et_options_list_copy",(function(t){t.preventDefault(),Z(e(this))})),i.on("click",".et_options_list_remove",(function(t){if(t.preventDefault(),1===i.find(".et_options_list_row").length)return i.find(".et_options_list_row").first().find("input[type=text]").val(""),void X(i,o);e(this).parents(".et_options_list_row").remove(),X(i,o)})),i.on("click",".et_options_list_check",(function(t){t.preventDefault();var n=e(this);n.parent().hasClass("et_options_list_row_radio")&&i.find(".et_options_list_check").not(n).removeClass("et_options_list_checked"),n.toggleClass("et_options_list_checked"),X(i,o)})),!n){var a=parseInt(i.parents("[data-parent-cid]").attr("data-parent-cid")),s=$.findWhere({cid:a}),l=!_.isUndefined(s.attributes.et_pb_checkbox_checked)&&"on"===s.attributes.et_pb_checkbox_checked,d=_.isUndefined(s.attributes.et_pb_field_title)?"":s.attributes.et_pb_field_title;n=JSON.stringify([{value:d,checked:!0===l?1:0}]),o.val(n),"checkbox"===s.attributes.et_pb_field_type&&i.find(".et_options_list_row_checkbox").length>0&&setTimeout((function(){e("#et_pb_field_title").val("")}),0)}!function(t,i,o){if(""===o||_.isUndefined(o))return;var n=t.find(".et_options_list_row").first(),a=e("<div>").addClass("et_options_rows");try{o=JSON.parse(o)}catch(e){o=o.replace(/\{("value":")(.*?)(",)("checked":.,?.*?)\}/gi,(function(e,t,i,o,n){var a=i.replace(/(.)?(")/gi,(function(e,t,i){return"\\"!==t?"".concat(t,"\\").concat(i):e}));return"{".concat(t).concat(a).concat(o).concat(n,"}")})),o=JSON.parse(o)}for(var s=0;s<o.length;s++){var l=o[s],d=1===l.checked,r=n.clone();r.find("input[type=text]").val(l.value),r.find(".et_options_list_check").toggleClass("et_options_list_checked",d),r.appendTo(a)}a.insertAfter(n),n.remove()}(i,0,n),i.children(".et_options_rows").sortable({axis:"y",containment:"parent",update:function(){X(i,o),setTimeout((function(){e(".et_options_rows").children().css({position:"",top:"",left:""})}),700)}})})),M.each((function(){var t=e(this),i=t.find("textarea").val();i=""!==i?i:"[]",i=JSON.parse(i);var o=e(this).find(".et_options_list_row");if(1<i.length)for(var n=1;n<i.length;n++){var a=o.clone();t.find(".et_options_list_row").last().after(a)}setTimeout((function(){var o={},n=t.parents(".et_pb_modal_settings_container_step2"),a=n.data("parent-cid"),s=n.prev(".et_pb_modal_settings_container").find('ul.et-pb-sortable-options li:not([data-cid="'.concat(a,'"])')),l=t.find(".et_conditional_logic_field");s.each((function(){var t=e(this).data("cid"),i=$.findWhere({cid:t}).attributes,n=i.et_pb_field_id;if(""!==n){n=n.toLowerCase();var a=_.isUndefined(i.et_pb_field_type)?"input":i.et_pb_field_type,s=_.isUndefined(i.et_pb_field_title)?n:i.et_pb_field_title;s=""!==s.trim()?s:n;var d=e('<option data-type="'.concat(a,'" value="').concat(n,'">').concat(s,"</option>"));l.append(d),o[n]=i}}));var d="";for(var r in o)if(o.hasOwnProperty(r)){d=r;break}var c=o[d].et_pb_field_id.toLowerCase();0===i.length&&0!==o.length&&i.push({field:c,condition:"is",value:""});for(var p=0;p<i.length;p++){var b=i[p],u=t.find(".et_options_list_row").eq(p),g=(l=u.find(".et_conditional_logic_field")).next(".et_conditional_logic_condition"),h=o[c],f="input",m="",v=_.isUndefined(b.field)||_.isUndefined(o[b.field])?c:b.field,w=_.isUndefined(b.condition)?"is":b.condition;_.isUndefined(o[b.field])||(h=o[b.field],m=b.value,f=_.isUndefined(h.et_pb_field_type)?"input":h.et_pb_field_type),u.find(".et_conditional_logic_value").remove(),Q(f,m,h,t).insertAfter(g),l.val(v),g.val(w)}ee(t),t.on("change",".et_conditional_logic_field",(function(){var i=e(this),n=i.val(),a=i.next(".et_conditional_logic_condition"),s=i.parents(".et_options_list_row"),l=o[n],d="",r=_.isUndefined(l.et_pb_field_type)?"input":l.et_pb_field_type,c=s.attr("data-selected-value");c&&!_.includes(["radio","select","checkbox"],r)&&(d=c),s.find(".et_conditional_logic_value").remove(),Q(r,d,l,t).insertAfter(a),ee(t)})),t.on("change",".et_conditional_logic_condition, .et_conditional_logic_value",(function(){ee(t)})),t.on("click",".et-pb-add-sortable-option",(function(t){t.preventDefault(),function(e,t){if(0===t.length)return;var i=e.parents(".et_conditional_logic"),o=i.find(".et_options_list_row").last(),n=o.clone(),a=n.find(".et_conditional_logic_condition"),s="";for(var l in t)if(t.hasOwnProperty(l)){s=l;break}var d=t[s],r="",c=_.isUndefined(d.et_pb_field_type)?"input":d.et_pb_field_type;n.find(".et_conditional_logic_value").remove(),Q(c,r,d,i).insertAfter(a),a.val("is"),n.insertAfter(o),ee(i)}(e(this),o)})),t.on("click",".et_options_list_remove",(function(t){t.preventDefault(),function(e){var t=e.parent(".et_options_list_row"),i=t.parent(".et_conditional_logic");if(1===i.find(".et_options_list_row").length)return;t.remove(),ee(i)}(e(this))}))}),0)})),q.on("focusout",(function(){var t=e(this).val().replace(/\s+/g,"_"),i=q.parents(".et_pb_modal_settings_container_step2"),o=i.prev(".et_pb_modal_settings_container"),n=i.data("parent-cid"),a=o.find('ul.et-pb-sortable-options li:not([data-cid="'.concat(n,'"])')),s=[];if(a.each((function(){var t=e(this).data("cid"),i=$.findWhere({cid:t}).attributes;s.push(i)})),""===t){var l=$.findWhere({cid:n}),_=parseInt(l.attributes.module_order);t="Field_".concat(_+1)}for(;;){for(var d=!1,r=0;r<s.length;r++){if(s[r].et_pb_field_id.toLowerCase()===t.toLowerCase()){t="".concat(t,"_2"),d=!0;break}}if(!1===d)break}e(this).val(t)})),L.each((function(){var t=e(this),i=t.find('input[type="hidden"]'),o=i.val();t.find('.et_animation_button_title[data-value="'.concat(o,'"]')).parent().addClass("et_active_animation"),t.on("click",".et_animation_button a",(function(o){o.preventDefault();var n=e(this);if(!n.hasClass("et_active_animation")){var a=n.find(".et_animation_button_title").attr("data-value");a=a.trim(),t.find(".et_animation_button a").removeClass("et_active_animation"),n.addClass("et_active_animation"),i.val(a).trigger("change")}}))})),E.each((function(){var t=e(this),i=t.find('input[type="hidden"]'),o="et-preset-active",n=function(e,i){var o=t.closest(".et-pb-options-toggle-container").find("#et_pb_".concat(e));o.val(i),o.trigger("change")},a=function(){t.find(".et-preset").removeClass(o),t.find('.et-preset[data-value="'.concat(i.val(),'"]')).addClass(o)};t.on("click",".et-preset",(function(a){var s=e(this),l=s.attr("data-value").trim(),_={};if(a.preventDefault(),!s.hasClass(o)){t.find(".et-preset").removeClass(o),s.addClass(o),i.val(l).trigger("change");try{_=JSON.parse(s.attr("data-fields"))}catch(e){_=[]}e.each(_,n)}})),i.on("change",a),a()})),V.on("click",(function(){var t=e(this),i=t.closest(".et_pb_yes_no_button_wrapper").find("select");t.hasClass("et_pb_off_state")?(t.removeClass("et_pb_off_state"),t.addClass("et_pb_on_state"),i.val("on")):(t.removeClass("et_pb_on_state"),t.addClass("et_pb_off_state"),i.val("off")),i.trigger("change")})),U.on("change",(function(){var t=e(this),i=t.closest(".et_pb_yes_no_button_wrapper").find(".et_pb_yes_no_button");"on"===t.val()?(i.removeClass("et_pb_off_state"),i.addClass("et_pb_on_state")):(i.removeClass("et_pb_on_state"),i.addClass("et_pb_off_state"))})),D.length&&D.each((function(){var t=e(this),i=t.is(".et-pb-option--background"),o=i?".et-pb-option--background":".et-pb-option--background-field",n=t.find(".et-pb-option-container-inner").data("base_name"),a=i?"":"".concat(n,"_"),s=t.find(".et_pb_background-tab-navs li").length;t.find(".et_pb_background-tab").first().show(),t.find(".et_pb_background-tab-navs li").first().find("a").addClass("active"),4!==s&&t.find(".et_pb_background-tab-navs li").css({width:"".concat(100/s,"%")}),t.find(".et_pb_background-tab-navs").on("click","a",(function(t){t.preventDefault();var i=e(this),n=i.attr("data-tab"),a=i.closest(o);a.find(".et_pb_background-tab-navs a").removeClass("active"),i.addClass("active"),a.find(".et_pb_background-tab:visible").hide(),a.find('.et_pb_background-tab[data-tab="'.concat(n,'"]')).fadeIn(),a.find('.et_pb_background-tab[data-tab="'.concat(n,'"]')).find(".et-pb-affects").trigger("change"),v(i.closest(o),!1)}));var l=t.find(".et_pb_background-tab--gradient"),d=l.find(".et-pb-option-preview"),r=d.find(".et-pb-option-preview-button--add"),c=d.find(".et-pb-option-preview-button--swap"),b=d.find(".et-pb-option-preview-button--delete"),u=i?"use_background_color_gradient":"".concat(n,"_use_color_gradient"),g=l.find(".et_pb_background-option--".concat(u," .et_pb_yes_no_button")),h=l.find(".et_pb_background-option--".concat(u," select")),f=l.find(".et_pb_background-option--".concat(n,"_color_gradient_start .wp-color-picker")),m=ke(l,n);function v(t,i){t.find(".et_pb_background-tab").each((function(){var o=e(this),a=!1,s=o.attr("data-tab"),l=t.find('.et_pb_background-tab-nav[data-tab="'.concat(s,'"]'));switch(s){case"color":var d=o.find(".et_pb_background-option--use_background_color"),r=o.find(".et_pb_background-option--".concat(n,"_color"));d.length&&r.length?a="on"===d.find("select option:selected").val()&&""!==r.find(".et-pb-color-picker-hex").val():!d.length&&r.length&&(a=""!==r.find(".et-pb-color-picker-hex").val());break;case"gradient":"on"===o.find(".et_pb_background-option--".concat(u," select option:selected")).val()&&(a=!0);break;case"image":var c=o.find(".et_pb_background-option--".concat(n,"_image .et-pb-upload-field")).val()||o.find(".et_pb_background-option--background_url .et-pb-upload-field").val();_.isUndefined(c)||""===c||(a=!0);break;case"video":var p=o.find(".et_pb_background-option--".concat(n,"_video_mp4 .et-pb-upload-field")).val(),b=o.find(".et_pb_background-option--".concat(n,"_video_webm .et-pb-upload-field")).val();(!_.isUndefined(p)&&""!==p||!_.isUndefined(b)&&""!==b)&&(a=!0)}a?(l.addClass("et-pb-filled"),i&&(t.find(".et_pb_background-tab").removeAttr("style"),l.trigger("click"))):l.removeClass("et-pb-filled")}))}m&&(d.css({backgroundImage:m}),d.removeClass("et-pb-option-preview--empty")),d.on("click",(function(e){e.preventDefault(),e.stopPropagation(),d.hasClass("et-pb-option-preview--empty")?(g.removeClass("et_pb_off_state").addClass("et_pb_on_state"),h.val("on").trigger("change"),d.removeClass("et-pb-option-preview--empty")):f.wpColorPicker("open",!0)})),r.on("click",(function(e){e.stopPropagation(),g.removeClass("et_pb_off_state").addClass("et_pb_on_state"),h.val("on").trigger("change"),d.removeClass("et-pb-option-preview--empty")})),b.on("click",(function(e){e.stopPropagation(),g.removeClass("et_pb_on_state").addClass("et_pb_off_state"),h.val("off").trigger("change"),d.addClass("et-pb-option-preview--empty")})),c.on("click",(function(t){t.preventDefault(),t.stopPropagation();var i=e(this).closest(o),a=i.find(".et_pb_background-option--".concat(n,"_color_gradient_start .et-pb-color-picker-hex")),s=i.find(".et_pb_background-option--".concat(n,"_color_gradient_end .et-pb-color-picker-hex")),l=a.val(),_=s.val();a.val(_).trigger("change"),s.val(l).trigger("change")})),l.on("change input keyup",'select, input[type="text"], input[type="range"]',(function(){ye(e(this))})),v(t,!0);var w=t.find(".et-pb-option-container--background").attr("data-column-index"),y=void 0===w?"":"_".concat(w),k=["#et_pb_".concat(n,"_color").concat(y),"#et_pb_use_background_color","#et_pb_".concat(n,"_color_gradient_start").concat(y),"#et_pb_".concat(n,"_color_gradient_end").concat(y),"#et_pb_".concat(u).concat(y),"#et_pb_".concat(n,"_color_gradient_type").concat(y),"#et_pb_".concat(n,"_color_gradient_direction").concat(y),"#et_pb_".concat(n,"_color_gradient_direction_radial").concat(y),"#et_pb_".concat(n,"_color_gradient_start_position").concat(y),"#et_pb_".concat(n,"_color_gradient_end_position").concat(y),void 0===w?"#et_pb_bg_img".concat(y):"#et_pb_background_image","#et_pb_background_url","#et_pb_".concat(a,"parallax").concat(y),"#et_pb_".concat(a,"parallax_method").concat(y),"#et_pb_".concat(n,"_size").concat(y),"#et_pb_".concat(n,"_position").concat(y),"#et_pb_".concat(n,"_repeat").concat(y),"#et_pb_".concat(n,"_blend").concat(y),".et-pb-range"];t.find(k.join(", ")).on("change",(function(){p(t.find(".et_pb_background-tab--image .et-pb-upload-button"))})),setTimeout((function(){e("#et_pb_featured_placement").length&&e("#et_pb_featured_placement").on("change",(function(){p(t.find(".et_pb_background-tab--image .et-pb-upload-button"))})),e("#et_pb_featured_image").length&&e("#et_pb_featured_image").on("change",(function(){p(t.find(".et_pb_background-tab--image .et-pb-upload-button"))}))}),700)})),o.find("li a").on("click",(function(){var t=e(this),i=t.closest("li").index(),n=t.closest("ul"),a=n.siblings(".et-pb-options-tabs"),s="et-pb-options-tabs-links-active",l=n.find(".".concat(s)),_=l.index(),d=a.find(".et-pb-options-tab").eq(_),r=a.find(".et-pb-options-tab").eq(i);return _!==i&&(r.css({display:"none",opacity:0}),d.css({display:"block",opacity:1}).stop(!0,!0).animate({opacity:0},300,(function(){e(this).css("display","none"),r.css({display:"block",opacity:0}).stop(!0,!0).animate({opacity:1},300,(function(){var t=e(this);t.find(".et-pb-option:visible").length||r.hasClass("et-pb-options-tab-view_stats")?e(".et-pb-all-options-hidden").remove():t.append('<p class="et-pb-all-options-hidden">'.concat(et_pb_options.all_tab_options_hidden,"<p>")),o.trigger("et_pb_main_tab:changed")}))})),l.removeClass(s),n.find("li").eq(i).addClass(s),e(".et-pb-options-tabs").animate({scrollTop:0},400,"swing")),!1})),n.each((function(){var t=e(this).find(".et-pb-options-toggle-enabled"),i="et-pb-option-toggle-content-open",o="et-pb-option-toggle-content-closed",n="et-pb-option-toggle-content";t.find("h3").on("click",(function(){var s=e(this),l=s.siblings(".".concat(n)),_=s.closest(".et-pb-options-toggle-container"),d=t.filter(".".concat(i)),r=d.find(".".concat(n));_.hasClass(i)||(d.removeClass(i).addClass(o),r.slideToggle(300),_.removeClass(o).addClass(i),l.slideToggle(300,(function(){le(a)})))}))})),d.length&&(d.each((function(){xe(e(this))})),d.on("et_main_custom_margin:change",(function(){xe(e(this))}))),r.on("change",(function(){var t=e(this),i=void 0!==t.data("device")?t.data("device"):"all",o=t.closest(".et_margin_padding"),n=o.closest(".et-pb-option-container").find(".et-pb-mobile-settings-toggle"),a="all"===i?o.find(".et_custom_margin_main"):o.find(".et_custom_margin_main.et_pb_setting_mobile_".concat(i)),s="all"===i?".et_custom_margin":".et_custom_margin.et_pb_setting_mobile_".concat(i),l="",_=t.closest(".et-pb-option").data("option_name"),d={custom_padding:"padding",custom_margin:"margin"};o.find(s).each((function(){l+="".concat(Se(e(this).val(),e(this).hasClass("auto_important"),void 0,d[_]).trim(),"|")})),"|||"===(l=l.slice(0,-1))?l="":n.addClass("et-pb-mobile-icon-visible"),a.val(l).trigger("et_pb_setting:change"),de(a)})),b.on("click",(function(){var t=e(this),i=t.closest(".et_builder_font_styles"),o=t.data("button_name");t.closest(".et-pb-option-container--font");return t.toggleClass("et_font_style_active"),_.forEach([["uppercase","capitalize"],["underline","line_through"]],(function(e){-1!==_.indexOf(e,o)&&_.forEach(e,(function(e){e!==o&&i.find(".et_builder_".concat(e,"_font")).removeClass("et_font_style_active")}))})),ue(t.closest(".et-pb-option-container--font")),je(t.closest(".et-pb-option--font")),!1})),u.on("change",(function(){ue(e(this).closest(".et-pb-option-container--font"))})),c.on("click",".et-pb-settings-option-select li",(function(t){var i=e(this),o=i.closest(".et-pb-option--font"),n=o.find(".et-pb-settings-option-select-advanced"),a=i.data("value");if(!_.isUndefined(a)){if(e(t.target).closest(".et-pb-user-font-marker").length>0)return void G("delete_font",a);ue(o,a),ge(n),"default"!==a&&$e(a),je(o,!1)}})),c.on("click",".et-pb-font-upload-button",(function(t){G("upload_font",e(t.target).closest(".et-pb-option--font").data("option_name"))})),c.on("input",".et-pb-menu-filter",(function(){var t=e(this).val(),i=e(this).closest(".et-pb-settings-option-select-advanced"),o=i.find(".select-option-item");""!==t?i.addClass("et_pb_menu_search_active"):i.removeClass("et_pb_menu_search_active"),o.removeClass("et_pb_hidden_item");var n=_.filter(o,(function(i){return-1===e(i).text().toLowerCase().search(t.toLowerCase())}));e(n).addClass("et_pb_hidden_item")})),c.each((function(){je(e(this),!1,!0)})),g.on("click",(function(){var t=e(this),i=t.closest(".et-pb-select-font-outer"),o=i.find(".et-pb-settings-option-select-advanced"),n=o.find(".select-option-item"),a=i.find(".et-pb-menu-filter");o.addClass("et_pb_menu_active"),o.removeClass("et_pb_menu_search_active"),n.removeClass("et_pb_hidden_item"),a.val(""),o.animate({scrollTop:0},0);var s=t.offset(),l=e(window).height(),_=e(window).scrollTop(),d=500>l?l-50:500,r=s.top-_-20,c=l-r;c<d?r-=d-c+50:d=c-50,o.css({top:"".concat(r,"px"),maxHeight:"".concat(d,"px")}),e("body").addClass("et_pb_advanced_menu_opened")})),h.each((function(){var t=e(this),i=t.data("saved_value"),o=t.data("default"),n=""!==i?t.val():o,a=t.closest(".et-pb-option-container"),s=(a.find("select.et-pb-text-align-select"),""!==n&&a.find(".et_builder_".concat(n,"_text_align")));s&&s.addClass("et_text_align_active")})),h.on("change",(function(){var t=e(this),i=t.closest(".et-pb-option-container").find(".et_builder_text_align.et_text_align_active"),o=!!i.length&&i.data("value"),n=t.attr("data-default")===o?"":o;o&&(t.data("saved_value",n),t.val(o).trigger("et_pb_setting:change"))})),f.on("click",(function(){var t=e(this),i="et_text_align_active",o=t.closest(".et-pb-option-container"),n=t.hasClass(i),a=o.find(".et-pb-text-align-select"),s=a.attr("data-default");return o.find(".et_builder_text_align").removeClass(i),n?_.isUndefined(s)||""===s||o.find(".et_builder_".concat(s,"_text_align")).addClass(i):t.addClass(i),a.trigger("change"),!1})),m.each((function(){be(e(this))})),m.on("change",(function(){be(e(this))})),v.on("click",(function(){var t=e(this),i=t.closest(".et-pb-option-container").find("input"),o=i.data("default"),n=i.val(),a=_.isUndefined(n)||""===n?[]:n.split("|"),s=t.data("value"),l=n,d="yes"===i.data("multi");return"yes"===i.data("toggleable")&&t.hasClass("et_builder_multiple_buttons_button_active")?l=d?_.without(a,s).join("|"):o:(d&&a.push(s),l=d?a.join("|"):s),i.val(l).trigger("change"),!1})),w.on("input change",(function(){var t,i,o=e(this),n=void 0===o.data("device")?"all":o.data("device"),a=o.val(),s="all"===n?o.siblings(".et-pb-range-input"):o.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(n)),l=s.data("initial_value_set")||!1,_=s.data("unit")||"no_default_unit",d=Se(s.val().trim(),!1,_);if(isNaN(parseFloat(d))&&!l)return o.val(0),void s.data("initial_value_set",!0);t=parseFloat(d),""!==(i=(d+="").replace(t,"").trim())&&(a+=i),s.val(a).trigger("et_pb_setting:change"),de(o,a)})),w.length&&w.each((function(){var t=e(this),i=void 0===t.data("device")?"all":t.data("device"),o="all"===i?t.siblings(".et-pb-range-input"):t.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(i)),n=o.val().trim(),a=void 0!==t.data("default")&&"string"==typeof t.data("default")?t.data("default").trim():t.data("default"),s=void 0!==t.data("default_inherited")&&"string"==typeof t.data("default_inherited")?t.data("default_inherited").trim():t.data("default_inherited"),l=void 0!==s?s:a;if(""===n&&(""!==l&&(o.val(l),l=parseFloat(l)||0),t.val(l),n=l),"tablet"===i){var _=t.siblings(".et-pb-range-input.et_pb_setting_mobile_desktop").val();t.data("default",parseFloat(_)),o.data("default",_)}else if("phone"===i){var d=t.siblings(".et-pb-range-input.et_pb_setting_mobile_tablet").val();t.data("default",parseFloat(d)),o.data("default",d)}he(t,n,!0)})),y.on("keyup change",_.debounce((function(t){var i,o=e(this),n=void 0===o.data("device")?"all":o.data("device"),a=Se(fe(o,!0),!1,o.data("unit")||"no_default_unit"),s="all"===n?o.siblings(".et-pb-range"):o.siblings(".et-pb-range.et_pb_setting_mobile_".concat(n)),l=!1;i=parseFloat(a)||0,_.isUndefined(t.type)||"keyup"!==t.type||(l=!0),he(s,i,l),o.val(a),s.val(i).trigger("et_pb_setting:change"),de(o)}),700)),O.length&&O.each((function(){var t=e(this),i=Se(t.val().trim());t.val(i)})),k.length&&(k.on("change et_pb_setting:change et_main_custom_margin:change",(function(){var t=e(this),i=void 0===t.data("device")?"all":t.data("device"),o=t.closest(".et-pb-option-container"),n=o.find(".et-pb-reset-setting"),a=t.hasClass("et-pb-range"),s=t.hasClass("et-pb-font-select"),l=t.hasClass("et-presets")||t.hasClass("et_select_animation"),_=a&&"all"===i?t.siblings(".et-pb-range-input"):t;l&&(_=t.children("input"));var d=ve(_=a&&"all"!==i?t.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(i)):_).toLowerCase(),r="".concat(_.val());r=r.toLowerCase();var c=o.find(".et-pb-mobile-settings-toggle");if(s){var p=r.split("|"),b=d.split("|");n.each((function(){var t=e(this),i=0;t.hasClass("et_pb_reset_weight")&&(i=1),""!==p[i]&&b[i]!==p[i]?t.addClass("et-pb-reset-icon-visible"):t.removeClass("et-pb-reset-icon-visible")}))}else!_.hasClass("et_pb_setting_mobile")||_.hasClass("et_pb_setting_mobile_active")?we(_)?(n.removeClass("et-pb-reset-icon-visible"),c.hasClass("et-pb-mobile-settings-active")||c.removeClass("et-pb-mobile-icon-visible")):(setTimeout((function(){n.addClass("et-pb-reset-icon-visible")}),50),c.addClass("et-pb-mobile-icon-visible")):(r!==d&&!a||a&&r!=="".concat(d,"px")&&r!==d)&&c.addClass("et-pb-mobile-icon-visible")})),k.trigger("change"),t.find(".et-pb-main-settings .et_pb_options_tab_advanced a").append('<span class="et-pb-reset-settings"></span>'),t.find(".et-pb-reset-settings").on("click",(function(){G("reset_advanced_settings",k)}))),t.find(".et-pb-reset-setting").not(".et-pb-reset-skip").on("click",(function(){Ce(e(this))}));var te=t.data("module_type"),ie=e();if("section"===te&&(te="et_pb_section"),"row"===te&&(te="et_pb_row"),x(window.et_pb_module_field_dependencies,te)){var oe=function e(i){var o=[],n=ne[i].affects,a=t.find("#et_pb_".concat(i)),s=a.closest(".et-pb-option"),l=function(e){var t=[];return ne[e].show_if&&(t=_.keys(ne[e].show_if)),ne[e].show_if_not&&(t=_.union(t,_.keys(ne[e].show_if_not))),t}(i);_.forEach(l,(function(e){var n=t.find("#et_pb_".concat(e)).val(),a=ne[e].affects[i].show_if,s=ne[e].affects[i].show_if_not;o.push(function(e,t,i){var o=!1;return t&&i?(t=_.isArray(t)?_.includes(t,e):e===t,i=_.isArray(i)?!_.includes(i,e):e!==i,o=t&&i):t?o=_.isArray(t)?_.includes(t,e):e===t:i&&(o=_.isArray(i)?!_.includes(i,e):e!==i),o}(n,a,s))})),o=!_.includes(o,!1),s.toggle(o).addClass("et_pb_animate_affected");var d=o?"et-pb-option-field-shown":"et-pb-option-field-hidden";a.trigger(d),setTimeout((function(){s.removeClass("et_pb_animate_affected"),_e(a)}),500),_.isUndefined(n)||_.forEach(n,(function(t,i){e(i)}))},ne=window.et_pb_module_field_dependencies[te];_.forEach(ne,(function(e,i){if(!_.isUndefined(e.affects)){var o=t.find("#et_pb_".concat(i));ie=ie.add(o),o.on("change",(function(){_.forEach(e.affects,(function(e,t){oe(t)}))}))}}))}a.length&&a.on("change",(function(){var i=e(this),o=i.closest(".et-pb-option"),n=i.val(),a=(parseInt(n),_.map(i.data("affects").split(", "),(function(e){return-1!==e.indexOf("#et_pb_")?e:"#et_pb_".concat(e)})).join(", ")),s=t.find(a),l=i.closest(".et-pb-options-tab").index(),d=[],r=function t(a,s){s=!0===s;var r=e(a),c=r.closest(".et-pb-option"),p=c.hasClass("et-pb-new-depends"),b="text"===i.attr("type"),u=c.data("depends_show_if")||"on",g=b?"":c.data("depends_show_if_not"),h=!s&&(u===n||void 0!==g&&!_.contains(g.split(","),n)),f=r.closest(".et-pb-options-tab").index(),m=c.find(".et-pb-affects"),v=i.closest(".et_pb_background-template--use_color_gradient").length;if(!(r.hasClass("et_pb_field_processed")||b&&!i.is(":visible")||p)){l!==f||!h||"none"!==o.css("display")||i.is('[type="hidden"]')||v||(h=!1),c.toggle(h).addClass("et_pb_animate_affected");var w=r.is(":visible")?"et-pb-option-field-shown":"et-pb-option-field-hidden";if(r.trigger(w),setTimeout((function(){c.removeClass("et_pb_animate_affected"),_e(r)}),500),m.length){var y=_.map(m.data("affects").split(", "),(function(e){return-1!==e.indexOf("#et_pb_")?e:"#et_pb_".concat(e)})).join(", "),k=e(y);h?d.push(r):k.each((function(){t(this,!0),_e(e(this))})).removeClass("et_pb_field_processed")}r.addClass("et_pb_field_processed")}};s.each((function(){r(this)})).removeClass("et_pb_field_processed"),_.forEach(d,(function(e){e.trigger("change")})),e(".et_options_list:not(.et_conditional_logic)").each((function(){var t=e(this);if(0===t.find(".et_options_rows").length){var i=t.find("textarea");t.find(".et_options_list_row").wrapAll('<div class="et_options_rows" />'),t.find(".et_options_rows").sortable({axis:"y",containment:"parent",update:function(){X(t,i),setTimeout((function(){e(".et_options_rows").children().css({position:"",top:"",left:""})}),700)}})}}))})),setTimeout((function(){n.css({display:"block"}),(a=a.add(ie)).data("is_rendering_setting_view",!0),le(a),a.data("is_rendering_setting_view",!1),n.css({display:"none"}),Re()}),100),setTimeout((function(){e(".et-pb-option-toggle-content").length>0&&e(".et-pb-option-toggle-content").each((function(){""===e(this).text().trim()&&e(this).closest(".et-pb-options-toggle-container").addClass("et-pb-options-toggle-empty")}))}),100),l.length&&(l.on("et_pb_setting:change",(function(){var t=e(this),i=t.parent(),o=(i.children(".et-pb-responsive-affects"),t.data("responsive-desktop-name")),n=t.data("responsive-affects").split(","),a={desktop:i.find("#".concat(o)).val(),tablet:i.find("#".concat(o,"_tablet")).val(),phone:i.find("#".concat(o,"_phone")).val()},s=(t.closest(".et_pb_modal_settings_container_step2").length?i.find('input[id="data.'.concat(o,'_last_edited"]')):i.find("#".concat(o,"_last_edited"))).val(),l="string"==typeof s&&"on"===s.split("|")[0];_.forEach(n,(function(t){var i=e("#et_pb_".concat(t)).closest(".et-pb-option:not(.et_pb_background-option)"),o=_.isUndefined(i.data("depends_show_if_not"))?[]:i.data("depends_show_if_not").split(","),n=!0;n=l?!_.contains(o,a.desktop)||!_.contains(o,a.tablet)||!_.contains(o,a.phone):!_.contains(o,a.desktop),i.toggle(n),i.siblings().length<1&&i.closest(".et-pb-options-toggle-container").toggle(n)}))})),setTimeout((function(){l.each((function(){e(this).trigger("et_pb_setting:change")}))}))),t.find(".et-pb-options-tabs-links").on("et_pb_main_tab:changed",(function(){var t,o,n=e(".et-pb-options-tabs-links").find(".et_pb_options_tab_custom_css"),a=e(".et-pb-options-tab-custom_css").find(".et_pb_module_order_placeholder");n.hasClass("et-pb-options-tabs-links-active")&&(t=void 0!==(o=$.findWhere({cid:i})).attributes.module_order?o.attributes.module_order:"",a.length&&a.replaceWith(t))})),R.length&&R.on("focusin",(function(){var t=e(this).closest(".et-pb-option"),i=t.find("label > span"),o=t.siblings().find("label > span");i.length&&(i.removeClass("et_pb_hidden_css_selector"),i.css({display:"inline-block"}),i.addClass("et_pb_visible_css_selector")),o.length&&(o.removeClass("et_pb_visible_css_selector"),o.addClass("et_pb_hidden_css_selector"),setTimeout((function(){o.css({display:"none"}),o.removeClass("et_pb_hidden_css_selector")}),200))})),t.on("click",".et_pb_global_sync_switcher",(function(){var t=e(this);t.hasClass("et_pb_global_unsynced")?t.removeClass("et_pb_global_unsynced"):t.addClass("et_pb_global_unsynced")})),new s.Controls.BorderRadius(t),new s.Controls.BorderStyles(t),new s.Controls.TabbedControl(t.find("#et_pb_divider_settings").parent()),t.on("click",".et-pb-option-container .description a",(function(e){var t=e.target.href;_.isUndefined(t)||(e.preventDefault(),window.open(t,"_blank").focus())}))}function be(e){e.data("default");var t=e.val(),i=e.closest(".et-pb-option-container"),o=""===t?[]:t.split("|");i.find(".et_builder_multiple_buttons_button").removeClass("et_builder_multiple_buttons_button_active"),o.length>0&&(_.forEach(o,(function(e){var t=i.find(".et_builder_".concat(e,"_button"));t.length>0&&t.addClass("et_builder_multiple_buttons_button_active")})),e.trigger("et_pb_setting:change"))}function ue(e,t){var i=e.find("input.et-pb-font-select"),o=i.val().split("|"),n=e.find(".et_builder_font_weight").val(),a=e.find(".et_builder_font_styles"),s=e.find(".et-pb-font-line-color-value"),l=e.find(".et_pb_font_line_style_select"),d=a.find(".et_builder_italic_font"),r=a.find(".et_builder_uppercase_font"),c=a.find(".et_builder_underline_font"),p=a.find(".et_builder_capitalize_font"),b=a.find(".et_builder_line_through_font"),u="et_font_style_active",g=_.isUndefined(t)?o[0]:t,h="";h+="default"!==g?g.trim():"",h+="|","400"!==n&&(h+=n),h+="|",d.hasClass(u)&&(h+="on"),h+="|",r.hasClass(u)&&(h+="on"),h+="|",c.hasClass(u)&&(h+="on"),h+="|",p.hasClass(u)&&(h+="on"),h+="|",b.hasClass(u)&&(h+="on"),h+="|",""!==s.val()&&(h+=s.val()),h+="|","solid"!==l.val()&&(h+=l.val()),i.val(h).trigger("change")}function ge(t){t.closest(".et-pb-option--font").find(".et_pb_select_placeholder");t.removeClass("et_pb_menu_active"),e("body").removeClass("et_pb_advanced_menu_opened")}function he(e,t,i){var o=parseFloat(e.attr("max")),n=parseFloat(e.attr("min"));e.hasClass("et-pb-fixed-range")||((t=""!==t?parseFloat(t):0)>o&&(e.attr("max",t),e.val(t)),t<n&&(e.attr("min",t),e.val(t)),i&&"0.1"!==e.attr("step")&&t%1>0&&(e.attr("step","0.1"),e.val(t)))}function fe(e,t){var i,o=e.parent().find(".et-pb-range"),n=e.val(),a="string"==typeof n?n.trim():n,s=parseFloat(a),l=a.toString().replace(s,""),_=o.data("default");if(isNaN(s)&&(s=""),o.hasClass("et-pb-fixed-range")){var d=parseFloat(o.attr("max")),r=parseFloat(o.attr("min")),c=s<r;s>d?s=d:c&&(s=r)}return i=s.toString()+l||_,t&&i!==n&&e.val(i),i}function me(t){return e(t).hasClass("et-pb-color-picker-hex")?"default-color":"default"}function ve(e){var t,i=me(e);if(t=void 0!==e.data(i)?e.data(i):"",_.isArray(t)&&t.length>0){var o=e.closest(".et-pb-options-toggle-container").find("#et_pb_".concat(t[0]));t=(t[1]||{})["".concat(o.val())]}return t="".concat(t)}function we(e){var t=ve(e).toLowerCase(),i=_.isUndefined(s.Helpers.getSettingValue(e))?"":s.Helpers.getSettingValue(e).toString().toLowerCase(),o=e.hasClass("et-pb-range");return void 0===i||""===String(i)||(!(!e.is("select")||""!==t||0!==e.prop("selectedIndex"))||!(!_.isNull(i)&&i!==t&&!o||o&&i!=="".concat(t,"px")&&i!==t))}function ye(e){var t=e.closest(".et_pb_background-tab--gradient"),i=t.closest(".et-pb-option-container-inner").attr("data-base_name"),o=ke(t,i),n=t.find(".et-pb-option-preview");o?n.css({backgroundImage:o}):n.removeAttr("style")}function ke(e,t){var i="background"===(t=t||"background")?"use_background_color_gradient":"".concat(t,"_use_color_gradient"),o=e.find(".et_pb_background-option--".concat(i," select")),n=e.find(".et_pb_background-option--".concat(t,"_color_gradient_start .et-pb-color-picker-hex")),a=e.find(".et_pb_background-option--".concat(t,"_color_gradient_end .et-pb-color-picker-hex")),s=e.find(".et_pb_background-option--".concat(t,"_color_gradient_type select")),l=e.find(".et_pb_background-option--".concat(t,"_color_gradient_direction .et-pb-range-input")),d=e.find(".et_pb_background-option--".concat(t,"_color_gradient_direction_radial select")),r=e.find(".et_pb_background-option--".concat(t,"_color_gradient_start_position .et-pb-range-input")),c=e.find(".et_pb_background-option--".concat(t,"_color_gradient_end_position .et-pb-range-input")),p=e.find(".et_pb_background-option--".concat(t,"_color_gradient_stops .et-pb-settings-option-input"));if("on"!==o.val())return!1;var b,u,g={type:"linear",direction:"180deg",radialDirection:"center",stops:"#2b87da 0%|#29c4a9 100%",colorStart:"#2b87da",colorEnd:"#29c4a9",startPosition:"0%",endPosition:"100%"};switch(_.each({type:s.val(),direction:l.val(),radialDirection:d.val(),colorStart:n.val(),colorEnd:a.val(),startPosition:r.val(),endPosition:c.val(),stops:p.val()},(function(e,t){""===e||_.isUndefined(e)||(g[t]=e)})),g.type){case"conic":b="conic",u="from ".concat(g.direction," at ").concat(g.radialDirection);break;case"elliptical":b="radial",u="ellipse at ".concat(g.radialDirection);break;case"radial":case"circular":b="radial",u="circle at ".concat(g.radialDirection);break;default:b="linear",u=g.direction}return"".concat(b,"-gradient( ").concat(u,", ").concat(g.stops.replace(/\|/g,", ")," )")}function Ce(e){var t=e,i=t.closest(".et-pb-option-container"),o=i.closest(".et-pb-option"),n=void 0!==t.data("device")&&o.hasClass("et_pb_has_mobile_settings")?t.data("device"):"all",a="all"===n?i.find(".et-pb-main-setting"):i.find(".et-pb-main-setting.et_pb_setting_mobile_".concat(n)),s=ve(a);if(a.is(".et-pb-text-align-select"))return s?i.find(".et_builder_".concat(s,"_text_align")).addClass("et_text_align_active").siblings().removeClass("et_text_align_active"):i.find(".et_text_align_active").removeClass("et_text_align_active"),a.val(s).trigger("change").trigger("et_pb_setting:change"),t.hasClass("et-pb-reset-setting")||(t=i.find(".et-pb-reset-setting")),void t.removeClass("et-pb-reset-icon-visible");if(a.is("select")&&""===s)a.prop("selectedIndex",0).trigger("change");else if(a.hasClass("et-pb-custom-color-picker"))!function(e){var t=e.closest(".et-pb-custom-color-container"),i=t.siblings(".et-pb-choose-custom-color-button"),o=t.find(".et-pb-custom-color-picker"),n="et_pb_hidden";i.removeClass(n),t.addClass(n),o.val("")}(t);else{if(a.hasClass("et-pb-color-picker-hex"))return a.wpColorPicker("color",s),""===s&&i.find(".wp-picker-clear").trigger("click"),t.hasClass("et-pb-reset-setting")||(t=i.find(".et-pb-reset-setting")),void t.removeClass("et-pb-reset-icon-visible");if(a.hasClass("et-pb-font-select"))je(i,t.hasClass("et_pb_reset_weight")?"weight":"font");else a.hasClass("et-pb-range")&&(s=ve(a="all"===n?t.siblings(".et-pb-range-input"):t.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(n)))),a.val(s).trigger("et_pb_setting:change",["et_pb_reset_setting"]),a.data("has_saved_value","no"),a.hasClass("et_custom_margin_main")?a.trigger("et_main_custom_margin:change"):a.trigger("change"),a.hasClass("et_select_animation")&&(a.find(".et_animation_button > a.et_active_animation").removeClass("et_active_animation"),a.find(".et_animation_button").first().find("> a").addClass("et_active_animation")),a.hasClass("et-presets")&&a.find(".et-preset").removeClass("et-preset-active").first().addClass("et-preset-active")}}function Se(t,i,o,n){var a,s="!important",l=s.length,d=!1,r=(t=void 0===t?"":t).length;i=!_.isUndefined(i)&&i;if(""===t)return"";if(t.substr(0-l,l)===s&&(d=!0,r-=l,t=t.substr(0,r).trim()),!_.isUndefined(n)&&function(e,t){var i=et_pb_options.acceptable_css_string_values;return!_.isUndefined(i[e])&&_.contains(i[e],t)}(n,t))return c=t,d&&!i&&(c="".concat(c," ").concat(s)),c;if(-1!==e.inArray(t.substr(-3,3),["deg","rem"])){var c=parseFloat(t)+t.substr(-3,3);return d&&!i&&(c="".concat(c," ").concat(s)),c}if(-1!==e.inArray(t.substr(-2,2),["em","px","cm","mm","in","pt","pc","ex","vh","vw","ms"])){c=parseFloat(t)+t.substr(-2,2);return d&&!i&&(c="".concat(c," ").concat(s)),c}return-1!==e.inArray(t.substr(-1,1),["%","x"])?(c=parseFloat(t)+t.substr(-1,1),d&&!i&&(c="".concat(c," ").concat(s)),c):isNaN(parseFloat(t))?t:(a=parseFloat(t),(_.isUndefined(o)||"no_default_unit"!==o)&&(a+=o||"px"),a)}function xe(t){var i,o=t,n=void 0!==o.data("device")?o.data("device"):"all",a=o.val(),s=o.closest(".et_margin_padding"),l=s.closest(".et-pb-option-container").find(".et-pb-mobile-settings-toggle"),_="all"===n?s.find(".et_custom_margin"):s.find(".et_custom_margin.et_pb_setting_mobile_".concat(n)),d=!1;de(t),""!==a?(i=a.split("|"),_.length>i.length&&(i.splice(1,0,""),i.push("")),_.each((function(){var t=e(this),o=_.index(t),n=t.hasClass("auto_important"),a=t.closest(".et-pb-option").data("option_name"),s=Se(i[o],n,void 0,{custom_padding:"padding",custom_margin:"margin"}[a]);t.val(s).trigger("et_pb_setting:change"),""!==s&&(d=!0)})),d&&l.addClass("et-pb-mobile-icon-visible")):_.each((function(){e(this).val("")}))}function je(t,i,o){var n,a=t.closest(".et-pb-options-tab"),s=t.find(".et-pb-select-font-outer"),l=t.find("input.et-pb-font-select"),d=t.find(".et-pb-settings-option-select-advanced"),r=t.find(".et_builder_font_styles"),c=t.find(".et_pb_select_placeholder"),p=t.find(".et_builder_font_weight"),b=t.find(".et_pb_font_line_color"),u=t.find(".et_pb_font_line_style_select"),g=t.find(".et_pb_font_style_container"),h=r.find(".et_builder_italic_font"),f=r.find(".et_builder_uppercase_font"),m=r.find(".et_builder_underline_font"),v=r.find(".et_builder_capitalize_font"),w=r.find(".et_builder_line_through_font"),y="et_font_style_active",k=l.val().trim(),C=_.isUndefined(l.data("default"))?"||||||||":l.data("default"),S=void 0!==l.data("old-option-ref")&&""!==l.data("old-option-ref")?l.data("old-option-ref"):"",x=""!==S?a.find(".et-pb-option-".concat(S)):"",j=""!==x&&x.length?x.find("input"):"",$="default",T=function(e){var t=wpCookies.get("et-pb-recent-items-font_family");if(t=_.isUndefined(t)||_.isNull(t)?[]:t.split("|"),_.isEmpty(t))return[];var i=[];return _.each(t,(function(t){e.find(".select-option-item-".concat(t.replace(/ /g,"_"))).length>0&&i.push(t)})),i}(d),V="400",U=!1,O=!1;if(i){var A=C.split("|");n=""===k.replace(/\|/g,"")?A:k.split("|"),"weight"===i?n[1]=A[1]:n[0]=A[0],k=n.join("|")}if(o){var M=t.find(".et_pb_font_weight_container"),L=g.find("label"),E=M.find("label"),D=s.data("group_label");""===k.replace(/\|/g,"")&&(k=C),L.html("".concat(D," ").concat(L.html())),E.html("".concat(D," ").concat(E.html()));var I=t.find(".et-pb-reset-setting"),P=I.clone();s.append(I.addClass("et_pb_reset_font")),M.append(P.addClass("et_pb_reset_weight"))}if(""!==k?($=""!==(n=k.split("|"))[0]?n[0]:"default",c.html(_.escape($)),""!==n[1]&&(V="on"===n[1]?"700":n[1]),"on"===n[2]?h.addClass(y):h.removeClass(y),"on"===n[3]?f.addClass(y):f.removeClass(y),"on"===n[4]?(m.addClass(y),U=!0):m.removeClass(y),_.isUndefined(n[5])||"on"!==n[5]?v.removeClass(y):v.addClass(y),_.isUndefined(n[6])||"on"!==n[6]?w.removeClass(y):(w.addClass(y),O=!0),_.isUndefined(n[7])||""===n[7]||(b.find(".et-pb-custom-color-container").removeClass("et_pb_hidden"),b.find(".et-pb-custom-color-button").addClass("et_pb_hidden"),b.find(".et-pb-color-picker-hex-alpha").wpColorPicker("color",n[7])),_.isUndefined(n[8])||""===n[8]||u.val(n[8])):(c.html(_.escape($)),h.removeClass(y),f.removeClass(y),m.removeClass(y),v.removeClass(y),w.removeClass(y)),U||O){var R=s.data("group_label");t.find(".et_pb_font_line_settings .et_pb_font_line_color > label").each((function(){var t=e(this),i=U?t.data("underline_label"):t.data("strikethrough_label");t.html("".concat(R," ").concat(i))})),t.find(".et_pb_font_line_settings").removeClass("et_pb_hidden"),t.find(".et-pb-option-container").addClass("et_pb_fonts_long")}else t.find(".et_pb_font_line_settings").addClass("et_pb_hidden"),t.find(".et-pb-option-container").removeClass("et_pb_fonts_long");var H=function(e){var t=et_pb_options.google_fonts,i=et_pb_options.user_fonts,o=!_.isUndefined(i[e])&&i[e],n=_.keys(et_pb_options.supported_font_weights);if("default"===e.toLowerCase())return["300","400","600","700","800"];o||(o=!_.isUndefined(t[e])&&t[e]);if(!o||_.isUndefined(o.styles))return n;return _.intersection(_.union(["400","700"],o.styles.split(",")),n)}($);p.find("option").removeClass("et_pb_unsupported_option"),p.find("option").each((function(){var t=e(this);-1===_.indexOf(H,t.val())&&(t.addClass("et_pb_unsupported_option"),V===t.val()&&(V="400"))})),p.find('option[value="'.concat(V,'"]')).prop("selected",!0);var N=d.find(".select-option-item-".concat($.replace(/ /g,"_")));d.find(".et_pb_selected_menu_item").removeClass("et_pb_selected_menu_item"),N.addClass("et_pb_selected_menu_item"),d.find(".et_pb_selected_item_container").html(_.escape(N.text())),_.isEmpty(T)?d.find(".et-pb-recent-fonts").addClass("et_pb_hidden_subgroup"):(d.find(".et-pb-recent-fonts").removeClass("et_pb_hidden_subgroup"),d.find(".et-pb-recent-fonts ul").html(""),_.each(T,(function(e){var t='<li class="select-option-item select-option-item-recent-font select-option-item-'.concat(e.replace(/ /g,"_"),'" data-value="').concat(e,'">').concat(e,"</li>");d.find(".et-pb-recent-fonts ul").append(t)}))),j.length&&""!==j.val()&&("on"!==n[3]&&"on"===j.val()&&(f.addClass(y),n[3]="on",l.val(n.join("|")).trigger("change")),j.val("")),i&&l.val(n.join("|")).trigger("et_pb_setting:change")}function $e(e,t){if("default"!==e){var i=wpCookies.get("et-pb-recent-items-font_family");if(i=_.isUndefined(i)||_.isNull(i)?[]:i.split("|"),"remove"===t){if(-1===_.indexOf(i,e))return;delete i[e]}else{if(-1!==_.indexOf(i,e))return;i.length>=3&&(i=i.slice(0,2)),i=_.union([e],i)}var o="https:"===window.location.protocol;wpCookies.set("et-pb-recent-items-font_family",i.join("|"),31536e6,et_pb_options.cookie_path,!1,o)}}function Te(t){t.$(".et-pb-color-picker-hex:visible").each((function(){e(this).closest(".wp-picker-container").find(".wp-color-result").trigger("click")}))}function Ve(){et_pb_options.debug&&window.console&&(2===arguments.length?console.log(arguments[0],arguments[1]):console.log(arguments[0]))}function Ue(t,i){V.saveAsShortcode(),setTimeout((function(){var o=e("#et_pb_layout"),n=o.innerHeight();o.css({height:"".concat(n,"px")});var a=ee("content",!0);if(V.removeAllSections(),V.$el.find(".et_pb_section").remove(),V.createLayoutFromContent(Oe(a),"","",{is_reinit:"reinit",migrate_global_modules:i}),o.css({height:"auto"}),J.update(),t){var s=_.filter($.models,(function(e){return"module"!==e.attributes.type&&void 0!==e.attributes.et_pb_global_module&&""!==e.attributes.et_pb_global_module}));0!==s.length&&_.each(s,(function(e){Ie(e.attributes.cid)}))}}),600)}function Oe(e){if(-1!==e.indexOf("[et_pb_")||"1"===et_pb_options.is_divi_library&&"module"===et_pb_options.layout_type)if(-1===e.indexOf("et_pb_row")&&-1===e.indexOf("et_pb_section")){var t=-1===e.indexOf("et_pb_fullwidth")?"regular":"fullwidth";-1===e.indexOf("et_pb_fullwidth_module_placeholder")&&-1===e.indexOf("et_pb_module_placeholder")||(e=""),e="regular"===t?'[et_pb_section template_type="module" skip_module="true"][et_pb_row template_type="module" skip_module="true"][et_pb_column type="4_4"]'.concat(e,"[/et_pb_column][/et_pb_row][/et_pb_section]"):'[et_pb_section fullwidth="on" template_type="module" skip_module="true"]'.concat(e,"[/et_pb_section]")}else-1===e.indexOf("et_pb_section")&&(e='[et_pb_section template_type="row" skip_module="true"]'.concat(e,"[/et_pb_section]"));return e}function Ae(t,i,o,n,a,l,_,d){i=""===i?"not_global":i;if(void 0!==N["".concat(o,"_").concat(i,"_").concat(a,"_").concat(l)]){var r=new s.SavedTemplates(N["".concat(o,"_").concat(i,"_").concat(a,"_").concat(l)]),c=new s.TemplatesView({collection:r,category:_});n.append(c.render().el),"include_global"===t&&"not_global"===i?Ae("include_global","global",o,n,a,l,_):(v.trigger("et-pb-loading:ended"),n.prepend(Me(_)),e("#et_pb_select_category").data("attr",{include_global:t,is_global:"",layout_type:o,append_to:n,module_width:a,specialty_cols:l}))}else e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_get_saved_templates",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_is_global:i,et_post_type:et_pb_options.post_type,et_layout_type:o,et_module_width:a,et_specialty_columns:l},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){("include_global"!==t||"include_global"===t&&"global"===i)&&(v.trigger("et-pb-loading:ended"),n.prepend(Me(_)),e("#et_pb_select_category").data("attr",{include_global:t,is_global:"",layout_type:o,append_to:n,module_width:a,specialty_cols:l}))},success:function(e){var r="";if(void 0!==e.error)("include_global"===t&&"global"===i&&"success"!==d||"include_global"!==t)&&(n.append("<ul><li>".concat(e.error,"</li></ul>")),r="fail");else{var c=new s.SavedTemplates(e),p=new s.TemplatesView({collection:c});N["".concat(o,"_").concat(i,"_").concat(a,"_").concat(l)]=e,n.append(p.render().el),r="success"}"include_global"===t&&"not_global"===i&&Ae("include_global","global",o,n,a,l,_,r)}})}function Me(t){var i=JSON.parse(et_pb_options.layout_categories),o='<select id="et_pb_select_category">',n="all"===t||""===t?" selected":"";return o+='<option value="all"'.concat(n,">").concat(et_pb_options.all_cat_text,"</option>"),e.isEmptyObject(i)||e.each(i,(function(i,a){e.isEmptyObject(a)||(n=t===a.slug?" selected":"",o+='<option value="'.concat(a.slug,'"').concat(n,">").concat(a.name,"</option>"))})),o+="</select>"}function Le(t,i,o,n,a){void 0===N["".concat(t,"_layouts")]||a?e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_show_all_layouts",et_layouts_built_for_post_type:n,et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_load_layouts_type:t},beforeSend:function(){a||v.trigger("et-pb-loading:started")},complete:function(){a||v.trigger("et-pb-loading:ended")},success:function(e){a||o.find(".et-pb-main-settings.".concat(i)).append(e),N["".concat(t,"_layouts")]=e}}):o.find(".et-pb-main-settings.".concat(i)).append(N["".concat(t,"_layouts")])}function Ee(t,i,o){if(!t.hasClass("et-pb-options-tabs-links-active")){var n=void 0!==t.closest(".et-pb-options-tabs-links").data("specialty_columns")?t.closest(".et-pb-options-tabs-links").data("specialty_columns"):0;e(".et-pb-options-tabs-links li").removeClass("et-pb-options-tabs-links-active"),t.addClass("et-pb-options-tabs-links-active"),e(".et-pb-main-settings.active-container").css({display:"block",opacity:1}).stop(!0,!0).animate({opacity:0},300,(function(){e(this).css("display","none"),e(this).removeClass("active-container"),e(".".concat(t.data("open_tab"))).addClass("active-container").css({display:"block",opacity:0}).stop(!0,!0).animate({opacity:1},300)})),void 0!==t.data("content_loaded")||t.hasClass("et-pb-new-module")||"layout"===i||(Ae("include_global","",i,e(".".concat(t.data("open_tab"))),o,n,"all"),t.data("content_loaded","true"))}}function De(t,i){var o=et_pb_options.template_post_id;e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_add_template_meta",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_meta_value:i,et_custom_field:t,et_post_id:o}})}function Ie(t){var i=k.getView(t),o=i.model.get("et_pb_global_module"),n=i.model.get("type"),a="row_inner"===n?"row":n,s=V.generateCompleteShortcode(t,a,"ignore_global",!1,!0),l=_.isEmpty(h[o])?[]:h[o];void 0!==o&&""!==o&&("row_inner"===n&&(s=(s=s.replace(/et_pb_row_inner/g,"et_pb_row")).replace(/et_pb_column_inner/g,"et_pb_column")),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_update_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_content:s,et_template_post_id:o,et_layout_type:n,et_unsynced_options:JSON.stringify(l)}}))}function Pe(e){for(var t=e,i="";!_.isUndefined(t.model.get("parent"))&&""===i;)t=k.getView(t.model.get("parent")),i=""!==i||_.isUndefined(t.model.get("et_pb_global_module"))?i:t.model.get("cid");return i}function Re(){var t=e(".et_pb_modal_settings_container");t.find(".et-pb-options-tabs .et-pb-options-tab:first-child").css({display:"block",opacity:1}),e(".et_pb_modal_settings_container").hasClass("et_pb_hide_general_tab")?(t.find(".et-pb-options-tabs-links li").removeClass("et-pb-options-tabs-links-active"),t.find(".et-pb-options-tabs .et-pb-options-tab").css({display:"none",opacity:0}),t.hasClass("et_pb_hide_advanced_tab")?(t.find(".et-pb-options-tabs-links li.et_pb_options_tab_custom_css").addClass("et-pb-options-tabs-links-active"),t.find(".et-pb-options-tabs .et-pb-options-tab.et-pb-options-tab-custom_css").css({display:"block",opacity:1})):(t.find(".et-pb-options-tabs-links li.et_pb_options_tab_advanced").addClass("et-pb-options-tabs-links-active"),t.find(".et-pb-options-tabs .et-pb-options-tab.et-pb-options-tab-advanced").css({display:"block",opacity:1}))):t.find(".et-pb-options-tabs .et-pb-options-tab.et-pb-options-tab-general").css({display:"block",opacity:1}),function(t){t.find(".et-pb-options-tab:visible").each((function(){var t=e(this);t.find(".et-pb-option:visible").length||t.append('<p class="et-pb-all-options-hidden">'.concat(et_pb_options.all_tab_options_hidden,"<p>"))}))}(t)}function He(){return e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_current_user_can_lock",et_admin_load_nonce:et_pb_options.et_admin_load_nonce},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){v.trigger("et-pb-loading:ended")}})}function Ne(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}function Be(){return"object"===("undefined"==typeof YoastSEO?"undefined":a(YoastSEO))&&YoastSEO.hasOwnProperty("app")}function ze(){return 0<e(".et_pb_modal_overlay, .et-core-modal-overlay.et-core-active").length}function Fe(e){var t=!k.is_global_children(e),i=!!et_pb_options.et_builder_edit_global_library;return t||i}function We(e){if(_.isEmpty(e)||ze())return!1;var t={model:e.model,view:e.$el,view_event:event};return new s.RightClickOptionsView(t,!0)}function Je(t,i){if(0!==t.length){var o=t.find(".et-pb-option");if(t.find(".et-pb-option-advanced-module-settings").length>0){var n=Ke("et_pb_content_field",i)?" et_pb_global_unsynced":"";t.find(".et-pb-option-advanced-module-settings").append('<span class="et_pb_global_sync_switcher'.concat(n,'" data-option_name="et_pb_content_field" data-additional_options="none"></span>'))}0!==o.length&&_.each(o,(function(t){var o=_.includes(["content","raw_content"],e(t).data("option_name"))?"et_pb_content_field":e(t).data("option_name"),n=Ke(o,i)?" et_pb_global_unsynced":"",a=0!==e(t).find(".et_pb_mobile_settings_tabs").length?"mobile":"none";e(t).append('<span class="et_pb_global_sync_switcher'.concat(n,'" data-option_name="').concat(o,'" data-additional_options="').concat(a,'"></span>'))}))}}function Ke(e,t){return"legacy"===(_.isUndefined(h[t])?"legacy":"updated")?-1===f[t].indexOf(e):-1!==h[t].indexOf(e)}function Ge(e){var t=e.closest(".et-pb-option-container--background"),i=e.closest(".et_pb_background-option").attr("data-option_name"),o=e.closest(".et_pb_module_settings").attr("data-module_type"),n=t.closest(".et-pb-options-tabs").find("#et_pb_featured_placement").val();return _.contains(et_pb_options.et_builder_modules_featured_image_background,o)&&"background_image"===i&&"background"===n}function qe(e){return e=(e=(e=(e=e.replace(/<p>\[/g,"[")).replace(/\]<\/p>/g,"]")).replace(/\]<br \/>/g,"]")).replace(/<br \/>\n\[/g,"[")}O.remove(),M.hasClass("et_pb_builder_is_used")&&(L.show(),Q()),A.on("click",(function(t){t.preventDefault();var i,o=e(this),n=o.hasClass("et_pb_builder_is_used"),a=e("#et_pb_fb_cta");if(n)G("deactivate_builder");else{i=ee("content"),E.val(i);var s=getUserSetting("editor");"html"!==s&&(e("#content-html").trigger("click"),setUserSetting("editor",s)),V.reInitialize(),I.val("on"),L.show(),o.text(o.data("editor")),P.toggleClass("et_pb_post_body_hidden"),o.toggleClass("et_pb_builder_is_used"),v.trigger("et-activate-builder"),Q(),a.addClass("et_pb_ready"),e("form#post").append('<input type="hidden" name="et_pb_show_page_creation" value="on" />')}})),e("#et_pb_fb_cta").on("click",(function(t){t.preventDefault(),e("html").fadeOut(),e("form#post").append('<input type="hidden" name="et-fb-builder-redirect" value="'.concat(e(this).attr("href"),'" />')),A.hasClass("et_pb_builder_is_used")||(E.val(ee("content")),V.reInitialize(),I.val("on")),e(window).off("beforeunload").delay(500).queue((function(){var t=e("#save-action #save-post");0===t.length&&(t=e("#publishing-action #publish")),t.trigger("click")}))})).on("contextmenu",(function(){e.ajax({type:"POST",url:e("#post").attr("action"),data:e("#post").serializeArray()})})),function(){var t,i,o,n,s,l,d,r,c,p,b,u=e("#et_pb_last_post_modified"),g=u.val(),h=e("#post_ID").val(),f=void 0!==window.autosaveL10n&&window.autosaveL10n.blog_id,m=!1,w=!0,y=!1,k="https:"===window.location.protocol,C=wpCookies.get("wp-saving-post"),S=300,x=!1;!function(){var e=Math.random().toString(),t=!1;try{window.sessionStorage.setItem("wp-test",e),t=window.sessionStorage.getItem("wp-test")===e,window.sessionStorage.removeItem("wp-test")}catch(e){}p=t}();var j=function(e,t){var i=function(e){var t=!1;return e=e||"wp",p&&f&&(t=(t=sessionStorage.getItem("".concat(e,"-autosave-").concat(f)))?JSON.parse(t):{}),t}(t);if(!i||!h)return!1;if(e)i["post_".concat(h)]=e;else{if(!i.hasOwnProperty("post_".concat(h)))return!1;delete i["post_".concat(h)]}return function(e,t){var i;return t=t||"wp",!(!p||!f)&&(i="".concat(t,"-autosave-").concat(f),sessionStorage.setItem(i,JSON.stringify(e)),null!==sessionStorage.getItem(i))}(i,t)};function $(){wpCookies.get("et-saved-post-".concat(h,"-fb"))&&(j(!1,"wp"),wpCookies.get("et-editing-post-".concat(h,"-fb"))||wpCookies.remove("et-saved-post-".concat(h,"-fb"),et_pb_options.cookie_path,!1,k))}C==="".concat(h,"-saved")&&(wpCookies.set("et-saved-post-".concat(h,"-bb"),"bb",S,et_pb_options.cookie_path,!1,k),wpCookies.set("et-recommend-sync-post-".concat(h,"-bb"),"bb",30,et_pb_options.cookie_path,!1,k)),wpCookies.set("et-editor-available-post-".concat(h,"-bb"),"bb",1800,et_pb_options.cookie_path,!1,k),$(),i=function(){return"on"===e("#et_pb_use_builder").val()},b=function(e){e?(wpCookies.remove("et-saved-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.set("et-saving-post-".concat(h,"-bb"),"bb",S,et_pb_options.cookie_path,!1,k)):(wpCookies.remove("et-saving-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.set("et-saved-post-".concat(h,"-bb"),"bb",S,et_pb_options.cookie_path,!1,k))};var T,U=_.isUndefined(wp.autosave)?"":wp.autosave.getCompareString();l=function(){if(i()&&(w=!1,wpCookies.get("et-editing-post-".concat(h,"-bb")))){if(!function(){if(_.isUndefined(wp.heartbeat)||_.isUndefined(wp.autosave))return!1;var e=wp.autosave.getPostData("local"),t=wp.autosave.getCompareString(e);return void 0===T&&(T=U),t!==T&&(T=t,!0)}())return!1;setTimeout((function(){x||(y=!0,b(!0),_.isUndefined(wp.heartbeat)||_.isUndefined(wp.autosave)||wp.autosave.server.triggerSave())}),0)}},d=function(){if(!i())return!1;var t=e("#post_ID").val(),o="https:"===window.location.protocol;if(w=!0,!wpCookies.get("et-editing-post-".concat(t,"-fb")))return!1;if(_.isUndefined(wp.heartbeat)||_.isUndefined(wp.autosave))return!1;var n=0;if(!function e(){var i=wpCookies.get("et-syncing-post-".concat(t,"-fb")),o=wpCookies.get("et-syncing-post-".concat(t,"-bb"));return n>=5||!i&&!o?(v.trigger("et-pb-loading:ended"),!1):(v.trigger("et-pb-loading:started"),n++,setTimeout(e,1e3),!0)}()){wpCookies.set("et-syncing-post-".concat(t,"-bb"),"bb",30,et_pb_options.cookie_path,!1,o),Ve("external editor was in use!"),Ve("trigger preloader"),v.trigger("et-pb-loading:started"),wp.autosave.server.tempBlockSave();var a=0;!function e(){var i=!1;if(wpCookies.get("et-saved-post-".concat(t,"-fb"))&&(i=!0),a>30&&(i=!0),a++,!_.isUndefined(wp.heartbeat)&&!_.isUndefined(wp.autosave)){if(wp.autosave.server.tempBlockSave(),v.trigger("et-pb-loading:started"),i)return Ve("calling wp.heartbeat.connectNow()"),m=!0,$(),setTimeout((function(){wp.heartbeat.connectNow()}),500),wpCookies.remove("et-saving-post-".concat(t,"-fb"),et_pb_options.cookie_path,!1,o),wpCookies.remove("et-saved-post-".concat(t,"-fb"),et_pb_options.cookie_path,!1,o),wpCookies.remove("et-syncing-post-".concat(t,"-bb"),et_pb_options.cookie_path,!1,o),wpCookies.remove("et-editing-post-".concat(t,"-fb"),et_pb_options.cookie_path,!1,o),!0;setTimeout(e,500)}}()}},c=function(){w&&!document.hasFocus()?l():!w&&document.hasFocus()&&d()},void 0!==document.hidden?(o="hidden",s="visibilitychange",n="visibilityState"):void 0!==document.msHidden?(o="msHidden",s="msvisibilitychange",n="msVisibilityState"):void 0!==document.webkitHidden&&(o="webkitHidden",s="webkitvisibilitychange",n="webkitVisibilityState"),window.addEventListener("beforeunload",(function(e){x=!0,wpCookies.remove("et-editing-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.remove("et-syncing-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.remove("et-saving-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.remove("et-editor-available-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k)})),o&&e(document).on("".concat(s,".fb-heartbeat"),(function(e){i()&&("hidden"===document[n]?(l(),window.clearInterval(r)):(d(),document.hasFocus&&(r=window.setInterval(c,1e3))))})),document.hasFocus&&(r=window.setInterval(c,1e3)),d(),setInterval((function(){var e=wpCookies.get("et-recommend-sync-post-".concat(h,"-fb")),t=wpCookies.get("et-saved-post-".concat(h,"-fb"));e&&t&&(_.isUndefined(wp.heartbeat)||wp.heartbeat.connectNow(),wpCookies.remove("et-recommend-sync-post-".concat(h,"-fb"),et_pb_options.cookie_path,!1,k))}),3e3),e(document).on("heartbeat-send.bb-heartbeat",(function(t,o){i()&&(o.et={last_post_modified:g,built_by:"bb",post_id:h,force_check:m,force_autosave:!m&&y},m=!1,y&&void 0===o.wp_autosave&&(o.wp_autosave=wp.autosave.getPostData(),o.wp_autosave.content=ee("content"),o.wp_autosave._wpnonce=e("#_wpnonce").val()||""),"object"===a(o.wp_autosave)&&(o.wp_autosave.builder_settings=_.mapObject(_.indexBy(e(".et_pb_page_settings input.et_pb_value_updated").serializeArray(),"name"),(function(e,t){return e.value})),o.wp_autosave.et_fb_autosave_nonce=et_pb_options.et_fb_autosave_nonce,e(".et_pb_page_settings input.et_pb_value_updated").removeClass("et_pb_value_updated")),y&&void 0!==o.wp_autosave&&(y=!1))})),e(document).on("heartbeat-tick.bb-heartbeat",(function(o,n){if(i()){if(!_.isEmpty(n.et)&&!_.isEmpty(n.et.builder_settings_autosave)){var a=e(".et_pb_modal_overlay.et_pb_builder_settings").length;_.each(n.et.builder_settings_autosave,(function(t,i){if(e("#_".concat(i)).val(t),"et_pb_section_background_color"===i&&(et_pb_options.page_section_bg_color=t),"et_pb_page_gutter_width"===i&&(et_pb_options.page_gutter_width=t),"et_pb_color_palette"===i&&(et_pb_options.page_color_palette=t),a){var o=e('.et_pb_modal_overlay.et_pb_builder_settings div[data-id="'.concat(i,'"]'));switch(o.attr("data-type")){case"range":o.find(".range, .et-pb-range-input").val(t);break;case"color-alpha":o.find(".input-colorpicker").wpColorPicker("color",t);break;case"textarea":o.find("textarea").val(t);break;case"colorpalette":var n=t.split("|");o.find(".input-colorpalette-colorpicker").each((function(t,i){if(!_.isUndefined(n[t])){var a=n[t];e(i).val(a).wpColorPicker("color",a),o.find(".colorpalette-item-".concat(t+1)).css({backgroundColor:a})}}));break;case"yes_no_button":o.find(".et_pb_yes_no_button_wrapper");var s=o.find(".et_pb_yes_no_button");o.find("select").find('option[value="'.concat(t,'"]')).prop("selected",!0),"on"===t?s.removeClass("et_pb_off_state").addClass("et_pb_on_state"):s.removeClass("et_pb_on_state").addClass("et_pb_off_state");break;default:o.find("input").val(t)}}}))}if(n.wp_autosave&&b(!1),void 0===n.et)return!1;if(void 0!==n.et.post_modified&&(g=n.et.post_modified),void 0!==n.et.post_content){Ve("ext changes occured"),t=n.et.post_content;var s=e(".et_pb_modal_settings_container");s.length&&"module_settings"===s.attr("data-open_view")&&s.find(".et-pb-modal-close").trigger("click"),O()}else v.trigger("et-pb-loading:ended")}}));var O=function(){if(u.val(g),i()&&""!=t){v.trigger("et-pb-loading:started");var o=t;ae("content",o,"updating_to_latest_fb_content"),setTimeout((function(){var t=e("#et_pb_layout"),i=t.innerHeight();t.css({height:"".concat(i,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),V.enable_history=!1,V.createLayoutFromContent(Oe(o),"","",{is_reinit:"reinit"}),J.is_active_based_on_models()?(J.toggle_status(!0),Ue()):J.toggle_status(!1),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),setTimeout((function(){wpCookies.remove("et-editing-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k)}),500)}),500)}}}(),e(document).on("tinymce-editor-init.autosave",(function(t,i){"content"===i.id&&e(document).off("tinymce-editor-init.autosave")}));var Ye={key:"et_pb_clipboard_",set:function(e,t){Ne()?(localStorage.setItem("".concat(this.key,"type"),LZString.compressToUTF16(e)),localStorage.setItem("".concat(this.key,"content"),LZString.compressToUTF16(t))):alert(et_pb_options.localstorage_unavailability_alert)},get:function(e){if(Ne()){var t=LZString.decompressFromUTF16(localStorage.getItem("".concat(this.key,"type"))),i=LZString.decompressFromUTF16(localStorage.getItem("".concat(this.key,"content")));return(void 0===e||e===t)&&i}alert(et_pb_options.localstorage_unavailability_alert)}},Ze=_.debounce(Ue,2e3);if(e(window).on("keydown",(function(i){if("on"===e("#et_pb_use_builder").val()){if(ze()||e(".et_pb_prompt_modal").is(":visible")){var o=e(".et-pb-modal-save"),n=e(".et_pb_prompt_proceed"),a=e("#et_pb_main_container a, #et_pb_toggle_builder");switch(i.which){case 13:if(e(".et-pb-option-container textarea, #et_pb_address, #et_pb_pin_address, .et-pb-color-picker-hex-has-preview").is(":focus"))return void e(".et-pb-color-picker-hex-has-preview:focus").wpColorPicker("close");a.trigger("blur"),(o.length||n.length)&&(n.length?n.trigger("click"):void 0!==o[1]?o[1].trigger("click"):o.trigger("click"));break;case 27:I()}}if(83===i.keyCode&&i.metaKey&&i.shiftKey&&!i.altKey||83===i.keyCode&&i.ctrlKey&&i.shiftKey&&!i.altKey)return i.preventDefault(),I(),void e("#save-post").trigger("click");if(83===i.keyCode&&i.metaKey&&!i.altKey||83===i.keyCode&&i.ctrlKey&&!i.altKey)return i.preventDefault(),I(),void t("#publish").trigger("click");var l=e(i.target);if(_.isUndefined(l)||!(l.is("input, textarea")||l.attr("contenteditable")||l.hasClass("et_disable_single_key_shortcuts"))){if(90===i.keyCode&&i.metaKey&&i.shiftKey&&!i.altKey||90===i.keyCode&&i.ctrlKey&&i.shiftKey&&!i.altKey)return i.preventDefault(),V.redo(i),!1;if(90===i.keyCode&&i.metaKey&&!i.altKey||90===i.keyCode&&i.ctrlKey&&!i.altKey)return i.preventDefault(),V.undo(i),!1;if(79===i.keyCode){if(ze())return;i.preventDefault(),e(".et_pb_builder_settings").length||e("#et_pb_layout .et-pb-app-settings-button").trigger("click")}else if(80===i.keyCode){if(i.preventDefault(),i.metaKey||i.ctrlKey)return e(".et-pb-modal-preview-template").length&&e(".et-pb-modal-preview-template").trigger("click"),!1;if(ze())return;e("div[data-et-core-portability]").hasClass("et-core-active")||e("#et_pb_layout .et-pb-app-portability-button").trigger("click")}else if(72===i.keyCode){if(ze())return;i.preventDefault(),e("#et_pb_layout .et-pb-layout-buttons-history").trigger("click")}else if(9===i.keyCode&&i.shiftKey){if(e(".et-pb-options-tabs-links").length||e(".et-pb-preview-screensize-switcher").length){var d=!(!e(".et-pb-modal-preview-template").length||!e(".et-pb-modal-preview-template").hasClass("active")),r=e(d?".et-pb-preview-screensize-switcher":".et-pb-options-tabs-links").find("li"),c=r.length,p=r[0];r.each((function(t){var i=d?e(this).find("a"):e(this),o=d?"active":"et-pb-options-tabs-links-active";i.hasClass(o)&&t!==c-1&&(p=r[t+1])})),e(p).length&&e(p).find("a").trigger("click")}}else if(67===i.keyCode&&(i.metaKey||i.ctrlKey)){if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;h.copy(i)}}else if(86===i.keyCode&&(i.metaKey||i.ctrlKey)){if(h=We(g))(E=g.$el).hasClass("et-pb-column")||E.hasClass("et_pb_section_fullwidth")&&!Ye.get("et_pb_clipboard_section")&&!E.find(".et_pb_module_block").length?h.pasteColumn(i):h.pasteAfter(i)}else if(88===i.keyCode&&(i.metaKey||i.ctrlKey)){if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;h.copy(i);var b=g.$el.hasClass("et_pb_module_block")?g.$el.find(".et-pb-remove"):g.$el.find("> .et-pb-controls .et-pb-remove");b.length&&(b.trigger("click"),g={},Ue())}}else if(68===i.keyCode){if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;var u="disabled";void 0===h.model.attributes.et_pb_disabled||"on"!==h.model.attributes.et_pb_disabled?(h.model.attributes.et_pb_disabled="on",g.$el.addClass("et_pb_disabled")):(h.model.attributes.et_pb_disabled="off",g.$el.removeClass("et_pb_disabled"),u="enabled"),h.updateGlobalModule(),V.allowHistorySaving(u,h.history_noun),V.saveAsShortcode()}}else if(76===i.keyCode){var h;if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;void 0===h.model.attributes.et_pb_locked||"on"!==h.model.attributes.et_pb_locked?h.lock(i):h.unlockItem(i),Ue()}}else if(83===i.keyCode)i.preventDefault(),_.isEmpty(g)||e(".et_pb_modal_overlay").length||(m.s=!0);else if(49!==i.keyCode&&50!==i.keyCode&&51!==i.keyCode||!m.s)if(82===i.keyCode)_.isEmpty(g)||e(".et_pb_modal_overlay").length||(m.r=!0);else if(67!==i.keyCode||i.metaKey||i.ctrlKey)if(49!==i.keyCode&&50!==i.keyCode&&51!==i.keyCode&&52!==i.keyCode&&53!==i.keyCode&&54!==i.keyCode&&55!==i.keyCode&&56!==i.keyCode&&57!==i.keyCode&&48!==i.keyCode&&189!==i.keyCode||!m.r&&!m.c){if(49===i.keyCode||50===i.keyCode||51===i.keyCode||52===i.keyCode||53===i.keyCode||54===i.keyCode||55===i.keyCode||56===i.keyCode||57===i.keyCode||48===i.keyCode||189===i.keyCode){if(!e("ul.et-pb-column-layouts").length)return;var f=e("ul.et-pb-column-layouts li");C=0;switch(i.keyCode){case 49:C=0;break;case 50:C=1;break;case 51:C=2;break;case 52:C=3;break;case 53:C=4;break;case 54:C=5;break;case 55:C=6;break;case 56:C=7;break;case 57:C=8;break;case 48:C=9;break;case 189:C=10}f.length&&f[C]&&e(f[C]).trigger("click")}else if("?"===i.key||191===i.keyCode){var v="help"===e(".et_pb_modal_settings_container").attr("data-open_view");if(e(".et-pb-modal-close").length&&e(".et-pb-modal-close").trigger("click"),v)return;I();var w=new s.ModalView({attributes:{"data-open_view":"help"},view:this});e("body").append(w.render().el)}}else{var y=(E=g.$el).closest(".et_pb_row");if(y.length){var C="4_4";switch(i.keyCode){case 49:C="4_4";break;case 50:C="1_2,1_2";break;case 51:C="1_3,1_3,1_3";break;case 52:C="1_4,1_4,1_4,1_4";break;case 53:C="2_3,1_3";break;case 54:C="1_3,2_3";break;case 55:C="1_4,3_4";break;case 56:C="3_4,1_4";break;case 57:C="1_2,1_4,1_4";break;case 48:C="1_4,1_4,1_2";break;case 189:C="1_4,1_2,1_4"}var S=k.getView(y.find(".et-pb-row-content").data("cid"));if(void 0!==S){var x=!1,j=!1,$=k.getView(S.model.attributes.parent);if(void 0!==$&&"column"===$.model.attributes.type){var T=3===$.model.attributes.specialty_columns?[49,50,51]:[49,50];if(-1===e.inArray(i.keyCode,T))return}var U={};if(m.r){if("on"===S.model.get("et_pb_parent_locked"))return;if(J.is_active()&&!J.is_user_has_permission(S.model.get("cid"),"add_row"))return void J.alert("has_no_permission");V.allowHistorySaving("added","row"),j=!0;var O=k.generateNewId(),A=void 0!==S.model.get("et_pb_global_module")&&""!==S.model.get("et_pb_global_module")?S.model.get("et_pb_global_module"):"",M=""!==A?S.model.get("cid"):"";$.collection.add([{type:"row",module_type:"row",cid:O,parent:$.model.get("cid"),view:S,appendAfter:S.$el,et_pb_global_parent:A,global_parent_cid:M,admin_label:et_pb_options.noun.row}]),U=k.getView(O)}else{if(void 0!==S.model.attributes.et_pb_global_module&&""!==S.model.attributes.et_pb_global_module||"row"===et_pb_options.layout_type&&"global"===et_pb_options.is_global_template)return;U=S,x=!0}var L={layout:C,is_structure_change:x,layout_specialty:""};k.changeColumnStructure(U,L,!0,j)}}}else _.isEmpty(g)||e(".et_pb_modal_overlay").length||(m.c=!0);else{if(e(".et_pb_modal_overlay").length)return;var E,D=(E=g.$el).closest(".et_pb_section");if(D.length)switch(i.keyCode){case 49:D.find(".et-pb-section-add-main").trigger("click");break;case 50:D.find(".et-pb-section-add-specialty").trigger("click");break;case 51:D.find(".et-pb-section-add-fullwidth").trigger("click")}}}}function I(){var t=e(".et-pb-modal-close"),i=e(".et-core-modal-close");t.length&&(void 0!==t[1]?t[1].trigger("click"):t.trigger("click")),i.length&&i.trigger("click"),e("body").removeClass("et-core-nbfc")}})),e(window).on("keyup",(function(e){83===e.keyCode?m.s=!1:82===e.keyCode?m.r=!1:67===e.keyCode&&m.c&&(m.c=!1,Ze())})),e("body").on("mouseover",".et-pb-right-click-trigger-overlay, .et-pb-controls, .et_pb_module_block, .et-pb-insert-module, .et-pb-row-add",(function(t){var i=e(t.target),o=i.closest(".et_pb_module_block");if(!o.length)if(i.closest(".et-pb-insert-module").length||i.closest(".et-pb-row-add").length)o=i.closest("div"),i.closest(".et-pb-row-add").length&&(o=o.find(".et-pb-row-content"));else{var n=i.closest(".et-pb-right-click-trigger-overlay").length?i.closest(".et-pb-right-click-trigger-overlay"):i.closest(".et-pb-controls");if(!n.length)return void(g={});var a=n.closest(".et_pb_row");if(a.length)o=a.find(".et-pb-row-content");else o=n.closest(".et_pb_section").find(".et-pb-section-content")}if(o.length){var s=k.getView(o.data("cid"));g=s}})),e("body").on("dblclick",".et-pb-right-click-trigger-overlay, .et-pb-controls, .et_pb_module_block",(function(t){var i=e(t.target);if(!i.closest("a").length){var o=i.closest(".et_pb_module_block");if(o.length)o.find(".et-pb-settings").trigger("click");else{i.closest(".et-pb-controls").length&&i.closest(".et-pb-controls").find(".et-pb-settings").trigger("click");var n=i.closest(".et-pb-right-click-trigger-overlay");if(n.length){var a=n.closest(".et_pb_row");if(a.length)a.find("> .et-pb-controls .et-pb-settings").trigger("click");else n.closest(".et_pb_section").find("> .et-pb-controls .et-pb-settings").trigger("click")}}}})),"0"===et_pb_options.is_divi_library){var Xe=e("#et-builder-app-settings-button-template").html();e("#et_pb_layout").prepend(Xe),e("#et_pb_layout").on("click",".et-pb-app-view-ab-stats-button",(function(t){t.preventDefault(),J.is_selecting_subject()?J.alert("select_ab_testing_subject_first"):J.is_selecting_goal()?J.alert("select_ab_testing_goal_first"):J.is_selecting_winner()?J.alert("select_ab_testing_winner_first"):e("#et_pb_layout_controls .et-pb-layout-buttons-view-ab-stats").trigger("click")})),e("#et_pb_layout").on("click",".et-pb-app-portability-button.et-core-disabled",(function(e){e.preventDefault(),J.is_selecting_subject()?J.alert("select_ab_testing_subject_first"):J.is_selecting_goal()?J.alert("select_ab_testing_goal_first"):J.is_selecting_winner()?J.alert("select_ab_testing_winner_first"):J.is_active()&&J.alert("cannot_import_export_layout_has_ab_testing")})),e("#et_pb_layout").on("click",".et-pb-app-settings-button",(function(t){t.preventDefault(),J.is_selecting_subject()?J.alert("select_ab_testing_subject_first"):J.is_selecting_goal()?J.alert("select_ab_testing_goal_first"):J.is_selecting_winner()?J.alert("select_ab_testing_winner_first"):e("#et_pb_layout_controls .et-pb-layout-buttons-settings").trigger("click")}))}else e("#toplevel_page_et_divi_options, #toplevel_page_et_divi_options > a").addClass("wp-has-current-submenu wp-menu-open").removeClass("wp-not-current-submenu");if(Be()){var Qe=function(){YoastSEO.app.registerPlugin("ET_PB_Yoast_Content",{status:"ready"}),YoastSEO.app.registerModification("content",this.et_pb_update_content,"ET_PB_Yoast_Content",5)};Qe.prototype.et_pb_update_content=function(t){var i=F||et_pb_options.yoast_content;return e(".et-pb-yoast-loading").remove(),i},new Qe}e(window).on("resize",(function(){var t=e(".et_pb_prompt_modal.et_pb_auto_centerize_modal");t.length&&(t.removeAttr("style"),(0,n.default)(t,".et_pb_prompt_buttons"))})),e(window).on("load",(function(){setTimeout((function(){var t=e("#et_pb_toggle_builder"),i=e("#et_pb_fb_cta");t.addClass("et_pb_ready"),t.hasClass("et_pb_builder_is_used")&&i.addClass("et_pb_ready")}),250)})),e(window).on("mousedown",(function(t){var i=e(".et-pb-settings-option-select-advanced.et_pb_menu_active");e(t.target).closest(".et-pb-settings-option-select-advanced").length<1&&i.length>0&&ge(i)}))})),window.et_builder=window.et_builder||{},void 0!==window.YoastShortcodePlugin&&(window.YoastShortcodePlugin.prototype.bindElementEvents=function(){var e=document.getElementById("content")||!1,t=this;e&&(e.addEventListener("keydown",this.loadShortcodes.bind(this,this.declareReloaded.bind(this))),e.addEventListener("change",this.loadShortcodes.bind(this,this.declareReloaded.bind(this)))),"undefined"!=typeof tinyMCE&&"function"==typeof tinyMCE.on&&tinyMCE.on("addEditor",(function(e){e.editor.on("change",(function(){t.loadShortcodes.bind(t,t.declareReloaded.bind(t))()}))}))}),document.addEventListener("DOMContentLoaded",(function(){var t,i={tabs:{},padding:{},yes_no_button:{},multiple_buttons:{},font_buttons:{},text_align_buttons:{},select:{},font_line_styles:{},animation_buttons:{},user_fonts:et_pb_options.user_fonts,font_weights:et_pb_options.supported_font_weights,options_icons:et_pb_options.all_svg_icons,background_tabs_nav:{},background_gradient_buttons:{},option_preview_buttons:{}};function o(){var t=e(".et_pb_modal_settings_container");t.find("div.mce-fullscreen").length&&setTimeout((function(){var e=t.innerHeight(),i=t.find(".mce-toolbar-grp").innerHeight()||0;t.find("iframe").height(e-i)}),100)}window.et_builder_template_options=i,s.Events.on("et-advanced-module-settings:render",(function(t){var i,o=t.$el.find("#et_pb_category_id"),n=t.$el.find("#et_pb_category_name");o.length&&n.length&&(i=o.find("option:selected").text().trim(),n.val(i),o.on("change",(function(){i=e(this).find("option:selected").text().trim(),n.val(i)})))})),t={fonts_template:function(t){return _.template(e("#et-builder-google-fonts-options-items").html())(window.et_builder_template_options.user_fonts)},fonts_weight_template:function(t){return _.template(e("#et-builder-font-weight-items").html())(window.et_builder_template_options.font_weights)},font_icon_list_template:function(){return e("#et-builder-font-icon-list-items").html()},font_down_icon_list_template:function(){return e("#et-builder-font-down-icon-list-items").html()},preview_tabs_output:function(){return e("#et-builder-preview-icons-template").html()},settings_tabs_output:function(t){var i=_.template(e("#et-builder-options-tabs-links-template").html());return window.et_builder_template_options.tabs.options=e.extend({},t),i(window.et_builder_template_options.tabs)},mobile_tabs_output:function(){return e("#et-builder-mobile-options-tabs-template").html()},options_template_output:function(t,i,o){var n=_.template(e("#et-builder-".concat(t,"-option-template")).html());return window.et_builder_template_options[t].options=e.extend({},i),_.isUndefined(o)||(window.et_builder_template_options[t].data=e.extend({},o)),n(window.et_builder_template_options[t])},options_text_align_buttons_output:function(t,i){var o=_.template(e("#et-builder-text-align-buttons-option-template").html());return window.et_builder_template_options.text_align_buttons.options=e.extend({},t),window.et_builder_template_options.text_align_buttons.type=i,o(window.et_builder_template_options.text_align_buttons)}},e.extend(window.et_builder,t),e("body").on("click",".et_pb_module_settings .mce-i-fullscreen",(function(){o()})),e(window).on("resize",(function(){o()})),e("body.wp-admin").on("click",'.et-pb-modal-container .mce-widget.mce-btn[aria-label="Fullscreen"] button',(function(){setTimeout((function(){e(window).trigger("resize")}),50)})),e(document).on("click",".et-pb-dynamic-content-fb-switch",(function(t){t.preventDefault(),e("#et_pb_fb_cta").trigger("click")}))}))}).call(this,i(0),i(0))},23:function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(t,i){var o=e(window),n=e("#wpadminbar"),a=o.height(),s=t.outerHeight(),l=n.outerHeight(),_=0-s/2+l/2;s>a-l?t.css({top:"".concat(l+15,"px"),bottom:15,marginTop:0,minHeight:0}):t.css({top:"50%",marginTop:"".concat(_,"px")}),t.addClass("et_pb_auto_centerize_modal")};t.default=i}).call(this,i(0))}}); |