PageSourceSearch

https://besacenter.org/wp-content/plugins/happy-elementor-addons/assets/js/happy-addons.js?ver=3.22.0

js besacenter.org collected 2026-10-02 02:50:48 UTC 65,372 bytes, 1,652 lines download raw bytes

1"use strict";
2
3function _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); }
4function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
7function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9;
10function haObserveTarget(target, callback) {
11  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
12  var observer = new IntersectionObserver(function (entries, observer) {
13    entries.forEach(function (entry) {
14      if (entry.isIntersecting) {
15        callback(entry);
16      }
17    });
18  }, options);
19  observer.observe(target);
20}
21(function ($) {
22  'use strict';
23
24  var $window = $(window);
25  $.fn.getHappySettings = function () {
26    return this.data('happy-settings');
27  };
28  function debounce(func, wait, immediate) {
29    var timeout;
30    return function () {
31      var context = this,
32        args = arguments;
33      var later = function later() {
34        timeout = null;
35        if (!immediate) func.apply(context, args);
36      };
37      var callNow = immediate && !timeout;
38      clearTimeout(timeout);
39      timeout = setTimeout(later, wait);
40      if (callNow) func.apply(context, args);
41    };
42  }
43  function initFilterNav($scope, filterFn) {
44    var $filterNav = $scope.find('.hajs-filter'),
45      defaultFilter = $filterNav.data('default-filter');
46    if ($filterNav.length) {
47      $filterNav.on('click.onFilterNav', 'button', function (event) {
48        event.stopPropagation();
49        var $current = $(this);
50        $current.addClass('ha-filter__item--active').siblings().removeClass('ha-filter__item--active');
51        filterFn($current.data('filter'));
52      });
53      $filterNav.find('[data-filter="' + defaultFilter + '"]').click();
54    }
55  }
56
57  /**
58   * Initialize magnific lighbox gallery
59   *
60   * @param {$element, selector, isEnabled, key} settings
61   */
62  function initPopupGallery(settings) {
63    settings.$element.on('click', settings.selector, function (event) {
64      event.preventDefault();
65    });
66    if (!$.fn.magnificPopup) {
67      return;
68    }
69    if (!settings.isEnabled) {
70      $.magnificPopup.close();
71      return;
72    }
73    var windowWidth = $(window).width(),
74      mobileWidth = elementorFrontendConfig.breakpoints.md,
75      tabletWidth = elementorFrontendConfig.breakpoints.lg;
76    settings.$element.find(settings.selector).magnificPopup({
77      key: settings.key,
78      type: 'image',
79      image: {
80        titleSrc: function titleSrc(item) {
81          return item.el.attr('title') ? item.el.attr('title') : item.el.find('img').attr('alt');
82        }
83      },
84      gallery: {
85        enabled: true,
86        preload: [1, 2]
87      },
88      zoom: {
89        enabled: true,
90        duration: 300,
91        easing: 'ease-in-out',
92        opener: function opener(openerElement) {
93          return openerElement.is('img') ? openerElement : openerElement.find('img');
94        }
95      },
96      disableOn: function disableOn() {
97        if (settings.disableOnMobile && windowWidth < mobileWidth) {
98          return false;
99        }
100        if (settings.disableOnTablet && windowWidth >= mobileWidth && windowWidth < tabletWidth) {
101          return false;
102        }
103        return true;
104      }
105    });
106  }
107  var HandleImageCompare = function HandleImageCompare($scope) {
108    var $item = $scope.find('.hajs-image-comparison'),
109      settings = $item.getHappySettings(),
110      fieldMap = {
111        on_hover: 'move_slider_on_hover',
112        on_swipe: 'move_with_handle_only',
113        on_click: 'click_to_move'
114      };
115    settings[fieldMap[settings.move_handle || 'on_swipe']] = true;
116    delete settings.move_handle;
117    $item.imagesLoaded().done(function () {
118      $item.twentytwenty(settings);
119      var t = setTimeout(function () {
120        $window.trigger('resize.twentytwenty');
121        clearTimeout(t);
122      }, 400);
123    });
124  };
125
126  // Trigger change for nested widgets
127  function triggerChange(el) {
128    $window.trigger('ha:nested:change', [el]);
129  }
130  $(document).on('click', '.e-n-tab-title, .e-n-accordion-item-title', function () {
131    triggerChange(this);
132  });
133  function observeNested() {
134    var observer = new MutationObserver(function (mutations) {
135      mutations.forEach(function (mutation) {
136        if (mutation.type === 'attributes' && (mutation.attributeName === 'class' || mutation.attributeName === 'aria-expanded')) {
137          triggerChange(mutation.target);
138        }
139      });
140    });
141    document.querySelectorAll('.e-n-tabs, .e-n-accordion').forEach(function (el) {
142      observer.observe(el, {
143        attributes: true,
144        subtree: true
145      });
146    });
147  }
148  ;
149  $window.on('elementor/frontend/init', function () {
150    // Call the handlers for the justified widget
151    observeNested();
152    var ModuleHandler = elementorModules.frontend.handlers.Base;
153    var SliderBase = ModuleHandler.extend({
154      bindEvents: function bindEvents() {
155        this.removeArrows();
156        this.run();
157      },
158      removeArrows: function removeArrows() {
159        var _this = this;
160        this.elements.$container.on('init', function () {
161          _this.elements.$container.siblings().hide();
162        });
163      },
164      getDefaultSettings: function getDefaultSettings() {
165        return {
166          autoplay: true,
167          arrows: false,
168          checkVisible: false,
169          container: '.hajs-slick',
170          dots: false,
171          infinite: true,
172          rows: 0,
173          slidesToShow: 1,
174          prevArrow: $('<div />').append(this.findElement('.slick-prev').clone().show()).html(),
175          nextArrow: $('<div />').append(this.findElement('.slick-next').clone().show()).html()
176        };
177      },
178      getDefaultElements: function getDefaultElements() {
179        return {
180          $container: this.findElement(this.getSettings('container'))
181        };
182      },
183      onElementChange: debounce(function () {
184        this.elements.$container.slick('unslick');
185        this.run();
186      }, 200),
187      getSlickSettings: function getSlickSettings() {
188        var $rtl = $('html[dir="rtl"]').length == 1 || $('body').hasClass('rtl');
189        if ('yes' == this.getElementSettings('vertical')) {
190          $rtl = false; // for vertical direction rtl is off
191        }
192
193        // Determine if the widget has the 'ha-slider' class
194        var isHaSlider = this.$element.hasClass('ha-slider');
195
196        // Generate the settings object
197        var settings = {
198          fade: isHaSlider ? this.getElementSettings('slides_transition') === 'fade' : this.getElementSettings('slides_transition') === 'fade' && parseInt(this.getElementSettings('slides_to_show')) === 1,
199          infinite: !!this.getElementSettings('loop'),
200          autoplay: !!this.getElementSettings('autoplay'),
201          autoplaySpeed: this.getElementSettings('autoplay_speed'),
202          speed: this.getElementSettings('animation_speed'),
203          centerMode: !!this.getElementSettings('center'),
204          vertical: !!this.getElementSettings('vertical'),
205          // slidesToScroll: 1,
206          rtl: $rtl
207        };
208        switch (this.getElementSettings('navigation')) {
209          case 'arrow':
210            settings.arrows = true;
211            break;
212          case 'dots':
213            settings.dots = true;
214            break;
215          case 'both':
216            settings.arrows = true;
217            settings.dots = true;
218            break;
219        }
220        var slides_to_scroll = !!this.getElementSettings('slides_to_scroll');
221        settings.slidesToShow = parseInt(this.getElementSettings('slides_to_show')) || 1;
222        settings.slidesToScroll = slides_to_scroll ? parseInt(this.getElementSettings('slides_to_show')) || 1 : 1;
223        settings.responsive = [{
224          breakpoint: elementorFrontend.config.breakpoints.lg,
225          settings: {
226            slidesToShow: parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow,
227            slidesToScroll: slides_to_scroll ? parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow : 1
228          }
229        }, {
230          breakpoint: elementorFrontend.config.breakpoints.md,
231          settings: {
232            slidesToShow: parseInt(this.getElementSettings('slides_to_show_mobile')) || parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow,
233            slidesToScroll: slides_to_scroll ? parseInt(this.getElementSettings('slides_to_show_mobile')) || parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow : 1
234          }
235        }];
236        return $.extend({}
236, this.getSettings(), settings);
237      },
238      run: function run() {
239        this.elements.$container.slick(this.getSlickSettings());
240      }
241    });
242    var NumberHandler = function NumberHandler($scope) {
243      haObserveTarget($scope[0], function () {
244        var $number = $scope.find('.ha-number-text');
245        $number.numerator($number.data('animation'));
246      });
247    };
248    var SkillHandler = function SkillHandler($scope) {
249      haObserveTarget($scope[0], function () {
250        $scope.find('.ha-skill-level').each(function () {
251          var $current = $(this),
252            $lt = $current.find('.ha-skill-level-text'),
253            lv = $current.data('level');
254          $current.animate({
255            width: lv + '%'
256          }, 500);
257          $lt.numerator({
258            toValue: lv + '%',
259            duration: 1300,
260            onStep: function onStep() {
261              $lt.append('%');
262            }
263          });
264        });
265      });
266    };
267    var ImageGrid = ModuleHandler.extend({
268      onInit: function onInit() {
269        ModuleHandler.prototype.onInit.apply(this, arguments);
270        this.run();
271        this.runFilter();
272        $window.on('resize', debounce(this.run.bind(this), 100));
273        // Trigger layout on nested change
274        $window.on('ha:nested:change', debounce(this.run.bind(this), 100));
275      },
276      getLayoutMode: function getLayoutMode() {
277        var layout = this.getElementSettings('layout');
278        return layout === 'even' ? 'masonry' : layout;
279      },
280      getDefaultSettings: function getDefaultSettings() {
281        return {
282          itemSelector: '.ha-image-grid__item',
283          percentPosition: true,
284          layoutMode: this.getLayoutMode()
285        };
286      },
287      getDefaultElements: function getDefaultElements() {
288        return {
289          $container: this.findElement('.hajs-isotope')
290        };
291      },
292      getLightBoxSettings: function getLightBoxSettings() {
293        return {
294          key: 'imagegrid',
295          $element: this.$element,
296          selector: '.ha-js-lightbox',
297          isEnabled: !!this.getElementSettings('enable_popup'),
298          disableOnTablet: !!this.getElementSettings('disable_lightbox_on_tablet'),
299          disableOnMobile: !!this.getElementSettings('disable_lightbox_on_mobile')
300        };
301      },
302      runFilter: function runFilter() {
303        var self = this,
304          lbSettings = this.getLightBoxSettings();
305        initFilterNav(this.$element, function (filter) {
306          self.elements.$container.isotope({
307            filter: filter
308          });
309          if (filter !== '*') {
310            lbSettings.selector = filter;
311          }
312          initPopupGallery(lbSettings);
313        });
314      },
315      onElementChange: function onElementChange(changedProp) {
316        if (['layout', 'image_height', 'columns', 'image_margin', 'enable_popup'].indexOf(changedProp) !== -1) {
317          this.run();
318        }
319      },
320      run: function run() {
321        var self = this;
322        self.elements.$container.isotope(self.getDefaultSettings()).imagesLoaded().progress(function () {
323          self.elements.$container.isotope('layout');
324        });
325        initPopupGallery(self.getLightBoxSettings());
326      }
327    });
328    var JustifiedGrid = ModuleHandler.extend({
329      onInit: function onInit() {
330        ModuleHandler.prototype.onInit.apply(this, arguments);
331        this.run();
332        this.runFilter();
333        $window.on('resize', debounce(this.run.bind(this), 100));
334        // Trigger layout on nested change
335        $window.on('ha:nested:change', debounce(this.run.bind(this), 100));
336      },
337      getDefaultSettings: function getDefaultSettings() {
338        var $defaultSettings = {
339          rowHeight: +this.getElementSettings('row_height.size') || 150,
340          lastRow: this.getElementSettings('last_row'),
341          margins: +this.getElementSettings('margins.size'),
342          captions: !!this.getElementSettings('show_caption')
343        };
344        var $maxRowHeight = {};
345        if ('yes' == this.getElementSettings('max_row_height')) {
346          $maxRowHeight = {
347            maxRowHeight: +this.getElementSettings('row_height.size') || 150
348          };
349        }
350        return $.extend($defaultSettings, $maxRowHeight);
351      },
352      getDefaultElements: function getDefaultElements() {
353        return {
354          $container: this.findElement('.hajs-justified-grid')
355        };
356      },
357      getLightBoxSettings: function getLightBoxSettings() {
358        return {
359          key: 'justifiedgallery',
360          $element: this.$element,
361          selector: '.ha-js-lightbox',
362          isEnabled: !!this.getElementSettings('enable_popup'),
363          disableOnTablet: !!this.getElementSettings('disable_lightbox_on_tablet'),
364          disableOnMobile: !!this.getElementSettings('disable_lightbox_on_mobile')
365        };
366      },
367      runFilter: function runFilter() {
368        var self = this,
369          lbSettings = this.getLightBoxSettings(),
370          settings = {
371            lastRow: this.getElementSettings('last_row')
372          };
373        initFilterNav(self.$element, function (filter) {
374          if (filter !== '*') {
375            settings.lastRow = 'nojustify';
376            lbSettings.selector = filter;
377          }
378          settings.filter = filter;
379          self.elements.$container.justifiedGallery(settings);
380          initPopupGallery(lbSettings);
381        });
382      },
383      onElementChange: function onElementChange(changedProp) {
384        if (['row_height', 'max_row_height', 'last_row', 'margins', 'show_caption', 'enable_popup'].indexOf(changedProp) !== -1) {
385          this.run();
386        }
387      },
388      run: function run() {
389        this.elements.$container.justifiedGallery(this.getDefaultSettings());
390        initPopupGallery(this.getLightBoxSettings());
391      }
392    });
393
394    // NewsTicker
395    var NewsTicker = ModuleHandler.extend({
396      onInit: function onInit() {
397        ModuleHandler.prototype.onInit.apply(this, arguments);
398        this.wrapper = this.$element.find('.ha-news-ticker-wrapper');
399        this.run();
400      },
401      onElementChange: function onElementChange(changed_prop) {
402        if (changed_prop === 'item_space' || changed_prop === 'title_typography_font_size') {
403          this.run();
404        }
405      },
406      run: function run() {
407        if (0 == this.wrapper.length) {
408          return;
409        }
410        var wrapper_height = this.wrapper.innerHeight(),
411          wrapper_width = this.wrapper.innerWidth(),
412          container = this.wrapper.find('.ha-news-ticker-container'),
413          single_item = container.find('.ha-news-ticker-item'),
414          scroll_direction = this.wrapper.data('scroll-direction'),
415          scroll = "scroll" + scroll_direction + parseInt(wrapper_height) + parseInt(wrapper_width),
416          duration = this.wrapper.data('duration'),
417          direction = 'normal',
418          all_title_width = 10;
419        var start = {
420            'transform': 'translateX(0' + wrapper_width + 'px)'
421          },
422          end = {
423            'transform': 'translateX(-101%)'
424          };
425        if ('right' === scroll_direction) {
426          direction = 'reverse';
427        }
428        single_item.each(function () {
429          all_title_width += $(this).outerWidth(true);
430        });
431        container.css({
432          'width': all_title_width,
433          'display': 'flex'
434        });
435        $.keyframe.define([{
436          name: scroll,
437          '0%': start,
438          '100%': end
439        }]);
440        container.playKeyframe({
441          name: scroll,
442          duration: duration.toString() + "ms",
443          timingFunction: 'linear',
444          delay: '0s',
445          iterationCount: 'infinite',
446          direction: direction,
447          fillMode: 'none',
448          complete: function complete() {}
449        });
450      }
451    });
452
453    // Fun factor
454    var FunFactor = function FunFactor($scope) {
455      haObserveTarget($scope[0], function () {
456        var $fun_factor = $scope.find('.ha-fun-factor__content-number');
457        $fun_factor.numerator($fun_factor.data('animation'));
458      });
459    };
460    var BarChart = function BarChart($scope) {
461      haObserveTarget($scope[0], function () {
462        var $container = $scope.find('.ha-bar-chart-container'),
463          $chart_canvas = $scope.find('#ha-bar-chart'),
464          settings = $container.data('settings');
465        if ($container.length) {
466          new Chart($chart_canvas, settings);
467        }
468      });
469    };
470
471    //twitter Feed
472    var TwitterFeed = function TwitterFeed($scope) {
473      var button = $scope.find('.ha-twitter-load-more');
474      var twitter_wrap = $scope.find('.ha-tweet-items');
475      button.on("click", function (e) {
476        e.preventDefault();
477        var $self = $(this),
478          query_settings = $self.data("settings"),
479          widget_id = $scope.data("id"),
480          total = $self.data("total"),
481          items = $scope.find('.ha-tweet-item').length;
482        $.ajax({
483          url: HappyLocalize.ajax_url,
484          type: 'POST',
485          data: {
486            action: "ha_twitter_feed_action",
487            security: HappyLocalize.nonce,
488            query_settings: query_settings,
489            widget_id: widget_id,
490            loaded_item: items
491          },
492          success: function success(response) {
493            if (total > items) {
494              $(response).appendTo(twitter_wrap);
495            } else {
496              $self.text('All Loaded').addClass('loaded');
497              setTimeout(function () {
498                $self.css({
499                  "display": "none"
500                });
501              }, 800);
502            }
503          },
504          error: function error(_error) {}
505        });
506      });
507    };
508
509    //PostTab
510    var PostTab = ModuleHandler.extend({
511      onInit: function onInit() {
512        ModuleHandler.prototype.onInit.apply(this, arguments);
513        this.wrapper = this.$element.find('.ha-post-tab');
514        this.run();
515      },
516      run: function run() {
517        var filter_wrap = this.wrapper.find('.ha-post-tab-filter'),
518          filter = filter_wrap.find('li'),
519          event = this.wrapper.data('event'),
520          args = this.wrapper.data('query-args');
521        filter.on(event, debounce(function (e) {
522          e.preventDefault();
523          var $self = $(this),
524            term_id = $self.data("term"),
525            $wrapper = $self.closest(".ha-post-tab"),
526            content = $wrapper.find('.ha-post-tab-content'),
527            loading = content.find('.ha-post-tab-loading'),
528            tab_item = content.find('.ha-post-tab-item-wrapper'),
529            $content_exist = false;
530          if (0 === loading.length) {
531            filter.removeClass('active');
532            tab_item.removeClass('active');
533            $self.addClass('active');
534            tab_item.each(function () {
535              var $self = $(this),
536                $content_id = $self.data("term");
537              if (term_id === $content_id) {
538                $self.addClass('active');
539                $content_exist = true;
540              }
541            });
542            if (false === $content_exist) {
543              $.ajax({
544                url: HappyLocalize.ajax_url,
545                type: 'POST',
546                data: {
547                  action: "ha_post_tab_action",
548                  security: HappyLocalize.nonce,
549                  post_tab_query: args,
550                  term_id: term_id
551                },
552                beforeSend: function beforeSend() {
553                  content.append('<span class="ha-post-tab-loading"><i class="eicon-spinner eicon-animation-spin"></i></span>');
554                },
555                success: function success(response) {
556                  content.find('.ha-post-tab-loading').remove();
557                  content.append(response);
558                },
559                error: function error(_error2) {}
560              });
561            }
562          }
563        }, 200));
564      }
565    });
566    var DataTable = function DataTable($scope) {
567      var columnTH = $scope.find('.ha-table__head-column-cell');
568      var rowTR = $scope.find('.ha-table__body-row');
569
570      // Step 1: Handle rowspan by inserting placeholder cells ("nullval")
571      rowTR.each(function (i, tr) {
572        var cells = $(tr).find('.ha-table__body-row-cell');
573        cells.each(function (index, cell) {
574          var $cell = $(cell);
575          var rowspan = parseInt($cell.attr("rowspan"), 10);
576          if (rowspan > 1) {
577            for (var j = i + 1; j < i + rowspan && j < rowTR.length; j++) {
578              var targetRow = $(rowTR).eq(j);
579              var targetCell = targetRow.children().eq(index);
580              $('<td class="ha-table__body-row-cell test">nullval</td>').insertBefore(targetCell);
581            }
582          }
583        });
584      });
585
586      // Step 2: Add header labels or remove placeholder cells
587      rowTR.each(function (i, tr) {
588        var cells = $(tr).find('.ha-table__body-row-cell');
589        cells.each(function (index, cell) {
590          var $cell = $(cell);
591          var cellContent = $cell.html();
592          if (cellContent.indexOf("nullval") === -1) {
593            var headerContent = columnTH.eq(index).html();
594            $cell.prepend('<div class="ha-table__head-column-cell">' + headerContent + '</div>');
595          } else {
596            $cell.remove();
597          }
598        });
599      });
600    };
601
602    //Threesixty Rotation
603    var Threesixty_Rotation = function Threesixty_Rotation($scope) {
604      var ha_circlr = $scope.find('.ha-threesixty-rotation-inner');
605      var cls = ha_circlr.data('selector');
606      var autoplay = ha_circlr.data('autoplay');
607      var glass_on = $scope.find('.ha-threesixty-rotation-magnify');
608      var t360 = $scope.find('.ha-threesixty-rotation-360img');
609      var zoom = glass_on.data('zoom');
610      var playb = $scope.find('.ha-threesixty-rotation-play');
611      var crl = circlr(cls, {
612        play: true
613      });
614      if ('on' === autoplay) {
615        var autoplay_btn = $scope.find('.ha-threesixty-rotation-autoplay');
616        autoplay_btn.on('click', function (el) {
617          el.preventDefault();
618          crl.play();
619          t360.remove();
620        });
621        setTimeout(function () {
622          autoplay_btn.trigger('click');
623          autoplay_btn.remove();
624        }, 1000);
625      } else {
626        playb.on('click', function (el) {
627          el.preventDefault();
628          var $self = $(this);
629          var $i = $self.find('i');
630          if ($i.hasClass('hm-play-button')) {
631            $i.removeClass('hm-play-button');
632            $i.addClass('hm-stop');
633            crl.play();
634          } else {
635            $i.removeClass('hm-stop');
636            $i.addClass('hm-play-button');
637            crl.stop();
638          }
639          t360.remove();
640        });
641      }
642      glass_on.on('click', function (el) {
643        var img_block = $scope.find('img');
644        img_block.each(function () {
645          var style = $(this).attr('style');
646          if (-1 !== style.indexOf("block")) {
647            HappySimplaMagnify($(this)[0], zoom);
648            glass_on.css('display', 'none');
649            t360.remove();
650          }
651        });
652      });
653      $(document).on('click', function (e) {
654        var t = $(e.target);
655        var magnifier = $scope.find('.ha-img-magnifier-glass');
656        var i = glass_on.find('i');
657        if (magnifier.length && t[0] !== i[0]) {
658          magnifier.remove();
659          glass_on.removeAttr('style');
660        }
661        if (t[0] === ha_circlr[0]) {
662          t360.remove();
663        }
664      });
665      ha_circlr.on('mouseup mousedown touchstart touchend', function (e) {
666        t360.remove();
667      });
668    };
669
670    //Event Calendar
671    var Event_Calendar = function Event_Calendar($scope) {
672      var calendarEl = $scope.find('.ha-ec');
673      var popup = $scope.find('.ha-ec-popup-wrapper');
674      var popupClose = $scope.find(".ha-ec-popup-close");
675      // var events = calendarEl.data('events');
676      var initialview = calendarEl.data('initialview');
677      var firstday = calendarEl.data('firstday');
678      var locale = calendarEl.data('locale');
679      var showPopup = calendarEl.data('show-popup');
680      var allday_text = calendarEl.data('allday-text');
681      var time_format = calendarEl.data('time-format');
682      var ECjson = window['HaECjson' + $scope.data('id')];
683      var events = ECjson;
684      if ('undefined' == typeof events) {
685        return;
686      }
687      var option = {
688        stickyHeaderDates: false,
689        locale: locale,
690        headerToolbar: {
691          left: "prev,next today",
692          center: "title",
693          right: "dayGridMonth,timeGridWeek,timeGridDay,listMonth"
694        },
695        initialView: initialview,
696        firstDay: firstday,
697        eventTimeFormat: {
698          // like '7pm'
699          hour: 'numeric',
700          minute: '2-digit',
701          meridiem: 'short'
702        },
703        events: events,
704        height: 'auto',
705        eventClick: function eventClick(info) {
706          if ('yes' == showPopup) {
707            // don't let the browser navigate
708            var getTheDate = function getTheDate(timeString) {
709              return new Date(timeString);
710            };
711            var timeFormat = function timeFormat(date) {
712              var time_format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'g:i a';
713              return function (date) {
714                // Parse the input time
715                var hours = date.getHours();
716                var minutes = date.getMinutes();
717                var date = new Date();
718                date.setHours(hours);
719                date.setMinutes(minutes);
720                var options = {};
721                if (time_format.includes('H')) {
722                  options.hour = '2-digit';
723                  options.hour12 = false;
724                } else {
725                  options.hour = 'numeric';
726                  options.hour12 = true;
727                  if (time_format.includes('a') || time_format.includes('A')) {
728                    options.hour = 'numeric';
729                  }
730                }
731                options.minute = '2-digit';
732                var formattedTime = new Intl.DateTimeFormat('en-US', options).format(date);
733                if (time_format.includes('a')) {
734                  formattedTime = formattedTime.toLowerCase();
735                }
736                return formattedTime;
737              }(date);
738            };
739            info.jsEvent.preventDefault();
740            var todayDateString = info.view.calendar.currentData.currentDate.toString(),
741              allDay = info.event.allDay,
742              title = info.event.title,
743              startDate = info.event.startStr,
744              endDate = info.event.endStr,
745              guest = info.event.extendedProps.guest,
746              location = info.event.extendedProps.location,
747              description = info.event.extendedProps.description,
748              detailsUrl = info.event.url,
749              imageUrl = info.event.extendedProps.image;
750            var titleWrap = popup.find('.ha-ec-event-title'),
751              timeWrap = popup.find('.ha-ec-event-time-wrap'),
752              guestWrap = popup.find('.ha-ec-event-guest-wrap'),
753              locationWrap = popup.find('.ha-ec-event-location-wrap'),
754              descWrap = popup.find('.ha-ec-popup-desc'),
755              detailsWrap = popup.find('.ha-ec-popup-readmore-link'),
756              imageWrap = popup.find('.ha-ec-popup-image');
757
758            // display none
759            imageWrap.css('display', 'none');
760            titleWrap.css('display', 'none');
761            timeWrap.css('display', 'none');
762            guestWrap.css('display', 'none');
763            locationWrap.css('display', 'none');
764            descWrap.css('display', 'none');
765            detailsWrap.css('display', 'none');
766            popup.addClass("ha-ec-popup-ready");
767
768            // image markup
769            if (imageUrl) {
770              imageWrap.removeAttr("style");
771              imageWrap.find('img').attr("src", imageUrl);
772              imageWrap.find('img').attr("alt", title);
773            }
774
775            // title markup
776            if (title) {
777              titleWrap.removeAttr("style");
778              titleWrap.text(title);
779            }
780
781            // guest markup
782            if (guest) {
783              guestWrap.removeAttr("style");
784              guestWrap.find('span.ha-ec-event-guest').text(guest);
785            }
786
787            // location markup
788            if (location) {
789              locationWrap.removeAttr("style");
790              locationWrap.find('span.ha-ec-event-location').text(location);
791            }
792
793            // description markup
794            if (description) {
795              descWrap.removeAttr("style");
796              descWrap.html(description);
797            }
798
799            // time markup
800            if (allDay !== true) {
801              timeWrap.removeAttr("style");
802              startDate = Date.parse(getTheDate(startDate));
803              endDate = Date.parse(getTheDate(endDate));
804              var startTimeText = timeFormat(getTheDate(startDate), time_format);
805              var endTimeText = 'Invalid Data';
806              if (startDate < endDate) {
807                endTimeText = timeFormat(getTheDate(endDate), time_format);
808              }
809              timeWrap.find('span.ha-ec-event-time').text(startTimeText + ' - ' + endTimeText);
810            } else {
811              timeWrap.removeAttr("style");
812              timeWrap.find('span.ha-ec-event-time').text(allday_text);
813            }
814
815            // read more markup
816            if (detailsUrl) {
817              detailsWrap.removeAttr("style");
818              detailsWrap.attr("href", detailsUrl);
819              if ("on" === info.event.extendedProps.external) {
820                detailsWrap.attr("target", "_blank");
821              }
822              if ("on" === info.event.extendedProps.nofollow) {
823                detailsWrap.attr("rel", "nofollow");
824              }
825            }
826          } else {
827            if (info.event.url && info.event.extendedProps.external) {
828              info.jsEvent.preventDefault();
829              var id = $scope.data('id'),
830                anchor = document.createElement('a'),
831                anchorReal,
832                timeout;
833              anchor.id = 'happy-even-calender-link-' + id;
834              anchor.href = info.event.url;
835              anchor.target = info.event.extendedProps.external ? '_blank' : '_self';
836              anchor.rel = info.event.extendedProps.nofollow ? 'nofollow noreferer' : '';
837              anchor.style.display = 'none';
838              document.body.appendChild(anchor);
839              anchorReal = document.getElementById(anchor.id);
840              anchorReal.click();
841              timeout = setTimeout(function () {
842                document.body.removeChild(anchorReal);
843                clearTimeout(timeout);
844              });
845              return false;
846            }
847          }
848        },
849        dateClick: function dateClick(arg) {
850          itemDate = arg.date.toUTCString();
851        }
852      };
853      var calendar = new FullCalendar.Calendar(calendarEl[0], option);
854      calendar.render();
855      $scope.find(".ha-ec-popup-wrapper").on("click", function (e) {
856        e.stopPropagation();
857        if (e.target === e.currentTarget || e.target == popupClose[0] || e.target == popupClose.find(".eicon-editor-close")[0]) {
858          popup.addClass("ha-ec-popup-removing").removeClass("ha-ec-popup-ready");
859        }
860      });
861    };
862    var MailChimp = function MailChimp($scope) {
863      var elForm = $scope.find('.ha-mailchimp-form'),
864        elMessage = $scope.find('.ha-mc-response-message'),
865        successMessage = elForm.data('success-message');
866      elForm.on('submit', function (e) {
867        e.preventDefault();
868        var data = {
869          action: 'ha_mailchimp_ajax',
870          security: HappyLocalize.nonce,
871          subscriber_info: elForm.serialize(),
872          list_id: elForm.data('list-id'),
873          post_id: elForm.parent().data('post-id'),
874          widget_id: elForm.parent().data('widget-id')
875        };
876        $.ajax({
877          type: 'post',
878          url: HappyLocalize.ajax_url,
879          data: data,
880          success: function success(response) {
881            elForm.trigger('reset');
882            if (response.status) {
883              elMessage.removeClass('error');
884              elMessage.addClass('success');
885              elMessage.text(successMessage);
886            } else {
887              elMessage.addClass('error');
888              elMessage.removeClass('success');
889              elMessage.text(response.msg);
890            }
891            var hideMsg = setTimeout(function () {
892              elMessage.removeClass('error');
893              elMessage.removeClass('success');
894              clearTimeout(hideMsg);
895            }, 5000);
896          },
897          error: function error(_error3) {}
898        });
899      });
900    };
901
902    //Image Accordion
903    var Image_Accordion = function Image_Accordion($scope) {
904      if ($scope.hasClass('ha-image-accordion-click')) {
905        var items = $scope.find('.ha-ia-item');
906        items.each(function (inx, btn) {
907          $(this).on('click', function (e) {
908            // e.preventDefault();
909            if ($(this).hasClass('active')) {
910              return;
911            } else {
912              items.removeClass('active');
913              $(this).addClass('active');
914            }
915          });
916        });
917      }
918    };
919
920    //Content Switcher
921    var Content_Switcher = function Content_Switcher($scope) {
922      var parent = $scope.find('.ha-content-switcher-wrapper'),
923        designType = parent.data('design-type');
924      if (designType == 'button') {
925        var buttons = parent.find('.ha-cs-button'),
926          contents = parent.find('.ha-cs-content-section');
927        buttons.each(function (inx, btn) {
928          $(this).on('click', function (e) {
929            e.preventDefault();
930            if ($(this).hasClass('active')) {
931              return;
932            } else {
933              buttons.removeClass('active');
934              $(this).addClass('active');
935              contents.removeClass('active');
936              var contentId = $(this).data('content-id');
937              parent.find('#' + contentId).addClass('active');
938            }
939          });
940        });
941      } else {
942        var toggleSwitch = parent.find('.ha-cs-switch.ha-input-label'),
943          input = parent.find('input.ha-cs-toggle-switch'),
944          primarySwitcher = parent.find('.ha-cs-switch.primary'),
945          secondarySwitcher = parent.find('.ha-cs-switch.secondary'),
946          primaryContent = parent.find('.ha-cs-content-section.primary'),
947          secondaryContent = parent.find('.ha-cs-content-section.secondary');
948        toggleSwitch.on('click', function (e) {
949          if (input.is(':checked')) {
950            primarySwitcher.removeClass('active');
951            primaryContent.removeClass('active');
952            secondarySwitcher.addClass('active');
953            secondaryContent.addClass('active');
954          } else {
955            secondarySwitcher.removeClass('active');
956            secondaryContent.removeClass('active');
957            primarySwitcher.addClass('active');
958            primaryContent.addClass('active');
959          }
960        });
961      }
962    };
963
964    //Team Member
965    var Team_Member = function Team_Member($scope) {
966      var btn = $scope.find('.ha-btn');
967      var lightBox = $scope.find('.ha-member-lightbox');
968      if (lightBox.length > 0) {
969        var close = lightBox.find('.ha-member-lightbox-close');
970        btn.on('click', function () {
971          lightBox.addClass('ha-member-lightbox-show');
972        });
973        lightBox.on('click', function (e) {
974          if (lightBox.hasClass('ha-member-lightbox-show')) {
975            if (e.target == lightBox[0]) {
976              lightBox.removeClass('ha-member-lightbox-show');
977            } else if (e.target == close[0]) {
978              lightBox.removeClass('ha-member-lightbox-show');
979            } else if (e.target == close.find('i.eicon-editor-close')[0]) {
980              lightBox.removeClass('ha-member-lightbox-show');
981            }
982          }
983        });
984      }
985    };
986
987    //Creative Button
988    var Creative_Button = function Creative_Button($scope) {
989      var btn_wrap = $scope.find('.ha-creative-btn-wrap');
990      var magnetic = btn_wrap.data('magnetic');
991      var btn = btn_wrap.find('a.ha-creative-btn');
992      if ('yes' == magnetic) {
993        btn_wrap.on('mousemove', function (e) {
994          var x = e.pageX - (btn_wrap.offset().left + btn_wrap.outerWidth() / 2);
995          var y = e.pageY - (btn_wrap.offset().top + btn_wrap.outerHeight() / 2);
996          btn.css("transform", "translate(" + x * 0.3 + "px, " + y * 0.5 + "px)");
997        });
998        btn_wrap.on('mouseout', function (e) {
999          btn.css("transform", "translate(0px, 0px)");
1000        });
1001      }
1002      //For expandable button style only
1003      var expandable = $scope.find('.ha-eft--expandable');
1004      var text = expandable.find('.text');
1005      if (expandable.length > 0 && text.length > 0) {
1006        text[0].addEventListener("transitionend", function () {
1007          if (text[0].style.width) {
1008            text[0].style.width = "auto";
1009          }
1010        });
1011        expandable[0].addEventListener("mouseenter", function (e) {
1012          e.currentTarget.classList.add('hover');
1013          text[0].style.width = "auto";
1014          var predicted_answer = text[0].offsetWidth;
1015          text[0].style.width = "0";
1016          window.getComputedStyle(text[0]).transform;
1017          text[0].style.width = "".concat(predicted_answer, "px");
1018        });
1019        expandable[0].addEventListener("mouseleave", function (e) {
1020          e.currentTarget.classList.remove('hover');
1021          text[0].style.width = "".concat(text[0].offsetWidth, "px");
1022          window.getComputedStyle(text[0]).transform;
1023          text[0].style.width = "";
1024        });
1025      }
1026    };
1027    var PDF_View = function PDF_View($scope) {
1028      var $id = $scope.data('id');
1029      var $settings = $scope.find(".viewer-" + $id).data('pdf-settings');
1030      var options = {
1031        width: $settings.width,
1032        height: $settings.height,
1033        page: $settings.page_number
1034      };
1035      PDFObject.embed($settings.pdf_url, "#" + $settings.unique_id, options);
1036    };
1037    var Comparison_Table = function Comparison_Table($scope) {
1038      var $table = $scope.find('.ha-comparison-table-wrapper');
1039      var $table_head = $scope.find('.ha-comparison-table__head');
1040      var $sticky_header = $table_head.data('sticky-header');
1041      var $section_height = $scope.height();
1042      var $table_height = $table.innerHeight();
1043      var $tableOffsetTop = $table.offset().top;
1044      if ($sticky_header === 'yes') {
1045        $window.scroll(function () {
1046          var offset = $(this).scrollTop();
1047          if (offset >= $tableOffsetTop) {
1048            $table_head.addClass('table-sticky');
1049          } else if (offset > $table_height) {
1050            $table_head.removeClass('table-sticky');
1051          }
1052        });
1053      }
1054    };
1055
1056    // Slider
1057    elementorFrontend.hooks.addAction('frontend/element_ready/ha-slider.default', function ($scope) {
1058      elementorFrontend.elementsHandler.addHandler(SliderBase, {
1059        $element: $scope
1060      });
1061    });
1062
1063    // Carousel
1064    elementorFrontend.hooks.addAction('frontend/element_ready/ha-carousel.default', function ($scope) {
1065      elementorFrontend.elementsHandler.addHandler(SliderBase, {
1066        $element: $scope
1067      });
1068    });
1069
1070    //Horizontal Timeline
1071    elementorFrontend.hooks.addAction('frontend/element_ready/ha-horizontal-timeline.default', function ($scope) {
1072      elementorFrontend.elementsHandler.addHandler(SliderBase, {
1073        $element: $scope,
1074        autoplay: false,
1075        container: '.ha-horizontal-timeline-wrapper',
1076        navigation: 'arrow',
1077        arrows: true
1078      });
1079      var img_wrap = $scope.find(".ha-horizontal-timeline-image");
1080      var magnific_popup = img_wrap.data("mfp-src");
1081      if (undefined !== magnific_popup) {
1082        img_wrap.magnificPopup({
1083          type: "image",
1084          gallery: {
1085            enabled: true
1086          }
1087        });
1088      }
1089    });
1090
1091    // elementorFrontend.hooks.addAction(
1092    // 	'frontend/element_ready/ha-mailchimp.default',
1093    // 	function ($scope) {
1094    // 		elementorFrontend.elementsHandler.addHandler(MailChimp, {
1095    // 			$element: $scope,
1096    // 		});
1097    // 	}
1098    // );
1099
1100    $('body').on('click.onWrapperLink', '[data-ha-element-link]', function () {
1101      var $wrapper = $(this),
1102        data = $wrapper.data('ha-element-link'),
1103        id = $wrapper.data('id'),
1104        anchor = document.createElement('a'),
1105        anchorReal,
1106        timeout;
1107      anchor.id = 'happy-addons-wrapper-link-' + id;
1108      anchor.href = data.url;
1109      anchor.target = data.is_external ? '_blank' : '_self';
1110      anchor.rel = data.nofollow ? 'nofollow noreferer' : '';
1111      anchor.style.display = 'none';
1112      document.body.appendChild(anchor);
1113      anchorReal = document.getElementById(anchor.id);
1114      anchorReal.click();
1115      timeout = setTimeout(function () {
1116        document.body.removeChild(anchorReal);
1117        clearTimeout(timeout);
1118      });
1119    });
1120
1121    // Background overlay extension
1122    var BackgroundOverlay = function BackgroundOverlay($scope) {
1123      $scope.hasClass('elementor-element-edit-mode') && $scope.addClass('ha-has-bg-overlay');
1124    };
1125    var fnHanlders = {
1126      'ha-image-compare.default': HandleImageCompare,
1127      'ha-number.default': NumberHandler,
1128      'ha-skills.default': SkillHandler,
1129      'ha-fun-factor.default': FunFactor,
1130      'ha-bar-chart.default': BarChart,
1131      'ha-twitter-feed.default': TwitterFeed,
1132      'ha-threesixty-rotation.default': Threesixty_Rotation,
1133      'ha-data-table.default': DataTable,
1134      // 'widget'                        : BackgroundOverlay,
1135      'section': BackgroundOverlay,
1136      'column': BackgroundOverlay,
1137      'ha-event-calendar.default': Event_Calendar,
1138      'ha-mailchimp.default': MailChimp,
1139      'ha-image-accordion.default': Image_Accordion,
1140      'ha-content-switcher.default': Content_Switcher,
1141      'ha-member.default': Team_Member,
1142      'ha-creative-button.default': Creative_Button,
1143      'ha-pdf-view.default': PDF_View,
1144      'ha-comparison-table.default': Comparison_Table
1145    };
1146    $.each(fnHanlders, function (widgetName, handlerFn) {
1147      elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, handlerFn);
1148    });
1149    var classHandlers = {
1150      'ha-image-grid.default': ImageGrid,
1151      'ha-justified-gallery.default': JustifiedGrid,
1152      'ha-news-ticker.default': NewsTicker,
1153      'ha-post-tab.default': PostTab
1154    };
1155    $.each(classHandlers, function (widgetName, handlerClass) {
1156      elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, function ($scope) {
1157        elementorFrontend.elementsHandler.addHandler(handlerClass, {
1158          $element: $scope
1159        });
1160      });
1161    });
1162
1163    //nav menu
1164    var NavigationMenu = function __init($scope) {
1165      var navMenu = $scope.find('.ha-nav-menu');
1166
1167      //for tablet only
1168      if (jQuery(window).width() < 1025 && jQuery(window).width() > 767) {
1169        var indicator = navMenu.find('.ha-submenu-indicator-wrap');
1170        indicator.on('click', function (e) {
1171          e.preventDefault();
1172          var $parentEl = $(this).parent('li.menu-item-has-children');
1173          if ($parentEl) {
1174            $parentEl.children('ul.sub-menu').slideToggle();
1175          }
1176        });
1177      }
1178      var humBurgerBtn = navMenu.find('.ha-menu-toggler');
1179      humBurgerBtn.on('click', function (e) {
1180        var humberger = $(this).data('humberger');
1181        var $pel = navMenu.find('ul.menu');
1182        if ('open' == humberger) {
1183          $('.ha-menu-open-icon').addClass('hide-icon');
1184          $('.ha-menu-close-icon').removeClass('hide-icon');
1185          $('.ha-menu-close-icon').addClass('show-icon');
1186          $pel.slideDown();
1187        } else {
1188          $('.ha-menu-close-icon').addClass('hide-icon');
1189          $('.ha-menu-open-icon').removeClass('hide-icon');
1190          $('.ha-menu-open-icon').addClass('show-icon');
1191          $pel.slideUp();
1192        }
1193      });
1194      function burgerClsAdd() {
1195        if (jQuery(window).width() < 768) {
1196          navMenu.removeClass('ha-navigation-menu-wrapper');
1197          navMenu.addClass('ha-navigation-burger-menu');
1198          var humBurgerSubMenuBtn = navMenu.find('.ha-submenu-indicator-wrap');
1199          humBurgerSubMenuBtn.on('click', function (e) {
1200            e.preventDefault();
1201            var $parentEl = $(this).parent('li.menu-item-has-children');
1202            if ($parentEl) {
1203              $parentEl.children('ul.sub-menu').slideToggle();
1204            }
1205          });
1206        } else {
1207          navMenu.addClass('ha-navigation-menu-wrapper');
1208          navMenu.removeClass('ha-navigation-burger-menu');
1209          navMenu.find('ul.menu').removeAttr('style');
1210          navMenu.find('ul.sub-menu').removeAttr('style');
1211        }
1212      }
1213      burgerClsAdd();
1214      $window.on('resize', debounce(burgerClsAdd, 100));
1215    };
1216    elementorFrontend.hooks.addAction("frontend/element_ready/ha-navigation-menu.default", NavigationMenu);
1217    var AgeGate = function AgeGate($scope, $) {
1218      if (elementorFrontend.isEditMode()) {
1219        localStorage.removeItem("ha-age-gate-expire-time");
1220        if ($scope.find('.ha-age-gate-wrapper').length) {
1221          var editor_mood = $scope.find('.ha-age-gate-wrapper').data('editor_mood');
1222          if ('no' == editor_mood) {
1223            $scope.find('.ha-age-gate-wrapper').hide();
1224          }
1225        }
1226      } else if (!elementorFrontend.isEditMode()) {
1227        var container = $scope.find('.ha-age-gate-wrapper'),
1228          cookies_time = container.data('age_gate_cookies_time'),
1229          exd = localStorage.getItem("ha-age-gate-expire-time");
1230        //container.closest("body").find("header").css("display","none");
1231        container.closest("body").css("overflow", "hidden");
1232        var cdate = new Date();
1233        var endDate = new Date();
1234        endDate.setDate(cdate.getDate() + cookies_time);
1235        $("body,html,document").scrollTop($scope.offset().top);
1236        var t = setTimeout(function () {
1237          $("body,html,document").scrollTop($("body").offset().top);
1238          clearTimeout(t);
1239        }, 1000);
1240        if (exd != '' && exd != undefined && new Date(cdate) <= new Date(exd)) {
1241          $('.ha-age-gate-wrapper').hide();
1242          container.closest("body").css("overflow", "");
1243        } else if (exd != '' && exd != undefined && new Date(cdate) > new Date(exd)) {
1244          localStorage.removeItem("ha-age-gate-expire-time");
1245          $('.ha-age-gate-wrapper').show();
1246        } else {
1247          $('.ha-age-gate-wrapper').show();
1248        }
1249
1250        /*confirm-age*/
1251        if ($scope.find('.ha-age-gate-wrapper.ha-age-gate-confirm-age').length) {
1252          $(".ha-age-gate-confirm-age-btn").on("click", function () {
1253            localStorage.setItem("ha-age-gate-expire-time", endDate);
1254            $(this).closest(".ha-age-gate-wrapper").hide();
1255            //$(this).closest("body").find("header").css("display","block");
1256            $(this).closest("body").css("overflow", "");
1257          });
1258        }
1259
1260        /*confirm-dob*/
1261        if ($scope.find('.ha-age-gate-wrapper.ha-age-gate-confirm-dob').length) {
1262          $(".ha-age-gate-confirm-dob-btn").on("click", function () {
1263            var birthYear = new Date(Date.parse($(this).closest('.ha-age-gate-form-body').find('.ha-age-gate-date-input').val())),
1264              agebirth = birthYear.getFullYear(),
1265              currentYear = cdate.getFullYear(),
1266              userage = currentYear - agebirth,
1267              agelimit = $(this).closest('.ha-age-gate-wrapper').data("userbirth");
1268            if (userage < agelimit) {
1269              $(this).closest('.ha-age-gate-boxes').find('.ha-age-gate-warning-msg').show();
1270            } else {
1271              localStorage.setItem("ha-age-gate-expire-time", endDate);
1272              $(this).closest('.ha-age-gate-wrapper').hide();
1273              //$(this).closest("body").find("header").css("display","block");
1274              $(this).closest("body").css("overflow", "");
1275            }
1276          });
1277        }
1278
1279        /*confirm-by-boolean*/
1280        if ($scope.find('.ha-age-gate-wrapper.ha-age-gate-confirm-by-boolean').length) {
1281          $(".ha-age-gate-wrapper .ha-age-gate-confirm-yes-btn").on("click", function () {
1282            localStorage.setItem("ha-age-gate-expire-time", endDate);
1283            $(this).closest('.ha-age-gate-wrapper').hide();
1284            //$(this).closest("body").find("header").css("display","block");
1285            $(this).closest("body").css("overflow", "");
1286          });
1287          $(".ha-age-gate-wrapper .ha-age-gate-confirm-no-btn").on("click", function () {
1288            $(this).closest('.ha-age-gate-boxes').find('.ha-age-gate-warning-msg').show();
1289          });
1290        }
1291      }
1292    };
1293    elementorFrontend.hooks.addAction("frontend/element_ready/ha-age-gate.default", AgeGate);
1294    var LiquidHoverImage = ModuleHandler.extend({
1295      onInit: function onInit() {
1296        ModuleHandler.prototype.onInit.apply(this, arguments);
1297        this.run();
1298
1299        // $window.on('resize', debounce(this.run.bind(this), 100));
1300      },
1301      onElementChange: debounce(function (changedProp) {
1302        var $keys = ['width', 'title_typography_typography', 'title_typography_font_size', 'title_typography_line_height', 'title_typography_font_weight', 'sub_title_typography_typography', 'sub_title_typography_font_size', 'sub_title_typography_line_height', 'sub_title_typography_font_weight'];
1303        if ($keys.indexOf(changedProp) !== -1) {
1304          this.run();
1305        }
1306      }, 300),
1307      run: function run() {
1308        var self = this,
1309          settings = JSON.parse(self.$element.find('.ha-lhi-image-area').attr("data-settings")),
1310          liquidImage = self.$element.find('.ha-lhi-image'),
1311          title = self.$element.find('.ha-lhi-title h2'),
1312          sub_title = self.$element.find('.ha-lhi-title p'),
1313          canvas = self.$element.find('canvas'),
1314          style = settings.hover_style,
1315          hover_effect = settings.plugin_url + 'liquid-hover-image/' + settings.hover_effect;
1316        if ('custom' == settings.hover_effect) {
1317          hover_effect = settings.custom_effect ? settings.custom_effect : '';
1318        }
1319        if (canvas) {
1320          canvas.remove();
1321        }
1322        var myAnimation = new hoverEffect({
1323          parent: liquidImage[0],
1324          intensity: settings.intensity,
1325          image1: settings.first_image,
1326          image2: settings.second_image,
1327          displacementImage: hover_effect,
1328          imagesRatio: liquidImage.height() / liquidImage.width(),
1329          angle1: (settings.angle - 45) * (Math.PI / 180) * -1,
1330          angle2: (settings.angle - 45) * (Math.PI / 180) * -1,
1331          speedIn: settings.speed,
1332          speedOut: settings.speed
1333        });
1334
1335        /* if title or subtitle enable */
1336        if ('style-1' == style && (title.length || sub_title.length)) {
1337          var HoverOutDelay = function HoverOutDelay(el, i, a) {
1338            return 'right' == style_direction ? (a - i) * 40 : 40 * i;
1339          };
1340          var style_direction = settings.style_1_direction;
1341          if (title.length) {
1342            title[0].innerHTML = title[0].textContent.replace(/\S/g, "<span class='letter'>$&</span>");
1343          }
1344          if (sub_title.length) {
1345            sub_title.addClass("letter");
1346          }
1347          var HoverTranslateX = [0, 0],
1348            HoverOutTranslateX = [0, 0],
1349            HoverTranslateY = [0, 0],
1350            HoverOutTranslateY = [0, 0];
1351          ;
1352          if ('left' == style_direction) {
1353            HoverTranslateX = [80, 0], HoverOutTranslateX = [0, -80];
1354          } else if ('right' == style_direction) {
1355            HoverTranslateX = [0, 80], HoverOutTranslateX = [80, 200];
1356          } else if ('up' == style_direction) {
1357            HoverTranslateY = [80, 0], HoverOutTranslateY = [0, -80];
1358          } else if ('down' == style_direction) {
1359            HoverTranslateY = [-80, 0], HoverOutTranslateY = [0, 80];
1360          }
1361          self.$element.hover(function () {
1362            anime.timeline({
1363              loop: false
1364            }).add({
1365              targets: '.elementor-element-' + self.getID() + ' .ha-lhi-title .letter',
1366              translateX: HoverTranslateX,
1367              translateY: HoverTranslateY,
1368              translateZ: 0,
1369              opacity: [0, 1],
1370              easing: "easeOutExpo",
1371              duration: 800,
1372              delay: function delay(el, i) {
1373                return 40 * i;
1374              }
1375            });
1376          }, function () {
1377            anime.timeline({
1378              loop: false
1379            }).add({
1380              targets: '.elementor-element-' + self.getID() + ' .ha-lhi-title .letter',
1381              translateX: HoverOutTranslateX,
1382              translateY: HoverOutTranslateY,
1383              opacity: [1, 0],
1384              // easing: "easeInExpo",
1385              duration: 850,
1386              delay: function delay(el, i, a) {
1387                return HoverOutDelay(el, i, a);
1388              }
1389            });
1390          });
1391        }
1392        if ('style-2' == style && (title.length || sub_title.length)) {
1393          if (title.length) {
1394            var height = title.find('.normal').outerHeight();
1395            title.height(height);
1396          }
1397          if (sub_title.length) {
1398            var height = sub_title.find('.normal').outerHeight();
1399            sub_title.height(height);
1400          }
1401          self.$element.hover(function () {
1402            title.addClass('play');
1403            sub_title.addClass('play');
1404          }, function () {
1405            title.removeClass('play');
1406            sub_title.removeClass('play');
1407          });
1408        }
1409        if ('style-5' == style && (title.length || sub_title.length)) {
1410          if (title.length) {
1411            var height = title.find('.normal').outerHeight();
1412            title.attr('style', '--ha-lhi-style-5-height:' + height + 'px');
1413          }
1414        }
1415      }
1416    });
1417    elementorFrontend.hooks.addAction('frontend/element_ready/ha-liquid-hover-image.default', function ($scope) {
1418      elementorFrontend.elementsHandler.addHandler(LiquidHoverImage, {
1419        $element: $scope
1420      });
1421    });
1422    var TextScroll = ModuleHandler.extend({
1423      onInit: function onInit() {
1424        ModuleHandler.prototype.onInit.apply(this, arguments);
1425        this.run();
1426      },
1427      onElementChange: debounce(function (changedProp) {
1428        var $keys = ['text_scroll_type'];
1429        if ($keys.indexOf(changedProp) !== -1) {
1430          this.run();
1431        }
1432      }, 300),
1433      getReadySettings: function getReadySettings() {
1434        var settings = {};
1435        var scroll_type = this.getElementSettings('text_scroll_type');
1436        if (scroll_type) settings.scroll_type = scroll_type;
1437        return $.extend({}
1437, this.getSettings(), settings);
1438      },
1439      run: function run() {
1440        var settings = this.getReadySettings();
1441        var $element = this.$element;
1442        var elementsToSplit = $element.find('.ha-split-lines')[0];
1443        var instancesOfSplit = [];
1444        var textScrollType = settings.scroll_type;
1445        var lastScrollTop = 0;
1446        var typeSplit;
1447        if (typeof gsap === 'undefined' || typeof ScrollTrigger === 'undefined') return;
1448        gsap.registerPlugin(ScrollTrigger);
1449        function runSplit() {
1450          if (elementsToSplit.length <= 0) return;
1451          if (textScrollType === 'horizontal_line_mask' || textScrollType === 'vertical_line_mask') {
1452            $(elementsToSplit).each(function (index) {
1453              var currentElement = $(this);
1454              instancesOfSplit[index] = new SplitType(currentElement, {
1455                types: "lines, words"
1456              });
1457            });
1458            $(elementsToSplit).find(".line").each(function (index) {
1459              $(this).append("<div class='ha-line-mask'></div>");
1460            });
1461          } else if (textScrollType === 'horizontal_line_highlight') {
1462            $(elementsToSplit).each(function (index) {
1463              var currentElement = $(this);
1464              instancesOfSplit[index] = new SplitType(currentElement, {
1465                types: "words, chars"
1466              });
1467            });
1468          } else {
1469            typeSplit = new SplitType(elementsToSplit, {
1470              types: 'lines, words'
1471            });
1472          }
1473          createAnimation();
1474        }
1475        runSplit();
1476        function createAnimation() {
1477          if (textScrollType === 'horizontal_line_mask' || textScrollType === 'vertical_line_mask') {
1478            $element.find('.line').each(function (index, targetElement) {
1479              var mask = $(targetElement).find('.ha-line-mask');
1480              if (mask.length <= 0) return;
1481              $(targetElement).addClass('mask-active');
1482              var scrollTriggerProps = {
1483                start: textScrollType === 'horizontal_line_mask' ? 'bottom 50%' : 'bottom center',
1484                end: 'bottom center',
1485                scrub: 3
1486              };
1487              var animationProps = textScrollType === 'horizontal_line_mask' ? {
1488                width: '0%'
1489              } : {
1490                height: '0%'
1491              };
1492              var tl = gsap.timeline({
1493                scrollTrigger: _objectSpread({
1494                  trigger: targetElement
1495                }, scrollTriggerProps)
1496              });
1497              tl.to(mask, _objectSpread(_objectSpread({}, animationProps), {}, {
1498                duration: 1
1499              }));
1500            });
1501          } else if (textScrollType === 'horizontal_line_highlight') {
1502            var charsTargetElement = $element.find('.word .char');
1503            var triggerElement = $element.find('.ha-split-lines');
1504            if (charsTargetElement.length >= 0 && triggerElement.length >= 0) {
1505              gsap.to(charsTargetElement, {
1506                scrollTrigger: {
1507                  trigger: triggerElement,
1508                  start: 'top 40%',
1509                  end: 'bottom center',
1510                  scrub: 1
1511                },
1512                opacity: 1,
1513                duration: 2,
1514                stagger: 1
1515              });
1516            }
1517          } else {
1518            $element.find('.line').each(function () {
1519              var _this2 = this;
1520              gsap.to(this, {
1521                scrollTrigger: {
1522                  trigger: this,
1523                  start: 'top 50%',
1524                  end: 'bottom 50%',
1525                  onEnter: function onEnter() {
1526                    $(_this2).addClass('highlight');
1527                  },
1528                  onLeaveBack: function onLeaveBack() {
1529                    $(_this2).removeClass('highlight');
1530                  }
1531                }
1532              });
1533            });
1534          }
1535        }
1536      }
1537    });
1538
1539    // Hook into Elementor's frontend ready event
1540    elementorFrontend.hooks.addAction('frontend/element_ready/ha-text-scroll.default', function ($scope) {
1541      elementorFrontend.elementsHandler.addHandler(TextScroll, {
1542        $element: $scope
1543      });
1544    });
1545
1546    // SVG Draw Handler
1547    var haSvgDrawHandler = ModuleHandler.extend({
1548      onInit: function onInit() {
1549        ModuleHandler.prototype.onInit.apply(this, arguments);
1550        this.run();
1551      },
1552      bindEvents: function bindEvents() {
1553        ScrollTrigger.config({
1554          limitCallbacks: true,
1555          ignoreMobileResize: true
1556        });
1557      },
1558      run: function run() {
1559        gsap.registerPlugin(ScrollTrigger);
1560        var $scope = this.$element;
1561        $scope.find("title").remove();
1562        if (!$scope.hasClass("ha-svg-animated-yes")) return;
1563        var elemID = $scope.data("id"),
1564          settings = this.getElementSettings(),
1565          scrollAction = settings.scroll_action,
1566          scrollTrigger = null,
1567          repeatDelay = parseFloat(settings.repeat_delay) || 0.5,
1568          timeLine = new TimelineMax({
1569            repeat: 0,
1570            yoyo: false,
1571            repeatDelay: 0.5
1572          });
1573        if ('automatic' === scrollAction) {
1574          scrollTrigger = 'custom' !== settings.animate_trigger ? settings.animate_trigger : settings.animate_offset.size + "%";
1575          var animRev = settings.anim_rev ? 'pause play reverse' : 'none';
1576
1577          // Configure the timeline
1578          timeLine.repeat(settings.loop ? -1 : 0).yoyo(settings.yoyo).repeatDelay(settings.loop ? repeatDelay : 0);
1579          ScrollTrigger.create({
1580            trigger: '.elementor-element-' + elemID,
1581            toggleActions: "play " + animRev,
1582            start: "top " + scrollTrigger,
1583            animation: timeLine
1584          });
1585        } else {
1586          // Configure timeline for non-automatic cases
1587          timeLine.repeat('hover' === scrollAction && settings.loop ? -1 : 0).yoyo('hover' === scrollAction && settings.yoyo).repeatDelay('hover' === scrollAction && settings.loop ? repeatDelay : 0);
1588          if ('viewport' === scrollAction) {
1589            scrollTrigger = settings.animate_offset.size / 100;
1590          }
1591        }
1592        var fromOrTo = !$scope.hasClass("ha-svg-animation-rev-yes") ? 'from' : 'to',
1593          $paths = $scope.find("path, circle, rect, square, ellipse, polyline, polygon, line"),
1594          lastPathIndex = 0,
1595          startOrEndPoint = 'from' === fromOrTo ? settings.animate_start_point.size : settings.animate_end_point.size;
1596        $paths.each(function (pathIndex, path) {
1597          var $path = $(path);
1598          $path.attr("fill", "transparent");
1599          if ($scope.hasClass("ha-svg-sync-together-yes")) pathIndex = 0;
1600          lastPathIndex = pathIndex;
1601
1602          // Use the timeline's from/to methods
1603          if (fromOrTo === 'from') {
1604            timeLine.from($path, 1, {
1605              PaSvgDrawer: (startOrEndPoint || 0) + "% 0"
1606            }, pathIndex);
1607          } else {
1608            timeLine.to($path, 1, {
1609              PaSvgDrawer: (startOrEndPoint || 0) + "% 0"
1610            }, pathIndex);
1611          }
1612        });
1613        if ('yes' === settings.svg_fill) {
1614          if (lastPathIndex == 0) lastPathIndex = 1;
1615          timeLine.to($paths, 1, {
1616            fill: settings.svg_color,
1617            stroke: settings.svg_stroke
1618          }, lastPathIndex);
1619        }
1620        if ('viewport' === scrollAction) {
1621          var controller = new ScrollMagic.Controller(),
1622            scene = new ScrollMagic.Scene({
1623              triggerElement: '.elementor-element-' + elemID,
1624              triggerHook: scrollTrigger,
1625              duration: settings.draw_speed ? settings.draw_speed.size * 1000 : "150%"
1626            });
1627          scene.setTween(timeLine).addTo(controller);
1628        } else {
1629          if (settings.frames) {
1630            timeLine.duration(settings.frames);
1631            timeLine.repeatDelay(repeatDelay);
1632          }
1633          if ('hover' === scrollAction) {
1634            timeLine.pause();
1635            $scope.find("svg").hover(function () {
1636              timeLine.play();
1637            }, function () {
1638              timeLine.pause();
1639            });
1640          }
1641        }
1642      }
1643    });
1644
1645    // Hook into Elementor's frontend ready event with svg draw
1646    elementorFrontend.hooks.addAction('frontend/element_ready/ha-svg-draw.default', function ($scope) {
1647      elementorFrontend.elementsHandler.addHandler(haSvgDrawHandler, {
1648        $element: $scope
1649      });
1650    });
1651  });
1652})(jQuery);

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.