"use strict"; (function ($) { $("document").ready(function () { if (window.Swiper == null) { return; } const defaultConfig = { direction: "horizontal", slidesPerView: 4, spaceBetween: 30, }; const swiperConfig = window.brandyData?.blocks_data["core/post-template"]?.swiper; const backIcon = swiperConfig?.backIcon ?? window.brandyData?.swiper?.backIcon ?? ''; const nextIcon = swiperConfig?.nextIcon ?? window.brandyData?.swiper?.nextIcon ?? ''; $(document).ready(function () { $( ".brandy-block-query-slider:not(.block-editor-block-list__block)" ).addClass("swiper"); $( ".brandy-block-query-slider:not(.block-editor-block-list__block) .wp-block-post-template" ).addClass("swiper-wrapper"); $( ".brandy-block-query-slider:not(.block-editor-block-list__block) .wp-block-post-template > .post" ).addClass("swiper-slide"); $( ".brandy-block-query-slider:not(.block-editor-block-list__block)" ).prepend(`
`); $( ".brandy-block-query-slider:not(.block-editor-block-list__block)" ).append(` `); setTimeout(() => { new Swiper( ".brandy-block-query-slider:not(.block-editor-block-list__block)", { navigation: { nextEl: ".brandy-swiper-navigation-button--next", prevEl: ".brandy-swiper-navigation-button--back", }, scrollbar: { el: ".brandy-swiper-scrollbar", draggable: true, placement: "outside", snapOnRelease: true, }, grabCursor: true, ...defaultConfig, ...(swiperConfig?.data ?? {}), } ); }, 1); }); }); })(window.jQuery);