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EAAkBzD,SAASE,iBAAT,WAA8BE,EAASG,GAAvC,iDACxBkD,MAAAA,OAAA,EAAAA,EAAiBC,SAAUD,EAAgBtD,SAAQ,SAAAwD,GAClDJ,EAAiBK,KAAKD,MAAAA,OAAtB,EAAsBA,EAAWE,kBAElCL,MAAAA,OAAA,EAAAA,EAAaE,SAAUF,EAAYrD,SAAQ,SAAA2D,GAC1CA,EAAMC,MAAMC,OAAZ,UAAwBC,KAAKC,IAAL,MAAAD,KAAYV,GAApC,SAIDlD,MAAAA,GAAAA,EAAU8D,gBAAgB,eAG1B,IAAMC,EAAWpE,SAASM,cAAT,WAA2BF,EAASG,GAApC,qBACjB,GAAI6D,EAAU,CACb,IAAQC,EAAW7D,KAAKC,MAAM2D,EAAS1D,QAAQ4D,QAAvCD,OAERvE,EAAEsE,GAAUG,WAAW,CACtBhD,UAAW,KACXiD,OAAQ,QACRrC,MAAO,OACPsC,SAAU,IACVT,OAAQ,OACRU,QAAS,EACTC,IAAKN,EACLO,YAAY,IAKdR,MAAAA,GAAAA,EAAUD,gBAAgB,qB","sources":["webpack://advanced-post-block/./src/script.js"],"sourcesContent":["const $ = jQuery;\r\nimport 'swiper/css/bundle'; // Swiper CSS\r\n\r\nimport './style.scss';\r\n\r\n// Advanced Posts\r\ndocument.addEventListener('DOMContentLoaded', () => {\r\n\tconst allApbPosts = document.querySelectorAll('.wp-block-ap-block-posts');\r\n\tallApbPosts.forEach(apbPosts => {\r\n\t\t// Slider\r\n\t\tconst sliderEl = document.querySelector(`#${apbPosts.id} .apbSliderPosts`);\r\n\t\tif (sliderEl) {\r\n\t\t\tconst { layout, columns, columnGap, sliderIsLoop, sliderIsTouchMove, sliderIsAutoplay, sliderSpeed, sliderEffect, sliderIsPageClickable, sliderIsPageDynamic } = JSON.parse(sliderEl.dataset.slider);\r\n\r\n\t\t\t'slider' === layout && new Swiper(sliderEl, {\r\n\t\t\t\t// Optional parameters\r\n\t\t\t\tdirection: 'horizontal',\r\n\t\t\t\tslidesPerView: columns?.mobile,\r\n\t\t\t\tbreakpoints: {\r\n\t\t\t\t\t// when window width is >= 576px\r\n\t\t\t\t\t576: { slidesPerView: columns?.tablet },\r\n\t\t\t\t\t// when window width is >= 768px\r\n\t\t\t\t\t768: { slidesPerView: columns?.desktop },\r\n\t\t\t\t},\r\n\t\t\t\tspaceBetween: columnGap,\r\n\t\t\t\tloop: sliderIsLoop,\r\n\t\t\t\tallowTouchMove: sliderIsTouchMove,\r\n\t\t\t\tgrabCursor: sliderIsTouchMove,\r\n\t\t\t\tautoplay: sliderIsAutoplay ? { delay: sliderSpeed * 1000 } : false,\r\n\t\t\t\tspeed: sliderSpeed * 1000,\r\n\t\t\t\teffect: sliderEffect,\r\n\t\t\t\tfadeEffect: { crossFade: true },\r\n\t\t\t\tcreativeEffect: {\r\n\t\t\t\t\tprev: {\r\n\t\t\t\t\t\tshadow: true,\r\n\t\t\t\t\t\ttranslate: ['-120%', 0, -500],\r\n\t\t\t\t\t},\r\n\t\t\t\t\tnext: {\r\n\t\t\t\t\t\tshadow: true,\r\n\t\t\t\t\t\ttranslate: ['120%', 0, -500],\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tallowSlideNext: true,\r\n\t\t\t\tallowSlidePrev: true,\r\n\t\t\t\tautoHeight: false,\r\n\t\t\t\tnotificationClass: null,\r\n\r\n\t\t\t\t// Controllers\r\n\t\t\t\tpagination: {\r\n\t\t\t\t\tel: '.swiper-pagination',\r\n\t\t\t\t\tclickable: sliderIsPageClickable,\r\n\t\t\t\t\tdynamicBullets: sliderIsPageDynamic\r\n\t\t\t\t},\r\n\t\t\t\tnavigation: {\r\n\t\t\t\t\tnextEl: '.swiper-button-next',\r\n\t\t\t\t\tprevEl: '.swiper-button-prev',\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst slideHeightArray = [];\r\n\t\tconst swiperSlide = document.querySelectorAll(`#${apbPosts.id} .apbSliderPosts .swiper-slide`);\r\n\t\tconst swiperSlideText = document.querySelectorAll(`#${apbPosts.id} .apbSliderPosts .swiper-slide .apbPostText`);\r\n\t\tswiperSlideText?.length && swiperSlideText.forEach(slideText => {\r\n\t\t\tslideHeightArray.push(slideText?.clientHeight);\r\n\t\t});\r\n\t\tswiperSlide?.length && swiperSlide.forEach(slide => {\r\n\t\t\tslide.style.height = `${Math.max(...slideHeightArray)}px`;\r\n\t\t});\r\n\r\n\t\t// Remove data slider attributes\r\n\t\tsliderEl?.removeAttribute('data-slider');\r\n\r\n\t\t// Ticker\r\n\t\tconst tickerEl = document.querySelector(`#${apbPosts.id} .apbTickerPosts`);\r\n\t\tif (tickerEl) {\r\n\t\t\tconst { rowGap } = JSON.parse(tickerEl.dataset.ticker);\r\n\r\n\t\t\t$(tickerEl).easyTicker({\r\n\t\t\t\tdirection: 'up',\r\n\t\t\t\teasing: 'swing',\r\n\t\t\t\tspeed: 'slow',\r\n\t\t\t\tinterval: 2000,\r\n\t\t\t\theight: 'auto',\r\n\t\t\t\tvisible: 3,\r\n\t\t\t\tgap: rowGap,\r\n\t\t\t\tmousePause: true\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Remove data ticker attributes\r\n\t\ttickerEl?.removeAttribute('data-ticker');\r\n\t});\r\n});\r\n\r\n// Custom Scripts\r\n// ; (function ($) {\r\n// $(document).ready(function () {\r\n// const scrollbarWidth = window.innerWidth - document.body.clientWidth;\r\n\r\n// $('.alignfull').css({\r\n// 'width': `calc(100vw - ${scrollbarWidth}px)`,\r\n// 'max-width': `calc(100vw - ${scrollbarWidth}px)`,\r\n// 'margin': `0 calc(-50vw + 50% + ${scrollbarWidth / 2}px)`\r\n// });\r\n// });\r\n// })(jQuery);"],"names":["$","jQuery","document","addEventListener","querySelectorAll","forEach","apbPosts","sliderEl","querySelector","id","JSON","parse","dataset","slider","layout","columns","columnGap","sliderIsLoop","sliderIsTouchMove","sliderIsAutoplay","sliderSpeed","sliderEffect","sliderIsPageClickable","sliderIsPageDynamic","Swiper","direction","slidesPerView","mobile","breakpoints","tablet","desktop","spaceBetween","loop","allowTouchMove","grabCursor","autoplay","delay","speed","effect","fadeEffect","crossFade","creativeEffect","prev","shadow","translate","next","allowSlideNext","allowSlidePrev","autoHeight","notificationClass","pagination","el","clickable","dynamicBullets","navigation","nextEl","prevEl","slideHeightArray","swiperSlide","swiperSlideText","length","slideText","push","clientHeight","slide","style","height","Math","max","removeAttribute","tickerEl","rowGap","ticker","easyTicker","easing","interval","visible","gap","mousePause"],"sourceRoot":""}