File: /home/dfwparty/dfwchat.net/wp-content/themes/buddyboss-theme/assets/js/main.min.js
/*!
* BuddyBoss Theme JavaScript Library
* @package BuddyBoss Theme
*/
!function(f){"use strict";function e(e){var t,i,n=window.location.search.substring(1).split("&");for(i=0;i<n.length;i++)if((t=n[i].split("="))[0]===e)return void 0===t[1]||decodeURIComponent(t[1])}function i(){f(".buddypress.widget .gamipress-buddypress-user-details-listing:not(.is_loaded)").each(function(){""!==f(this).text().trim()&&(f(this).parent().append('<span class="showGamipressData" data-balloon-pos="right" data-balloon="'+bs_data.gamipress_badge_label+'"></span>'),f(this).find("img").length?f(this).parent().find(".showGamipressData").append('<img src="'+f(this).find("img").attr("src")+'"/>'):f(this).parent().find(".showGamipressData").append('<i class="bb-icon-l bb-icon-award"></i>'),f(this).parent().find(".gamipress-buddypress-user-details-listing").wrap('<div class="GamiPress-data-popup"></div>'),f(this).parent().find(".gamipress-buddypress-user-details-listing").append('<i class="bb-icon-l bb-icon-times hideGamipressData"></i>')),f(this).addClass("is_loaded")})}var t;window.BuddyBossTheme={init:function(){this.add_Class(),this.header_search(),this.Menu(),this.inputStyles(),this.sidePanel(),this.headerAside(),this.bbMasonry(),this.stickySidebars(),this.bbFitVideo(),this.LoadMorePosts(),this.jsSocial(),this.beforeLogIn(),this.bbRelatedSlider(),this.BuddyPanel_Dropdown(),this.fileUpload(),this.commentsValidate(),this.messageScroll(),f(".ld-in-focus-mode").length<=0&&this.ajax_comment(),this.DropdownToggle(),this.photoCommentFocus(),this.bpRegRequired(),this.inputFileStyle(),this.primaryNavBar(),this.forumsTopic(),this.profileFilterPoint(),this.heartbeat(),this.unReadNotifications(),this.ajaxComplete(),this.bpNavDropDown(),this.scrollToAnchor()},ajaxComplete:function(){f(document).ajaxComplete(function(e,t,i){void 0!==i.data&&"string"==typeof i.data&&0<i.data.indexOf("action=messages_get_thread_messages")&&"undefined"!=typeof wp&&void 0!==wp.heartbeat&&wp.heartbeat.connectNow()})},ajax_comment:function(){f(document).on("submit","#commentform",function(e){e.preventDefault();var t=f("#commentform"),i=f.post(t.attr("action"),t.serialize()),n=f("#commentform").find("[type='submit']").val();f("#comment").prop("disabled",!0),f("#commentform").find("[type='submit']").addClass("waiting"),f("#commentform").find("[type='submit']").prop("disabled",!0).val(bs_data.translation.comment_btn_loading),i.success(function(e,t,i){var n=f("<div></div>");n.append(e);var o="#comments",a=n.find(o);a.length<1&&(o=".comment-list",a=n.find(o));var s=a.find("li"),r=!1;s.each(function(e){var t=f(s[e]);0==f("#"+t.attr("id")).length&&(r=t.attr("id"))}),f(o).replaceWith(a);var l=f("#"+r).offset().top;f("body").hasClass("sticky-header")&&(l=f("#"+r).offset().top-f("#masthead").height()),f("body").hasClass("admin-bar")&&(l-=f("#wpadminbar").height()),r&&f("body, html").animate({scrollTop:l},600)}),i.fail(function(e){var t=f("<div></div>");t.append(e.responseText),t.find("style,meta,title,a").remove(),t=t.find(".wp-die-message p").text(),"object"==typeof bb_vue_loader&&"object"==typeof bb_vue_loader.common&&void 0!==bb_vue_loader.common.showSnackbar?bb_vue_loader.common.showSnackbar(t):alert(t)}),i.always(function(){f("#comment").prop("disabled",!1),f("#commentform").find("[type='submit']").removeClass("waiting"),f("#commentform").find("[type='submit']").prop("disabled",!1).val(n)})})},add_Class:function(){"complete"!==document.readyState&&"interactive"!==document.readyState||(document.getElementsByTagName("body")[0].className+=" bb-page-loaded");var e=document.querySelector(".bb-left-panel-mobile");e&&e.addEventListener("click",function(e){e.preventDefault();var t=document.querySelector(".bb-mobile-panel-wrapper"),i=document.body;t.classList.toggle("closed"),i.classList.toggle("bb-mobile-panel-open")}),f(".bb-close-panel").on("click",function(e){e.preventDefault(),f(".bb-mobile-panel-wrapper").addClass("closed"),f("body").removeClass("bb-mobile-panel-open")}),f(".bp-template-notice.bp-sitewide-notice").insertAfter("#masthead"),document.getElementById("learndash-page-content")&&f(".bp-template-notice.bp-sitewide-notice").prependTo("#learndash-page-content"),"bbp-topic-form"===f(".btn-new-topic").attr("data-modal-id")&&f("body").addClass("forum").find("#bbpress-forums").closest("article.type-page").addClass("type-forum"),f(".bb-sfwd-aside #masthead").hasClass("elementor-header")&&(f(".bb-toggle-panel").prependTo(".ld-course-navigation"),f(".site-header--elementor #bb-toggle-theme").length||f(".site-header--elementor .course-toggle-view").length||f(".bb-elementor-header-items").prependTo(".learndash-content-body")),f(".bb-sfwd-aside #masthead").hasClass("beaver-header")&&(f(".bb-toggle-panel").prependTo(".ld-course-navigation"),f(".bb-elementor-header-items").prependTo(".learndash-content-body")),"1"===f(".beaver-header > header").attr("data-sticky")&&f("body").addClass("beaver-sticky-header"),f(document).on("click","#members-list.item-list:not(.grid) li .has_hook_content .more-action-button",function(e){f(this).parents("li.item-entry").toggleClass("active").siblings("li").removeClass("active"),e.preventDefault()}),f(".bb-mobile-panel-inner .main-navigation a").on("click",function(e){!f(e.target).hasClass("bs-submenu-toggle")&&0<!f(e.target).parents(".bb-menu-section").length&&(f(".bb-mobile-panel-wrapper").addClass("closed"),f("body").removeClass("bb-mobile-panel-open"))})},Menu:function(){f("#activity-sub-nav").BossSocialMenu(90),f("#object-nav:not(.vertical) > ul").BossSocialMenu(90),f(".bb-footer ul.footer-menu").BossSocialMenu(90),f(".bp-navs ul.component-navigation:not(.search-nav)").BossSocialMenu(35),f(".bb-profile-grid.bb-grid .bp-navs.user-subnav ul.subnav").BossSocialMenu(90),0<f("#object-nav > ul").length&&setTimeout(function(){window.dispatchEvent(new Event("resize"))},0),f(".toggle-button").panelslider({bodyClass:"ps-active",clickClose:!0,onOpen:null}),f(document).on("click",".more-button",function(e){e.preventDefault(),f(this).toggleClass("active open").next().toggleClass("active open"),f("body").toggleClass("nav_more_option_open")}),f(document).on("click",".hideshow .sub-menu a",function(e){f("body").trigger("click");var t=f(this).parent();t.parent(".sub-menu").find("li").removeClass("current selected"),t.addClass("current selected")}),f(document).on("click",".bb-share",function(e){e.preventDefault()}),f(document).click(function(e){var t=f(".more-button, .sub-menu");t.is(e.target)||0!==t.has(e.target).length||(f(".more-button").removeClass("active open").next().removeClass("active open"),f("body").removeClass("nav_more_option_open")),(f(e.target).hasClass("bb_more_dropdown__title")||0<f(e.target).closest(".bb_more_dropdown__title").length)&&(f(".more-button").removeClass("active open").next().removeClass("active open"),f("body").removeClass("nav_more_option_open"))});var t=f("#masthead").height()+55;768<f(window).width()&&f(".site-content-grid > .bb-share-container").stick_in_parent({offset_top:t,spacer:!1});window.matchMedia("( max-width: 768px )").addEventListener("change",function(e){e.matches?f(".site-content-grid > .bb-share-container").trigger("sticky_kit:detach"):f(".site-content-grid > .bb-share-container").stick_in_parent({offset_top:t,spacer:!1})}),f(".site-content-grid > .bb-share-container").stick_in_parent({offset_top:t,spacer:!1});var e=f(document),i=f(".sticky-header .site-header"),n=f(".bb-sfwd-aside .buddypanel"),o=f(".single-sfwd-lessons .site-header"),a=f(".single-sfwd-topic .site-header"),s="has-scrolled";e.scroll(function(){i.toggleClass(s,1<=e.scrollTop()),n.toggleClass(s,5<=e.scrollTop()),o.toggleClass(s,1<=e.scrollTop()),a.toggleClass(s,1<=e.scrollTop())}),f(document).on("click",".header-aside div.menu-item-has-children > a",function(e){e.preventDefault();var t=f(this).closest("div.menu-item-has-children");t.siblings(".selected").removeClass("selected"),t.toggleClass("selected")}),f("body").mouseup(function(e){f(".header-aside div.menu-item-has-children *").is(e.target)||f(".header-aside div.menu-item-has-children").removeClass("selected")})},inputStyles:function(){var e=f('.mc4wp-form-fields input[type="submit"]');e.attr("disabled",!0),f('.mc4wp-form-fields input[type="email"]').keyup(function(){0!=f(this).val().length?e.attr("disabled",!1):e.attr("disabled",!0)}),f(".bs-bp-container-reg .field-visibility-settings input[type=radio]").each(function(){var e=f(this);f('<span class="bs-radio"></span>').insertAfter(e),e.addClass("bs-radio"),e.is(":checked")&&(e.next("span.bs-radio").addClass("on"),e.closest("label").addClass("on")),e.change(function(){e.closest("div.radio").find("span.bs-radio").removeClass("on"),e.closest("div.radio").find("label").removeClass("on"),e.next("span.bs-radio").addClass("on"),e.closest("label").addClass("on")})})},header_search:function(){f(".site-header.site-header--bb .header-search-link").on("click",function(e){e.preventDefault(),f("body").toggleClass("search-visible"),navigator.userAgent.match(/(iPod|iPhone|iPad)/)||setTimeout(function(){f("body").find(".header-search-wrap .search-field-top").focus()},90)}),f(".header-search-wrap .search-field-top").focus(function(){if(!navigator.userAgent.match(/(iPod|iPhone|iPad)/)){var e=this;setTimeout(function(){e.selectionStart=e.selectionEnd=1e4},0)}}),f(".site-header.site-header--bb .close-search").on("click",function(e){e.preventDefault(),f("body").removeClass("search-visible"),f(".header-search-wrap input.search-field-top").val("")}),f(document).click(function(e){var t=f(".header-search-wrap, .header-search-link");t.is(e.target)||0!==t.has(e.target).length||f("body").removeClass("search-visible")}),f(document).keyup(function(e){27===e.keyCode&&f("body").removeClass("search-visible")})},unReadNotifications:function(){var o=[];f(document).on("click",".action-unread",function(e){var t={action:"buddyboss_theme_unread_notification",notification_id:f(this).data("notification-id")};if(-1!==o.indexOf(f(this).data("notification-id")))return!1;o.push(f(this).data("notification-id"));var i=f(".bb-icon-bell"),n=f(i).parent().children(".count");0<n.length&&("all"!==f(this).data("notification-id")?n.html(parseInt(n.html())-1):parseInt(f("#header-notifications-dropdown-elem ul.notification-list li").length)<25?n.fadeOut():n.html(parseInt(n.html())-parseInt(f("#header-notifications-dropdown-elem ul.notification-list li").length))),("undefined"!==f(".notification-wrap.menu-item-has-children.selected ul.notification-list li").length&&1==f(".notification-wrap.menu-item-has-children.selected ul.notification-list li").length||"all"===f(this).data("notification-id"))&&f("#header-notifications-dropdown-elem ul.notification-list").html('<p class="bb-header-loader"><i class="bb-icon-loader animate-spin"></i></p>'),"all"!==f(this).data("notification-id")&&(f(this).parent().parent().fadeOut(),f(this).parent().parent().remove()),f.post(ajaxurl,t,function(e){var t=f(".bb-icon-bell"),i=f(t).parent().children(".count");1===o.length&&e.success&&void 0!==e.data&&void 0!==e.data.contents&&f("#header-notifications-dropdown-elem ul.notification-list").length&&f("#header-notifications-dropdown-elem ul.notification-list").html(e.data.contents),void 0!==e.data.total_notifications&&0<e.data.total_notifications&&0<i.length?(f(i).text(e.data.total_notifications),f(".notification-header .mark-read-all").show()):(f(i).remove(),f(".notification-header .mark-read-all").fadeOut());var n=o.indexOf(f(this).data("notification-id"));o.splice(n,1)})})},sidePanel:function(){function t(){if(f("body").hasClass("bb-buddypanel")&&f("body").hasClass("header-style-5")&&f(".buddypanel").css("height",f("html").height()-f(".site-header").height()-f("#wpadminbar").height()+"px"),f("body").hasClass("buddypanel-header")||f("body").hasClass("buddypanel-logo")){if(f(".buddypanel .site-branding").length)var e=f(".buddypanel .site-branding").outerHeight();else e=0;if(f(".buddypanel .panel-head").length)var t=f(".buddypanel .panel-head").outerHeight();else t=0;if(f(".buddypanel .buddypanel-site-icon:visible").length)var i=f(".buddypanel .buddypanel-site-icon").outerHeight();else i=0;f("body:not(.buddypanel-open) .side-panel-inner:not(.is_block)").css("height","100%").css("height","-="+(t+i+40)+"px"),f("body.buddypanel-open .side-panel-inner:not(.is_block)").css("height","100%").css("height","-="+(e+t+40)+"px")}}function e(){window.matchMedia("(pointer: coarse)").matches?f(".side-panel-inner:not(.is_block)").addClass("touch-only"):(f(".side-panel-inner:not(.is_block)").removeClass("touch-only"),f(".side-panel-inner:not(.is_block)").mousewheel(function(e){e.preventDefault(),f(".side-panel-inner").removeClass("touch-only");var t=this.scrollTop;this.scrollTop=t+e.deltaY*e.deltaFactor*-1,f("#buddypanel-menu:not(.buddypanel-menu-block)").addClass("side-panel-scroll"),f("#buddypanel-menu:not(.buddypanel-menu-block) li a").css("margin-top","-"+this.scrollTop+"px"),f("#buddypanel-menu:not(.buddypanel-menu-block) li a:after","#buddypanel-menu:not(.buddypanel-menu-block) li a:before").css("display","none"),clearTimeout(f.data(this,"scrollTimer")),f.data(this,"scrollTimer",setTimeout(function(){f("#buddypanel-menu:not(.buddypanel-menu-block)").removeClass("side-panel-scroll")},250))}))}f(".bb-toggle-panel").on("click",function(e){e.preventDefault(),f("body").addClass("buddypanel-transtioned"),f(".buddypanel").on("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){setTimeout(function(){f("body").removeClass("buddypanel-transtioned")},200)}),function(e,t,i,n,o){var a=e+"="+escape(t)+";";i&&(i instanceof Date?isNaN(i.getTime())&&(i=new Date):i=new Date((new Date).getTime()+1e3*parseInt(i)*60*60*24),a+="expires="+i.toUTCString()+";");n&&(a+="path="+n+";");o&&(a+="domain="+o+";");document.cookie=a}("buddypanel",f("body").hasClass("buddypanel-open")?(f("body").removeClass("buddypanel-open"),"closed"):(f("body").addClass("buddypanel-open"),"open"),30,"/"),0<f(".elementor-section-stretched").length&&(setTimeout(function(){f(window).trigger("resize")},300),setTimeout(function(){f(window).trigger("resize")},500)),0<f(".elementor-section[style*=width]").length&&(setTimeout(function(){f(window).trigger("resize")},300),setTimeout(function(){f(window).trigger("resize")},500)),f("side-panel-inner:not(.is_block) .bs-submenu-toggle").removeClass("bs-submenu-open"),f("side-panel-inner:not(.is_block) .sub-menu").removeClass("bb-open")}),t(),f(window).on("resize",function(){t()}),f(".bb-toggle-panel").on("click",function(e){e.preventDefault(),t(),setTimeout(function(){t()},300),setTimeout(function(){t()},600)}),e(),f(window).resize(function(){e()})},headerAside:function(){function n(){f(".user-wrap .menu-item-has-children").each(function(){var e=f(this),t=f("> .wrapper > .bb-sub-menu",e),i=e.closest(".wrapper"),n=e.position(),o=i.position(),a=n.top+o.top,s=jQuery(window).height()-a-120;t.css({"max-height":s+"px"})}),f(".user-wrap .menupop.parent").each(function(){var e=f(this),t=f("> .ab-sub-wrapper > .ab-submenu",e),i=e.position(),n=jQuery(window).height()-i.top-120;t.css({"max-height":n+"px"})})}f(".sub-menu-inner > li").each(function(){0!==f(this).find(".ab-sub-wrapper").length&&(f(this).addClass("parent"),f(this).find(".ab-sub-wrapper").addClass("wrapper"))}),n(),f(window).resize(function(){n()}),f(".user-wrap li.parent, .user-wrap .menu-item-has-children").on("mouseover",function(){var e=f(this),t=f("> .wrapper",e),i=e.position();t.css({top:i.top}),n()})},DropdownToggle:function(){jQuery(document).on("click","a.bs-dropdown-link.bb-reply-actions-button",function(e){e.preventDefault(),jQuery(this).hasClass("active")?jQuery(this).removeClass("active").next(".bb-reply-actions-dropdown").removeClass("open").closest("li").removeClass("dropdown-open"):(jQuery("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active").next(".bb-reply-actions-dropdown").removeClass("open").closest("li").removeClass("dropdown-open"),jQuery(this).toggleClass("active").next(".bb-reply-actions-dropdown").toggleClass("open").closest("li").toggleClass("dropdown-open"))}),f(document).click(function(e){var t=f(".bb-reply-actions-dropdown, a.bs-dropdown-link.bb-reply-actions-button"),i=f(".forum_single_action_more-wrap");t.is(e.target)||0!==t.has(e.target).length||(f(".bb-reply-actions-dropdown").removeClass("open"),f("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active").closest("li").removeClass("dropdown-open")),(f(e.target).hasClass("bb_more_dropdown__title")||0<f(e.target).closest(".bb_more_dropdown__title").length)&&(f(".bb-reply-actions-dropdown").removeClass("open"),f("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active").closest("li").removeClass("dropdown-open")),i.is(e.target)||0!==i.has(e.target).length||f(".forum_single_action_wrap.is_visible").removeClass("is_visible")}),f(document).on("click",".bb-reply-actions-dropdown .bbp-reply-to-link",function(e){f(".bb-reply-actions-dropdown").removeClass("open"),f("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active")}),f(document).on("click",".bs-forums-items .bbp-reply-to-link",function(e){f(this).closest(".bs-reply-list-item").addClass("in-focus")})},bbMasonry:function(){f(".bb-masonry").css("visibility","visible").masonry({itemSelector:".bb-masonry .hentry",columnWidth:".bb-masonry-sizer"})},bbSlider:function(){},stickySidebars:function(){var e=f("#masthead").outerHeight(),t=30;f("body").hasClass("sticky-header")&&f("body").hasClass("admin-bar")?t=e+62:f("body").hasClass("sticky-header")?t=e+30:f("body").hasClass("admin-bar")&&(t=62),1081<f(window).width()&&(f(".bb-sticky-sidebar").stick_in_parent({spacer:!1,offset_top:t}),f(".activity #activity-stream #bp-ajax-loader .loading").length&&f(".bb-sticky-sidebar").trigger("sticky_kit:detach"),f(".activity #buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',function(){f(".bb-sticky-sidebar").stick_in_parent({spacer:!1,offset_top:t})}),f(".bb-sticky-sidebar").parent("#secondary, #user-activity").css("min-height",f(".bb-sticky-sidebar").height()));window.matchMedia("( max-width: 1081px )").addEventListener("change",function(e){e.matches?f(".bb-sticky-sidebar").trigger("sticky_kit:detach"):f(".bb-sticky-sidebar").stick_in_parent({spacer:!1,offset_top:t})}),f(window).resize(function(){f(".bb-sticky-sidebar").parent("#secondary, #user-activity").css("min-height",f(".bb-sticky-sidebar").height())}),0<f(".bb-sticky-sidebar").length&&f(document).ajaxComplete(function(e,t,i){setTimeout(function(){f(document.body).trigger("sticky_kit:recalc")},150)})},bbFitVideo:function(){0<f(".thrv-page-section .tcb-video-background-el iframe").length&&f(".thrv-page-section .tcb-video-background-el iframe").addClass("fitvidsignore"),0<f(".tutor-video-player iframe").length&&f(".tutor-video-player iframe").addClass("fitvidsignore");function i(){setTimeout(function(){var e="";0<!f(".tutor-course-details-page").length&&0<!f(".tutor-course-single-content-wrapper").length&&(e='iframe[src*="vimeo"]'),f('iframe[src*="youtube"]'+(e?","+e:"")).parent().fitVids()},300)}i(),f(document).ajaxComplete(function(){f(".elementor-popup-modal .elementor-widget-video").length||i(),f(".elementor-video-container").addClass("fitvidsignore")});f(document).on("bp_nouveau_lazy_load",function(e,t){void 0!==t&&void 0!==t.element&&"iframe"==t.element.getAttribute("data-lazy-type")&&i()})},LoadMorePosts:function(){f(document).on("click",".button-load-more-posts",function(e){e.preventDefault();var t=f(this),i=t.attr("href"),n=f(".post-grid");t.addClass("loading"),f.get(i,function(e){f(".pagination-below").remove(),f(e).find("article.status-publish").each(function(e,t){var i=f(t);n.hasClass("bb-masonry")?n.append(i).masonry("appended",i).masonry():n.append(i)}),f(".post-grid").after(f(e).find(".pagination-below")),f(".post-grid").hasClass("bb-masonry")&&f(".bb-masonry").masonry({});var t=f(e).filter("script.bb_bookmarks_bootstrap");0<t.length&&t.each(function(){f("body").append(f(this))})})}),f(document).on("scroll",function(){var e=f(".post-infinite-scroll");if(e.length){var t=e.offset();f(window).scrollTop()+f(window).height()>t.top&&(e.hasClass("loading")||e.trigger("click"))}})},postGridLoader:function(){var e=f("article.type-post").not(".first").first().clone();e.removeClass("format-quote"),e.find(".entry-meta").remove(),e.find(".mejs-offscreen").remove(),e.find(".mejs-container").remove(),e.find("img").remove(),e.find(".post-format-icon").remove(),e.find(".post-main-link").remove(),e.find(".bb-gallery-slider").replaceWith('<a href="" class="entry-media entry-img"></a>'),e.find(".entry-img").length||e.prepend('<a href="" class="entry-media entry-img"></a>');for(var t="",i=0;i<=60;i++)t+=" ";e.find(".entry-content").html("<span>"+t+"</span>"),t="";for(i=0;i<=20;i++)t+=" ";return e.find(".entry-title > a").html(t),e.addClass("loading"),e},jsSocial:function(){f(".bb-shareIcons").jsSocials({showLabel:!0,showCount:!1,shares:[{share:"facebook",label:bs_data.facebook_label},{share:"twitter",label:bs_data.twitter_label}]}),f(".jssocials-share-link").each(function(){var e=f(this).find(".jssocials-share-label").text();f(this).attr("data-balloon-pos","right"),f(this).attr("data-balloon",e),f(this).attr("aria-label",e)}),f(".post-related-posts").find("a[data-balloon-pos]").attr("data-balloon-pos","left")},beforeLogIn:function(){var t="#bp-login-widget-user-login",i="#bp-login-widget-user-pass",n=f("#bp-login-widget-submit");function e(){var e=!1;f(t+","+i).each(function(){""==f(this).val()&&(e=!0)}),e?n.removeClass("bp-login-btn-active"):n.addClass("bp-login-btn-active")}e(),f(t+", "+i).keyup(function(){e()}),setTimeout(function(){f("#bp-login-widget-user-pass").each(function(e,t){f(this).is("*:-webkit-autofill")&&n.addClass("bp-login-btn-active")})},200);var o=".bbp-login-form #user_login",a=".bbp-login-form #user_pass",s=f(".bbp-login-form #user-submit");function r(){var e=!1;f(o+","+a).each(function(){""==f(this).val()&&(e=!0)}),e?s.removeClass("bp-login-btn-active"):s.addClass("bp-login-btn-active")}r(),f(o+", "+a).keyup(function(){r()}),f('form.bbp-login-form label[for="user_pass"]').append("<span class='label-switch'></span>"),f(document).on("click","form.bbp-login-form .label-switch",function(e){var t=f(this),i=t.closest(".bbp-password").find("input#user_pass");t.toggleClass("bb-eye"),t.hasClass("bb-eye")?i.attr("type","text"):i.attr("type","password")}),f('form#bp-login-widget-form label[for="bp-login-widget-user-pass"]').append("<span class='label-switch'></span>"),f(document).on("click","form#bp-login-widget-form .label-switch",function(e){var t=f(this),i=t.closest("form").find("input#bp-login-widget-user-pass");t.toggleClass("bb-eye"),t.hasClass("bb-eye")?i.attr("type","text"):i.attr("type","password")})},bbRelatedSlider:function(){if(f("body").hasClass("has-sidebar"))var i=900;else i=544;function e(){var e="rtl"===f("html").attr("dir"),t={infinite:!1,slidesToShow:2,slidesToScroll:2,adaptiveHeight:!0,arrows:!0,prevArrow:e?'<a class="bb-slide-next"><i class="bb-icon-l bb-icon-angle-left"></i></a>':'<a class="bb-slide-prev"><i class="bb-icon-l bb-icon-angle-right"></i></a>',nextArrow:e?'<a class="bb-slide-prev"><i class="bb-icon-l bb-icon-angle-left"></i></a>':'<a class="bb-slide-next"><i class="bb-icon-l bb-icon-angle-right"></i></a>',appendArrows:".post-related-posts h3",rtl:e,responsive:[{breakpoint:i,settings:{slidesToShow:1,slidesToScroll:1}}]};f(".post-related-posts .post-grid").not(".slick-initialized").slick(t)}e(),f(window).on("resize",function(){e(),f(".post-related-posts .slick-slider").slick("reinit"),f(".post-related-posts .slick-slider").slick("resize"),f(".post-related-posts .slick-slider").slick("refresh")})},BuddyPanel_Dropdown:function(){f(".buddypanel-menu .sub-menu").each(function(){f(this).closest("li.menu-item-has-children").find("a:first").append('<i class="bb-icon-l bb-icon-angle-down bs-submenu-toggle"></i>')}),f(document).on("click",".bs-submenu-toggle",function(e){e.preventDefault(),f(this).toggleClass("bs-submenu-open").closest("a").next(".sub-menu").toggleClass("bb-open"),f(this).parent(".menu-item-has-children").toggleClass("bb-open-parent")}),f("aside.buddypanel .buddypanel-menu .current-menu-parent").find("ul.sub-menu").addClass("bb-open");var e=f(".bb-mobile-panel-inner .menu-item-has-children.current-menu-ancestor, .bb-mobile-panel-inner .menu-item-has-children.current_page_item, .bb-mobile-panel-inner .menu-item-has-children.current-menu-item, .bb-mobile-panel-inner .menu-item-has-children.current-menu-parent");e.children("ul.sub-menu").addClass("bb-open"),e.children("ul.sub-menu").prev().children(".bs-submenu-toggle").addClass("bs-submenu-open")},fileUpload:function(){f(".job-manager-form fieldset input[type=file], .ginput_container_fileupload > input[type=file], .ginput_container_post_image input[type=file]").each(function(){var e=f(this),t=e.attr("id");e.after('<label for="'+t+'">'+bs_data.translation.choose_a_file_label+"</label>")}),f(".job-manager-form fieldset input[type=file], .ginput_container_fileupload > input[type=file], .ginput_container_post_image input[type=file]").change(function(e){var t=f(this);t.next().html(t.val());0===t.val().length?t.next().html(bs_data.translation.choose_a_file_label):t.next().html(t.val().replace(/C:\\fakepath\\/i,""))})},commentsValidate:function(){jQuery.validator.addMethod("BBEmail",function(e,t){return this.optional(t)||/^([a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)},bs_data.translation.email_validation);f("#commentform").validate({rules:{author:{required:!0,normalizer:function(e){return f.trim(e)}},email:{required:!0,BBEmail:!0},url:{url:!0},comment:{required:!0,normalizer:function(e){return f.trim(e)}}},messages:{author:"Please enter your name",email:{required:"Please enter an email address",email:"Please enter a valid email address"},url:"Please enter a valid URL e.g. http://www.mysite.com",comment:"Please fill the required field"},errorElement:"div",errorPlacement:function(e,t){t.after(e)}});f("#comment").focus(function(){f(this).parents("#respond").addClass("bb-active")}),f("#comment").blur(function(){f(this).parents("#respond").removeClass("bb-active")})},messageScroll:function(){},photoCommentFocus:function(){f(document).on("click",".bb-media-model-wrapper .bs-comment-textarea",function(e){e.preventDefault(),f(".bb-media-model-wrapper").animate({scrollTop:f(".bb-media-model-wrapper")[0].scrollHeight},"slow")})},bpRegRequired:function(){f(".bs-bp-container-reg .signup-form input").removeAttr("required")},inputFileStyle:function(){var e=document.querySelectorAll(".bb-inputfile");Array.prototype.forEach.call(e,function(e){var i=e.nextElementSibling,n=i.innerHTML;e.addEventListener("change",function(e){var t="";(t=this.files&&1<this.files.length?(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):e.target.value.split("\\").pop())?i.querySelector("span").innerHTML=t:i.innerHTML=n})})},primaryNavBar:function(){function o(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return[].slice.call(e)}var a=document.getElementById("primary-navbar"),s=document.getElementById("primary-menu"),r=document.getElementById("navbar-extend"),l=document.getElementById("navbar-collapse");function t(){var e=r.children,t=0;[].concat(o(e)).forEach(function(e){e.outHTML="",s.appendChild(e)});var i=a.offsetWidth-(l.offsetWidth+30),n=(s.offsetWidth,s.children);[].concat(o(n)).forEach(function(e){t+=e.offsetWidth+(f("body").hasClass("header-style-2")?0:5),i<t&&(e.outHTML="",r.appendChild(e))}),1<=r.getElementsByTagName("li").length?l.classList.add("hasItems"):l.classList.remove("hasItems"),s.classList.remove("bb-primary-overflow")}void 0!==s&&null!=s&&(f(window).on("resize",function(){setTimeout(function(){t()},300)}),t(),setTimeout(function(){t()},300),setTimeout(function(){t()},900),f(".bb-toggle-panel").on("click",function(e){e.preventDefault(),t(),setTimeout(function(){t(),f(".post-grid").hasClass("bb-masonry")&&f(".bb-masonry").masonry({})},300),setTimeout(function(){t()},600)}))},forumsTopic:function(){var t=f("#masthead").outerHeight();768<f(window).width()&&f("#bbpress-forums .bs-topic-sidebar-inner").stick_in_parent({offset_top:t+45,spacer:!1,bottoming:!0});window.matchMedia("( max-width: 768px )").addEventListener("change",function(e){e.matches?f("#bbpress-forums .bs-topic-sidebar-inner").trigger("sticky_kit:detach"):f("#bbpress-forums .bs-topic-sidebar-inner").stick_in_parent({offset_top:t+45,spacer:!1,bottoming:!1})}),f("body .bbp-topic-form").length&&(f(document).on("keyup",".bbp-topic-form #new-post #bbp_topic_title",function(e){9!=e.which||e.shiftKey||(e.preventDefault(),f(e.target).closest(".bbp-topic-form #new-post .bbp-editor-content").focus())}),f(document).on("keyup",".bbp-topic-form #new-post .bbp-editor-content",function(e){9==e.which&&e.shiftKey&&(e.preventDefault(),f(e.target).closest(".bbp-topic-form #new-post #bbp_topic_title").focus())}),f(document).on("keyup",".bbp-topic-form #new-post #bbp_topic_tags",function(e){9==e.which&&e.shiftKey&&(e.preventDefault(),f(e.target).closest(".bbp-topic-form #new-post #bbp_editor_topic_content").focus())})),f("body .bbp-reply-form").length&&f(document).on("keyup",".bbp-reply-form #new-post #bbp_topic_tags",function(e){9==e.which&&e.shiftKey&&(e.preventDefault(),f(e.target).closest(".bbp-reply-form #new-post .bbp-editor-content").focus())});var b='<div class="bb-modal-overlay js-modal-close"></div>';f(document).on("click","a[data-modal-id]",function(e){e.preventDefault(),f("body").addClass("bb-modal-overlay-open").append(b),f(".bb-modal-overlay").fadeTo(0,1);var t=f(e.target).closest(".bb-grid"),i=f(this).attr("data-modal-id");if(1===f("body.single-forum").length&&f(e.target).parent().hasClass("bbpress-sidebar")?t=t.find("#bbpress-forums"):0<t.find("#bbpress-forums").length&&(t=f(e.target).closest("#bbpress-forums")),t.find("."+i).fadeIn(0).addClass("bb-modal-open"),t.find(".bbp-reply-form").length){t.find(".bbp-reply-form").find("#bbp_reply_to").val(0),t.find(".bbp-reply-form").find("#bbp-reply-to-user").html(t.find(t.find(".topic-lead").find(".item-meta").get(0)).find(".bbp-author-name").text());var n=t.find("#bbp_topic_id").val(),o=f("#topic-"+n+"-replies li.bs-item-wrap #bbp_topic_excerpt").val();""!=o&&(o+="...",t.find(".bbp-reply-form").find("#bbp-reply-exerpt").text(o));var a=t.find(".bbp-the-content").data("key");void 0!==window.forums_medium_reply_editor&&void 0!==window.forums_medium_reply_editor[a]&&window.forums_medium_reply_editor[a].subscribe("editableInput",function(){""!=f.trim(window.forums_medium_reply_editor[a].getContent()).replace("<p><br></p>","")?t.find(".bbp-the-content").removeClass("error"):t.find(".bbp-the-content").addClass("error")})}void 0!==window.forums_medium_topic_editor&&void 0!==window.forums_medium_topic_editor[a]&&window.forums_medium_topic_editor[a].subscribe("editableInput",function(){""!=f.trim(window.forums_medium_topic_editor[a].getContent()).replace("<p><br></p>","")?t.find(".bbp-the-content").removeClass("error"):t.find(".bbp-the-content").addClass("error")}),t.find(".bbp-topic-form").trigger("bbp_after_load_topic_form",{click_event:this}),t.find(".bbp-reply-form").trigger("bbp_after_load_reply_form",{click_event:this})}),f(document).on("click","a[data-modal-id-inline]",function(e){if(!f(this).closest(".bs-single-forum-list").hasClass("bb-single")){e.preventDefault(),f("body").addClass("bb-modal-overlay-open").append(b),f(".bb-modal-overlay").fadeTo(0,1);var t=f(this).attr("data-modal-id-inline");f("#"+t).fadeIn(0).addClass("bb-modal-open");var i=f(e.target).closest(".bb-grid");if(i.find(".bbp-reply-form").length){i.find(".bbp-reply-form").find("#bbp-reply-to-user").html(f(f(this).closest("li").find(".bs-reply-list-item").get(0)).find(".item-meta").find(".bbp-author-name").text());var n=f(this).closest(".bs-reply-list-item").find(".bbp-author-name").text().trim(),o=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().substring(0,50);if(f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-elem").length){var a=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-elem .document-helper-text")[0];""!==(a=f(a).text())&&(o=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(a,"g"),"").substring(0,50).trim());var s=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-elem").not(".document-activity")[0];""!==(s=f(s).text().trim())&&(o=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(s,"g"),"").substring(0,50).trim())}if(f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-wrap .bp-video-thumbnail-uploader").length){var r=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-wrap")[0];""!==(r=f(r).text().trim())&&(o=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(r,"g"),"").substring(0,50).trim())}if(f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bbp-reply-revision-log").length){var l=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bbp-reply-revision-log").text().trim();o=f(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(l,"g"),"").substring(0,50).trim()}""!==n&&i.find(".bbp-reply-form").find("#bbp-reply-to-user").text(n);var d=i.find(".bbp-reply-form").find("#bbp-reply-exerpt");""!==o?(d.removeClass("show-empty"),o+="..."):d.addClass("show-empty"),d.text(o);var c=i.find(".bbp-the-content").data("key");void 0!==window.forums_medium_reply_editor&&void 0!==window.forums_medium_reply_editor[c]&&window.forums_medium_reply_editor[c].subscribe("editableInput",function(){""!=f.trim(window.forums_medium_reply_editor[c].getContent()).replace("<p><br></p>","")?i.find(".bbp-the-content").removeClass("error"):i.find(".bbp-the-content").addClass("error")})}i.find(".bbp-reply-form").trigger("bbp_after_load_inline_reply_form",{click_event:this})}}),f(document).on("click",".js-modal-close",function(e){e.preventDefault(),f(".bb-modal-box, .bb-modal-overlay").fadeOut(50,function(){f(".bb-modal-overlay").remove()}),f("body").removeClass("popup-modal-reply bb-modal-overlay-open"),f(".bs-reply-list-item.in-focus").removeClass("in-focus"),f(".bb-modal-box").removeClass("bb-modal-open"),f(this).trigger("bbp_after_close_topic_reply_form",{click_event:this})}),f(document).on("click",".bb-modal-overlay",function(e){e.preventDefault(),f("body").removeClass("bb-modal-overlay-open"),f(".bb-modal-box, .bb-modal-overlay").fadeOut(50,function(){f(".bb-modal-overlay").remove()}),f(".bb-modal-box").removeClass("bb-modal-open"),f(document).trigger("bbp_after_close_topic_reply_form_on_overlay",{click_event:this})}),e("bbp_reply_to")&&e("bbp_reply_to")&&(0<parseInt(e("bbp_reply_to"))&&f(document).find(".bbp-reply-to-link."+e("bbp_reply_to")).length?f(window).load(function(){f(".bbp-reply-to-link."+e("bbp_reply_to")).trigger("click")}):f(".bbp-topic-reply-link").trigger("click")),f(".bbp-topic-form form").length&&f(".bbp-topic-form form").find(".bp-feedback.error").length&&f(".btn-new-topic").trigger("click"),f(".bbp-topic-form form").on("keyup","#bbp_topic_title,#bbp_anonymous_author,#bbp_anonymous_email",function(e){e.preventDefault(),""===f.trim(f(this).val())?f(this).addClass("error"):f(this).removeClass("error")}),f(document).on("click",".bbp-topic-form form #bbp_topic_submit",function(e){e.preventDefault();var t=f(e.target).closest("form");if(t.hasClass("submitting"))return!1;t.addClass("submitting");var i=!0,n=!0;t.find(".bbp-form-anonymous").length&&(""===f.trim(t.find("#bbp_anonymous_author").val())?(t.find("#bbp_anonymous_author").addClass("error"),i=!1):t.find("#bbp_anonymous_author").removeClass("error"),""===f.trim(t.find("#bbp_anonymous_email").val())?(t.find("#bbp_anonymous_email").addClass("error"),i=!1):t.find("#bbp_anonymous_email").removeClass("error")),""===f.trim(t.find("#bbp_topic_title").val())?(t.find("#bbp_topic_title").addClass("error"),i=!1):t.find("#bbp_topic_title").removeClass("error");var o=t.find(".bbp_editor_topic_content").data("key"),a=!1;void 0!==window.forums_medium_topic_editor&&void 0!==window.forums_medium_topic_editor[o]&&(a=window.forums_medium_topic_editor[o]);var s=0<t.find("#forums-gif-button").length&&!t.find("#forums-gif-button").parents(".post-elements-buttons-item").hasClass("disable"),r=0<t.find("#bbp_media").length&&t.find("#bbp_document").length<=0&&t.find("#bbp_video").length<=0&&s&&0<t.find("#bbp_media_gif").length&&""==t.find("#bbp_media").val()&&""==t.find("#bbp_media_gif").val(),l=0<t.find("#bbp_document").length&&t.find("#bbp_media").length<=0&&t.find("#bbp_video").length<=0&&s&&0<t.find("#bbp_media_gif").length&&""==t.find("#bbp_document").val()&&""==t.find("#bbp_media_gif").val(),d=0<t.find("#bbp_video").length&&t.find("#bbp_media").length<=0&&t.find("#bbp_document").length<=0&&s&&0<t.find("#bbp_media_gif").length&&""==t.find("#bbp_video").val()&&""==t.find("#bbp_media_gif").val(),c=0<t.find("#bbp_document").length&&!s&&(""==t.find("#bbp_document").val()||"[]"==t.find("#bbp_document").val())&&""==t.find("#bbp_media").val()&&""==t.find("#bbp_video").val(),b=0<t.find("#bbp_media").length&&!s&&(""==t.find("#bbp_media").val()||"[]"==t.find("#bbp_media").val())&&""==t.find("#bbp_document").val()&&""==t.find("#bbp_video").val(),p=0<t.find("#bbp_video").length&&!s&&(""==t.find("#bbp_video").val()||"[]"==t.find("#bbp_video").val())&&""==t.find("#bbp_media").val()&&""==t.find("#bbp_document").val(),m=s&&0<t.find("#bbp_media_gif").length&&t.find("#bbp_media").length<=0&&t.find("#bbp_document").length<=0&&t.find("#bbp_video").length<=0&&""==t.find("#bbp_media_gif").val();(r||l||d||c||b||p||m)&&(n=!1);var u="";0<t.find("#link_preview_data").length&&""!==t.find("#link_preview_data").val()&&(u=JSON.parse(t.find("#link_preview_data").val()).link_url),a&&""===f.trim(a.getContent().replace("<p><br></p>",""))&&0==n?""===u&&(t.find("#bbp_editor_topic_content").addClass("error"),i=!1):a||""!==f.trim(t.find("#bbp_topic_content").val())||0!=n?(a&&t.find("#bbp_editor_topic_content").removeClass("error"),t.find("#bbp_topic_content").removeClass("error")):""===u&&(t.find("#bbp_topic_content").addClass("error"),i=!1),i?t.submit():t.removeClass("submitting")}),f(".bbp-reply-form form #bbp_reply_submit").on("click",function(e){e.preventDefault();var t=!0,i=f(e.target).closest("form");if(i.find(".bbp-form-anonymous").length&&(""===f.trim(i.find("#bbp_anonymous_author").val())?(i.find("#bbp_anonymous_author").addClass("error"),t=!1):i.find("#bbp_anonymous_author").removeClass("error"),""===f.trim(i.find("#bbp_anonymous_email").val())?(i.find("#bbp_anonymous_email").addClass("error"),t=!1):i.find("#bbp_anonymous_email").removeClass("error")),t){i.find('input[name="bbp_topic_id"]').val();i.submit()}f("body").removeClass("popup-modal-reply"),f(".bs-reply-list-item.in-focus").removeClass("in-focus"),i.find(".bbp_topic_tags_wrapper tags tag").remove()}),f(document).keydown(function(e){if(e.ctrlKey&&13===e.keyCode){var t=f(".bbp-topic-form form"),i=f(".bbp-reply-form form");i.length&&i.find("#bbp_reply_submit").trigger("click"),t.length&&t.find("#bbp_topic_submit").trigger("click")}}),window.addReply={moveForm:function(e,t,i,n){f(".bbp-reply-form").find("#bbp_reply_to").val(t);var o,a=this,s=a.I(e),r=a.I(i),l=a.I("bbp-cancel-reply-to-link"),d=a.I("bbp_reply_to"),c=a.I("bbp_topic_id");if(s&&r&&l&&d){a.respondId=i,n=n||!1,a.I("bbp-temp-form-div")||((o=document.createElement("div")).id="bbp-temp-form-div",o.style.display="none",r.parentNode.insertBefore(o,r)),r.classList.remove("mfp-hide"),s.parentNode.appendChild(r),"undefined"!=typeof tinyMCE&&(tinyMCE.remove(),tinyMCE.init({selector:"textarea.bbp-the-content",menubar:!1,branding:!1,plugins:"image,lists,link",toolbar:"bold italic bullist numlist blockquote link"})),c&&n&&(c.value=n),d.value=t,l.style.display="",l.onclick=function(){var e=addReply,t=e.I("bbp-temp-form-div"),i=e.I(e.respondId);if(t&&i)return e.I("bbp_reply_to").value="0",i.classList.add("mfp-hide"),t.parentNode.insertBefore(i,t),t.parentNode.removeChild(t),this.style.display="none",this.onclick=null,!1};try{a.I("bbp_reply_content").focus()}catch(e){}return!1}},I:function(e){return document.getElementById(e)}}},profileFilterPoint:function(){var e=window.matchMedia("( max-width: 800px )");function t(){e.matches?f("#bp-profile-search-form-outer").prependTo("#buddypress"):f("#bp-profile-search-form-outer").prependTo("#secondary")}e.addEventListener("change",function(e){t()}),t()},heartbeat:function(){(void 0!==bs_data.show_notifications&&"1"==bs_data.show_notifications||void 0!==bs_data.show_messages&&"1"==bs_data.show_messages)&&(f(document).on("heartbeat-send",this.bpHeartbeatSend.bind(this)),f(document).on("heartbeat-tick",this.bpHeartbeatTick.bind(this)))},bpNavDropDown:function(){f("nav .bp-navs__dropdown").change(function(){window.location=f(this).find("option:selected").val()})},scrollToAnchor:function(){if(f("body").hasClass("sticky-header")&&f("body").hasClass("single-post")){var o=f("#masthead").height()+55;if(f(document).on("click",".widget_recent_comments .recentcomments > a, .widget_recent_comments .wp-block-latest-comments__comment-link, .widget.new_blog_comment.bp-latest-activities .activity-time-since",function(e){var t=f(this).attr("href"),i=t.substr(t.indexOf("#")+1),n=f("#"+i);n.length&&(e.preventDefault(),f("html,body").animate({scrollTop:n.offset().top+-o},"slow"),window.history.pushState({},"","#"+i))}),-1<window.location.href.indexOf("#comment-")){var e=window.location.href,t=e.substr(e.indexOf("#")+1),i=f("#"+t);setTimeout(function(){i.length&&f("html,body").animate({scrollTop:i.offset().top+-o},100)},100)}}},bpHeartbeatSend:function(e,t){t.customfield="",f("#buddypress").trigger("bp_heartbeat_send",t)},bpHeartbeatTick:function(e,t){this.bpInjectNotifications(e,t),f("#buddypress").trigger("bp_heartbeat_tick",t)},bpInjectNotifications:function(e,t){if(void 0!==t.unread_notifications&&""!==t.unread_notifications&&f("#header-notifications-dropdown-elem .notification-dropdown .notification-list").empty().html(t.unread_notifications),void 0!==t.unread_messages&&""!==t.unread_messages&&f("#header-messages-dropdown-elem .notification-dropdown .notification-list").empty().html(t.unread_messages),void 0!==t.total_notifications&&0<t.total_notifications){var i=f(".bb-icon-bell"),n=f(i).parent().children(".count");f(".notification-header .mark-read-all").show(),0<n.length?f(n).text(t.total_notifications):f(i).parent(":not(.group-subscription)").append('<span class="count"> '+t.total_notifications+" </span>")}else{i=f(".bb-icon-bell"),n=f(i).parent().children(".count");f(n).remove(),f(".notification-header .mark-read-all").fadeOut()}if(void 0!==t.total_unread_messages&&0===parseInt(t.total_unread_messages)){var o=f(".bb-icon-inbox");0<(a=f(o).parent().children(".count")).length&&f(a).remove(),0<(s=f(".bp-messages-nav").find(".count")).length&&s.text(t.total_unread_messages).addClass("bp-hide")}if(void 0!==t.total_unread_messages&&0<t.total_unread_messages){var a,s;o=f(".bb-icon-inbox");0<(a=f(o).parent().children(".count")).length?f(a).text(t.total_unread_messages):f(o).parent().append('<span class="count"> '+t.total_unread_messages+" </span>"),0<(s=f(".bp-messages-nav").find(".count")).length&&s.text(t.total_unread_messages).removeClass("bp-hide")}}},f(document).on("ready",function(){BuddyBossTheme.init(),f(".bp-personal-sub-tab #compose").on("click",function(){f(this).parent().toggleClass("current selected")})}),f(".ld-entry-content > .entry-content-wrap .entry-content").addClass("ld-gb-content"),f(".llms-notice > a").click(function(){f(".llms-person-login-form-wrapper").hasClass("llms-person-login-aktif")?(f(".llms-login").css("display","none"),f(".llms-person-login-form-wrapper").removeClass("llms-person-login-aktif")):f(".llms-person-login-form-wrapper").addClass("llms-person-login-aktif")}),f.fn.wrapStart=function(e){var t=this.contents().filter(function(){return 3==this.nodeType}).first(),i=t.text().replace(/\s+/g," ").replace(/^\s|\s$/g,""),n=i.split(" ",e).join(" ");t.length&&(t[0].nodeValue=i.slice(n.length),t.before("<span>"+n+"</span>"))},f("#header-my-account-menu").length&&(f("#header-my-account-menu > li").each(function(){if(f(this).hasClass("icon-added"))return f(this).closest("ul").addClass("has-icon"),!1}),f("#header-my-account-menu ul").each(function(){f(this).children("li").each(function(){if(f(this).hasClass("icon-added"))return f(this).closest("ul").addClass("has-icon"),!1})})),f(".admin-bar #wp-admin-bar-my-account-default").length&&f(".admin-bar #wp-admin-bar-my-account-default > li").each(function(){if(f(this).hasClass("menupop"))return f(this).closest("ul").addClass("has-menupop"),!1}),f(document).on("click",".forum_single_action_wrap .forum_single_action_more-wrap",function(e){var t=f(e.currentTarget).closest(".forum_single_action_wrap");t.hasClass("is_visible")?t.removeClass("is_visible"):t.addClass("is_visible")}),f(".buddypress.widget .gamipress-buddypress-user-details-listing").length&&(i(),f(document).on("click",".buddypress.widget .showGamipressData",function(){f(this).parent().find(".GamiPress-data-popup").addClass("is_active"),f(this).closest(".bb-sticky-sidebar").length&&(t=f(this).closest(".bb-sticky-sidebar").attr("style"),f(this).closest(".bb-sticky-sidebar").attr("style",""),f("body").addClass("hide-overflow"))}),f(document).on("heartbeat-tick",function(e,t){setTimeout(function(){i()},1e3)}),f(".widget div#members-list-options a").on("click",function(){setTimeout(function(){i()},3e3)}),f(document).on("click",".buddypress.widget .GamiPress-data-popup .hideGamipressData",function(){f(this).closest(".GamiPress-data-popup").removeClass("is_active"),f(this).closest(".bb-sticky-sidebar").length&&(f(this).closest(".bb-sticky-sidebar").attr("style",t),t="",f("body").removeClass("hide-overflow"))}));function n(){var e=f(window).scrollTop(),t=f("#wpadminbar").height(),i=t+f(".site-header").height()-e;t<i?(f(".buddypanel").css("top",i+"px"),f(".buddypanel").css("height",f("html").height()-f(".site-header").height()-f("#wpadminbar").height()+"px")):(f(".buddypanel").css("top",t+"px"),f(".buddypanel").css("height","100%"))}f("body").on("bbp_after_load_reply_form",function(e,t){if(f('div[data-component="activity"]').length){var i=f(t.click_event),n=i.closest(".bb-grid").find(".bbp-reply-form");if(n.length){var o=i.data("topic-id"),a=(i.data("author-name"),i.closest("li").find(".activity-discussion-title-wrap a").text());n.closest(".bb-quick-reply-form-wrap").show(),n.css({display:"block"}),n.addClass("bb-modal bb-modal-box"),n.closest(".bb-quick-reply-form-wrap").show(),n.find("#bbp_reply_to").val(0),n.find("#bbp-reply-exerpt").text(a+"..."),n.find('input[name="bbp_topic_id"]').val(o)}}}),f(document).on("bbp_after_submit_reply_form",".bbp-reply-form",function(e,t){if(t.response.success&&f('div[data-component="activity"]').length){var i=f("a[data-topic-id="+t.topic_id+"]").closest("li").find(".activity-discussion-title-wrap").clone();f("a[data-topic-id="+t.topic_id+"]").closest("li").find(".activity-discussion-title-wrap").find("a").attr("href");f(".bbp-reply-form-success-modal").find(".activity-list").html(i),setTimeout(function(){f(".bbp-reply-form-success-modal .view-reply-button a").attr("href",t.response.redirect_url),f(".bbp-reply-form-success-modal").removeAttr("style"),f(".bbp-reply-form-success-modal .bb-modal").css("z-index",999992),f(".bbp-reply-form-success").fadeIn(100)},200)}}),f("body").hasClass("header-style-5")&&!f("body").hasClass("sticky-header")&&(f(window).on("scroll",function(){n()}),f(window).on("resize",function(){n()}),f(window).on("load",function(){n()}))}(jQuery);var BBGetQueryVariable=BBGetQueryVariable||function(e,t){if("string"!=typeof e||""==e||void 0===t||""==t)return"";for(var i=e.split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]==t)return o[1]}return!1},BBGetUrlParameter=BBGetUrlParameter||function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))};jQuery("#members-group-list").on("DOMSubtreeModified",function(){jQuery("#members-list.item-list:not(.grid) li.item-entry-header").prev("li").addClass("last-of-type")}),setTimeout(function(){jQuery(document).on("mouseover","#site-navigation #navbar-collapse #navbar-extend .menu-item-has-children, #site-navigation #primary-menu .ab-submenu .menu-item-has-children",function(){var e=jQuery(this),t=jQuery(this).children(".ab-submenu"),i=e.position();t.css({top:i.top}),jQuery("body").addClass("bb-submenu-isactive")}),jQuery(document).on("mouseleave","#site-navigation #navbar-collapse #navbar-extend .menu-item-has-children, #site-navigation #primary-menu .ab-submenu .menu-item-has-children",function(){jQuery("body").removeClass("bb-submenu-isactive")})},500);