")).attr("src",a),c.attr("type",l),f.append(c)),void 0!==n&&""!=n&&((h=e("")).attr("src",n),h.attr("type",d),f.append(h)),!FLBuilderLayout._isMobile()||FLBuilderLayout._isMobile()&&"yes"==s?void 0!==t?FLBuilderLayout._initYoutubeBgVideo.apply(this):void 0!==o?FLBuilderLayout._initVimeoBgVideo.apply(this):i.append(f):(f.attr("src",""),i.append(f)),i.data("loaded",!0))},_initYoutubeBgVideo:function(){var i,a,t=e(this),o=t.data("video-id"),l=t.find(".fl-bg-video-player"),n=t.data("enable-audio"),d=t.find(".fl-bg-video-audio"),r=void 0!==t.data("start")?t.data("start"):0,u=(r=void 0!==t.data("t")&&0===r?t.data("t"):r,void 0!==t.data("end")?t.data("end"):0),s=void 0!==t.data("loop")?t.data("loop"):1,f=0;o&&(fallback=t.data("fallback")||!1,fallback&&(t.find("iframe").remove(),fallbackTag=e("
"),fallbackTag.addClass("fl-bg-video-fallback"),fallbackTag.css("background-image","url("+t.data("fallback")+")"),fallbackTag.css("background-size","cover"),fallbackTag.css("transition","background-image 1s"),t.append(fallbackTag),a=!0),FLBuilderLayout._onYoutubeApiReady((function(c){setTimeout((function(){i=new c.Player(l[0],{videoId:o,events:{onReady:function(e){"no"===n||FLBuilderLayout._isMobile()?e.target.mute():"yes"===n&&e.target.isMuted&&e.target.unMute(),t.data("YTPlayer",i),FLBuilderLayout._resizeYoutubeBgVideo.apply(t),e.target.playVideo(),d.length>0&&!FLBuilderLayout._isMobile()&&d.on("click",{button:d,player:i},FLBuilderLayout._toggleBgVideoAudio)},onStateChange:function(t){1===t.data&&a&&e(".fl-bg-video-fallback").css("background-image","url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"),f<4&&f++,f>1&&(-1===t.data||2===t.data)&&"yes"===n&&(i.mute(),i.playVideo(),d.show()),t.data===c.PlayerState.ENDED&&1===s&&(r>0?i.seekTo(r):i.playVideo())},onError:function(e){FLBuilderLayout._onErrorYoutubeVimeo(t)}},playerVars:{playsinline:FLBuilderLayout._isMobile()?1:0,controls:0,showinfo:0,rel:0,start:r,end:u}})}),1)})))},_onErrorYoutubeVimeo:function(i){if(fallback=i.data("fallback")||!1,!fallback)return!1;i.find("iframe").remove(),fallbackTag=e(""),fallbackTag.addClass("fl-bg-video-fallback"),fallbackTag.css("background-image","url("+i.data("fallback")+")"),i.append(fallbackTag)},_onYoutubeApiReady:function(e){window.YT&&YT.loaded?e(YT):setTimeout((function(){FLBuilderLayout._onYoutubeApiReady(e)}),350)},_initVimeoBgVideo:function(){var i,a=e(this),t=a.data("video-id"),o=a.find(".fl-bg-video-player"),l=a.data("enable-audio"),n=a.find(".fl-bg-video-audio"),d=(a.outerWidth(),navigator.userAgent);"undefined"!=typeof Vimeo&&t&&(i=new Vimeo.Player(o[0],{id:t,loop:!0,title:!1,portrait:!1,background:!0,autopause:!1,muted:!0}),a.data("VMPlayer",i),"no"===l?i.setVolume(0):"yes"===l&&(d.indexOf("Safari")>-1||d.indexOf("Chrome")>-1||d.indexOf("Firefox")>-1?(i.setVolume(0),n.show()):i.setVolume(1)),i.play().catch((function(e){FLBuilderLayout._onErrorYoutubeVimeo(a)})),n.length>0&&n.on("click",{button:n,player:i},FLBuilderLayout._toggleBgVideoAudio))},_toggleBgVideoAudio:function(e){var i=e.data.player,a=e.data.button.find(".fl-audio-control");a.hasClass("fa-volume-off")?(a.removeClass("fa-volume-off").addClass("fa-volume-up"),e.data.button.find(".fa-times").hide(),"function"==typeof i.unMute?i.unMute():i.setVolume(1)):(a.removeClass("fa-volume-up").addClass("fa-volume-off"),e.data.button.find(".fa-times").show(),"function"==typeof i.unMute?i.mute():i.setVolume(0))},_videoBgSourceError:function(i){var a=e(i.target),t=a.closest(".fl-bg-video"),o=t.find("video"),l=t.data("fallback"),n="";a.remove(),o.find("source").length||""!==l&&((n=e("")).addClass("fl-bg-video-fallback"),n.css("background-image","url("+l+")"),t.append(n),o.remove())},_resizeBgVideos:function(){e(".fl-bg-video").each((function(){FLBuilderLayout._resizeBgVideo.apply(this),e(this).parent().find("img").length>0&&e(this).parent().imagesLoaded(e.proxy(FLBuilderLayout._resizeBgVideo,this))}))},_resizeBgVideo:function(){if(0!==e(this).find("video").length||0!==e(this).find("iframe").length){var i=e(this),a=i.outerHeight(),t=i.outerWidth(),o=i.find("video"),l=i.data("height"),n=i.data("width"),d=t,r=Math.round(l*t/n),u=0,s=0,f=i.find("iframe"),c=e(this).closest(".fl-row-bg-video").hasClass("fl-row-full-height"),h={top:"50%",left:"50%",transform:"translate(-50%,-50%)"};if(o.length){if(""===l||void 0===l||""===n||void 0===n)return o.css({left:"0px",top:"0px",width:d+"px"}),void o.on("loadedmetadata",FLBuilderLayout._resizeOnLoadedMeta);c||(rd,u=r?a:t*d,s=r?a/d:t;l&&e(l).width(u).height(s)},_initModuleAnimations:function(){void 0!==jQuery.fn.waypoint&&e(".fl-animation").each((function(){var i=e(this),a=i.offset().top,t=e(window).height(),o=e("body").height(),l="80%";void 0!==typeof FLBuilderLayoutConfig.waypoint.offset&&(l=FLBuilderLayoutConfig.waypoint.offset+"%"),o-a<.2*t&&(l="100%"),i.waypoint({offset:l,handler:FLBuilderLayout._doModuleAnimation})}))},_doModuleAnimation:function(){var i=void 0===this.element?e(this):e(this.element),a=parseFloat(i.data("animation-delay")),t=parseFloat(i.data("animation-duration"));isNaN(t)||i.css("animation-duration",t+"s"),!isNaN(a)&&a>0?setTimeout((function(){i.addClass("fl-animated")}),1e3*a):setTimeout((function(){i.addClass("fl-animated")}),1)},_initHash:function(){var i=window.location.hash.replace("#","").split("/").shift(),a=null,t=null,o=null,l=null;if(""!==i)try{(a=e("#"+i)).length>0&&(a.hasClass("fl-accordion-item")&&setTimeout((function(){a.find(".fl-accordion-button").trigger("click")}),100),a.hasClass("fl-tabs-panel")&&setTimeout((function(){t=a.closest(".fl-tabs"),o=a.find(".fl-tabs-panel-label"),l=o.data("index"),t.find(".fl-tabs-labels .fl-tabs-label[data-index="+l+"]")[0].click(),FLBuilderLayout._scrollToElement(a)}),100))}catch(e){}},_initAnchorLinks:function(){e("a").each(FLBuilderLayout._initAnchorLink)},_initAnchorLink:function(){var i=e(this),a=i.attr("href"),t=window.location,o=null,l=null,n=!1;if(void 0!==a&&a.indexOf("#")>-1&&i.closest("svg").length<1&&t.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&t.hostname==this.hostname)try{if(!(o=a.split("#").pop()))return;(l=e("#"+o)).length>0&&(n=l.hasClass("fl-row")||l.hasClass("fl-col")||l.hasClass("fl-module"),l.hasClass("fl-no-scroll")||!i.hasClass("fl-scroll-link")&&!n||e(i).on("click",FLBuilderLayout._scrollToElementOnLinkClick),l.hasClass("fl-accordion-item")&&e(i).on("click",FLBuilderLayout._scrollToAccordionOnLinkClick),l.hasClass("fl-tabs-panel")&&e(i).on("click",FLBuilderLayout._scrollToTabOnLinkClick))}catch(e){}},_scrollToElementOnLinkClick:function(i,a){var t=e("#"+e(this).attr("href").split("#").pop());FLBuilderLayout._scrollToElement(t,a),i.preventDefault()},_scrollToElement:function(i,a){var t=FLBuilderLayoutConfig.anchorLinkAnimations,o=0,l=e(window),n=e(document);i.length>0&&(o="fixed"===i.css("position")||"fixed"===i.parent().css("position")?i.position().top:i.offset().top>n.height()-l.height()?n.height()-l.height():i.offset().top-t.offset,e("html, body").animate({scrollTop:o},t.duration,t.easing,(function(){void 0!==a&&a(),null!=i.attr("id")&&(history.pushState?history.pushState(null,null,"#"+i.attr("id")):window.location.hash=i.attr("id"))})))},_scrollToAccordionOnLinkClick:function(i){var a=e("#"+e(this).attr("href").split("#").pop());a.length>0&&FLBuilderLayout._scrollToElementOnLinkClick.call(this,i,(function(){a&&(a.find(".fl-accordion-button").trigger("click"),a=!1)}))},_scrollToTabOnLinkClick:function(i){var a=e("#"+e(this).attr("href").split("#").pop()),t=null,o=null,l=null;a.length>0&&(t=a.closest(".fl-tabs"),l=a.find(".fl-tabs-panel-label"),tabIndex=l.data("index"),o=t.find(".fl-tabs-labels .fl-tabs-label[data-index="+tabIndex+"]"),l.is(":visible")?FLBuilderLayout._scrollToElementOnLinkClick.call(this,i,(function(){a&&l.trigger(e.Event("click",{which:1}))})):(o[0].click(),FLBuilderLayout._scrollToElement(a)),i.preventDefault())},_initForms:function(){FLBuilderLayout._hasPlaceholderSupport||e(".fl-form-field input").each(FLBuilderLayout._initFormFieldPlaceholderFallback),e(".fl-form-field input").on("focus",FLBuilderLayout._clearFormFieldError)},_hasPlaceholderSupport:function(){return"undefined"!=document.createElement("input").placeholder},_initFormFieldPlaceholderFallback:function(){var i=e(this),a=i.val(),t=i.attr("placeholder");"undefined"!=t&&""===a&&(i.val(t),i.on("focus",FLBuilderLayout._hideFormFieldPlaceholderFallback),i.on("blur",FLBuilderLayout._showFormFieldPlaceholderFallback))},_hideFormFieldPlaceholderFallback:function(){var i=e(this);i.val()==i.attr("placeholder")&&i.val("")},_showFormFieldPlaceholderFallback:function(){var i=e(this),a=i.val(),t=i.attr("placeholder");""===a&&i.val(t)},_clearFormFieldError:function(){var i=e(this);i.removeClass("fl-form-error"),i.siblings(".fl-form-error-message").hide()},_initRowShapeLayerHeight:function(){FLBuilderLayout._adjustRowShapeLayerHeight(),e(window).on("resize",FLBuilderLayout._adjustRowShapeLayerHeight)},_initNestedColsWidth:function(){var i=e(".fl-col-has-cols");i.length<=0||e(i).each((function(i,a){e(a).width()<=0&&e(a).css("width",FLBuilderLayoutConfig.emptyColWidth)}))},_adjustRowShapeLayerHeight:function(){var i=e(".fl-builder-shape-layer");e(i).each((function(i){var a=e(this),t=e(a).find("svg"),o=t.height();a.is(".fl-builder-shape-circle, .fl-builder-shape-dot-cluster, .fl-builder-shape-topography, .fl-builder-shape-rect")||e(t).css("height",Math.ceil(o))}))},_string_to_slug:function(e){return e=e.replace(/^\s+|\s+$/g,""),void 0===window._fl_string_to_slug_regex?regex=new RegExp("[^a-zA-Z0-9'\":() !.,-_|]","g"):regex=new RegExp("[^"+window._fl_string_to_slug_regex+"'\":() !.,-_|\\p{Letter}]","ug"),e.replace(regex,"").replace(/\s+/g," ")},_reorderMenu:function(){e("#wp-admin-bar-fl-builder-frontend-edit-link-default li").length>1&&e("#wp-admin-bar-fl-builder-frontend-duplicate-link").appendTo("#wp-admin-bar-fl-builder-frontend-edit-link-default").css("padding-top","5px").css("border-top","2px solid #1D2125").css("margin-top","5px")}},e((function(){FLBuilderLayout.init()})))}(jQuery);