Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 63
/home/sportsfe.../httpdocs/wp-conte.../plugins/themify-.../js/editor/frontend
File: themify-builder-visual.js
((t,e,i,o,r,n,s,l,a,_,d,u,h,c,g,f,b,p,m)=>{"use strict";let v,w,y;t.is_ajax_call=null;const k=new p,x=new p,z=()=>{const e=r.document.tfClass("tb_middle_bar"),i=function(e){if(0===e.button){e.stopPropagation();let i,o=e.clientX,s=r.document.tfId("tb_iframe"),l="tb_right_bar"===this.id?"right":"left",a=themify_vars.breakpoints,_=t.ToolBar.el.offsetWidth,d=s.offsetWidth,c=r.document.tfClass("tb_vertical_change_tooltip")[0],b=r.document.tfClass("tb_vertical_bars")[0];s.style.transition="none",c?.remove(),c=f("","tb_vertical_change_tooltip"),this.appendChild(c),b.className+=" tb_resizing_start",s.classList.add("tb_resizing_start");const p=()=>{n.body.classList.add("tb_start_animate","tb_start_change_mode")},m=e=>{e.stopPropagation(),h(i),i=u((()=>{let i=e.clientX-o;i*=2,"left"===l&&(i=-i);let r,n=d+i<320?320:d+i;n<=a.mobile?r="mobile":n<=a.tablet[1]?r="tablet":n<=a.tablet_landscape[1]?r="tablet_landscape":(r="desktop",n>_-17&&(n=_)),c.textContent=s.style.width=g(n)+"px",t.activeBreakPoint!==r&&t.ToolBar.switchToBreakpoint(n)}))},v=function(e){e.stopPropagation(),h(i),this.tfOff("lostpointercapture pointerup",v,{once:!0,passive:!0}).tfOff("pointermove",p,{once:!0,passive:!0}).tfOff("pointermove",m,{passive:!0}),c.remove(),s.style.transition="",s.classList.remove("tb_resizing_start"),b.classList.remove("tb_resizing_start"),n.body.classList.remove("tb_start_animate","tb_start_change_mode"),t.Utils.onResize(!0),b=c=d=a=l=o=_=i=s=null};this.tfOn("lostpointercapture pointerup",v,{once:!0,passive:!0}).tfOn("pointermove",p,{once:!0,passive:!0}).tfOn("pointermove",m,{passive:!0}).setPointerCapture(e.pointerId)}};for(let t=e.length-1;t>-1;--t)e[t].tfOn("pointerdown",i,{passive:!0})},N={async reCreate(){const i=f("span","tf_lazy tb_preview_component"),o=e.convert(this.el.querySelectorAll("[data-cid]")),r=[];this.el.prepend(i),o.unshift(this.el);for(let e=o.length-1;e>-1;--e){let i=t.Registry.get(o[e].dataset.cid);i&&r.push(i.id)}await t.bootstrap(r),i.remove(),t.Utils.setColumnsCount(this.el.tfClass("module_column")),t.Utils.runJs(this.el)},createEl(e){const i=this.type,o=f("template");o.innerHTML=e;const r=o.content.querySelector(".module_"+i),n=r.classList,s=r.attributes,l="subrow"===i?this.el.tfClass("module_subrow")[0]:this.el;for(let t=n.length-1;t>-1;--t)l.classList.add(n[t]);for(let t=s.length-1;t>-1;--t){let e=s[t].name;"class"!==e&&l.setAttribute(e,s[t].value)}const a=r.tfClass("builder_row_cover")[0],_=r.tfClass("tbp_dc_styles")[0],d=r.tfClass(i+"-slider")[0],u=r.tfClass("tb_row_frame_wrap")[0],h=b(),c=l.tfClass("builder_row_cover")[0],g=l.tfClass("tb_row_frame_wrap")[0],p=l.tfClass("tbp_dc_styles")[0],m=l.tfClass(i+"-slider")[0];a?.parentNode===r?c?.parentNode===l?c.replaceWith(a):h.appendChild(a):c?.remove(),u?.parentNode===r?g?.parentNode===l?g.replaceWith(u):h.appendChild(u):g?.remove(),_?.parentNode===r?p?.parentNode===l?p.replaceWith(_):l.appendChild(_):p?.remove(),d?.parentNode===r?m?.parentNode===l?m.replaceWith(d):h.appendChild(d):d?.remove(),"row"===i&&t.is_builder_ready&&(l.tfClass("tb_row_anchor")[0].textContent=this.get("row_anchor")||""),l.prepend(h)},previewVisibility(){const e=this.el,i=e.classList,o=e.dataset,r=this.get("mod_settings");t.isPreview?("hide_all"===r.visibility_all?i.add("hide-all"):("hide"===r.visibility_desktop&&i.add("hide-desktop"),"hide"===r.visibility_tablet&&i.add("hide-tablet"),"hide"===r.visibility_tablet_landscape&&i.add("hide-tablet_landscape"),"hide"===r.visibility_mobile&&i.add("hide-mobile")),r.custom_parallax_scroll_reverse&&(o.parallaxElementReverse=!0),r.custom_parallax_scroll_fade&&(o.parallaxFade=!0),r.custom_parallax_scroll_speed&&(o.parallaxElementSpeed=~~r.custom_parallax_scroll_speed)):i.remove("hide-desktop","hide-tablet","hide-tablet_landscape","hide-mobile","hide-all")},previewLive:t=>a.keys(t).length>0},T={visualPreview(...t){return"ajax"===this.getPreviewType()?this.previewReload(...t):this.previewLive(...t)},createEl(i){let o=b(),r=f("template"),n=f("","tb_data_mod_name tf_overflow tf_textc tf_abs_t tf_hide"),s=this.get("mod_name"),l=null;"string"==typeof i?(r.innerHTML=i,r=r.content,l=r.querySelector(".module")):(r=i,l=r.classList.contains("module")?r:r.querySelector(".module"));const a=r.querySelector("#tb_module_styles"),_=r.querySelectorAll('link[rel="prefetch"]');if(null===l)return t.is_ajax_call||t.Registry.remove(this.id),!1;for(let t=_.length-1;t>-1;--t)_[t].remove();if(null!==a){const t=JSON.parse(a.innerText);for(let i in t)t[i].s&&e.loadCss(t[i].s,i,t[i].v)}n.innerHTML=this.getName(),l.classList.add("module-"+s,"tb_"+this.id),l.append(n,f("","tf_plus_icon tb_column_btn_plus tb_disable_sorting")),o.append(l,f("","tb_action_wrap tb_module_action tf_abs_t tf_box tf_hide"),f("","tb_visibility_hint tf_overflow tf_abs_t tf_hide")),this.el.replaceChildren(o),this.fixSafariSrcSet(),this.visibilityLabel()},selectorPreview(t,e){const i=t.length===s?[t]:t;for(let t=i.length-1;t>-1;--t)if(i[t].hasAttribute("data-has-editor"))i[t].innerHTML=e;else{let o=i[t].childNodes;if(o[0]!==s){let t=!1;for(let i=o.length-1;i>-1;--i)if(o[i].nodeType===Node.TEXT_NODE){o[i].nodeValue=e,t=!0;break}return t}i[t].textContent=e}return!0},shortcodeToHTML(i,o){let r=[],n=_.available_shortcodes,s=!1;for(let t=0;t<n.length;++t)i=wp.shortcode.replace(n[t],i,(t=>{s=!0;let i=wp.shortcode.string(t),o=e.hash(i),n=k.get(o);return n||(r.push(i),n='<span class="tb_shortocde_loading tmp'+o+'">[loading shortcode...]</span>'),n}));if(o)return s;if(s&&r.length>0){t.bootstrap_working||!0!==t.is_builder_ready||y?.abort(),y=new AbortController;const i={action:"tb_render_element_shortcode",shortcode_data:JSON.stringify(r)};t.LocalFetch(i,"json",{signal:y.signal}).then((i=>{if(i.success){const o=i.data.shortcodes,r=i.data.styles;if(r)for(let t=0;t<r.length;++t)e.loadCss(r[t].s+"?ver="+r[t].v,null,!1,null,r[t].m);for(let i=0;i<o.length;++i){let r=e.hash(o[i].key),n=f("template");n.innerHTML=o[i].html,this.el.tfClass("tmp"+r)[0].replaceWith(n.content),k.set(r,o[i].html),t.is_builder_ready&&t.Utils.runJs(this.el,"module",!0)}}}))}return{content:i,found:s}},previewLive(i,o,r,n){return new l((async s=>{t.is_ajax_call=!1,t.bootstrap_working||!0!==t.is_builder_ready||w?.abort(),i??={},i.cid=this.id;let l,a=null!==t.activeModel&&r,_=300;if(!a||!0===o){if(l=await this.preview(i),t.is_ajax_call||!l)return void s();e.trigger("tb_preview_component",{tmpl:l,data:i,slug:this.get("mod_name")}),!0===o&&this.shortcodeToHTML(n,!0)&&(_=1e3,a=null)}e.trigger("tbDisableInline"),a?this.selectorPreview(r,n)?s():this.previewLive(i,o).then(s):(this.createEl(l),t.bootstrap_working||!0!==t.is_builder_ready?s():t.activeModel?(t.liveStylingInstance.el=this.el,clearTimeout(v),v=d((()=>{v=null,t.Utils.runJs(this.el,"module"),s()}),_)):(t.Utils.runJs(this.el,"module"),s()))})).catch((t=>{console.error(t,this)}))},async previewReload(i,o,r){if(o&&r&&t.activeModel)this.selectorPreview(o,r);else{t.bootstrap_working||!0!==t.is_builder_ready||w?.abort();const o=this.get("mod_name"),r=i.unsetKey,n="module_"+o+"_slug";e.trigger("tbDisableInline"),delete i.unsetKey,delete i.element_id,this.constructor.builderSave(i),i[n]=1,i=JSON.stringify(i);let s,l=e.hash(i),a=!r&&x.get(l);if(a)s=a.html.replaceAll(a.id,this.id);else{const e=f("span","tb_preview_component tf_lazy");this.el.prepend(e),t.is_ajax_call=!0,w=new AbortController;try{const e={action:"tb_load_module_partial",element_id:this.id,tb_module_slug:o,tb_module_data:i};try{s=await t.LocalFetch(e,"text",{signal:w.signal})}catch(t){if("AbortError"!==t.name)throw t;return}x.set(l,{html:s,id:this.id}),t.is_ajax_call=w=null}catch(t){throw this.el.classList.remove("tb_preview_loading"),t}finally{e.remove()}}delete i[n],this.createEl(s),t.bootstrap_working||!0!==t.is_builder_ready||(t.liveStylingInstance.el=this.el,t.Utils.runJs(this.el,"module",!0))}}};a.assign(t.Base.prototype,N),a.assign(t.Module.prototype,T);const C=()=>{if(!t.Builder.get()){const e=n.tfClass("themify_builder_content"),i=t.Helper.correctBuilderData(_.builder_data),o=0,r=[];for(let t=e.length-1;t>-1;--t)e[t].classList.add("not_editable_builder");for(let t=0,e=i.length;t<e;++t)i[t]&&a.keys(i[t]).length>0&&r.push(i[t]);new t.Builder(n.tfClass("themify_builder_content-"+_.post_ID)[o],r,_.custom_css)}},S=async(i,o,r,n)=>{if(o>=i.length)e.trigger("tb_css_visual_modules_load");else{const s=i.slice(o,o+r);await(async(i,o)=>{const r={},n=new p,s=[],a=t.Registry;for(let t=i.length-1;t>-1;--t){let o=i[t],s=o.element_id,l=a.get(s),_="module_"+(o.mod_name||o.elType)+"_slug",d=o.mod_settings||o.styling||{};l.constructor.builderSave(d),d[_]=1;let u=e.hash(JSON.stringify(d)),h=x.get(u);delete d[_],h?(i.splice(t,1),r[s]=h):n.set(s,u)}if(i.length>0){const r={action:"tb_render_element",batch:JSON.stringify(i)};o&&(r.tmpGS=JSON.stringify(o));const l=await t.LocalFetch(r);if(l.tb_module_styles){const t=l.tb_module_styles;for(let i in t)t[i].s&&s.push(e.loadCss(t[i].s,i,t[i].v))}for(let t in l)if("tb_module_styles"!==t&&"gs"!==t){let e=n.get(t);e&&x.set(e,{html:l[t],id:t}),a.get(t)?.createEl(l[t])}}for(let t in r){let e=r[t];a.get(t)?.createEl(e.html.replaceAll(e.id,t))}if(!0===t.is_builder_ready&&s.length>0)try{await l.all(s)}catch(t){}})(s,n),S(i,o+=r,r)}};t.bootstrap=async(e,i,o)=>{const r=[];t.bootstrap_working=!0,o??=!!e,e||(C(),e=t.Registry.items.keys());for(let i of e){let e=t.Registry.get(i),{type:n,fields:l}=e,a=l.mod_name,d=e.get("styling");if("module"===n&&_.modules[a]===s){e.getDisabledTpl();continue}if(!0===o&&await t.setCss([l],"module"===n?a:n),d.t===s)if("module"!==n){if(!e.previewLive(d))continue}else if("ajax"!==e.getPreviewType()){e.previewLive(d);continue}if("tb-page-break"===d.custom_css_row&&"row"===n)continue;let u={elType:n,element_id:i};"module"===n?(u.mod_name=a,u.mod_settings=d):u.styling=d,r.push(u)}e=null,await S(r,0,120,i),t.bootstrap_working=null},t.render=async()=>{await l.all([t.jsModuleLoaded(),t.loadJson()]),C(),i.init(t.styleData,t.breakpointsReverse,t.Builder.get().id,_.gutters),await t.bootstrap(),await t.setCss(t.Builder.get().toJSON()),e.trigger("themify_builder_ready"),r.Themify.trigger("themify_builder_ready"),t.Utils.runJs(),t.liveStylingInstance=new E,t.Registry.trigger(t.Builder.get(),"tb_init"),t.is_builder_ready=!0,d((()=>{e.fonts(),t.EdgeDrag.init(),z()}),1500)},t.setCss=async(e,o,r)=>{const n=await t.GS.createCss(e,o),s=[];for(let e in n)if("fonts"===e||"cf_fonts"===e)for(let t in n[e]){let i=t;n[e][t].length>0&&(i+=":"+n[e][t].join(",")),s.push(i)}else if("gs"===e){let o=n[e];for(let e in o){let r=i.getSheet(e,!0),n=r.cssRules;for(let i in o[e])!1===t.Utils.findCssRule(n,i)&&r.insertRule(i+"{"+o[e][i].join("")+";}",n.length)}}else if("bg"!==e){let o=i.getSheet(e,r),s=o.cssRules;for(let i in n[e])!1===t.Utils.findCssRule(s,i)&&o.insertRule(i+"{"+n[e][i].join("")+";}",s.length)}return ThemifyConstructor.font_select.loadGoogleFonts(s.join("|")),n},e.on("builderiframeloaded",(()=>{e.w=o.innerWidth,e.h=o.innerHeight,d((()=>{e.animateCss()}),3e3),r.api=t,o._??=r._,o.wp=r.wp||{},o.Backbone??=r.Backbone,o.wp.Backbone??=r.wp.Backbone,o.wp.template??=r.wp.template,o.wp.shortcode??=r.wp.shortcode,o.wp.media??=r.wp.media,o.MediaElementPlayer??=r.MediaElementPlayer,jQuery.fn.mediaelementplayer??=r.jQuery(o.top.document).mediaelementplayer,o.wp.mediaelement||(o.wp.mediaelement=r.wp.mediaelement),o.tinyMCE||(o.tinyMCE=r.tinyMCE,o.tinymce=r.tinymce,o.tinyMCEPreInit=r.tinyMCEPreInit,o.switchEditors=r.switchEditors),o.wpApiSettings??=r.wpApiSettings,t.render(),n.tfOn("submit",(t=>{t.preventDefault()})).tfOn("click",(t=>{const e=t.target.closest("a");!e||"_blank"===e.target||"javascript:;"===e.href||"#"!==e.href&&e.href&&e.href.replace(new URL(e.href).hash,"")===o.top.location.href.replace(location.hash,"")||t.preventDefault()}))}),!0).on("tb_undo_add undo",(i=>{!t.isVisual||"string"==typeof i&&"move"!==i&&"delete"!==i&&"duplicate"!==i&&"paste"!==i&&"import"!==i&&"saveLightbox"!==i&&"inline"!==i||e.trigger("tb_toc")}));const E=function(){this.context=null,this.el=null,this.module_rules={},this.rulesCache={},this.currentStyleObj={}};E.prototype.init=function(e,o,r,n){if(t.isVisual||e){this.context=t.LightBox.el,this.model=r||t.activeModel,this.bp=n||t.activeBreakPoint,this.group=this.model.get("mod_name");let s,l=this.model.id;!0===o&&null!==t.GS.previousId?(l=t.GS.previousId,s=t.Registry.get(l).get("mod_name")):s=this.group,this.prefix=i.getBaseSelector(s,t.Builder.get().id,l),this.el=o?t.Builder.get().el.querySelector(this.prefix):this.model.el,this.currentStyleObj={},this.rulesCache[this.bp]??={},this.currentSheet=i.getSheet(this.bp,o),!0!==e&&("column"!==this.model.type&&"subrow"!==this.model.type&&this.bindAnimation(),this.bindTabsSwitch(),this.initModChange())}},E.prototype.setLiveStyle=function(o,r,n){n?"string"==typeof n&&(n=[n]):n=[""],n=i.getNestedSelector(n);let s="";const l=this.currentSheet.cssRules;for(let t=0,e=n.length;t<e;++t){let i="h"!==this.styleTabId||(n[t].endsWith(":after")||n[t].endsWith(":before"));!1!==i||n[t].includes(":hover")||(n[t]+=":hover"),s+=this.prefix+n[t],!1===i&&(s+=","+this.prefix+n[t].replace(":hover",".tb_visual_hover")),t!==e-1&&(s+=",")}if(!0===this.isChanged){let e;if("h"===this.styleTabId){const i=s.split(","),o=t.Builder.get().el;for(let t=i.length-1;t>-1;--t)if(!i[t].includes("tb_visual_hover")){e=o.querySelectorAll(i[t].split(":hover")[0]);for(let t=e.length-1;t>-1;--t)e[t].classList.add("tb_visual_hover")}}else{this.el.classList.remove("tb_visual_hover"),e=this.el.tfClass("tb_visual_hover");for(let t=e.length-1;t>-1;--t)e[t].classList.remove("tb_visual_hover")}}s=s.replace(/\s{2,}/g," ").replace(/\s*>\s*/g,">").replace(/\,\s/g,",");const a=e.hash(s),_=r;let d=this.rulesCache[this.bp][a]||t.Utils.findCssRule(l,s);if(!1===r&&(r=""),!1!==d&&l[d]){const t=""!==r&&r.includes("!important")?"important":"";""!==t&&(r=r.replace("!important","")),l[d].style.setProperty(o,r,t)}else{if(""===r)return;d=l.length,this.currentSheet.insertRule(s+"{"+o+":"+r+";}",d)}this.rulesCache[this.bp][a]=d,e.trigger("tb_"+this.model.type+"_styling",[this.group,o,r,_,this.el])},E.prototype.initModChange=function(i){if(!0===i)return e.off("themify_builder_change_mode",this.modChange),void(this.modChange=null);this.modChange||(this.modChange=(e,i)=>{this.setMode(i,null!==t.GS.activeGS)}),e.on("themify_builder_change_mode",this.modChange)},E.prototype.setMode=function(t,e){this.bp=t,this.rulesCache[t]??={},this.currentSheet=i.getSheet(t,e)},E.prototype.reset=function(){this.rulesCache={};const e=t.breakpointsReverse;for(let t=e.length-1;t>-1;--t){let o=i.getSheet(e[t]),r=o.cssRules;for(let t=r.length-1;t>-1;--t)o.deleteRule(t);o=i.getSheet(e[t],!0),r=o.cssRules;for(let t=r.length-1;t>-1;--t)o.deleteRule(t)}},E.prototype.clear=function(){const t=this.el;t.classList.remove("animated","hover-wow","tb_visual_hover"),this.module_rules={},this.styleTab=this.styleTabId=this.currentField=this.isChanged=null;const e=t.tfClass("tb_visual_hover");for(let t=e.length-1;t>-1;--t)e[t].classList.remove("tb_visual_hover");this.bindAnimation(!0),this.bindTabsSwitch(!0),this.initModChange(!0),this.el=this.currentStyleObj=this.currentSheet=this.bp=this.model=this.context=null},E.prototype.addOrRemoveFrame=function(e,o){if("module"===this.model.type)return;let r,l="subrow"===this.model.type?this.el.querySelector(":scope>.module_subrow"):this.el,a="string"==typeof e,_=a?e:e.closest(".tb_tab").id.split("_").pop(),d=l.querySelector(":scope>.tb_row_frame_wrap"),u="",h="";d||(d=f("span","tb_row_frame_wrap tf_overflow tf_abs"),l.prepend(d)),ThemifyBuilderModuleJs.addonLoad(l,"fr",!1);let g=d.tfClass("tb_row_frame_"+_)[0];if(s===o){o={},r=this.getValue(_+"-frame_type").selector;const e=["custom","location","width","height","width_unit","height_unit","repeat","type","layout","color","sh_x","sh_y","sh_b","sh_c","ani_dur","ani_rev"];for(let i=0;i<e.length;++i){let r,n=t.LightBox.el.querySelector("#"+_+"-frame_"+e[i]);if("type"===e[i])r=n.querySelector("input:checked").value;else if("ani_rev"===e[i])r=n.querySelector("input").value;else if("layout"===e[i])r=n.tfClass("selected")[0].id;else if("color"===e[i]||"sh_c"===e[i]){if(r=t.Helper.getColor(n),""===r)continue}else r=n.value;o[e[i]]=r}}const b=c(o.ani_dur)>0,p=o.type===_+"-custom";if(!(p||o.layout&&"none"!==o.layout)||p&&!o.custom)"desktop"===this.bp?a||this.setLiveStyle("background-image","",r):"none"===o.layout&&this.setLiveStyle("background-image","none",r);else if(g?(g.classList.remove("in_bellow","in_front"),o.location!==s&&g.classList.add(o.location)):(g=f("span","tf_abs tf_overflow tf_w tb_row_frame tb_row_frame_"+_+(o.location!==s?" "+o.location:"")),d.appendChild(g)),this.setLiveStyle("transform",p||"bottom"!==_&&"right"!==_?"":"rotate(180deg)",r),!a){if(p)this.setLiveStyle("background-image",'url("'+o.custom+'")',r);else{const t="left"===_||"right"===_?o.layout+"-l":o.layout;if(!i.fields.frameCache[t]){const e=n.tfId("tmpl-frame_"+t);null!==e&&(i.fields.frameCache[t]=e.textContent.trim())}if(i.fields.frameCache[t]){let e=i.fields.frameCache[t];o.color&&(e=e.replace(/\#D3D3D3/gi,o.color)),this.setLiveStyle("background-image",'url("data:image/svg+xml;utf8,'+encodeURIComponent(e)+'")',r)}o.layout.startsWith("corner")&&(u="150px",h="150px","bottom"===_?this.setLiveStyle("left","auto",r):"left"===_&&this.setLiveStyle("top","auto",r))}if(b&&("left"===_||"right"===_?(o.height=200,o.height_unit="%"):(o.width=200,o.width_unit="%"),o.repeat=""===o.repeat?2:2*~~o.repeat),this.setLiveStyle("width",o.width?o.width+o.width_unit:u,r),this.setLiveStyle("height",o.height?o.height+o.height_unit:h,r),o.repeat){let t=100/o.repeat;this.setLiveStyle("background-size","left"===_||"right"===_?"100% "+t+"%":t+"% 100%",r)}else this.setLiveStyle("background-size","",r);if(b?(this.setLiveStyle("animation-name","tb_frame_"+("left"===_||"right"===_?"vertical":"horizontal"),r),this.setLiveStyle("animation-iteration-count","infinite",r),this.setLiveStyle("animation-timing-function","linear",r),this.setLiveStyle("animation-duration",o.ani_dur+"s",r),this.setLiveStyle("animation-direction","1"===o.ani_rev?"reverse":"",r)):this.setLiveStyle("animation-name","",r),o.sh_b&&o.sh_c){this.setLiveStyle("filter","drop-shadow("+[o.sh_x?o.sh_x+"px":0,o.sh_y?o.sh_y+"px":0,o.sh_b+"px",o.sh_c].join(" ")+")",r)}else this.setLiveStyle("filter","",r)}},E.prototype.overlayType=function(i){if("module"===this.model.type)return;const o="color"===i||"hover_color"===i,r=o?"tfminicolors-input":"themify-gradient-type",n=this.styleTab.tfClass("tb_group_element_"+i)[0].tfClass(r)[0];if(o){let i=n.value;i&&(i=t.Helper.getColor(n)),e.triggerEvent(n,"themify_builder_color_picker_change",{val:i})}else e.triggerEvent(n,"change")},E.prototype.addOrRemoveComponentOverlay=function(t,e,i){if("module"===this.model.type)return;let o=this.getComponentBgOverlay(this.model.type);const r=this.getValue(e),n=r.selector;if(this.el.classList.toggle("tb_visual_hover","h"===this.styleTabId),""===i&&e)this.setLiveStyle("background-image","",n),this.setLiveStyle("background-color","",n);else{if(o||(o=f("span","builder_row_cover tf_abs"),("row"===this.model.type?this.el.querySelector(":scope > .row_inner"):this.el.tfClass("tb_"+this.model.type+"_action")[0]).before(o)),ThemifyBuilderModuleJs.addonLoad(o,"cover",!1),!r)return;"color"===t?this.setLiveStyle("background-image","none",n):this.setLiveStyle("background-color",!1,n),this.setLiveStyle(r.prop,i,n)}},E.prototype.outline=function(e){const i=this.getValue(e.id),o=e.closest(".tb_multi_fields"),r=t.Helper.getColor(o.tfClass("outline_color")[0]),n=c(o.tfClass("outline_width")[0].value),s=o.tfClass("outline_style")[0].value;"none"===s?this.setLiveStyle("outline","none",i):isNaN(n)||""===r||this.setLiveStyle("outline",n+"px "+s+" "+r,i)},E.prototype.bindMultiFields=function(i,o){if(o=this.getValue(i.id)){let r=i.closest(".tb_seperate_items"),n=o.prop.split("-"),l=n[3]!==s,a=!1===l&&"border"===n[0],_=r.hasAttribute("data-checked"),u=e=>{let i="";if(!0===a){const o=e.closest("li"),r=c(o.tfClass("border_width")[0].value.trim()),n=o.tfClass("border_style")[0].value,s=t.Helper.getColor(o.tfClass("tfminicolors-input")[0]);"none"===n?i=n:isNaN(r)||""===s||(i=r+"px "+n+" "+s)}else i=e.value.trim(),""!==i&&(i=c(i),isNaN(i)?i="":i+=e.closest(".tb_input").querySelector("#"+e.id+"_unit").value);return i},h=(t,i)=>{if(!1===a&&!1===l){if("row"===this.model.type&&m.fullwidth_support!==s&&(_&&("padding"===i||"margin"===i)||"padding-left"===i||"padding-right"===i||"margin-left"===i||"margin-right"===i)){const o=i.split("-"),r=this.bp+"-"+o[0];if(_)t=t+","+t;else{let e=this.el.dataset[r];e=e?e.split(","):[],"left"===o[1]?e[0]=t:e[1]=t,t=e.join(",")}this.el.setAttribute("data-"+r,t),e.reRun(this.el,!0)}(_&&"padding"===i||0===i.indexOf("padding"))&&d((()=>{e.trigger("tfsmartresize",{w:e.w,h:e.h})}),600)}},g=!0===_?u(i):null;n=n[0];for(let t=r.tfClass("tb_multi_field"),e=t.length-1;e>-1;--e)!1===_&&(g=u(t[e])),n=this.getValue(t[e].id).prop,this.setLiveStyle(n,g,o.selector),h(g,n)}},E.prototype.bindRowWidthHeight=function(t,i,o){o||(o=this.el);const r=o.classList;if("row_height"===t)r.toggle("fullheight","fullheight"===i);else if(r.remove("fullwidth","fullwidth_row_container"),"fullwidth"===i)r.add("fullwidth_row_container"),e.reRun(o,!0);else if("fullwidth-content"===i)r.add("fullwidth"),e.reRun(o,!0);else{const t=o.style;t.marginLeft=t.marginRight=t.paddingLeft=t.paddingRight=t.width=""}e.trigger("tfsmartresize",{w:e.w,h:e.h})},E.prototype.bindAnimation=function(t){if(!0!==t){if(!this.animateEvent){const t=this;this.animateEvent=e=>{const i=e.target.id;if("animation_effect"===i||"animation_effect_delay"===i||"animation_effect_repeat"===i||"hover_animation_effect"===i){const o="hover_animation_effect"===i,r=o?"hover_animation_effect":"animation_effect",n=o?e.target.value:t.context.querySelector("#animation_effect").value,s=t.currentStyleObj[r]??ThemifyConstructor.values[r],l=t.el,a=l.classList,_=l.style;if(s&&(a.remove(s,"wow"),_.setProperty("animation-name",""),_.setProperty("animation-delay",""),_.setProperty("animation-iteration-count","")),a.remove("animated","tb_hover_animate"),t.currentStyleObj[r]=n,n){const e=o?"":c(t.context.querySelector("#animation_effect_delay").value),i=o?"":~~t.context.querySelector("#animation_effect_repeat").value,r=m.is_animation;l.dataset.tfAnimation=n,_.setProperty("animation-delay",e>0&&!isNaN(e)?e+"s":""),_.setProperty("animation-iteration-count",i>0&&!isNaN(i)?i:""),a.add("wow"),m.is_animation=!0,ThemifyBuilderModuleJs.wow(l,!1),m.is_animation=r}}}}this.context.tfOn("change",this.animateEvent,{passive:!0})}else this.animateEvent&&(this.context.tfOff("change",this.animateEvent,{passive:!0}),this.animateEvent=null)},E.prototype.getStylingVal=function(t){return this.currentStyleObj[t]??""},E.prototype.setStylingVal=function(t,e){this.currentStyleObj[t]=e},E.prototype.bindBackgroundMode=function(o,r){const n={repeat:"repeat","repeat-x":"repeat-x","repeat-y":"repeat-y","repeat-none":"no-repeat","no-repeat":"no-repeat",fullcover:"cover","best-fit-image":"contain","builder-parallax-scrolling":"cover","builder-zoom-scrolling":"100%","builder-zooming":"100%"},l=this.el;if(n[o]!==s){const s={"background-repeat":"","background-size":"","background-position":"","background-attachment":""},a=this.model.get("mod_name"),_=(e,o)=>{let r;return t.activeModel?.id===this.model.id?(r=this.context.querySelector(o),r&&(r=r.value.trim())):r=i.getStyleVal(e,this.model.get("styling"),this.bp),r},d=i.getStyleOptions(a)[r],u=this.getValue(r),h=d?d.selector:u.selector,c=r.endsWith("_inner")?"_inner":"",g=_("background_type","#background_type input:checked"),f=""!==c||g&&"image"!==g||_("resp_no_bg","#resp_no_bg input:checked")?null:d?_(d.origId,"#"+d.origId):null;if(f&&""===f)o=null;else if(d){const e="background_position"+c,n=_(e,"#"+e),l={[d.origId]:!0};"desktop"===this.bp?(l[r]=o,l[e]=n):l["breakpoint_"+this.bp]={[r]:o,[e]:n};const u=i.fields[d.type].call(i,r,a,d,{[d.origId]:!0},this.id,l,this.bp);if(u){const t=u.split("#@#");for(let e=t.length-1;e>-1;--e)if(t[e]){let[i,o]=t[e].split(":");s[i]=o}}"desktop"!==t.activeBreakPoint&&(""===s["background-attachment"]&&(s["background-attachment"]=_("background_attachment"+c,"#background_attachment"+c)||""),""===s["background-position"]&&(s["background-position"]=_(e,"#"+e)||""))}else o.includes("repeat")?(s["background-repeat"]=n[o],s["background-size"]="auto"):(s["background-size"]=n[o],s["background-repeat"]="no-repeat");for(let t=["parallax","zooming","zoom"],e=t.length-1;e>-1;--e)l.getAttribute("data-"+t[e]+"-bg")===this.bp&&l.removeAttribute("data-"+t[e]+"-bg");if(l.classList.remove("builder-parallax-scrolling","builder-zooming","builder-zoom-scrolling","active-zooming"),l.style.backgroundSize=l.style.backgroundPosition="","module"===this.model.type&&("builder-parallax-scrolling"===o||"builder-zooming"===o||"builder-zoom-scrolling"===o||"best-fit-image"===o))return;for(let t in s)this.setLiveStyle(t,s[t],h);"builder-zoom-scrolling"!==o&&"builder-zooming"!==o&&"builder-parallax-scrolling"!==o||(l.setAttribute("data-"+o.split("-")[1]+"-bg",this.bp),e.reRun(l,!0))}},E.prototype.position=function(t,i){if(t&&t.length>0){const o=this.getValue(i);o&&u((()=>{const i=t.split(",");this.setLiveStyle(o.prop,i[0]+"% "+i[1]+"%",o.selector),this.el.classList.contains("builder-parallax-scrolling")&&(this.el.style.setProperty("background-position-y",""),e.reRun(this.el,!0))}))}},E.prototype.bindBackgroundSlider=async function(i){const o=this,r=o.model.type;if("module"!==r){const n=o.context,l=n.querySelector("#"+i.id).value.trim(),_="subrow"===r?o.el.tfClass("module_subrow")[0]:o.el;if(this.removeBgSlider(),l){o.cache===s&&(o.cache=new p);let i={shortcode:encodeURIComponent(l),mode:n.querySelector("#background_slider_mode").value,speed:n.querySelector("#background_slider_speed").value,size:n.querySelector("#background_slider_size").value},d=e.hash(a.values(i).join("")),u=o.cache.get(d);if(!u){i.type=r;const e={action:"tb_slider_live_styling",tb_background_slider_data:JSON.stringify(i)};if(u=await t.LocalFetch(e,"html"),u.length<10)return;o.cache.set(d,u)}const h=o.getComponentBgOverlay(r);h?h.after(u.cloneNode(!0)):_.prepend(u.cloneNode(!0)),t.is_builder_ready&&e.reRun(_,!0)}}},E.prototype.videoOptions=function(t,i){if("module"===this.model.type)return;const o="subrow"===this.model.type?this.el.tfClass("module_subrow")[0]:this.el,r=o.querySelector(":scope>.tb_fullwidth_video"),n=!0===t.checked;if(r)if("mute"===i?n?o.removeAttribute("data-mutevideo"):o.dataset.mutevideo="unmute":"unloop"===i&&(n?o.dataset.unloopvideo="unloop":o.removeAttribute("data-mutevideo")),r.classList.contains("tb_local_video")){const t=r.tfTag("video")[0];"mute"===i?t.muted=n:"unloop"===i&&(t.loop=n)}else e.reRun(o,!0)},E.prototype.bindBackgroundTypeRadio=function(t){let i="tb_uploader_input";"module"!==this.model.type&&("slider"!==t?"n"===this.styleTabId&&this.removeBgSlider():i="tb_shortcode_input","video"!==t&&"n"===this.styleTabId&&this.removeBgVideo()),"gradient"!==t?this.setLiveStyle("background-image","none"):i="themify-gradient-type";const o=this.styleTab.querySelector(".tb_group_element_"+t+":not(.background_color)");if(o&&(e.triggerEvent(o.tfClass(i)[0],"change"),"image"===t&&"module"===this.model.type)){const t=o.tfClass("tfminicolors-input")[0];t&&e.triggerEvent(t,"themify_builder_color_picker_change",{val:t.value})}},E.prototype.bindFontColorType=function(i,o,n){if("radio"===n){const o=i.includes("_solid"),n=!0===o?i.replace(/_solid$/gi,""):i.replace(/_gradient$/gi,"-gradient-type"),s=r.document.tfId(n);return void(!0===o?e.triggerEvent(s,"themify_builder_color_picker_change",{val:t.Helper.getColor(s)??""}):e.triggerEvent(s,"change"))}let l=n,a=this,_=a.getValue(o).selector;"color"===l?i===s||""===i?(i="",a.setLiveStyle("-webkit-background-clip","",_),a.setLiveStyle("background-clip","",_),a.setLiveStyle("background-image","",_)):(a.setLiveStyle("-webkit-background-clip","",_),a.setLiveStyle("background-clip","border-box",_),a.setLiveStyle("background-image","none",_)):""!==i&&(l="background-image",a.setLiveStyle("color","transparent",_),a.setLiveStyle("-webkit-background-clip","text",_),a.setLiveStyle("background-clip","text",_)),""===i&&"color"!==l||a.setLiveStyle(l,i,_)},E.prototype.shadow=function(e,i,o){const r=this.getValue(i);if(r){let i=e.closest(".tb_input"),o=i.tfClass("tb_shadow_field"),n="",s=!0,l="";for(let e=0,r=o.length;e<r;++e)if(o[e].classList.contains("tb_checkbox"))n=o[e].checked?"inset ":"";else{let r=o[e].value.trim();"color"===ThemifyConstructor.styles[o[e].id].type?r=t.Helper.getColor(o[e]):""===r?r=0:(s=!1,r+=i.querySelector("#"+o[e].id+"_unit").value),l+=r+" "}l=!0===s?"":n+l,this.setLiveStyle(r.prop,l,r.selector)}},E.prototype.filters=function(t,e){let i,o=t.closest(".tb_filters_fields").tfClass("tb_filters_field"),r="";for(let t=0,e=o.length;t<e;++t){let e=o[t].value.trim();""!==e&&(i=this.getValue(o[t].id),e+="hue-rotate"===i.prop?"deg":o[t].closest(".tb_seperate_items").querySelector("#"+o[t].id+"_unit").textContent,e=i.prop+"("+e+")",r+=e+" ")}i=this.getValue(e),this.setLiveStyle("filter",r,i.selector)},E.prototype.transform=function(t,e){let i="";const o=t.closest(".tb_transform_fields"),r=this.getValue(e),n=e.split("_")[0];for(let t=["scale","translate","rotate","skew"],e=0;e<t.length;++e){let r=t[e];switch(r){case"scale":case"translate":case"skew":let t,e=o.querySelector("#"+n+"_"+r+"_top").value.trim(),s=o.querySelector("#"+n+"_"+r+"_bottom").value.trim();t="translate"===r?{x:o.querySelector("#"+n+"_"+r+"_top_unit").value,y:o.querySelector("#"+n+"_"+r+"_bottom_unit").value}:"skew"===r?"deg":"",""===e&&""===s||(""!==e&&o.querySelector("#"+n+"_"+r+"_opp_bottom .style_apply_oppositive").checked?i+=r+"("+e+("translate"===r?t.x:t)+") ":i+=""!==e&&""!==s?r+"("+e+("translate"===r?t.x:t)+","+s+("translate"===r?t.y:t)+") ":""!==e?r+"X("+e+("translate"===r?t.x:t)+") ":r+"Y("+s+("translate"===r?t.y:t)+") ");break;case"rotate":for(let t=["z","y","x"],e=t.length-1;e>-1;--e){let s=o.querySelector("#"+n+"_"+r+"_"+t[e]).value.trim();""!==s&&(i+=r+t[e].toUpperCase()+"("+s+"deg) ")}break}}this.setLiveStyle("transform",i.trim(),r.selector)},E.prototype.setData=function(t,e,i){const o=this.getValue(t);o&&(""===e&&(e=o.prop),this.setLiveStyle(e,i,o.selector))},E.prototype.bindEvents=function(t,o){if(t.classList.contains("style_apply_all"))return;const r=this;let n,l=o.type,a=o.prop,_=o.id;n="color"===l?"themify_builder_color_picker_change":"gradient"===l?"themify_builder_gradient_change":"text"===l||"range"===l||"textarea"===l?"keyup":"change",t.tfOn(n,(function(t){let d,u=this,h=u.classList,c="SELECT"===u.tagName,f=!c&&"radio"===u.type;if((t=>{if(r.currentField!==t.id||""===r.currentField){r.currentField="radio"!==t.type&&t.id,r.isChanged=!0,r.styleTab=null,r.styleTabId="n";let e=t.closest(".tb_tab");null===e?(e=t.closest(".tb_expanded_opttions"),null===e&&(e=r.context.querySelector("#tb_options_styling"))):r.styleTabId=e.id.split("_").pop(),r.styleTab=e}else r.isChanged=!1})(u),d=t.detail?.val?t.detail.val:"frame"===l?u.id:u.value,d=d!==s&&"undefined"!==d?d.trim():"",h.contains("outline_color")||h.contains("outline_width")||h.contains("outline_style"))return r.outline(u,o),u;if(h.contains("tb_transform_field"))r.transform(u,_);else if("color"===l&&h.contains("border_color")||!0===c&&h.contains("border_style")||"keyup"===n&&(h.contains("border_width")||h.contains("tb_multi_field")))r.bindMultiFields(u);else if("frame-custom"===a||"frame"===l||h.contains("tb_frame")||h.contains("toggle_switch")&&u.closest(".tb_field.tb_frame"))"module"!==r.model.type&&r.addOrRemoveFrame(u);else if(h.contains("tb_shadow_field"))r.shadow(u,_);else if(h.contains("tb_filters_field"))r.filters(u,_);else if("keyup"!==n)if(!0!==o.isFontColor){if(!0===c)if("font-weight"===a){const t=u.getAttribute("data-selected"),e=r.styleTab.tfClass("tb_multi_fonts")[0];if(ThemifyConstructor.font_select.loadGoogleFonts(t+":"+d),e){let t;d.includes("italic")?(d=""+g(d.replace("italic","")),t=e.querySelector('[data-value="italic"]')):t=e.querySelector('[data-value="normal"]'),!1===t.checked&&t.parentNode.click()}}else if("font_select"===l){if(""!==d&&"default"!==d&&ThemifyConstructor.font_select.safe[d]===s){let t,e=u.closest(".tb_tab").tfClass("font-weight-select")[0];t=d,e!==s?t+=":"+e.value:r.setLiveStyle("font-weight","",o.selector),ThemifyConstructor.font_select.loadGoogleFonts(t)}else"default"===d&&(d="");""!==d&&(d=i.parseFontName(d))}else{if(h.contains("tb_unit"))return void e.triggerEvent(r.context.querySelector("#"+_.replace("_unit","")),"keyup");if("background-mode"===a)return void r.bindBackgroundMode(d,_);if("column-count"===a&&0==d)d="";else if(h.contains("tb_position_field")){const t=["top","right","bottom","left"],e=u.closest(".tb_input");for(let i=t.length-1;i>-1;--i){let n="";if("absolute"===d||"fixed"===d){let r="#"+o.id+"_"+t[i];n="auto",e.querySelector(r+"_auto input").checked||(n=e.querySelector(r).value.trim()+e.querySelector(r+"_unit").value.trim())}r.setLiveStyle(t[i],n,o.selector)}}else if("vertical-align"===a&&""!==d){let t;t="top"===d?"start":"middle"===d?"center":"end",r.setLiveStyle("align-self",t,o.selector)}}else{if("gallery"===l&&"module"!==r.model.type)return void r.bindBackgroundSlider(o);if(!0===f){if(_=u.closest(".tb_lb_option").id,!1===u.checked&&(d=""),"imageGradient"===l||!0===o.is_background)return void r.bindBackgroundTypeRadio(d);if(!0===o.is_overlay)return void("module"!==r.model.type&&r.overlayType(d))}else if("color"===l||"gradient"===l){if("gradient"===l&&(_=u.dataset.id),!0===o.is_overlay)return void("module"!==r.model.type&&r.addOrRemoveComponentOverlay(l,_,d));if("color"===l){let t=null;"module"===r.model.type&&o.colorId!==s&&o.origId!==s?(t=r.context.querySelector("#"+o.origId),null!==t&&"image"!==t.closest(".tb_input").querySelector("input:checked").value&&(t=null)):"module"!==r.model.type&&"h"===r.styleTabId&&(t=r.styleTab.tfClass("tb_uploader_input")[0]),t&&""===t.value.trim()&&r.setLiveStyle("background-image",""!==d?"none":"",o.selector)}}else if("image"===l||"video"===l){if("video"===l){if(d.length>0){if("module"!==r.model.type){const t="subrow"===r.model.type?r.el.tfClass("module_subrow")[0]:r.el;!t.dataset.mutevideo&&r.context.querySelector('#background_video_options [value="mute"]').checked?t.dataset.mutevideo="mute":t.removeAttribute("data-mutevideo"),t.dataset.tbfullwidthvideo=d,e.reRun(t,!0)}}else r.removeBgVideo();return!1}{if(d)d="url("+d+")";else if(d="",o.colorId!==s&&"h"===r.styleTabId){const t=r.context.querySelector("#"+o.colorId);null!==t&&""!==t.value.trim()&&(d="none")}const t=r.styleTab.tfClass("tb_image_options");for(let i=t.length-1;i>-1;--i){let o=t[i].tfClass("tb_lb_option");for(let t=o.length-1;t>-1;--t)e.triggerEvent(o[t],"change")}}}else{if("position_box"===l)return void r.position(d,_);if("checkbox"===l){if(null!==u.closest("#background_video_options"))return void r.videoOptions(u,d);if(("height"===a||"width"===a)&&_.includes("_auto_"+a)){const t=o.origId;if(u.checked)r.setData(t,a,"auto");else{const e=r.styleTab.querySelector("#"+t).value.trim();r.setData(t,a,""!==e?e+r.styleTab.querySelector("#"+t+"_unit").value:"")}return}if(!0===o.is_position){const t="#"+o.posId,e=u.closest(".tb_multi_fields");return u.checked?d="auto":(d=e.querySelector(t).value.trim(),d=""===d||isNaN(d)?"":d+e.querySelector(t+"_unit").value),void r.setLiveStyle(o.prop,d,o.selector)}if("background-image"===a)return u.checked||(d=!1),void r.setLiveStyle(o.prop,d,o.selector)}}}r.setData(_,"",d)}else r.bindFontColorType(d,_,l);else{if(""!==d&&"z-index"!==a)if("column-rule-width"===a){d+="px";const t=_.replace("_width","_style"),e=r.context.querySelector("#"+t);null!==e&&r.setData(t,"",e.value)}else{const t=r.context.querySelector("#"+_+"_unit");d+=null!==t&&t.value?t.value:"px"}r.setData(_,"",d)}}),{passive:!0})},E.prototype.getValue=function(t){return this.module_rules[t]??!1},E.prototype.bindTabsSwitch=function(t){!0!==t?(this.tabsHover||(this.tabsHover=(t,e)=>{if("styling"===ThemifyConstructor.clicked){let i;if("h"!==t.split("_").pop()){this.el.classList.remove("tb_visual_hover"),i=this.el.tfClass("tb_visual_hover");for(let t=i.length-1;t>-1;--t)i[t].classList.remove("tb_visual_hover")}else{if("module"!==this.model.type){let t=e.previousElementSibling.tfClass("background_type")[0];t&&(t=t.querySelector("input:checked").value,e.classList.toggle("tb_disable_hover","image"!==t&&"gradient"!==t))}d((()=>{i=e.tfClass("tb_lb_option");let t=[];for(let e=i.length-1;e>-1;--e){let o=i[e].id,r=i[e].classList.contains("themify-gradient");if(!0===r&&(o=i[e].dataset.id),this.module_rules[o]!==s&&(r||null!==i[e].offsetParent)){this.module_rules[o].is_overlay!==s&&this.el.classList.add("tb_visual_hover");let e=Array.isArray(this.module_rules[o].selector)?this.module_rules[o].selector:[this.module_rules[o].selector];for(let i=e.length-1;i>-1;--i){t[e[i].split(":hover")[0]]=1}}}if(t=a.keys(t),t.length>0)for(let e=t.length-1;e>-1;--e){i=n.querySelectorAll(this.prefix+t[e]);for(let t=i.length-1;t>-1;--t)i[t].classList.add("tb_visual_hover")}}),10)}}}),e.on("tb_builder_tabsactive",this.tabsHover)):this.tabsHover&&(e.off("tb_builder_tabsactive",this.tabsHover),this.tabsHover=null)},E.prototype.getComponentBgOverlay=function(t){t??=this.model.type;return("subrow"===t?this.el.querySelector(":scope>.module_subrow"):this.el).querySelector(":scope>.builder_row_cover")},E.prototype.getComponentBgSlider=function(){return("subrow"===this.model.type?this.el.tfClass("module_subrow")[0]:this.el).querySelector(":scope>.tb_slider")},E.prototype.removeBgSlider=function(){const t="subrow"===this.model.type?this.el.tfClass("module_subrow")[0]:this.el;this.getComponentBgSlider()?.remove(),t.querySelector(":scope>.tb_backstretch")?.remove(),t.style.position=t.style.background=t.style.zIndex=""},E.prototype.removeFrames=function(){const t="subrow"===this.model.type?this.el.tfClass("module_subrow")[0]:this.el;t.querySelector(":scope>.tb_row_frame_wrap")?.remove()},E.prototype.removeBgVideo=function(){const t="subrow"===this.model.type?this.el.tfClass("module_subrow")[0]:this.el;t.removeAttribute("data-tbfullwidthvideo"),t.querySelector(":scope>.tb_fullwidth_video")?.remove()},t.EdgeDrag={i:null,o:null,l:new WeakMap,p:new Set,k:null,init(){const e=t.Builder.get().el,i=t.ToolBar.el.tfClass("padding_dragging_mode")[0],o=n.body.classList;null===this.i&&(this.i=t=>{this.N(t)}),t.isVisual&&!localStorage.getItem("tb_disable_padding_dragging")?(e.tfOn("pointerdown",this.i,{passive:!0}),o.remove("tb_disable_padding_dragging"),i.checked=!0):(e.tfOff("pointerdown",this.i,{passive:!0}),o.add("tb_disable_padding_dragging"),i.checked=!1)},T(e){const i=e.closest(".tb_dragger");if(!i.tfClass("tb_dragger_lightbox")[0]){const e=i.classList.contains("tb_dragger_margin")?"margin":"padding",o=t.Registry.get(i.closest("[data-cid]").getAttribute("data-cid")),r=o.type,n="margin"===e&&("column"===r||"row"===r),l=["%","em","px"],a=n?["opposite"]:["all","opposite"],_=i.classList.contains("tb_dragger_top")||i.classList.contains("tb_dragger_bottom")?"s":"e",d="1"===this.C(n?"margin-top_opp_top":"checkbox_#id#_apply_all",o,e),u=i.dataset.u||"px",h=f("","tb_dragger_lightbox"),c=f("ul","tb_dragger_types"),g=f("ul","tb_dragger_units");for(let t=l.length-1;t>-1;--t)g.appendChild(f("li",l[t]===u?"current":s,l[t]));for(let t=a.length-1;t>-1;--t){let i=f("li","tb_apply tf_box tf_rel tf_block tb_apply_"+a[t]),r=!1;if(n||"opposite"!==a[t])r=d;else if(!d){let t="#id#_opp_";t+="s"===_?"top":"left",r="1"==this.C(t,o,e)}r&&(i.className+=" current"),i.appendChild(f("span")),c.appendChild(i)}h.append(g,c),i.tfClass("tb_dragger_options")[0].appendChild(h)}},openLightBox(i){if(i.hasAttribute("data-v")||""===i.getAttribute("data-v")){const o=i.closest("[data-cid]");if(o){t.Registry.get(o.dataset.cid).edit("styling").then((t=>{const o=i.classList.contains("tb_dragger_padding")?"p":"m",r=_.i18n.label[o],n=t.tfClass("tb_style_toggle");for(let t=n.length-1;t>-1;--t)if(n[t].textContent===r){n[t].classList.contains("tb_closed")&&e.triggerEvent(n[t],e.click),d((()=>{n[t].closest(".tf_scrollbar").scrollTop=n[t].offsetTop}),10);break}})).catch((t=>{}))}}},addEdges(e){const i=e.el,o=e.get("mod_name");!0===e.isEmpty||"divider"===o||"row"===o&&i.classList.contains("tb-page-break")||(h(this.k),this.k=u((()=>{const r=["padding","margin"],n=["right","bottom","left","top"],l=e.type,a=[];for(let _=r.length-1;_>-1;--_){let d,u,h,c=b(),g=r[_],p=i,m=!1;"padding"===g?"module"===l?p=i.tfClass("module")[0]:"subrow"===l&&(p=i.tfClass("module_subrow")[0]):(m="column"===l||"row"===l,!0===m&&"1"==this.C("margin-top_opp_top",e,g)&&(u=this.C("margin-top",e,g),h=this.C("margin-top_unit",e,g)||"px")),p&&(p=p.children,d=p.length-1),!1===m&&"1"==this.C("checkbox_#id#_apply_all",e,g)&&(u=this.C("#id#_top",e,g),h=this.C("#id#_top_unit",e,g)||"px");for(let t=3;t>-1;--t){if(!("margin"!==g||"column"!==l&&"row"!==l||"right"!==n[t]&&"left"!==n[t]))continue;let i,r,_=h,b=u;if(p)for(let e=d;e>-1;--e)if(p[e]?.classList.contains("tb_dragger_"+n[t])&&p[e].classList.contains("tb_dragger_"+g)){i=p[e];break}if(i)r=i.tfClass("tb_dragger_value")[0];else{i=f("subrow"===l?"span":"","tb_dragger tf_opacity tf_box tf_abs_t tf_h tb_dragger_"+n[t]+" tb_dragger_"+g),r=f("span","tb_dragger_value");let e=f("",{class:"tb_dragger_options tf_abs_c tf_flx",tabindex:-1});e.append(r,f("span","tb_dragger_arrow")),i.appendChild(e),c.appendChild(i)}if(!_){let i=m?"#id#-"+n[t]:"#id#_"+n[t];b=this.C(i,e,g),_=this.C(i+"_unit",e,g)||"px"}if(b!==s&&null!==b&&""!==b){(i.dataset.u||"px")===_&&i.dataset.v==b||(i.dataset.u=_,i.dataset.v=b,r.textContent=b+_,"padding"!==g&&("px"===_?this.S(i,o,b,_):a.push(i)))}}if("margin"===g||"module"!==l&&"subrow"!==l?i.appendChild(c):i.tfClass("subrow"===l?"module_subrow":"module")[0]?.appendChild(c),"padding"!==g)for(let t=a.length-1;t>-1;--t){let e=a[t];e?.isConnected&&this.S(e,o,e.dataset.v,e.dataset.u)}if("row"!==l){let e="module"===l||"subrow"===l?"column":i.classList.contains("sub_column")?"subrow":"row",o=i.closest(".module_"+e);"subrow"===e&&(o=o.parentNode),this.addEdges(t.Registry.get(o.dataset.cid))}}})))},setTimer(t){let e=t.classList;if(e.contains("tb_dragger")&&t.dataset.v&&!e.contains("tf_dragger_negative")){let i=this.l.get(t);i&&(clearTimeout(i),this.l.delete(t),i=null),i=d((()=>{!t.isConnected||t.style.willChange||n.body.classList.contains("tb_dragger_options_open")||!t.matches(":hover")||t.closest("[data-cid]").classList.contains("tb_dragger_input_mode")||(this.p.add(t),t.tfOff("pointerover",this.pointerover,{passive:!0,once:!0}).tfOn("pointerover",this.pointerover,{passive:!0,once:!0}),e.add("tf_dragger_negative")),this.l.delete(t),i=e=t=null}),1200),this.l.set(t,i)}},pointerover(e){const i=e.currentTarget;t.EdgeDrag.p.delete(i),i.classList.remove("tf_dragger_negative")},clearTimer(t,e){if(this.p.size>0)for(let i of this.p)if(i.isConnected&&i.classList.contains("tf_dragger_negative")){let o=i.getBoundingClientRect();(t<o.left||t>o.right||o.top>e||o.bottom<e)&&i.tfOff("pointerover",this.pointerover,{passive:!0,once:!0}).classList.remove("tf_dragger_negative")}else i.isConnected||this.l.delete(i),this.p.delete(i)},async I(e){e.stopPropagation();const i=null!==e.target.closest(".tb_dragger_value");i||this.T(e.target.closest(".tb_dragger_options"));const o="LI"===e.target.nodeName||i?e.target:e.target.parentNode;if("LI"===o.nodeName){const e=!o.classList.contains("current")&&o.parentNode.classList.contains("tb_dragger_units"),i=!e&&o.parentNode.classList.contains("tb_dragger_types"),r=t.ActionBar;r.disable=!0,(e||i)&&(t.undoManager.start("style"),e?await this.J(o):await this.L(o),t.undoManager.end("style"),r.disable=null)}else i&&!o.classList.contains("tb_disable_sorting")&&this.M(o)},M(e){e.classList.add("tb_disable_sorting");let i=e.closest(".tb_dragger"),o=i.classList.contains("tb_dragger_padding")?"padding":"margin",{u:r,v:l=0}=i.dataset,{min:a,max:_}=this.D(o,r),u=i.closest("[data-cid]"),h=f("span",s,r),g=f("input",{type:"number",min:a,max:_,step:"em"===r?.01:1,inputmode:"em"===r?"decimal":"numeric"}),b=t=>{t.stopPropagation();let e=g.value;if(""!==e){let t=e.replaceAll(",",".").replace(/[^\d.-]/g,"");a>=0&&(t=t.replaceAll("-","")),t="em"===r?c(t):~~t,isNaN(t)?t="":t<a?t=a:t>_&&(t=_),e!==""+t&&(g.value=t)}"Enter"===t.key&&p(t)},p=async s=>{s.stopPropagation();let f=g.value.replaceAll(",",".");if(f="em"===r?c(f):~~f,isNaN(f)||0===f?f="":f<a?f=a:f>_&&(f=_),g.tfOff("focusout",p,{passive:!0,once:!0}).tfOff("keyup",b,{passive:!0}).remove(),h.remove(),e.textContent=f+r,""+f!==l){t.ActionBar.disablePosition=!0,i.dataset.v=f,e.dataset.unit=r;const s=i.matches(":hover")||0!=getComputedStyle(i).opacity,l=t.Registry.get(u.dataset.cid),a=l&&t.activeModel?.id===l.id,_=()=>{s&&(u.tfOff("transitionend transitioncancel",_,{passive:!0,once:!0}).style.transition=""),d((()=>{i=r=h=b=p=u=g=null}),500),t.ActionBar.disablePosition=null};n.body.classList.add("tb_edge_drag_start"),i.tfClass("tb_dragger_lightbox")[0]?.remove(),this.T(i),!1===a&&t.undoManager.start("style"),s&&(u.tfOn("transitionend transitioncancel",_,{passive:!0,once:!0}).style.transition=o+" .1s ease"),this.J(e),!1===a&&t.undoManager.end("style"),e.removeAttribute("data-unit"),i.tfClass("tb_dragger_lightbox")[0]?.remove(),u.classList.remove("tb_dragger_input_mode"),n.body.classList.remove("tb_edge_drag_start"),s||_()}else u.classList.remove("tb_dragger_input_mode");e.classList.remove("tb_disable_sorting")};g.tfOn("focusout",p,{passive:!0,once:!0}).tfOn("keyup",b,{passive:!0}).value=l,i.tfClass("tb_dragger_lightbox")[0]?.remove(),e.innerHTML="",e.append(g,h),t.SmallPanel.hide(),u.classList.add("tb_dragger_input_mode"),g.focus()},J(e){return new l((o=>{const r=e.closest(".tb_dragger"),s=r.classList.contains("tb_dragger_padding")?"padding":"margin",l=r.classList.contains("tb_dragger_top")||r.classList.contains("tb_dragger_bottom")?"s":"e",a=e.dataset.unit||e.textContent||"px",_=r.dataset.v,u=r.dataset.u||"px",h=r.parentNode,c=i.getSheet(t.activeBreakPoint),g=c.cssRules;let f,b=r.tfClass("tb_dragger_types")[0],p=h.children,m=h.closest("[data-cid]"),v=""!==_?this.O(r,u,a,_):"",w=t.Registry.get(m.dataset.cid),y=w.get("mod_name"),k=i.getBaseSelector(y,t.Builder.get().id,w.get("element_id"));b&&(b=b.tfClass("current")[0],b&&(b=b.classList.contains("tb_apply_all")?"all":"opposite")),f=t.Utils.findCssRule(g,k),n.body.classList.add("tb_edge_drag_start");for(let t=p.length-1;t>-1;--t){let e=p[t],i=e.classList;if(i.contains("tb_dragger_"+s)){let t="left";if(i.contains("tb_dragger_bottom")?t="bottom":i.contains("tb_dragger_right")?t="right":i.contains("tb_dragger_top")&&(t="top"),e!==r&&(!b||"opposite"===b&&("s"===l&&("left"===t||"right"===t)||"e"===l&&("top"===t||"bottom"===t))))continue;let o=e.tfClass("tb_dragger_units")[0]?.children,n=s+"-"+t,_=""===v?"":v+a,d="margin"!==s||"column"!==y&&"row"!==y?"#id#_"+t:"#id#-"+t;if(!1!==f&&g[f]?g[f].style.setProperty(n,_):""!==_&&(f=g.length,c.insertRule(k+"{"+n+":"+_+";}",f)),o)for(let t=o.length-1;t>-1;--t)o[t].classList.toggle("current",o[t].textContent===a);"em"!==a&&""!==v&&(v=~~v),"padding"!==s&&this.S(e,y,v,a),e.tfClass("tb_dragger_value")[0].textContent=""===v?"":_,e.dataset.v=v,e.dataset.u=a,i.add("tb_dragger_dragged"),this.setData(w,this.A(d,w,s),v,a)}}d((()=>{for(let t=p.length-1;t>-1;--t)p[t].classList.remove("tb_dragger_dragged");n.body.classList.remove("tb_edge_drag_start"),p=null,o()}),500)}))},L(e){return new l((i=>{const o=e.closest(".tb_dragger"),r=o.parentNode,n=o.classList.contains("tb_dragger_padding")?"padding":"margin",s=o.classList.contains("tb_dragger_top")||o.classList.contains("tb_dragger_bottom")?"s":"e",l=r.closest("[data-cid]"),a=t.Registry.get(l.dataset.cid),_=e.classList.contains("current")?"":"1",d=e.nextElementSibling||e.previousElementSibling;let u,h="margin-top_opp_top";if(("margin"!==n||"column"!==a.type&&"row"!==a.type)&&(u="checkbox_#id#_apply_all",h="#id#_opp_",h+="s"===s?"top":"left",e.classList.contains("tb_apply_all"))){const t=h;h=u,u=t}d?.classList.remove("current"),e.classList.toggle("current",_),this.setData(a,this.A(h,a,n),_),u&&this.setData(a,this.A(u,a,n),""),this.J(o.tfClass("tb_dragger_units")[0].tfClass("current")[0]).then((()=>{this.j(),i()}))}))},O(t,e,i,o){if(!o)return 0;if(e||(e="px"),i||(i="px"),e===i)return o;let r,n=t.parentNode;if(n.classList.contains("active_module")){const t=n.classList.contains("active_subrow")?"module_subrow":"module";n=n.tfClass(t)[0]}const s="em"===i||"em"===e?c(getComputedStyle(n).fontSize):null,l="%"===i||"%"===e?n.parentNode.offsetWidth:null,{min:a,max:_}=this.D(t.classList.contains("tb_dragger_padding")?"padding":"margin",i);return"px"===e?"em"===i?r=+c(o/s).toFixed(2):"%"===i&&(r=c(100*o/l)):"%"===e?(r=c(o*l/100),r="em"===i?+c(r/s).toFixed(2):c(r)):(r=c(o*s),"%"===i&&(r=c(100*r/l)),r=c(r)),r=+r.toFixed(2),r<a?r=a:r>_&&(r=_),r},D(t,e){const{min:i=0,max:o=100}=ThemifyConstructor.getMarginPaddingUnits(t,e);return{min:i,max:o}},S(t,e,i,o="px"){let r="margin";const n=t.classList;for(let t=n.length-1;t>-1;--t)if("tb_dragger_top"===n[t]||"tb_dragger_bottom"===n[t]||"tb_dragger_left"===n[t]||"tb_dragger_right"===n[t]){r+="-"+n[t].replace("tb_dragger_","");break}"px"!==o&&""!==i&&(i=this.O(t,o,"px",i),o="px"),i??="";t.style["margin-top"===r||"margin-bottom"===r?"height":"width"]=""===i?"":(i>0?i:-i)+o,"row"!==e&&"column"!==e||(t.style[r]=""===i?"":-i+o)},A(t,e,o){const r=e.type,n=i.getStyleOptions(e.get("mod_name"));return"margin"===o&&("row"===r||"column"===r)||n[o+"_top"]!==s&&n[o+"_top"].type===o||(o=o[0]),t.replace("#id#",o)},C(e,o,r){const n=o.get("styling");if(e=this.A(e,o,r),t.activeModel?.id===o.id){let i=t.LightBox.el.querySelector("#"+e);if(null!==i){if(!i.classList.contains("tb_checkbox_wrap"))return i.value;if(i=i.tfClass("tb_checkbox")[0],i)return!!i.checked&&i.value}}let l=i.getStyleVal(e,n,t.activeBreakPoint);return l!==s&&""!==l&&"column"===o.type&&(""+l).includes(",")&&(0===e.indexOf("padding")||e.includes("margin"))&&(l=l.trim().split(","),l=l[1]!==s&&""!==l[1]?l[1].trim():l[0].trim()),l},setData(i,o,r,n){r&&n&&"em"!==n&&(r=+r);const s="breakpoint_"+t.activeBreakPoint,l=ThemifyConstructor;if(i.id===t.activeModel?.id){let t=l.getEl(o);if(null!==t)return t.classList.contains("tb_checkbox_wrap")?(t=t.tfClass("tb_checkbox")[0],t&&(t.checked=!!r)):(t.value=r,t=l.getEl(o+"_unit"),t&&(t.value=n)),void(t&&e.triggerEvent(t,"change"));{const t=l.values;"breakpoint_desktop"===s?(t[o]=r,n&&(t[o+"_unit"]=n)):(t[s]||(t[s]={}),t[s][o]=r,n&&(t[s][o+"_unit"]=n))}}const a=t.Helper.cloneObject(i.get("mod_settings"));"breakpoint_desktop"!==s?(a[s]||(a[s]={}),a[s][o]=r,n&&(a[s][o+"_unit"]=n)):(r?a[o]=r:delete a[o],n&&("px"===n?delete a[o+"_unit"]:a[o+"_unit"]=n)),i.set("mod_settings",a)},j(){d((()=>{t.Utils.onResize(!0)}),1500)},N(o){if(0===o.button){const s=o.target,l=this;if(s.closest(".tb_dragger_options"))return void n.tfOn("pointerup",(function(t){if(s===t.target){if(t.target.classList.contains("tb_dragger_arrow")){this.body.classList.add("tb_dragger_options_open");let t=s.closest(".tb_dragger");const i=o=>{"pointerleave"!==o.type&&o.target.closest(".tb_dragger_options")||(this.tfOff(e.click,i,{passive:!0}),r.document.tfOff(e.click,i,{passive:!0}),t.tfOff("pointerleave",i,{once:!0,passive:!0}),this.body.classList.remove("tb_dragger_options_open"),t.tfClass("tb_dragger_lightbox")[0]?.remove(),t=null)};d((()=>{t.tfOn("pointerleave",i,{once:!0,passive:!0}),this.tfOn(e.click,i,{passive:!0}),r.document.tfOn(e.click,i,{passive:!0})}),10)}l.I(t)}}),{once:!0,passive:!0});if(!s.classList.contains("tb_dragger"))return;o.stopImmediatePropagation();const a=s.closest("[data-cid]"),_=t.Registry.get(a.dataset.cid);if(_){let d,g,f,b,p=[],{clientX:m,clientY:v}=o,w=m,y=v,k=_.type,x=!1,z="module"===k?a.tfClass("module")[0]:"subrow"===k?a.tfClass("module_subrow")[0]:a,N=s.classList.contains("tb_dragger_padding")?"padding":"margin",T=s.classList.contains("tb_dragger_top")||s.classList.contains("tb_dragger_bottom")?"s":"e",C="s"===T?s.classList.contains("tb_dragger_top")?"top":"bottom":s.classList.contains("tb_dragger_left")?"left":"right",S=s.dataset.u||"px",{min:E,max:I}=l.D(N,S),J=(t,e,i)=>{let o="%"===S?1:~~Math.abs("left"===i||"right"===i?t-w:e-y);return o<=0?o="px"===S||"%"===S?1:.1:"em"===S&&(o/=10),w=t,y=e,o},L=e=>{e.stopImmediatePropagation(),x=!0,n.body.classList.add("tb_start_animate","tb_edge_drag_start"),r.document.body.classList.add("tb_start_animate","tb_edge_drag_start"),t.SmallPanel.hide(),t.ActionBar.clear(),t.ActionBar.disable=!0,s.tfClass("tb_dragger_lightbox")[0]?.remove(),b=t.activeModel?.id===_.id,!1===b&&t.undoManager.start("style"),l.T(s),g=c(s.dataset.v)||0,g="em"!==S?~~g:+g.toFixed(2),f=s.tfClass("tb_dragger_types")[0],f&&(f=f.tfClass("current")[0],f&&(f=f.classList.contains("tb_apply_all")?"all":"opposite"));const i=s.parentNode.children;for(let t=i.length-1;t>-1;--t){let e=i[t].classList;if(e.contains("tb_dragger_"+N)){let o="left";if(e.contains("tb_dragger_bottom")?o="bottom":e.contains("tb_dragger_right")?o="right":e.contains("tb_dragger_top")&&(o="top"),C!==o&&(!f||"opposite"===f&&("s"===T&&("left"===o||"right"===o)||"e"===T&&("top"===o||"bottom"===o))))continue;i[t].classList.add("tb_dragger_dragged"),p.push({el:i[t],prop:N+"-"+o,text:i[t].tfClass("tb_dragger_value")[0]})}}a.classList.add("tb_current_module")},M=t=>{t.stopImmediatePropagation(),h(d),d=u((()=>{const e=t.clientX,i=t.clientY,o=J(e,i,C);"e"===T?e!==m&&(e>m?"left"===C?g+=o:g-=o:"left"===C?g-=o:g+=o):i!==v&&(i>v?g+=o:g-=o),m=e,v=i,g<0&&"padding"===N?g=0:g%1!=0&&(g=c(g.toFixed(1))),g>I?g=I:g<E&&(g=E);const r=g+S;for(let t=p.length-1;t>-1;--t){let e=p[t].prop,i=p[t].el,o=p[t].text;if(z.style[e]=r,"margin"===N){let t=i.classList.contains("tb_dragger_top")||i.classList.contains("tb_dragger_bottom")?"height":"width",o=g,n=S;"px"!==n&&(o=l.O(i,n,"px",o),n="px"),"row"!==k&&"column"!==k||(i.style[e]=""===r?"":-o+n),i.style[t]=(g<0?-o:o)+n}o.textContent=0===g?"":r}}))},D=function(o){h(d),this.style.willChange=z.style.willChange="",this.tfOff("pointermove",L,{passive:!0,once:!0}).tfOff("pointermove",M,{passive:!0}).tfOff("lostpointercapture pointerup",D,{once:!0,passive:!0}),e.trigger("tbDisableInline"),x&&(o.stopImmediatePropagation(),n.body.classList.remove("tb_start_animate","tb_edge_drag_start"),r.document.body.classList.remove("tb_start_animate","tb_edge_drag_start"),e.trigger("tbresizeImageEditor"),u((()=>{a.classList.remove("tb_current_module");const e=i.getBaseSelector(_.get("mod_name"),t.Builder.get().id,_.get("element_id")),o=i.getSheet(t.activeBreakPoint),r=o.cssRules,n=t.Utils.findCssRule(r,e);for(let t=p.length-1;t>-1;--t){let i=p[t].el,s=p[t].prop,a=z.style[s],d=s.replace(N+"-",""),u="margin"!==N||"column"!==k&&"row"!==k?"#id#_"+d:"#id#-"+d;0===g&&"margin"===N&&(i.style.setProperty(s,""),i.style.width=i.style.height=""),i.tfClass("tb_dragger_lightbox")[0]?.remove(),!1!==n&&r[n]?r[n].style.setProperty(s,a):o.insertRule(e+"{"+s+":"+a+";}",r.length),z.style[s]="",i.dataset.v=g,i.dataset.u=S,i.classList.remove("tb_dragger_dragged"),l.setData(_,l.A(u,_,N),g,S)}l.j(),t.Utils.runJs(a,null,!0),!1===b&&t.undoManager.end("style"),t.ActionBar.disable=f=z=d=b=p=g=v=m=E=I=x=null}))),u((()=>{l.addEdges(_),l.setTimer(this)}))};z.style.willChange=N,s.style.willChange="margin"===N?"top"===C||"bottom"===C?"height":"width":N,s.tfOn("lostpointercapture pointerup",D,{once:!0,passive:!0}).tfOn("pointermove",L,{passive:!0,once:!0}).tfOn("pointermove",M,{passive:!0}).setPointerCapture(o.pointerId)}}}},t.createStyleInstance=()=>new E})(tb_app,Themify,ThemifyStyles,window,window.top,document,void 0,Promise,Object,themifyBuilder,setTimeout,requestAnimationFrame,cancelAnimationFrame,parseFloat,parseInt,tb_createElement,tb_createDocumentFragment,Map,tbLocalScript);
[0] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function