1/******/ (() => { // webpackBootstrap 2/******/ "use strict"; 3/******/ var __webpack_modules__ = ({ 4 5/***/ 2: 6/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 7 8__webpack_require__.r(__webpack_exports__); 9/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10/* harmony export */ csGetCookie: () => (/* binding */ csGetCookie), 11/* harmony export */ csSetCookie: () => (/* binding */ csSetCookie), 12/* harmony export */ csco: () => (/* binding */ csco), 13/* harmony export */ isInViewport: () => (/* binding */ isInViewport), 14/* harmony export */ slideDown: () => (/* binding */ slideDown), 15/* harmony export */ slideToggle: () => (/* binding */ slideToggle), 16/* harmony export */ slideUp: () => (/* binding */ slideUp) 17/* harmony export */ }); 18// Create csco object. 19var csco = { 20 addAction: function addAction(x, y, z) { 21 return; 22 } 23}; 24if ('undefined' !== typeof wp && 'undefined' !== typeof wp.hooks) { 25 csco.addAction = wp.hooks.addAction; 26} 27 28/** 29 * isInViewport 30 */ 31 32function isInViewport(element) { 33 var rect = element.getBoundingClientRect(); 34 var windowHeight = window.innerHeight || document.documentElement.clientHeight; 35 var windowWidth = window.innerWidth || document.documentElement.clientWidth; 36 return rect.top <= windowHeight && rect.top + rect.height >= 0 && rect.left <= windowWidth && rect.left + rect.width >= 0; 37} 38 39/** 40 * slideDown \ slideUp \ slideToggle 41 */ 42 43function slideDown(element) { 44 var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350; 45 element.style.display = 'block'; 46 element.style.overflow = 'hidden'; 47 var height = element.scrollHeight; 48 element.style.height = 0; 49 setTimeout(function () { 50 element.style.transition = "height ".concat(duration, "ms"); 51 element.style.height = height + 'px'; 52 element.addEventListener('transitionend', function te() { 53 element.removeEventListener('transitionend', te); 54 element.style.removeProperty('height'); 55 element.style.removeProperty('transition'); 56 element.style.removeProperty('overflow'); 57 }); 58 }, 0); 59} 60function slideUp(element) { 61 var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350; 62 element.style.height = element.offsetHeight + 'px'; 63 element.style.overflow = 'hidden'; 64 setTimeout(function () { 65 element.style.transition = "height ".concat(duration, "ms"); 66 element.style.height = '0'; 67 element.addEventListener('transitionend', function te() { 68 element.removeEventListener('transitionend', te); 69 if (element.style.height === '0px') { 70 element.style.display = 'none'; 71 } 72 element.style.removeProperty('height'); 73 element.style.removeProperty('transition'); 74 element.style.removeProperty('overflow'); 75 }); 76 }, 0); 77} 78function slideToggle(element) { 79 var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350; 80 if (window.getComputedStyle(element).display === 'none') { 81 return slideDown(element, duration); 82 } else { 83 return slideUp(element, duration); 84 } 85} 86 87/** 88 * Cookies 89 */ 90function csGetCookie(name) { 91 var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)")); 92 return matches ? decodeURIComponent(matches[1]) : undefined; 93} 94function csSetCookie(name, value) { 95 var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 96 props = { 97 path: '/' 98 }; 99 if (props.expires instanceof Date) { 100 props.expires = props.expires.toUTCString(); 101 } 102 var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value); 103 for (var optionKey in props) { 104 updatedCookie += "; " + optionKey; 105 var optionValue = props[optionKey]; 106 if (optionValue !== true) { 107 updatedCookie += "=" + optionValue; 108 } 109 } 110 document.cookie = updatedCookie; 111} 112 113 114/***/ }) 115 116/******/ }); 117/************************************************************************/ 118/******/ // The module cache 119/******/ var __webpack_module_cache__ = {}; 120/******/ 121/******/ // The require function 122/******/ function __webpack_require__(moduleId) { 123/******/ // Check if module is in cache 124/******/ var cachedModule = __webpack_module_cache__[moduleId]; 125/******/ if (cachedModule !== undefined) { 126/******/ return cachedModule.exports; 127/******/ } 128/******/ // Create a new module (and put it into the cache) 129/******/ var module = __webpack_module_cache__[moduleId] = { 130/******/ // no module.id needed 131/******/ // no module.loaded needed 132/******/ exports: {} 133/******/ }; 134/******/ 135/******/ // Execute the module function 136/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 137/******/ 138/******/ // Return the exports of the module 139/******/ return module.exports; 140/******/ } 141/******/ 142/************************************************************************/ 143/******/ /* webpack/runtime/define property getters */ 144/******/ (() => { 145/******/ // define getter functions for harmony exports 146/******/ __webpack_require__.d = (exports, definition) => { 147/******/ for(var key in definition) { 148/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 149/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 150/******/ } 151/******/ } 152/******/ }; 153/******/ })(); 154/******/ 155/******/ /* webpack/runtime/hasOwnProperty shorthand */ 156/******/ (() => { 157/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 158/******/ })(); 159/******/ 160/******/ /* webpack/runtime/make namespace object */ 161/******/ (() => { 162/******/ // define __esModule on exports 163/******/ __webpack_require__.r = (exports) => { 164/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 165/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 166/******/ } 167/******/ Object.defineProperty(exports, '__esModule', { value: true }); 168/******/ }; 169/******/ })(); 170/******/ 171/************************************************************************/ 172var __webpack_exports__ = {}; 173// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 174(() => { 175var __webpack_exports__ = {}; 176__webpack_require__.r(__webpack_exports__); 177/** ---------------------------------------------------------------------------- 178 * Comments Toggle */ 179 180(function () {
181 var commentsElement = document.querySelector('.cs-entry__comments'); 182 var headToggles = document.querySelectorAll('.cs-entry__header .cs-meta-comments'); 183 184 // Handle toggling comments visibility 185 document.addEventListener('click', function (e) { 186 if (e.target && e.target.classList.contains('cs-entry__comments-view-toggle')) { 187 e.preventDefault(); 188 var commentsWrap = e.target.closest('.cs-entry__wrap'); 189 var _commentsElement = commentsWrap.querySelector('.cs-entry__comments'); 190 _commentsElement.classList.toggle('cs-entry__comments-visible'); 191 } 192 }); 193 headToggles.forEach(function (headToggle) { 194 headToggle.addEventListener('click', function (e) { 195 e.preventDefault(); 196 commentsElement.classList.add('cs-entry__comments-visible'); 197 commentsElement.scrollIntoView({ 198 behavior: 'smooth' 199 }); 200 }); 201 }); 202 var scrollToHash = function scrollToHash() { 203 if (window.location.hash && window.location.hash !== "#") { 204 var target = document.querySelector(window.location.hash); 205 if (target && target === commentsElement) { 206 commentsElement.classList.add('cs-entry__comments-visible'); 207 } 208 } 209 }; 210 window.addEventListener('load', scrollToHash); 211 document.addEventListener('DOMContentLoaded', function () { 212 document.addEventListener('click', function (event) { 213 // Check if the clicked element is a reply link 214 var replyLink = event.target.closest('.comment-reply-link'); 215 if (replyLink) { 216 event.preventDefault(); 217 var commentsWrap = replyLink.closest('.cs-entry__wrap'); 218 var _commentsElement2 = commentsWrap.querySelector('.cs-entry__comments'); 219 220 // Ensure comments form visibility toggle is handled 221 if (_commentsElement2 && _commentsElement2.classList.contains('cs-entry__comments-form-visible')) { 222 _commentsElement2.classList.remove('cs-entry__comments-form-visible'); 223 } 224 var cancelLink = commentsWrap.querySelector('#cancel-comment-reply-link'); 225 var targetSpan = commentsWrap.querySelector('.form-submit .cs-cancel-reply-button'); 226 var commentBody = commentsWrap.querySelector('.comment-body'); 227 228 // Move the cancel link into the form's cancel button container 229 if (cancelLink && targetSpan) { 230 targetSpan.appendChild(cancelLink); 231 cancelLink.style.display = 'inline'; 232 } 233 234 // Show the reply form inside the current comment 235 if (commentBody) { 236 setTimeout(function () { 237 var commentRespond = commentBody.querySelector('.comment-respond'); 238 if (commentRespond) { 239 commentRespond.style.display = 'block'; 240 } 241 }, 50); 242 } 243 } 244 }); 245 }); 246})(); 247})(); 248 249// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 250(() => { 251var __webpack_exports__ = {}; 252__webpack_require__.r(__webpack_exports__); 253/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 254/** ---------------------------------------------------------------------------- 255 * Footer Nav Menu */ 256 257 258(function () { 259 HTMLElement.prototype.responsiveNav = function () { 260 this.classList.remove('menu-item-expanded'); 261 var previousElement = this.previousElementSibling; 262 if (previousElement && previousElement.classList.contains('submenu-visible')) { 263 previousElement.classList.remove('submenu-visible'); 264 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(previousElement); 265 this.parentElement.classList.remove('menu-item-expanded'); 266 } else { 267 var parentOfParent = this.parentElement.parentElement; 268 parentOfParent.querySelectorAll('.menu-item .sub-menu').forEach(function (subMenu) { 269 subMenu.classList.remove('submenu-visible'); 270 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(subMenu); 271 }); 272 parentOfParent.querySelectorAll('.menu-item-expanded').forEach(function (item) { 273 item.classList.remove('menu-item-expanded'); 274 }); 275 if (previousElement) { 276 previousElement.classList.toggle('submenu-visible'); 277 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideToggle)(previousElement); 278 } 279 this.parentElement.classList.toggle('menu-item-expanded'); 280 } 281 }; 282 document.addEventListener('DOMContentLoaded', function () { 283 var menuItems = document.querySelectorAll('.cs-footer__nav .menu-item-has-children');
284 menuItems.forEach(function (menuItem) { 285 var span = document.createElement('span'); 286 menuItem.appendChild(span); 287 span.addEventListener('click', function (e) { 288 e.preventDefault(); 289 this.responsiveNav(); 290 }); 291 }); 292 }); 293})(); 294})(); 295 296// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 297(() => { 298var __webpack_exports__ = {}; 299__webpack_require__.r(__webpack_exports__); 300/** ---------------------------------------------------------------------------- 301 * Header Scroll Scheme */ 302 303document.addEventListener('DOMContentLoaded', function () { 304 var transitionTimer; 305 document.addEventListener('nav-stick', function (event) { 306 if (document.body.classList.contains('cs-display-header-overlay')) { 307 var headerSmart = document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'); 308 var headerAlt = headerSmart.querySelector('.cs-container'); 309 headerAlt.classList.add("cs-header-elements-no-transition"); 310 clearTimeout(transitionTimer); 311 transitionTimer = setTimeout(function () { 312 headerAlt.classList.remove("cs-header-elements-no-transition"); 313 }, 300); 314 } 315 }); 316 document.addEventListener('nav-unstick', function (event) { 317 if (document.body.classList.contains('cs-display-header-overlay')) { 318 var headerSmart = document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'); 319 var headerAlt = headerSmart.querySelector('.cs-container'); 320 headerAlt.classList.add("cs-header-elements-no-transition"); 321 clearTimeout(transitionTimer); 322 transitionTimer = setTimeout(function () { 323 headerAlt.classList.remove("cs-header-elements-no-transition"); 324 }, 300); 325 } 326 }); 327}); 328})(); 329 330// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 331(() => { 332var __webpack_exports__ = {}; 333__webpack_require__.r(__webpack_exports__); 334/** ---------------------------------------------------------------------------- 335 * Header Smart Streatch */ 336 337document.addEventListener('DOMContentLoaded', function () { 338 document.addEventListener('header-smart-stretch-scroll-sticky-scroll-init', function (event) { 339 var headerParams = event.detail; 340 window.addEventListener('scroll', function () { 341 var scrolled = window.scrollY; 342 var headerSmart = document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'); 343 headerParams.headerSmartPosition = headerSmart ? headerSmart.offsetTop : 0; 344 if (scrolled > headerParams.smartStart + headerParams.scrollPoint + 10 && scrolled > headerParams.scrollPrev) { 345 if (scrolled > headerParams.smartStart + headerParams.headerLargeHeight + 200) { 346 document.dispatchEvent(new CustomEvent('sticky-nav-hide', { 347 detail: headerParams 348 })); 349 } 350 } else { 351 if (headerParams.scrollUpAmount >= headerParams.scrollPoint || scrolled === 0) { 352 document.dispatchEvent(new CustomEvent('sticky-nav-visible', { 353 detail: headerParams 354 })); 355 } 356 } 357 if (scrolled > headerParams.smartStart + headerParams.headerLargeHeight) { 358 document.dispatchEvent(new CustomEvent('nav-stick', { 359 detail: headerParams 360 })); 361 } else if (headerParams.headerSmartPosition <= headerParams.smartStart) { 362 document.dispatchEvent(new CustomEvent('nav-unstick', { 363 detail: headerParams 364 })); 365 } 366 if (scrolled < headerParams.scrollPrev) { 367 headerParams.scrollUpAmount += headerParams.scrollPrev - scrolled; 368 } else { 369 headerParams.scrollUpAmount = 0; 370 } 371 var wpAdminBar = document.querySelector('#wpadminbar'); 372 if (wpAdminBar && window.innerWidth <= 600 && scrolled >= headerParams.wpAdminBarHeight) { 373 document.dispatchEvent(new CustomEvent('adminbar-mobile-scrolled', { 374 detail: headerParams 375 })); 376 } else { 377 document.dispatchEvent(new CustomEvent('adminbar-mobile-no-scrolled', { 378 detail: headerParams 379 })); 380 } 381 headerParams.scrollPrev = scrolled; 382 }); 383 }); 384}); 385})(); 386 387// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 388(() => { 389var __webpack_exports__ = {}; 390__webpack_require__.r(__webpack_exports__); 391/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 392/** ---------------------------------------------------------------------------- 393 * Hero */ 394 395 396(function () { 397 var section = 'cs-hero-type-2'; 398 var sliders = document.querySelectorAll(".".concat(section, "__slider")); 399 if (sliders.length === 0) { 400 return; 401 } 402 var executed = false;
403 var isMouseOnControl = false; // Track if the mouse is on the controls (next/prev/pagination) 404 var isMouseOnSlider = false; // Track if the mouse is on the slider 405 var isSliderVisible = true; // Track if the slider is fully visible on the screen 406 407 var initHero = function initHero() { 408 if (!executed && (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.isInViewport)(sliders[0])) { 409 executed = true; 410 var head = document.getElementsByTagName('head')[0]; 411 var script = document.createElement('script'); 412 script.type = 'text/javascript'; 413 script.src = 'https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js'; 414 script.onload = function () { 415 function setParallaxAttributes(element, duration) { 416 element.setAttribute('data-swiper-parallax-x', '-400'); 417 element.setAttribute('data-swiper-parallax-duration', duration); 418 } 419 sliders.forEach(function (slider) { 420 // Section data 421 var autoplayValue = slider.getAttribute('data-cs-autoplay'); 422 var autoplayDelayValue = slider.getAttribute('data-cs-autoplay-delay'); 423 var parallaxValue = slider.getAttribute('data-cs-parallax'); 424 var gapValue = slider.getAttribute('data-cs-gap'); 425 var postContentContainer = '.cs-entry__content'; 426 // Data manipulation 427 var autoplayDelay = !isNaN(parseInt(autoplayDelayValue)) ? parseInt(autoplayDelayValue) : 5000; 428 var autoplay = autoplayValue ? { 429 delay: autoplayDelay, 430 disableOnInteraction: false, 431 pauseOnMouseEnter: true 432 } : false; 433 var parallax = !!parallaxValue ? true : false; 434 var gap = !isNaN(parseInt(gapValue)) ? parseInt(gapValue) : 0; 435 var postContents = slider.querySelectorAll(postContentContainer); 436 if (parallax) { 437 if (postContents.length > 0) { 438 postContents.forEach(function (postContent) { 439 setParallaxAttributes(postContent, '800'); 440 }); 441 } 442 } 443 // Swiper settings 444 var wrapperClass = "".concat(section, "__wrapper"); 445 var slideClass = "".concat(section, "__item"); 446 var prevEl = slider.querySelector(".".concat(section, "__button-prev")); 447 var nextEl = slider.querySelector(".".concat(section, "__button-next")); 448 var paginationContainer = slider.querySelector(".".concat(section, "__pagination")); 449 var bulletClass = "".concat(section, "__pagination-bullet"); 450 var bulletClassActive = "".concat(section, "__pagination-bullet-active"); 451 var swiper = new Swiper(slider, { 452 scrollbar: false, 453 wrapperClass: wrapperClass, 454 slideClass: slideClass, 455 direction: 'horizontal', 456 loop: true, 457 speed: 800, 458 parallax: parallax, 459 autoplay: autoplay, 460 slidesPerView: 1, 461 spaceBetween: gap, 462 a11y: { 463 slideRole: 'article', 464 slideLabelMessage: 'Slide {{index}} of {{slidesLength}}' 465 }, 466 pagination: { 467 el: paginationContainer, 468 clickable: true, 469 bulletElement: 'span', 470 bulletClass: bulletClass, 471 bulletActiveClass: bulletClassActive 472 }, 473 navigation: { 474 nextEl: nextEl, 475 prevEl: prevEl 476 }, 477 on: { 478 init: function init() { 479 var _this = this; 480 setTimeout(function () { 481 var initialSlide = _this.slides[_this.activeIndex]; 482 if (initialSlide) { 483 var initialContent = initialSlide.querySelector(postContentContainer); 484 if (initialContent) { 485 initialContent.style.transform = 'none'; 486 } 487 } 488 }, 100); 489 }, 490 slideChange: function slideChange() { 491 var currentSlide = this.slides[this.activeIndex];
492 postContents.forEach(function (postContent) { 493 if (postContent === currentSlide.querySelector(postContentContainer)) { 494 postContent.style.transform = 'none'; 495 } 496 }); 497 } 498 } 499 }); 500 if (autoplayValue) { 501 var controls = [nextEl, prevEl, paginationContainer]; 502 controls.forEach(function (control) { 503 if (control) { 504 control.addEventListener('mouseenter', function () { 505 swiper.autoplay.stop(); 506 swiper.el.classList.add('swiper-paused'); 507 isMouseOnControl = true; // Track if mouse is on a control 508 509 // Pause button animation 510 if (nextEl) { 511 nextEl.style.animationPlayState = "paused"; 512 } 513 if (prevEl) { 514 prevEl.style.animationPlayState = "paused"; 515 } 516 }); 517 control.addEventListener('mouseleave', function () { 518 isMouseOnControl = false; // Mouse is no longer on a control 519 520 // Resume autoplay and remove 'swiper-paused' class if mouse is not on the slider 521 if (!isMouseOnSlider && isSliderVisible) { 522 swiper.autoplay.start(); 523 swiper.el.classList.remove('swiper-paused'); 524 } 525 526 // Resume button animation 527 if (nextEl) { 528 nextEl.style.animationPlayState = "running"; 529 } 530 if (prevEl) { 531 prevEl.style.animationPlayState = "running"; 532 } 533 }); 534 control.addEventListener('click', function () { 535 swiper.autoplay.stop(); 536 swiper.el.classList.add('swiper-paused'); 537 538 // Pause button animation on click 539 if (nextEl) { 540 nextEl.style.animationPlayState = "paused"; 541 } 542 if (prevEl) { 543 prevEl.style.animationPlayState = "paused"; 544 } 545 }); 546 } 547 }); 548 slider.addEventListener('mouseenter', function () { 549 isMouseOnSlider = true; 550 swiper.autoplay.stop(); 551 swiper.el.classList.add('swiper-paused'); 552 }); 553 slider.addEventListener('mouseleave', function () { 554 isMouseOnSlider = false;
555 if (!isMouseOnControl && isSliderVisible) { 556 swiper.autoplay.start(); 557 swiper.el.classList.remove('swiper-paused'); 558 } 559 }); 560 var observer = new IntersectionObserver(function (entries) { 561 entries.forEach(function (entry) { 562 if (entry.isIntersecting) { 563 isSliderVisible = true; 564 if (!isMouseOnControl && !isMouseOnSlider) { 565 swiper.autoplay.start(); 566 swiper.el.classList.remove('swiper-paused'); 567 } 568 } else { 569 isSliderVisible = false; 570 swiper.autoplay.stop(); 571 swiper.el.classList.add('swiper-paused'); 572 } 573 }); 574 }, { 575 threshold: 0.50 576 }); 577 observer.observe(slider); 578 } 579 }); 580 }; 581 head.appendChild(script); 582 } 583 }; 584 document.addEventListener('DOMContentLoaded', function () { 585 initHero(); 586 }); 587 window.addEventListener('resize', function () { 588 initHero(); 589 }); 590 window.addEventListener('scroll', function () { 591 initHero(); 592 }); 593})(); 594})(); 595 596// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 597(() => { 598var __webpack_exports__ = {}; 599__webpack_require__.r(__webpack_exports__); 600/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 601/** ---------------------------------------------------------------------------- 602 * Latest Posts Widget */ 603 604 605(function () { 606 var section = 'cs-latest-posts-slider'; 607 var sliders = document.querySelectorAll(".".concat(section, " .is-style-cs-tile-layout")); 608 if (sliders.length === 0) { 609 return; 610 } 611 var executed = false; 612 var initLatestPosts = function initLatestPosts() { 613 if (!executed && (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.isInViewport)(sliders[0])) { 614 executed = true; 615 var head = document.getElementsByTagName('head')[0]; 616 var script = document.createElement('script'); 617 script.type = 'text/javascript'; 618 script.src = 'https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js'; 619 script.onload = function () { 620 sliders.forEach(function (slider) { 621 // Swiper settings 622 var wrapperClass = "".concat(section, "__wrapper"); 623 var slideClass = "".concat(section, "__item"); 624 var prevEl = slider.querySelector(".".concat(section, "__button-prev")); 625 var nextEl = slider.querySelector(".".concat(section, "__button-next")); 626 var paginationContainer = document.querySelector(".cs-latest-posts-slider__pagination"); 627 var bulletClass = "".concat(section, "__pagination-bullet"); 628 var bulletClassActive = "".concat(section, "__pagination-bullet-active"); 629 new Swiper(slider, { 630 scrollbar: false, 631 wrapperClass: wrapperClass, 632 slideClass: slideClass, 633 direction: 'horizontal', 634 loop: true, 635 speed: 800, 636 parallax: false, 637 autoplay: false, 638 slidesPerView: 1, 639 a11y: { 640 slideRole: 'article', 641 slideLabelMessage: 'Slide {{index}} of {{slidesLength}}' 642 }, 643 pagination: { 644 el: paginationContainer, 645 clickable: true, 646 bulletElement: 'span', 647 bulletClass: bulletClass, 648 bulletActiveClass: bulletClassActive 649 }, 650 navigation: { 651 nextEl: nextEl, 652 prevEl: prevEl 653 } 654 }); 655 }); 656 }; 657 head.appendChild(script); 658 } 659 }; 660 document.addEventListener('DOMContentLoaded', function () { 661 initLatestPosts(); 662 }); 663 window.addEventListener('resize', function () { 664 initLatestPosts(); 665 }); 666 window.addEventListener('scroll', function () { 667 initLatestPosts(); 668 }); 669})(); 670})(); 671 672// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 673(() => { 674var __webpack_exports__ = {}; 675__webpack_require__.r(__webpack_exports__); 676/** 677 * AJAX Load More. 678 * 679 * Contains functions for AJAX Load More. 680 */ 681 682if (typeof window.load_more_query === 'undefined') { 683 window.load_more_query = []; 684} 685 686// Get next posts 687function csco_ajax_get_posts(object) { 688 var container = object.closest('.cs-posts-area'); 689 var settings = JSON.parse(object.dataset.settings); 690 var page = parseInt(object.dataset.page); 691 object.dataset.loading = true; 692 693 // Set button text to Load More. 694 object.textContent = settings.translation.loading; 695 var data = { 696 action: 'csco_ajax_load_more', 697 page: page, 698 posts_per_page: settings.posts_per_page, 699 query_data: settings.query_data, 700 attributes: settings.attributes, 701 options: settings.options, 702 _ajax_nonce: settings.nonce 703 }; 704 705 // Request Url. 706 var csco_pagination_url = settings.type === 'ajax_restapi' ? settings.rest_url : settings.url; 707 function encodeFormData(data) { 708 return Object.keys(data).map(function (key) { 709 return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]); 710 }).join('&'); 711 } 712 fetch(csco_pagination_url, { 713 method: 'POST', 714 body: encodeFormData(data), 715 headers: { 716 'Content-Type': 'application/x-www-form-urlencoded' 717 } 718 }).then(function (response) { 719 return response.json(); 720 }).then(function (res) { 721 if (res.success) { 722 var dataContent = document.createElement('div'); 723 dataContent.innerHTML = res.data.content; 724 if (dataContent.children.length) { 725 // WP Post Load trigger. This might need more logic for your specific use-case. 726 document.body.dispatchEvent(new Event('post-load')); 727 728 // Reinit Facebook widgets. 729 if (document.querySelector('#fb-root') && typeof FB !== 'undefined') { 730 FB.XFBML.parse(); 731 } 732 733 // Set button text to Load More. 734 object.textContent = settings.translation.load_more; 735 736 // Increment a page. 737 page += 1; 738 object.dataset.page = page.toString(); 739 740 // Reset the loading state. 741 object.dataset.loading = "false"; 742 743 // Append new content to the container 744 var mainContainer = container.querySelector('.cs-posts-area__main'); 745 while (dataContent.firstChild) { 746 mainContainer.appendChild(dataContent.firstChild); 747 } 748 } 749 750 // Remove Button on Posts End. 751 if (res.data.posts_end) { 752 // Remove Load More button. 753 object.parentNode.removeChild(object); 754 } 755 } 756 })["catch"](function (error) { 757 console.error('Error fetching posts:', error); 758 }); 759} 760function csco_load_more_init(infinite) { 761 var areas = document.querySelectorAll('.cs-posts-area'); 762 areas.forEach(function (area) { 763 if (area.dataset.init) { 764 return; 765 } 766 var csco_ajax_settings; 767 var archive_data = area.dataset.postsArea; 768 if (archive_data) { 769 csco_ajax_settings = JSON.parse(window.atob(archive_data)); 770 } else if (typeof csco_ajax_pagination !== 'undefined' && typeof archive_data === 'undefined') { 771 csco_ajax_settings = csco_ajax_pagination; 772 } 773 if (csco_ajax_settings) { 774 if (!infinite && csco_ajax_settings.infinite_load) { 775 return; 776 } 777 var pagination = document.createElement('div'); 778 pagination.className = 'cs-posts-area__pagination'; 779 var btn = document.createElement('button'); 780 btn.className = 'cs-load-more'; 781 btn.textContent = csco_ajax_settings.translation.load_more; 782 pagination.appendChild(btn); 783 area.appendChild(pagination); 784 btn.dataset.settings = JSON.stringify(csco_ajax_settings); 785 btn.dataset.page = '2'; 786 btn.dataset.loading = "false"; 787 btn.dataset.scrollHandling = JSON.stringify({ 788 allow: JSON.parse(csco_ajax_settings.infinite_load), 789 delay: 400 790 }); 791 } 792 area.dataset.init = true; 793 }); 794} 795csco_load_more_init(true); 796 797// Elementor Init 798window.addEventListener('elementor/frontend/init', function () { 799 csco_load_more_init(true); 800}); 801 802// On Scroll Event. 803window.addEventListener('scroll', function () { 804 var buttons = document.querySelectorAll('.cs-posts-area .cs-load-more'); 805 buttons.forEach(function (btn) { 806 var loading = btn.dataset.loading === "true"; 807 var scrollHandling = JSON.parse(btn.dataset.scrollHandling || '{}'); 808 if (loading || !scrollHandling.allow) { 809 return; 810 } 811 scrollHandling.allow = false;
812 btn.dataset.scrollHandling = JSON.stringify(scrollHandling); 813 setTimeout(function () { 814 scrollHandling.allow = true; 815 btn.dataset.scrollHandling = JSON.stringify(scrollHandling); 816 }, scrollHandling.delay); 817 var offset = btn.getBoundingClientRect().top - window.innerHeight; 818 if (offset < 4000) { 819 csco_ajax_get_posts(btn); 820 } 821 }); 822}); 823 824// On Click Event. 825document.body.addEventListener('click', function (event) { 826 if (event.target.classList.contains('cs-load-more')) { 827 var loading = event.target.dataset.loading === "true"; 828 if (!loading) { 829 csco_ajax_get_posts(event.target); 830 } 831 } 832}); 833})(); 834 835// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 836(() => { 837var __webpack_exports__ = {}; 838__webpack_require__.r(__webpack_exports__); 839function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 840// Check if Load Nextpost is defined by the wp_localize_script 841if (typeof csco_ajax_nextpost !== 'undefined') { 842 var objNextparent = document.querySelector('.cs-site-primary > .cs-site-content'); 843 var objNextsect = '.cs-nextpost-section'; 844 var objNextpost = null; 845 var currentNTitle = document.title; 846 var currentNLink = window.location.href; 847 var loadingNextpost = false; 848 var scrollNextpost = { 849 allow: true, 850 reallow: function reallow() { 851 scrollNextpost.allow = true; 852 }, 853 delay: 400 //(milliseconds) adjust to the highest acceptable value 854 }; 855 856 // Init. 857 if (csco_ajax_nextpost.next_post) { 858 objNextparent.insertAdjacentHTML('afterend', '<div class="cs-nextpost-inner"></div>'); 859 objNextpost = document.querySelector('.cs-nextpost-inner'); 860 } 861 862 // Remove previous & next post elements from the Floating Header. 863 var floatingHeader = document.querySelector('.cs-floating-header__content'); 864 if (floatingHeader) { 865 var nextElement = floatingHeader.querySelector('.cs-floating-header__next'); 866 if (nextElement) { 867 nextElement.remove(); 868 } 869 var prevElement = floatingHeader.querySelector('.cs-floating-header__prev'); 870 if (prevElement) { 871 prevElement.remove(); 872 } 873 var currentElement = floatingHeader.querySelector('.cs-floating-header__current'); 874 if (currentElement) { 875 currentElement.classList.add('fullwidth'); 876 } 877 } 878} 879 880/** 881 * Update Floating Header 882 */ 883function updateFloatingHeader(title) { 884 var floatingHeader = document.querySelector('.cs-floating-header__content'); 885 if (floatingHeader && title) { 886 var currentPostTitle = floatingHeader.querySelector('.cs-floating-header__current span'); 887 if (currentPostTitle) { 888 currentPostTitle.textContent = title || ''; // Fallback to empty string if title is missing 889 } 890 } 891} 892 893/** 894 * Get next post 895 */ 896function csco_ajax_get_nextpost() { 897 loadingNextpost = true; 898 899 // Set class loading. 900 var data = { 901 action: 'csco_ajax_load_nextpost', 902 not_in: csco_ajax_nextpost.not_in, 903 current_user: csco_ajax_nextpost.current_user, 904 nonce: csco_ajax_nextpost.nonce, 905 next_post: csco_ajax_nextpost.next_post 906 }; 907 908 // Request Url. 909 var csco_ajax_nextpost_url; 910 if ('ajax_restapi' === csco_ajax_nextpost.type) { 911 csco_ajax_nextpost_url = csco_ajax_nextpost.rest_url; 912 } else { 913 csco_ajax_nextpost_url = csco_ajax_nextpost.url; 914 } 915 function encodeFormData(data) { 916 return Object.keys(data).map(function (key) { 917 return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]); 918 }).join('&'); 919 } 920 921 // Send Request. 922 fetch(csco_ajax_nextpost_url, { 923 method: 'POST', 924 body: encodeFormData(data), 925 headers: { 926 'Content-Type': 'application/x-www-form-urlencoded' 927 } 928 }).then(function (response) { 929 return response.json(); 930 }).then(function (res) { 931 csco_ajax_nextpost.next_post = false; 932 if (res.success) { 933 // Get the posts. 934 var tempDiv = document.createElement('div'); 935 tempDiv.innerHTML = res.data.content; 936 var newPosts = Array.from(tempDiv.children); 937 938 // Check if there're any posts. 939 if (newPosts.length) { 940 // Set the loading state. 941 loadingNextpost = false;
942 943 // Set not_in. 944 csco_ajax_nextpost.not_in = res.data.not_in; 945 946 // Set next data. 947 csco_ajax_nextpost.next_post = res.data.next_post; 948 949 // Remove loader. 950 var loadingElement = objNextpost.nextElementSibling; 951 if (loadingElement && loadingElement.classList.contains('cs-nextpost-loading')) { 952 loadingElement.remove(); 953 } 954 955 // Append new post. 956 newPosts.forEach(function (post) { 957 return objNextpost.appendChild(post.cloneNode(true)); 958 }); 959 960 // Update Floating Header with the new title. 961 if (objNextpost.children.length === newPosts.length) { 962 updateFloatingHeader(res.data.title || ''); 963 } 964 if (document.getElementById('fb-root') && (typeof FB === "undefined" ? "undefined" : _typeof(FB)) === 'object') { 965 FB.XFBML.parse(); 966 } 967 document.body.dispatchEvent(new Event('post-load')); 968 } 969 } else { 970 // console.log(res); 971 } 972 })["catch"](function (error) { 973 // console.log(error); 974 }); 975} 976 977/** 978 * Check if Load Nextpost is defined by the wp_localize_script 979 */ 980if (typeof csco_ajax_nextpost !== 'undefined') { 981 // On Scroll Event. 982 window.addEventListener('scroll', function () { 983 var scrollTop = window.scrollY || window.pageYOffset; 984 985 // Init nextpost. 986 if (csco_ajax_nextpost.next_post) { 987 if (objNextpost && !loadingNextpost && scrollNextpost.allow) { 988 scrollNextpost.allow = false; 989 setTimeout(scrollNextpost.reallow, scrollNextpost.delay); 990 // Calc current offset. 991 var offset = objNextpost.offsetTop + objNextpost.offsetHeight - scrollTop; 992 // Load nextpost. 993 if (4000 > offset) { 994 objNextpost.insertAdjacentHTML('afterend', '<div class="cs-nextpost-loading"></div>'); 995 csco_ajax_get_nextpost(); 996 } 997 } 998 } 999 1000 // Reset browser data link. 1001 var objFirst = document.querySelector(objNextsect + ':first-child'); 1002 if (objFirst) { 1003 var firstTop = objFirst.offsetTop; 1004 // If there has been a change. 1005 if (scrollTop < firstTop && window.location.href !== currentNLink) { 1006 document.title = currentNTitle; 1007 history.pushState(null, currentNTitle, currentNLink); 1008 updateFloatingHeader(currentNTitle); // Update header when scrolling back to the top 1009 } 1010 } 1011 1012 // Set browser data link. 1013 document.querySelectorAll(objNextsect).forEach(function (elem) { 1014 var elemTop = elem.offsetTop; 1015 var elemHeight = elem.offsetHeight; 1016 if (scrollTop > elemTop && scrollTop < elemTop + elemHeight) { 1017 // If there has been a change. 1018 if (window.location.href !== elem.dataset.url) { 1019 // New title. 1020 document.title = elem.dataset.title; 1021 // New link. 1022 history.pushState(null, elem.dataset.title, elem.dataset.url); 1023 1024 // Update Floating Header with the new title. 1025 updateFloatingHeader(elem.dataset.title); 1026 1027 // Google Analytics. 1028 if (typeof gtag === 'function' && _typeof(window.gaData) === 'object') { 1029 var trackingId = Object.keys(window.gaData)[0]; 1030 if (trackingId) { 1031 gtag('config', trackingId, { 1032 'page_title': elem.dataset.title, 1033 'page_location': elem.dataset.url 1034 }); 1035 gtag('event', 'page_view', { 1036 'send_to': trackingId 1037 }); 1038 } 1039 } 1040 } 1041 } 1042 }); 1043 }); 1044} 1045})(); 1046 1047// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1048(() => { 1049var __webpack_exports__ = {}; 1050__webpack_require__.r(__webpack_exports__); 1051/** ---------------------------------------------------------------------------- 1052 * Metabar */ 1053 1054(function () { 1055 var ticking = false; 1056 var update = function update() { 1057 document.querySelectorAll('.cs-site-content .cs-content-area').forEach(function (mainContent) { 1058 var content = mainContent.querySelector('.entry-content'); 1059 if (!content) { 1060 return; 1061 } 1062 var sidebar = mainContent.querySelector('.post-sidebar-inner'); 1063 if (!sidebar) { 1064 return; 1065 } 1066 var offsetTop = 20; 1067 var offsetBottom = -20; 1068 var elements = ['.alignfull', '.alignwide']; 1069 var layouts = Array.from(content.querySelectorAll(elements.join(','))); 1070 if (!sidebar || layouts.length === 0) { 1071 return; 1072 } 1073 var disabled = false;
1074 var sidebarTop = sidebar.getBoundingClientRect().top + window.scrollY; 1075 var sidebarHeight = sidebar.offsetHeight; 1076 layouts.forEach(function (layout) { 1077 if (getComputedStyle(layout).transform === 'none') { 1078 return; 1079 } 1080 var layoutTop = layout.getBoundingClientRect().top + window.scrollY; 1081 var layoutHeight = layout.offsetHeight; 1082 var pointTop = layoutTop - offsetTop; 1083 var pointBottom = layoutTop + layoutHeight + offsetBottom; 1084 if (sidebarTop + sidebarHeight >= pointTop && sidebarTop <= pointBottom) { 1085 disabled = true; 1086 } 1087 }); 1088 sidebar.style.opacity = disabled ? '0' : '1'; 1089 }); 1090 ticking = false; 1091 }; 1092 var requestTick = function requestTick() { 1093 if (!ticking) { 1094 window.requestAnimationFrame(update); 1095 ticking = true; 1096 } 1097 }; 1098 var onProcess = function onProcess() { 1099 requestTick(); 1100 }; 1101 window.addEventListener('scroll', onProcess); 1102 window.addEventListener('resize', onProcess); 1103 window.addEventListener('load', onProcess); 1104})(); 1105})(); 1106 1107// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1108(() => { 1109var __webpack_exports__ = {}; 1110__webpack_require__.r(__webpack_exports__); 1111function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 1112function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1113function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } 1114function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } 1115function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } 1116function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 1117/** ---------------------------------------------------------------------------- 1118 * Navigation */ 1119var CscoNavigation = /*#__PURE__*/function () { 1120 function CscoNavigation() { 1121 _classCallCheck(this, CscoNavigation); 1122 this.headerParams = { 1123 headerLargeHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')), 1124 headerCompactHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')), 1125 headerSmart: document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'), 1126 wpAdminBar: document.querySelector('#wpadminbar'), 1127 headerBefore: document.querySelector('.cs-header-before'), 1128 headerStretch: document.querySelector('.cs-navbar-smart-enabled .cs-header-stretch'), 1129 wpAdminBarHeight: null, 1130 smartStart: null, 1131 scrollPoint: 200, 1132 scrollPrev: 200, 1133 scrollUpAmount: 0, 1134 headerSmartPosition: 0 1135 }; 1136 this.initialize(); 1137 } 1138 _createClass(CscoNavigation, [{ 1139 key: "initialize", 1140 value: function initialize() { 1141 if (document.body.classList.contains('wp-admin')) { 1142 return; 1143 } 1144 this.bindEvents(); 1145 } 1146 }, { 1147 key: "bindEvents", 1148 value: function bindEvents() { 1149 var _this = this; 1150 document.addEventListener('DOMContentLoaded', function () { 1151 _this.smartLevels(); 1152 _this.adaptTablet(); 1153 _this.stickyScroll(); 1154 _this.headerClassesChange(); 1155 }); 1156 window.addEventListener('resize', function () { 1157 _this.smartLevels(); 1158 _this.adaptTablet(); 1159 _this.stickyScroll(); 1160 }); 1161 } 1162 }, { 1163 key: "smartLevels", 1164 value: function smartLevels() { 1165 var windowWidth = window.innerWidth; 1166 1167 // Reset Calc. 1168 document.querySelectorAll('.cs-header__nav-inner li').forEach(function (el) { 1169 el.classList.remove('cs-sm__level', 'cs-sm-position-left', 'cs-sm-position-right'); 1170 }); 1171 document.querySelectorAll('.cs-header__nav-inner li .sub-menu').forEach(function (el) { 1172 el.classList.remove('cs-mm__position-init'); 1173 }); 1174 1175 // Set Settings. 1176 document.querySelectorAll('.cs-header__nav-inner > li.menu-item:not(.cs-mm)').forEach(function (parent) { 1177 var position = 'cs-sm-position-right'; //default 1178 var objPrevWidth = 0; 1179 parent.querySelectorAll('.sub-menu').forEach(function (el) { 1180 // Reset child levels. 1181 if (el.parentElement.nextElementSibling) { 1182 el.parentElement.nextElementSibling.classList.add('cs-sm__level'); 1183 } 1184 if (el.parentElement.classList.contains('cs-sm__level')) { 1185 el.parentElement.classList.remove('cs-mm-level'); 1186 position = 'cs-sm-position-right'; //reset 1187 objPrevWidth = 0; 1188 } 1189 1190 // Find out position items. 1191 var offset = el.getBoundingClientRect().left; 1192 if (position === 'cs-sm-position-right' && el.offsetWidth + offset > windowWidth) { 1193 position = 'cs-sm-position-left'; 1194 } 1195 if (position === 'cs-sm-position-left' && offset - (el.offsetWidth + objPrevWidth) < 0) { 1196 position = 'cs-sm-position-right'; 1197 } 1198 objPrevWidth = el.offsetWidth; 1199 el.classList.add('cs-sm-position-init'); 1200 el.parentElement.classList.add(position); 1201 }); 1202 }); 1203 } 1204 }, { 1205 key: "adaptTablet", 1206 value: function adaptTablet() { 1207 // Click outside. 1208 document.addEventListener('touchstart', function (e) { 1209 if (!e.target.closest('.cs-header__nav-inner')) { 1210 document.querySelectorAll('.cs-header__nav-inner .menu-item-has-children').forEach(function (el) { 1211 el.classList.remove('submenu-visible'); 1212 }); 1213 } else { 1214 var parentMenuItem = e.target.closest('.menu-item'); 1215 if (parentMenuItem) { 1216 if (parentMenuItem.previousElementSibling) { 1217 parentMenuItem.previousElementSibling.querySelectorAll('.menu-item').forEach(function (el) { 1218 el.classList.remove('submenu-visible'); 1219 }); 1220 } 1221 if (parentMenuItem.nextElementSibling) { 1222 parentMenuItem.nextElementSibling.classList.remove('submenu-visible'); 1223 } 1224 } 1225 } 1226 }); 1227 document.querySelectorAll('.cs-header__nav-inner .menu-item-has-children').forEach(function (el) { 1228 // Reset class. 1229 el.classList.remove('submenu-visible'); 1230 1231 // Remove expanded if exists. 1232 var expandedElem = el.querySelector('a > .expanded'); 1233 if (expandedElem) { 1234 expandedElem.remove(); 1235 } 1236 1237 // Add a caret. 1238 if ('ontouchstart' in document.documentElement) { 1239 var aTag = el.querySelector('a'); 1240 if (aTag) { 1241 var span = document.createElement('span'); 1242 span.className = 'expanded'; 1243 aTag.appendChild(span); 1244 } 1245 } 1246 1247 // Check touch device. 1248 if ('ontouchstart' in document.documentElement) { 1249 el.classList.add('touch-device'); 1250 } 1251 var expandedElement = el.querySelector('a .expanded'); 1252 if (expandedElement) { 1253 expandedElement.addEventListener('touchstart', function (e) { 1254 e.preventDefault(); 1255 el.classList.toggle('submenu-visible'); 1256 }, { 1257 passive: true 1258 }); 1259 } 1260 var anchor = el.querySelector('a'); 1261 if (anchor && anchor.getAttribute('href') === '#') { 1262 anchor.addEventListener('touchstart', function (e) { 1263 e.preventDefault(); 1264 if (!e.target.classList.contains('expanded')) { 1265 el.classList.toggle('submenu-visible'); 1266 } 1267 }, { 1268 passive: true 1269 }); 1270 } 1271 }); 1272 } 1273 }, { 1274 key: "stickyScroll", 1275 value: function stickyScroll() { 1276 var _this2 = this; 1277 this.headerParams = { 1278 headerLargeHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')), 1279 headerCompactHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')), 1280 headerSmart: document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'), 1281 wpAdminBar: document.querySelector('#wpadminbar'), 1282 headerBefore: document.querySelector('.cs-header-before'), 1283 headerStretch: document.querySelector('.cs-navbar-smart-enabled .cs-header-stretch'), 1284 wpAdminBarHeight: null, 1285 smartStart: null, 1286 scrollPoint: 200, 1287 scrollPrev: 200, 1288 scrollUpAmount: 0, 1289 headerSmartPosition: 0 1290 }; 1291 this.headerParams.wpAdminBarHeight = this.headerParams.wpAdminBar ? this.headerParams.wpAdminBar.offsetHeight : 0; 1292 if (this.headerParams.headerBefore) { 1293 this.headerParams.smartStart = this.headerParams.headerBefore.offsetTop; 1294 } else { 1295 this.headerParams.smartStart = this.headerParams.wpAdminBarHeight + (this.headerParams.headerSmart ? this.headerParams.headerSmart.offsetTop : 0); 1296 } 1297 window.addEventListener('scroll', function () { 1298 var scrolled = window.scrollY; 1299 _this2.headerParams.headerSmartPosition = _this2.headerParams.headerSmart ? _this2.headerParams.headerSmart.offsetTop : 0; 1300 if (scrolled > _this2.headerParams.smartStart + _this2.headerParams.scrollPoint + 10 && scrolled > _this2.headerParams.scrollPrev) { 1301 if (scrolled > _this2.headerParams.smartStart + _this2.headerParams.headerCompactHeight + 200) { 1302 document.dispatchEvent(new Event('sticky-nav-hide')); 1303 } 1304 } else { 1305 if (_this2.headerParams.scrollUpAmount >= _this2.headerParams.scrollPoint || scrolled === 0) { 1306 document.dispatchEvent(new Event('sticky-nav-visible')); 1307 } 1308 } 1309 if (_this2.headerParams.headerSmart) { 1310 if (scrolled > _this2.headerParams.smartStart + _this2.headerParams.headerCompactHeight) { 1311 document.dispatchEvent(new Event('nav-stick', { 1312 detail: _this2.headerParams 1313 })); 1314 } else if (_this2.headerParams.headerSmartPosition <= _this2.headerParams.smartStart) { 1315 document.dispatchEvent(new Event('nav-unstick', { 1316 detail: _this2.headerParams 1317 })); 1318 } 1319 } 1320 if (scrolled < _this2.headerParams.scrollPrev) { 1321 _this2.headerParams.scrollUpAmount += _this2.headerParams.scrollPrev - scrolled; 1322 } else { 1323 _this2.headerParams.scrollUpAmount = 0; 1324 } 1325 if (_this2.headerParams.wpAdminBar && window.innerWidth <= 600 && scrolled >= _this2.headerParams.wpAdminBarHeight) { 1326 document.dispatchEvent(new Event('adminbar-mobile-scrolled')); 1327 } else { 1328 document.dispatchEvent(new Event('adminbar-mobile-no-scrolled')); 1329 } 1330 _this2.headerParams.scrollPrev = scrolled; 1331 }); 1332 } 1333 }, { 1334 key: "headerClassesChange", 1335 value: function headerClassesChange() { 1336 var _this3 = this; 1337 document.addEventListener("sticky-nav-visible", function (event) { 1338 _this3.headerParams.headerSmart.classList.add('cs-header-smart-visible'); 1339 }); 1340 document.addEventListener("sticky-nav-hide", function (event) { 1341 _this3.headerParams.headerSmart.classList.remove('cs-header-smart-visible'); 1342 }); 1343 document.addEventListener("nav-stick", function (event) { 1344 _this3.headerParams.headerSmart.classList.add('cs-scroll-sticky'); 1345 }); 1346 document.addEventListener("nav-unstick", function (event) { 1347 _this3.headerParams.headerSmart.classList.remove('cs-scroll-sticky', 'cs-header-smart-visible'); 1348 }); 1349 document.addEventListener("adminbar-mobile-scrolled", function (event) { 1350 document.body.classList.add('cs-adminbar-mobile-scrolled'); 1351 }); 1352 document.addEventListener("adminbar-mobile-no-scrolled", function (event) { 1353 document.body.classList.remove('cs-adminbar-mobile-scrolled'); 1354 }); 1355 } 1356 }]); 1357 return CscoNavigation; 1358}();
1359new CscoNavigation(); 1360})(); 1361 1362// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1363(() => { 1364var __webpack_exports__ = {}; 1365__webpack_require__.r(__webpack_exports__); 1366/** ---------------------------------------------------------------------------- 1367 * Offcanvas */ 1368 1369(function () { 1370 var toggles = document.querySelectorAll('.cs-header__offcanvas-toggle, .cs-site-overlay, .cs-offcanvas__toggle'); 1371 toggles.forEach(function (toggle) { 1372 toggle.addEventListener('click', function (e) { 1373 e.preventDefault(); 1374 var body = document.body; 1375 if (!body.classList.contains('cs-offcanvas-active')) { 1376 body.classList.add('cs-offcanvas-transition'); 1377 } else { 1378 setTimeout(function () { 1379 body.classList.remove('cs-offcanvas-transition'); 1380 }, 400); 1381 } 1382 body.classList.toggle('cs-offcanvas-active'); 1383 }); 1384 }); 1385})(); 1386})(); 1387 1388// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1389(() => { 1390var __webpack_exports__ = {}; 1391__webpack_require__.r(__webpack_exports__); 1392/** ---------------------------------------------------------------------------- 1393 * Reading Time Progress */ 1394 1395(function () { 1396 var initReadingTimeProgress = function initReadingTimeProgress(postElement) { 1397 var section = 'cs-post-reading-time'; 1398 var readingTimeProgress = postElement.querySelector(".".concat(section)); 1399 var content = postElement.querySelector('.entry-content'); 1400 if (readingTimeProgress && content) { 1401 var progressPath = readingTimeProgress.querySelector(".".concat(section, "__progress path")); 1402 var pathLength = progressPath.getTotalLength(); 1403 progressPath.style.transition = progressPath.style.WebkitTransition = 'none'; 1404 progressPath.style.strokeDasharray = "".concat(pathLength, " ").concat(pathLength); 1405 progressPath.style.strokeDashoffset = pathLength; 1406 progressPath.getBoundingClientRect(); 1407 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 1408 var updateProgress = function updateProgress() { 1409 var scroll = window.scrollY || window.scrollTop || document.documentElement.scrollTop; 1410 var contentHeight = content.offsetHeight; 1411 var contentOffsetTop = content.getBoundingClientRect().top + window.scrollY; 1412 var windowHeight = window.innerHeight; 1413 1414 // Calculate the total scrollable height for the content of the post 1415 var scrollableHeight = contentHeight - windowHeight; 1416 1417 // Check if the post is currently being viewed 1418 if (scrollableHeight > 0) { 1419 // Determine how much we've scrolled within the bounds of this post 1420 var relativeScroll = Math.max(0, Math.min(scroll - contentOffsetTop, scrollableHeight)); 1421 1422 // Calculate the progress 1423 var progress = pathLength - relativeScroll * pathLength / scrollableHeight; 1424 1425 // Update the strokeDashoffset 1426 progressPath.style.strokeDashoffset = Math.max(progress, 0); 1427 } else { 1428 // Reset progress if the content is not scrollable 1429 progressPath.style.strokeDashoffset = pathLength; 1430 } 1431 }; 1432 1433 // Immediately call updateProgress to handle visible content 1434 updateProgress(); 1435 window.addEventListener('scroll', updateProgress); 1436 window.addEventListener('resize', updateProgress); 1437 } 1438 }; 1439 document.addEventListener('DOMContentLoaded', function () { 1440 var firstPost = document.querySelector('.cs-content-area'); // Change the selector based on your post structure 1441 if (firstPost) { 1442 initReadingTimeProgress(firstPost); 1443 } 1444 }); 1445 var observePosts = function observePosts() { 1446 var posts = document.querySelectorAll('.cs-nextpost-section'); 1447 var observer = new IntersectionObserver(function (entries, observer) { 1448 entries.forEach(function (entry) { 1449 if (entry.isIntersecting) { 1450 initReadingTimeProgress(entry.target); 1451 observer.unobserve(entry.target); 1452 } 1453 }); 1454 }, { 1455 root: null, 1456 threshold: 0.1 1457 });
1458 posts.forEach(function (post) { 1459 observer.observe(post); 1460 }); 1461 }; 1462 document.addEventListener('DOMContentLoaded', observePosts); 1463 document.body.addEventListener('post-load', function (e) { 1464 observePosts(); 1465 }); 1466})(); 1467})(); 1468 1469// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1470(() => { 1471var __webpack_exports__ = {}; 1472__webpack_require__.r(__webpack_exports__); 1473/** ---------------------------------------------------------------------------- 1474 * Responsive Embeds */ 1475 1476(function () { 1477 /** 1478 * Add max-width & max-height to <iframe> elements, depending on their width & height props. 1479 */ 1480 function initResponsiveEmbeds() { 1481 var proportion, parentWidth; 1482 var iframes = document.querySelectorAll('.entry-content iframe'); 1483 1484 // Loop through iframe elements. 1485 iframes.forEach(function (iframe) { 1486 // Don't handle if the parent automatically resizes itself. 1487 if (iframe.closest('div[data-video-start], div[data-video-end]')) { 1488 return; 1489 } 1490 // Only continue if the iframe has a width & height defined. 1491 if (iframe.width && iframe.height) { 1492 // Calculate the proportion/ratio based on the width & height. 1493 proportion = parseFloat(iframe.width) / parseFloat(iframe.height); 1494 // Get the parent element's width. 1495 parentWidth = parseFloat(window.getComputedStyle(iframe.parentElement).width); 1496 // Set the max-width & height. 1497 iframe.style.maxWidth = '100%'; 1498 iframe.style.maxHeight = Math.round(parentWidth / proportion) + 'px'; 1499 } 1500 }); 1501 } 1502 1503 // Document ready. 1504 document.addEventListener('DOMContentLoaded', function () { 1505 initResponsiveEmbeds(); 1506 }); 1507 1508 // Post load. This assumes you have an event "post-load" being dispatched on the body element. 1509 document.body.addEventListener('post-load', function () { 1510 initResponsiveEmbeds(); 1511 }); 1512 1513 // Window resize. 1514 window.addEventListener('resize', function () { 1515 initResponsiveEmbeds(); 1516 }); 1517 1518 // Run on initial load. 1519 initResponsiveEmbeds(); 1520})(); 1521})(); 1522 1523// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1524(() => { 1525var __webpack_exports__ = {}; 1526__webpack_require__.r(__webpack_exports__); 1527/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 1528/** ---------------------------------------------------------------------------- 1529 * Color Scheme Toogle */ 1530 1531 1532var cscoDarkMode = { 1533 init: function init() { 1534 var _this = this; 1535 this.initMode(); 1536 window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) { 1537 _this.initMode(); 1538 }); 1539 document.querySelectorAll('.cs-site-scheme-toggle').forEach(function (toggle) { 1540 toggle.onclick = function () { 1541 var siteScheme = document.body.getAttribute('data-scheme'); 1542 if ('dark' === siteScheme) { 1543 _this.changeScheme('light', true); 1544 } else if ('light' === siteScheme) { 1545 _this.changeScheme('dark', true); 1546 } else if ('auto' === siteScheme) { 1547 var systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches; 1548 if (systemDark) { 1549 _this.changeScheme('light', true); 1550 } else { 1551 _this.changeScheme('dark', true); 1552 } 1553 } 1554 }; 1555 }); 1556 }, 1557 detectColorScheme: function detectColorScheme(color) { 1558 var level = 190; 1559 var alpha = 1; 1560 var rgba = [255, 255, 255]; 1561 var color_rgba = false; 1562 color = color.trim(); 1563 1564 // Excludes. 1565 if (['#0e131a'].includes(color)) { 1566 return 'dark'; 1567 } 1568 if ('#' === color[0]) { 1569 color = color.replace('#', '').trim(); 1570 if (3 === color.length) { 1571 color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]; 1572 } 1573 rgba[0] = parseInt(color.substr(0, 2), 16); 1574 rgba[1] = parseInt(color.substr(2, 2), 16); 1575 rgba[2] = parseInt(color.substr(4, 2), 16); 1576 } else if (color_rgba = color.replace(/\s/g, '').match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i)) { 1577 rgba[0] = parseInt(color_rgba[1]); 1578 rgba[1] = parseInt(color_rgba[2]); 1579 rgba[2] = parseInt(color_rgba[3]); 1580 if (color_rgba[4] !== undefined) { 1581 alpha = parseFloat(color_rgba[4]); 1582 } 1583 }
1584 rgba.forEach(function myFunction(channel, key, stack) { 1585 stack[key] = String(channel + Math.ceil((255 - channel) * (1 - alpha))).padStart(2, '0'); 1586 }); 1587 var scheme = 'light'; 1588 var brightness = (rgba[0] * 299 + rgba[1] * 587 + rgba[2] * 114) / 1000; 1589 if (rgba[0] === rgba[1] && rgba[1] === rgba[2]) { 1590 if (brightness < level) { 1591 scheme = 'dark'; 1592 } 1593 } else { 1594 if (brightness < level) { 1595 scheme = 'inverse'; 1596 } 1597 } 1598 return scheme; 1599 }, 1600 setIndividualScheme: function setIndividualScheme() { 1601 var list = { 1602 '.cs-header': '--cs-header-background', 1603 '.cs-header__nav-inner .sub-menu': '--cs-header-submenu-background' 1604 }; 1605 function createClosure(key) { 1606 return function (element) { 1607 var color = getComputedStyle(element).getPropertyValue(list[key]); 1608 var scheme = cscoDarkMode.detectColorScheme(color); 1609 element.setAttribute('data-scheme', scheme); 1610 }; 1611 } 1612 for (var key in list) { 1613 if (list.hasOwnProperty(key)) { 1614 var elements = document.querySelectorAll(key); 1615 if (elements.length <= 0) { 1616 continue; 1617 } 1618 elements.forEach(createClosure(key)); 1619 } 1620 } 1621 }, 1622 initMode: function initMode() { 1623 var siteScheme = false; 1624 switch (csLocalize.siteSchemeMode) { 1625 case 'dark': 1626 siteScheme = 'dark'; 1627 break; 1628 case 'light': 1629 siteScheme = 'light'; 1630 break; 1631 case 'system': 1632 siteScheme = 'auto'; 1633 break; 1634 } 1635 if (csLocalize.siteSchemeToogle) { 1636 if ('light' === (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.csGetCookie)('_color_schema')) { 1637 siteScheme = 'light'; 1638 } 1639 if ('dark' === (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.csGetCookie)('_color_schema')) { 1640 siteScheme = 'dark'; 1641 } 1642 } 1643 this.setIndividualScheme(); 1644 if (siteScheme && siteScheme !== document.body.getAttribute('data-scheme')) { 1645 this.changeScheme(siteScheme, false); 1646 } 1647 }, 1648 changeScheme: function changeScheme(siteScheme, cookie) { 1649 document.body.classList.add('cs-scheme-toggled'); 1650 document.body.setAttribute('data-scheme', siteScheme); 1651 this.setIndividualScheme(); 1652 if (cookie) { 1653 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.csSetCookie)('_color_schema', siteScheme, { 1654 expires: 2592000 1655 }); 1656 } 1657 setTimeout(function () { 1658 document.body.classList.remove('cs-scheme-toggled'); 1659 }, 100); 1660 } 1661}; 1662cscoDarkMode.init(); 1663})(); 1664 1665// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1666(() => { 1667var __webpack_exports__ = {}; 1668__webpack_require__.r(__webpack_exports__); 1669/** ---------------------------------------------------------------------------- 1670 * Scroll to top */ 1671 1672(function () { 1673 var section = 'cs-scroll-top'; 1674 var scrollToTopButton = document.querySelector(".".concat(section)); 1675 if (scrollToTopButton) { 1676 var activeClass = 'is-active'; 1677 var offset = 200; 1678 var scrollToTop = function scrollToTop() { 1679 window.scrollTo({ 1680 top: 0, 1681 behavior: 'smooth' 1682 }); 1683 }; 1684 var progressPath = scrollToTopButton.querySelector(".".concat(section, "-progress path")); 1685 var pathLength = progressPath.getTotalLength(); 1686 progressPath.style.transition = progressPath.style.WebkitTransition = 'none'; 1687 progressPath.style.strokeDasharray = "".concat(pathLength, " ").concat(pathLength); 1688 progressPath.style.strokeDashoffset = pathLength; 1689 progressPath.getBoundingClientRect(); 1690 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 1691 var updateProgress = function updateProgress() { 1692 var scroll = window.scrollY || window.scrollTop || document.documentElement.scrollTop; 1693 var docHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); 1694 var windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0
1694); 1695 var height = docHeight - windowHeight; 1696 var progress = pathLength - scroll * pathLength / height; 1697 progressPath.style.strokeDashoffset = progress; 1698 }; 1699 updateProgress(); 1700 if (scrollToTopButton) { 1701 scrollToTopButton.addEventListener('click', scrollToTop); 1702 } 1703 window.addEventListener('scroll', function () { 1704 updateProgress(); 1705 var scrollPos = window.scrollY || window.scrollTop || document.getElementsByTagName('html')[0].scrollTop; 1706 if (scrollPos > offset) { 1707 scrollToTopButton.classList.add(activeClass); 1708 } else { 1709 scrollToTopButton.classList.remove(activeClass); 1710 } 1711 }); 1712 } 1713})(); 1714})(); 1715 1716// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1717(() => { 1718var __webpack_exports__ = {}; 1719__webpack_require__.r(__webpack_exports__); 1720/** ---------------------------------------------------------------------------- 1721 * Search Dropdown */ 1722 1723(function () { 1724 var toggles = document.querySelectorAll('.cs-header__search-toggle, .cs-search-overlay, .cs-search__close'); 1725 toggles.forEach(function (toggle) { 1726 toggle.addEventListener('click', function (e) { 1727 e.preventDefault(); 1728 var body = document.body; 1729 var headerElement = document.querySelector('.cs-header'); 1730 if (!body.classList.contains('cs-search-active')) { 1731 body.classList.add('cs-search-transition'); 1732 } else { 1733 setTimeout(function () { 1734 body.classList.remove('cs-search-transition'); 1735 }, 400); 1736 } 1737 body.classList.toggle('cs-search-active'); 1738 headerElement.classList.toggle('cs-search-visible'); 1739 }); 1740 }); 1741})(); 1742})(); 1743 1744// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1745(() => { 1746var __webpack_exports__ = {}; 1747__webpack_require__.r(__webpack_exports__); 1748/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 1749/** ---------------------------------------------------------------------------- 1750 * Metabar Share copy link */ 1751 1752 1753(function () { 1754 function copyToClipboard(str) { 1755 var area = document.createElement('textarea'); 1756 document.body.appendChild(area); 1757 area.value = str; 1758 area.select(); 1759 document.execCommand('copy'); 1760 document.body.removeChild(area); 1761 } 1762 function showTooltip(button, message) { 1763 var tooltip = document.createElement('div'); 1764 tooltip.className = 'cs-share__copy-link-tooltip'; 1765 tooltip.textContent = message; 1766 button.appendChild(tooltip); 1767 setTimeout(function () { 1768 tooltip.classList.add('hide'); 1769 }, 1500); 1770 setTimeout(function () { 1771 button.removeChild(tooltip); 1772 }, 2000); 1773 } 1774 var copyButtons = document.querySelectorAll('.cs-share__copy-link'); 1775 copyButtons.forEach(function (button) { 1776 button.addEventListener('click', function (event) { 1777 event.preventDefault(); 1778 var pageURL = this.getAttribute('href'); 1779 copyToClipboard(pageURL); 1780 showTooltip(this, 'URL copied'); 1781 }); 1782 }); 1783})(); 1784})(); 1785 1786// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1787(() => { 1788var __webpack_exports__ = {}; 1789__webpack_require__.r(__webpack_exports__); 1790/** ---------------------------------------------------------------------------- 1791 * Sticky Sidebar */ 1792 1793(function () { 1794 var stickyElementsSmart = [], 1795 stickyElements = []; 1796 stickyElementsSmart.push('.cs-navbar-smart-enabled.cs-stick-to-top .cs-single-product .entry-summary', '.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-to-top .cs-sidebar__inner', '.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child'); 1797 stickyElements.push('.cs-navbar-sticky-enabled.cs-stick-to-top .cs-single-product .entry-summary', '.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-to-top .cs-sidebar__inner', '.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child'); 1798 document.addEventListener("DOMContentLoaded", function () { 1799 var headerStick = document.querySelector('.cs-header'), 1800 wpAdminBar = document.querySelector('#wpadminbar'), 1801 headerStickHeight = headerStick ? headerStick.offsetHeight : 0, 1802 wpAdminBarHeight = wpAdminBar ? wpAdminBar.offsetHeight : 0, 1803 headerStretch = document.querySelector('.cs-header-stretch'), 1804 headerStretchHeight = headerStretch ? headerStretch.offsetHeight : 0, 1805 allHeight = headerStickHeight + wpAdminBarHeight + 20, 1806 windowWidth = window.innerWidth; 1807 if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { 1808 stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner'); 1809 stickyElements.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner'); 1810 } 1811 stickyElementsSmart = stickyElementsSmart.join(','); 1812 stickyElements = stickyElements.join(','); 1813 document.addEventListener('sticky-nav-visible', function () { 1814 headerStickHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height'));
1815 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1816 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1817 el.style.top = allHeight + 'px'; 1818 }); 1819 }); 1820 document.addEventListener('sticky-nav-hide', function () { 1821 headerStickHeight = 0; 1822 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20; 1823 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1824 el.style.top = allHeight + 'px'; 1825 }); 1826 }); 1827 document.addEventListener('stretch-nav-to-small', function () { 1828 headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')); 1829 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1830 if (headerStretch && headerStretch.classList.contains("cs-scroll-sticky") && !headerStretch.classList.contains("cs-scroll-active")) { 1831 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1832 el.style.top = allHeight + 'px'; 1833 }); 1834 } 1835 }); 1836 document.addEventListener('stretch-nav-to-big', function () { 1837 headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')); 1838 }); 1839 if (document.body.classList.contains('cs-navbar-smart-enabled') && windowWidth >= 1020) { 1840 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1841 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1842 el.style.top = allHeight + 'px'; 1843 }); 1844 } else if (document.body.classList.contains('cs-navbar-sticky-enabled') && windowWidth >= 1020) { 1845 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1846 document.querySelectorAll(stickyElements).forEach(function (el) { 1847 el.style.top = allHeight + 'px'; 1848 }); 1849 } 1850 window.addEventListener('resize', function () { 1851 var windowWidthResize = window.innerWidth; 1852 if (windowWidthResize < 1020) { 1853 document.querySelectorAll(stickyElements).forEach(function (el) { 1854 el.removeAttribute('style'); 1855 }); 1856 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1857 el.removeAttribute('style'); 1858 }); 1859 } 1860 }); 1861 }); 1862})(); 1863})(); 1864 1865// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1866(() => { 1867__webpack_require__.r(__webpack_exports__); 1868/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 1869/** ---------------------------------------------------------------------------- 1870 * Widget Nav Menu */ 1871 1872 1873(function () { 1874 HTMLElement.prototype.responsiveNav = function () { 1875 this.classList.remove('menu-item-expanded'); 1876 var previousElement = this.previousElementSibling; 1877 if (previousElement && previousElement.classList.contains('submenu-visible')) { 1878 previousElement.classList.remove('submenu-visible'); 1879 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(previousElement); 1880 this.parentElement.classList.remove('menu-item-expanded'); 1881 } else { 1882 var parentOfParent = this.parentElement.parentElement; 1883 parentOfParent.querySelectorAll('.menu-item .sub-menu').forEach(function (subMenu) { 1884 subMenu.classList.remove('submenu-visible'); 1885 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(subMenu); 1886 }); 1887 parentOfParent.querySelectorAll('.menu-item-expanded').forEach(function (item) { 1888 item.classList.remove('menu-item-expanded'); 1889 }); 1890 if (previousElement) { 1891 previousElement.classList.toggle('submenu-visible'); 1892 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideToggle)(previousElement); 1893 } 1894 this.parentElement.classList.toggle('menu-item-expanded'); 1895 } 1896 }; 1897 document.addEventListener('DOMContentLoaded', function () { 1898 var menuItems = document.querySelectorAll('.widget_nav_menu .menu-item-has-children'); 1899 menuItems.forEach(function (menuItem) { 1900 var span = document.createElement('span'); 1901 menuItem.appendChild(span); 1902 span.addEventListener('click', function (e) { 1903 e.preventDefault(); 1904 this.responsiveNav(); 1905 }); 1906 var anchor = menuItem.children[0]; 1907 if (anchor && anchor.tagName === 'A' && anchor.getAttribute('href') === '#') { 1908 anchor.addEventListener('click', function (e) { 1909 e.preventDefault(); 1910 this.nextElementSibling.nextElementSibling.responsiveNav(); 1911 }); 1912 } 1913 }); 1914 }); 1915})(); 1916})(); 1917 1918/******/ })() 1919;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.