// source --> https://www.trinityboardsport.com/wp-content/plugins/divi-bodycommerce/includes/modules/divi-ajax-filter/includes/modules/FilterPosts/../../../js/divi-filter.min.js?ver=5.3.1 
jQuery(document).ready(function (e) { e(".et_pb_contact_field_radio.is-collapsible").each(function (t, a) { var i = e(this).attr("data_cat_id"); e('.et_pb_contact_field_radio[data_parent_cat_id="' + i + '"]').each(function (t, a) { e(this).hide() }) }), e(document).on("click", ".et_pb_contact_field_radio.is-collapsible input", function (t) { e(this).closest(".et_pb_contact_field_radio").toggleClass("open"), "on" == e(this).closest(".et_pb_contact_field_radio").attr("data_prevent_collapse") && t.preventDefault(); var a = e(this).closest(".et_pb_contact_field_radio").attr("data_cat_id"); e('.et_pb_contact_field_radio[data_parent_cat_id="' + a + '"]').each(function (t, a) { e(this).toggle("slow") }) }), e(document).on("click", ".showmore", function (t) { e(this).closest(".et_pb_de_mach_search_posts_item").addClass("limit_show_all") }), e(document).on("click", ".showless", function (t) { e(this).closest(".et_pb_de_mach_search_posts_item").removeClass("limit_show_all") }), e(document).on("click", ".mobile_toggle_trigger.et_pb_button", function (t) { e("#divi_filter").slideToggle() }), e("#divi_filter").length > 0 && e("#divi_filter").find(".mobile_toggle_trigger.sticky-toggle").click(function () { e(this).closest("#divi_filter").toggleClass("toggle_open") }), e("#divi_filter select, #divi_filter input[type=radio], #divi_filter input[type=checkbox], #divi_filter input[type=range], #dmach-search-form select, #dmach-search-form input[type=radio], #dmach-search-form input[type=checkbox], #dmach-search-form input[type=range]").on("change", function () { handle_conditional_fields() }), e(document.body).on("click", ".bc-link-whole-grid-card", function (t) { var a = e(t.target); if ($newtab = a.closest(".et_pb_de_mach_archive_loop"), !a.hasClass("ajax_add_to_cart")) { var i = e(this).data("link-url"); $newtab.hasClass("link_whole_new_tab") ? window.open(i, "_blank") : window.location.href = i } }), e(".mobile_toggle_trigger").length > 0 && e(".mobile_toggle_trigger").closest(".et_pb_column").css("z-index", "20"), e(".divi-filer-toggle .et_pb_contact_field_options_title, .divi-filer-toggle-mob .et_pb_contact_field_options_title").click(function (t) { e(this).closest(".et_pb_de_mach_search_posts_item").hasClass("visible") ? e(".et_pb_de_mach_search_posts_item").removeClass("visible") : (e(".et_pb_de_mach_search_posts_item").removeClass("visible"), e(this).closest(".et_pb_de_mach_search_posts_item").addClass("visible")) }); var t = e(".divi-filter-archive-loop.main-loop").attr("data-filter-var"); void 0 !== t && (void 0 !== (a = JSON.parse(t)).meta_query && jQuery.each(a.meta_query, function (t, a) { if ("_weight" == a.key ? a.key = "product_weight" : "_wc_average_rating" == a.key && (a.key = "product_rating"), jQuery('[data-name="' + a.key + '"]').closest(".et_pb_de_mach_search_posts_item").hasClass("filter_params")) { if (jQuery('[data-name="' + a.key + '"]').closest(".et_pb_de_mach_search_posts_item").hasClass("filter_params_yes_title")) var i = "title"; else i = "no-title"; var r = jQuery('[data-name="' + a.key + '"]').attr("data-field_type"), o = e('[data-name="' + a.key + '"]').data("name"), l = jQuery('[data-name="' + a.key + '"]').closest(".et_pb_de_mach_search_posts_item").find(".et_pb_contact_field_options_title ").html(), s = jQuery('[data-name="' + a.key + '"]').closest(".et_pb_de_mach_search_posts_item").find(".irs-to").text(), n = jQuery('[data-name="' + a.key + '"]').closest(".et_pb_de_mach_search_posts_item").find(".irs-from").text(); if ("select" == r) { var d = jQuery('[data-name="' + a.key + '"]').find("option:selected").text(); divi_filter_params(r, o, d, l, i, s, n) } else if ("radio" == r || "checkbox" == r) jQuery('[data-name="' + a.key + '"]:checked').each(function () { var e = jQuery(this).parent().find(".radio-label").attr("title"); divi_filter_params(r, o, e, l, i, s, n) }); else { d = jQuery('[data-name="' + a.key + '"]').val(); divi_filter_params(r, o, d, l, i, s, n) } } }), void 0 !== a.tax_query && jQuery.each(a.tax_query, function (e, t) { if (jQuery('[data-name="' + t.taxonomy + '"]').length > 0 && jQuery('[data-name="' + t.taxonomy + '"]').eq(0).closest(".et_pb_de_mach_search_posts_item").hasClass("filter_params")) { if (jQuery('input[data-name="' + t.taxonomy + '"]').eq(0).closest(".et_pb_de_mach_search_posts_item").hasClass("filter_params_yes_title")) var a = "title"; else a = "no-title"; var i = jQuery('[data-name="' + t.taxonomy + '"]').eq(0).attr("data-field_type"), r = jQuery('[data-name="' + t.taxonomy + '"]').eq(0).closest(".et_pb_de_mach_search_posts_item").find(".et_pb_contact_field_options_title ").html(), o = jQuery('[data-name="' + t.taxonomy + '"]').eq(0).closest(".et_pb_de_mach_search_posts_item").find(".irs-to").text(), l = jQuery('[data-name="' + t.taxonomy + '"]').eq(0).closest(".et_pb_de_mach_search_posts_item").find(".irs-from").text(); if ("select" == i) { var s = jQuery('[data-name="' + t.taxonomy + '"]').find("option:selected").text(); divi_filter_params(i, t.taxonomy, s, r, a, o, l) } else if ("radio" == i || "checkbox" == i) jQuery('[data-name="' + t.taxonomy + '"]:checked').each(function () { var e = jQuery(this).parent().find(".radio-label").attr("title"); divi_filter_params(i, t.taxonomy, e, r, a, o, l) }); else { s = jQuery('[data-name="' + t.taxonomy + '"]').val(); divi_filter_params(i, t.taxonomy, s, r, a, o, l) } } })); if (show_filter_counts(), show_hide_reset(), handle_conditional_fields(), e(".reset-filters").click(function (t) { t.preventDefault(); var a = e(".divi-filter-archive-loop.main-loop").data("current-taxonomy"), i = e(".divi-filter-archive-loop.main-loop").data("current-taxterm"); e(".js-range-slider").length && e(".js-range-slider").each(function (t, a) { var i = e(this).data("ionRangeSlider"); i.options.to = i.options.max, i.reset() }), jQuery(".search_filter_cont[data-conditional-logic]").hide(), e(".et_pb_contact_field_radio").removeClass("hidethis"), e(this).closest("#divi_filter").find("input[type=text], textarea").val(""), e(this).closest("#divi_filter").find(".et_pb_contact_select").prop("selectedIndex", 0), e(this).closest("#divi_filter").find(".et_pb_contact_field_radio input").prop("checked", !1), e(this).closest("#divi_filter").find('.et_pb_contact_field_radio input[value=""]').prop("checked", !0), e(this).closest("#divi_filter").find(".et_pb_contact_field_options_wrapper").each(function (t, r) { var o = !1; void 0 !== a && void 0 !== i && e(this).find("input").eq(0).data("name") == a && e(this).find('input[value="' + i + '"]').length > 0 && (e(this).find('input[value="' + i + '"]').prop("checked", !0), o = !0), e(this).find('label[data-value="all"]').length > 0 && 0 == o && e(this).find('label[data-value="all"]').closest(".et_pb_contact_field_radio").find("input").prop("checked", !0) }), void 0 !== a && void 0 !== i && e(this).closest("#divi_filter").find('.et_pb_contact_select[data-name="' + a + '"]').length > 0 && e(this).closest("#divi_filter").find('.et_pb_contact_select[data-name="' + a + '"]').find('option[value="' + i + '"]').length > 0 && e(this).closest("#divi_filter").find('.et_pb_contact_select[data-name="' + a + '"]').val(i), e(".filter-param-item").remove(); var r = document.location.href, o = 0, l = r; -1 == (o = r.indexOf("?")) && (o = r.indexOf("")), -1 != o && (l = r.substring(0, o)), window.history.replaceState(null, null, l), divi_find_filters_to_filter() }), jQuery(".divi-filter-archive-loop.main-loop").length > 0 && "1" == filter_ajax_object.ajax_pagination && jQuery(".woocommerce-ordering").submit(function () { return !1 }), jQuery(".orderby").length > 0) { var a, i = jQuery(".orderby").val(), r = "desc"; if (jQuery(".orderby").closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-orderbyvalue", jQuery(".orderby").val()), void 0 !== t) i = (a = JSON.parse(t)).orderby, r = a.order, jQuery(".orderby").closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-orderbyvalue", i); if ("price" == i && (r = "asc"), Array.isArray(i.split("-"))) { var o = i.split("-"); i = o[0], r = o[1] } jQuery(".orderby").closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-sortorder", i), jQuery(".orderby").closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-sortasc", r) } }); var get_sub_cat_ajax, page_clicked = !1; function divi_append_url(e, t) { var a = document.location.href; if (t = encodeURIComponent(t), -1 == window.location.href.indexOf("?")) "" != t && window.history.replaceState(null, null, a + "?filter=true&" + e + "=" + t); else if (-1 == window.location.search.indexOf("?filter") && (r = a.replace("?", "?filter=true&"), a = r, window.history.replaceState(null, null, r)), window.location.search.indexOf("&" + e) > -1) { var i = new RegExp("([?&]" + e + ")=([^#&]*)", "g"), r = ""; "" != t ? (r = a.replace(i, "$1=" + t), window.history.replaceState(null, null, r)) : (r = a.replace(i, ""), window.history.replaceState(null, null, r)) } else "" != t && window.history.replaceState(null, null, a + "&" + e + "=" + t) } function divi_filter_params(e, t, a, i, r, o, l) { if (void 0 !== a) { var s = !1; if (jQuery('.divi-filter-item[data-filter-option="' + t + '"]').hasClass("divi-checkboxmulti") ? jQuery(".param-" + t + '[data-value="' + a + '"]').length ? jQuery(".param-" + t + '[data-value="' + a + '"]').remove() : s = !0 : (jQuery(".param-" + t).length && jQuery(".param-" + t).remove(), 0 == jQuery(".param-" + t + '[data-value="' + a + '"]').length && (s = !0)), 1 == s && "" !== a && "All" !== a) { if ("range" == e && (a = l + " - " + o), "title" == r) var n = '<p class="filter-param-item param-' + t + '" data-filter="' + t + '" data-type="' + e + '" data-value="' + a + '">' + i + ": " + a + '<span class="remove-filter"></span></p>'; else n = '<p class="filter-param-item param-' + t + '" data-filter="' + t + '" data-type="' + e + '" data-value="' + a + '">' + a + '<span class="remove-filter"></span></p>'; jQuery(".filter-param-tags").append(n) } } } function divi_filter_params_array(e, t, a, i, r, o, l) { for (var s = e.length, n = [], d = 0; d < s; d++) { var c = { type_arr: e[d], slug_arr: t[d], value_arr: a[d], name_arr: i[d], filter_param_type_arr: r[d], iris_to_arr: o[d], irs_from_arr: l[d] }; n.push(c) } jQuery.each(n, function (e, t) { divi_filter_params(t.type_arr, t.slug_arr, t.value_arr, t.name_arr, t.filter_param_type_arr, t.iris_to_arr, t.irs_from_arr) }) } function divi_find_filters_to_filter() { var e = [], t = [], a = [], i = [], r = !1; if (jQuery(".et_pb_de_mach_filter_posts").each(function () { jQuery(this).width() > 0 && jQuery(this).find(".divi-acf").each(function (o, l) { var s = !1, n = jQuery(this).closest(".et_pb_contact").find(".et_pb_contact_field").data("type"); if ("divi-checkboxsingle" == jQuery(this).attr("data-filtertype")) if (jQuery(this).is("select")) d = jQuery(this).data("name"), c = jQuery(this).attr("id"), _ = jQuery(this).val(), s = !0; else if ((u = (p = jQuery(this).closest(".et_pb_contact_field_options_list")).find("input:checked")).length > 0) var d = u.data("name"), c = u.attr("id"), _ = u.val(), s = !0; else { var d = p.find("input").eq(0).data("name"), c = "", _ = ""; s = !1 } else if ("divi-checkboxmulti" == jQuery(this).attr("data-filtertype")) { var p, u = (p = jQuery(this).closest(".et_pb_contact_field_options_list")).find("input:checked"), f = []; u.each(function () { f.push(jQuery(this).val()) }); d = jQuery(this).data("name"), c = jQuery(this).attr("id"), _ = f.join(","), s = !0; -1 != e.indexOf(d) && (s = !1) } else d = jQuery(this).data("name"), c = jQuery(this).attr("id"), _ = jQuery(this).val(), s = !0; if (-1 == e.indexOf(d) && (e.push(d), t.push(c), a.push(_), i.push(n)), 1 == s && ("" != _ && (r = !0), divi_append_url(d, _)), jQuery(this).closest(".search_filter_cont").is(":hidden")) return divi_append_url(d, ""), !0 }) }), window.location.search.indexOf("?filter") > -1 && (window.location.search.indexOf("&page") > -1 || window.location.search.indexOf("&orderby") > -1) && (r = !0), 0 == r) { var o = document.location.href; newurl = o.replace("?filter=true", ""), window.history.replaceState(null, null, newurl) } show_hide_reset(), divi_filter_posts(e, t, a, i) } function divi_filter_posts(e, t, a, i) { var r = jQuery(".divi-filter-archive-loop.main-loop"), o = r.attr("data-layoutid"), l = r.attr("data-noresults"), s = r.attr("data-sortorder"), n = r.attr("data-orderbyvalue"), d = (r.attr("data-sorttype"), r.attr("data-sortasc")), c = r.attr("data-gridstyle"), _ = r.attr("data-columnscount"), p = r.attr("data-postnumber"), u = r.attr("data-loadmore"), f = r.attr("data-btntext"), h = r.attr("data-btntext_loading"), y = r.attr("data-resultcount"), m = r.attr("data-countposition"), v = r.attr("data-search"), j = (r.attr("data-sortchanged"), r.attr("data-include_category")), b = r.attr("data-include_tag"), Q = r.attr("data-exclude_category"), g = r.attr("data-hide_non_purchasable"), x = r.attr("data-show_hidden_prod"), w = r.attr("data-pagechanged"), k = (r.attr("data-current_category"), r.attr("data-current_custom_category"), r.attr("data-current_custom_category_terms"), r.attr("data-current_author"), r.attr("data-has-map")), C = r.attr("data-map-selector"), A = r.attr("data-map-marker-layout"), O = r.attr("data-current-page"), q = r.find(".divi-loadmore").attr("data-icon"), S = r.attr("data-link_wholegrid"), I = [], N = e.join(", "), T = t.join(", "), z = a.join(", "), L = i.join(", "), P = "", R = r.data("current-taxonomy"), D = r.data("current-taxterm"); r.find(".divi-filter-loop-container").length > 0 && (P = r.find(".no-results-layout").length > 0 ? r.find(".no-results-layout").data("classes") : r.find(".divi-filter-loop-container > ul").attr("class")), $num = 0; var J = []; jQuery(".divi-acf").each(function (e, t) { if (jQuery(this).closest(".search_filter_cont").is(":hidden")) return !0; var a = jQuery(this).data("name"), i = jQuery(this).val(), r = jQuery(this).attr("data-filtertype"), o = jQuery(this).closest(".et_pb_contact").find(".et_pb_contact_field").data("type"), l = jQuery(this).closest(".search_filter_cont").data("value-type"); if ("divi-checkboxsingle" == r || "divi-checkboxmulti" == r || "customcategory" == r) if (jQuery(this).is("select")) jQuery(this).closest(".search_filter_cont").hasClass("condition-field") && "has-child" == jQuery(this).find("option:selected").data("type") ? i = "" : "" != i && I.push({ fieldList: [{ name: a, val: i, type: "radio", acf_type: o, val_type: l }] }); else { var s = jQuery(this).closest(".et_pb_contact_field_options_list").find("input:checked"), n = []; s.each(function () { jQuery(this).closest(".search_filter_cont").hasClass("condition-field") && "has-child" == jQuery(this).data("type") || n.push(jQuery(this).val()) }), i = n.join(","), -1 == J.indexOf(a) && "" != i && I.push({ fieldList: [{ name: a, val: i, type: "radio", acf_type: o, val_type: l }] }) } else "rangeslider" == r ? "" != i && I.push({ fieldList: [{ name: a, val: i, type: "range", acf_type: o, val_type: l }] }) : "customtaxonomy" == r ? "" != i && I.push({ fieldList: [{ name: a, val: i, type: "customtaxonomy", acf_type: o, val_type: l }] }) : "acfselectmulitple" == r ? "" != i && I.push({ fieldList: [{ name: a, val: i, type: "acfselectmulitple", acf_type: o, val_type: l }] }) : "" != i && I.push({ fieldList: [{ name: a, val: i, type: "other", acf_type: o, val_type: l }] }); -1 == J.indexOf(a) && "" != i && J.push(a) }), void 0 !== v && "" != v && I.push({ fieldList: [{ name: "s", val: v, type: "search" }] }); var G = 1; "on" == u || ("true" == w ? (G = parseInt(O), r.removeAttr("data-pagechanged")) : divi_append_url("page", "")), r.removeAttr("data-sortchanged"); var E = jQuery(".divi-filter-archive-loop.main-loop").attr("data-filter-var"); return data = { action: "divi_filter_ajax_handler", layoutid: o, noresults: l, filter_item_name: N, filter_item_id: T, filter_item_val: z, filter_input_type: L, orderby_param: n, sortorder: s, sortasc: d, gridstyle: c, columnscount: _, postnumber: p, loadmore: u, loadmoretext: f, include_cats: j, include_tags: b, exclude_cats: Q, resultcount: y, countposition: m, loadmoretextloading: h, has_map: k, map_selector: C, marker_layout: A, current_page: G, query: E, loadmore_icon: q, link_wholegrid: S, hide_non_purchasable: g, show_hidden_prod: x, ul_classes: P, data_fields: I }, void 0 !== R && (data.current_loop_taxonomy = R), void 0 !== D && (data.current_loop_taxterm = D), "none" == o && (data.show_rating = r.attr("data-show_rating"), data.show_price = r.attr("data-show_price"), data.show_excerpt = r.attr("data-show_excerpt"), data.show_add_to_cart = r.attr("data-show_add_to_cart")), data.show_sort = r.attr("data-show_sort"), jQuery.ajax({ url: filter_ajax_object.ajax_url, data: data, type: "POST", beforeSend: function (e) { r.closest(".filtered-posts-cont").find(".filtered-posts-loading").prepend('<div class="ajax-loading"><div class="lines"><div class="line"></div><div class="line"></div><div class="line"></div></div><div class="spinner donut-cont"><div class="donut"></div></div><div class="spinner donutmulti-cont"><div class="donut multi"></div></div><div class="spinner ripple-cont"><div class="ripple"></div></div></div>'), jQuery(".divi-acf").attr("disabled", "disabled"), jQuery(".et_pb_de_mach_search_posts_item").animate({ opacity: .5 }, 250) }, success: function (e) { if (e) { var t; if (jQuery(".divi-acf").removeAttr("disabled"), jQuery(".et_pb_de_mach_search_posts_item").animate({ opacity: 1 }, 250), r.find(".loop-grid").length > 0 || r.find(".no-results-layout").length > 0) t = r.find(".no-results-layout").length > 0 ? r.find(".no-results-layout").parent() : r.find(".loop-grid").parent(), r.find(".loop-grid").remove(), r.find(".no-results-layout").remove(), t.append(e.posts); else r.find("ul.products").length > 0 && (r.find("ul.products").remove(), r.children().eq(0).html(e.posts)); r.find(".df-inner-styles").remove(), r.find(".df-loadmore-inner-styles").remove(), r.append(e.css_output), r.attr("data-current-page", e.loadmore_param.current_page), 1 == e.loadmore_param.current_page && r.attr("data-max-page", e.loadmore_param.max_num_pages), r.removeClass("has-result").removeClass("no-results-layout").addClass(e.filter_result), e.before_shop_loop && (jQuery(".filter-param-tags").prevAll().remove(), jQuery(".filter-param-tags").before(e.before_shop_loop)), void 0 !== e.after_shop_loop && (r.closest(".filtered-posts-cont").nextAll().remove(), r.closest(".filtered-posts-cont").after(e.after_shop_loop)), 1 == e.loadmore_param.current_page && r.attr("data-max-page", e.loadmore_param.max_num_pages), r.attr("data-filter-var", e.loadmore_param.post_var), "undefined" != typeof wc_add_to_cart_variation_params && jQuery(".variations_form").each(function () { jQuery(this).wc_variation_form() }), jQuery(".single_add_to_cart_button").addClass("ajax_add_to_cart"), "undefined" != typeof ajax_disabled_products_class && $("." + ajax_disabled_products_class + " .single_add_to_cart_button").removeClass("ajax_add_to_cart"), e.map_data && jQuery(C).length > 0 && jQuery(C).each(function () { var t = jQuery(this); t.find(".et_pb_map_pin").remove(), jQuery.each(e.map_data, function (e, a) { t.append('<div class="et_pb_map_pin" data-lat="' + a.lat + '" data-lng="' + a.lng + '" data-title="' + a.title + '"><div class="infowindow">' + a.infoview + "</div></div>") }), et_pb_map_init(t) }) } else r.html("No posts found."); r.closest(".filtered-posts-cont").find(".ajax-loading").remove(), "function" == typeof get_post_popup && get_post_popup(), show_filter_counts(); var a = jQuery("#divi_filter").attr("data-settings"); if (void 0 !== a) var i = JSON.parse(a), o = i.scrollto, l = i.scrollto_where, s = i.scrollto_section, n = i.scrollto_fine_tune; else o = "", l = "", s = "", n = ""; var d = jQuery(".divi-filter-archive-loop").attr("data-pagi_scrollto"), c = jQuery(".divi-filter-archive-loop").attr("data-pagi_scrollto_fine"); jQuery(".divi-filter-archive-loop").attr("data-loadmore"); "all" == l ? (breakpoint = "5000", min_breakpoint = "0") : "desktop" == l ? (breakpoint = "5000", min_breakpoint = "981") : "tab_mob" == l ? (breakpoint = "980", min_breakpoint = "0") : (breakpoint = "767", min_breakpoint = "0"), 1 == page_clicked ? ("on" == d && ($scrolltosection = jQuery(".divi-filter-archive-loop"), (n = c.replace("px", "")).match("^-") ? (n = n.replace("-", ""), scrollto_fine_tune_dis = parseInt(n), jQuery("html, body").animate({ scrollTop: $scrolltosection.offset().top - scrollto_fine_tune_dis }, 500)) : (scrollto_fine_tune_dis = parseInt(n), jQuery("html, body").animate({ scrollTop: $scrolltosection.offset().top + scrollto_fine_tune_dis }, 500))), page_clicked = !1) : "on" == o && jQuery(window).width() > min_breakpoint && jQuery(window).width() <= breakpoint && ($scrolltosection = jQuery("." + s), (n = n.replace("px", "")).match("^-") ? (n = n.replace("-", ""), scrollto_fine_tune_dis = parseInt(n), jQuery("html, body").animate({ scrollTop: $scrolltosection.offset().top - scrollto_fine_tune_dis }, 500)) : (scrollto_fine_tune_dis = parseInt(n), jQuery("html, body").animate({ scrollTop: $scrolltosection.offset().top + scrollto_fine_tune_dis }, 500))), jQuery(window).width() < 980 && jQuery(".et_pb_de_mach_filter_posts").hasClass("auto_close_filter_mobile") && jQuery("#divi_filter").slideToggle(), "function" == typeof resizeAllGridItems && (resizeAllGridItems(), setTimeout(function () { resizeAllGridItems() }, 500)) } }), !1 } function divi_remove_filters() { jQuery(".et_pb_contact_field_radio").removeClass("hidethis"), jQuery(".refine-filters > span").each(function () { var e = jQuery(this).attr("data-filter-name"), t = jQuery(this).attr("data-filter-val").split(","), a = {}; jQuery.each(t, function (e, t) { a.hasOwnProperty(t) ? a[t]++ : a[t] = 1 }), jQuery('input[data-name="' + e + '"]').each(function () { t.indexOf(jQuery(this).val()) > -1 || jQuery(this).closest(".et_pb_contact_field_radio").addClass("hidethis") }) }) } function show_hide_reset() { var e = !1; jQuery(".search_filter_cont").each(function () { switch (jQuery(this).find(".et_pb_contact_field").attr("data-type")) { case "select": "" != jQuery(this).find(".et_pb_contact_field select").eq(0).val() && (e = !0); break; case "checkbox": case "radio": jQuery(this).find(".et_pb_contact_field_options_list").find("input").each(function () { "" != jQuery(this).val() && jQuery(this).is(":checked") && (e = !0) }); break; case "range": var t = jQuery(this).find(".js-range-slider").data("ionRangeSlider"); void 0 !== t && (t.options.min == t.result.from && t.options.max == t.result.to || (e = !0)); break; case "input": jQuery(this).find(".et_pb_contact_field").find("input").each(function () { "" != jQuery(this).val() && (e = !0) }) } }), e ? jQuery("#divi_filter").find(".reset-filters").show() : jQuery("#divi_filter").find(".reset-filters").hide() } function handle_conditional_fields() { jQuery(".search_filter_cont[data-conditional-logic]").each(function () { var e = jQuery(this), t = e.data("conditional-logic"), a = e.data("conditional-relation"), r = !1, o = [], l = !1; if ("category" == e.data("type")) { var s, n = !1, d = !1; if (jQuery.each(t, function (e, t) { var a = jQuery("#" + t[0]); "category" == a.data("type") && (s = a, "is not" == t[1] && (d = !0), "is not empty" == t[1] && (n = !0)) }), "all" == a && 1 == d && 1 == n) { s.find(".et_pb_contact_field").data("type"); var c = null, _ = ""; switch (s.find(".et_pb_contact_field").data("type")) { case "select": c = s.find(".et_pb_contact_field select option:selected").eq(0).val(), _ = s.find(".et_pb_contact_field select option:selected").eq(0).data("type"); break; case "checkbox": case "radio": c = s.find("input:checked").eq(0).val(), _ = s.find("input:checked").eq(0).data("type") }if (l = !0, void 0 !== c && "" != c && "has-child" == _) { !0; var p = "off", u = ""; "radio" == e.data("field-type") && "on" == (p = e.find(".et_pb_contact_field_options_list").data("filter-count")) && (u = jQuery(".divi-filter-archive-loop.main-loop").attr("data-filter-var")), void 0 !== get_sub_cat_ajax && get_sub_cat_ajax.abort(); var f = { action: "divi_filter_get_sub_category_handler", top_category: c, field_type: e.data("field-type"), child_mode: e.data("child-mode"), hide_empty: e.data("hide-empty"), post_type: e.data("post-type"), select_placeholder: e.data("select-placeholder"), sub_prefix: e.data("sub-prefix"), show_available: e.data("show-available"), radio_all_hide: e.data("radio-all-hide"), radio_select: e.data("radio-select"), radio_style: e.data("radio-style"), radio_all_text: e.data("radio-all-text"), filter_count: p, query: u }; get_sub_cat_ajax = jQuery.ajax({ url: filter_ajax_object.ajax_url, data: f, type: "POST", beforeSend: function (e) { jQuery(".divi-acf").attr("disabled", "disabled"), jQuery(".et_pb_de_mach_search_posts_item").animate({ opacity: .5 }, 250) }, success: function (t) { "select" == e.data("field-type") ? e.find(".divi-filter-item").html(t) : e.find(".et_pb_contact_field_options_list").html(t), "" == t ? e.hide() : e.show(), jQuery(".divi-acf").removeAttr("disabled"), jQuery(".et_pb_de_mach_search_posts_item").animate({ opacity: 1 }, 250) } }) } else e.find(".divi-filter-item").html(""), e.find(".et_pb_contact_field_options_list").html(""), e.hide() } } jQuery.each(t, function (e, t) { var a = !1, r = jQuery("#" + t[0]); r.addClass("condition-field"); var l = r.find(".et_pb_contact_field").data("type"), s = null, n = t[2]; switch (l) { case "select": s = r.find(".et_pb_contact_field select").val(); break; case "checkbox": case "radio": s = [], r.find("input:checked").each(function () { s.push(jQuery(this).val()) }); break; case "range": var d = r.find(".js-range-slider").data("ionRangeSlider"); void 0 !== d && (s = [d.result.from, d.result.to]); break; case "input": s = r.find("input").val() }switch (t[1]) { case "is": a = Array.isArray(s) ? s.includes(n) : s == n; break; case "is not": a = Array.isArray(s) ? !s.includes(n) : s != n; break; case "is greater": if (jQuery.isNumeric(n)) if (Array.isArray(s)) for (i = 0; i < s.size; i++)jQuery.isNumeric(s[i]) && s[i] > n && (a = !0); else a = jQuery.isNumeric(s) && s > n; else a = !1; break; case "is less": if (jQuery.isNumeric(n)) if (Array.isArray(s)) for (i = 0; i < s.size; i++)jQuery.isNumeric(s[i]) && s[i] < n && (a = !0); else a = jQuery.isNumeric(s) && s < n; else a = !1; break; case "contains": if (Array.isArray(s)) for (i = 0; i < s.size; i++)-1 != s[i].indexOf(n) && (a = !0); else a = -1 != s.indexOf(n); break; case "does not contain": if (Array.isArray(s)) for (i = 0; i < s.length; i++)-1 == s[i].indexOf(n) && (a = !0); else a = -1 == s.indexOf(n); break; case "is empty": a = Array.isArray(s) ? 0 == s.length : "" == s; break; case "is not empty": a = Array.isArray(s) ? 0 != s.length : "" != s }o.push(a) }), "any" == a ? o.includes(!0) && (r = !0) : o.includes(!1) || (r = !0), 1 == r ? 0 == l && e.show() : e.hide() }) } function show_filter_counts() { var e = [], t = [], a = []; if (jQuery(".search_filter_cont").each(function () { if (jQuery(this).find('.et_pb_contact_field[data-filtertype="radio"]').length > 0) { var i = jQuery(this).find(".et_pb_contact_field_options_list"); if ("on" == i.attr("data-filter-count")) { e.push(i.attr("data-filter-option")); var r = i.attr("data-parent-cat"); void 0 !== r && !1 !== r ? a.push(r) : a.push(""), i.hasClass("dmach-checkboxmulti") ? t.push("multi") : t.push("single") } } }), e.length > 0) { var i = { action: "divi_filter_get_count_ajax_handler", query: jQuery(".divi-filter-archive-loop.main-loop").attr("data-filter-var"), filters: e.join(","), filter_types: t.join(","), filter_parents: a.join(",") }; jQuery.ajax({ url: filter_ajax_object.ajax_url, data: i, type: "POST", dataType: "JSON", success: function (e) { jQuery(".search_filter_cont").each(function () { if (jQuery(this).find('.et_pb_contact_field[data-filtertype="radio"]').length > 0) { var t = jQuery(this).find(".et_pb_contact_field_options_list"); if ("on" == t.attr("data-filter-count")) { var a = t.attr("data-filter-option"), i = t.data("show-empty"); t.find("span.et_pb_contact_field_radio").each(function () { var t = jQuery(this).find("label.radio-label").attr("data-value"); void 0 !== e[a][t] ? (jQuery(this).removeClass("empty"), "0" == e[a][t] && "on" != i && jQuery(this).addClass("empty"), jQuery(this).find("label.radio-count").length > 0 ? jQuery(this).find("label.radio-count").html(e[a][t]) : jQuery(this).append('<label class="radio-count">' + e[a][t] + "</label>")) : "on" != i && jQuery(this).addClass("empty") }) } } }) } }) } } jQuery(document).on("click", "a.page-numbers", function (e) { if (jQuery(".divi-filter-archive-loop.main-loop").length > 0 && "1" == filter_ajax_object.ajax_pagination) { e.preventDefault(), e.stopPropagation(), page_clicked = !0; var t = a = parseInt(jQuery(this).closest("ul").find(".current").text()); divi_append_url("page", t = jQuery(this).hasClass("next") ? a + 1 : jQuery(this).hasClass("prev") ? a - 1 : parseInt(jQuery(this).text())), jQuery(this).closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-current-page", t), jQuery(this).closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-pagechanged", "true"), divi_find_filters_to_filter() } else if (jQuery(".divi-filter-archive-loop.main-loop").length > 0) { e.preventDefault(), e.stopPropagation(); var a; t = a = parseInt(jQuery(this).closest("ul").find(".current").text()); divi_append_url("page", t = jQuery(this).hasClass("next") ? a + 1 : jQuery(this).hasClass("prev") ? a - 1 : parseInt(jQuery(this).text())), window.location.reload() } }), jQuery(document).on("change", ".orderby", function (e) { if (jQuery(".divi-filter-archive-loop.main-loop").length > 0 && "1" == filter_ajax_object.ajax_pagination) { e.preventDefault(), e.stopPropagation(); var t = jQuery(this).val(), a = "desc"; if ("price" == t && (a = "asc"), Array.isArray(t.split("-"))) { var i = t.split("-"); t = i[0], a = i[1] } divi_append_url("orderby", jQuery(this).val()), jQuery(this).closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-sortorder", t), jQuery(this).closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-sortasc", a), jQuery(this).closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-orderbyvalue", jQuery(this).val()), jQuery(this).closest(".et_pb_module").find(".divi-filter-archive-loop.main-loop").attr("data-pagechanged", "true"), divi_find_filters_to_filter() } else jQuery(this).closest("form").submit() }), jQuery(".radio-label").click(function () { var e = jQuery(this).attr("data-value"), t = jQuery(this).closest(".et_pb_contact_field_options_list"); t.find('input[type="radio"]').prop("checked", !1), t.find('input[value="' + e + '"]').trigger("click") }), jQuery(document).on("click", ".remove-filter", function () { var e = jQuery(this).closest(".filter-param-item").attr("data-filter"), t = jQuery(this).closest(".filter-param-item").attr("data-type"), a = jQuery(this).closest(".filter-param-item").attr("data-value"); jQuery(this).closest(".filter-param-item").text(); if ("radio" == t) jQuery('[name="' + e + '"]').closest(".divi-filter-item").hasClass("divi-checkboxmulti") ? jQuery('[name="' + e + '"]').parent().find('.radio-label[title="' + a + '"]').parent().find("input").prop("checked", !1) : (jQuery('.et_pb_contact_field_radio input[name="' + e + '"]').prop("checked", !1), jQuery('.et_pb_contact_field_radio input[name="' + e + '"][value=""]').prop("checked", !0)); else if ("range" == t) { var i = jQuery('.js-range-slider[data-name="' + e + '"]').data("ionRangeSlider"); i.options.from = i.options.min, i.options.to = i.options.max, i.reset() } else "select" == t && jQuery('.et_pb_contact_select[name="' + e + '"]').prop("selectedIndex", 0); jQuery(this).closest(".filter-param-item").remove(), divi_find_filters_to_filter() });
// source --> https://www.trinityboardsport.com/wp-content/plugins/divi-bodycommerce/includes/modules/divi-ajax-filter/includes/modules/FilterPosts/../../../js/masonry.min.js?ver=5.3.1 
function resizeGridItem(e) { grid = jQuery(e).closest(".loop-grid")[0], "undefined" != typeof grid && (rowHeight = parseInt(window.getComputedStyle(grid).getPropertyValue("grid-auto-rows")), rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue("grid-row-gap")), console.log("rowHeight: " + rowHeight), console.log("rowGap: " + rowGap), console.log("item" + e), rowSpan = Math.ceil((e.querySelector(".grid-item-cont").getBoundingClientRect().height + rowGap) / (rowHeight + rowGap)), e.style.gridRowEnd = "span " + rowSpan) } function resizeAllGridItems() { for (allItems = document.getElementsByClassName("grid-item"), x = 0; x < allItems.length; x++)resizeGridItem(allItems[x]) } function resizeInstance(e) { item = e.elements[0], resizeGridItem(item) } window.addEventListener("resize", resizeAllGridItems), jQuery(document).ready(function (e) { resizeAllGridItems(), e(".masonry").addClass("resized"), e(window).on("load", function () { resizeAllGridItems(), e(".masonry").addClass("resized") }) });
// source --> https://www.trinityboardsport.com/wp-content/plugins/pixelyoursite/dist/scripts/jquery.bind-first-0.2.3.min.js?ver=e93b348fc08d67d69ffd10ccb8d323a9 
/*
 * jQuery.bind-first library v0.2.3
 * Copyright (c) 2013 Vladimir Zhuravlev
 *
 * Released under MIT License
 * @license
 *
 * Date: Thu Feb  6 10:13:59 ICT 2014
 **/
(function(t){function e(e){return u?e.data("events"):t._data(e[0]).events}function n(t,n,r){var i=e(t),a=i[n];if(!u){var s=r?a.splice(a.delegateCount-1,1)[0]:a.pop();return a.splice(r?0:a.delegateCount||0,0,s),void 0}r?i.live.unshift(i.live.pop()):a.unshift(a.pop())}function r(e,r,i){var a=r.split(/\s+/);e.each(function(){for(var e=0;a.length>e;++e){var r=a[e].trim().match(/[^\.]+/i)[0];n(t(this),r,i)}})}function i(e){t.fn[e+"First"]=function(){var n=t.makeArray(arguments),i=n.shift();return i&&(t.fn[e].apply(this,arguments),r(this,i)),this}}var a=t.fn.jquery.split("."),s=parseInt(a[0]),f=parseInt(a[1]),u=1>s||1==s&&7>f;i("bind"),i("one"),t.fn.delegateFirst=function(){var e=t.makeArray(arguments),n=e[1];return n&&(e.splice(0,2),t.fn.delegate.apply(this,arguments),r(this,n,!0)),this},t.fn.liveFirst=function(){var e=t.makeArray(arguments);return e.unshift(this.selector),t.fn.delegateFirst.apply(t(document),e),this},u||(t.fn.onFirst=function(e,n){var i=t(this),a="string"==typeof n;if(t.fn.on.apply(i,arguments),"object"==typeof e)for(type in e)e.hasOwnProperty(type)&&r(i,type,a);else"string"==typeof e&&r(i,e,a);return i})})(jQuery);