PageSourceSearch

https://prospermj.com/wp-content/themes/prosper/ui/js/main.js?ver=7.1.2

js prospermj.com collected 2026-09-27 01:34:11 UTC 36,764 bytes, 1,236 lines download raw bytes

1jQuery(function($) {
2
3  $('.content-home-products__cell').on('click', function() {
4
5    $('.content-home-products__cell .test').removeClass('open');
6    $('.content-home-products__cell .testtwo').removeClass('close');
7
8    $(this).children('.test').addClass('open_flip');
9    $(this).children('.testtwo').addClass('close_flip');
10
11  });
12
13
14  /**
15   * Fix dark mode flash.
16   */
17  $(document).ready(function() {
18    $('#fix-dark-mode-flash').remove();
19  });
20
21  /**
22   * Query URL
23   * Usage: qurl($q)
24   */
25   function qurl(q) {
26    var x = window.location.search.substring(1);
27    var s = x.split('&');
28
29    for (var i = 0; i < s.length; i++) {
30      var pair = s[i].split('=');
31
32      if (pair[0] === q) {
33        return pair[1];
34      }
35    }
36  };
37
38  function hash() {
39    return window.location.hash.substr(1).replace('#', '');
40  };
41
42  /**
43   * Button Icon
44   */
45
46  var set_button_link_icon = function() {
47    var arrow_left = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 14"><path d="M6.364 13.231L-.04 6.933c-.074-.058-.074-.174 0-.247L6.364.387c.074-.072.177-.072.25 0l.825.812-5.05 4.966h13.794c.398 0 .722.319.722.71 0 .376-.324.695-.722.695H2.507l4.932 4.85-.825.811c-.073.073-.176.073-.25 0"/></svg>';
48    var arrow_right = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 14"><path d="M10.636 13.231l6.404-6.298c.074-.058.074-.174 0-.247L10.636.387c-.074-.072-.177-.072-.25 0l-.825.812 5.05 4.966H.817c-.398 0-.722.319-.722.71 0 .376.324.695.722.695h13.676l-4.932 4.85.825.811c.073.073.176.073.25 0"/></svg>';
49
50    $('.button-link').each( function() {
51      var button = $(this).not('input');
52
53      /**
54       * Append svg if no existing svg.
55       */
56      if (! button.find('svg').length) {
57        if (button.hasClass('button--prev')) {
58          button.append(arrow_left);
59        } else {
60          button.append(arrow_right);
61        }
62      }
63    });
64
65    /*$('input[type="button"], input[type="submit"]').each(function() {
66      var value = $(this).attr('value');
67
68      if (! $(this).parent().hasClass('button-input')) {
69        $(this).attr('value', '').wrap('<div class="button button-input"></div>');
70
71        $(this).parent('.button-input').prepend(value);
72    }
73});*/
74  };
75
76  jQuery(document).on('gform_post_render', function(e, form_id) {
77    set_button_link_icon();
78  });
79
80  $(document).ready(function() {
81    set_button_link_icon();
82  });
83
84  /**
85   * List Icon
86   */
87
88  $(document).ready(function() {
89    $('.list-arrow li').each(function() {
90      var svg = $('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 13"><path d="M9.921-.051l-.706.708 4.867 4.884H0v1.003h14.082l-4.867 4.882.706.71 6.074-6.094z"/></svg>' );
91
92      if ($(this).children('a').length) {
93        var href = $(this).attr('href');
94        var svg = $('<a class="list-icon" href="' + href + '"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 13"><path d="M9.921-.051l-.706.708 4.867 4.884H0v1.003h14.082l-4.867 4.882.706.71 6.074-6.094z"/></svg></a>' );
95
96        $(this).css('paddingLeft', 0);
97        $(this).children('a').css('paddingLeft', '2.25rem');
98      }
99
100      $(this).append(svg);
101    });
102  });
103
104  /**
105   * Check in view with padding.
106   */
107  function isScrolledIntoView(el) {
108    var rect = el.getBoundingClientRect();
109    var elemTop = rect.top;
110    var elemBottom = rect.bottom;
111
112    isVisible = (elemTop + 216) < window.innerHeight && elemBottom >= 0;
113
114    return isVisible;
115  }
116
117  /**
118   * Animation on scroll.
119   */
120  $(document).ready(function() {
121    if (isScrolledIntoView($('[data-scroll-class]').get(0)) === true) {
122      $('[data-scroll-class]').each(function() {
123        var scrollClass = $(this).attr('data-scroll-class');
124
125        $(this).addClass(scrollClass);
126      });
127    } else {
128      $(window).scroll(function() {
129        $('[data-scroll-class]').each(function() {
130          var scrollClass = $(this).attr('data-scroll-class');
131
132          if (isScrolledIntoView(this) === true) {
133            $(this).addClass(scrollClass);
134          }
135        });
136      });
137    }
138  });
139
140  /**
141   * Newsletter
142   */
143
144/*  $(document).ready(function() {
145    $('.newsletter-inline').each(function() {
146      var input_wrap = $(this).find('input[type="email"]').parent();
147      var submit_button = $(this).find('[type="submit"]');
148
149      if (input_wrap.length < 1) {
150        input_wrap = $(this).find('input[type="text"]').parent();
151      }
152
153      if ($(this).find('.button-input').length) {
154        submit_button = $(this).find('.button-input:first');
155      }
156
157      input_wrap.addClass('input-wrap');
158
159      input_wrap.append(submit_button);
160    });
161});*/
162
163  /**
164   * WordPress comment form.
165   */
166
167  $('.comment-form').each(function() {
168    var comment_field_wrap = $('<span class="comment-field-wrap"></span>');
169    var comment_form_author = $(this).find('.comment-form-author');
170    var comment_form_email = $(this).find('.comment-form-email');
171    var comment_notes = $(this).find('.comment-notes');
172
173    if (! $(this) .find('.comment-field-wrap').length > 0) {
174      if (comment_notes.length > 0) {
175        comment_field_wrap.insertAfter(comment_notes);
176      } else {
177        $(this).prepend(comment_field_wrap);
178      }
179    }
180
181    comment_field_wrap.append(comment_form_author).append(comment_form_email);
182  } );
183
184  $('.blog-posts-comments-label a').on('click', function( e ) {
185    e.preventDefault();
186
187    if ($( e.target).is('.comments-label-close')) {
188      $('.blog-post-comments').slideUp(250);
189
190      $('.blog-posts-comments-label').addClass('is-active');
191      $('.blog-posts-comments-label .comments-label__text').removeClass('screen-reader-text');
192      $('.blog-posts-comments-label .comments-label-close').addClass('screen-reader-text');
193
194      return false;
195    }
196
197    $('.blog-post-comments').slideDown(250);
198
199    $('.blog-posts-comments-label').addClass('is-active');
200    $('.blog-posts-comments-label .comments-label__text').addClass('screen-reader-text');
201    $('.blog-posts-comments-label .comments-label-close').removeClass('screen-reader-text');
202  });
203
204  $(document).ready( function() {
205    if ( window.location.hash == '#comments') {
206      $('.blog-post-comments').addClass('has-hash');
207
208      $('.blog-posts-comments-label').addClass('is-active');
209      $('.blog-posts-comments-label .comments-label__text').addClass('screen-reader-text');
210      $('.blog-posts-comments-label .comments-label-close').removeClass('screen-reader-text');
211    }
212  });
213
214  /**
215   * Grab
216   */
217
218  $.fn.grab = function(size) {
219    var arr = [];
220
221    for (var i = 0; i < this.length; i += size) {
222      arr.push(this.slice(i, i + size));
223    }
224
225    return this.pushStack(arr, 'grab', size);
226  }
227
228  /**
229   * Split Navigation
230   */
231
232  var split_nav = function() {
233    var split_nav = $( '#primary-menu' );
234    var insertAfter = $( '#primary .logo' );
235    var ul_clone = $( '<ul class="menu" id="primary-menu-clone"></ul>' );
236    var half_1_length = Math.ceil( parseFloat( split_nav.children().length / 2 ) );
237    var half_1 = $( split_nav ).children().slice( 0, half_1_length );
238    var half_2 = $( split_nav ).children().slice( half_1_length );
239
240    ul_clone.insertAfter( insertAfter ).append( half_2 );
241
242    split_nav.css( 'display', 'flex' );
243    ul_clone.css( 'display', 'flex' );
244  };
245
246  var split_nav_equal_width = function() {
247    var equalize = $( '#primary ul' );
248    var maxWidth = 0;
249
250    equalize.each( function() {
251      $( this ).css( 'width', 'auto' );
252
253      if ( $( this ).width() > maxWidth ) {
254        maxWidth = $( this ).width() + .01;
255      }
256    } );
257
258    equalize.width( maxWidth );
259  };
260
261  // split_nav();
262  // split_nav_equal_width();
263
264  // $( window ).on( 'resize', function() {
265  //   setTimeout( split_nav_equal_width, 300 );
266  // } );
267
268  /**
269   * Sortby
270   */
271  function sortMeBy(arg, sel, elem, order) {
272    var $selector = $(sel),
273      $element = $selector.children(elem);
274
275    $element.sort(function(a, b) {
276      var an = parseInt(a.getAttribute(arg)),
277        bn = parseInt(b.getAttribute(arg));
278
279      if (order == 'asc') {
280        if (an > bn)
281          return 1;
282        if (an < bn)
283          return -1;
284      } else if (order == 'desc') {
285        if (an < bn)
286          return 1;
287        if (an > bn)
288          return -1;
289      }
290
291      return 0;
292    });
293
294    $element.detach().appendTo($selector);
295  }
296
297  /**
298   * jQuery Sorting
299   *
300   * (https://j11y.io/javascript/sorting-elements-with-jquery)
301   */
302   jQuery.fn.sortElements = (function() {
303    var sort = [].sort;
304
305    return function(comparator, getSortable) {
306      getSortable = getSortable || function() {
307        return this;
308      };
309
310      var placements = this.map(function() {
311        var sortElement = getSortable.call(this),
312          parentNode = sortElement.parentNode,
313
314          // Since the element itself will change position, we have
315          // to have some way of storing its original position in
316          // the DOM. The easiest way is to have a 'flag' node:
317          nextSibling = parentNode.insertBefore(document.createTextNode(''), sortElement.nextSibling);
318
319        return function() {
320          if (parentNode === this) {
321            throw new Error( "You can't sort elements if any one is a descendant of another." );
322          }
323
324          // Insert before flag:
325          parentNode.insertBefore(this, nextSibling);
326
327          // Remove flag:
328          parentNode.removeChild(nextSibling);
329        };
330      });
331
332      return sort.call(this, comparator).each( function(i) {
333        placements[i].call(getSortable.call(this));
334      });
335    };
336  })();
337
338  /**
339   * Form
340   */
341
342  $(document).ready(function() {
343    $('form select').chosen({
344      width: '100%'
345    });
346  });
347
348  $(document).ready(function() {
349    var chosen_search_svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><path d="M11.975 2.052c-2.736-2.736-7.187-2.736-9.923 0-2.736 2.736-2.736 7.187 0 9.923 2.44 2.441 6.248 2.704 8.983.79l4.877 4.877c.478.477 1.252.477 1.73 0 .477-.478.477-1.252 0-1.73l-4.877-4.877c1.914-2.735 1.651-6.542-.79-8.983zm-1.438 8.485c-1.95 1.95-5.124 1.95-7.074 0-1.95-1.95-1.95-5.124 0-7.074 1.95-1.95 5.124-1.95 7.074 0 1.95 1.95 1.95 5.124 0 7.074z"/></svg>';
350
351    $('.chosen-search').append(chosen_search_svg);
352  });
353
354  /**
355   * Image Ratio
356   */
357
358  var image_ratio = function() {
359    "use strict";
360
361    var images_parent = document.querySelector('[data-proportional-image]');
362    var images = document.querySelectorAll('[data-proportional-image] img');
363
364    if (images_parent) {
365      var data_widthBase = images_parent.getAttribute('data-width-base');
366      var data_scaleFactor = images_parent.getAttribute('data-scale');
367    }
368
369    function adjustImageWidth(image) {
370      if (data_widthBase) {
371        var widthBase = data_widthBase;
372      } else {
373        var widthBase = 110;
374      }
375
376      if (data_scaleFactor) {
377        var scaleFactor = data_scaleFactor;
378      } else {
379        var scaleFactor = .375;
380      }
381
382      var imageRatio = image.naturalWidth / image.naturalHeight;
383
384      image.style.width = (Math.pow(imageRatio, scaleFactor) * widthBase) + 'px';
385    }
386
387    images.forEach(adjustImageWidth);
388  }
389
390  // $(document).ready(function() {
391  //   image_ratio();
392  // });
393
394  // $(window).on('load', function() {
395  //   image_ratio();
396  // });
397
398  // $(window).on('resize', function() {
399  //   setTimeout(image_ratio, 400);
400  // });
401
402  /**
403   * Navigation
404   */
405  var navSpeed = 400;
406  var navChildSpeed = 250;
407
408  $(document).on('click touchend', function(e) {
409    var classToggle = $('body, #accessory, #accessory-toggle, #header, #page');
410
411    if ($('#accessory').hasClass('is-open') && $(e.target).closest( 'body').length && ! $(e.target).closest('#accessory, #accessory-toggle').length) {
412      classToggle.addClass('is-closed is-closing').removeClass('is-open');
413
414      setTimeout(function() {
415        classToggle.removeClass('is-closing');
416      }, navSpeed);
417    }
418  });
419
420  $('#accessory .close').on('click', function(e) {
421    e.preventDefault();
422
423    var classToggle = $(this).add($('body, #accessory, #accessory-toggle, #header, #page'));
424
425    classToggle.addClass('is-closed is-closing').removeClass('is-open');
426
427    setTimeout(function() {
428      classToggle.removeClass('is-closing');
429    }, navSpeed);
430  });
431
432  $('#accessory-toggle').on('click', function() {
433    var classToggle = $(this).add( $(this).parent()).add($('body, #accessory, #accessory-toggle, #header, #page'));
434
435    if ($('#accessory').hasClass('is-open')) {
436      classToggle.addClass('is-closed is-closing').removeClass('is-open');
437
438      setTimeout(function() {
439        classToggle.removeClass('is-closing');
440      }, navSpeed);
441    } else {
442      classToggle.addClass('is-open is-opening').removeClass('is-closed');
443
444      setTimeout(function() {
445        classToggle.removeClass('is-opening');
446      }, navSpeed);
447    }
448  });
449
450  var closeMenuDesktop = function() {
451    if (window.matchMedia('(min-width: 1024px)').matches) {
452      $('#main').removeClass('is-open');
453    }
454  }
455
456  $(document).ready(function() {
457    closeMenuDesktop();
458  });
459
460  $(window).on('resize', function() {
461    setTimeout(closeMenuDesktop, 400);
462  });
463
464  /**
465   * Navigation Path Helper
466   *
467   * Insert a span after sub menu.
468   * In the CSS it will be positioned behind the
469   * menu to help with mouse path.
470   */
471
472  $(document).ready(function() {
473    var primary_menu_li = $('#primary-menu li');
474
475    primary_menu_li.each( function() {
476      var sub_menu = $(this).children('ul').first();
477
478      if (sub_menu) {
479        sub_menu.wrap('<span class="menu-path-helper"></span>');
480      }
481    });
482  });
483
484  // Add menu elements to create scroll
485  // $( document ).ready( function() {
486  //   var e = $( '#menu-item-190' );
487
488  //   for ( var i = 0; i < 10; i++ ) {
489  //     e.clone().insertAfter( e );
490  //   }
491  // } );
492
493  $('#accessory-menu .menu-item-has-children > a').on('click', function(e) {
494    e.preventDefault();
495    e.stopPropagation();
496
497    if ($(this).parent( 'li' ).hasClass('is-open')) {
498      $(this).next('ul').slideUp(navChildSpeed);
499      $(this).parent('li').removeClass('is-open');
500    } else {
501      $(this).next('ul').slideDown(navChildSpeed);
502      $(this).parent('li').addClass('is-open');
503    }
504  });
505
506  $('#accessory-menu .menu-item-has-children a span:first-child').on('click', function(e) {
507    e.preventDefault();
508    e.stopPropagation();
509
510    if (! $(this).is('.nolink, .no-link') && ! $(this).closest('li').is('.nolink, .no-link') && ! $(this).parent().is('.nolink, .no-link')) {
511      window.location.href = $(this).parent().attr('href');
512    } else if ($(this).parent('.menu-item-has-children') || $(this).parent().parent('.menu-item-has-children')) {
513      if ($(this).closest('.menu-item-has-children').hasClass('is-open')) {
514        $(this).closest('.menu-item-has-children').find('ul').first().slideUp(navChildSpeed);
515        $(this).closest('.menu-item-has-children').removeClass('is-open');
516      } else {
517        $(this).closest('.menu-item-has-children').find('ul').first().slideDown(navChildSpeed);
518        $(this).closest('.menu-item-has-children').addClass('is-open');
519      }
520    }
521  });
522
523  $( '.logo__mark, .logo__type' ).on( {
524    mouseenter: function() {
525      $( '#header .logo' ).addClass( 'is-hover' );
526    },
527    mouseleave: function() {
528      $( '#header .logo' ).removeClass( 'is-hover' );
529    }
530  } );
531
532  /**
533   * Prevent Link.
534   */
535  $(document).ready(function() {
536    $('a.nolink, a.no-link, .nolink > a, .no-link > a').on('click', function(e) {
537      e.preventDefault();
538    });
539  });
540
541  /**
542   * Prevent Orphan
543   */
544  $( document ).ready( function() {
545    var element = $( '.prevent-orphan, .footer-grid__cell h4, .footer-grid__cell button, .footer-grid__cell .button' );
546
547    element.each( function() {
548      var a = $( this ).html().trim().replace( '&nbsp;', ' ' ).split( ' ' );
549
550      if ( a.length > 1 ) {
551        a[ a.length - 2 ] += '&nbsp;' + a[ a.length - 1 ];
552        a.pop();
553        $( this ).html( a.join( ' ' ) );
554      }
555    } );
556  } );
557
558  /**
559   * Remove empty element
560   */
561  $( document ).ready( function() {
562    $( 'p, h1, h2, h3, h4, h5, h6' ).each( function() {
563      var html = $.trim( $( this ).html() );
564
565      if ( html == '' || html == ' ' || html == '&nbsp;' ) {
566        $( this ).remove();
567      }
568    } );
569  } );
570
571  /**
572   * Replace Tag
573   */
574
575  $( window ).on( 'load', function() {
576    $( '.hs-form fieldset' ).each( function() {
577      var t = $( '<div>' );
578
579      $.each( this.attributes, function( i, attr ) {
580        $( t ).attr( attr.name, attr.value );
581      } );
582
583      $( this ).replaceWith( function() {
584        return $( t ).append( $( this ).contents() );
585      } );
586    } );
587  } );
588
589  /**
590   * Reveal
591   */
592
593  $( window ).on( 'load', function() {
594    $( '.reveal' ).each( function() {
595      var cusion = $( this ).find( '.reveal__toggle' ).outerHeight();
596      var inside = $( this ).find( '.reveal__content' );
597      var remove = $( this ).find( '.close' );
598      var rename = $( this ).find( '.reveal__toggle a' ).text();
599      var reveal = $( this );
600      var toggle = $( this ).find( '.reveal__toggle' );
601
602      inside.css( 'top', cusion );
603
604      toggle.on( 'click', function( e ) {
605        var height = reveal.find( '.reveal__content' ).outerHeight();
606
607        e.preventDefault();
608
609        if ( reveal.hasClass( 'is-open' ) ) {
610          reveal.addClass( 'is-closed' ).removeClass( 'is-open' );
611          toggle.css( 'marginBottom', 0 );
612
613          setTimeout( function() {
614            toggle.find( 'a' ).text( rename );
615          }, 260 );
616        } else {
617          reveal.addClass( 'is-open' ).removeClass( 'is-closed' );
618          toggle.css( 'marginBottom', height ).find( 'a' ).text( 'close' );
619        }
620      } );
621
622      remove.on( 'click', function( e ) {
623        e.preventDefault();
624
625        reveal.addClass( 'is-closed' ).removeClass( 'is-open' );
626        toggle.css( 'marginBottom', 0 );
627
628        setTimeout( function() {
629          toggle.find( 'a' ).text( rename );
630        }, 260 );
631      } );
632    } );
633  } );
634
635  /**
636   * Emergence
637   */
638
639  // emergence.init( {
640  //   reset: false
641  // } );
642
643  /**
644   * Scroll Action
645   */
646
647  // var headerScrollClass = function() {
648  //   var a = Math.ceil($('html').scrollTop()); // (Firefox)
649  //   var b = Math.ceil($('body').scrollTop()); // (Everyone else)
650
651  //   // Check which to use - body on firefox will print 0, html on chrome will print 0.
652  //   if (a > b) {
653  //     var n = a;
654  //   } else {
655  //     var n = b;
656  //   }
657
658  //   if (window.matchMedia( '(min-width: 1024px)').matches) {
659  //     if (n > 114) {
660  //       $('#header').not('.pre-scrolled').addClass('is-scrolled').removeClass('not-scrolled');
661  //     } else {
662  //       $('#header').not('.pre-scrolled').addClass('not-scrolled').removeClass('is-scrolled');
663  //     }
664  //   } else {
665  //     if (n > 80) {
666  //       $('#header').not('.pre-scrolled').addClass('is-scrolled').removeClass('not-scrolled');
667  //     } else {
668  //       $('#header').not('.pre-scrolled').addClass('not-scrolled').removeClass('is-scrolled');
669  //     }
670  //   }
671  // };
672
673  // $(document).ready( function() {
674  //   headerScrollClass();
675  // });
676
677  // $(document).on('scroll', function() {
678  //   headerScrollClass();
679  // });
680
681  /**
682   * Search Utility
683   */
684
685  // $('.search-utility button').on('click', function(e) {
686  //   var search = $(this).closest('form').find('.search-field');
687
688  //   if (! search.hasClass('is-active')) {
689  //     e.preventDefault();
690
691  //     search.addClass('is-active').focus();
692  //   } else if (search.hasClass('is-active') && search.val() == '') {
693  //     e.preventDefault();
694
695  //     search.removeClass('is-active');
696  //   }
697  // });
698
699  // var header_utility = document.querySelector('.header-primary');
700
701  // if (header_utility) {
702  //   var header_search_field = header_utility.querySelector('.search-field');
703  // }
704
705  // document.addEventListener('click', function(e) {
706  //   if (header_utility) {
707  //     var inside__header_utility = header_utility.contains(e.target);
708  //   }
709
710  //   if (! inside__header_utility && $( header_search_field ).val() == '') {
711  //     header_search_field.classList.remove('is-active');
712  //   }
713  // });
714
715  /**
716   * Smooth Scroll
717   */
718  $(document).ready(function() {
719    $('[data-goto]').on('click', function(e) {
720      e.preventDefault();
721
722      var goto = $(this).attr('data-goto');
723      var offs = $(goto).offset().top;
724      var trim = $(this).attr('data-goto-trim');
725
726      if ($(this).attr('speed')) {
727        var speed = $(this).attr('speed');
728      } else {
729        var speed = 275;
730      }
731
732      if (! trim) {
733        var trim = 0;
734      }
735
736      $('body, html').animate({
737        scrollTop: offs - trim
738      }, { duration: speed });
739    });
740  });
741
742  /**
743   * Tabbed Content
744   */
745
746  $( '.tabset' ).each( function() {
747    var tab = $( this ).find( '[role="tab"]' );
748    var all_panel = $( this ).find( '[role="tabpanel"]' );
749
750    tab.each( function( e ) {
751      var panel = '#' + $( this ).attr( 'aria-controls' );
752      var panel_container = $( this ).closest( '.tabset' ).find( '.tabset__panel' );
753
754      $( this ).on( 'click', function( e ) {
755        e.preventDefault();
756
757        all_panel.removeClass( 'is-active' );
758        tab.removeClass( 'is-active' );
759
760        $( this ).addClass( 'is-active' );
761        $( panel ).addClass( 'is-active' );
762
763        panel_container.attr( 'data-active-panel', panel );
764      } );
765    } );
766  } );
767
768  $( '.tabset-hover' ).each( function() {
769    var tab = $( this ).find( '[role="tab"]' );
770    var all_panel = $( this ).find( '[role="tabpanel"]' );
771
772    tab.each( function() {
773      var panel = '#' + $( this ).attr( 'aria-controls' );
774
775      $( this ).on( {
776        mouseenter: function() {
777          all_panel.removeClass( 'is-active' );
778          tab.removeClass( 'is-active' );
779          $( this ).addClass( 'is-active' );
780          $( panel ).addClass( 'is-active' );
781        },
782        // mouseleave: function() {
783        //   $( panel ).removeClass( 'is-active' );
784        // }
785      } );
786    } );
787
788    $( this ).on( 'click', function( e ) {
789      e.preventDefault();
790    } );
791  } );
792
793  var minHeight_tabpanel = function() {
794    $( '.tabset' ).each( function() {
795      var minHeight = 0;
796      var panel = $( this ).find( '[role="tabpanel"]' );
797      var parent = $( this ).find( '.tabset__panel' );
798
799      panel.each( function() {
800        if ( $( this ).height() > minHeight ) {
801          minHeight = $( this ).height();
802        }
803      } );
804
805      parent.css( 'minHeight', minHeight );
806    } );
807  };
808
809  $( document ).ready( function() {
810    minHeight_tabpanel();
811  } );
812
813  $( window ).on( 'resize', function() {
814    setTimeout( minHeight_tabpanel, 400 );
815  } );
816
817  /**
818   * Accordion
819   */
820
821  // Hide inactive panels
822  // $( '.accordion' ).each( function() {
823  //   if ( ! $( this ).hasClass( 'is-open' ) ) {
824  //     $( this ).children( '.accordion__panel' ).hide();
825  //   }
826  // } );
827
828  // $( '.accordion__title' ).on( 'click', function( e ) {
829  //   e.preventDefault();
830
831  //   if ( $( this ).parent( '.accordion' ).hasClass( 'is-open' ) ) {
832  //     $( this ).next( '.accordion__panel' ).slideUp( 275 );
833  //     $( this ).parent( '.accordion' ).removeClass( 'is-open' );
834  //   } else {
835  //     $( this ).next( '.accordion__panel' ).slideDown( 275 );
836  //     $( this ).parent( '.accordion' ).addClass( 'is-open' );
837  //   }
838  // } );
839
840  /**
841   * Vendor: Magnific Popup
842   */
843
844  // $( '.gallery__image' ).magnificPopup( {
845  //   type: 'image',
846  //   gallery: {
847  //     enabled: true
848  //   }
849  // } );
850
851  $('.video-image').magnificPopup({
852    type: 'iframe',
853    midClick: true,
854    removalDelay: 275
855  });
856
857  // $('.close').on('click', function() {
858  //   $.magnificPopup.close();
859  // });
860
861  /**
862   * Vendor: Slick
863   */
864
865  var nextArrow = '<button class="slick-next" type="button">Next Slide<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 792.049 792.049"><path d="M622.955 342.127L268.424 20.521c-27.36-27.36-71.677-27.36-99.037 0s-27.36 71.676 0 99.037l304.749 276.468-304.749 276.466c-27.36 27.359-27.36 71.676 0 99.036s71.677 27.36 99.037 0l354.531-321.606c14.783-14.783 21.302-34.538 20.084-53.897 1.186-19.36-5.301-39.114-20.084-53.898z"/></svg></button>';
866  var prevArrow = '<button class="slick-prev" type="button">Previous Slide<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 792.082 792.082"><path d="M317.896 396.024l304.749-276.467c27.36-27.36 27.36-71.677 0-99.037s-71.677-27.36-99.036 0L169.11 342.161c-14.783 14.783-21.302 34.538-20.084 53.897-1.218 19.359 5.301 39.114 20.084 53.897l354.531 321.606c27.36 27.36 71.677 27.36 99.037 0s27.36-71.677 0-99.036L317.896 396.024z"/></svg></button>';
867
868  $('.community-image-slider.is-reel').slick({
869    nextArrow: nextArrow,
870    prevArrow: prevArrow,
871    rows: 0,
872    speed: 250
873  });
874
875  $('.testimonial-slider.is-reel').slick({
876    arrows: false,
877    appendDots: $('.testimonial-slider').next('.testimonial-slider-dots'),
878    dots: true,
879    fade: true,
880    rows: 0,
881    speed: 250
882  });
883
884  /**
885   * Link List
886   */
887
888  $(document).ready(function() {
889    $('.link-list').each(function() {
890      var li = $(this).find('li a');
891      var svg = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 16"><path d="M13 0l-1.41 1.41L17.17 7H0v2h17.17l-5.58 5.59L13 16l8-8z"/></svg>';
892
893      li.append(svg);
894    });
895  });
896
897  /**
898   * Open external link in new tab
899   */
900  $(document).ready(function() {
901    $('a').filter('[href^="http"], [href^="//"]').not('[href*="' + window.location.host + '"]').attr('rel', 'noopener noreferrer').attr('target', '_blank');
902  });
903
904  /**
905   * Open PDF in new tab
906   */
907  $(document).ready(function() {
908    $('a[href$=".pdf"]').attr('target', '_blank');
909  });
910
911
912
913  /**
914   * Dropdown
915   */
916
917  $(document).on('click', function(e) {
918    if (! $(e.target).closest('.dropdown').length) {
919      $('.dropdown').removeClass('is-active');
920    }
921  });
922
923  $('.dropdown > button').on('click', function(e) {
924    e.preventDefault();
925
926    $('.dropdown').not($(this).closest('.dropdown')).removeClass('is-active');
927
928    $(this).closest('.dropdown').toggleClass('is-active');
929  });
930
931  $('.dropdown-content > li:first-child').on({
932    mouseenter: function() {
933      $(this).closest('ul').addClass('is-top-item-hover');
934    },
935    mouseleave: function() {
936      $(this).closest('ul').removeClass('is-top-item-hover');
937    }
938  });
939
940  /**
941   * Search Utility
942   */
943
944  $('.category-bar .search-form button').on('click', function(e) {
945    var search = $(this).closest('form').find('.search-field');
946
947    if (! search.hasClass('is-active')) {
948      e.preventDefault();
949
950      search.addClass('is-active').focus();
951    } else if (search.hasClass('is-active') && search.val() == '') {
952      e.preventDefault();
953
954      search.removeClass('is-active');
955    }
956  });
957
958  /**
959   * Variable for AJAX load more.
960   */
961  var loadMoreFeedCardPost = 1;
962
963  /**
964   * Category bar.
965   */
966  $('.category-bar a').on('click', function(e) {
967    e.preventDefault();
968
969    var category = $(this).attr('data-filter-category');
970    var pageUrl = new URL(window.location.href);
971    var pageUrlParams = pageUrl.searchParams;
972
973    $('.category-bar li').removeClass('is-active');
974
975    $(this).parent().addClass('is-active');
976
977    if (typeof category != 'undefined' && category) {
978      pageUrlParams.set('category', $(this).attr('data-filter-category'));
979    } else {
980      pageUrlParams.delete('category');
981    }
982
983    window.history.replaceState({}, '', pageUrl);
984
985    // Show spinner
986    $('.spinner').addClass('is-active');
987
988    loadMoreFeedCardPost = 1;
989
990    var posts_per_page = 6;
991    var activeCategories = [];
992    var json_url = '/wp-json/blog/posts?page=1&posts_per_page=' + posts_per_page;
993
994    $('.category-bar li').each(function() {
995      var category = $(this).find('[data-filter-category]');
996
997      if (category.length > 0 && $(this).hasClass('is-active')) {
998        activeCategories.push($(this).find('[data-filter-category]').attr('data-filter-category'));
999      }
1000    });
1001
1002    if (activeCategories.length) {
1003      for (var i = 0; i < activeCategories.length; i++) {
1004        json_url = json_url + '&category[]=' + activeCategories[i];
1005      }
1006    }
1007
1008    $.getJSON(json_url, function(data) {
1009      if (data.length) {
1010        var items = [];
1011
1012        // Sort by date
1013        data.sort((a, b) => (a.date < b.date) ? 1 : -1);
1014
1015        var total_posts = data[0].total_posts;
1016        var total_pages = Math.ceil(total_posts / posts_per_page);
1017
1018        $.each(data, function(key, val) {
1019          const arr = $.map(val, function(el) { return el });
1020
1021          var in_category = false;
1022
1023          const post_id = arr[0];
1024          const post_slug = arr[1];
1025          const post_type = arr[2];
1026          const post_title = arr[3];
1027          const post_img = arr[4];
1028          const post_category = data[key].category;
1029          const post_category_primary = arr[6];
1030          const post_permalink = data[key].permalink;
1031          const post_excerpt = data[key].excerpt;
1032          const post_date_format = data[key].date_format;
1033          const post_author = data[key].author;
1034          const post_thumbnail = data[key].featured_img_src;
1035
1036          var html_post_author = '';
1037
1038          if (post_author) {
1039            html_post_author = `<h6>by ${post_author}</h6>`;
1040          }
1041
1042          var item_string = `
1043            <div class="feed-card-post__cell is-fade">
1044              <div class="card-post">
1045                <a aria-hidden="true" class="card-post__head" href="${post_permalink}" title="${post_title}" style="background-image: url(${post_thumbnail});"></a>
1046
1047                <div class="card-post__body">
1048                  <div class="card-post__content">
1049                    <h4><a href="${post_permalink}" title="${post_title}">${post_title}</a></h6>
1050
1051                    <div class="card-post__meta">
1052                      ${html_post_author}
1053
1054                      <h6>${post_date_format}</h6>
1055                    </div>
1056
1057                    <p>${post_excerpt}</p>
1058                  </div>
1059
1060                  <div class="card-post__link">
1061                    <a class="button" href="${post_permalink}" title="${post_title}">Read More</a>
1062                  </div>
1063                </div>
1064              </div>
1065            </div>
1066          `;
1067
1068          items.push($(item_string));
1069        });
1070
1071        if ($('.feed-card-post__grid .feed-card-post__cell').length) {
1072          $('.feed-card-post__grid .feed-card-post__cell').fadeOut(250, function() {
1073            $('.feed-card-post__grid .feed-card-post__cell').remove();
1074            $('.feed-card-post__grid').append(items);
1075
1076            if (total_pages > 1) {
1077              $('.feed-card-post .button-group').css('display', 'flex');
1078            } else {
1079              $('.feed-card-post .button-group').css('display', 'none');
1080            }
1081
1082            $(items).each(function() {
1083              $(this).fadeIn(250)
1084            });
1085          });
1086        } else {
1087          $('.feed-card-post__grid').append(items);
1088        }
1089      }
1090    }).done(function(data) {
1091
1092      // Hide spinner
1093      $('.spinner').removeClass('is-active');
1094    });
1095  });
1096
1097  /**
1098   * AJAX load more.
1099   */
1100  $('.feed-card-post .load-more').on('click', function(e) {
1101    e.preventDefault();
1102
1103    let jsonFlag = true;
1104
1105    var posts_per_page = 6;
1106
1107    if (jsonFlag) {
1108
1109      // Show spinner
1110      $('.spinner').addClass('is-active');
1111
1112      jsonFlag = false;
1113
1114      loadMoreFeedCardPost++;
1115
1116      var activeCategories = [];
1117
1118      $('.category-bar li').each(function() {
1119        var category = $(this).find('[data-filter-category]');
1120
1121        if (category.length > 0 && $(this).hasClass('is-active')) {
1122          activeCategories.push($(this).find('[data-filter-category]').attr('data-filter-category'));
1123        }
1124      });
1125
1126      var json_url = '/wp-json/blog/posts?page=' + loadMoreFeedCardPost + '&posts_per_page=' + posts_per_page;
1127
1128      if (activeCategories.length) {
1129        for (var i = 0; i < activeCategories.length; i++) {
1130          json_url = json_url + '&category[]=' + activeCategories[i];
1131        }
1132      }
1133
1134      $.getJSON(json_url, function(data) {
1135        if (data.length) {
1136          var items = [];
1137
1138          var total_posts = data[0].total_posts;
1139          var total_pages = Math.ceil(total_posts / posts_per_page);
1140
1141          $.each(data, function(key, val) {
1142            const arr = $.map(val, function(el) { return el });
1143
1144            const post_id = arr[0];
1145            const post_slug = arr[1];
1146            const post_type = arr[2];
1147            const post_title = arr[3];
1148            const post_img = arr[4];
1149            const post_category = data[key].category;
1150            const post_category_primary = arr[6];
1151            const post_permalink = data[key].permalink;
1152            const post_excerpt = data[key].excerpt;
1153            const post_date_format = data[key].date_format;
1154            const post_author = data[key].author;
1155            const post_thumbnail = data[key].featured_img_src;
1156
1157            var html_post_author = '';
1158
1159            if (post_author) {
1160              html_post_author = `<h6>by ${post_author}</h6>`;
1161            }
1162
1163            var item_string = `
1164              <div class="feed-card-post__cell is-fade">
1165                <div class="card-post">
1166                  <a aria-hidden="true" class="card-post__head" href="${post_permalink}" title="${post_title}" style="background-image: url(${post_thumbnail});"></a>
1167
1168                  <div class="card-post__body">
1169                    <div class="card-post__content">
1170                      <h4><a href="${post_permalink}" title="${post_title}">${post_title}</a></h6>
1171
1172                      <div class="card-post__meta">
1173                        ${html_post_author}
1174
1175                        <h6>${post_date_format}</h6>
1176                      </div>
1177
1178                      <p>${post_excerpt}</p>
1179                    </div>
1180
1181                    <div class="card-post__link">
1182                      <a class="button" href="${post_permalink}" title="${post_title}">Read More</a>
1183                    </div>
1184                  </div>
1185                </div>
1186              </div>
1187            `;
1188
1189            items.push($(item_string));
1190          });
1191
1192          $('.feed-card-post__grid').append(items);
1193
1194          $('.feed-card-post .button-group').appendTo('.feed-card-post');
1195
1196          $(items).each(function() {
1197            $(this).fadeIn(250);
1198          });
1199
1200          if (data.length < posts_per_page) {
1201            $('.bloglist-results .paginate-me').hide();
1202          }
1203        }
1204      }).done(function(data) {
1205        var total_posts = data[0].total_posts;
1206        var total_pages = Math.ceil(total_posts / posts_per_page);
1207
1208        if (loadMoreFeedCardPost > total_pages - 1) {
1209          $('.feed-card-post .button-group').hide();
1210        } else {
1211          jsonFlag = true;
1212        }
1213
1214        $('.spinner').removeClass('is-active');
1215      });
1216    }
1217  });
1218});
1219
1220
1221/**
1222 * Banner slider
1223 */
1224
1225jQuery(function ($) {
1226  $('.banner_slider').slick({
1227    arrows: true,
1228    dots: true,
1229    prevArrow: '<button type="button" class="slick-prev">
1229<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true"><g clip-path="url(#clip0_11706_30023)"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.60457 4.28795C8.99782 4.67572 9.00227 5.30887 8.61449 5.70213L3.39046 11L23 11C23.5523 11 24 11.4477 24 12C24 12.5523 23.5523 13 23 13L3.39046 13L8.61449 18.2979C9.00227 18.6911 8.99782 19.3243 8.60457 19.7121C8.21131 20.0998 7.57816 20.0954 7.19039 19.7021L0.287949 12.7021C-0.0959829 12.3128 -0.0959829 11.6872 0.287949 11.2979L7.19039 4.29787C7.57816 3.90462 8.21131 3.90017 8.60457 4.28795Z" fill="#0E0E0E"></path></g><defs><clipPath id="clip0_11706_30023"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></button>',
1230    nextArrow: '<button type="button" class="slick-next"><svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true"><g clip-path="url(#clip0_11706_30022)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3954 4.28795C15.7887 3.90017 16.4218 3.90462 16.8096 4.29787L23.7121 11.2979C24.096 11.6872 24.096 12.3128 23.7121 12.7021L16.8096 19.7021C16.4218 20.0954 15.7887 20.0998 15.3954 19.7121C15.0022 19.3243 14.9977 18.6911 15.3855 18.2979L20.6095 13H1C0.447715 13 0 12.5523 0 12C0 11.4477 0.447715 11 1 11H20.6095L15.3855 5.70213C14.9977 5.30887 15.0022 4.67572 15.3954 4.28795Z" fill="#0E0E0E"></path></g><defs><clipPath id="clip0_11706_30022"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></button>',
1231    responsive: [{
1232      breakpoint: 800,
1233      settings: { arrows: false }
1234    }]
1235  });
1236});

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.