Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/bdthemes-element-pack/assets/js/ep-scripts.js

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + /**
2 + * Start accordion widget script
3 + */
4 +
5 + (function ($, elementor) {
6 + "use strict";
7 + var widgetAccordion = function ($scope, $) {
8 + var $accrContainer = $scope.find(".bdt-ep-accordion-container"),
9 + $accordion = $accrContainer.find(".bdt-ep-accordion"),
10 + $activeItem = $accrContainer.find(".bdt-ep-accordion-item.bdt-open");
11 + if (!$accrContainer.length) {
12 + return;
13 + }
14 + var $settings = $accordion.data("settings"),
15 + activeHash = $settings.activeHash,
16 + hashTopOffset = $settings.hashTopOffset,
17 + hashScrollspyTime = $settings.hashScrollspyTime,
18 + activeScrollspy = $settings.activeScrollspy,
19 + closeAllItemsOnMobile = $settings.closeAllItemsOnMobile;
20 +
21 + if (closeAllItemsOnMobile) {
22 + if (isMobileDevice()) {
23 + $activeItem.removeClass("bdt-open");
24 + $activeItem.find(".bdt-ep-accordion-content").prop("hidden", true);
25 + }
26 + }
27 +
28 + function isMobileDevice() {
29 + return window.matchMedia("(max-width: 767px)").matches;
30 + }
31 +
32 + if (activeScrollspy === null || typeof activeScrollspy === "undefined") {
33 + activeScrollspy = "no";
34 + }
35 +
36 + function hashHandler($accordion, hashScrollspyTime, hashTopOffset) {
37 + if (window.location.hash) {
38 + if (
39 + $($accordion).find(
40 + '[data-title="' + window.location.hash.substring(1) + '"]'
41 + ).length
42 + ) {
43 + var hashTarget = $(
44 + '[data-title="' + window.location.hash.substring(1) + '"]'
45 + )
46 + .closest($accordion)
47 + .attr("id");
48 +
49 + if (activeScrollspy == "yes") {
50 + $("html, body")
51 + .animate(
52 + {
53 + easing: "slow",
54 + scrollTop: $("#" + hashTarget).offset().top - hashTopOffset,
55 + },
56 + hashScrollspyTime,
57 + function () {}
58 + )
59 + .promise()
60 + .then(function () {
61 + bdtUIkit
62 + .accordion($accordion)
63 + .toggle(
64 + $(
65 + '[data-title="' + window.location.hash.substring(1) + '"]'
66 + ).data("accordion-index"),
67 + false
68 + );
69 + });
70 + } else {
71 + bdtUIkit
72 + .accordion($accordion)
73 + .toggle(
74 + $(
75 + '[data-title="' + window.location.hash.substring(1) + '"]'
76 + ).data("accordion-index"),
77 + true
78 + );
79 + }
80 + }
81 + }
82 + }
83 + if (activeHash == "yes") {
84 + $(window).on("load", function () {
85 + if (activeScrollspy == "yes") {
86 + hashHandler($accordion, hashScrollspyTime, hashTopOffset);
87 + } else {
88 + bdtUIkit
89 + .accordion($accordion)
90 + .toggle(
91 + $(
92 + '[data-title="' + window.location.hash.substring(1) + '"]'
93 + ).data("accordion-index"),
94 + false
95 + );
96 + }
97 + });
98 + $($accordion)
99 + .find(".bdt-ep-accordion-title")
100 + .off("click")
101 + .on("click", function (event) {
102 + window.location.hash = $.trim($(this).attr("data-title"));
103 + hashHandler($accordion, (hashScrollspyTime = 1000), hashTopOffset);
104 + });
105 + $(window).on("hashchange", function (e) {
106 + hashHandler($accordion, (hashScrollspyTime = 1000), hashTopOffset);
107 + });
108 + }
109 + };
110 +
111 + jQuery(window).on("elementor/frontend/init", function () {
112 + elementorFrontend.hooks.addAction(
113 + "frontend/element_ready/bdt-accordion.default",
114 + widgetAccordion
115 + );
116 + elementorFrontend.hooks.addAction(
117 + "frontend/element_ready/bdt-acf-accordion.default",
118 + widgetAccordion
119 + );
120 + });
121 + })(jQuery, window.elementorFrontend);
122 +
123 + /**
124 + * End accordion widget script
125 + */
126 +
127 + /**
128 + * Start dual button widget script
129 + */
130 +
131 + (function ($, elementor) {
132 + "use strict";
133 +
134 + var widgetDualButton = function ($scope, $) {
135 + var $buttons = $scope.find(".bdt-dual-button .bdt-ep-button[data-onclick]");
136 +
137 + if (!$buttons.length) return;
138 +
139 + $buttons.on("click", function (event) {
140 + event.preventDefault();
141 +
142 + var functionName = $(this).data("onclick")?.trim();
143 +
144 + if (functionName) {
145 + functionName = functionName.replace(/[\(\);\s]/g, '');
146 +
147 + if (typeof window[functionName] === "function") {
148 + window[functionName]();
149 + } else {
150 + console.warn(`Function "${functionName}" is not defined.`);
151 + }
152 + }
153 + });
154 + };
155 +
156 +
157 + jQuery(window).on("elementor/frontend/init", function () {
158 + elementorFrontend.hooks.addAction(
159 + "frontend/element_ready/bdt-dual-button.default",
160 + widgetDualButton
161 + );
162 + });
163 + })(jQuery, window.elementorFrontend);
164 +
165 + /**
166 + * End dual button widget script
167 + */
168 +
169 + /**
170 + * Start advanced divider widget script
171 + */
172 +
173 + (function($, elementor) {
174 + 'use strict';
175 + var widgetBusinessHours = function($scope, $) {
176 + var $businessHoursContainer = $scope.find('.bdt-ep-business-hours'),
177 + $businessHours = $businessHoursContainer.find('.bdt-ep-business-hours-current-time');
178 + if (!$businessHoursContainer.length) {
179 + return;
180 + }
181 + var $settings = $businessHoursContainer.data('settings');
182 + var dynamic_timezone = $settings.dynamic_timezone;
183 + var timeNotation = $settings.timeNotation;
184 + var business_hour_style = $settings.business_hour_style;
185 +
186 + if (business_hour_style != 'dynamic') return;
187 +
188 + $(document).ready(function() {
189 + var offset_val;
190 + var timeFormat = '%H:%M:%S', timeZoneFormat;
191 + var dynamic_timezone = $settings.dynamic_timezone;
192 +
193 + if(business_hour_style == 'static'){
194 + offset_val = $settings.dynamic_timezone_default;
195 + }else{
196 + offset_val = dynamic_timezone;
197 + }
198 +
199 + if(timeNotation == '12h'){
200 + timeFormat = '%I:%M:%S %p';
201 + }
202 + if (offset_val == '') return;
203 + var options = {
204 + // format:'<span class=\"dt\">%A, %d %B %I:%M:%S %P</span>',
205 + // format:'<span class=\"dt\"> %I:%M:%S </span>',
206 + format: timeFormat,
207 + timeNotation: timeNotation, //'24h',
208 + am_pm: true,
209 + utc: true,
210 + utc_offset: offset_val
211 + }
212 + $($businessHoursContainer).find('.bdt-ep-business-hours-current-time').jclock(options);
213 +
214 + });
215 +
216 + };
217 + jQuery(window).on('elementor/frontend/init', function() {
218 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-business-hours.default', widgetBusinessHours);
219 + });
220 + }(jQuery, window.elementorFrontend));
221 +
222 + /**
223 + * End business hours widget script
224 + */
225 +
226 +
227 + /**
228 + * Start contact form widget script
229 + */
230 +
231 + (function ($, elementor) {
232 +
233 + 'use strict';
234 +
235 + var widgetSimpleContactForm = function ($scope, $) {
236 +
237 + var $contactForm = $scope.find('.bdt-contact-form .without-recaptcha'),
238 + widgetID = $scope.data('id');
239 +
240 + // Validate tel type input field
241 + var $inputFieldTel = $scope.find('.bdt-contact-form input[type="tel"]');
242 + $inputFieldTel.on('input', function(e) {
243 + this.value = this.value.replace(/[^0-9\+]/g, ''); // Allow only numbers and the plus sign
244 + });
245 +
246 +
247 + if (!$contactForm.length) {
248 + return;
249 + }
250 +
251 + $contactForm.on('submit', function (e) {
252 + sendContactForm($contactForm, widgetID);
253 + return false;
254 + });
255 +
256 + return false;
257 +
258 + };
259 +
260 + function sendContactForm($contactForm, widgetID = false) {
261 + var langStr = window.ElementPackConfig.contact_form;
262 +
263 + $.ajax({
264 + url: $contactForm.attr('action'),
265 + type: 'POST',
266 + data: $contactForm.serialize(),
267 + beforeSend: function () {
268 + bdtUIkit.notification({
269 + message: '<div bdt-spinner></div> ' + langStr.sending_msg,
270 + timeout: false,
271 + status: 'primary'
272 + });
273 + },
274 + success: function (data) {
275 + var redirectURL = $(data).data('redirect'),
276 + isExternal = $(data).data('external'),
277 + resetStatus = $(data).data('resetstatus');
278 +
279 + bdtUIkit.notification.closeAll();
280 + var notification = bdtUIkit.notification({
281 + message: '<div class="bdt-contact-form-success-message-' + widgetID + '">' + data + '</div>'
282 + });
283 +
284 + if (redirectURL) {
285 + if (redirectURL != 'no') {
286 + bdtUIkit.util.on(document, 'close', function (evt) {
287 + if (evt.detail[0] === notification) {
288 + window.open(redirectURL, isExternal);
289 + }
290 + });
291 + }
292 + }
293 +
294 + localStorage.setItem("bdtCouponCode", $contactForm.attr('id'));
295 +
296 + if (resetStatus) {
297 + if (resetStatus !== 'no') {
298 + $contactForm[0].reset();
299 + }
300 + }
301 +
302 + // $contactForm[0].reset();
303 + }
304 + });
305 + return false;
306 + }
307 +
308 + // google invisible captcha
309 + function elementPackGIC() {
310 +
311 + var langStr = window.ElementPackConfig.contact_form;
312 +
313 + return new Promise(function (resolve, reject) {
314 +
315 + if (grecaptcha === undefined) {
316 + bdtUIkit.notification({
317 + message: '<div bdt-spinner></div> ' + langStr.captcha_nd,
318 + timeout: false,
319 + status: 'warning'
320 + });
321 + reject();
322 + }
323 +
324 + var response = grecaptcha.getResponse();
325 +
326 + if (!response) {
327 + bdtUIkit.notification({
328 + message: '<div bdt-spinner></div> ' + langStr.captcha_nr,
329 + timeout: false,
330 + status: 'warning'
331 + });
332 + reject();
333 + }
334 +
335 + var $contactForm = $('textarea.g-recaptcha-response').filter(function () {
336 + return $(this).val() === response;
337 + }).closest('form.bdt-contact-form-form');
338 +
339 + var contactFormAction = $contactForm.attr('action');
340 +
341 + if (contactFormAction && contactFormAction !== '') {
342 + sendContactForm($contactForm);
343 + }
344 +
345 + grecaptcha.reset();
346 +
347 + }); //end promise
348 +
349 + }
350 +
351 + //Contact form recaptcha callback, if needed
352 + window.elementPackGICCB = elementPackGIC;
353 +
354 + jQuery(window).on('elementor/frontend/init', function () {
355 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-contact-form.default', widgetSimpleContactForm);
356 + });
357 +
358 +
359 + }(jQuery, window.elementorFrontend));
360 +
361 + /**
362 + * End contact form widget script
363 + */
364 + /**
365 + * Start cookie consent widget script
366 + */
367 +
368 + (function ($, elementor) {
369 +
370 + 'use strict';
371 +
372 + var widgetCookieConsent = function ($scope, $) {
373 +
374 + var $cookieConsent = $scope.find('.bdt-cookie-consent'),
375 + $settings = $cookieConsent.data('settings'),
376 + editMode = Boolean(elementorFrontend.isEditMode()),
377 + gtagSettings = $cookieConsent.data('gtag');
378 +
379 + if (!$cookieConsent.length || editMode) {
380 + return;
381 + }
382 +
383 + window.cookieconsent.initialise($settings);
384 +
385 + $('.cc-compliance').append(
386 + `<button class="btn-denyCookie bdt-cc-close-btn cc-btn cc-dismiss">
387 + <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
388 + <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18 17.94 6M18 18 6.06 6"/>
389 + </svg>
390 + </button>`
391 + );
392 +
393 + /**
394 + * Dismiss if user click close button
395 + */
396 + $('.cc-btn.btn-denyCookie').on('click', function () {
397 + $('.bdt-cookie-consent').hide();
398 + document.cookie = 'element_pack_cookie_widget_gtag=denied; max-age=' + 60 * 60 * 24 * 7 + '; path=/';
399 + return;
400 + });
401 +
402 + if (document.cookie.indexOf('element_pack_cookie_widget_gtag=denied') !== -1) {
403 + $('.bdt-cookie-consent').hide();
404 + return;
405 + }
406 +
407 + /**
408 + * gtag consent update
409 + */
410 + if (gtagSettings === undefined) {
411 + return;
412 + }
413 +
414 + if (gtagSettings.gtag_enabled !== true) {
415 + return;
416 + }
417 +
418 + function consentGrantedAdStorage(args) {
419 + gtag('consent', 'update', args);
420 + }
421 +
422 + let gtagAttrObj = {
423 + 'ad_user_data': gtagSettings.ad_user_data,
424 + 'ad_personalization': gtagSettings.ad_personalization,
425 + 'ad_storage': gtagSettings.ad_storage,
426 + 'analytics_storage': gtagSettings.analytics_storage,
427 + };
428 +
429 + $('.cc-btn.cc-dismiss').on('click', function () {
430 + consentGrantedAdStorage(gtagAttrObj);
431 + });
432 +
433 + $('.cc-btn.btn-denyCookie').on('click', function () {
434 + consentGrantedAdStorage({
435 + 'ad_storage': 'denied',
436 + 'analytics_storage': 'denied'
437 + });
438 + });
439 + };
440 +
441 + jQuery(window).on('elementor/frontend/init', function () {
442 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-cookie-consent.default', widgetCookieConsent);
443 + });
444 +
445 + }(jQuery, window.elementorFrontend));
446 +
447 + /**
448 + * End cookie consent widget script
449 + */
450 +
451 + /**
452 + * Start countdown widget script
453 + */
454 +
455 + (function ($, elementor) {
456 + 'use strict';
457 + var widgetCountdown = function ($scope, $) {
458 + var $countdown = $scope.find('.bdt-countdown-wrapper');
459 + if (!$countdown.length) {
460 + return;
461 + }
462 + var $settings = $countdown.data('settings'),
463 + endTime = $settings.endTime,
464 + loopHours = $settings.loopHours,
465 + isLogged = $settings.isLogged;
466 +
467 +
468 +
469 + var countDownObj = {
470 + setCookie: function (name, value, hours) {
471 + var expires = "";
472 + if (hours) {
473 + var date = new Date();
474 + date.setTime(date.getTime() + (hours * 60 * 60 * 1000));
475 + expires = "; expires=" + date.toUTCString();
476 + }
477 + document.cookie = name + "=" + (value || "") + expires + "; path=/";
478 + },
479 + getCookie: function (name) {
480 + var nameEQ = name + "=";
481 + var ca = document.cookie.split(';');
482 + for (var i = 0; i < ca.length; i++) {
483 + var c = ca[i];
484 + while (c.charAt(0) == ' ') c = c.substring(1, c.length);
485 + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
486 + }
487 + return null;
488 + },
489 + randomIntFromInterval: function (min, max) { // min and max included
490 + return Math.floor(Math.random() * (max - min + 1) + min)
491 + },
492 + getTimeSpan: function (date) {
493 + var total = date - Date.now();
494 +
495 + return {
496 + total,
497 + seconds: total / 1000 % 60,
498 + minutes: total / 1000 / 60 % 60,
499 + hours: total / 1000 / 60 / 60 % 24,
500 + days: total / 1000 / 60 / 60 / 24
501 + };
502 + },
503 + showPost: function (endTime) {
504 + jQuery.ajax({
505 + url: $settings.adminAjaxUrl,
506 + type: 'post',
507 + data: {
508 + action: 'element_pack_countdown_end',
509 + endTime: endTime,
510 + couponTrickyId: $settings.couponTrickyId
511 + },
512 + success: function (data) {
513 + if (data == 'ended') {
514 + if ($settings.endActionType == 'message') {
515 + jQuery($settings.msgId).css({
516 + 'display': 'block'
517 + });
518 + jQuery($settings.id + '-timer').css({
519 + 'display': 'none'
520 + });
521 + }
522 +
523 + if ($settings.endActionType == 'url' && $settings.redirectUrl !== '' && $settings.redirectUrl.indexOf('http') > -1) {
524 + setInterval(function () {
525 + jQuery(location).attr('href', $settings.redirectUrl);
526 + }, $settings.redirectDelay);
527 + }
528 + }
529 + },
530 + error: function () {
531 + // error handling code can be added here if needed
532 + }
533 + });
534 + },
535 + couponCode: function(){
536 + jQuery.ajax({
537 + url: $settings.adminAjaxUrl,
538 + type: 'post',
539 + data: {
540 + action: 'element_pack_countdown_end',
541 + endTime: endTime,
542 + couponTrickyId: $settings.couponTrickyId
543 + },
544 + success: function (data) {
545 + },
546 + error: function () {
547 + }
548 + });
549 + },
550 + triggerFire : function(){
551 + jQuery.ajax({
552 + url: $settings.adminAjaxUrl,
553 + type: 'post',
554 + data: {
555 + action: 'element_pack_countdown_end',
556 + endTime: endTime,
557 + couponTrickyId: $settings.couponTrickyId
558 + },
559 + success: function (data) {
560 + if (data == 'ended') {
561 + setTimeout(function () {
562 + if ($settings.triggerId){
563 + document.getElementById($settings.triggerId).click();
564 +
565 + }
566 + // document.getElementById($settings.triggerId).click();
567 + // jQuery('#' + $settings.triggerId).trigger('click');
568 + }, 1500);
569 + }
570 + },
571 + error: function () {
572 + // error handling code can be added here if needed
573 + }
574 + });
575 + },
576 + clearInterVal: function (myInterVal) {
577 + clearInterval(myInterVal);
578 + }
579 +
580 + };
581 +
582 +
583 + if (loopHours == false) {
584 + var countdown = bdtUIkit.countdown($($settings.id + '-timer'), {
585 + date: $settings.finalTime
586 + });
587 +
588 + var myInterVal = setInterval(function () {
589 + var seconds = countDownObj.getTimeSpan(countdown.date).seconds.toFixed(0);
590 + var finalSeconds = parseInt(seconds);
591 + if (finalSeconds < 0) {
592 + if (!jQuery('body').hasClass('elementor-editor-active')) {
593 + jQuery($settings.id + '-msg').css({
594 + 'display': 'none'
595 + });
596 + if ($settings.endActionType != 'none') {
597 + countDownObj.showPost(endTime)
598 + };
599 + }
600 + countDownObj.clearInterVal(myInterVal);
601 + }
602 + }, 1000);
603 +
604 + // for coupon code
605 + if ($settings.endActionType == 'coupon-code') {
606 + var myInterVal2 = setInterval(function () {
607 + var seconds = countDownObj.getTimeSpan(countdown.date).seconds.toFixed(0);
608 + var finalSeconds = parseInt(seconds);
609 + if (finalSeconds < 0) {
610 + if (!jQuery('body').hasClass('elementor-editor-active')) {
611 + if ($settings.endActionType == 'coupon-code') {
612 + countDownObj.couponCode(endTime)
613 + };
614 + }
615 + countDownObj.clearInterVal(myInterVal2);
616 + }
617 + }, 1000);
618 + }
619 + // custom trigger on the end
620 +
621 + if ($settings.triggerId !== false) {
622 + var myInterVal2 = setInterval(function () {
623 + var seconds = countDownObj.getTimeSpan(countdown.date).seconds.toFixed(0);
624 + var finalSeconds = parseInt(seconds);
625 + if (finalSeconds < 0) {
626 + if (!jQuery('body').hasClass('elementor-editor-active')) {
627 + countDownObj.triggerFire();
628 + }
629 + countDownObj.clearInterVal(myInterVal2);
630 + }
631 + }, 1000);
632 + }
633 +
634 + }
635 +
636 +
637 + if (loopHours !== false) {
638 + var now = new Date(),
639 + randMinute = countDownObj.randomIntFromInterval(6, 14),
640 + hours = loopHours * 60 * 60 * 1000 - (randMinute * 60 * 1000),
641 + timer = new Date(now.getTime() + hours),
642 + loopTime = timer.toISOString(),
643 + getCookieLoopTime = countDownObj.getCookie('bdtCountdownLoopTime');
644 +
645 +
646 + if ((getCookieLoopTime == null || getCookieLoopTime == 'undefined') && isLogged === false) {
647 + countDownObj.setCookie('bdtCountdownLoopTime', loopTime, loopHours);
648 + }
649 +
650 + var setLoopTimer;
651 +
652 + if (isLogged === false) {
653 + setLoopTimer = countDownObj.getCookie('bdtCountdownLoopTime');
654 + } else {
655 + setLoopTimer = loopTime;
656 + }
657 +
658 + $($settings.id + '-timer').attr('data-bdt-countdown', 'date: ' + setLoopTimer);
659 + var countdown = bdtUIkit.countdown($($settings.id + '-timer'), {
660 + date: setLoopTimer
661 + });
662 +
663 + var countdownDate = countdown.date;
664 +
665 + setInterval(function () {
666 + var seconds = countDownObj.getTimeSpan(countdownDate).seconds.toFixed(0);
667 + var finalSeconds = parseInt(seconds);
668 + // console.log(finalSeconds);
669 + if (finalSeconds > 0) {
670 + if ((getCookieLoopTime == null || getCookieLoopTime == 'undefined') && isLogged === false) {
671 + countDownObj.setCookie('bdtCountdownLoopTime', loopTime, loopHours);
672 + bdtUIkit.countdown($($settings.id + '-timer'), {
673 + date: setLoopTimer
674 + });
675 + }
676 + }
677 +
678 + }, 1000);
679 +
680 +
681 + }
682 +
683 +
684 + };
685 + jQuery(window).on('elementor/frontend/init', function () {
686 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-countdown.default', widgetCountdown);
687 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-countdown.bdt-tiny-countdown', widgetCountdown);
688 + });
689 + }(jQuery, window.elementorFrontend));
690 +
691 + /**
692 + * End countdown widget script
693 + */
694 + /**
695 + * Start bdt custom gallery widget script
696 + */
697 +
698 + (function($, elementor) {
699 +
700 + 'use strict';
701 +
702 + var widgetCustomGallery = function($scope, $) {
703 +
704 + var $customGallery = $scope.find('.bdt-custom-gallery'),
705 + $settings = $customGallery.data('settings');
706 +
707 + if (!$customGallery.length) {
708 + return;
709 + }
710 +
711 + if ($settings.tiltShow == true) {
712 + var elements = document.querySelectorAll($settings.id + " [data-tilt]");
713 + VanillaTilt.init(elements);
714 + }
715 +
716 + };
717 +
718 + jQuery(window).on('elementor/frontend/init', function() {
719 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-custom-gallery.default', widgetCustomGallery);
720 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-custom-gallery.bdt-abetis', widgetCustomGallery);
721 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-custom-gallery.bdt-fedara', widgetCustomGallery);
722 + });
723 +
724 + }(jQuery, window.elementorFrontend));
725 +
726 + /**
727 + * End bdt custom gallery widget script
728 + */
729 +
730 +
731 + ; (function ($, elementor) {
732 + 'use strict';
733 + $(window).on('elementor/frontend/init', function () {
734 +
735 + var ModuleHandler = elementorModules.frontend.handlers.Base, FloatingEffect;
736 +
737 + FloatingEffect = ModuleHandler.extend({
738 +
739 + bindEvents: function () {
740 + this.run();
741 + },
742 +
743 + getDefaultSettings: function () {
744 + return {
745 + direction: 'alternate',
746 + easing: 'easeInOutSine',
747 + loop: true
748 + };
749 + },
750 +
751 + settings: function (key) {
752 + return this.getElementSettings('ep_floating_effects_' + key);
753 + },
754 +
755 + onElementChange: debounce(function (prop) {
756 + if (prop.indexOf('ep_floating') !== -1) {
757 + this.anime && this.anime.restart();
758 + this.run();
759 + }
760 + }, 400),
761 +
762 + run: function () {
763 + var options = this.getDefaultSettings(),
764 + element = this.$element[0];
765 +
766 + if (this.settings('translate_toggle')) {
767 + if (this.settings('translate_x.sizes.from').length !== 0 || this.settings('translate_x.sizes.to').length !== 0) {
768 + options.translateX = {
769 + value: [this.settings('translate_x.sizes.from') || 0, this.settings('translate_x.sizes.to') || 0],
770 + duration: this.settings('translate_duration.size'),
771 + delay: this.settings('translate_delay.size') || 0
772 + };
773 + }
774 +
775 + if (this.settings('translate_y.sizes.from').length !== 0 || this.settings('translate_y.sizes.to').length !== 0) {
776 + options.translateY = {
777 + value: [this.settings('translate_y.sizes.from') || 0, this.settings('translate_y.sizes.to') || 0],
778 + duration: this.settings('translate_duration.size'),
779 + delay: this.settings('translate_delay.size') || 0
780 + };
781 + }
782 + }
783 +
784 + if (this.settings('rotate_toggle')) {
785 + if (this.settings('rotate_infinite') !== 'yes') {
786 + if (this.settings('rotate_x.sizes.from').length !== 0 || this.settings('rotate_x.sizes.to').length !== 0) {
787 + options.rotateX = {
788 + value: [this.settings('rotate_x.sizes.from') || 0, this.settings('rotate_x.sizes.to') || 0],
789 + duration: this.settings('rotate_duration.size'),
790 + delay: this.settings('rotate_delay.size') || 0
791 + };
792 + }
793 + if (this.settings('rotate_y.sizes.from').length !== 0 || this.settings('rotate_y.sizes.to').length !== 0) {
794 + options.rotateY = {
795 + value: [this.settings('rotate_y.sizes.from') || 0, this.settings('rotate_y.sizes.to') || 0],
796 + duration: this.settings('rotate_duration.size'),
797 + delay: this.settings('rotate_delay.size') || 0
798 + };
799 + }
800 + if (this.settings('rotate_z.sizes.from').length !== 0 || this.settings('rotate_z.sizes.to').length !== 0) {
801 + options.rotateZ = {
802 + value: [this.settings('rotate_z.sizes.from') || 0, this.settings('rotate_z.sizes.to') || 0],
803 + duration: this.settings('rotate_duration.size'),
804 + delay: this.settings('rotate_delay.size') || 0
805 + };
806 + }
807 + }
808 + }
809 +
810 + if (this.settings('scale_toggle')) {
811 + if (this.settings('scale_x.sizes.from').length !== 0 || this.settings('scale_x.sizes.to').length !== 0) {
812 + options.scaleX = {
813 + value: [this.settings('scale_x.sizes.from') || 0, this.settings('scale_x.sizes.to') || 0],
814 + duration: this.settings('scale_duration.size'),
815 + delay: this.settings('scale_delay.size') || 0
816 + };
817 + }
818 + if (this.settings('scale_y.sizes.from').length !== 0 || this.settings('scale_y.sizes.to').length !== 0) {
819 + options.scaleY = {
820 + value: [this.settings('scale_y.sizes.from') || 0, this.settings('scale_y.sizes.to') || 0],
821 + duration: this.settings('scale_duration.size'),
822 + delay: this.settings('scale_delay.size') || 0
823 + };
824 + }
825 + }
826 +
827 + if (this.settings('skew_toggle')) {
828 + if (this.settings('skew_x.sizes.from').length !== 0 || this.settings('skew_x.sizes.to').length !== 0) {
829 + options.skewX = {
830 + value: [this.settings('skew_x.sizes.from') || 0, this.settings('skew_x.sizes.to') || 0],
831 + duration: this.settings('skew_duration.size'),
832 + delay: this.settings('skew_delay.size') || 0
833 + };
834 + }
835 + if (this.settings('skew_y.sizes.from').length !== 0 || this.settings('skew_y.sizes.to').length !== 0) {
836 + options.skewY = {
837 + value: [this.settings('skew_y.sizes.from') || 0, this.settings('skew_y.sizes.to') || 0],
838 + duration: this.settings('skew_duration.size'),
839 + delay: this.settings('skew_delay.size') || 0
840 + };
841 + }
842 + }
843 +
844 + if (this.settings('border_radius_toggle')) {
845 + jQuery(element).css('overflow', 'hidden');
846 + if (this.settings('border_radius.sizes.from').length !== 0 || this.settings('border_radius.sizes.to').length !== 0) {
847 + options.borderRadius = {
848 + value: [this.settings('border_radius.sizes.from') || 0, this.settings('border_radius.sizes.to') || 0],
849 + duration: this.settings('border_radius_duration.size'),
850 + delay: this.settings('border_radius_delay.size') || 0
851 + };
852 + }
853 + }
854 +
855 + if (this.settings('opacity_toggle')) {
856 + if (this.settings('opacity_start.size').length !== 0 || this.settings('opacity_end.size').length !== 0) {
857 + options.opacity = {
858 + value: [this.settings('opacity_start.size') || 1, this.settings('opacity_end.size') || 0],
859 + duration: this.settings('opacity_duration.size'),
860 + easing: 'linear'
861 + };
862 + }
863 + }
864 +
865 + if (this.settings('easing')) {
866 + options.easing = this.settings('easing');
867 + }
868 +
869 + if (this.settings('show')) {
870 + options.targets = element;
871 + if (
872 + this.settings('translate_toggle') ||
873 + this.settings('rotate_toggle') ||
874 + this.settings('scale_toggle') ||
875 + this.settings('skew_toggle') ||
876 + this.settings('border_radius_toggle') ||
877 + this.settings('opacity_toggle')
878 + ) {
879 + this.anime = window.anime && window.anime(options);
880 + }
881 + }
882 +
883 + }
884 + });
885 +
886 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
887 + elementorFrontend.elementsHandler.addHandler(FloatingEffect, {
888 + $element: $scope
889 + });
890 + });
891 + });
892 + }(jQuery, window.elementorFrontend));
893 +
894 + /**
895 + * Start Flip Box widget script
896 + */
897 +
898 + (function ($, elementor) {
899 + 'use strict';
900 + var widgetFlipBox = function ($scope, $) {
901 + var $flipBox = $scope.find('.bdt-flip-box'),
902 + $settings = $flipBox.data('settings');
903 + if (!$flipBox.length) {
904 + return;
905 + }
906 +
907 + if ('click' === $settings.flipTrigger) {
908 + $($flipBox).on('click', function () {
909 + $(this).toggleClass('bdt-active');
910 + });
911 + }
912 + if ('hover' === $settings.flipTrigger) {
913 + $($flipBox).on('mouseenter', function () {
914 + $(this).addClass('bdt-active');
915 + });
916 + $($flipBox).on('mouseleave', function () {
917 + $(this).removeClass('bdt-active');
918 + });
919 + }
920 +
921 +
922 + };
923 + jQuery(window).on('elementor/frontend/init', function () {
924 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-flip-box.default', widgetFlipBox);
925 + });
926 + }(jQuery, window.elementorFrontend));
927 +
928 + /**
929 + * End Flip Box widget script
930 + */
931 + (function ($, elementor) {
932 + "use strict";
933 +
934 + var widgetImageAccordion = function ($scope, $) {
935 + var $imageAccordion = $scope.find(".bdt-ep-image-accordion"),
936 + $settings = $imageAccordion.data("settings");
937 +
938 + var accordionItem = $imageAccordion.find(".bdt-ep-image-accordion-item");
939 + var totalItems = $imageAccordion.children().length;
940 +
941 + // Make each accordion item focusable
942 + accordionItem.attr('tabindex', '0');
943 +
944 + if (
945 + $settings.activeItem == true &&
946 + $settings.activeItemNumber <= totalItems
947 + ) {
948 + $imageAccordion.find(".bdt-ep-image-accordion-item").removeClass("active");
949 + $imageAccordion.children().eq($settings.activeItemNumber - 1).addClass("active");
950 + }
951 +
952 + // Mouse event
953 + $(accordionItem).on($settings.mouse_event, function () {
954 + $(this).siblings().removeClass("active");
955 + $(this).addClass("active");
956 + });
957 +
958 + // Keyboard focus event
959 + $(accordionItem).on('focus', function () {
960 + $(this).siblings().removeClass("active");
961 + $(this).addClass("active");
962 + });
963 +
964 + // Keydown event for Enter or Space key
965 + $(accordionItem).on('keydown', function (e) {
966 + if (e.key === "Enter" || e.key === " ") {
967 + e.preventDefault();
968 + $(this).siblings().removeClass("active");
969 + $(this).addClass("active");
970 + }
971 + });
972 +
973 + if ($settings.activeItem != true) {
974 + $("body").on($settings.mouse_event, function (e) {
975 + if (
976 + e.target.$imageAccordion == "bdt-ep-image-accordion" ||
977 + $(e.target).closest(".bdt-ep-image-accordion").length
978 + ) {
979 + // inside accordion, do nothing
980 + } else {
981 + $imageAccordion.find(".bdt-ep-image-accordion-item").removeClass("active");
982 + }
983 + });
984 + }
985 +
986 + // Swiping (unchanged)
987 + function handleSwipe(event) {
988 + var deltaX = touchendX - touchstartX;
989 + var hasPrev = $(event.currentTarget).prev();
990 + var hasNext = $(event.currentTarget).next();
991 +
992 + if (deltaX > 50) {
993 + if (hasPrev.length) {
994 + $(accordionItem).removeClass("active");
995 + hasPrev.addClass("active");
996 + }
997 + } else if (deltaX < -50) {
998 + if (hasNext.length) {
999 + $(accordionItem).removeClass("active");
1000 + hasNext.addClass("active");
1001 + }
1002 + }
1003 + }
1004 +
1005 + if ($settings.swiping) {
1006 + var touchstartX = 0;
1007 + var touchendX = 0;
1008 +
1009 + $(accordionItem).on("touchstart", function (event) {
1010 + touchstartX = event.changedTouches[0].screenX;
1011 + });
1012 +
1013 + $(accordionItem).on("touchend", function (event) {
1014 + touchendX = event.changedTouches[0].screenX;
1015 + handleSwipe(event);
1016 + });
1017 + }
1018 +
1019 + // Inactive Item
1020 + if ($settings.inactiveItemOverlay) {
1021 + $(accordionItem).on($settings.mouse_event, function (event) {
1022 + event.stopPropagation();
1023 + if ($(this).hasClass("active")) {
1024 + $(this).removeClass("bdt-inactive").siblings().addClass("bdt-inactive");
1025 + } else {
1026 + $(this).siblings().removeClass("bdt-inactive");
1027 + }
1028 + });
1029 + $(document).on($settings.mouse_event, function () {
1030 + $(accordionItem).removeClass("bdt-inactive");
1031 + });
1032 + }
1033 + };
1034 +
1035 + jQuery(window).on("elementor/frontend/init", function () {
1036 + elementorFrontend.hooks.addAction(
1037 + "frontend/element_ready/bdt-image-accordion.default",
1038 + widgetImageAccordion
1039 + );
1040 + });
1041 + })(jQuery, window.elementorFrontend);
1042 +
1043 + /**
1044 + * Start image compare widget script
1045 + */
1046 +
1047 + ( function( $, elementor ) {
1048 +
1049 + 'use strict';
1050 +
1051 + var widgetImageCompare = function( $scope, $ ) {
1052 + var $image_compare_main = $scope.find('.bdt-image-compare');
1053 + var $image_compare = $scope.find('.image-compare');
1054 + if ( !$image_compare.length ) {
1055 + return;
1056 + }
1057 +
1058 + var $settings = $image_compare.data('settings');
1059 +
1060 + var sanitizeHTML = function(str) {
1061 + return str.replace(/&/g, '&amp;')
1062 + .replace(/</g, '&lt;')
1063 + .replace(/>/g, '&gt;')
1064 + .replace(/"/g, '&quot;')
1065 + .replace(/'/g, '&#039;');
1066 + };
1067 +
1068 + var
1069 + default_offset_pct = $settings.default_offset_pct,
1070 + orientation = $settings.orientation,
1071 + before_label = sanitizeHTML($settings.before_label || ''),
1072 + after_label = sanitizeHTML($settings.after_label || ''),
1073 + no_overlay = $settings.no_overlay,
1074 + on_hover = $settings.on_hover,
1075 + add_circle_blur = $settings.add_circle_blur,
1076 + add_circle_shadow = $settings.add_circle_shadow,
1077 + add_circle = $settings.add_circle,
1078 + smoothing = $settings.smoothing,
1079 + smoothing_amount = $settings.smoothing_amount,
1080 + bar_color = $settings.bar_color,
1081 + move_slider_on_hover = $settings.move_slider_on_hover;
1082 +
1083 + var viewers = document.querySelectorAll('#' + $settings.id);
1084 +
1085 + var options = {
1086 +
1087 + // UI Theme Defaults
1088 + controlColor : bar_color,
1089 + controlShadow: add_circle_shadow,
1090 + addCircle : add_circle,
1091 + addCircleBlur: add_circle_blur,
1092 +
1093 + // Label Defaults
1094 + showLabels : no_overlay,
1095 + labelOptions : {
1096 + before : before_label,
1097 + after : after_label,
1098 + onHover : on_hover
1099 + },
1100 +
1101 + // Smoothing
1102 + smoothing : smoothing,
1103 + smoothingAmount: smoothing_amount,
1104 +
1105 + // Other options
1106 + hoverStart : move_slider_on_hover,
1107 + verticalMode : orientation,
1108 + startingPoint : default_offset_pct,
1109 + fluidMode : false
1110 + };
1111 +
1112 + viewers.forEach(function (element){
1113 + var view = new ImageCompare(element, options).mount();
1114 + });
1115 +
1116 + };
1117 +
1118 + jQuery(window).on('elementor/frontend/init', function() {
1119 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-image-compare.default', widgetImageCompare );
1120 + });
1121 +
1122 + }( jQuery, window.elementorFrontend ) );
1123 +
1124 + /**
1125 + * End image compare widget script
1126 + */
1127 +
1128 +
1129 + /**
1130 + * Start image magnifier widget script
1131 + */
1132 +
1133 + ( function( $, elementor ) {
1134 +
1135 + 'use strict';
1136 +
1137 + var widgetImageMagnifier = function( $scope, $ ) {
1138 +
1139 + var $imageMagnifier = $scope.find( '.bdt-image-magnifier' ),
1140 + settings = $imageMagnifier.data('settings'),
1141 + magnifier = $imageMagnifier.find('> .bdt-image-magnifier-image');
1142 +
1143 + if ( ! $imageMagnifier.length ) {
1144 + return;
1145 + }
1146 +
1147 + $(magnifier).ImageZoom(settings);
1148 +
1149 + };
1150 +
1151 +
1152 + jQuery(window).on('elementor/frontend/init', function() {
1153 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-image-magnifier.default', widgetImageMagnifier );
1154 + });
1155 +
1156 + }( jQuery, window.elementorFrontend ) );
1157 +
1158 + /**
1159 + * End image magnifier widget script
1160 + */
1161 +
1162 +
1163 + /**
1164 + * Start price table widget script
1165 + */
1166 +
1167 + ( function( $, elementor ) {
1168 +
1169 + 'use strict';
1170 +
1171 + var widgetImageStack = function( $scope, $ ) {
1172 +
1173 + var $imageStack = $scope.find( '.bdt-image-stack' );
1174 +
1175 + if ( ! $imageStack.length ) {
1176 + return;
1177 + }
1178 +
1179 + var $tooltip = $imageStack.find('.bdt-tippy-tooltip'),
1180 + widgetID = $scope.data('id');
1181 +
1182 + $tooltip.each( function( index ) {
1183 + tippy( this, {
1184 + allowHTML: true,
1185 + theme: 'bdt-tippy-' + widgetID
1186 + });
1187 + });
1188 +
1189 + };
1190 +
1191 + jQuery(window).on('elementor/frontend/init', function() {
1192 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-image-stack.default', widgetImageStack );
1193 + });
1194 +
1195 + }( jQuery, window.elementorFrontend ) );
1196 +
1197 + /**
1198 + * End price table widget script
1199 + */
1200 + /**
1201 + * Start marker widget script
1202 + */
1203 +
1204 + ( function( $, elementor ) {
1205 +
1206 + 'use strict';
1207 +
1208 + var widgetIconMobileMenu = function( $scope, $ ) {
1209 +
1210 + var $marker = $scope.find( '.bdt-icon-mobile-menu-wrap' );
1211 +
1212 + if ( ! $marker.length ) {
1213 + return;
1214 + }
1215 +
1216 + var $tooltip = $marker.find('ul > li > .bdt-tippy-tooltip'),
1217 + widgetID = $scope.data('id');
1218 +
1219 + $tooltip.each( function( index ) {
1220 + tippy( this, {
1221 + allowHTML: true,
1222 + theme: 'bdt-tippy-' + widgetID
1223 + });
1224 + });
1225 +
1226 + };
1227 +
1228 +
1229 + jQuery(window).on('elementor/frontend/init', function() {
1230 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-icon-mobile-menu.default', widgetIconMobileMenu );
1231 + });
1232 +
1233 + }( jQuery, window.elementorFrontend ) );
1234 +
1235 + /**
1236 + * End marker widget script
1237 + */
1238 +
1239 +
1240 + /**
1241 + * Start logo grid widget script
1242 + */
1243 +
1244 + (function($, elementor) {
1245 +
1246 + 'use strict';
1247 +
1248 + var widgetLogoGrid = function($scope, $) {
1249 +
1250 + var $logogrid = $scope.find('.bdt-logo-grid-wrapper');
1251 +
1252 + if (!$logogrid.length) {
1253 + return;
1254 + }
1255 +
1256 + var $tooltip = $logogrid.find('> .bdt-tippy-tooltip'),
1257 + widgetID = $scope.data('id');
1258 +
1259 + $tooltip.each(function(index) {
1260 + tippy(this, {
1261 + allowHTML: true,
1262 + theme: 'bdt-tippy-' + widgetID
1263 + });
1264 + });
1265 +
1266 + };
1267 +
1268 +
1269 + jQuery(window).on('elementor/frontend/init', function() {
1270 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-logo-grid.default', widgetLogoGrid);
1271 + });
1272 +
1273 + }(jQuery, window.elementorFrontend));
1274 +
1275 + /**
1276 + * Start open street map widget script
1277 + */
1278 +
1279 + ( function( $, elementor ) {
1280 +
1281 + 'use strict';
1282 +
1283 + var widgetOpenStreetMap = function( $scope, $ ) {
1284 +
1285 + var $openStreetMap = $scope.find( '.bdt-open-street-map' ),
1286 + settings = $openStreetMap.data('settings'),
1287 + markers = $openStreetMap.data('map_markers'),
1288 + tileSource = '';
1289 +
1290 + if ( ! $openStreetMap.length ) {
1291 + return;
1292 + }
1293 +
1294 + var avdOSMap = L.map($openStreetMap[0], {
1295 + zoomControl: settings.zoomControl,
1296 + scrollWheelZoom: false
1297 + }).setView([
1298 + settings.lat,
1299 + settings.lng
1300 + ],
1301 + settings.zoom
1302 + );
1303 +
1304 + if (settings.mapboxToken !== '' && settings.mapboxToken !== false) {
1305 + tileSource = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=' + settings.mapboxToken;
1306 + L.tileLayer( tileSource, {
1307 + maxZoom: 18,
1308 + attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery &copy; <a href="https://www.mapbox.com/">Mapbox</a>',
1309 + id: 'mapbox/streets-v11',
1310 + tileSize: 512,
1311 + zoomOffset: -1
1312 + }).addTo(avdOSMap);
1313 + } else {
1314 + L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
1315 + maxZoom: 18,
1316 + attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
1317 + }).addTo(avdOSMap);
1318 + }
1319 +
1320 +
1321 + for (var i in markers) {
1322 + if( (markers[i]['iconUrl']) != '' && typeof (markers[i]['iconUrl']) !== 'undefined'){
1323 + var LeafIcon = L.Icon.extend({
1324 + options: {
1325 + iconSize : [25, 41],
1326 + iconAnchor : [12, 41],
1327 + popupAnchor: [2, -41]
1328 + }
1329 + });
1330 + var greenIcon = new LeafIcon({iconUrl: markers[i]['iconUrl'] });
1331 + // Create a safe popup content that allows HTML formatting but prevents XSS
1332 + var popupContent = document.createElement('div');
1333 + popupContent.innerHTML = markers[i]['infoWindow'];
1334 + // Remove any script tags and event handlers for security
1335 + var scripts = popupContent.querySelectorAll('script');
1336 + for (var j = 0; j < scripts.length; j++) {
1337 + scripts[j].remove();
1338 + }
1339 + // Remove any elements with event handlers
1340 + var elementsWithEvents = popupContent.querySelectorAll('[onclick], [onload], [onerror], [onmouseover], [onmouseout]');
1341 + for (var k = 0; k < elementsWithEvents.length; k++) {
1342 + elementsWithEvents[k].removeAttribute('onclick');
1343 + elementsWithEvents[k].removeAttribute('onload');
1344 + elementsWithEvents[k].removeAttribute('onerror');
1345 + elementsWithEvents[k].removeAttribute('onmouseover');
1346 + elementsWithEvents[k].removeAttribute('onmouseout');
1347 + }
1348 + L.marker( [markers[i]['lat'], markers[i]['lng']], {icon: greenIcon} ).bindPopup(popupContent).addTo(avdOSMap);
1349 + } else {
1350 + if( (markers[i]['lat']) != '' && typeof (markers[i]['lat']) !== 'undefined'){
1351 + // Create a safe popup content that allows HTML formatting but prevents XSS
1352 + var popupContent = document.createElement('div');
1353 + popupContent.innerHTML = markers[i]['infoWindow'];
1354 + // Remove any script tags and event handlers for security
1355 + var scripts = popupContent.querySelectorAll('script');
1356 + for (var j = 0; j < scripts.length; j++) {
1357 + scripts[j].remove();
1358 + }
1359 + // Remove any elements with event handlers
1360 + var elementsWithEvents = popupContent.querySelectorAll('[onclick], [onload], [onerror], [onmouseover], [onmouseout]');
1361 + for (var k = 0; k < elementsWithEvents.length; k++) {
1362 + elementsWithEvents[k].removeAttribute('onclick');
1363 + elementsWithEvents[k].removeAttribute('onload');
1364 + elementsWithEvents[k].removeAttribute('onerror');
1365 + elementsWithEvents[k].removeAttribute('onmouseover');
1366 + elementsWithEvents[k].removeAttribute('onmouseout');
1367 + }
1368 + L.marker( [markers[i]['lat'], markers[i]['lng']] ).bindPopup(popupContent).addTo(avdOSMap);
1369 + }
1370 + }
1371 + }
1372 +
1373 + };
1374 +
1375 +
1376 + jQuery(window).on('elementor/frontend/init', function() {
1377 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-open-street-map.default', widgetOpenStreetMap );
1378 + });
1379 +
1380 + }( jQuery, window.elementorFrontend ) );
1381 +
1382 + /**
1383 + * End open street map widget script
1384 + */
1385 +
1386 +
1387 + /**
1388 + * Start panel slider widget script
1389 + */
1390 +
1391 + (function ($, elementor) {
1392 +
1393 + 'use strict';
1394 +
1395 + var widgetPanelSlider = function ($scope, $) {
1396 +
1397 + var $slider = $scope.find('.bdt-panel-slider');
1398 +
1399 + if (!$slider.length) {
1400 + return;
1401 + }
1402 +
1403 + var $sliderContainer = $slider.find('.swiper-carousel'),
1404 + $settings = $slider.data('settings'),
1405 + $widgetSettings = $slider.data('widget-settings');
1406 +
1407 + const Swiper = elementorFrontend.utils.swiper;
1408 + initSwiper();
1409 + async function initSwiper() {
1410 + var swiper = await new Swiper($sliderContainer, $settings);
1411 +
1412 + if ($settings.pauseOnHover) {
1413 + $($sliderContainer).hover(function () {
1414 + (this).swiper.autoplay.stop();
1415 + }, function () {
1416 + (this).swiper.autoplay.start();
1417 + });
1418 + }
1419 + };
1420 +
1421 + if ($widgetSettings.mouseInteractivity == true) {
1422 + setTimeout(() => {
1423 + var data = $($widgetSettings.id).find('.bdt-panel-slide-item');
1424 + $(data).each((index, element) => {
1425 + var scene = $(element).get(0);
1426 + var parallaxInstance = new Parallax(scene, {
1427 + selector: '.bdt-panel-slide-thumb',
1428 + hoverOnly: true,
1429 + pointerEvents: true
1430 + });
1431 + });
1432 + }, 2000);
1433 + }
1434 +
1435 + };
1436 +
1437 +
1438 + jQuery(window).on('elementor/frontend/init', function () {
1439 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-panel-slider.default', widgetPanelSlider);
1440 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-panel-slider.bdt-middle', widgetPanelSlider);
1441 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-panel-slider.always-visible', widgetPanelSlider);
1442 + });
1443 +
1444 + }(jQuery, window.elementorFrontend));
1445 +
1446 + /**
1447 + * End panel slider widget script
1448 + */
1449 + /**
1450 + * Start progress pie widget script
1451 + */
1452 +
1453 + (function ($, elementor) {
1454 +
1455 + 'use strict';
1456 +
1457 + var widgetProgressPie = function ($scope, $) {
1458 +
1459 + var $progressPie = $scope.find('.bdt-progress-pie');
1460 +
1461 + if (!$progressPie.length) {
1462 + return;
1463 + }
1464 +
1465 + epObserveTarget($scope[0], function () {
1466 + var $this = $($progressPie);
1467 +
1468 + $this.asPieProgress({
1469 + namespace: 'pieProgress',
1470 + classes: {
1471 + svg: 'bdt-progress-pie-svg',
1472 + number: 'bdt-progress-pie-number',
1473 + content: 'bdt-progress-pie-content'
1474 + }
1475 + });
1476 +
1477 + $this.asPieProgress('start');
1478 +
1479 + }, {
1480 + root: null, // Use the viewport as the root
1481 + rootMargin: '0px', // No margin around the root
1482 + threshold: 1 // 80% visibility (1 - 0.8)
1483 + });
1484 +
1485 + };
1486 +
1487 +
1488 + jQuery(window).on('elementor/frontend/init', function () {
1489 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-progress-pie.default', widgetProgressPie);
1490 + });
1491 +
1492 + }(jQuery, window.elementorFrontend));
1493 +
1494 + /**
1495 + * End progress pie widget script
1496 + */
1497 +
1498 +
1499 + /**
1500 + * Start reading progress widget script
1501 + */
1502 +
1503 + (function($, elementor) {
1504 +
1505 + 'use strict';
1506 +
1507 + var readingProgressWidget = function($scope, $) {
1508 +
1509 + var $readingProgress = $scope.find('.bdt-reading-progress');
1510 +
1511 + if (!$readingProgress.length) {
1512 + return;
1513 + }
1514 + var $settings = $readingProgress.data('settings');
1515 +
1516 + jQuery(document).ready(function(){
1517 +
1518 + var settings = {
1519 + borderSize: 10,
1520 + mainBgColor: '#E6F4F7',
1521 + lightBorderColor: '#A2ECFB',
1522 + darkBorderColor: '#39B4CC'
1523 + };
1524 +
1525 + var colorBg = $settings.progress_bg; //'red'
1526 + var progressColor = $settings.scroll_bg; //'green';
1527 + var innerHeight, offsetHeight, netHeight,
1528 + self = this,
1529 + container = $($readingProgress),
1530 + borderContainer = 'bdt-reading-progress-border',
1531 + circleContainer = 'bdt-reading-progress-circle',
1532 + textContainer = 'bdt-reading-progress-text';
1533 +
1534 + var getHeight = function () {
1535 + innerHeight = window.innerHeight;
1536 + offsetHeight = document.body.offsetHeight;
1537 + netHeight = offsetHeight - innerHeight;
1538 + };
1539 +
1540 + var addEvent = function () {
1541 + var e = document.createEvent('Event');
1542 + e.initEvent('scroll', false, false);
1543 + window.dispatchEvent(e);
1544 + };
1545 + var updateProgress = function (percnt) {
1546 + var per = Math.round(100 * percnt);
1547 + var deg = per * 360 / 100;
1548 + if (deg <= 180) {
1549 + $('.' + borderContainer, container).css('background-image', 'linear-gradient(' + (90 + deg) + 'deg, transparent 50%, ' + colorBg + ' 50%),linear-gradient(90deg, ' + colorBg + ' 50%, transparent 50%)');
1550 + } else {
1551 + $('.' + borderContainer, container).css('background-image', 'linear-gradient(' + (deg - 90) + 'deg, transparent 50%, ' + progressColor + ' 50%),linear-gradient(90deg, ' + colorBg + ' 50%, transparent 50%)');
1552 + }
1553 + $('.' + textContainer, container).text(per + '%');
1554 + };
1555 + var prepare = function () {
1556 + $(container).html("<div class='" + borderContainer + "'><div class='" + circleContainer + "'><span class='" + textContainer + "'></span></div></div>");
1557 +
1558 + $('.' + borderContainer, container).css({
1559 + 'background-color': progressColor,
1560 + 'background-image': 'linear-gradient(91deg, transparent 50%,' + settings.lightBorderColor + '50%), linear-gradient(90deg,' + settings.lightBorderColor + '50%, transparent 50%'
1561 + });
1562 + $('.' + circleContainer, container).css({
1563 + 'width': settings.width - settings.borderSize,
1564 + 'height': settings.height - settings.borderSize
1565 + });
1566 +
1567 + };
1568 + var init = function () {
1569 + prepare();
1570 + $(window).on('scroll', function () {
1571 + var getOffset = window.pageYOffset || document.documentElement.scrollTop,
1572 + per = Math.max(0, Math.min(1, getOffset / netHeight));
1573 + updateProgress(per);
1574 + });
1575 + $(window).on('resize', function () {
1576 + getHeight();
1577 + addEvent();
1578 + });
1579 + $(window).on('load', function () {
1580 + getHeight();
1581 + addEvent();
1582 + });
1583 + };
1584 + init();
1585 + });
1586 +
1587 + };
1588 + // start progress with cursor
1589 + var readingProgressCursorSkin = function($scope, $) {
1590 +
1591 + var $readingProgress = $scope.find('.bdt-progress-with-cursor');
1592 +
1593 + if (!$readingProgress.length) {
1594 + return;
1595 + }
1596 +
1597 + document.getElementsByTagName('body')[0].addEventListener('mousemove', function(n) {
1598 + t.style.left = n.clientX + 'px';
1599 + t.style.top = n.clientY + 'px';
1600 + e.style.left = n.clientX + 'px';
1601 + e.style.top = n.clientY + 'px';
1602 + i.style.left = n.clientX + 'px';
1603 + i.style.top = n.clientY + 'px';
1604 + });
1605 + var t = document.querySelector('.bdt-cursor'),
1606 + e = document.querySelector('.bdt-cursor2'),
1607 + i = document.querySelector('.bdt-cursor3');
1608 +
1609 + function n(t) {
1610 + e.classList.add('hover'), i.classList.add('hover');
1611 + }
1612 +
1613 + function s(t) {
1614 + e.classList.remove('hover'), i.classList.remove('hover');
1615 + }
1616 + s();
1617 + for (var r = document.querySelectorAll('.hover-target'), a = r.length - 1; a >= 0; a--) {
1618 + o(r[a]);
1619 + }
1620 +
1621 + function o(t) {
1622 + t.addEventListener('mouseover', n);
1623 + t.addEventListener('mouseout', s);
1624 + }
1625 +
1626 + $(document).ready(function() {
1627 + //Scroll indicator
1628 + var progressPath = document.querySelector('.bdt-progress-wrap path');
1629 + var pathLength = progressPath.getTotalLength();
1630 + progressPath.style.transition = progressPath.style.WebkitTransition = 'none';
1631 + progressPath.style.strokeDasharray = pathLength + ' ' + pathLength;
1632 + progressPath.style.strokeDashoffset = pathLength;
1633 + progressPath.getBoundingClientRect();
1634 + progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear';
1635 + var updateProgress = function() {
1636 + var scroll = $(window).scrollTop();
1637 + var height = $(document).height() - $(window).height();
1638 + var progress = pathLength - (scroll * pathLength / height);
1639 + progressPath.style.strokeDashoffset = progress;
1640 + };
1641 + updateProgress();
1642 + jQuery(window).on('scroll', updateProgress);
1643 +
1644 +
1645 + });
1646 +
1647 + };
1648 + // end progress with cursor
1649 +
1650 + // start progress horizontal
1651 +
1652 +
1653 + var readingProgressHorizontalSkin = function($scope, $) {
1654 +
1655 + var $readingProgress = $scope.find('.bdt-horizontal-progress');
1656 +
1657 + if (!$readingProgress.length) {
1658 + return;
1659 + }
1660 +
1661 + $('#bdt-progress').progress({ size: '3px', wapperBg: '#eee', innerBg: '#DA4453' });
1662 +
1663 + };
1664 +
1665 + // end progress horizontal
1666 +
1667 + // start progress back to top
1668 +
1669 +
1670 + var readingProgressBackToTopSkin = function($scope, $) {
1671 +
1672 + var $readingProgress = $scope.find('.bdt-progress-with-top');
1673 +
1674 + if (!$readingProgress.length) {
1675 + return;
1676 + }
1677 +
1678 + var progressPath = document.querySelector('.bdt-progress-wrap path');
1679 + var pathLength = progressPath.getTotalLength();
1680 + progressPath.style.transition = progressPath.style.WebkitTransition = 'none';
1681 + progressPath.style.strokeDasharray = pathLength + ' ' + pathLength;
1682 + progressPath.style.strokeDashoffset = pathLength;
1683 + progressPath.getBoundingClientRect();
1684 + progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear';
1685 + var updateProgress = function() {
1686 + var scroll = jQuery(window).scrollTop();
1687 + var height = jQuery(document).height() - jQuery(window).height();
1688 + var progress = pathLength - (scroll * pathLength / height);
1689 + progressPath.style.strokeDashoffset = progress;
1690 + };
1691 + updateProgress();
1692 + jQuery(window).on('scroll', updateProgress);
1693 + var offset = 50;
1694 + var duration = 550;
1695 + jQuery(window).on('scroll', function() {
1696 + if (jQuery(this).scrollTop() > offset) {
1697 + jQuery('.bdt-progress-wrap').addClass('active-progress');
1698 + } else {
1699 + jQuery('.bdt-progress-wrap').removeClass('active-progress');
1700 + }
1701 + });
1702 + jQuery('.bdt-progress-wrap').on('click', function(event) {
1703 + event.preventDefault();
1704 + jQuery('html, body').animate({ scrollTop: 0 }, duration);
1705 + return false;
1706 + });
1707 +
1708 + };
1709 +
1710 + // end progress back to top
1711 +
1712 + jQuery(window).on('elementor/frontend/init', function() {
1713 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-reading-progress.default', readingProgressWidget);
1714 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-reading-progress.bdt-progress-with-cursor', readingProgressCursorSkin);
1715 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-reading-progress.bdt-horizontal-progress', readingProgressHorizontalSkin);
1716 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-reading-progress.bdt-back-to-top-with-progress', readingProgressBackToTopSkin);
1717 + });
1718 +
1719 + }(jQuery, window.elementorFrontend));
1720 +
1721 + /**
1722 + * End reading progress widget script
1723 + */
1724 +
1725 +
1726 + (function ($, elementor) {
1727 + $(window).on("elementor/frontend/init", function () {
1728 + let ModuleHandler = elementorModules.frontend.handlers.Base,
1729 + ReadingTimer;
1730 +
1731 + ReadingTimer = ModuleHandler.extend({
1732 + bindEvents: function () {
1733 + this.run();
1734 + },
1735 + getDefaultSettings: function () {
1736 + return {
1737 + allowHTML: true,
1738 + };
1739 + },
1740 +
1741 + settings: function (key) {
1742 + return this.getElementSettings("reading_timer_" + key);
1743 + },
1744 +
1745 + calculateReadingTime: function (ReadingContent) {
1746 + let wordCount = ReadingContent.split(/\s+/).filter(function (word) {
1747 + return word !== "";
1748 + }).length,
1749 + averageReadingSpeed = this.settings("avg_words_per_minute")
1750 + ? this.settings("avg_words_per_minute").size
1751 + : 200,
1752 + readingTime = Math.floor(wordCount / averageReadingSpeed),
1753 + reading_seconds = Math.floor(
1754 + (wordCount % averageReadingSpeed) / (averageReadingSpeed / 60)
1755 + ),
1756 + minText = this.settings("minute_text")
1757 + ? this.settings("minute_text")
1758 + : "min read",
1759 + secText = this.settings("seconds_text")
1760 + ? this.settings("seconds_text")
1761 + : "sec read";
1762 +
1763 + if (wordCount >= averageReadingSpeed) {
1764 + return `${readingTime} ${minText}`;
1765 + } else {
1766 + return `${reading_seconds} ${secText}`;
1767 + }
1768 + },
1769 +
1770 + run: function () {
1771 + const widgetID = this.$element.data("id"),
1772 + widgetContainer = `.elementor-element-${widgetID} .bdt-reading-timer`,
1773 + contentSelector = this.settings("content_id");
1774 + let minText = this.settings("minute_text")
1775 + ? this.settings("minute_text")
1776 + : "min read";
1777 +
1778 + var editMode = Boolean(elementorFrontend.isEditMode());
1779 + if (editMode) {
1780 + $(widgetContainer).append("2 " + minText + "");
1781 + return;
1782 + }
1783 + if (contentSelector) {
1784 + ReadingContent = $(document).find(`#${contentSelector}`).text();
1785 + var readTime = this.calculateReadingTime(ReadingContent);
1786 + $(widgetContainer).append(readTime);
1787 + } else return;
1788 + },
1789 + });
1790 +
1791 + elementorFrontend.hooks.addAction(
1792 + "frontend/element_ready/bdt-reading-timer.default",
1793 + function ($scope) {
1794 + elementorFrontend.elementsHandler.addHandler(ReadingTimer, {
1795 + $element: $scope,
1796 + });
1797 + }
1798 + );
1799 + });
1800 + })(jQuery, window.elementorFrontend);
1801 +
1802 + /**
1803 + * Start twitter carousel widget script
1804 + */
1805 +
1806 + (function ($, elementor) {
1807 +
1808 + 'use strict';
1809 +
1810 + var widgetReviewCardCarousel = function ($scope, $) {
1811 +
1812 + var $reviewCardCarousel = $scope.find('.bdt-review-card-carousel');
1813 +
1814 + if (!$reviewCardCarousel.length) {
1815 + return;
1816 + }
1817 +
1818 + var $reviewCardCarouselContainer = $reviewCardCarousel.find('.swiper-carousel'),
1819 + $settings = $reviewCardCarousel.data('settings');
1820 +
1821 + const Swiper = elementorFrontend.utils.swiper;
1822 + initSwiper();
1823 + async function initSwiper() {
1824 + var swiper = await new Swiper($reviewCardCarouselContainer, $settings); // this is an example
1825 +
1826 + if ($settings.pauseOnHover) {
1827 + $($reviewCardCarouselContainer).hover(function () {
1828 + (this).swiper.autoplay.stop();
1829 + }, function () {
1830 + (this).swiper.autoplay.start();
1831 + });
1832 + }
1833 +
1834 + };
1835 +
1836 +
1837 + };
1838 +
1839 +
1840 + jQuery(window).on('elementor/frontend/init', function () {
1841 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-review-card-carousel.default', widgetReviewCardCarousel);
1842 + });
1843 +
1844 + }(jQuery, window.elementorFrontend));
1845 +
1846 + /**
1847 + * End twitter carousel widget script
1848 + */
1849 +
1850 +
1851 + /**
1852 + * Start scroll button widget script
1853 + */
1854 +
1855 + ( function( $, elementor ) {
1856 +
1857 + 'use strict';
1858 +
1859 + var widgetScrollButton = function( $scope, $ ) {
1860 +
1861 + var $scrollButton = $scope.find('.bdt-scroll-button'),
1862 + $selector = $scrollButton.data('selector'),
1863 + $settings = $scrollButton.data('settings');
1864 +
1865 + if ( ! $scrollButton.length ) {
1866 + return;
1867 + }
1868 +
1869 + //$($scrollButton).find('.bdt-scroll-button').unbind();
1870 +
1871 + if ($settings.HideOnBeforeScrolling == true) {
1872 +
1873 + $(window).scroll(function() {
1874 + if ($(window).scrollTop() > 300) {
1875 + $scrollButton.css("opacity", "1");
1876 + } else {
1877 + $scrollButton.css("opacity", "0");
1878 + }
1879 + });
1880 + }
1881 +
1882 + $($scrollButton).on('click', function(event){
1883 + event.preventDefault();
1884 + bdtUIkit.scroll($scrollButton, $settings ).scrollTo($($selector));
1885 +
1886 + });
1887 +
1888 + };
1889 +
1890 + jQuery(window).on('elementor/frontend/init', function() {
1891 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-scroll-button.default', widgetScrollButton );
1892 + });
1893 +
1894 + }( jQuery, window.elementorFrontend ) );
1895 +
1896 + /**
1897 + * End scroll button widget script
1898 + */
1899 +
1900 +
1901 + /**
1902 + * Start search widget script
1903 + */
1904 +
1905 + (function ($, elementor) {
1906 + 'use strict';
1907 + var serachTimer;
1908 + var widgetAjaxSearch = function ($scope, $) {
1909 + var $searchContainer = $scope.find('.bdt-search-container'),
1910 + $searchWidget = $scope.find('.bdt-ajax-search');
1911 +
1912 + $($scope).find('.bdt-navbar-dropdown-close').on('click', function () {
1913 + bdtUIkit.drop($scope.find('.bdt-navbar-dropdown')).hide();
1914 + });
1915 +
1916 + let $search;
1917 +
1918 + if (!$searchWidget.length) {
1919 + return;
1920 + }
1921 +
1922 + var $resultHolder = $($searchWidget).find('.bdt-search-result'),
1923 + $settings = $($searchWidget).data('settings'),
1924 + $connectSettings = $($searchContainer).data('settings'),
1925 + $target = $($searchWidget).attr('anchor-target');
1926 +
1927 + if ('yes' === $target) {
1928 + $target = '_blank';
1929 + } else {
1930 + $target = '_self';
1931 + }
1932 +
1933 + clearTimeout(serachTimer);
1934 +
1935 + if ($connectSettings && $connectSettings.element_connect) {
1936 + $($connectSettings.element_selector).hide();
1937 + }
1938 +
1939 + $($searchWidget).on('keyup keypress', function (e) {
1940 + var keyCode = e.keyCode || e.which;
1941 + if (keyCode === 13) {
1942 + e.preventDefault();
1943 + return false;
1944 + }
1945 + });
1946 +
1947 + $searchWidget.find('.bdt-search-input').keyup(function () {
1948 + $search = $(this).val();
1949 + serachTimer = setTimeout(function () {
1950 + $($searchWidget).addClass('bdt-search-loading');
1951 + jQuery.ajax({
1952 + url: window.ElementPackConfig.ajaxurl,
1953 + type: 'post',
1954 + data: {
1955 + action: 'element_pack_search',
1956 + s: $search,
1957 + settings: $settings,
1958 + },
1959 + success: function (response) {
1960 + var response = $.parseJSON(response);
1961 +
1962 + if (response.results.length > 0) {
1963 + if ($search.length >= 3) {
1964 + var output = `<div class="bdt-search-result-inner">
1965 + <h3 class="bdt-search-result-header">${window.ElementPackConfig.search.search_result}<i class="ep-icon-close bdt-search-result-close-btn"></i></h3>
1966 + <ul class="bdt-list bdt-list-divider">`;
1967 + for (let i = 0; i < response.results.length; i++) {
1968 + const element = response.results[i];
1969 + output += `<li class="bdt-search-item" data-url="${element.url}">
1970 + <a href="${element.url}" target="${$target}">
1971 + <div class="bdt-search-title">${element.title}</div>
1972 + <div class="bdt-search-text">${element.text}</div>
1973 + </a>
1974 + </li>`;
1975 + }
1976 + output += `</ul><a class="bdt-search-more">${window.ElementPackConfig.search.more_result}</a></div>`;
1977 +
1978 + $resultHolder.html(output);
1979 + $resultHolder.show();
1980 + $(".bdt-search-result-close-btn").on("click", function (e) {
1981 + $(".bdt-search-result").hide();
1982 + $(".bdt-search-input").val("");
1983 + });
1984 +
1985 + $($searchWidget).removeClass("bdt-search-loading");
1986 + $(".bdt-search-more").on("click", function (event) {
1987 + event.preventDefault();
1988 + $($searchWidget).submit();
1989 + });
1990 + } else {
1991 + $resultHolder.hide();
1992 + }
1993 + } else {
1994 + if ($search.length > 3) {
1995 + var not_found = `<div class="bdt-search-result-inner">
1996 + <h3 class="bdt-search-result-header">${window.ElementPackConfig.search.search_result}<i class="ep-icon-close bdt-search-result-close-btn"></i></h3>
1997 + <div class="bdt-search-text">${$search} ${window.ElementPackConfig.search.not_found}</div>
1998 + </div>`;
1999 + $resultHolder.html(not_found);
2000 + $resultHolder.show();
2001 + $(".bdt-search-result-close-btn").on("click", function (e) {
2002 + $(".bdt-search-result").hide();
2003 + $(".bdt-search-input").val("");
2004 + });
2005 + $($searchWidget).removeClass("bdt-search-loading");
2006 +
2007 + if ($connectSettings && $connectSettings.element_connect) {
2008 + $resultHolder.hide();
2009 + setTimeout(function () {
2010 + $($connectSettings.element_selector).show();
2011 + }, 1500);
2012 + }
2013 +
2014 + } else {
2015 + $resultHolder.hide();
2016 + $($searchWidget).removeClass("bdt-search-loading");
2017 + }
2018 +
2019 + }
2020 + }
2021 + });
2022 + }, 450);
2023 + });
2024 +
2025 + };
2026 +
2027 +
2028 + jQuery(window).on('elementor/frontend/init', function () {
2029 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-search.default', widgetAjaxSearch);
2030 + });
2031 +
2032 + //window.elementPackAjaxSearch = widgetAjaxSearch;
2033 +
2034 + })(jQuery, window.elementorFrontend);
2035 +
2036 + /**
2037 + * End search widget script
2038 + */
2039 + /**
2040 + * Start slider widget script
2041 + */
2042 +
2043 + ( function( $, elementor ) {
2044 +
2045 + 'use strict';
2046 +
2047 + var widgetSlider = function( $scope, $ ) {
2048 +
2049 + var $slider = $scope.find( '.bdt-slider' );
2050 +
2051 + if ( ! $slider.length ) {
2052 + return;
2053 + }
2054 +
2055 + var $sliderContainer = $slider.find('.swiper-carousel'),
2056 + $settings = $slider.data('settings');
2057 +
2058 + // Access swiper class
2059 + const Swiper = elementorFrontend.utils.swiper;
2060 + initSwiper();
2061 +
2062 + async function initSwiper() {
2063 +
2064 + var swiper = await new Swiper($sliderContainer, $settings);
2065 +
2066 + if ($settings.pauseOnHover) {
2067 + $($sliderContainer).hover(function() {
2068 + (this).swiper.autoplay.stop();
2069 + }, function() {
2070 + (this).swiper.autoplay.start();
2071 + });
2072 + }
2073 + };
2074 +
2075 + };
2076 +
2077 +
2078 + jQuery(window).on('elementor/frontend/init', function() {
2079 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-slider.default', widgetSlider );
2080 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-acf-slider.default', widgetSlider );
2081 + });
2082 +
2083 + }( jQuery, window.elementorFrontend ) );
2084 +
2085 + /**
2086 + * End slider widget script
2087 + */
2088 +
2089 +
2090 + /**
2091 + * Start twitter carousel widget script
2092 + */
2093 +
2094 + ( function( $, elementor ) {
2095 +
2096 + 'use strict';
2097 +
2098 + var widgetStaticCarousel = function( $scope, $ ) {
2099 +
2100 + var $StaticCarousel = $scope.find( '.bdt-static-carousel' );
2101 +
2102 + if ( ! $StaticCarousel.length ) {
2103 + return;
2104 + }
2105 +
2106 + var $StaticCarouselContainer = $StaticCarousel.find('.swiper-carousel'),
2107 + $settings = $StaticCarousel.data('settings');
2108 +
2109 + // Access swiper class
2110 + const Swiper = elementorFrontend.utils.swiper;
2111 + initSwiper();
2112 +
2113 + async function initSwiper() {
2114 +
2115 + var swiper = await new Swiper($StaticCarouselContainer, $settings);
2116 +
2117 + if ($settings.pauseOnHover) {
2118 + $($StaticCarouselContainer).hover(function() {
2119 + (this).swiper.autoplay.stop();
2120 + }, function() {
2121 + (this).swiper.autoplay.start();
2122 + });
2123 + }
2124 + };
2125 +
2126 + };
2127 +
2128 +
2129 + jQuery(window).on('elementor/frontend/init', function() {
2130 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-static-carousel.default', widgetStaticCarousel );
2131 + });
2132 +
2133 + }( jQuery, window.elementorFrontend ) );
2134 +
2135 + /**
2136 + * End twitter carousel widget script
2137 + */
2138 +
2139 +
2140 + /**
2141 + * Start post grid tab widget script
2142 + */
2143 +
2144 + ;
2145 + (function ($, elementor) {
2146 +
2147 + 'use strict';
2148 +
2149 + var widgetStaticPostTab = function ($scope, $) {
2150 +
2151 + var $postGridTab = $scope.find('.bdt-static-grid-tab'),
2152 + gridTab = $postGridTab.find('.gridtab');
2153 +
2154 + var $settings = $postGridTab.data('settings');
2155 +
2156 + if (!$postGridTab.length) {
2157 + return;
2158 + }
2159 +
2160 + $(gridTab).gridtab($settings);
2161 +
2162 + };
2163 +
2164 +
2165 + jQuery(window).on('elementor/frontend/init', function () {
2166 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-static-grid-tab.default', widgetStaticPostTab);
2167 + });
2168 +
2169 + }(jQuery, window.elementorFrontend));
2170 +
2171 + /**
2172 + * End post grid tab widget script
2173 + */
2174 + /**
2175 + * Start step flow widget script
2176 + */
2177 +
2178 + (function ($, elementor) {
2179 +
2180 + 'use strict';
2181 +
2182 + var widgetStepFlow = function ($scope, $) {
2183 +
2184 + var $avdDivider = $scope.find('.bdt-step-flow'),
2185 + divider = $($avdDivider).find('.bdt-title-separator-wrapper > img');
2186 +
2187 + if (!$avdDivider.length) {
2188 + return;
2189 + }
2190 +
2191 + epObserveTarget($scope[0], function () {
2192 + bdtUIkit.svg(divider, {
2193 + strokeAnimation: true
2194 + });
2195 + }, {
2196 + root: null, // Use the viewport as the root
2197 + rootMargin: '0px', // No margin around the root
2198 + threshold: 0.8 // 80% visibility (1 - 0.8)
2199 + });
2200 +
2201 + };
2202 +
2203 +
2204 + jQuery(window).on('elementor/frontend/init', function () {
2205 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-step-flow.default', widgetStepFlow);
2206 + });
2207 +
2208 + }(jQuery, window.elementorFrontend));
2209 +
2210 + /**
2211 + * End step flow widget script
2212 + */
2213 +
2214 +
2215 + /**
2216 + * Start toggle widget script
2217 + */
2218 +
2219 + (function ($, elementor) {
2220 + 'use strict';
2221 + var widgetToggle = function ($scope, $) {
2222 + var $toggleContainer = $scope.find('.bdt-show-hide-container');
2223 + var $toggle = $toggleContainer.find('.bdt-show-hide');
2224 +
2225 + if ( !$toggleContainer.length ) {
2226 + return;
2227 + }
2228 + var $settings = $toggle.data('settings');
2229 + var toggleId = $settings.id;
2230 + var animTime = $settings.scrollspy_time;
2231 + var scrollspy_top_offset = $settings.scrollspy_top_offset;
2232 +
2233 + var by_widget_selector_status = $settings.by_widget_selector_status;
2234 + var toggle_initially_open = $settings.toggle_initially_open;
2235 + var source_selector = $settings.source_selector;
2236 + var widget_visibility = $settings.widget_visibility;
2237 + var widget_visibility_tablet = $settings.widget_visibility_tablet;
2238 + var widget_visibility_mobile = $settings.widget_visibility_mobile;
2239 + var viewport_lg = $settings.viewport_lg;
2240 + var viewport_md = $settings.viewport_md;
2241 +
2242 + var widget_visibility_filtered = widget_visibility;
2243 +
2244 + if ( $settings.widget_visibility == 'undefined' || $settings.widget_visibility == null ) {
2245 + widget_visibility_filtered = widget_visibility = 0;
2246 + }
2247 +
2248 + if ( $settings.widget_visibility_tablet == 'undefined' || $settings.widget_visibility_tablet == null ) {
2249 + widget_visibility_tablet = widget_visibility;
2250 + }
2251 +
2252 + if ( $settings.widget_visibility_mobile == 'undefined' || $settings.widget_visibility_mobile == null ) {
2253 + widget_visibility_mobile = widget_visibility;
2254 + }
2255 +
2256 + function widgetVsibleFiltered() {
2257 + if ( (window.outerWidth) > (viewport_lg) ) {
2258 + widget_visibility_filtered = widget_visibility;
2259 + } else if ( (window.outerWidth) > (viewport_md) ) {
2260 + widget_visibility_filtered = widget_visibility_tablet;
2261 + } else {
2262 + widget_visibility_filtered = widget_visibility_mobile;
2263 + }
2264 + }
2265 +
2266 + $(window).resize(function () {
2267 + widgetVsibleFiltered();
2268 + });
2269 +
2270 +
2271 + function scrollspyHandler($toggle, toggleId, toggleBtn, animTime, scrollspy_top_offset) {
2272 + if ( $settings.status_scrollspy === 'yes' && by_widget_selector_status !== 'yes' ) {
2273 + if ( $($toggle).find('.bdt-show-hide-item') ) {
2274 + if ( $settings.hash_location === 'yes' ) {
2275 + window.location.hash = ($.trim(toggleId));
2276 + }
2277 + var scrollspyWrapper = $('#bdt-show-hide-' + toggleId).find('.bdt-show-hide-item');
2278 + $('html, body').animate({
2279 + easing : 'slow',
2280 + scrollTop: $(scrollspyWrapper).offset().top - scrollspy_top_offset
2281 + }, animTime, function () {
2282 + //#code
2283 + }).promise().then(function () {
2284 + $(toggleBtn).siblings('.bdt-show-hide-content').slideToggle('slow', function () {
2285 + $(toggleBtn).parent().toggleClass('bdt-open');
2286 + });
2287 + });
2288 + }
2289 + } else {
2290 + if ( by_widget_selector_status === 'yes' ) {
2291 + $(toggleBtn).parent().toggleClass('bdt-open');
2292 + $(toggleBtn).siblings('.bdt-show-hide-content').slideToggle('slow', function () {
2293 + });
2294 + }else{
2295 + $(toggleBtn).siblings('.bdt-show-hide-content').slideToggle('slow', function () {
2296 + $(toggleBtn).parent().toggleClass('bdt-open');
2297 + });
2298 + }
2299 +
2300 + }
2301 + }
2302 +
2303 + $($toggle).find('.bdt-show-hide-title').off('click').on('click', function (event) {
2304 + var toggleBtn = $(this);
2305 + scrollspyHandler($toggle, toggleId, toggleBtn, animTime, scrollspy_top_offset);
2306 + });
2307 +
2308 + function hashHandler() {
2309 + toggleId = window.location.hash.substring(1);
2310 + var toggleBtn = $('#bdt-show-hide-' + toggleId).find('.bdt-show-hide-title');
2311 + var scrollspyWrapper = $('#bdt-show-hide-' + toggleId).find('.bdt-show-hide-item');
2312 + $('html, body').animate({
2313 + easing : 'slow',
2314 + scrollTop: $(scrollspyWrapper).offset().top - scrollspy_top_offset
2315 + }, animTime, function () {
2316 + //#code
2317 + }).promise().then(function () {
2318 + $(toggleBtn).siblings('.bdt-show-hide-content').slideToggle('slow', function () {
2319 + $(toggleBtn).parent().toggleClass('bdt-open');
2320 + });
2321 + });
2322 + }
2323 +
2324 + $(window).on('load', function () {
2325 + if ( $($toggleContainer).find('#bdt-show-hide-' + window.location.hash.substring(1)).length != 0 ) {
2326 + if ( $settings.hash_location === 'yes' ) {
2327 + hashHandler();
2328 + }
2329 + }
2330 + });
2331 +
2332 + /* Function to animate height: auto */
2333 + function autoHeightAnimate(element, time){
2334 + var curHeight = element.height(), // Get Default Height
2335 + autoHeight = element.css('height', 'auto').height(); // Get Auto Height
2336 + element.height(curHeight); // Reset to Default Height
2337 + element.stop().animate({ height: autoHeight }, time); // Animate to Auto Height
2338 + }
2339 + function byWidgetHandler() {
2340 + if ( $settings.status_scrollspy === 'yes' ) {
2341 + $('html, body').animate({
2342 + easing : 'slow',
2343 + scrollTop: $(source_selector).offset().top - scrollspy_top_offset
2344 + }, animTime, function () {
2345 + //#code
2346 + }).promise().then(function () {
2347 + if ( $(source_selector).hasClass('bdt-fold-close') ) {
2348 + // $(source_selector).css({
2349 + // 'max-height': '100%'
2350 + // }).removeClass('bdt-fold-close toggle_initially_open').addClass('bdt-fold-open');
2351 + $(source_selector).removeClass('bdt-fold-close toggle_initially_open').addClass('bdt-fold-open');
2352 + autoHeightAnimate($(source_selector), 500);
2353 + } else {
2354 + $(source_selector).css({
2355 + 'height': widget_visibility_filtered + 'px'
2356 + }).addClass('bdt-fold-close').removeClass('bdt-fold-open');
2357 + }
2358 + });
2359 + } else {
2360 + if ( $(source_selector).hasClass('bdt-fold-close') ) {
2361 + // $(source_selector).css({
2362 + // 'max-height': '100%'
2363 + // }).removeClass('bdt-fold-close toggle_initially_open').addClass('bdt-fold-open');
2364 + $(source_selector).removeClass('bdt-fold-close toggle_initially_open').addClass('bdt-fold-open');
2365 + autoHeightAnimate($(source_selector), 500);
2366 +
2367 + } else {
2368 + $(source_selector).css({
2369 + 'height': widget_visibility_filtered + 'px',
2370 + 'transition' : 'all 1s ease-in-out 0s'
2371 + }).addClass('bdt-fold-close').removeClass('bdt-fold-open');
2372 + }
2373 + }
2374 +
2375 + }
2376 +
2377 +
2378 + if ( by_widget_selector_status === 'yes' ) {
2379 + $($toggle).find('.bdt-show-hide-title').on('click', function () {
2380 + byWidgetHandler();
2381 + });
2382 +
2383 + if ( toggle_initially_open === 'yes' ) {
2384 + $(source_selector).addClass('bdt-fold-toggle bdt-fold-open toggle_initially_open');
2385 + } else {
2386 + $(source_selector).addClass('bdt-fold-toggle bdt-fold-close toggle_initially_open');
2387 + }
2388 +
2389 + $(window).resize(function () {
2390 + visibilityCalled();
2391 + });
2392 + visibilityCalled();
2393 + }
2394 +
2395 + function visibilityCalled() {
2396 + if ( $(source_selector).hasClass('bdt-fold-close') ) {
2397 + $(source_selector).css({
2398 + 'height': widget_visibility_filtered + 'px'
2399 + });
2400 + } else {
2401 + // $(source_selector).css({
2402 + // 'max-height': '100%'
2403 + // });
2404 + autoHeightAnimate($(source_selector), 500);
2405 + }
2406 + }
2407 +
2408 +
2409 + };
2410 + jQuery(window).on('elementor/frontend/init', function () {
2411 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-toggle.default', widgetToggle);
2412 + });
2413 + }(jQuery, window.elementorFrontend));
2414 +
2415 + /**
2416 + * End toggle widget script
2417 + */
2418 +
2419 +
2420 + /**
2421 + * Start tutor lms grid widget script
2422 + */
2423 +
2424 + (function ($, elementor) {
2425 +
2426 + 'use strict';
2427 +
2428 + var widgetTutorLMSGrid = function ($scope, $) {
2429 +
2430 + var $tutorLMS = $scope.find('.bdt-tutor-lms-course-grid'),
2431 + $settings = $tutorLMS.data('settings');
2432 +
2433 + if (!$tutorLMS.length) {
2434 + return;
2435 + }
2436 +
2437 + if ($settings.tiltShow == true) {
2438 + var elements = document.querySelectorAll($settings.id + " .bdt-tutor-course-item");
2439 + VanillaTilt.init(elements);
2440 + }
2441 +
2442 + };
2443 +
2444 + jQuery(window).on('elementor/frontend/init', function () {
2445 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-tutor-lms-course-grid.default', widgetTutorLMSGrid);
2446 + });
2447 +
2448 + }(jQuery, window.elementorFrontend));
2449 +
2450 + /**
2451 + * End tutor lms grid widget script
2452 + */
2453 +
2454 + /**
2455 + * Start tutor lms widget script
2456 + */
2457 +
2458 + (function ($, elementor) {
2459 +
2460 + 'use strict';
2461 +
2462 + var widgetTutorCarousel = function ($scope, $) {
2463 +
2464 + var $tutorCarousel = $scope.find('.bdt-tutor-lms-course-carousel');
2465 +
2466 + if (!$tutorCarousel.length) {
2467 + return;
2468 + }
2469 +
2470 + var $tutorCarouselContainer = $tutorCarousel.find('.swiper-carousel'),
2471 + $settings = $tutorCarousel.data('settings');
2472 +
2473 + // Access swiper class
2474 + const Swiper = elementorFrontend.utils.swiper;
2475 + initSwiper();
2476 +
2477 + async function initSwiper() {
2478 +
2479 + var swiper = await new Swiper($tutorCarouselContainer, $settings);
2480 +
2481 + if ($settings.pauseOnHover) {
2482 + $($tutorCarouselContainer).hover(function () {
2483 + (this).swiper.autoplay.stop();
2484 + }, function () {
2485 + (this).swiper.autoplay.start();
2486 + });
2487 + }
2488 + };
2489 + };
2490 +
2491 +
2492 + jQuery(window).on('elementor/frontend/init', function () {
2493 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-tutor-lms-course-carousel.default', widgetTutorCarousel);
2494 + });
2495 +
2496 + }(jQuery, window.elementorFrontend));
2497 +
2498 + /**
2499 + * End tutor lms widget script
2500 + */
2501 + /**
2502 + * Start user register widget script
2503 + */
2504 +
2505 + (function ($, elementor) {
2506 +
2507 + 'use strict';
2508 +
2509 + var widgetUserRegistrationForm = {
2510 +
2511 + registraitonFormSubmit: function (_this, $scope) {
2512 +
2513 + bdtUIkit.notification({
2514 + message: '<div bdt-spinner></div>' + $(_this).find('.bdt_spinner_message').val(),
2515 + timeout: false
2516 + });
2517 + $(_this).find('button.bdt-button').attr("disabled", true);
2518 + var redirect_url = $(_this).find('.redirect_after_register').val();
2519 + $.ajax({
2520 + type: 'POST',
2521 + dataType: 'json',
2522 + url: element_pack_ajax_login_config.ajaxurl,
2523 + data: {
2524 + 'action': 'element_pack_ajax_register', //calls wp_ajax_nopriv_element_pack_ajax_register
2525 + 'first_name': $(_this).find('.first_name').val(),
2526 + 'terms': $(_this).find('.user_terms').is(':checked'),
2527 + 'last_name': $(_this).find('.last_name').val(),
2528 + 'email': $(_this).find('.user_email').val(),
2529 + 'password': $(_this).find('.user_password').val(),
2530 + 'is_password_required': $(_this).find('.is_password_required').val(),
2531 + 'g-recaptcha-response': $(_this).find('#g-recaptcha-response').val(),
2532 + 'widget_id': $scope.data('id'),
2533 + 'page_id': $(_this).find('.page_id').val(),
2534 + 'security': $(_this).find('#bdt-user-register-sc').val(),
2535 + 'lang': element_pack_ajax_login_config.language
2536 + },
2537 + success: function (data) {
2538 + var recaptcha_field = _this.find('.element-pack-google-recaptcha');
2539 + if (recaptcha_field.length > 0) {
2540 + var recaptcha_id = recaptcha_field.attr('data-widgetid');
2541 + grecaptcha.reset(recaptcha_id);
2542 + grecaptcha.execute(recaptcha_id);
2543 + }
2544 +
2545 + if (data.registered === true) {
2546 + bdtUIkit.notification.closeAll();
2547 + bdtUIkit.notification({
2548 + message: '<div class="bdt-flex"><span bdt-icon=\'icon: info\'></span><span>' + data.message + '</span></div>',
2549 + status: 'primary'
2550 + });
2551 + if (redirect_url) {
2552 + document.location.href = redirect_url;
2553 + }
2554 + } else {
2555 + bdtUIkit.notification.closeAll();
2556 + bdtUIkit.notification({
2557 + message: '<div class="bdt-flex"><span bdt-icon=\'icon: warning\'></span><span>' + data.message + '</span></div>',
2558 + status: 'warning'
2559 + });
2560 + }
2561 + $(_this).find('button.bdt-button').attr("disabled", false);
2562 +
2563 + },
2564 + });
2565 + },
2566 + load_recaptcha: function () {
2567 + var reCaptchaFields = $('.element-pack-google-recaptcha'),
2568 + widgetID;
2569 +
2570 + if (reCaptchaFields.length > 0) {
2571 + reCaptchaFields.each(function () {
2572 + var self = $(this),
2573 + attrWidget = self.attr('data-widgetid');
2574 + // alert(self.data('sitekey'))
2575 + // Avoid re-rendering as it's throwing API error
2576 + if ((typeof attrWidget !== typeof undefined && attrWidget !== false)) {
2577 + return;
2578 + } else {
2579 + widgetID = grecaptcha.render($(this).attr('id'), {
2580 + sitekey: self.data('sitekey'),
2581 + callback: function (response) {
2582 + if (response !== '') {
2583 + self.append(jQuery('<input>', {
2584 + type: 'hidden',
2585 + value: response,
2586 + class: 'g-recaptcha-response'
2587 + }));
2588 + }
2589 + }
2590 + });
2591 + self.attr('data-widgetid', widgetID);
2592 + }
2593 + });
2594 + }
2595 + }
2596 +
2597 + }
2598 +
2599 +
2600 + window.onLoadElementPackRegisterCaptcha = widgetUserRegistrationForm.load_recaptcha;
2601 +
2602 + var widgetUserRegisterForm = function ($scope, $) {
2603 + var register_form = $scope.find('.bdt-user-register-widget'),
2604 + recaptcha_field = $scope.find('.element-pack-google-recaptcha'),
2605 + $userRegister = $scope.find('.bdt-user-register');
2606 +
2607 + // Perform AJAX register on form submit
2608 + register_form.on('submit', function (e) {
2609 + e.preventDefault();
2610 + widgetUserRegistrationForm.registraitonFormSubmit(register_form, $scope)
2611 + });
2612 +
2613 + if (elementorFrontend.isEditMode() && undefined === recaptcha_field.attr('data-widgetid')) {
2614 + onLoadElementPackRegisterCaptcha();
2615 + }
2616 +
2617 + if (recaptcha_field.length > 0) {
2618 + grecaptcha.ready(function () {
2619 + var recaptcha_id = recaptcha_field.attr('data-widgetid');
2620 + grecaptcha.execute(recaptcha_id);
2621 + });
2622 + }
2623 +
2624 + var $settings = $userRegister.data('settings');
2625 +
2626 + if (!$settings || typeof $settings.passStrength === "undefined") {
2627 + return;
2628 + }
2629 +
2630 + var percentage = 0,
2631 + $selector = $('#' + $settings.id),
2632 + $progressBar = $('#' + $settings.id).find('.bdt-progress-bar');
2633 +
2634 + var passStrength = {
2635 + progress: function ($value = 0) {
2636 + if ($value <= 100) {
2637 + $($progressBar).css({
2638 + 'width': $value + '%'
2639 + });
2640 + }
2641 + },
2642 + formula: function (input, length) {
2643 +
2644 + if (length < 6) {
2645 + percentage = 0;
2646 + $($progressBar).css('background', '#ff4d4d'); //red
2647 + } else if (length < 8) {
2648 + percentage = 10;
2649 + $($progressBar).css('background', '#ffff1a'); //yellow
2650 + } else if (input.match(/0|1|2|3|4|5|6|7|8|9/) == null && input.match(/[A-Z]/) == null) {
2651 + percentage = 40;
2652 + $($progressBar).css('background', '#ffc14d'); //orange
2653 + }else{
2654 + if (length < 12){
2655 + percentage = 50;
2656 + $($progressBar).css('background', '#1aff1a'); //green
2657 + }else{
2658 + percentage = 60;
2659 + $($progressBar).css('background', '#1aff1a'); //green
2660 + }
2661 + }
2662 +
2663 +
2664 + //Lowercase Words only
2665 + if ((input.match(/[a-z]/) != null)) {
2666 + percentage += 10;
2667 + }
2668 +
2669 + //Uppercase Words only
2670 + if ((input.match(/[A-Z]/) != null)) {
2671 + percentage += 10;
2672 + }
2673 +
2674 + //Digits only
2675 + if ((input.match(/0|1|2|3|4|5|6|7|8|9/) != null)) {
2676 + percentage += 10;
2677 + }
2678 +
2679 + //Special characters
2680 + if ((input.match(/\W/) != null) && (input.match(/\D/) != null)) {
2681 + percentage += 10;
2682 + }
2683 + return percentage;
2684 + },
2685 + forceStrongPass: function (result) {
2686 + if (result >= 70) {
2687 + $($selector).find('.elementor-field-type-submit .bdt-button').prop('disabled', false);
2688 + } else {
2689 + $($selector).find('.elementor-field-type-submit .bdt-button').prop('disabled', true);
2690 + }
2691 + },
2692 + init: function () {
2693 + $scope.find('.user_password').keyup(function () {
2694 + var input = $(this).val(),
2695 + length = input.length;
2696 + let result = passStrength.formula(input, length);
2697 + passStrength.progress(result);
2698 +
2699 + if (typeof $settings.forceStrongPass !== 'undefined') {
2700 + passStrength.forceStrongPass(result);
2701 + }
2702 + });
2703 + if (typeof $settings.forceStrongPass !== 'undefined') {
2704 + $($selector).find('.elementor-field-type-submit .bdt-button').prop('disabled', true);
2705 + }
2706 +
2707 + $scope.find('.confirm_password').keyup(function () {
2708 + let input = $(this).val(),
2709 + length = input.length;
2710 + let result = passStrength.formula(input, length);
2711 + passStrength.progress(result);
2712 +
2713 + let pass = $scope.find('.user_password').val();
2714 +
2715 + if(input !== pass){
2716 + $scope.find('.bdt-user-register-pass-res').removeClass('bdt-hidden');
2717 + $($selector).find('.elementor-field-type-submit .bdt-button').prop('disabled', true);
2718 + }else{
2719 + $scope.find('.bdt-user-register-pass-res').addClass('bdt-hidden');
2720 + if (typeof $settings.forceStrongPass !== 'undefined') {
2721 + passStrength.forceStrongPass(result);
2722 + }
2723 + }
2724 +
2725 + });
2726 + }
2727 + }
2728 +
2729 + passStrength.init();
2730 +
2731 + };
2732 +
2733 +
2734 + jQuery(window).on('elementor/frontend/init', function () {
2735 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-user-register.default', widgetUserRegisterForm);
2736 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-user-register.bdt-dropdown', widgetUserRegisterForm);
2737 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-user-register.bdt-modal', widgetUserRegisterForm);
2738 + });
2739 +
2740 + }(jQuery, window.elementorFrontend));
2741 +
2742 + /**
2743 + * End user register widget script
2744 + */
2745 + jQuery(document).ready(function () {
2746 + jQuery('body').on('click', '.bdt-element-link', function () {
2747 + var $el = jQuery(this)
2748 + , settings = $el.data("ep-wrapper-link");
2749 + if (settings && settings.url && (/^https?:\/\//.test(settings.url) || settings.url.startsWith("#"))) {
2750 + var id = "bdt-element-link-" + $el.data("id");
2751 + 0 === jQuery("#" + id).length && jQuery("body").append(jQuery("<a/>").prop({
2752 + target: settings.is_external ? "_blank" : "_self",
2753 + href: settings.url,
2754 + class: "bdt-hidden",
2755 + id: id,
2756 + rel: settings.is_external ? "noopener noreferrer" : ""
2757 + })),
2758 + jQuery("#" + id)[0].click()
2759 + }
2760 + });
2761 + });
2762 +
2763 + ; (function ($, elementor) {
2764 + $(window).on('elementor/frontend/init', function () {
2765 + var ModuleHandler = elementorModules.frontend.handlers.Base,
2766 + ThreedText;
2767 +
2768 + ThreedText = ModuleHandler.extend({
2769 +
2770 + bindEvents: function () {
2771 + this.run();
2772 + },
2773 +
2774 + getDefaultSettings: function () {
2775 + return {
2776 + depth: '30px',
2777 + layers: 8,
2778 + };
2779 + },
2780 +
2781 + onElementChange: debounce(function (prop) {
2782 + if (prop.indexOf('ep_threed_text_') !== -1) {
2783 + this.run();
2784 + }
2785 + }, 400),
2786 +
2787 + settings: function (key) {
2788 + return this.getElementSettings('ep_threed_text_' + key);
2789 + },
2790 +
2791 + run: function () {
2792 + var options = this.getDefaultSettings(),
2793 + $element = this.findElement('.elementor-heading-title, .bdt-main-heading-inner'),
2794 + $widgetId = 'ep-' + this.getID(),
2795 + $widgetIdSelect = '#' + $widgetId;
2796 +
2797 + jQuery($element).attr('id', $widgetId);
2798 +
2799 + if (this.settings('depth.size')) {
2800 + options.depth = this.settings('depth.size') + this.settings('depth.unit') || '30px';
2801 + }
2802 + if (this.settings('layers')) {
2803 + options.layers = this.settings('layers') || 8;
2804 + }
2805 + if (this.settings('perspective.size')) {
2806 + options.perspective = this.settings('perspective.size') + 'px' || '500px';
2807 + }
2808 + if (this.settings('fade')) {
2809 + options.fade = !!this.settings('fade');
2810 + }
2811 + // if (this.settings('direction')) {
2812 + // options.direction = this.settings('direction') || 'forwards';
2813 + // }
2814 + if (this.settings('event')) {
2815 + options.event = this.settings('event') || 'pointer';
2816 + }
2817 + if (this.settings('event_rotation') && this.settings('event') != 'none') {
2818 + options.eventRotation = this.settings('event_rotation.size') + 'deg' || '35deg';
2819 + }
2820 + if (this.settings('event_direction') && this.settings('event') != 'none') {
2821 + options.eventDirection = this.settings('event_direction') || 'default';
2822 + }
2823 +
2824 + if (this.settings('active') == 'yes') {
2825 +
2826 + var $text = $($widgetIdSelect).html();
2827 + $($widgetIdSelect).parent().append('<div class="ep-z-text-duplicate" style="display:none;">' + $text + '</div>');
2828 +
2829 + $text = $($widgetIdSelect).parent().find('.ep-z-text-duplicate:first').html();
2830 +
2831 + $($widgetIdSelect).find('.z-text').remove();
2832 +
2833 + var ztxt = new Ztextify($widgetIdSelect, options, $text);
2834 + }
2835 +
2836 + if (this.settings('depth_color')) {
2837 + var depthColor = this.settings('depth_color') || '#fafafa';
2838 + $($widgetIdSelect).find('.z-layers .z-layer:not(:first-child)').css('color', depthColor);
2839 + }
2840 +
2841 + // if (this.settings('bg_color')) {
2842 + // var bgColor = this.settings('bg_color') || 'rgba(96, 125, 139, .5)';
2843 + // $($widgetIdSelect).find('.z-text > .z-layers').css('background', bgColor);
2844 + // }
2845 +
2846 + }
2847 + });
2848 +
2849 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
2850 + elementorFrontend.elementsHandler.addHandler(ThreedText, {
2851 + $element: $scope
2852 + });
2853 + });
2854 +
2855 + });
2856 + }) (jQuery, window.elementorFrontend);
2857 + /**
2858 + * Start twitter carousel widget script
2859 + */
2860 +
2861 + ( function( $, elementor ) {
2862 +
2863 + 'use strict';
2864 +
2865 + var widgetProductCarousel = function( $scope, $ ) {
2866 +
2867 + var $ProductCarousel = $scope.find( '.bdt-ep-product-carousel' );
2868 +
2869 + if ( ! $ProductCarousel.length ) {
2870 + return;
2871 + }
2872 +
2873 + var $ProductCarouselContainer = $ProductCarousel.find('.swiper-carousel'),
2874 + $settings = $ProductCarousel.data('settings');
2875 +
2876 + // Access swiper class
2877 + const Swiper = elementorFrontend.utils.swiper;
2878 + initSwiper();
2879 +
2880 + async function initSwiper() {
2881 +
2882 + var swiper = await new Swiper($ProductCarouselContainer, $settings);
2883 +
2884 + if ($settings.pauseOnHover) {
2885 + $($ProductCarouselContainer).hover(function() {
2886 + (this).swiper.autoplay.stop();
2887 + }, function() {
2888 + (this).swiper.autoplay.start();
2889 + });
2890 + }
2891 + };
2892 +
2893 + };
2894 +
2895 +
2896 + jQuery(window).on('elementor/frontend/init', function() {
2897 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-product-carousel.default', widgetProductCarousel );
2898 + });
2899 +
2900 + }( jQuery, window.elementorFrontend ) );
2901 +
2902 + /**
2903 + * End twitter carousel widget script
2904 + */
2905 +
2906 +
2907 + /**
2908 + * Start age-gate script
2909 + */
2910 +
2911 + (function ($, elementor) {
2912 +
2913 + 'use strict';
2914 +
2915 + var widgetAgeGate = function ($scope, $) {
2916 +
2917 + var $modal = $scope.find('.bdt-age-gate');
2918 +
2919 + if (!$modal.length) {
2920 + return;
2921 + }
2922 +
2923 + $.each($modal, function (index, val) {
2924 +
2925 + var $this = $(this),
2926 + $settings = $this.data('settings'),
2927 + modalID = $settings.id,
2928 + displayTimes = $settings.displayTimes,
2929 + closeBtnDelayShow = $settings.closeBtnDelayShow,
2930 + delayTime = $settings.delayTime,
2931 + widgetId = $settings.widgetId,
2932 + requiredAge = $settings.requiredAge,
2933 + redirect_link = $settings.redirect_link;
2934 + var editMode = Boolean(elementorFrontend.isEditMode());
2935 +
2936 + if (editMode) {
2937 + redirect_link = false;
2938 + }
2939 +
2940 + var modal = {
2941 + setLocalize: function () {
2942 + if (editMode) {
2943 + this.clearLocalize();
2944 + return;
2945 + }
2946 + this.clearLocalize();
2947 + var widgetID = widgetId,
2948 + localVal = 0,
2949 + // hours = 4;
2950 + hours = $settings.displayTimesExpire;
2951 +
2952 + var expires = (hours * 60 * 60);
2953 + var now = Date.now();
2954 + var schedule = now + expires * 1000;
2955 +
2956 + if (localStorage.getItem(widgetID) === null) {
2957 + localStorage.setItem(widgetID, localVal);
2958 + localStorage.setItem(widgetID + '_expiresIn', schedule);
2959 + }
2960 + if (localStorage.getItem(widgetID) !== null) {
2961 + var count = parseInt(localStorage.getItem(widgetID));
2962 + count++;
2963 + localStorage.setItem(widgetID, count);
2964 + // this.clearLocalize();
2965 + }
2966 + },
2967 + clearLocalize: function () {
2968 + var localizeExpiry = parseInt(localStorage.getItem(widgetId + '_expiresIn'));
2969 + var now = Date.now(); //millisecs since epoch time, lets deal only with integer
2970 + var schedule = now;
2971 + if (schedule >= localizeExpiry) {
2972 + localStorage.removeItem(widgetId + '_expiresIn');
2973 + localStorage.removeItem(widgetId);
2974 + }
2975 + },
2976 + modalFire: function () {
2977 + var displayTimes = 1;
2978 + var firedNotify = parseInt(localStorage.getItem(widgetId)) || 0;
2979 +
2980 + if ((displayTimes !== false) && (firedNotify >= displayTimes)) {
2981 + return;
2982 + }
2983 + bdtUIkit.modal($this, {
2984 + bgclose: false,
2985 + keyboard: false
2986 + }).show();
2987 + },
2988 + ageVerify: function () {
2989 + var init = this;
2990 + var firedNotify = parseInt(localStorage.getItem(widgetId)) || 0;
2991 + $('#' + widgetId).find('.bdt-button').on('click', function (e) {
2992 + let input_age = parseInt($('#' + widgetId).find('.bdt-age-input').val());
2993 +
2994 + if ($(this).hasClass('data-val-yes')) {
2995 + input_age = 18;
2996 + }
2997 + if ($(this).hasClass('data-val-no')) {
2998 + requiredAge = 18;
2999 + input_age = 1;
3000 + }
3001 +
3002 + if (input_age >= requiredAge) {
3003 + init.setLocalize();
3004 + firedNotify += 1;
3005 + bdtUIkit.modal($this).hide();
3006 + } else {
3007 + if (redirect_link == false) {
3008 + $('.modal-msg-text').removeClass('bdt-hidden');
3009 + return;
3010 + } else {
3011 + $('.modal-msg-text').removeClass('bdt-hidden');
3012 + }
3013 + window.location.replace(redirect_link);
3014 + }
3015 + });
3016 +
3017 + bdtUIkit.util.on($this, 'hidden', function () {
3018 +
3019 + if(editMode){
3020 + return;
3021 + }
3022 +
3023 + if (redirect_link == false && firedNotify <= 0) {
3024 +
3025 + setTimeout( function(){
3026 + init.modalFire();
3027 + }, 1500);
3028 +
3029 + return;
3030 + }
3031 +
3032 + if (redirect_link !== false && firedNotify <= 0) {
3033 + window.location.replace(redirect_link);
3034 + }
3035 + });
3036 + },
3037 + closeBtnDelayShow: function () {
3038 + var $modal = $('#' + modalID);
3039 + $modal.find('#bdt-modal-close-button').hide(0);
3040 + $modal.on("shown", function () {
3041 + $('#bdt-modal-close-button').hide(0).fadeIn(delayTime);
3042 + })
3043 + .on("hide", function () {
3044 + $modal.find('#bdt-modal-close-button').hide(0);
3045 + });
3046 + },
3047 +
3048 + default: function () {
3049 + this.modalFire();
3050 + },
3051 + init: function () {
3052 + var init = this;
3053 + init.default();
3054 + init.ageVerify();
3055 +
3056 + if (closeBtnDelayShow) {
3057 + init.closeBtnDelayShow();
3058 + }
3059 + }
3060 + };
3061 +
3062 + // kick the modal
3063 + modal.init();
3064 +
3065 + });
3066 + };
3067 +
3068 + jQuery(window).on('elementor/frontend/init', function () {
3069 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-age-gate.default', widgetAgeGate);
3070 + });
3071 +
3072 + }(jQuery, window.elementorFrontend));
3073 +
3074 + /**
3075 + * End age-gate script
3076 + */
3077 +
3078 + (function ($, elementor) {
3079 +
3080 + 'use strict';
3081 +
3082 + $(window).on('elementor/frontend/init', function () {
3083 + var ModuleHandler = elementorModules.frontend.handlers.Base,
3084 + widgetDarkMode;
3085 +
3086 + widgetDarkMode = ModuleHandler.extend({
3087 +
3088 + bindEvents: function () {
3089 + this.run();
3090 + },
3091 +
3092 + getDefaultSettings: function () {
3093 + return {
3094 + left: 'unset',
3095 + time: '.5s',
3096 + mixColor: '#fff',
3097 + backgroundColor: '#fff',
3098 + saveInCookies: false,
3099 + label: '🌓',
3100 + autoMatchOsTheme: false
3101 + };
3102 + },
3103 +
3104 +
3105 + onElementChange: debounce(function (prop) {
3106 + // if (prop.indexOf('time.size') !== -1) {
3107 + this.run();
3108 + // }
3109 + }, 400),
3110 +
3111 + settings: function (key) {
3112 + return this.getElementSettings(key);
3113 + },
3114 +
3115 + setCookie: function (name, value, days) {
3116 + var expires = "";
3117 + if (days) {
3118 + var date = new Date();
3119 + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
3120 + expires = "; expires=" + date.toUTCString();
3121 + }
3122 + document.cookie = name + "=" + (value || "") + expires + "; path=/";
3123 + },
3124 + getCookie: function (name) {
3125 + var nameEQ = name + "=";
3126 + var ca = document.cookie.split(';');
3127 + for (var i = 0; i < ca.length; i++) {
3128 + var c = ca[i];
3129 + while (c.charAt(0) == ' ') c = c.substring(1, c.length);
3130 + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
3131 + }
3132 + return null;
3133 + },
3134 +
3135 + eraseCookie: function (name) {
3136 + document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
3137 + },
3138 +
3139 +
3140 + run: function () {
3141 + var options = this.getDefaultSettings();
3142 +
3143 + var autoMatchOsTheme = (this.settings('autoMatchOsTheme') === 'yes'
3144 + && this.settings('autoMatchOsTheme') !== 'undefined');
3145 +
3146 + var saveInCookies = (this.settings('saveInCookies') === 'yes'
3147 + && this.settings('saveInCookies') !== 'undefined');
3148 +
3149 + options.left = 'unset';
3150 + options.time = this.settings('time.size') / 1000 + 's';
3151 + options.mixColor = this.settings('mix_color');
3152 + options.backgroundColor = this.settings('default_background');
3153 + options.saveInCookies = saveInCookies;
3154 + options.label = '🌓';
3155 + options.autoMatchOsTheme = autoMatchOsTheme;
3156 +
3157 + $('body').removeClass(function (index, css) {
3158 + return (css.match(/\bbdt-dark-mode-\S+/g) || []).join(' '); // removes anything that starts with "page-"
3159 + });
3160 + $('body').addClass('bdt-dark-mode-position-' + this.settings('toggle_position'));
3161 +
3162 + $(this.settings('ignore_element')).addClass('darkmode-ignore');
3163 +
3164 + if (options.mixColor) {
3165 +
3166 + $('.darkmode-toggle, .darkmode-layer, .darkmode-background').remove();
3167 +
3168 + var darkmode = new Darkmode(options);
3169 + darkmode.showWidget();
3170 +
3171 + if (this.settings('default_mode') === 'dark') {
3172 + darkmode.toggle();
3173 + $('body').addClass('darkmode--activated');
3174 + $('.darkmode-layer').addClass('darkmode-layer--simple darkmode-layer--expanded');
3175 + } else {
3176 + $('body').removeClass('darkmode--activated');
3177 + $('.darkmode-layer').removeClass('darkmode-layer--simple darkmode-layer--expanded');
3178 + }
3179 +
3180 + var global_this = this,
3181 + editMode = $('body').hasClass('elementor-editor-active');
3182 +
3183 + if (editMode === false && saveInCookies === true) {
3184 + $('.darkmode-toggle').on('click', function () {
3185 + if (darkmode.isActivated() === true) {
3186 + global_this.eraseCookie('bdtDarkModeUserAction');
3187 + global_this.setCookie('bdtDarkModeUserAction', 'dark', 10);
3188 + } else if (darkmode.isActivated() === false) {
3189 + global_this.eraseCookie('bdtDarkModeUserAction');
3190 + global_this.setCookie('bdtDarkModeUserAction', 'light', 10);
3191 + } else {
3192 +
3193 + }
3194 + });
3195 +
3196 + var userCookie = this.getCookie('bdtDarkModeUserAction')
3197 +
3198 + if (userCookie !== null && userCookie !== 'undefined') {
3199 + if (userCookie === 'dark') {
3200 + darkmode.toggle();
3201 + $('body').addClass('darkmode--activated');
3202 + $('.darkmode-layer').addClass('darkmode-layer--simple darkmode-layer--expanded');
3203 + } else {
3204 + $('body').removeClass('darkmode--activated');
3205 + $('.darkmode-layer').removeClass('darkmode-layer--simple darkmode-layer--expanded');
3206 + }
3207 +
3208 + }
3209 + }
3210 +
3211 + }
3212 +
3213 +
3214 + }
3215 + });
3216 +
3217 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-dark-mode.default', function ($scope) {
3218 + elementorFrontend.elementsHandler.addHandler(widgetDarkMode, { $element: $scope });
3219 +
3220 + });
3221 + });
3222 +
3223 +
3224 + }(jQuery, window.elementorFrontend));
3225 +
3226 + /**
3227 + * End Dark Mode widget script
3228 + */
3229 +
3230 + (function ($, elementor) {
3231 + $(window).on("elementor/frontend/init", function () {
3232 + var ModuleHandler = elementorModules.frontend.handlers.Base,
3233 + AnimatedGradientBackground;
3234 +
3235 + AnimatedGradientBackground = ModuleHandler.extend({
3236 + bindEvents: function () {
3237 + this.run();
3238 + },
3239 +
3240 + getDefaultSettings: function () {
3241 + return {
3242 + allowHTML: true,
3243 + };
3244 + },
3245 +
3246 + onElementChange: debounce(function (prop) {
3247 + if (prop.indexOf('element_pack_agbg_') !== -1) {
3248 + this.run();
3249 + }
3250 + }, 400),
3251 +
3252 + settings: function (key) {
3253 + return this.getElementSettings("element_pack_agbg_" + key);
3254 + },
3255 +
3256 + // Helper function to parse and standardize colors to desired formats
3257 + parseColor: function (color) {
3258 + // Convert RGBA to 6-digit HEX if alpha is 1
3259 + if (/^rgba?\((\d+),\s*(\d+),\s*(\d+),?\s*([\d.]*)\)$/.test(color)) {
3260 + const [_, r, g, b, a = 1] = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+),?\s*([\d.]*)\)$/);
3261 + const alpha = parseFloat(a);
3262 + if (alpha === 1) {
3263 + // If alpha is 1, convert to 6-digit HEX format
3264 + return `#${((1 << 24) + (parseInt(r) << 16) + (parseInt(g) << 8) + parseInt(b)).toString(16).slice(1)}`;
3265 + }
3266 + return `rgba(${r}, ${g}, ${b}, .${a.toString().split('.')[1] || 0})`; // Format as .decimal if alpha < 1
3267 + }
3268 +
3269 + // Convert 8-digit HEXA (#RRGGBBAA) to 6-digit HEX if alpha is 1
3270 + if (/^#([A-Fa-f0-9]{8})$/.test(color)) {
3271 + const rgba = color.match(/[A-Fa-f0-9]{2}/g).map((hex) => parseInt(hex, 16));
3272 + const alpha = parseFloat((rgba[3] / 255).toFixed(2));
3273 + if (alpha === 1) {
3274 + return `#${color.slice(1, 7)}`; // Remove alpha part if 100% opaque
3275 + }
3276 + return `rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, .${alpha.toString().split('.')[1] || 0})`;
3277 + }
3278 +
3279 + // Convert 6-digit HEX to standard 6-digit HEX (no changes needed)
3280 + if (/^#([A-Fa-f0-9]{6})$/.test(color)) {
3281 + return color.toLowerCase();
3282 + }
3283 +
3284 + // Handle HSLA, standardizing alpha to .decimal format
3285 + if (/^hsla?\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,?\s*([\d.]*)\)$/.test(color)) {
3286 + const [_, h, s, l, a = 1] = color.match(/^hsla?\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,?\s*([\d.]*)\)$/);
3287 + const alpha = parseFloat(a);
3288 + if (alpha === 1) {
3289 + return `hsl(${h}, ${s}%, ${l}%)`; // No alpha if fully opaque
3290 + }
3291 + return `hsla(${h}, ${s}%, ${l}%, .${a.toString().split('.')[1] || 0})`; // .decimal format for alpha < 1
3292 + }
3293 +
3294 + return color; // Return color as-is for named colors or other formats
3295 + },
3296 +
3297 + run: function () {
3298 + if (this.settings('show') !== 'yes') {
3299 + return;
3300 + }
3301 + const sectionID = this.$element.data("id");
3302 + const widgetContainer = document.querySelector(".elementor-element-" + sectionID);
3303 + const checkClass = $(widgetContainer).find(".bdt-animated-gradient-background");
3304 +
3305 + if ($(checkClass).length < 1) {
3306 + $(widgetContainer).prepend('<canvas id="canvas-basic-' + sectionID + '" class="bdt-animated-gradient-background"></canvas>');
3307 + }
3308 +
3309 + const gradientID = $(widgetContainer).find(".bdt-animated-gradient-background").attr("id");
3310 +
3311 + let color_list = this.settings("color_list");
3312 + let colors = color_list.map((color) => [
3313 + this.parseColor(color.start_color),
3314 + this.parseColor(color.end_color)
3315 + ]);
3316 +
3317 + var direction = (this.settings("direction") !== undefined) ? this.settings('direction') : 'diagonal';
3318 + var transitionSpeed = (this.settings("transitionSpeed") !== undefined) ? this.settings('transitionSpeed.size') : '5500';
3319 +
3320 + var granimInstance = new Granim({
3321 + element: "#" + gradientID,
3322 + direction: direction,
3323 + isPausedWhenNotInView: true,
3324 + states: {
3325 + "default-state": {
3326 + gradients: colors,
3327 + transitionSpeed: transitionSpeed,
3328 + },
3329 + },
3330 + });
3331 + },
3332 + });
3333 +
3334 + elementorFrontend.hooks.addAction(
3335 + "frontend/element_ready/section",
3336 + function ($scope) {
3337 + elementorFrontend.elementsHandler.addHandler(AnimatedGradientBackground, {
3338 + $element: $scope,
3339 + });
3340 + }
3341 + );
3342 +
3343 + elementorFrontend.hooks.addAction(
3344 + "frontend/element_ready/container",
3345 + function ($scope) {
3346 + elementorFrontend.elementsHandler.addHandler(AnimatedGradientBackground, {
3347 + $element: $scope,
3348 + });
3349 + }
3350 + );
3351 +
3352 + });
3353 + })(jQuery, window.elementorFrontend);
3354 +
3355 + ; (function ($, elementor) {
3356 + $(window).on('elementor/frontend/init', function () {
3357 + var ModuleHandler = elementorModules.frontend.handlers.Base,
3358 + Tooltip;
3359 +
3360 + Tooltip = ModuleHandler.extend({
3361 +
3362 + bindEvents: function () {
3363 + this.run();
3364 + },
3365 +
3366 + getDefaultSettings: function () {
3367 + return {
3368 + allowHTML: true,
3369 + };
3370 + },
3371 +
3372 + onElementChange: debounce(function (prop) {
3373 + if (prop.indexOf('element_pack_widget_') !== -1) {
3374 + this.instance.destroy();
3375 + this.run();
3376 + }
3377 + }, 400),
3378 +
3379 + settings: function (key) {
3380 + return this.getElementSettings('element_pack_widget_' + key);
3381 + },
3382 +
3383 + run: function () {
3384 + var options = this.getDefaultSettings();
3385 + var widgetID = this.$element.data('id');
3386 + var widgetContainer = document.querySelector('.elementor-element-' + widgetID);
3387 +
3388 + if (this.settings('tooltip_text')) {
3389 + options.content = EP_SAFE_HTML(this.settings('tooltip_text'));
3390 + }
3391 +
3392 + options.arrow = !!this.settings('tooltip_arrow');
3393 + options.followCursor = !!this.settings('tooltip_follow_cursor');
3394 +
3395 + if (this.settings('tooltip_placement')) {
3396 + options.placement = this.settings('tooltip_placement');
3397 + }
3398 +
3399 + if (this.settings('tooltip_trigger')) {
3400 + if (this.settings('tooltip_custom_trigger')) {
3401 + options.triggerTarget = document.querySelector(this.settings('tooltip_custom_trigger'));
3402 + } else {
3403 + options.trigger = this.settings('tooltip_trigger');
3404 + }
3405 + }
3406 + // if (this.settings('tooltip_animation_duration')) {
3407 + // options.duration = this.settings('tooltip_animation_duration.sizes.from');
3408 + // }
3409 + if (this.settings('tooltip_animation')) {
3410 + if (this.settings('tooltip_animation') === 'fill') {
3411 + options.animateFill = true;
3412 + } else {
3413 + options.animation = this.settings('tooltip_animation');
3414 + }
3415 + }
3416 + if (this.settings('tooltip_x_offset.size') || this.settings('tooltip_y_offset.size')) {
3417 + options.offset = [this.settings('tooltip_x_offset.size') || 0, this.settings('tooltip_y_offset.size') || 0];
3418 + }
3419 + if (this.settings('tooltip')) {
3420 + options.theme = 'bdt-tippy-' + widgetID;
3421 + this.instance = tippy(widgetContainer, options);
3422 + }
3423 + }
3424 + });
3425 +
3426 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
3427 + elementorFrontend.elementsHandler.addHandler(Tooltip, {
3428 + $element: $scope
3429 + });
3430 + });
3431 + });
3432 + })(jQuery, window.elementorFrontend);
3433 +
3434 + // Common js for review card, review card carousel, review card grid, testimonial carousel, testimonial grid
3435 + (function ($, elementor) {
3436 + "use strict";
3437 + $(window).on("elementor/frontend/init", function () {
3438 + /** Read more */
3439 + const readMoreWidgetHandler = function readMoreWidgetHandler($scope) {
3440 + if (jQuery($scope).find(".bdt-ep-read-more-text").length) {
3441 + jQuery($scope)
3442 + .find(".bdt-ep-read-more-text")
3443 + .each(function () {
3444 + var words_limit_settings = $(this).data("read-more");
3445 + var max_words = words_limit_settings.words_length || 20; // Set the maximum number of words to show
3446 + var content = $(this).html(); // Get the full content
3447 + var cleanContent = content.replace(/<\/?[^>]+(>|$)/g, ""); // Removes all HTML tags
3448 + var words = cleanContent.split(/\s+/);
3449 +
3450 + if (words.length > max_words) {
3451 + var short_content = words.slice(0, max_words).join(" "); // Get the first part of the content
3452 + var long_content = words.slice(max_words).join(" "); // Get the remaining part of the content
3453 +
3454 + $(this).html(`
3455 + ${short_content}
3456 + <a href="#" class="bdt_read_more">...${ElementPackConfig.words_limit.read_more}</a>
3457 + <span class="bdt_more_text" style="display:none;">${long_content}</span>
3458 + <a href="#" class="bdt_read_less" style="display:none;">${ElementPackConfig.words_limit.read_less}</a>
3459 + `);
3460 +
3461 + $(this)
3462 + .find("a.bdt_read_more")
3463 + .on('click', function (event) {
3464 + event.preventDefault();
3465 + $(this).hide(); // Hide the read more link
3466 + $(this).siblings(".bdt_more_text").show(); // Show the more text
3467 + $(this).siblings("a.bdt_read_less").show(); // Show the read less link
3468 + });
3469 +
3470 + $(this)
3471 + .find("a.bdt_read_less")
3472 + .click(function (event) {
3473 + event.preventDefault();
3474 + $(this).hide(); // Hide the read less link
3475 + $(this).siblings(".bdt_more_text").hide(); // Hide the more text
3476 + $(this).siblings("a.bdt_read_more").show(); // Show the read more link
3477 + });
3478 + }
3479 + });
3480 + }
3481 + };
3482 +
3483 + const readMoreWidgetsHanlders = {
3484 + "bdt-review-card.default": readMoreWidgetHandler,
3485 + "bdt-review-card-carousel.default": readMoreWidgetHandler,
3486 + "bdt-review-card-grid.default": readMoreWidgetHandler,
3487 + "bdt-testimonial-carousel.default": readMoreWidgetHandler,
3488 + "bdt-testimonial-carousel.bdt-twyla": readMoreWidgetHandler,
3489 + "bdt-testimonial-carousel.bdt-vyxo": readMoreWidgetHandler,
3490 + "bdt-testimonial-grid.default": readMoreWidgetHandler,
3491 + "bdt-testimonial-slider.default": readMoreWidgetHandler,
3492 + "bdt-testimonial-slider.bdt-single": readMoreWidgetHandler,
3493 + "bdt-testimonial-slider.bdt-thumb": readMoreWidgetHandler,
3494 + };
3495 +
3496 + $.each(readMoreWidgetsHanlders, function (widgetName, handlerFn) {
3497 + elementorFrontend.hooks.addAction(
3498 + "frontend/element_ready/" + widgetName,
3499 + handlerFn
3500 + );
3501 + });
3502 + /** /Read more */
3503 + });
3504 + })(jQuery, window.elementorFrontend);
3505 +
3506 + // end
3507 +
3508 + ; (function ($, elementor) {
3509 + $(window).on('elementor/frontend/init', function () {
3510 + let ModuleHandler = elementorModules.frontend.handlers.Base,
3511 + CursorEffect;
3512 +
3513 + CursorEffect = ModuleHandler.extend({
3514 + bindEvents: function () {
3515 + this.run();
3516 + },
3517 + getDefaultSettings: function () {
3518 + return {
3519 +
3520 + };
3521 + },
3522 + onElementChange: debounce(function (prop) {
3523 + if (prop.indexOf('element_pack_cursor_effects_') !== -1) {
3524 + this.run();
3525 + }
3526 + }, 400),
3527 +
3528 + settings: function (key) {
3529 + return this.getElementSettings('element_pack_cursor_effects_' + key);
3530 + },
3531 +
3532 + run: function () {
3533 + if (this.settings("show") !== "yes") {
3534 + return;
3535 + }
3536 +
3537 + // Disable on mobile
3538 + const disableOnMobile = this.settings("disable_on_mobile") === "yes";
3539 + const isMobile = window.innerWidth <= 767;
3540 + if (disableOnMobile && isMobile) {
3541 + return;
3542 + }
3543 +
3544 + var options = this.getDefaultSettings(),
3545 + elementID = this.$element.data("id"),
3546 + elementContainer = ".elementor-element-" + elementID,
3547 + $element = this.$element,
3548 + cursorStyle = this.settings("style");
3549 + const checkClass = $(elementContainer).find(".bdt-cursor-effects");
3550 + var source = this.settings("source");
3551 + if ($(checkClass).length < 1) {
3552 + if (source === "image") {
3553 + var image = this.settings("image_src.url");
3554 + $(elementContainer).append(
3555 + '<div class="bdt-cursor-effects"><div id="bdt-ep-cursor-ball-effects-' +
3556 + elementID +
3557 + '" class="ep-cursor-ball"><img class="bdt-cursor-image"src="' +
3558 + image +
3559 + '"></div></div>'
3560 + );
3561 + } else if (source === "icons") {
3562 + var svg = this.settings("icons.value.url");
3563 + var icons = this.settings("icons.value");
3564 + if (svg !== undefined) {
3565 + $(elementContainer).append(
3566 + '<div class="bdt-cursor-effects"><div id="bdt-ep-cursor-ball-effects-' +
3567 + elementID +
3568 + '" class="ep-cursor-ball"><img class="bdt-cursor-image" src="' +
3569 + svg +
3570 + '"></img></div></div>'
3571 + );
3572 + } else {
3573 + $(elementContainer).append(
3574 + '<div class="bdt-cursor-effects"><div id="bdt-ep-cursor-ball-effects-' +
3575 + elementID +
3576 + '" class="ep-cursor-ball"><i class="' +
3577 + icons +
3578 + ' bdt-cursor-icons"></i></div></div>'
3579 + );
3580 + }
3581 + } else if (source === "text") {
3582 + var text = this.settings("text_label");
3583 + $(elementContainer).append(
3584 + '<div class="bdt-cursor-effects"><div id="bdt-ep-cursor-ball-effects-' +
3585 + elementID +
3586 + '" class="ep-cursor-ball"><span class="bdt-cursor-text">' +
3587 + text +
3588 + "</span></div></div>"
3589 + );
3590 + } else {
3591 + $(elementContainer).append(
3592 + '<div class="bdt-cursor-effects ' +
3593 + cursorStyle +
3594 + '"><div id="bdt-ep-cursor-ball-effects-' +
3595 + elementID +
3596 + '" class="ep-cursor-ball"></div><div id="bdt-ep-cursor-circle-effects-' +
3597 + elementID +
3598 + '" class="ep-cursor-circle"></div></div>'
3599 + );
3600 + }
3601 + }
3602 + const cursorBallID =
3603 + "#bdt-ep-cursor-ball-effects-" + this.$element.data("id");
3604 + const cursorBall = document.querySelector(cursorBallID);
3605 + options.models = elementContainer;
3606 + options.speed = 1;
3607 + options.centerMouse = true;
3608 + new Cotton(cursorBall, options);
3609 +
3610 + if (source === "default") {
3611 + const cursorCircleID =
3612 + "#bdt-ep-cursor-circle-effects-" + this.$element.data("id");
3613 + const cursorCircle = document.querySelector(cursorCircleID);
3614 + options.models = elementContainer;
3615 + options.speed = this.settings("speed")
3616 + ? this.settings("speed.size")
3617 + : 0.725;
3618 + options.centerMouse = true;
3619 + new Cotton(cursorCircle, options);
3620 + }
3621 + }
3622 + });
3623 +
3624 + // Handle widgets
3625 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
3626 + elementorFrontend.elementsHandler.addHandler(CursorEffect, {
3627 + $element: $scope
3628 + });
3629 + });
3630 +
3631 + // Handle sections
3632 + elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) {
3633 + elementorFrontend.elementsHandler.addHandler(CursorEffect, {
3634 + $element: $scope
3635 + });
3636 + });
3637 +
3638 + // Handle containers
3639 + elementorFrontend.hooks.addAction('frontend/element_ready/container', function ($scope) {
3640 + elementorFrontend.elementsHandler.addHandler(CursorEffect, {
3641 + $element: $scope
3642 + });
3643 + });
3644 + });
3645 + })(jQuery, window.elementorFrontend);
3646 +
3647 + /**
3648 + * Start Content Switcher widget script
3649 + */
3650 +
3651 + (function ($, elementor) {
3652 +
3653 + 'use strict';
3654 +
3655 + var widgetContentSwitcher = function ($scope, $) {
3656 +
3657 + var $contentSwitcher = $scope.find('.bdt-content-switcher'),
3658 + $settings = $contentSwitcher.data('settings'),
3659 + $linkedSections = $contentSwitcher.data('linked-sections'),
3660 + $linkedWidgets = $contentSwitcher.data('linked-widgets'),
3661 + editMode = Boolean(elementorFrontend.isEditMode());
3662 +
3663 + if (!$contentSwitcher.length) {
3664 + return;
3665 + }
3666 +
3667 + // Handle linked sections if needed
3668 + if ($linkedSections !== undefined && editMode === false) {
3669 + const handleLinkedSections = () => {
3670 + var $sections = $linkedSections.sections;
3671 +
3672 + // Process each linked section
3673 + Object.entries($sections).forEach(([index, sectionId]) => {
3674 + var $switcherContainer = $contentSwitcher.find('.bdt-switcher-content').eq(index),
3675 + $sectionContent = $('.elementor').find('.elementor-element' + '#' + sectionId);
3676 +
3677 + if ($linkedSections.positionUnchanged !== true) {
3678 + if ($switcherContainer.length && $sectionContent.length) {
3679 + $($sectionContent).appendTo($switcherContainer.find('.bdt-switcher-item-content-section'));
3680 + }
3681 + } else {
3682 + // Handle position unchanged - similar to the switcher widget
3683 + var $activeClass = '';
3684 + if (index == 0 && $contentSwitcher.find('.bdt-primary').hasClass('bdt-active') ||
3685 + index > 0 && $contentSwitcher.find(`.bdt-switcher-content:eq(${index})`).hasClass('bdt-active')) {
3686 + $activeClass = 'bdt-active';
3687 + }
3688 +
3689 + if (!$(`#bdt-content-switcher-section-${$linkedSections.id}`).length) {
3690 + $sectionContent.parent().append(`<div id="bdt-content-switcher-section-${$linkedSections.id}" class="bdt-switcher bdt-switcher-section-content"></div>`);
3691 + }
3692 +
3693 + $($sectionContent).appendTo($(`#bdt-content-switcher-section-${$linkedSections.id}`));
3694 + $sectionContent.wrap(`<div class="bdt-switcher-section-content-inner ${$activeClass}"></div>`);
3695 + }
3696 + });
3697 + };
3698 +
3699 + handleLinkedSections();
3700 + }
3701 +
3702 + // Handle linked widgets if needed
3703 + if ($linkedWidgets !== undefined && editMode === false) {
3704 + const handleLinkedWidgets = () => {
3705 + var $widgets = $linkedWidgets.widgets;
3706 +
3707 + // Set initial visibility of widgets
3708 + Object.entries($widgets).forEach(([index, widgetId]) => {
3709 + var $targetWidget = $('#' + widgetId),
3710 + isActive = false;
3711 +
3712 + if ('button' !== $settings.switcherStyle) {
3713 + if (index == 0 && $contentSwitcher.find('.bdt-primary').hasClass('bdt-active')) {
3714 + isActive = true;
3715 + } else if (index == 1 && $contentSwitcher.find('.bdt-secondary').hasClass('bdt-active')) {
3716 + isActive = true;
3717 + }
3718 + } else {
3719 + if ($contentSwitcher.find(`.bdt-switcher-content:eq(${index})`).hasClass('bdt-active')) {
3720 + isActive = true;
3721 + }
3722 + }
3723 +
3724 + $targetWidget.css({
3725 + 'opacity': isActive ? 1 : 0,
3726 + 'display': isActive ? 'block' : 'none',
3727 + 'grid-row-start': 1,
3728 + 'grid-column-start': 1
3729 + });
3730 +
3731 + $targetWidget.parent().css({
3732 + 'display': 'grid'
3733 + });
3734 + });
3735 + };
3736 +
3737 + handleLinkedWidgets();
3738 + }
3739 +
3740 + if ('button' !== $settings.switcherStyle) {
3741 +
3742 + // Content Switcher Checkbox
3743 + var $checkbox = $contentSwitcher.find('input[type="checkbox"]');
3744 + var primarySwitcher = $contentSwitcher.find('.bdt-primary-switcher');
3745 + var secondarySwitcher = $contentSwitcher.find('.bdt-secondary-switcher');
3746 + var primaryIcon = $contentSwitcher.find('.bdt-primary-icon');
3747 + var secondaryIcon = $contentSwitcher.find('.bdt-secondary-icon');
3748 + var primaryText = $contentSwitcher.find('.bdt-primary-text');
3749 + var secondaryText = $contentSwitcher.find('.bdt-secondary-text');
3750 + var primaryContent = $contentSwitcher.find('.bdt-switcher-content.bdt-primary');
3751 + var secondaryContent = $contentSwitcher.find('.bdt-switcher-content.bdt-secondary');
3752 +
3753 + $checkbox.on('change', function () {
3754 + if (this.checked) {
3755 + primarySwitcher.removeClass('bdt-active');
3756 + secondarySwitcher.addClass('bdt-active');
3757 + primaryIcon.removeClass('bdt-active');
3758 + secondaryIcon.addClass('bdt-active');
3759 + primaryText.removeClass('bdt-active');
3760 + secondaryText.addClass('bdt-active');
3761 + primaryContent.removeClass('bdt-active');
3762 + secondaryContent.addClass('bdt-active');
3763 +
3764 + // Update linked sections if position unchanged is true
3765 + if ($linkedSections && $linkedSections.positionUnchanged === true) {
3766 + $(`#bdt-content-switcher-section-${$linkedSections.id} .bdt-switcher-section-content-inner`).removeClass('bdt-active');
3767 + $(`#bdt-content-switcher-section-${$linkedSections.id} .bdt-switcher-section-content-inner`).eq(1).addClass('bdt-active');
3768 + }
3769 +
3770 + // Update linked widgets visibility
3771 + if ($linkedWidgets) {
3772 + Object.entries($linkedWidgets.widgets).forEach(([index, widgetId]) => {
3773 + var $targetWidget = $('#' + widgetId);
3774 + var isActive = index == 1; // Show second widget when checkbox is checked
3775 +
3776 + $targetWidget.css({
3777 + 'opacity': isActive ? 1 : 0,
3778 + 'display': isActive ? 'block' : 'none'
3779 + });
3780 + });
3781 + }
3782 + } else {
3783 + primarySwitcher.addClass('bdt-active');
3784 + secondarySwitcher.removeClass('bdt-active');
3785 + primaryIcon.addClass('bdt-active');
3786 + secondaryIcon.removeClass('bdt-active');
3787 + primaryText.addClass('bdt-active');
3788 + secondaryText.removeClass('bdt-active');
3789 + primaryContent.addClass('bdt-active');
3790 + secondaryContent.removeClass('bdt-active');
3791 +
3792 + // Update linked sections if position unchanged is true
3793 + if ($linkedSections && $linkedSections.positionUnchanged === true) {
3794 + $(`#bdt-content-switcher-section-${$linkedSections.id} .bdt-switcher-section-content-inner`).removeClass('bdt-active');
3795 + $(`#bdt-content-switcher-section-${$linkedSections.id} .bdt-switcher-section-content-inner`).eq(0).addClass('bdt-active');
3796 + }
3797 +
3798 + // Update linked widgets visibility
3799 + if ($linkedWidgets) {
3800 + Object.entries($linkedWidgets.widgets).forEach(([index, widgetId]) => {
3801 + var $targetWidget = $('#' + widgetId);
3802 + var isActive = index == 0; // Show first widget when checkbox is unchecked
3803 +
3804 + $targetWidget.css({
3805 + 'opacity': isActive ? 1 : 0,
3806 + 'display': isActive ? 'block' : 'none'
3807 + });
3808 + });
3809 + }
3810 + }
3811 + });
3812 + }
3813 +
3814 + if ('button' == $settings.switcherStyle) {
3815 + var $tab = $contentSwitcher.find('.bdt-content-switcher-tab');
3816 +
3817 + $tab.on('click', function () {
3818 + var $this = $(this);
3819 + var id = $this.attr('id');
3820 + var $content = $contentSwitcher.find('.bdt-switcher-content[data-content-id="' + id + '"]');
3821 + var index = $this.index();
3822 +
3823 + $this.siblings().removeClass('bdt-active');
3824 + $this.addClass('bdt-active');
3825 +
3826 + $this.parent().next().children().removeClass('bdt-active');
3827 + $content.addClass('bdt-active');
3828 +
3829 + // Update linked sections if position unchanged is true
3830 + if ($linkedSections && $linkedSections.positionUnchanged === true) {
3831 + $(`#bdt-content-switcher-section-${$linkedSections.id} .bdt-switcher-section-content-inner`).removeClass('bdt-active');
3832 + $(`#bdt-content-switcher-section-${$linkedSections.id} .bdt-switcher-section-content-inner`).eq(index).addClass('bdt-active');
3833 + }
3834 +
3835 + // Update linked widgets visibility
3836 + if ($linkedWidgets) {
3837 + Object.entries($linkedWidgets.widgets).forEach(([widgetIndex, widgetId]) => {
3838 + var $targetWidget = $('#' + widgetId);
3839 + var isActive = parseInt(widgetIndex) === index;
3840 +
3841 + $targetWidget.css({
3842 + 'opacity': isActive ? 1 : 0,
3843 + 'display': isActive ? 'block' : 'none'
3844 + });
3845 + });
3846 + }
3847 + });
3848 + }
3849 + }
3850 +
3851 + jQuery(window).on('elementor/frontend/init', function () {
3852 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-content-switcher.default', widgetContentSwitcher);
3853 + });
3854 +
3855 + }(jQuery, window.elementorFrontend));
3856 +
3857 + /**
3858 + * End Content Switcher widget script
3859 + */
3860 + /**
3861 + * Start interactive card widget script
3862 + */
3863 +
3864 + (function ($, elementor) {
3865 +
3866 + 'use strict';
3867 +
3868 + var widgetInteractiveCard = function ($scope, $) {
3869 + var $i_card_main = $scope.find('.bdt-interactive-card');
3870 +
3871 + if ( !$i_card_main.length ) {
3872 + return;
3873 + }
3874 + var $settings = $i_card_main.data('settings');
3875 +
3876 + if ( $($settings).length ) {
3877 + var myWave = wavify(document.querySelector('#' + $settings.id), {
3878 + height : 60,
3879 + bones : $settings.wave_bones, //3
3880 + amplitude: $settings.wave_amplitude, //40
3881 + speed : $settings.wave_speed //.25
3882 + });
3883 +
3884 + setTimeout(function(){
3885 + $($i_card_main).addClass('bdt-wavify-active');
3886 + }, 1000);
3887 + }
3888 + };
3889 +
3890 + jQuery(window).on('elementor/frontend/init', function () {
3891 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-interactive-card.default', widgetInteractiveCard);
3892 + });
3893 +
3894 + }(jQuery, window.elementorFrontend));
3895 +
3896 + /**
3897 + * End interactive card widget script
3898 + */
3899 +
3900 +
3901 + /**
3902 + * Start scrollnav widget script
3903 + */
3904 +
3905 + ( function( $, elementor ) {
3906 +
3907 + 'use strict';
3908 +
3909 + var widgetScrollNav = function( $scope, $ ) {
3910 +
3911 + var $scrollnav = $scope.find( '.bdt-dotnav > li' );
3912 +
3913 + if ( ! $scrollnav.length ) {
3914 + return;
3915 + }
3916 +
3917 + var $tooltip = $scrollnav.find('> .bdt-tippy-tooltip'),
3918 + widgetID = $scope.data('id');
3919 +
3920 + $tooltip.each( function( index ) {
3921 + tippy( this, {
3922 + allowHTML: true,
3923 + theme: 'bdt-tippy-' + widgetID
3924 + });
3925 + });
3926 +
3927 + };
3928 +
3929 +
3930 + jQuery(window).on('elementor/frontend/init', function() {
3931 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-scrollnav.default', widgetScrollNav );
3932 + });
3933 +
3934 + }( jQuery, window.elementorFrontend ) );
3935 +
3936 + /**
3937 + * End scrollnav widget script
3938 + */
3939 +
3940 +
3941 + /**
3942 + * Start custom calculator widget script
3943 + */
3944 +
3945 + ;
3946 + (function ($, elementor) {
3947 + 'use strict';
3948 + var widgetCCalculator = function ($scope, $) {
3949 + var $customCalculator = $scope.find('.bdt-ep-advanced-calculator'),
3950 + $settings = $customCalculator.data('settings');
3951 +
3952 + if (!$customCalculator.length) {
3953 + return;
3954 + }
3955 +
3956 + // start main js
3957 + function getVarableDataArray() {
3958 + let data = [],
3959 + variableIndex,
3960 + onlyValueArray = [],
3961 + formulaString = "",
3962 + getIsRealValue,
3963 + radioNameArrayStack = []; // radioNameArrayStack is for escaping duplicating value of radio button
3964 + $.each(
3965 + $($settings.id).find(
3966 + ".bdt-ep-advanced-calculator-field-wrap input[type=text], .bdt-ep-advanced-calculator-field-wrap input[type=hidden], .bdt-ep-advanced-calculator-field-wrap input[type=checkbox], .bdt-ep-advanced-calculator-field-wrap input[type=radio], .bdt-ep-advanced-calculator-field-wrap input[type=number], .bdt-ep-advanced-calculator-field-wrap select"
3967 + ),
3968 + function (index, item) {
3969 + variableIndex = parseInt(index) + 1;
3970 + let itemValue = parseInt($(item).val());
3971 + if ($(item).prop("type") === "radio") {
3972 + let currentRadioButtonName = $(item).attr('name');
3973 + if ($("input[name='" + currentRadioButtonName + "']").is(":checked") === true && radioNameArrayStack.indexOf(currentRadioButtonName) < 0) {
3974 + radioNameArrayStack.push(currentRadioButtonName);
3975 + getIsRealValue = getValueIfInteger($('input[name="' + currentRadioButtonName + '"]:checked').val());
3976 + if (Number.isInteger(getIsRealValue)) {
3977 + onlyValueArray.push({
3978 + variable: "f" + variableIndex,
3979 + value: getIsRealValue,
3980 + });
3981 + }
3982 + data.push({
3983 + type: $(item).prop("type"),
3984 + index: index,
3985 + value: $(item).val(),
3986 + variable: "f" + variableIndex,
3987 + //real_value: getValueIfInteger($(item).val())
3988 + real_value: getIsRealValue,
3989 + });
3990 + formulaString +=
3991 + Number.isInteger(itemValue) && itemValue < 0 ?
3992 + "-f" + variableIndex + ", " :
3993 + "f" + variableIndex + ", ";
3994 + variableIndex++;
3995 + }
3996 + } else if ($(item).prop("type") === "checkbox") {
3997 + // first check if this item is checkbox or radio
3998 + if ($(item).is(":checked") === true) {
3999 + getIsRealValue = getValueIfInteger($(item).val());
4000 + if (Number.isInteger(getIsRealValue)) {
4001 + onlyValueArray.push({
4002 + variable: "f" + variableIndex,
4003 + value: getIsRealValue,
4004 + });
4005 + }
4006 + data.push({
4007 + type: $(item).prop("type"),
4008 + index: index,
4009 + value: $(item).val(),
4010 + variable: "f" + variableIndex,
4011 + //real_value: getValueIfInteger($(item).val())
4012 + real_value: getIsRealValue,
4013 + });
4014 + formulaString +=
4015 + Number.isInteger(itemValue) && itemValue < 0 ?
4016 + "-f" + variableIndex + ", " :
4017 + "f" + variableIndex + ", ";
4018 + variableIndex++;
4019 + }
4020 + } else if ($(item).prop("type") === "number") {
4021 + getIsRealValue = getValueIfInteger($(item).val());
4022 + if (Number.isInteger(getIsRealValue)) {
4023 + onlyValueArray.push({
4024 + variable: "f" + variableIndex,
4025 + value: getIsRealValue,
4026 + });
4027 + }
4028 + data.push({
4029 + type: $(item).prop("type"),
4030 + index: index,
4031 + value: $(item).val(),
4032 + variable: "f" + variableIndex,
4033 + //real_value: getValueIfInteger($(item).val())
4034 + real_value: getIsRealValue,
4035 + });
4036 + formulaString +=
4037 + Number.isInteger(itemValue) && itemValue < 0 ?
4038 + "-f" + variableIndex + ", " :
4039 + "f" + variableIndex + ", ";
4040 + variableIndex++;
4041 + } else {
4042 + getIsRealValue = getValueIfInteger($(item).val());
4043 + if (Number.isInteger(getIsRealValue)) {
4044 + onlyValueArray.push({
4045 + variable: "f" + variableIndex,
4046 + value: getIsRealValue,
4047 + });
4048 + }
4049 +
4050 + if (Number.isInteger(getIsRealValue) === false) {
4051 + onlyValueArray.push({
4052 + variable: "f" + variableIndex,
4053 + value: getIsRealValue,
4054 + });
4055 + }
4056 +
4057 + data.push({
4058 + type: $(item).prop("type"),
4059 + index: index,
4060 + value: $(item).val(),
4061 + variable: "f" + variableIndex,
4062 + //real_value: getValueIfInteger($(item).val())
4063 + real_value: getIsRealValue,
4064 + });
4065 + formulaString +=
4066 + Number.isInteger(itemValue) && itemValue < 0 ?
4067 + "-f" + variableIndex + ", " :
4068 + "f" + variableIndex + ", ";
4069 + variableIndex++;
4070 + }
4071 + }
4072 + );
4073 + return [data, onlyValueArray];
4074 + }
4075 + /**
4076 + * casting value
4077 + */
4078 + function getValueIfInteger(value) {
4079 + if (value === undefined) return null;
4080 + // first convert this value to integer
4081 + // let valueConvert = parseInt(value);
4082 + let valueConvert = Number(value);
4083 + // and then check if this item is integer or not. if integer then return that value otherwise return false
4084 + return Number.isInteger(valueConvert) === true ? valueConvert : parseFloat(value);
4085 + //return Number.isInteger(valueConvert) === true ? valueConvert : null;
4086 + }
4087 +
4088 + /**
4089 + * get the data settings from targetted element
4090 + */
4091 + function getFormulaStringFromDataSettings() {
4092 + let str = $settings.formula,
4093 + extract = str ? str.match(/'(.*)'/).pop() : false;
4094 + return extract ? extract : false;
4095 + }
4096 + /**
4097 + * processing calculation
4098 + */
4099 + function procesingFormDataWithFormulaJs() {
4100 + let getDataArray = getVarableDataArray(),
4101 + regexp = new RegExp("[f][1-9][0-9]{0,2}|1000$", "g"),
4102 + str = getFormulaStringFromDataSettings(),
4103 + match,
4104 + value;
4105 + let variableArray = getDataArray[1]; // here variableArray is just contain all variable information
4106 + if (variableArray.length > 0) {
4107 + while ((match = regexp.exec(str)) !== null) {
4108 + let isElementExistsCounter = 0;
4109 + for (let i = 0; i < variableArray.length; i++) {
4110 + if (variableArray[i]["variable"] === match[0]) {
4111 + str = str.replace(match[0], variableArray[i]["value"]);
4112 + isElementExistsCounter++;
4113 + }
4114 + }
4115 + if (isElementExistsCounter === 0) {
4116 + str = str.replace(match[0], null);
4117 + }
4118 + }
4119 + try {
4120 + value = eval("formulajs." + str);
4121 + $($settings.id).find(".bdt-ep-advanced-calculator-result span").text(value.toFixed(2));
4122 + //alert(value);
4123 + } catch (error) {
4124 + // alert("error occured, invalid data format. please fix the data format and send again. thanks!");
4125 + $($settings.id).find('.bdt-ep-advanced-calculator-error').removeClass('bdt-hidden');
4126 + setTimeout(function () {
4127 + $($settings.id).find('.bdt-ep-advanced-calculator-error').addClass('bdt-hidden');
4128 + }, 5000);
4129 + }
4130 + }
4131 + }
4132 +
4133 + if ($settings.resultShow == 'submit') {
4134 + $($settings.id).find(".bdt-ep-advanced-calculator-form").on('submit', function (e) {
4135 + e.preventDefault();
4136 + procesingFormDataWithFormulaJs();
4137 + });
4138 + }
4139 + if ($settings.resultShow == 'change') {
4140 + $($settings.id).find(".bdt-ep-advanced-calculator-form input").change(function () {
4141 + procesingFormDataWithFormulaJs();
4142 + });
4143 + }
4144 +
4145 + };
4146 +
4147 + jQuery(window).on('elementor/frontend/init', function () {
4148 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-calculator.default', widgetCCalculator);
4149 + });
4150 +
4151 + }(jQuery, window.elementorFrontend));
4152 +
4153 + /**
4154 + * End custom calculator widget script
4155 + */
4156 + /**
4157 + * Start advanced counter widget script
4158 + */
4159 + ; (function ($, elementor) {
4160 + 'use strict';
4161 + var widgetAdvancedCounter = function ($scope, $) {
4162 + var $AdvancedCounter = $scope.find('.bdt-ep-advanced-counter');
4163 + if (!$AdvancedCounter.length) {
4164 + return;
4165 + }
4166 +
4167 + let $this = $($scope[0]).find('.bdt-ep-advanced-counter'),
4168 + $settings = $this.data('settings');
4169 +
4170 + let countNumber = $settings.countNumber ?? 0;
4171 +
4172 + let options = {
4173 + startVal: $settings.countStart ?? 0,
4174 + numerals: $settings.language,
4175 + decimalPlaces: $settings.decimalPlaces ?? 0,
4176 + duration: $settings.duration ?? 0,
4177 + useEasing: !($settings.useEasing == null),
4178 + useGrouping: !($settings.useGrouping == null),
4179 + separator: $settings.counterSeparator ?? '',
4180 + decimal: $settings.decimalSymbol ?? '',
4181 + prefix: $settings.counterPrefix ?? '',
4182 + suffix: $settings.counterSuffix ?? '',
4183 + };
4184 +
4185 + epObserveTarget($scope[0], function () {
4186 +
4187 + var demo = new CountUp($settings.id, countNumber, options);
4188 +
4189 + if (!demo.error) {
4190 + demo.start();
4191 + } else {
4192 + console.error(demo.error);
4193 + }
4194 +
4195 + });
4196 +
4197 + };
4198 + jQuery(window).on('elementor/frontend/init', function () {
4199 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-counter.default', widgetAdvancedCounter);
4200 + });
4201 + }(jQuery, window.elementorFrontend));
4202 +
4203 + /**
4204 + * End advanced counter widget script
4205 + */
4206 +
4207 +
4208 + /**
4209 + * Start advanced divider widget script
4210 + */
4211 +
4212 + ; (function ($, elementor) {
4213 +
4214 + 'use strict';
4215 +
4216 + var widgetAdvancedDivider = function ($scope, $) {
4217 +
4218 + var $avdDivider = $scope.find('.bdt-ep-advanced-divider'),
4219 + $settings = $avdDivider.data('settings');
4220 +
4221 +
4222 + if (!$avdDivider.length) {
4223 + return;
4224 + }
4225 +
4226 + if ($settings.animation === true) {
4227 + epObserveTarget($scope[0], function () {
4228 + var $divider = $scope.find('.bdt-ep-advanced-divider').find('img');
4229 + bdtUIkit.svg($divider, {
4230 + strokeAnimation: true,
4231 + });
4232 + }, { loop: $settings.loop || false });
4233 + } else {
4234 + var $divider = $($avdDivider).find('img');
4235 + bdtUIkit.svg($divider);
4236 + }
4237 +
4238 + };
4239 +
4240 +
4241 + jQuery(window).on('elementor/frontend/init', function () {
4242 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-divider.default', widgetAdvancedDivider);
4243 + });
4244 +
4245 + }(jQuery, window.elementorFrontend));
4246 +
4247 + /**
4248 + * End advanced divider widget script
4249 + */
4250 +
4251 +
4252 + ;(function ($, elementor) {
4253 + 'use strict';
4254 +
4255 + var widgetAvdGoogleMap = function ($scope, $) {
4256 + var $advancedGoogleMap = $scope.find('.bdt-advanced-gmap'),
4257 + $GmapWrapper = $scope.find('.bdt-advanced-map'),
4258 + map_settings = $advancedGoogleMap.data('map_settings'),
4259 + markers = $advancedGoogleMap.data('map_markers'),
4260 + map_lists = $scope.find('ul.bdt-gmap-lists div.bdt-gmap-list-item'),
4261 + map_search_form = $scope.find('.bdt-search'),
4262 + map_search_text_box = $scope.find('.bdt-search-input'),
4263 + map_form = $scope.find('.bdt-gmap-search-wrapper > form');
4264 +
4265 + if (!$advancedGoogleMap.length) {
4266 + return;
4267 + }
4268 +
4269 + if (elementorFrontend.isEditMode()) {
4270 + initMap($GmapWrapper, map_settings, markers, map_lists, map_search_form, map_search_text_box, map_form, $advancedGoogleMap);
4271 + } else {
4272 + window.addEventListener('load', function() {
4273 + initMap($GmapWrapper, map_settings, markers, map_lists, map_search_form, map_search_text_box, map_form, $advancedGoogleMap);
4274 + });
4275 + }
4276 + };
4277 +
4278 + function createMarkerContent(marker, markerImage) {
4279 + var listMarker = markerImage !== '' ? `<div class="bdt-map-tooltip-top-image"><img class="bdt-map-image" src="${markerImage}" alt="" /></div>` : "";
4280 + var markupWebsite = marker.website !== undefined ? `<a href="${marker.website}">${marker.website}</a>` : '';
4281 + var markupPhone = marker.phone !== undefined ? `<a href="tel:${marker.phone}">${marker.phone}</a>` : '';
4282 +
4283 + // Create a safe content element that allows HTML formatting but prevents XSS
4284 + var markupContent = '';
4285 + if (marker.content !== undefined) {
4286 + var contentDiv = document.createElement('div');
4287 + contentDiv.innerHTML = marker.content;
4288 + // Remove any script tags and event handlers for security
4289 + var scripts = contentDiv.querySelectorAll('script');
4290 + for (var j = 0; j < scripts.length; j++) {
4291 + scripts[j].remove();
4292 + }
4293 + // Remove any elements with event handlers
4294 + var elementsWithEvents = contentDiv.querySelectorAll('[onclick], [onload], [onerror], [onmouseover], [onmouseout]');
4295 + for (var k = 0; k < elementsWithEvents.length; k++) {
4296 + elementsWithEvents[k].removeAttribute('onclick');
4297 + elementsWithEvents[k].removeAttribute('onload');
4298 + elementsWithEvents[k].removeAttribute('onerror');
4299 + elementsWithEvents[k].removeAttribute('onmouseover');
4300 + elementsWithEvents[k].removeAttribute('onmouseout');
4301 + }
4302 + markupContent = `<span class="bdt-tooltip-content">${contentDiv.innerHTML}</span><br>`;
4303 + }
4304 +
4305 + var markupPlace = marker.place !== undefined ? `<h5 class="bdt-tooltip-place">${marker.place}</h5>` : '';
4306 + var markupTitle = marker.title !== undefined ? `<h4 class="bdt-tooltip-title">${marker.title}</h4>` : '';
4307 + return `<div class="bdt-map-tooltip-view">
4308 + <div class="bdt-map-tooltip-view-inner">
4309 + ${listMarker}
4310 + <div class="bdt-map-tooltip-bottom-footer">
4311 + ${markupTitle}
4312 + ${markupPlace}
4313 + ${markupContent}
4314 + ${markupWebsite}
4315 + ${markupPhone}
4316 + </div>
4317 + </div>
4318 + </div>`;
4319 + }
4320 +
4321 + var initMap = function ($GmapWrapper, map_settings, markers, map_lists, map_search_form, map_search_text_box, map_form, $advancedGoogleMap) {
4322 + $GmapWrapper.removeAttr("style");
4323 +
4324 + // Convert map settings from GMaps format to Google Maps API format
4325 + var mapOptions = {
4326 + center: { lat: parseFloat(map_settings.lat), lng: parseFloat(map_settings.lng) },
4327 + zoom: map_settings.zoom || 15,
4328 + mapTypeId: google.maps.MapTypeId[map_settings.mapTypeId?.toUpperCase()] || google.maps.MapTypeId.ROADMAP,
4329 + zoomControl: map_settings.zoomControl !== undefined ? map_settings.zoomControl : true,
4330 + zoomControlOptions: {
4331 + position: google.maps.ControlPosition.TOP_LEFT
4332 + },
4333 + mapTypeControl: map_settings.mapTypeControl !== undefined ? map_settings.mapTypeControl : true,
4334 + streetViewControl: map_settings.streetViewControl !== undefined ? map_settings.streetViewControl : true,
4335 + scrollwheel: map_settings.scrollwheel !== undefined ? map_settings.scrollwheel : true,
4336 + fullscreenControl: true
4337 + };
4338 +
4339 + // Create the map instance
4340 + var mapEl = $advancedGoogleMap[0];
4341 + var googleMap = new google.maps.Map(mapEl, mapOptions);
4342 +
4343 + // Add markers to the map
4344 + var allMarkers = [];
4345 + var infoWindow = new google.maps.InfoWindow();
4346 +
4347 + for (var i in markers) {
4348 + var markerImage = markers[i].image !== undefined ? markers[i].image : "";
4349 + var markerPosition = {
4350 + lat: parseFloat(markers[i].lat),
4351 + lng: parseFloat(markers[i].lng)
4352 + };
4353 +
4354 + var markerOptions = {
4355 + position: markerPosition,
4356 + map: googleMap,
4357 + title: markers[i].title
4358 + };
4359 +
4360 + if (markers[i].icon) {
4361 + markerOptions.icon = markers[i].icon;
4362 + }
4363 +
4364 + var marker = new google.maps.Marker(markerOptions);
4365 +
4366 + // Add info window to marker
4367 + (function(marker, markerData, markerImage) {
4368 + var content = createMarkerContent(markerData, markerImage);
4369 +
4370 + google.maps.event.addListener(marker, 'click', function() {
4371 + infoWindow.setContent(content);
4372 + infoWindow.open(googleMap, marker);
4373 + });
4374 + })(marker, markers[i], markerImage);
4375 +
4376 + allMarkers.push(marker);
4377 + }
4378 +
4379 + // Handle map styles if defined
4380 + if ($advancedGoogleMap.data('map_style')) {
4381 + try {
4382 + var styles = $advancedGoogleMap.data('map_style');
4383 +
4384 + // Check if the styles is already an object (jQuery's data method automatically parses JSON)
4385 + if (typeof styles === 'string') {
4386 + styles = JSON.parse(styles);
4387 + }
4388 +
4389 + googleMap.setOptions({ styles: styles });
4390 + } catch (e) {
4391 + console.error("Error parsing map styles:", e);
4392 + }
4393 + }
4394 +
4395 + // Geocoding search
4396 + if ($advancedGoogleMap.data('map_geocode')) {
4397 + $(map_form).on('submit', function (e) {
4398 + e.preventDefault();
4399 + var geocoder = new google.maps.Geocoder();
4400 + var address = $(this).find('.bdt-search-input').val().trim();
4401 +
4402 + geocoder.geocode({ 'address': address }, function (results, status) {
4403 + if (status === 'OK') {
4404 + var location = results[0].geometry.location;
4405 + googleMap.setCenter(location);
4406 +
4407 + new google.maps.Marker({
4408 + map: googleMap,
4409 + position: location
4410 + });
4411 + }
4412 + });
4413 + });
4414 + }
4415 +
4416 + // Map list items click handler
4417 + $(map_lists).on("click", function (e) {
4418 + var dataSettings = $(this).data("settings");
4419 + if (!dataSettings) return;
4420 +
4421 + // Center map on the selected location
4422 + var position = {
4423 + lat: parseFloat(dataSettings.lat),
4424 + lng: parseFloat(dataSettings.lng)
4425 + };
4426 +
4427 + googleMap.setCenter(position);
4428 + googleMap.setZoom(map_settings.zoom);
4429 +
4430 + // Create a marker for the selected location
4431 + var markerImage = dataSettings.image !== undefined ? dataSettings.image[0] : "";
4432 + var listMarker = new google.maps.Marker({
4433 + position: position,
4434 + map: googleMap,
4435 + title: dataSettings.title
4436 + });
4437 +
4438 + if (dataSettings.icon) {
4439 + listMarker.setIcon(dataSettings.icon);
4440 + }
4441 +
4442 + // Open info window for the marker
4443 + var content = createMarkerContent(dataSettings, markerImage);
4444 + infoWindow.setContent(content);
4445 + infoWindow.open(googleMap, listMarker);
4446 +
4447 + // Apply map styles to the new view if available
4448 + if ($advancedGoogleMap.data('map_style')) {
4449 + try {
4450 + var styles = $advancedGoogleMap.data('map_style');
4451 +
4452 + // Check if the styles is already an object (jQuery's data method automatically parses JSON)
4453 + if (typeof styles === 'string') {
4454 + styles = JSON.parse(styles);
4455 + }
4456 +
4457 + googleMap.setOptions({ styles: styles });
4458 + } catch (e) {
4459 + console.error("Error parsing map styles:", e);
4460 + }
4461 + }
4462 + });
4463 +
4464 + // Search functionality for lists
4465 + $(map_search_form).on('submit', function (e) {
4466 + e.preventDefault();
4467 + let searchValue = $(map_search_text_box).val().toLowerCase();
4468 + filterMapLists(map_lists, searchValue);
4469 + });
4470 +
4471 + $(map_search_text_box).on('keyup', function () {
4472 + let searchValue = $(this).val().toLowerCase();
4473 + filterMapLists(map_lists, searchValue);
4474 + });
4475 +
4476 + function filterMapLists(listItems, searchValue) {
4477 + $(listItems).filter(function () {
4478 + $(this).toggle($(this).text().toLowerCase().indexOf(searchValue) > -1);
4479 + });
4480 + }
4481 + };
4482 +
4483 + jQuery(window).on('elementor/frontend/init', function () {
4484 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-gmap.default', widgetAvdGoogleMap);
4485 + });
4486 + }(jQuery, window.elementorFrontend));
4487 +
4488 + /**
4489 + * Start advanced heading widget script
4490 + */
4491 +
4492 + ;
4493 + (function ($, elementor) {
4494 + 'use strict';
4495 + var widgetAdavancedHeading = function ($scope, $) {
4496 + var $advHeading = $scope.find('.bdt-ep-advanced-heading'),
4497 + $advMainHeadeingInner = $advHeading.find('.bdt-ep-advanced-heading-main-title-inner');
4498 +
4499 + if (!$advHeading.length) {
4500 + return;
4501 + }
4502 + var $settings = $advHeading.data('settings');
4503 + if (typeof $settings.titleMultiColor !== "undefined") {
4504 + if ($settings.titleMultiColor != 'yes') {
4505 + return;
4506 + }
4507 + var word = $($advMainHeadeingInner).text();
4508 + var words = word.split(" ");
4509 +
4510 + $($advMainHeadeingInner).html('');
4511 + var i;
4512 + for (i = 0; i < words.length; ++i) {
4513 + // $('#result').append('<span>'+words[i] +' </span>');
4514 + $($advMainHeadeingInner).append('<span>' + words[i] + '&nbsp;</span>');
4515 + }
4516 +
4517 + $($advMainHeadeingInner).find('span').each(function () {
4518 + var randomColor = Math.floor(Math.random() * 16777215).toString(16);
4519 + $(this).css({
4520 + 'color': '#' + randomColor
4521 + });
4522 + });
4523 + }
4524 +
4525 + };
4526 + jQuery(window).on('elementor/frontend/init', function () {
4527 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-heading.default', widgetAdavancedHeading);
4528 + });
4529 + }(jQuery, window.elementorFrontend));
4530 +
4531 + /**
4532 + * End advanced heading widget script
4533 + */
4534 +
4535 + /**
4536 + * Start advanced icon box widget script
4537 + */
4538 +
4539 + (function ($, elementor) {
4540 +
4541 + 'use strict';
4542 + var widgetAdvancedIconBox = function ($scope, $) {
4543 +
4544 + var $avdDivider = $scope.find('.bdt-ep-advanced-icon-box'),
4545 + divider = $($avdDivider).find('.bdt-ep-advanced-icon-box-separator-wrap > img');
4546 +
4547 + if (!$avdDivider.length && !divider.length) {
4548 + return;
4549 + }
4550 +
4551 + epObserveTarget($scope[0], function () {
4552 + bdtUIkit.svg(divider, {
4553 + strokeAnimation: true
4554 + });
4555 + });
4556 +
4557 + };
4558 +
4559 +
4560 + jQuery(window).on('elementor/frontend/init', function () {
4561 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-icon-box.default', widgetAdvancedIconBox);
4562 + });
4563 +
4564 + }(jQuery, window.elementorFrontend));
4565 +
4566 + /**
4567 + * End advanced icon box widget script
4568 + */
4569 +
4570 +
4571 + /**
4572 + * Start bdt advanced image gallery widget script
4573 + */
4574 +
4575 + (function ($, elementor) {
4576 +
4577 + 'use strict';
4578 +
4579 + var widgetAdvancedImageGallery = function ($scope, $) {
4580 +
4581 + var $advancedImageGallery = $scope.find('.bdt-ep-advanced-image-gallery'),
4582 + $settings = $advancedImageGallery.data('settings');
4583 +
4584 + if (!$advancedImageGallery.length) {
4585 + return;
4586 + }
4587 +
4588 + if ($settings.tiltShow == true) {
4589 + var elements = document.querySelectorAll($settings.id + " [data-tilt]");
4590 + VanillaTilt.init(elements);
4591 + }
4592 +
4593 + };
4594 +
4595 + jQuery(window).on('elementor/frontend/init', function () {
4596 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-image-gallery.default', widgetAdvancedImageGallery);
4597 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-image-gallery.bdt-carousel', widgetAdvancedImageGallery);
4598 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-acf-gallery.default', widgetAdvancedImageGallery);
4599 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-acf-gallery.bdt-carousel', widgetAdvancedImageGallery);
4600 + });
4601 +
4602 + }(jQuery, window.elementorFrontend));
4603 +
4604 + /**
4605 + * End bdt advanced image gallery widget script
4606 + */
4607 + (function ($, elementor) {
4608 + "use strict";
4609 +
4610 + var widgetAdvancedProgressBar = function ($scope, $) {
4611 + var $advancedProgressBars = $scope.find(
4612 + ".bdt-ep-advanced-progress-bar-item"
4613 + );
4614 + if (!$advancedProgressBars.length) {
4615 + return;
4616 + }
4617 +
4618 + $advancedProgressBars.each(function (index) {
4619 + var $this = $(this);
4620 +
4621 + epObserveTarget($this[0], function () {
4622 + var bar = $this.find(".bdt-ep-advanced-progress-bar-fill");
4623 +
4624 + bar.each(function () {
4625 + var $barFill = $(this),
4626 + thisMaxVal = $barFill.attr("data-max-value"),
4627 + thisFillVal = $barFill.attr("data-width").slice(0, -1),
4628 + formula = (thisFillVal * 100) / thisMaxVal,
4629 + animationDelay = $barFill.attr("data-animation-delay");
4630 +
4631 + $barFill.css({
4632 + width: formula + "%",
4633 + });
4634 +
4635 +
4636 + $barFill.css("transitionDelay", index * animationDelay + "s");
4637 + $barFill.children(".bdt-ep-advanced-progress-bar-parcentage").css({
4638 + "-webkit-transform": "scale(1)",
4639 + "-moz-transform": "scale(1)",
4640 + "-ms-transform": "scale(1)",
4641 + "-o-transform": "scale(1)",
4642 + transform: "scale(1)",
4643 + });
4644 + });
4645 + });
4646 + });
4647 + };
4648 +
4649 + jQuery(window).on("elementor/frontend/init", function () {
4650 + elementorFrontend.hooks.addAction(
4651 + "frontend/element_ready/bdt-advanced-progress-bar.default",
4652 + widgetAdvancedProgressBar
4653 + );
4654 + });
4655 + })(jQuery, window.elementorFrontend);
4656 +
4657 + /**
4658 + * Start animated heading widget script
4659 + */
4660 +
4661 + ;
4662 + (function ($, elementor) {
4663 +
4664 + 'use strict';
4665 +
4666 + var widgetAnimatedHeading = function ($scope, $) {
4667 +
4668 + var $heading = $scope.find('.bdt-heading > *'),
4669 + $_heading = $scope.find('.bdt-heading'),
4670 + $animatedHeading = $heading.find('.bdt-animated-heading'),
4671 + $settings = $animatedHeading.data('settings');
4672 +
4673 + if (!$heading.length) {
4674 + return;
4675 + }
4676 +
4677 + function kill() {
4678 + var splitTextTimeline = gsap.timeline(),
4679 + mySplitText = new SplitText($quote, {
4680 + type: "chars, words, lines"
4681 + });
4682 + splitTextTimeline.clear().time(0);
4683 + mySplitText.revert();
4684 + }
4685 +
4686 + if ($settings.layout === 'animated') {
4687 + $_heading.css('display', 'block'); // Fix full list on first loading
4688 + $($animatedHeading).Morphext($settings);
4689 + } else if ($settings.layout === 'typed') {
4690 + var animateSelector = $($animatedHeading).attr('id');
4691 + var typed = new Typed('#' + animateSelector, $settings);
4692 + } else if ($settings.layout === 'split_text') {
4693 +
4694 + var $quote = $($heading);
4695 +
4696 + var splitTextTimeline = gsap.timeline(),
4697 + mySplitText = new SplitText($quote, {
4698 + type: "chars, words, lines"
4699 + });
4700 +
4701 +
4702 + gsap.set($quote, {
4703 + perspective: $settings.anim_perspective //400
4704 + });
4705 +
4706 + kill();
4707 +
4708 + mySplitText.split({
4709 + type: 'chars, words, lines'
4710 + });
4711 + var stringType = '';
4712 + if ('lines' == $settings.animation_on) {
4713 + stringType = mySplitText.lines;
4714 + } else if ('chars' == $settings.animation_on) {
4715 + stringType = mySplitText.chars;
4716 + } else {
4717 + stringType = mySplitText.words;
4718 + }
4719 + var animationConfig = {
4720 + opacity: 0, //0
4721 + scale: $settings.anim_scale, //0
4722 + y: $settings.anim_rotation_y, //80
4723 + rotationX: $settings.anim_rotation_x, //180
4724 + transformOrigin: $settings.anim_transform_origin, //0% 50% -50
4725 + };
4726 +
4727 + if ($settings.anim_repeat) {
4728 + animationConfig.repeat = -1; // Infinite repeat
4729 + if ($settings.anim_yoyo) {
4730 + animationConfig.yoyo = true; // Makes animation reverse on repeat
4731 + }
4732 + }
4733 +
4734 + splitTextTimeline.staggerFrom(stringType, 0.5, animationConfig, $settings.anim_duration);
4735 +
4736 + }
4737 +
4738 + $($heading).animate({
4739 + easing: 'slow',
4740 + opacity: 1,
4741 + }, 500);
4742 +
4743 +
4744 + };
4745 +
4746 +
4747 + jQuery(window).on('elementor/frontend/init', function () {
4748 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-animated-heading.default', widgetAnimatedHeading);
4749 + });
4750 +
4751 + }(jQuery, window.elementorFrontend));
4752 +
4753 + /**
4754 + * End animated heading widget script
4755 + */
4756 + /**
4757 + * Start audio player widget script
4758 + */
4759 +
4760 + ( function( $, elementor ) {
4761 +
4762 + 'use strict';
4763 +
4764 + //Audio Player
4765 + var widgetAudioPlayer = function( $scope, $ ) {
4766 +
4767 + var $audioPlayer = $scope.find( '.bdt-audio-player .jp-jplayer' ),
4768 + $container = $audioPlayer.next('.jp-audio').attr('id'),
4769 + $settings = $audioPlayer.data('settings');
4770 +
4771 +
4772 + if ( ! $audioPlayer.length ) {
4773 + return;
4774 + }
4775 +
4776 + $($audioPlayer).jPlayer({
4777 + ready: function (event) {
4778 + $(this).jPlayer('setMedia', {
4779 + title : $settings.audio_title,
4780 + mp3 : $settings.audio_source
4781 + });
4782 + if($settings.autoplay) {
4783 + $(this).jPlayer('play', 1);
4784 + }
4785 + },
4786 + play: function() {
4787 + $(this).next('.jp-audio').removeClass('bdt-player-played');
4788 + $(this).jPlayer('pauseOthers');
4789 + },
4790 + ended: function() {
4791 + $(this).next('.jp-audio').addClass('bdt-player-played');
4792 + },
4793 + timeupdate: function(event) {
4794 + if($settings.time_restrict) {
4795 + if ( event.jPlayer.status.currentTime > $settings.restrict_duration ) {
4796 + $(this).jPlayer('stop');
4797 + }
4798 + }
4799 + },
4800 +
4801 + cssSelectorAncestor : '#' + $container,
4802 + useStateClassSkin : true,
4803 + autoBlur : $settings.smooth_show,
4804 + smoothPlayBar : true,
4805 + keyEnabled : $settings.keyboard_enable,
4806 + remainingDuration : true,
4807 + toggleDuration : true,
4808 + volume : $settings.volume_level,
4809 + loop : $settings.loop
4810 +
4811 + });
4812 +
4813 + };
4814 +
4815 +
4816 + jQuery(window).on('elementor/frontend/init', function() {
4817 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-audio-player.default', widgetAudioPlayer );
4818 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-audio-player.bdt-poster', widgetAudioPlayer );
4819 + });
4820 +
4821 + }( jQuery, window.elementorFrontend ) );
4822 +
4823 + /**
4824 + * Start audio player widget script
4825 + */
4826 +
4827 +
4828 + ; (function ($, elementor) {
4829 + 'use strict';
4830 +
4831 + $(window).on('elementor/frontend/init', function () {
4832 + var ModuleHandler = elementorModules.frontend.handlers.Base,
4833 + BackgroundParallax;
4834 +
4835 + BackgroundParallax = ModuleHandler.extend({
4836 +
4837 + bindEvents: function () {
4838 + this.run();
4839 + },
4840 +
4841 + getDefaultSettings: function () {
4842 + return {
4843 + media: false,
4844 + easing: 1,
4845 + viewport: 1,
4846 + };
4847 + },
4848 +
4849 + onElementChange: debounce(function (prop) {
4850 + if ((prop.indexOf('section_parallax_') !== -1) || (prop.indexOf('ep_parallax_') !== -1)) {
4851 + this.run();
4852 + }
4853 + }, 400),
4854 +
4855 + settings: function (key) {
4856 + return this.getElementSettings(key);
4857 + },
4858 +
4859 + run: function () {
4860 + var options = this.getDefaultSettings(),
4861 + ID = this.$element.data('id');
4862 +
4863 + if ('yes' !== this.settings('section_parallax_on')) {
4864 + return;
4865 + }
4866 +
4867 + let element = jQuery('.elementor-element-' + ID).get(0);
4868 +
4869 + if (this.settings('section_parallax_x_value.size')) {
4870 + options.bgx = this.settings('section_parallax_x_value.size') || 0;
4871 + }
4872 + if (this.settings('section_parallax_value.size')) {
4873 + options.bgy = this.settings('section_parallax_value.size') || 0;
4874 + }
4875 +
4876 + if (this.settings('ep_parallax_bg_colors')) {
4877 + if (this.settings('ep_parallax_bg_border_color_start') || this.settings('ep_parallax_bg_border_color_end')) {
4878 + options.borderColor = [this.settings('ep_parallax_bg_border_color_start') || 0, this.settings('ep_parallax_bg_border_color_end') || 0];
4879 + }
4880 + }
4881 + if (this.settings('ep_parallax_bg_colors')) {
4882 + if (this.settings('ep_parallax_bg_color_start') || this.settings('ep_parallax_bg_color_end')) {
4883 + options.backgroundColor = [this.settings('ep_parallax_bg_color_start') || 0, this.settings('ep_parallax_bg_color_end') || 0];
4884 + }
4885 + }
4886 +
4887 + if (
4888 + this.settings('section_parallax_x_value') ||
4889 + this.settings('section_parallax_value') ||
4890 + this.settings('ep_parallax_bg_colors')
4891 + ) {
4892 + this.bgParallax = bdtUIkit.parallax(element, options);
4893 + }
4894 +
4895 + }
4896 + });
4897 +
4898 +
4899 + elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) {
4900 + elementorFrontend.elementsHandler.addHandler(BackgroundParallax, {
4901 + $element: $scope
4902 + });
4903 + });
4904 +
4905 + elementorFrontend.hooks.addAction('frontend/element_ready/container', function ($scope) {
4906 + elementorFrontend.elementsHandler.addHandler(BackgroundParallax, {
4907 + $element: $scope
4908 + });
4909 + });
4910 +
4911 + });
4912 + })(jQuery, window.elementorFrontend);
4913 +
4914 + ;(function($, elementor){
4915 + 'use strict';
4916 +
4917 + $(window).on('elementor/frontend/init', function () {
4918 +
4919 + var ModuleHandler = elementorModules.frontend.handlers.Base, BarCode;
4920 +
4921 +
4922 + BarCode = ModuleHandler.extend({
4923 + bindEvents: function () {
4924 + this.run();
4925 + },
4926 +
4927 + getDefaultSettings: function () {
4928 + return {
4929 + format: 'code128'
4930 + };
4931 + },
4932 +
4933 + onElementChange: debounce(function (prop) {
4934 + if (prop.indexOf('ep_barcode') !== -1) {
4935 + this.run();
4936 + }
4937 + }, 400),
4938 +
4939 + settings: function (key) {
4940 + return this.getElementSettings('ep_barcode_' + key);
4941 + },
4942 +
4943 + run: function () {
4944 +
4945 + var options = this.getDefaultSettings();
4946 + var $container = this.$element.find(".bdt-ep-barcode");
4947 + if (!$container.length) {
4948 + return;
4949 + }
4950 +
4951 + var content = this.settings('content');
4952 + options.displayValue = (this.settings('show_label') === 'yes');
4953 + options.format = this.settings('format');
4954 + options.text = (this.settings('label_text')) ? this.settings('label_text') : '';
4955 + options.width = (this.settings('width.size')) ? this.settings('width.size') : 2;
4956 + options.height = (this.settings('height.size')) ? this.settings('height.size') : 40;
4957 + options.fontOptions = (this.settings('font_width')) ? this.settings('font_width') : 'normal';
4958 + options.textAlign = (this.settings('label_alignment')) ? this.settings('label_alignment') : 'center';
4959 + options.textPosition = (this.settings('label_position')) ? this.settings('label_position') : 'bottom';
4960 + options.textMargin = (this.settings('label_spacing.size')) ? this.settings('label_spacing.size') : 2;
4961 + options.margin = 0;
4962 +
4963 + JsBarcode('#bdt-ep-barcode-' + this.$element.data('id'), content, options);
4964 +
4965 + }
4966 + });
4967 +
4968 +
4969 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-barcode.default',
4970 + function ($scope) {
4971 + elementorFrontend.elementsHandler.addHandler(BarCode, {
4972 + $element: $scope
4973 + });
4974 + }
4975 + );
4976 + });
4977 +
4978 + })(jQuery, window.elementorFrontend);
4979 +
4980 + (function ($, elementor) {
4981 + "use strict";
4982 +
4983 + $(window).on("elementor/frontend/init", function () {
4984 + var ModuleHandler = elementorModules.frontend.handlers.Base,
4985 + SvgBlob;
4986 +
4987 + SvgBlob = ModuleHandler.extend({
4988 + bindEvents: function () {
4989 + this.run();
4990 + },
4991 +
4992 + getDefaultSettings: function () {
4993 + return {};
4994 + },
4995 +
4996 + settings: function (key) {
4997 + return this.getElementSettings("svg_blob_" + key);
4998 + },
4999 +
5000 + run: function () {
5001 + var options = this.getDefaultSettings();
5002 + var element = element = this.$element.get(0);;
5003 + if (jQuery(this.$element).hasClass("elementor-section")) {
5004 + element = this.$element.get(0);
5005 + }
5006 + var $container = this.$element.find(".bdt-svg-blob");
5007 + if (!$container.length) {
5008 + return;
5009 + }
5010 + const path = $container.data("settings");
5011 + const firstSVG = $container.find("path")[0];
5012 + options = {
5013 + targets: firstSVG,
5014 + d: [{ value: path || [] }],
5015 + easing: 'easeOutQuad',
5016 + direction: 'alternate',
5017 + loop: this.settings('loop') === 'yes',
5018 + duration:
5019 + this.settings('duration.size') !== ''
5020 + ? this.settings('duration.size')
5021 + : 2000,
5022 + delay:
5023 + this.settings('delay.size') !== ''
5024 + ? this.settings('delay.size')
5025 + : 10,
5026 + endDelay:
5027 + this.settings('end_delay.size') !== ''
5028 + ? this.settings('end_delay.size')
5029 + : 10,
5030 + };
5031 + anime(options);
5032 + },
5033 + });
5034 +
5035 + elementorFrontend.hooks.addAction(
5036 + "frontend/element_ready/bdt-svg-blob.default",
5037 + function ($scope) {
5038 + elementorFrontend.elementsHandler.addHandler(SvgBlob, {
5039 + $element: $scope,
5040 + });
5041 + }
5042 + );
5043 + });
5044 + })(jQuery, window.elementorFrontend);
5045 +
5046 + (function ($, elementor) {
5047 + $(window).on("elementor/frontend/init", function () {
5048 + let ModuleHandler = elementorModules.frontend.handlers.Base,
5049 + ListMarquee;
5050 +
5051 + ListMarquee = ModuleHandler.extend({
5052 + bindEvents: function () {
5053 + this.run();
5054 + },
5055 + getDefaultSettings: function () {
5056 + return {
5057 + allowHTML: true,
5058 + };
5059 + },
5060 +
5061 + onElementChange: debounce(function (prop) {
5062 + if (prop.indexOf("marquee_") !== -1) {
5063 + this.run();
5064 + }
5065 + }, 400),
5066 +
5067 + settings: function (key) {
5068 + return this.getElementSettings("marquee_" + key);
5069 + },
5070 +
5071 + run: function () {
5072 + let isElementorEditor = elementorFrontend.isEditMode();
5073 + if (isElementorEditor) {
5074 + return;
5075 + }
5076 + const widgetID = this.$element.data("id");
5077 + var self = this;
5078 + var options = this.getDefaultSettings();
5079 + var $container = this.$element.find(".bdt-marquee");
5080 +
5081 + if (!$container) {
5082 + return;
5083 + }
5084 +
5085 + // Add overflow hidden to parent element conditionally based on rotation
5086 + let rotationValue = this.getElementSettings("marquee_rotate");
5087 + if (rotationValue && rotationValue.size !== 0 && rotationValue.size !== '') {
5088 + this.$element.parent().css("overflow", "hidden");
5089 + this.$element.css("margin-left", "-100px");
5090 + } else {
5091 + this.$element.css("overflow", "hidden");
5092 + }
5093 +
5094 + let advancedOptions =
5095 + self.settings("advanced") === "yes" ? true : false;
5096 +
5097 + if (advancedOptions) {
5098 + $("body").css("overflow-x", "hidden");
5099 + }
5100 +
5101 + var widgetContainer = ".elementor-element-" + widgetID;
5102 + const direction = self.settings("direction") || "left";
5103 + const isVertical = direction === "top" || direction === "bottom";
5104 +
5105 + let boxes = gsap.utils.toArray(widgetContainer + " .marquee-content");
5106 +
5107 + // Function to check if boxes width/height is less than container, if so clone boxes to fill it
5108 + const ensureFull = (boxes, isVertical) => {
5109 + if (isVertical) {
5110 + // For vertical direction, ensure full height
5111 + let totalBoxHeight = boxes.reduce(
5112 + (total, box) => total + box.offsetHeight,
5113 + 0
5114 + );
5115 + if (totalBoxHeight == 0) {
5116 + return boxes;
5117 + }
5118 + let containerHeight = $container[0].offsetHeight || 500; // Use container height or default
5119 + // Clone boxes if the total height is less than the container height
5120 + while (totalBoxHeight < containerHeight * 2) { // Multiply by 2 to ensure smooth loop
5121 + boxes.forEach((box) => {
5122 + const clone = box.cloneNode(true);
5123 + box.parentNode.appendChild(clone);
5124 + });
5125 + boxes = gsap.utils.toArray(widgetContainer + " .marquee-content");
5126 + totalBoxHeight = boxes.reduce(
5127 + (total, box) => total + box.offsetHeight,
5128 + 0
5129 + );
5130 + }
5131 + } else {
5132 + // For horizontal direction, ensure full width
5133 + let totalBoxWidth = boxes.reduce(
5134 + (total, box) => total + box.offsetWidth,
5135 + 0
5136 + );
5137 + if (totalBoxWidth == 0) {
5138 + return boxes;
5139 + }
5140 + let screenWidth = window.innerWidth;
5141 + // Clone boxes if the total width is less than the container width
5142 + while (totalBoxWidth < screenWidth) {
5143 + boxes.forEach((box) => {
5144 + const clone = box.cloneNode(true);
5145 + box.parentNode.appendChild(clone);
5146 + });
5147 + boxes = gsap.utils.toArray(widgetContainer + " .marquee-content");
5148 + totalBoxWidth = boxes.reduce(
5149 + (total, box) => total + box.offsetWidth,
5150 + 0
5151 + );
5152 + }
5153 + }
5154 + return boxes;
5155 + };
5156 +
5157 + // Ensure that boxes fill the container
5158 + boxes = ensureFull(boxes, isVertical);
5159 +
5160 + const isRTL = document.documentElement.dir === "rtl";
5161 + const reversedDirection = isVertical
5162 + ? direction === "top"
5163 + : (direction === "right") !== isRTL;
5164 +
5165 + let marqueeSpeed = self.settings("speed")
5166 + ? self.settings("speed") / 100
5167 + : 1,
5168 + isClickable = self.settings("clickable") === "yes" ? true : false,
5169 + isPauseOnHover =
5170 + self.settings("pause_on_hover") === "yes" ? true : false,
5171 + isDraggable = self.settings("draggable") === "yes" ? true : false,
5172 + spacing = self.settings("spacing") ? self.settings("spacing") : 0,
5173 + isLoop = self.settings("loop") === "yes" ? true : false;
5174 +
5175 + let activeElement;
5176 + const loop = isVertical
5177 + ? self.verticalLoop(boxes, {
5178 + paused: false,
5179 + draggable: isDraggable,
5180 + repeat: -1,
5181 + speed: marqueeSpeed,
5182 + paddingBottom: spacing,
5183 + reversed: reversedDirection,
5184 + center: true,
5185 + reversedDirection: reversedDirection,
5186 + onChange: (element, index) => {
5187 + activeElement && activeElement.classList.remove("active");
5188 + element.classList.add("active");
5189 + activeElement = element;
5190 + },
5191 + })
5192 + : self.horizontalLoop(boxes, {
5193 + paused: false,
5194 + draggable: isDraggable,
5195 + repeat: -1,
5196 + speed: marqueeSpeed,
5197 + paddingRight: spacing,
5198 + reversed: reversedDirection,
5199 + center: true,
5200 + reversedDirection: reversedDirection,
5201 + onChange: (element, index) => {
5202 + activeElement && activeElement.classList.remove("active");
5203 + element.classList.add("active");
5204 + activeElement = element;
5205 + },
5206 + });
5207 +
5208 + if (isPauseOnHover) {
5209 + self.pauseOnHover(loop, boxes);
5210 + }
5211 +
5212 + if (isClickable) {
5213 + $(boxes).on("mouseleave", () => {
5214 + if (loop.reversed()) {
5215 + loop.play();
5216 + loop.reverse();
5217 + } else {
5218 + loop.play();
5219 + loop.reversed();
5220 + }
5221 + });
5222 + // loop.pause();
5223 + boxes.forEach((box, i) => {
5224 + box.addEventListener("click", () => {
5225 + loop.toIndex(i, {
5226 + duration: 0.8,
5227 + ease: "power1.inOut",
5228 + });
5229 + });
5230 + });
5231 + }
5232 + },
5233 +
5234 + pauseOnHover: function (tween, boxes) {
5235 + $(boxes).on("mouseenter", () => {
5236 + tween.pause();
5237 + });
5238 +
5239 + $(boxes).on("mouseleave", () => {
5240 + if (tween.reversed()) {
5241 + tween.play();
5242 + tween.reverse();
5243 + } else {
5244 + tween.play();
5245 + tween.reversed();
5246 + }
5247 + });
5248 + },
5249 + horizontalLoop: function (items, config, reverseDirection = false) {
5250 + var self = this;
5251 + items = gsap.utils.toArray(items);
5252 + config = config || {};
5253 + let onChange = config.onChange,
5254 + lastIndex = 0,
5255 + tl = gsap.timeline({
5256 + repeat: config.repeat,
5257 + paused: config.paused,
5258 + defaults: { ease: "none" },
5259 + onReverseComplete: () =>
5260 + tl.totalTime(tl.rawTime() + tl.duration() * 100),
5261 + }),
5262 + length = items.length,
5263 + startX = items[0].offsetLeft,
5264 + times = [],
5265 + widths = [],
5266 + spaceBefore = [],
5267 + xPercents = [],
5268 + curIndex = 0,
5269 + center = config.center,
5270 + pixelsPerSecond = (config.speed || 1) * 100,
5271 + snap =
5272 + config.snap === false
5273 + ? (v) => v
5274 + : gsap.utils.snap(config.snap || 1), // some browsers shift by a pixel to accommodate flex layouts, so for example if width is 20% the first element's width might be 242px, and the next 243px, alternating back and forth. So we snap to 5 percentage points to make things look more natural
5275 + timeOffset = 0,
5276 + container =
5277 + center === true
5278 + ? items[0].parentNode
5279 + : gsap.utils.toArray(center)[0] || items[0].parentNode,
5280 + totalWidth,
5281 + getTotalWidth = () =>
5282 + items[length - 1].offsetLeft +
5283 + (xPercents[length - 1] / 100) * widths[length - 1] -
5284 + startX +
5285 + spaceBefore[0] +
5286 + items[length - 1].offsetWidth *
5287 + gsap.getProperty(items[length - 1], "scaleX") +
5288 + (parseFloat(config.paddingRight) || 0),
5289 + populateWidths = () => {
5290 + let b1 = container.getBoundingClientRect(),
5291 + b2;
5292 + items.forEach((el, i) => {
5293 + widths[i] = parseFloat(gsap.getProperty(el, "width", "px"));
5294 + xPercents[i] = snap(
5295 + (parseFloat(gsap.getProperty(el, "x", "px")) / widths[i]) *
5296 + 100 +
5297 + gsap.getProperty(el, "xPercent")
5298 + );
5299 + b2 = el.getBoundingClientRect();
5300 + spaceBefore[i] = b2.left - (i ? b1.right : b1.left);
5301 + b1 = b2;
5302 + });
5303 + gsap.set(items, {
5304 + // convert "x" to "xPercent" to make things responsive, and populate the widths/xPercents Arrays to make lookups faster.
5305 + xPercent: (i) => xPercents[i],
5306 + });
5307 + totalWidth = getTotalWidth();
5308 + },
5309 + timeWrap,
5310 + populateOffsets = () => {
5311 + timeOffset = center
5312 + ? (tl.duration() * (container.offsetWidth / 2)) / totalWidth
5313 + : 0;
5314 + center &&
5315 + times.forEach((t, i) => {
5316 + times[i] = timeWrap(
5317 + tl.labels["label" + i] +
5318 + (tl.duration() * widths[i]) / 2 / totalWidth -
5319 + timeOffset
5320 + );
5321 + });
5322 + },
5323 + getClosest = (values, value, wrap) => {
5324 + let i = values.length,
5325 + closest = 1e10,
5326 + index = 0,
5327 + d;
5328 + while (i--) {
5329 + d = Math.abs(values[i] - value);
5330 + if (d > wrap / 2) {
5331 + d = wrap - d;
5332 + }
5333 + if (d < closest) {
5334 + closest = d;
5335 + index = i;
5336 + }
5337 + }
5338 + return index;
5339 + },
5340 + populateTimeline = () => {
5341 + let i, item, curX, distanceToStart, distanceToLoop;
5342 + tl.clear();
5343 + for (i = 0; i < length; i++) {
5344 + item = items[i];
5345 + curX = (xPercents[i] / 100) * widths[i];
5346 + distanceToStart =
5347 + item.offsetLeft + curX - startX + spaceBefore[0];
5348 + distanceToLoop =
5349 + distanceToStart + widths[i] * gsap.getProperty(item, "scaleX");
5350 + tl.to(
5351 + item,
5352 + {
5353 + xPercent: snap(((curX - distanceToLoop) / widths[i]) * 100),
5354 + duration: distanceToLoop / pixelsPerSecond,
5355 + },
5356 + 0
5357 + )
5358 + .fromTo(
5359 + item,
5360 + {
5361 + xPercent: snap(
5362 + ((curX - distanceToLoop + totalWidth) / widths[i]) * 100
5363 + ),
5364 + },
5365 + {
5366 + xPercent: xPercents[i],
5367 + duration:
5368 + (curX - distanceToLoop + totalWidth - curX) /
5369 + pixelsPerSecond,
5370 + immediateRender: false,
5371 + },
5372 + distanceToLoop / pixelsPerSecond
5373 + )
5374 + .add("label" + i, distanceToStart / pixelsPerSecond);
5375 + times[i] = distanceToStart / pixelsPerSecond;
5376 + }
5377 + timeWrap = gsap.utils.wrap(0, tl.duration());
5378 + },
5379 + refresh = (deep) => {
5380 + let progress = tl.progress();
5381 + tl.progress(0, true);
5382 + populateWidths();
5383 + deep && populateTimeline();
5384 + populateOffsets();
5385 + deep && tl.draggable
5386 + ? tl.time(times[curIndex], true)
5387 + : tl.progress(progress, true);
5388 + },
5389 + proxy;
5390 + gsap.set(items, { x: 0 });
5391 + populateWidths();
5392 + populateTimeline();
5393 + populateOffsets();
5394 + window.addEventListener("resize", () => refresh(true));
5395 + function toIndex(index, vars) {
5396 + vars = vars || {};
5397 +
5398 + if (reverseDirection) {
5399 + index = length - index;
5400 + }
5401 + Math.abs(index - curIndex) > length / 2 &&
5402 + (index += index > curIndex ? -length : length); // always go in the shortest direction
5403 + let newIndex = gsap.utils.wrap(0, length, index),
5404 + time = times[newIndex];
5405 + if (time > tl.time() !== index > curIndex) {
5406 + // if we're wrapping the timeline's playhead, make the proper adjustments
5407 + time += tl.duration() * (index > curIndex ? 1 : -1);
5408 + }
5409 + if (time < 0 || time > tl.duration()) {
5410 + vars.modifiers = { time: timeWrap };
5411 + }
5412 + curIndex = newIndex;
5413 + vars.overwrite = true;
5414 + gsap.killTweensOf(proxy);
5415 + return tl.tweenTo(time, vars);
5416 + }
5417 + tl.next = (vars) => toIndex(curIndex + 1, vars);
5418 + tl.previous = (vars) => toIndex(curIndex - 1, vars);
5419 + tl.current = () => curIndex;
5420 + tl.toIndex = (index, vars) => toIndex(index, vars);
5421 + tl.closestIndex = (setCurrent) => {
5422 + let index = getClosest(times, tl.time(), tl.duration());
5423 + setCurrent && (curIndex = index);
5424 + return index;
5425 + };
5426 + tl.times = times;
5427 + tl.progress(1, true).progress(0, true); // pre-render for performance
5428 + if (config.reversed) {
5429 + tl.vars.onReverseComplete();
5430 + tl.reverse();
5431 + }
5432 +
5433 + if (config.draggable && typeof Draggable === "function") {
5434 + proxy = document.createElement("div");
5435 + let wrap = gsap.utils.wrap(0, 1),
5436 + ratio,
5437 + startProgress,
5438 + draggable,
5439 + dragSnap,
5440 + align = () =>
5441 + tl.progress(
5442 + wrap(startProgress + (draggable.startX - draggable.x) * ratio)
5443 + ),
5444 + syncIndex = () => tl.closestIndex(true);
5445 + typeof InertiaPlugin === "undefined" &&
5446 + console.warn(
5447 + "InertiaPlugin required for momentum-based scrolling and snapping. https://greensock.com/club"
5448 + );
5449 + draggable = Draggable.create(proxy, {
5450 + trigger: items[0].parentNode,
5451 + type: "x",
5452 + onPressInit() {
5453 + gsap.killTweensOf(tl);
5454 + startProgress = tl.progress();
5455 + refresh();
5456 + ratio = 1 / totalWidth;
5457 + gsap.set(proxy, { x: startProgress / -ratio });
5458 + },
5459 + onDrag: align,
5460 + onThrowUpdate: align,
5461 + inertia: true,
5462 + snap: (value) => {
5463 + let time = -(value * ratio) * tl.duration(),
5464 + wrappedTime = timeWrap(time),
5465 + snapTime = times[getClosest(times, wrappedTime, tl.duration())],
5466 + dif = snapTime - wrappedTime;
5467 + Math.abs(dif) > tl.duration() / 2 &&
5468 + (dif += dif < 0 ? tl.duration() : -tl.duration());
5469 + return (time + dif) / tl.duration() / -ratio;
5470 + },
5471 + onRelease: syncIndex,
5472 + onThrowComplete: syncIndex,
5473 + })[0];
5474 + tl.draggable = draggable;
5475 + }
5476 + tl.closestIndex(true);
5477 + onChange && onChange(items[curIndex], curIndex);
5478 + return tl;
5479 + },
5480 + verticalLoop: function (items, config, reverseDirection = false) {
5481 + var self = this;
5482 + items = gsap.utils.toArray(items);
5483 + config = config || {};
5484 + let onChange = config.onChange,
5485 + lastIndex = 0,
5486 + tl = gsap.timeline({
5487 + repeat: config.repeat,
5488 + paused: config.paused,
5489 + defaults: { ease: "none" },
5490 + onReverseComplete: () =>
5491 + tl.totalTime(tl.rawTime() + tl.duration() * 100),
5492 + }),
5493 + length = items.length,
5494 + startY = items[0].offsetTop,
5495 + times = [],
5496 + heights = [],
5497 + spaceBefore = [],
5498 + yPercents = [],
5499 + curIndex = 0,
5500 + center = config.center,
5501 + pixelsPerSecond = (config.speed || 1) * 100,
5502 + snap =
5503 + config.snap === false
5504 + ? (v) => v
5505 + : gsap.utils.snap(config.snap || 1),
5506 + timeOffset = 0,
5507 + container =
5508 + center === true
5509 + ? items[0].parentNode
5510 + : gsap.utils.toArray(center)[0] || items[0].parentNode,
5511 + totalHeight,
5512 + getTotalHeight = () =>
5513 + items[length - 1].offsetTop +
5514 + (yPercents[length - 1] / 100) * heights[length - 1] -
5515 + startY +
5516 + spaceBefore[0] +
5517 + items[length - 1].offsetHeight *
5518 + gsap.getProperty(items[length - 1], "scaleY") +
5519 + (parseFloat(config.paddingBottom) || 0),
5520 + populateHeights = () => {
5521 + let b1 = container.getBoundingClientRect(),
5522 + b2;
5523 + items.forEach((el, i) => {
5524 + heights[i] = parseFloat(gsap.getProperty(el, "height", "px"));
5525 + yPercents[i] = snap(
5526 + (parseFloat(gsap.getProperty(el, "y", "px")) / heights[i]) *
5527 + 100 +
5528 + gsap.getProperty(el, "yPercent")
5529 + );
5530 + b2 = el.getBoundingClientRect();
5531 + spaceBefore[i] = b2.top - (i ? b1.bottom : b1.top);
5532 + b1 = b2;
5533 + });
5534 + gsap.set(items, {
5535 + yPercent: (i) => yPercents[i],
5536 + });
5537 + totalHeight = getTotalHeight();
5538 + },
5539 + timeWrap,
5540 + populateOffsets = () => {
5541 + timeOffset = center
5542 + ? (tl.duration() * (container.offsetHeight / 2)) / totalHeight
5543 + : 0;
5544 + center &&
5545 + times.forEach((t, i) => {
5546 + times[i] = timeWrap(
5547 + tl.labels["label" + i] +
5548 + (tl.duration() * heights[i]) / 2 / totalHeight -
5549 + timeOffset
5550 + );
5551 + });
5552 + },
5553 + getClosest = (values, value, wrap) => {
5554 + let i = values.length,
5555 + closest = 1e10,
5556 + index = 0,
5557 + d;
5558 + while (i--) {
5559 + d = Math.abs(values[i] - value);
5560 + if (d > wrap / 2) {
5561 + d = wrap - d;
5562 + }
5563 + if (d < closest) {
5564 + closest = d;
5565 + index = i;
5566 + }
5567 + }
5568 + return index;
5569 + },
5570 + populateTimeline = () => {
5571 + let i, item, curY, distanceToStart, distanceToLoop;
5572 + tl.clear();
5573 + for (i = 0; i < length; i++) {
5574 + item = items[i];
5575 + curY = (yPercents[i] / 100) * heights[i];
5576 + distanceToStart =
5577 + item.offsetTop + curY - startY + spaceBefore[0];
5578 + distanceToLoop =
5579 + distanceToStart + heights[i] * gsap.getProperty(item, "scaleY");
5580 + tl.to(
5581 + item,
5582 + {
5583 + yPercent: snap(((curY - distanceToLoop) / heights[i]) * 100),
5584 + duration: distanceToLoop / pixelsPerSecond,
5585 + },
5586 + 0
5587 + )
5588 + .fromTo(
5589 + item,
5590 + {
5591 + yPercent: snap(
5592 + ((curY - distanceToLoop + totalHeight) / heights[i]) * 100
5593 + ),
5594 + },
5595 + {
5596 + yPercent: yPercents[i],
5597 + duration:
5598 + (curY - distanceToLoop + totalHeight - curY) /
5599 + pixelsPerSecond,
5600 + immediateRender: false,
5601 + },
5602 + distanceToLoop / pixelsPerSecond
5603 + )
5604 + .add("label" + i, distanceToStart / pixelsPerSecond);
5605 + times[i] = distanceToStart / pixelsPerSecond;
5606 + }
5607 + timeWrap = gsap.utils.wrap(0, tl.duration());
5608 + },
5609 + refresh = (deep) => {
5610 + let progress = tl.progress();
5611 + tl.progress(0, true);
5612 + populateHeights();
5613 + deep && populateTimeline();
5614 + populateOffsets();
5615 + deep && tl.draggable
5616 + ? tl.time(times[curIndex], true)
5617 + : tl.progress(progress, true);
5618 + },
5619 + proxy;
5620 + gsap.set(items, { y: 0 });
5621 + populateHeights();
5622 + populateTimeline();
5623 + populateOffsets();
5624 + window.addEventListener("resize", () => refresh(true));
5625 + function toIndex(index, vars) {
5626 + vars = vars || {};
5627 +
5628 + if (reverseDirection) {
5629 + index = length - index;
5630 + }
5631 + Math.abs(index - curIndex) > length / 2 &&
5632 + (index += index > curIndex ? -length : length);
5633 + let newIndex = gsap.utils.wrap(0, length, index),
5634 + time = times[newIndex];
5635 + if (time > tl.time() !== index > curIndex) {
5636 + time += tl.duration() * (index > curIndex ? 1 : -1);
5637 + }
5638 + if (time < 0 || time > tl.duration()) {
5639 + vars.modifiers = { time: timeWrap };
5640 + }
5641 + curIndex = newIndex;
5642 + vars.overwrite = true;
5643 + gsap.killTweensOf(proxy);
5644 + return tl.tweenTo(time, vars);
5645 + }
5646 + tl.next = (vars) => toIndex(curIndex + 1, vars);
5647 + tl.previous = (vars) => toIndex(curIndex - 1, vars);
5648 + tl.current = () => curIndex;
5649 + tl.toIndex = (index, vars) => toIndex(index, vars);
5650 + tl.closestIndex = (setCurrent) => {
5651 + let index = getClosest(times, tl.time(), tl.duration());
5652 + setCurrent && (curIndex = index);
5653 + return index;
5654 + };
5655 + tl.times = times;
5656 + tl.progress(1, true).progress(0, true);
5657 + if (config.reversed) {
5658 + tl.vars.onReverseComplete();
5659 + tl.reverse();
5660 + }
5661 +
5662 + if (config.draggable && typeof Draggable === "function") {
5663 + proxy = document.createElement("div");
5664 + let wrap = gsap.utils.wrap(0, 1),
5665 + ratio,
5666 + startProgress,
5667 + draggable,
5668 + dragSnap,
5669 + align = () =>
5670 + tl.progress(
5671 + wrap(startProgress + (draggable.startY - draggable.y) * ratio)
5672 + ),
5673 + syncIndex = () => tl.closestIndex(true);
5674 + typeof InertiaPlugin === "undefined" &&
5675 + console.warn(
5676 + "InertiaPlugin required for momentum-based scrolling and snapping. https://greensock.com/club"
5677 + );
5678 + draggable = Draggable.create(proxy, {
5679 + trigger: items[0].parentNode,
5680 + type: "y",
5681 + onPressInit() {
5682 + gsap.killTweensOf(tl);
5683 + startProgress = tl.progress();
5684 + refresh();
5685 + ratio = 1 / totalHeight;
5686 + gsap.set(proxy, { y: startProgress / -ratio });
5687 + },
5688 + onDrag: align,
5689 + onThrowUpdate: align,
5690 + inertia: true,
5691 + snap: (value) => {
5692 + let time = -(value * ratio) * tl.duration(),
5693 + wrappedTime = timeWrap(time),
5694 + snapTime = times[getClosest(times, wrappedTime, tl.duration())],
5695 + dif = snapTime - wrappedTime;
5696 + Math.abs(dif) > tl.duration() / 2 &&
5697 + (dif += dif < 0 ? tl.duration() : -tl.duration());
5698 + return (time + dif) / tl.duration() / -ratio;
5699 + },
5700 + onRelease: syncIndex,
5701 + onThrowComplete: syncIndex,
5702 + })[0];
5703 + tl.draggable = draggable;
5704 + }
5705 + tl.closestIndex(true);
5706 + onChange && onChange(items[curIndex], curIndex);
5707 + return tl;
5708 + },
5709 + });
5710 +
5711 + elementorFrontend.hooks.addAction(
5712 + "frontend/element_ready/bdt-marquee.default",
5713 + function ($scope) {
5714 + elementorFrontend.elementsHandler.addHandler(ListMarquee, {
5715 + $element: $scope,
5716 + });
5717 + }
5718 + );
5719 + });
5720 + })(jQuery, window.elementorFrontend);
5721 +
5722 + (function ($, elementor) {
5723 + "use strict";
5724 + $(window).on("elementor/frontend/init", function () {
5725 + var ModuleHandler = elementorModules.frontend.handlers.Base,
5726 + PostGrid;
5727 +
5728 + PostGrid = ModuleHandler.extend({
5729 + bindEvents: function () {
5730 + this.run();
5731 + },
5732 +
5733 + getDefaultSettings: function () {
5734 + return {};
5735 + },
5736 +
5737 + onElementChange: debounce(function (prop) {
5738 + if (prop.indexOf("post_grid") !== -1) {
5739 + this.run();
5740 + }
5741 + }, 400),
5742 +
5743 + settings: function (key) {
5744 + return this.getElementSettings("post_grid_" + key);
5745 + },
5746 +
5747 + run: function () {
5748 + var options = this.getDefaultSettings();
5749 + var content = this.settings("ajax_loadmore");
5750 + var $container = this.$element.find(".bdt-post-grid");
5751 + if (!$container.length) {
5752 + return;
5753 + }
5754 + if (content === undefined) {
5755 + return;
5756 + }
5757 + var settingsLoadmore = this.settings("show_loadmore");
5758 + var settingsInfiniteScroll = this.settings("show_infinite_scroll");
5759 +
5760 + var loadButtonContainer = this.$element.find(".bdt-loadmore-container");
5761 + var grid = $container.find(".bdt-grid");
5762 + var loadButton = loadButtonContainer.find(".bdt-loadmore");
5763 + var loading = false;
5764 + var settings = $container.data("settings");
5765 + var readMore = $container.data("settings-button");
5766 + // var page = 1;
5767 + var currentItemCount = settings.posts_per_page;
5768 +
5769 + var loadMorePosts = function () {
5770 + var dataSettings = {
5771 + action: "ep_loadmore_posts",
5772 + settings: settings,
5773 + readMore: readMore,
5774 + per_page: settings.ajax_item_load,
5775 + offset: currentItemCount,
5776 + paged: settings.paged,
5777 + nonce: settings.nonce,
5778 + };
5779 + jQuery.ajax({
5780 + url: window.ElementPackConfig.ajaxurl,
5781 + type: "post",
5782 + data: dataSettings,
5783 + success: function (response) {
5784 + $(grid).append(response.markup);
5785 + currentItemCount += settings.ajax_item_load;
5786 +
5787 + // if(settings.paged === "yes") {
5788 + settings.paged += 1;
5789 + // }
5790 + loading = false;
5791 + if (settingsLoadmore === "yes") {
5792 + loadButton.html("Load More");
5793 + }
5794 +
5795 + if ($(response.markup).length < settings.ajax_item_load) {
5796 + loadButton.hide();
5797 + loadButtonContainer.hide();
5798 + }
5799 + },
5800 + });
5801 + };
5802 +
5803 + if (settingsLoadmore === "yes") {
5804 + $(loadButton).on("click", function () {
5805 + if (!loading) {
5806 + loading = true;
5807 + loadButton.html("loading...");
5808 + loadMorePosts();
5809 + }
5810 + });
5811 + }
5812 +
5813 + if (settingsInfiniteScroll === "yes") {
5814 + $(window).scroll(function () {
5815 + if (
5816 + $(window).scrollTop() ==
5817 + $(document).height() - $(window).height()
5818 + ) {
5819 + $(loadButton).css("display", "block");
5820 + loadMorePosts();
5821 + } else {
5822 + return;
5823 + }
5824 + });
5825 + }
5826 + },
5827 + });
5828 +
5829 + elementorFrontend.hooks.addAction(
5830 + "frontend/element_ready/bdt-post-grid.default",
5831 + function ($scope) {
5832 + elementorFrontend.elementsHandler.addHandler(PostGrid, {
5833 + $element: $scope,
5834 + });
5835 + }
5836 + );
5837 + });
5838 + })(jQuery, window.elementorFrontend);
5839 +
5840 + (function ($) {
5841 + var categoryCache = {};
5842 +
5843 + $(window).on("elementor/frontend/init", function () {
5844 + elementorFrontend.hooks.addAction(
5845 + "frontend/element_ready/bdt-post-list.default",
5846 + function (scope) {
5847 + scope.find(".bdt-post-list-wrap").each(function () {
5848 + var element = $(this)[0];
5849 +
5850 + if (element) {
5851 + var $settings_showHide = $(this).data("show-hide");
5852 + var tabs = $(this).find(".bdt-option");
5853 + var tabs_header = $(this).find(".bdt-post-list-header");
5854 + var item_wrapper = $(this).find(".bdt-post-list");
5855 + var loader = $(this).find("#bdt-loading-image");
5856 + var settings = item_wrapper.data("settings");
5857 +
5858 + function loadCategoryData(slug) {
5859 + // Show the loader at the beginning of each request
5860 + $(loader).show();
5861 +
5862 + if (categoryCache[slug]) {
5863 + item_wrapper.html(categoryCache[slug]);
5864 + console.log("Using cached data for category:", slug);
5865 + $(loader).hide();
5866 + } else {
5867 + $.ajax({
5868 + url: ElementPackConfig.ajaxurl,
5869 + data: {
5870 + action: "bdt_post_list",
5871 + nonce: ElementPackConfig.nonce,
5872 + settings: settings,
5873 + post_type: settings["post-type"],
5874 + showHide: $settings_showHide,
5875 + category: slug,
5876 + human_diff_time: $settings_showHide["human_diff_time"],
5877 + human_diff_time_short: $settings_showHide["human_diff_time_short"],
5878 + bdt_link_new_tab: $settings_showHide["bdt_link_new_tab"],
5879 + },
5880 + type: "POST",
5881 + dataType: "HTML",
5882 + beforeSend: function() {
5883 + // Ensure loader is shown in case it's hidden unexpectedly
5884 + $(loader).show();
5885 + },
5886 + success: function (response) {
5887 + categoryCache[slug] = response;
5888 + item_wrapper.html(response);
5889 + },
5890 + error: function (response) {
5891 + console.log(response);
5892 + },
5893 + complete: function() {
5894 + // Hide the loader after the request completes
5895 + $(loader).hide();
5896 + },
5897 + });
5898 + }
5899 + }
5900 +
5901 + tabs.on("click", function (e) {
5902 + var slug = $(this).data("slug");
5903 + tabs_header.find(".bdt-filter-list").removeClass("bdt-active");
5904 + $(this).parent().addClass("bdt-active");
5905 + e.preventDefault();
5906 + loadCategoryData(slug);
5907 + });
5908 +
5909 + }
5910 + });
5911 + }
5912 + );
5913 + });
5914 + })(jQuery);
5915 +
5916 + (function ($, elementor) {
5917 + "use strict";
5918 + const MegaMenuAjax = {
5919 +
5920 + initAjaxLoading($container, mode) {
5921 + $container
5922 + .find('.ep-ajax-megamenu[data-ajax-load="true"]')
5923 + .each(function () {
5924 + const $panel = $(this);
5925 + const postId = $panel.data("id");
5926 + let loaded = false;
5927 +
5928 + const $menuItem = $panel.closest("li.ep-has-megamenu");
5929 + if (!$menuItem.length || !postId) return;
5930 + $menuItem.on(mode === "click" ? "click.epAjaxMegamenu" : "mouseenter.epAjaxMegamenu", () => {
5931 + if (!loaded) {
5932 + MegaMenuAjax.loadAjaxContent($panel, postId);
5933 + loaded = true;
5934 + }
5935 + });
5936 + });
5937 + },
5938 +
5939 + initAjaxMobileLoading($container, mode) {
5940 + const postId = $container.data("id");
5941 + //remove hidden attribute
5942 + $container.removeAttr("hidden");
5943 + MegaMenuAjax.loadAjaxContent($container, postId);
5944 + },
5945 +
5946 + loadAjaxContent($panel, postId) {
5947 + const $menuItem = $panel.closest(".ep-has-megamenu");
5948 + const $menuLink = $menuItem.find(".ep-menu-nav-link");
5949 +
5950 + // Prevent multiple loading states
5951 + if ($menuLink.hasClass("ajax-loading")) {
5952 + return;
5953 + }
5954 +
5955 + $.ajax({
5956 + url: `${window.location.origin}/wp-json/element-pack/v1/megamenu/ajax_content/`,
5957 + type: "GET",
5958 + data: { id: postId },
5959 + dataType: "json",
5960 + beforeSend: () => {
5961 + // Add loading class and spinner
5962 + $menuLink.addClass("ajax-loading");
5963 + $menuLink.append('<span class="bdt-megamenu-indicator bdt-spinner" bdt-spinner="ratio: 0.5"></span>');
5964 + },
5965 + success: (response) => {
5966 + this.cleanupLoading($menuLink);
5967 + if (response?.content) {
5968 + $panel.html(response.content);
5969 + this.reinitializeWidgets($panel);
5970 + } else {
5971 + this.showError($panel);
5972 + }
5973 + },
5974 + error: (xhr, status, error) => {
5975 + console.error("MegaMenu Ajax Error:", status, error);
5976 + this.cleanupLoading($menuLink);
5977 + this.showError($panel);
5978 + }
5979 + });
5980 + },
5981 +
5982 + cleanupLoading($menuLink) {
5983 + // Remove loading class and spinner
5984 + $menuLink.removeClass("ajax-loading");
5985 + $menuLink.find(".bdt-spinner").remove();
5986 + },
5987 +
5988 + reinitializeWidgets($panel) {
5989 + if (typeof elementorFrontend !== "undefined") {
5990 + $panel.find(".elementor-element").each((_, el) => {
5991 + elementorFrontend.elementsHandler.runReadyTrigger($(el));
5992 + });
5993 + }
5994 + },
5995 +
5996 + showError($panel) {
5997 + $panel.html('<li class="ep-ajax-error">Failed to load content</li>');
5998 + },
5999 + };
6000 +
6001 + $(window).on("elementor/frontend/init", function () {
6002 +
6003 + var ModuleHandler = elementorModules.frontend.handlers.Base,
6004 + MegaMenu;
6005 +
6006 + MegaMenu = ModuleHandler.extend({
6007 + bindEvents: function () {
6008 + this.run();
6009 + },
6010 +
6011 + getDefaultSettings: function () {
6012 + return {};
6013 + },
6014 +
6015 + onElementChange: debounce(function (prop) {
6016 + if (prop.indexOf("ep_megamenu_") !== -1) {
6017 + this.run();
6018 + }
6019 + }, 400),
6020 +
6021 + settings: function (key) {
6022 + return this.getElementSettings("ep_megamenu_" + key);
6023 + },
6024 +
6025 + run: function () {
6026 + var $this = this;
6027 + var options = this.getDefaultSettings(),
6028 + widgetID = this.$element.data("id");
6029 + var element = this.$element.get(0);
6030 + var $container = this.$element.find(".ep-megamenu");
6031 +
6032 + if (!$container.length) {
6033 + return;
6034 + }
6035 +
6036 + // Get mobile menu type setting
6037 + var mobileMenuType =
6038 + this.getElementSettings("mobile_menu_type") || "hamburger";
6039 +
6040 + MegaMenuAjax.initAjaxLoading($container, this.settings("mode"));
6041 +
6042 + //initial breking issue fixed
6043 + $container.find(".megamenu-header-mobile").removeAttr("style");
6044 + $container.removeClass("initialized");
6045 +
6046 + // Add active class to parent menu link if child item is active
6047 + $container.find(".ep-has-megamenu").each(function() {
6048 + var $megamenuItem = $(this);
6049 + if ($megamenuItem.find(".ep-item.active").length > 0) {
6050 + $megamenuItem.find("> .ep-menu-nav-link").addClass("active");
6051 + }
6052 + });
6053 +
6054 + var dropMenu = $($container).find(".ep-megamenu-vertical-dropdown");
6055 +
6056 + bdtUIkit.drop(dropMenu, {
6057 + offset:
6058 + this.settings("vertical_dropdown_offset") !== undefined
6059 + ? this.settings("vertical_dropdown_offset")
6060 + : "10",
6061 + animation:
6062 + this.settings("vertical_dropdown_animation_type") !== undefined
6063 + ? this.settings("vertical_dropdown_animation_type")
6064 + : "fade",
6065 + duration:
6066 + this.settings("vertical_dropdown_animation_duration") !== undefined
6067 + ? this.settings("vertical_dropdown_animation_duration")
6068 + : "200",
6069 + delayHide:
6070 + this.settings("vertical_dropdown_delay_hide") !== undefined
6071 + ? this.settings("vertical_dropdown_delay_hide")
6072 + : "800",
6073 + mode:
6074 + this.settings("vertical_dropdown_mode") !== undefined
6075 + ? this.settings("vertical_dropdown_mode")
6076 + : "click",
6077 + animateOut:
6078 + this.settings("vertical_dropdown_animate_out") !== undefined
6079 + ? this.settings("vertical_dropdown_animate_out")
6080 + : false,
6081 + });
6082 +
6083 + //has megamenu
6084 + var $megamenu_items = $container.find(".ep-has-megamenu");
6085 + var $subDropdown = $container.find(".ep-default-submenu-panel");
6086 +
6087 + //dropdown options
6088 + options.flip = false;
6089 + options.offset =
6090 + this.settings("offset.size") !== ""
6091 + ? this.settings("offset.size")
6092 + : "10";
6093 + options.animation =
6094 + this.settings("animation_type") !== undefined
6095 + ? this.settings("animation_type")
6096 + : "fade";
6097 + options.duration =
6098 + this.settings("animation_duration") !== undefined
6099 + ? this.settings("animation_duration")
6100 + : "200";
6101 + options.delayHide =
6102 + this.settings("delay_hide") !== undefined
6103 + ? this.settings("delay_hide")
6104 + : "800";
6105 + options.mode =
6106 + this.settings("mode") !== undefined ? this.settings("mode") : "hover";
6107 + options.animateOut =
6108 + this.settings("animate_out") !== undefined
6109 + ? this.settings("animate_out")
6110 + : false;
6111 +
6112 + $($megamenu_items).each(function (index, item) {
6113 + var $drop = $(item).find(".ep-megamenu-panel");
6114 + var widthType = $(item).data("width-type");
6115 +
6116 + var defaltWidthSelector = $(item).closest(".e-con-inner");
6117 + if (defaltWidthSelector.length <= 0) {
6118 + var defaltWidthSelector = $(item).closest(".elementor-container");
6119 + }
6120 +
6121 + if ("horizontal" === $this.settings("direction")) {
6122 + switch (widthType) {
6123 + case "custom":
6124 + options.stretch = null;
6125 + options.target = null;
6126 + options.boundary = null;
6127 + options.pos = $(item).data("content-pos");
6128 + $(this)
6129 + .find(".ep-megamenu-panel")
6130 + .css({
6131 + "min-width": $(item).data("content-width"),
6132 + "max-width": $(item).data("content-width"),
6133 + });
6134 + break;
6135 + case "full":
6136 + options.stretch = "x";
6137 + options.target = "#ep-megamenu-" + widgetID;
6138 + options.boundary = false;
6139 + break;
6140 + default:
6141 + options.stretch = "x";
6142 + options.target = "#ep-megamenu-" + widgetID;
6143 + options.boundary = defaltWidthSelector;
6144 + break;
6145 + }
6146 + } else if ("vertical" === $this.settings("direction")) {
6147 + switch (widthType) {
6148 + case "custom":
6149 + options.stretch = false;
6150 + options.target = false;
6151 + options.boundary = false;
6152 + $(this)
6153 + .find(".ep-megamenu-panel")
6154 + .css({
6155 + "min-width": $(item).data("content-width"),
6156 + "max-width": $(item).data("content-width"),
6157 + });
6158 + break;
6159 + default:
6160 + options.stretch = "x";
6161 + break;
6162 + }
6163 + //check is RTL
6164 + if ($($container).data("is-rtl") === 1) {
6165 + options.pos = "left-top";
6166 + } else {
6167 + options.pos = "right-top";
6168 + }
6169 + }
6170 +
6171 + // options.toggle = $($drop).closest('.menu-item').find('.ep-menu-nav-link');
6172 +
6173 + bdtUIkit.drop($drop, options);
6174 + });
6175 +
6176 + $($subDropdown).each(function (index, item) {
6177 + if ("horizontal" === $this.settings("direction")) {
6178 + if ($(item).hasClass("ep-parent-element")) {
6179 + options.pos = "bottom-left";
6180 + } else {
6181 + options.pos = "right-top";
6182 + }
6183 + } else if ("vertical" === $this.settings("direction")) {
6184 + options.stretch = false;
6185 + $(this).find(".ep-megamenu-panel").css({
6186 + "padding-left": "20px",
6187 + });
6188 +
6189 + //check is RTL
6190 + if ($($container).data("is-rtl") === 1) {
6191 + options.pos = "left-top";
6192 + } else {
6193 + options.pos = "right-top";
6194 + }
6195 + }
6196 + options.stretch = false;
6197 + options.target = false;
6198 + options.flip = true;
6199 +
6200 + bdtUIkit.drop(item, options);
6201 + });
6202 +
6203 + var dropWrapper = $(element).closest(".elementor-top-section");
6204 + if (dropWrapper.length <= 0) {
6205 + var dropWrapper = $(element).closest(
6206 + ".elementor-element.e-con.e-parent"
6207 + );
6208 + if (dropWrapper.length <= 0) {
6209 + var dropWrapper = $(element).closest(
6210 + ".elementor-widget-bdt-mega-menu"
6211 + );
6212 + }
6213 + }
6214 +
6215 + if ($(dropWrapper).find(".ep-virtual-area").length === 0) {
6216 + // code to run if it isn't there
6217 + $("#ep-megamenu-" + widgetID)
6218 + .clone()
6219 + .appendTo(dropWrapper)
6220 + .wrapAll('<div class="ep-virtual-area" />');
6221 + dropWrapper.find(".ep-virtual-area [id]").each(function (index, obj) {
6222 + let old_id = $(obj).attr("id");
6223 + $(obj).attr("id", old_id + "-virtual");
6224 + });
6225 + dropWrapper
6226 + .find(".ep-virtual-area [fill]")
6227 + .each(function (index, obj) {
6228 + let fill_id = $(obj).attr("fill");
6229 + if (fill_id.indexOf("url(#") == 0) {
6230 + $(obj).attr(
6231 + "fill",
6232 + ("url(#", fill_id.slice(0, -1) + "-virtual)")
6233 + );
6234 + }
6235 + });
6236 + }
6237 +
6238 + /**
6239 + * Remove Attributes from Virtual DOMS
6240 + */
6241 +
6242 + dropWrapper
6243 + .find(".ep-virtual-area .bdt-navbar-nav")
6244 + .removeAttr("class");
6245 + dropWrapper
6246 + .find(".ep-virtual-area .menu-item")
6247 + .removeAttr("data-width-type");
6248 + dropWrapper
6249 + .find(".ep-virtual-area .menu-item")
6250 + .removeAttr("data-content-width");
6251 + dropWrapper
6252 + .find(".ep-virtual-area .menu-item")
6253 + .removeAttr("data-content-pos");
6254 + dropWrapper
6255 + .find(".ep-virtual-area .menu-item-has-children")
6256 + .addClass("ep-has-megamenu");
6257 + dropWrapper
6258 + .find(".ep-virtual-area .ep-megamenu-panel")
6259 + .removeClass()
6260 + .addClass("bdt-accordion-content");
6261 + dropWrapper
6262 + .find(".ep-virtual-area .bdt-accordion-content")
6263 + .removeAttr("style");
6264 +
6265 + $(this).find(".details").removeClass("hidden");
6266 + $($container).find(".sub-menu-toggle").remove();
6267 +
6268 + if ($(dropWrapper).find(".bdt-accrodion-title-megamenu").length === 0) {
6269 + dropWrapper
6270 + .find(".ep-virtual-area .ep-menu-nav-link")
6271 + .wrap(
6272 + "<span class='bdt-accordion-title bdt-accrodion-title-megamenu'></span>"
6273 + );
6274 + dropWrapper
6275 + .find(".ep-virtual-area .ep-menu-nav-link")
6276 + .attr("onclick", "event.stopPropagation();");
6277 + dropWrapper.find(".ep-virtual-area .bdt-megamenu-indicator").remove();
6278 + $(
6279 + '<i class="bdt-megamenu-indicator ep-icon-arrow-down-3"></i>'
6280 + ).appendTo(dropWrapper.find(".ep-has-megamenu .bdt-accordion-title"));
6281 + }
6282 +
6283 + /**
6284 + * Mobile toggler
6285 + */
6286 + var $toggler = $container.find(".bdt-navbar-toggle");
6287 + var $toggleContent = dropWrapper.find(".ep-virtual-area");
6288 + bdtUIkit.drop($toggleContent, {
6289 + offset:
6290 + this.settings("offset_mobile.size") !== ""
6291 + ? this.settings("offset_mobile.size")
6292 + : "5",
6293 + // offset:5,
6294 + toggle: $toggler,
6295 + animation:
6296 + this.settings("animation_type") !== undefined
6297 + ? this.settings("animation_type")
6298 + : "fade",
6299 + duration:
6300 + this.settings("animation_duration") !== undefined
6301 + ? this.settings("animation_duration")
6302 + : "200",
6303 + mode: "click",
6304 + });
6305 + // Initialize accordion
6306 + const accordionSelector = "#ep-megamenu-" + widgetID + "-virtual";
6307 + bdtUIkit.accordion(accordionSelector, { offset: 10 });
6308 +
6309 + // Handle when accordion item opens
6310 + $(accordionSelector).on("show", function (event, accordion) {
6311 + const $targetItem = $(event.target)
6312 + .find("[data-ajax-load='true']")
6313 + .first();
6314 +
6315 + if ($targetItem.length && !$targetItem.data("ajax-loaded")) {
6316 + $targetItem.data("ajax-loaded", true); // prevent double load
6317 + MegaMenuAjax.initAjaxMobileLoading($targetItem, "accordion");
6318 + }
6319 + });
6320 +
6321 + // Toggle icon handler
6322 + $toggler.find("svg:last").hide();
6323 + $toggler.on("click", function (event) {
6324 + event.stopPropagation(); // Prevent event from bubbling up
6325 + var $icons = $(this).find("svg");
6326 + $icons.toggle();
6327 + });
6328 +
6329 + // Prevent icon change when clicking outside
6330 + $(document).on("click", function (e) {
6331 + if (
6332 + !$(e.target).closest($toggler).length &&
6333 + !$toggleContent.hasClass("bdt-open")
6334 + ) {
6335 + // Reset icons if dropdown is open and click is outside
6336 + $toggler.find("svg:first").show();
6337 + $toggler.find("svg:last").hide();
6338 + }
6339 + });
6340 +
6341 + /**
6342 + * Simple Offcanvas Accordion for parent menu items
6343 + */
6344 + if (mobileMenuType === "offcanvas") {
6345 + var $offcanvas = this.$element.find(".ep-megamenu-offcanvas");
6346 + var $offcanvasNav = $offcanvas.find(".ep-offcanvas-nav");
6347 +
6348 + if ($offcanvas.length && $offcanvasNav.length) {
6349 + // Remove bdt-drop and bdt-open classes from mega menu panels (we don't want dropdown behavior in offcanvas)
6350 + $offcanvasNav
6351 + .find(".ep-megamenu-panel, .ep-default-submenu-panel")
6352 + .removeClass("bdt-drop bdt-open");
6353 +
6354 + // Initialize UIkit offcanvas
6355 + bdtUIkit.offcanvas($offcanvas);
6356 +
6357 + // Find all parent menu items (items with submenus)
6358 + $offcanvasNav
6359 + .find("li.ep-has-megamenu, li.menu-item-has-children")
6360 + .each(function () {
6361 + var $menuItem = $(this);
6362 + var $link = $menuItem.find("> a").first();
6363 + var $submenu = $menuItem
6364 + .find(
6365 + "> .ep-megamenu-panel, > .ep-default-submenu-panel, > .sub-menu"
6366 + )
6367 + .first();
6368 +
6369 + if ($submenu.length) {
6370 + // Remove bdt-drop and bdt-open classes if present
6371 + $submenu.removeClass("bdt-drop bdt-open");
6372 +
6373 + // Hide submenu initially
6374 + $submenu.hide();
6375 +
6376 + $link.off("click");
6377 +
6378 + // Make parent link clickable for accordion
6379 + $link.on("click", function (e) {
6380 + e.preventDefault();
6381 +
6382 + // Toggle current submenu
6383 + if ($menuItem.hasClass("menu-open")) {
6384 + $menuItem.removeClass("menu-open");
6385 + $submenu.slideUp(300);
6386 + } else {
6387 + // Close siblings
6388 + $menuItem.siblings().removeClass("menu-open");
6389 + $menuItem
6390 + .siblings()
6391 + .find(
6392 + "> .ep-megamenu-panel, > .ep-default-submenu-panel, > .sub-menu"
6393 + )
6394 + .slideUp(300);
6395 +
6396 + // Open current
6397 + $menuItem.addClass("menu-open");
6398 + $submenu.slideDown(300);
6399 + }
6400 + });
6401 + }
6402 + });
6403 +
6404 + // Reset when offcanvas closes
6405 + // $offcanvas.on("hidden", function() {
6406 + // $offcanvasNav.find(".menu-open").removeClass("menu-open");
6407 + // $offcanvasNav.find(".ep-megamenu-panel, .ep-default-submenu-panel, .sub-menu").hide().removeClass("bdt-open");
6408 + // });
6409 + }
6410 + }
6411 + },
6412 + });
6413 +
6414 + elementorFrontend.hooks.addAction(
6415 + "frontend/element_ready/bdt-mega-menu.default",
6416 + function ($scope) {
6417 + elementorFrontend.elementsHandler.addHandler(MegaMenu, {
6418 + $element: $scope,
6419 + });
6420 + }
6421 + );
6422 + });
6423 + })(jQuery, window.elementorFrontend);
6424 + /**
6425 + * Start twitter carousel widget script
6426 + */
6427 +
6428 + (function ($, elementor) {
6429 +
6430 + 'use strict';
6431 +
6432 + var widgetBrandCarousel = function ($scope, $) {
6433 +
6434 + var $brandCarousel = $scope.find('.bdt-ep-brand-carousel');
6435 +
6436 + if (!$brandCarousel.length) {
6437 + return;
6438 + }
6439 +
6440 + var $brandCarouselContainer = $brandCarousel.find('.swiper-carousel'),
6441 + $settings = $brandCarousel.data('settings');
6442 +
6443 + const Swiper = elementorFrontend.utils.swiper;
6444 + initSwiper();
6445 + async function initSwiper() {
6446 + var swiper = await new Swiper($brandCarouselContainer, $settings); // this is an example
6447 + if ($settings.pauseOnHover) {
6448 + $($brandCarouselContainer).hover(function () {
6449 + (this).swiper.autoplay.stop();
6450 + }, function () {
6451 + (this).swiper.autoplay.start();
6452 + });
6453 + }
6454 + };
6455 + };
6456 +
6457 +
6458 + jQuery(window).on('elementor/frontend/init', function () {
6459 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-brand-carousel.default', widgetBrandCarousel);
6460 + });
6461 +
6462 + }(jQuery, window.elementorFrontend));
6463 +
6464 + /**
6465 + * End twitter carousel widget script
6466 + */
6467 +
6468 +
6469 + (function ($, elementor) {
6470 +
6471 + 'use strict';
6472 +
6473 + var widgetCarousel = function ($scope, $) {
6474 +
6475 + var $carousel = $scope.find('.bdt-ep-carousel');
6476 +
6477 + if (!$carousel.length) {
6478 + return;
6479 + }
6480 +
6481 + var $carouselContainer = $carousel.find('.swiper-carousel'),
6482 + $settings = $carousel.data('settings');
6483 +
6484 + const Swiper = elementorFrontend.utils.swiper;
6485 + initSwiper();
6486 + async function initSwiper() {
6487 + var swiper = await new Swiper($carouselContainer, $settings);
6488 +
6489 + if ($settings.pauseOnHover) {
6490 + $($carouselContainer).hover(function () {
6491 + (this).swiper.autoplay.stop();
6492 + }, function () {
6493 + (this).swiper.autoplay.start();
6494 + });
6495 + }
6496 +
6497 + };
6498 +
6499 + };
6500 +
6501 +
6502 + jQuery(window).on('elementor/frontend/init', function () {
6503 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-carousel.default', widgetCarousel);
6504 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-carousel.bdt-alice', widgetCarousel);
6505 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-carousel.bdt-vertical', widgetCarousel);
6506 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-carousel.bdt-ramble', widgetCarousel);
6507 + });
6508 +
6509 + }(jQuery, window.elementorFrontend));
6510 + /**
6511 + * Start chart widget script
6512 + */
6513 +
6514 + (function ($, elementor) {
6515 +
6516 + 'use strict';
6517 +
6518 + var widgetChart = function ($scope, $) {
6519 +
6520 + var $chart = $scope.find('.bdt-chart'),
6521 + $chart_canvas = $chart.find('> canvas'),
6522 + settings = $chart.data('settings'),
6523 + suffixprefix = $chart.data('suffixprefix');
6524 +
6525 + if (!$chart.length) {
6526 + return;
6527 + }
6528 +
6529 + epObserveTarget($scope[0], function () {
6530 + var $this = $($chart),
6531 + ctx = $chart.find('> canvas')[0].getContext('2d'),
6532 + myChart = null;
6533 +
6534 + if (myChart != null) {
6535 + myChart.destroy();
6536 + }
6537 +
6538 + myChart = new Chart(ctx, settings);
6539 +
6540 +
6541 + var thouSeparator = settings.valueSeparator,
6542 + separatorSymbol = settings.separatorSymbol,
6543 + xAxesSeparator = settings.xAxesSeparator,
6544 + yAxesSeparator = settings.yAxesSeparator;
6545 + var _k_formatter = (settings.kFormatter == 'yes') ? true : false;
6546 +
6547 + /**
6548 + * start update
6549 + * s_p_status = s = suffix, p = prefix
6550 + */
6551 +
6552 + if (settings.type == 'pie' || settings.type == 'doughnut') {
6553 + return;
6554 + }
6555 +
6556 + var
6557 + s_p_status = (typeof suffixprefix.suffix_prefix_status !== 'undefined') ? suffixprefix.suffix_prefix_status : 'no',
6558 +
6559 + x_prefix = (typeof suffixprefix.x_custom_prefix !== 'undefined') ? suffixprefix.x_custom_prefix : '',
6560 + x_suffix = (typeof suffixprefix.x_custom_suffix !== 'undefined') ? suffixprefix.x_custom_suffix : '',
6561 +
6562 + y_suffix = (typeof suffixprefix.y_custom_suffix !== 'undefined') ? suffixprefix.y_custom_suffix : '',
6563 + y_prefix = (typeof suffixprefix.y_custom_prefix !== 'undefined') ? suffixprefix.y_custom_prefix : '';
6564 +
6565 +
6566 + function addCommas(nStr, separatorSymbol, _k_formatter) {
6567 + nStr += '';
6568 + var x = nStr.split('.');
6569 + var x1 = x[0];
6570 + var x2 = x.length > 1 ? '.' + x[1] : '';
6571 + var rgx = /(\d+)(\d{3})/;
6572 + while (rgx.test(x1)) {
6573 + x1 = x1.replace(rgx, '$1' + separatorSymbol + '$2');
6574 + }
6575 +
6576 + if (_k_formatter == true) {
6577 + if (nStr >= 1000000000) {
6578 + return (nStr / 1000000000).toFixed(1).replace(/\.0$/, '') + 'G';
6579 + }
6580 + if (nStr >= 1000000) {
6581 + return (nStr / 1000000).toFixed(1).replace(/\.0$/, '') + 'M';
6582 + }
6583 + if (nStr >= 1000) {
6584 + return (nStr / 1000).toFixed(1).replace(/\.0$/, '') + 'K';
6585 + }
6586 + return nStr;
6587 + } else {
6588 + return x1 + x2;
6589 + }
6590 + }
6591 +
6592 +
6593 + function updateChartSetting(chart, thouSeparator = 'no', separatorSymbol = ',') {
6594 +
6595 + // chart.options.scales.x.ticks = {
6596 + // callback: function (value, index, ticks) {
6597 +
6598 + // if (s_p_status == 'yes' && thouSeparator == 'yes' && xAxesSeparator == 'yes') {
6599 + // return x_prefix + addCommas(value, separatorSymbol, _k_formatter) + x_suffix;
6600 + // } else if (s_p_status == 'no' && thouSeparator == 'yes' && xAxesSeparator == 'yes') {
6601 + // return addCommas(value, separatorSymbol, _k_formatter);
6602 + // } else {
6603 + // return x_prefix + value + x_suffix;
6604 + // }
6605 +
6606 + // }
6607 + // }
6608 +
6609 + if (suffixprefix.type == 'horizontalBar') {
6610 + chart.options.scales.x.ticks = {
6611 + callback: function (value, index) {
6612 +
6613 + if (s_p_status == 'yes' && thouSeparator == 'yes' && yAxesSeparator == 'yes') {
6614 + return y_prefix + addCommas(value, separatorSymbol, _k_formatter) + y_suffix;
6615 + } else if (s_p_status == 'no' && thouSeparator == 'yes' && yAxesSeparator == 'yes') {
6616 + return addCommas(value, separatorSymbol, _k_formatter);
6617 + } else {
6618 + return y_prefix + value + y_suffix;
6619 + }
6620 + }
6621 + }
6622 + } else if (suffixprefix.type == 'bar' || suffixprefix.type == 'line' || suffixprefix.type == 'bubble') {
6623 + chart.options.scales.y.ticks = {
6624 + callback: function (value, index) {
6625 +
6626 + if (s_p_status == 'yes' && thouSeparator == 'yes' && yAxesSeparator == 'yes') {
6627 + return y_prefix + addCommas(value, separatorSymbol, _k_formatter) + y_suffix;
6628 + } else if (s_p_status == 'no' && thouSeparator == 'yes' && yAxesSeparator == 'yes') {
6629 + return addCommas(value, separatorSymbol, _k_formatter);
6630 + } else {
6631 + return y_prefix + value + y_suffix;
6632 + }
6633 + }
6634 + }
6635 + }
6636 +
6637 + chart.update();
6638 + }
6639 + if (s_p_status == 'yes' && thouSeparator == 'no') {
6640 + updateChartSetting(myChart);
6641 + } else if (s_p_status == 'yes' && thouSeparator == 'yes') {
6642 + updateChartSetting(myChart, thouSeparator, separatorSymbol);
6643 + } else if (s_p_status == 'no' && thouSeparator == 'yes') {
6644 + updateChartSetting(myChart, thouSeparator, separatorSymbol);
6645 + } else {
6646 +
6647 + }
6648 + // end update
6649 +
6650 + },{
6651 + root: null, // Use the viewport as the root
6652 + rootMargin: '0px', // No margin around the root
6653 + threshold: 0.8 // 80% visibility (1 - 0.8)
6654 + });
6655 +
6656 + };
6657 +
6658 + jQuery(window).on('elementor/frontend/init', function () {
6659 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-chart.default', widgetChart);
6660 + });
6661 +
6662 + }(jQuery, window.elementorFrontend));
6663 +
6664 + /**
6665 + * End chart widget script
6666 + */
6667 + /**
6668 + * Start circle info widget script
6669 + */
6670 +
6671 + // this is the main function, here impvaring all html into js DOM as a
6672 + // parameter.
6673 + function circleJs(id, circleMoving, movingTime, mouseEvent) {
6674 + var circles = document.querySelectorAll('#' + id + ' .bdt-ep-circle-info-sub-circle');
6675 + var circleContents = document.querySelectorAll('#' + id + ' .bdt-ep-circle-info-item');
6676 + var parent = document.querySelector('#' + id + ' .bdt-ep-circle-info-inner ');
6677 +
6678 + var i = 2;
6679 + var prevNowPlaying = null;
6680 +
6681 + if (movingTime <= 0) {
6682 + movingTime = '100000000000';
6683 + }
6684 +
6685 + if (circleMoving === false) {
6686 + movingTime = '100000000000';
6687 + }
6688 +
6689 + function myTimer() {
6690 + var dataTab = jQuery(' #' + id + ' .bdt-ep-circle-info-sub-circle.active').data('circle-index');
6691 + var totalSubCircle = jQuery('#' + id + ' .bdt-ep-circle-info-sub-circle').length; // here
6692 +
6693 + if (dataTab > totalSubCircle || i > totalSubCircle) {
6694 + dataTab = 1;
6695 + i = 1;
6696 + }
6697 +
6698 + jQuery('#' + id + ' .bdt-ep-circle-info-sub-circle').removeClass('active');
6699 + jQuery('#' + id + ' .bdt-ep-circle-info-sub-circle.active').removeClass('active', this);
6700 + jQuery('#' + id + ' ' + '[data-circle-index=\'' + i + '\']').addClass('active');
6701 + jQuery('#' + id + ' .bdt-ep-circle-info-item').removeClass('active');
6702 + jQuery('#' + id + ' .icci' + i).addClass('active');
6703 + i++;
6704 + var activeIcon = '#' + id + ' .bdt-ep-circle-info-sub-circle i,' + '#' + id + ' .bdt-ep-circle-info-sub-circle svg';
6705 + jQuery(activeIcon).css({
6706 + 'transform': 'rotate(' + (360 - (i - 2) * 36) + 'deg)',
6707 + 'transition': '2s'
6708 + });
6709 + jQuery('#' + id + ' .bdt-ep-circle-info-inner').css({
6710 + 'transform': 'rotate(' + ((i - 2) * 36) + 'deg) ',
6711 + 'transition': '1s'
6712 + });
6713 +
6714 + }
6715 + if (circleMoving === true) {
6716 + var prevNowPlaying = setInterval(myTimer, movingTime);
6717 + }
6718 + if (circleMoving === false) {
6719 + clearInterval(prevNowPlaying);
6720 + }
6721 +
6722 +
6723 + // active class toggle methods
6724 + var removeClasses = function removeClasses(nodes, value) {
6725 + var nodes = nodes;
6726 + var value = value;
6727 + if (nodes) return nodes.forEach(function (node) {
6728 + return node.classList.contains(value) && node.classList.remove(value);
6729 + });
6730 + else return false;
6731 + };
6732 + var addClass = function addClass(nodes, index, value) {
6733 + var nodes = nodes;
6734 + var index = index;
6735 + var value = value;
6736 + return nodes ? nodes[index].classList.add(value) : 0;
6737 + };
6738 + var App = {
6739 + initServicesCircle: function initServicesCircle() {
6740 + // info circle
6741 + if (parent) {
6742 + var spreadCircles = function spreadCircles() {
6743 + // spread the sub-circles around the circle
6744 + var parent = document.querySelector('#' + id + ' .bdt-ep-circle-info-inner ').getBoundingClientRect();
6745 + var centerX = 0;
6746 + var centerY = 0;
6747 + Array.from(circles).reverse().forEach(function (circle, index) {
6748 + var circle = circle;
6749 + var index = index;
6750 + var angle = index * (360 / circles.length);
6751 + var x = centerX + (parent.width / 2) * Math.cos((angle * Math.PI) / 180);
6752 + var y = centerY + (parent.height / 2) * Math.sin((angle * Math.PI) / 180);
6753 + circle.style.transform = 'translate3d(' + parseFloat(x).toFixed(5) + 'px,' + parseFloat(y).toFixed(5) + 'px,0)';
6754 + });
6755 + };
6756 +
6757 + spreadCircles();
6758 +
6759 + var resizeTimer = void 0;
6760 + window.addEventListener('resize', function () {
6761 + clearTimeout(resizeTimer);
6762 + resizeTimer = setTimeout(function () {
6763 + spreadCircles();
6764 + }, 50);
6765 + });
6766 + circles.forEach(function (circle, index) {
6767 + var circle = circle;
6768 + var index = index;
6769 + var circlesToggleFnc = function circlesToggleFnc() {
6770 + this.index = circle.dataset.circleIndex;
6771 + if (!circle.classList.contains('active')) {
6772 + removeClasses(circles, 'active');
6773 + removeClasses(circleContents, 'active');
6774 + addClass(circles, index, 'active');
6775 + addClass(circleContents, index, 'active');
6776 + }
6777 + };
6778 + if (mouseEvent === 'mouseover') {
6779 + circle.addEventListener('mouseover', circlesToggleFnc, true);
6780 + } else if (mouseEvent === 'click') {
6781 + circle.addEventListener('click', circlesToggleFnc, true);
6782 + } else {
6783 + circle.addEventListener('mouseover', circlesToggleFnc, true);
6784 + }
6785 + });
6786 + }
6787 + }
6788 + };
6789 + App.initServicesCircle();
6790 + }
6791 +
6792 + (function ($, elementor) {
6793 + 'use strict';
6794 + var widgetCircleInfo = function ($scope, $) {
6795 + var $circleInfo = $scope.find('.bdt-ep-circle-info');
6796 +
6797 + if (!$circleInfo.length) {
6798 + return;
6799 + }
6800 +
6801 + epObserveTarget($circleInfo[0], function () {
6802 + const $this = jQuery($circleInfo[0]);
6803 + var $settings = $this.data('settings');
6804 +
6805 + circleJs($settings.id, $settings.circleMoving, $settings.movingTime, $settings.mouseEvent);
6806 +
6807 + }, {
6808 + root: null, // Use the viewport as the root
6809 + rootMargin: '0px', // No margin around the root
6810 + threshold: 0.8 // 80% visibility (1 - 0.8)
6811 + });
6812 +
6813 + };
6814 +
6815 + jQuery(window).on('elementor/frontend/init', function () {
6816 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-circle-info.default', widgetCircleInfo);
6817 + });
6818 + }(jQuery, window.elementorFrontend));
6819 +
6820 + /**
6821 + * End circle info widget script
6822 + */
6823 + /**
6824 + * Start circle menu widget script
6825 + */
6826 +
6827 + ( function( $, elementor ) {
6828 +
6829 + 'use strict';
6830 +
6831 + var widgetCircleMenu = function( $scope, $ ) {
6832 +
6833 + var $circleMenu = $scope.find('.bdt-circle-menu'),
6834 + $settings = $circleMenu.data('settings');
6835 +
6836 + if ( ! $circleMenu.length ) {
6837 + return;
6838 + }
6839 +
6840 + $($circleMenu[0]).circleMenu({
6841 + direction : $settings.direction,
6842 + item_diameter : $settings.item_diameter,
6843 + circle_radius : $settings.circle_radius,
6844 + speed : $settings.speed,
6845 + delay : $settings.delay,
6846 + step_out : $settings.step_out,
6847 + step_in : $settings.step_in,
6848 + trigger : $settings.trigger,
6849 + transition_function : $settings.transition_function
6850 + });
6851 +
6852 + var $tooltip = $circleMenu.find('.bdt-tippy-tooltip'),
6853 + widgetID = $scope.data('id');
6854 +
6855 + $tooltip.each(function (index) {
6856 + tippy(this, {
6857 + //appendTo: $scope[0]
6858 + //arrow: false,
6859 + allowHTML: true,
6860 + theme: 'bdt-tippy-' + widgetID
6861 + });
6862 + });
6863 +
6864 + };
6865 +
6866 +
6867 + jQuery(window).on('elementor/frontend/init', function() {
6868 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-circle-menu.default', widgetCircleMenu );
6869 + });
6870 +
6871 + }( jQuery, window.elementorFrontend ) );
6872 +
6873 + /**
6874 + * End circle menu widget script
6875 + */
6876 +
6877 +
6878 + /**
6879 + * Start comment widget script
6880 + */
6881 +
6882 + ( function( $, elementor ) {
6883 +
6884 + 'use strict';
6885 +
6886 + var widgetComment = function( $scope, $ ) {
6887 +
6888 + var $comment = $scope.find( '.bdt-comment-container' ),
6889 + $settings = $comment.data('settings');
6890 +
6891 + if ( ! $comment.length ) {
6892 + return;
6893 + }
6894 +
6895 + if ($settings.layout === 'disqus') {
6896 +
6897 + var disqus_config = function () {
6898 + this.page.url = $settings.permalink; // Replace PAGE_URL with your page's canonical URL variable
6899 + this.page.identifier = $comment; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
6900 + };
6901 +
6902 + (function() { // DON'T EDIT BELOW THIS LINE
6903 + var d = document, s = d.createElement('script');
6904 + s.src = '//' + $settings.username + '.disqus.com/embed.js';
6905 + s.setAttribute('data-timestamp', +new Date());
6906 + (d.head || d.body).appendChild(s);
6907 + })();
6908 +
6909 + } else if ($settings.layout === 'facebook') {
6910 + (function(d, s, id){
6911 + var js, fjs = d.getElementsByTagName(s)[0];
6912 + if (d.getElementById(id)) {return;}
6913 + js = d.createElement(s); js.id = id;
6914 + js.src = 'https://connect.facebook.net/en_US/sdk.js';
6915 + fjs.parentNode.insertBefore(js, fjs);
6916 + }(document, 'script', 'facebook-jssdk'));
6917 +
6918 +
6919 + window.fbAsyncInit = function() {
6920 + FB.init({
6921 + appId : $settings.app_id,
6922 + autoLogAppEvents : true,
6923 + xfbml : true,
6924 + version : 'v3.2'
6925 + });
6926 + };
6927 +
6928 + }
6929 +
6930 + };
6931 +
6932 +
6933 + jQuery(window).on('elementor/frontend/init', function() {
6934 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-comment.default', widgetComment );
6935 + });
6936 +
6937 + }( jQuery, window.elementorFrontend ) );
6938 +
6939 + /**
6940 + * End comment widget script
6941 + */
6942 +
6943 +
6944 + (function ($, elementor) {
6945 +
6946 + 'use strict';
6947 +
6948 + $(window).on('elementor/frontend/init', function ($) {
6949 + var ModuleHandler = elementorModules.frontend.handlers.Base,
6950 + Confetti;
6951 +
6952 + Confetti = ModuleHandler.extend({
6953 +
6954 + bindEvents: function () {
6955 + this.run();
6956 + },
6957 +
6958 + getDefaultSettings: function () {
6959 + return {
6960 + resize: true,
6961 + useWorker: true,
6962 + };
6963 + },
6964 +
6965 + onElementChange: debounce(function (prop) {
6966 + if (prop.indexOf('ep_widget_cf_') !== -1) {
6967 + // this.instance.reset();
6968 + this.run();
6969 +
6970 + }
6971 + }, 400),
6972 +
6973 + settings: function (key) {
6974 + return this.getElementSettings('ep_widget_cf_' + key);
6975 + },
6976 + randomInRange: function (min, max) {
6977 + return Math.random() * (max - min) + min;
6978 + },
6979 + run: function () {
6980 + var options = this.getDefaultSettings(),
6981 + $element = this.$element;
6982 +
6983 + if (this.settings('confetti') !== 'yes') {
6984 + return;
6985 + }
6986 +
6987 + if (this.settings('z_index')) {
6988 + options.zIndex = this.settings('z_index');
6989 + }
6990 + if (this.settings('particle_count.size')) {
6991 + options.particleCount = this.settings('particle_count.size') || 100;
6992 + }
6993 + if (this.settings('start_velocity.size')) {
6994 + options.startVelocity = this.settings('start_velocity.size') || 45;
6995 + }
6996 +
6997 + if (this.settings('spread.size')) {
6998 + options.spread = this.settings('spread.size') || 70;
6999 + }
7000 + if (this.settings('colors')) {
7001 + var colors = this.settings('colors');
7002 + options.colors = colors.split(',');
7003 + }
7004 + if (this.settings('shapes')) {
7005 + var shapes = this.settings('shapes');
7006 + options.shapes = shapes.split(/,|\|/);
7007 + }
7008 +
7009 + if ('emoji' == this.settings('shape_type') && this.settings('shapes_emoji')) {
7010 + var shapes = this.settings('shapes_emoji');
7011 + let __shapes = [];
7012 +
7013 + let shapesArray = shapes.split(/,|\|/);
7014 + shapesArray.forEach(function (shape, i) {
7015 + __shapes[i] = confetti.shapeFromText({
7016 + text: shape,
7017 + });
7018 + });
7019 + options.shapes = __shapes;
7020 + }
7021 +
7022 + if ('svg' == this.settings('shape_type') && this.settings('shapes_svg')) {
7023 + let shapes = this.settings('shapes_svg');
7024 + let __path = [];
7025 + let shapesArray = shapes.split('|');
7026 +
7027 + shapesArray.forEach(function (shape, i) {
7028 + __path[i] = confetti.shapeFromPath({
7029 + path: shape,
7030 + matrix: [0.03597122302158273, 0, 0, 0.03597122302158273, -4.856115107913669, -5.071942446043165]
7031 + });
7032 + });
7033 +
7034 + options.shapes = __path;
7035 + }
7036 +
7037 +
7038 + if (this.settings('scalar.size')) {
7039 + options.scalar = this.settings('scalar.size') || 1;
7040 + }
7041 +
7042 + if (this.settings('origin')) {
7043 + if (this.settings('origin_x.size') || this.settings('origin_y.size')) {
7044 + options.origin = {
7045 + x: this.settings('origin_x.size') || 0.5,
7046 + y: this.settings('origin_y.size') || 0.6
7047 + }
7048 + }
7049 + }
7050 +
7051 + if (this.settings('angle.size')) {
7052 + options.angle = this.settings('angle.size') || 90;
7053 + }
7054 +
7055 + var this_instance = this;
7056 + var instanceConfetti = {
7057 + executeConfetti: function () {
7058 + if (this_instance.settings('type') == 'random') {
7059 + options.angle = this_instance.randomInRange(55, this_instance.settings('angle.size') || 90);
7060 + options.spread = this_instance.randomInRange(50, this_instance.settings('spread.size') || 70);
7061 + options.particleCount = this_instance.randomInRange(55, this_instance.settings('particle_count.size') || 100);
7062 + }
7063 + if (this_instance.settings('type') == 'fireworks') {
7064 + var duration = this_instance.settings('fireworks_duration.size') || 1500;
7065 + var animationEnd = Date.now() + duration;
7066 + var defaults = {
7067 + startVelocity: this_instance.settings('start_velocity.size') || 30,
7068 + spread: this_instance.settings('spread.size') || 360,
7069 + shapes: this_instance.settings('shapes') ? shapes.split(',') : ['circle', 'circle', 'square'],
7070 + ticks: 60,
7071 + zIndex: this_instance.settings('z_index') || 0
7072 + };
7073 +
7074 + var interval = setInterval(function () {
7075 + var timeLeft = animationEnd - Date.now();
7076 +
7077 + if (timeLeft <= 0) {
7078 + return clearInterval(interval);
7079 + }
7080 +
7081 + var particleCount = 50 * (timeLeft / duration);
7082 + // since particles fall down, start a bit higher than random
7083 + confetti(Object.assign({}, defaults, {
7084 + particleCount,
7085 + origin: {
7086 + x: this_instance.randomInRange(0.1, 0.3),
7087 + y: Math.random() - 0.2
7088 + }
7089 + }));
7090 + confetti(Object.assign({}, defaults, {
7091 + particleCount,
7092 + origin: {
7093 + x: this_instance.randomInRange(0.7, 0.9),
7094 + y: Math.random() - 0.2
7095 + }
7096 + }));
7097 + }, 250);
7098 + }
7099 +
7100 + if (this_instance.settings('type') == 'school-pride') {
7101 + var duration = this_instance.settings('fireworks_duration.size') || 1500;
7102 + var end = Date.now() + (duration);
7103 +
7104 + (function frame() {
7105 + confetti({
7106 + particleCount: this_instance.settings('particle_count.size') || 2,
7107 + angle: this_instance.settings('angle.size') || 60,
7108 + spread: this_instance.settings('spread.size') || 55,
7109 + shapes: this_instance.settings('shapes') ? shapes.split(',') : ['circle', 'circle', 'square'],
7110 + origin: {
7111 + x: 0
7112 + },
7113 + colors: colors.split(',')
7114 + });
7115 + confetti({
7116 + particleCount: this_instance.settings('particle_count.size') || 2,
7117 + angle: (this_instance.settings('angle.size') || 60) * 2, //120
7118 + spread: this_instance.settings('spread.size') || 55,
7119 + shapes: this_instance.settings('shapes') ? shapes.split(',') : ['circle', 'circle', 'square'],
7120 + origin: {
7121 + x: 1
7122 + },
7123 + colors: colors.split(',')
7124 + });
7125 +
7126 + if (Date.now() < end) {
7127 + requestAnimationFrame(frame);
7128 + }
7129 + }());
7130 + }
7131 +
7132 + if (this_instance.settings('type') == 'snow') {
7133 + var duration = this_instance.settings('fireworks_duration.size') || 1500;
7134 + /**
7135 + * Infinite Animation Time
7136 + * Yes & Not in Editor
7137 + */
7138 + if ('yes' == this_instance.settings('anim_infinite') && false == Boolean(elementorFrontend.isEditMode())) {
7139 + duration = 24 * 60 * 60 * 1000;
7140 + }
7141 + var animationEnd = Date.now() + duration;
7142 + var skew = 1;
7143 +
7144 + (function frame() {
7145 + var timeLeft = animationEnd - Date.now();
7146 + var ticks = Math.max(200, 500 * (timeLeft / duration));
7147 + skew = Math.max(0.8, skew - 0.001);
7148 +
7149 + confetti({
7150 + particleCount: this_instance.settings('particle_count.size') || 1,
7151 + startVelocity: this_instance.settings('start_velocity.size') || 0,
7152 + ticks: ticks,
7153 + origin: {
7154 + x: Math.random(),
7155 + // since particles fall down, skew start toward the top
7156 + y: (Math.random() * skew) - 0.2
7157 + },
7158 + colors: colors.split(','),
7159 + shapes: this_instance.settings('shapes') ? shapes.split(',') : ['circle'],
7160 + gravity: this_instance.randomInRange(0.4, 0.6),
7161 + scalar: this_instance.randomInRange(0.4, 1),
7162 + drift: this_instance.randomInRange(-0.4, 0.4)
7163 + });
7164 +
7165 + if (timeLeft > 0) {
7166 + requestAnimationFrame(frame);
7167 + }
7168 + }());
7169 +
7170 + setInterval(function () {
7171 + // instanceConfetti.executeConfetti();
7172 + }, 5000);
7173 + }
7174 +
7175 + if ((this_instance.settings('type') == 'basic') ||
7176 + (this_instance.settings('type') == 'random')) {
7177 + this_instance.instance = confetti(options);
7178 +
7179 + }
7180 + }
7181 + };
7182 +
7183 + if (this.settings('confetti') == 'yes') {
7184 +
7185 + if ((this.settings('trigger_type') == 'click')) {
7186 + jQuery(this.settings('trigger_selector')).on('click', function () {
7187 + instanceConfetti.executeConfetti();
7188 + // $(this).unbind('mouseenter mouseleave');
7189 + });
7190 + } else if (this.settings('trigger_type') == 'mouseenter') {
7191 + jQuery(this.settings('trigger_selector')).on('mouseenter', function () {
7192 + instanceConfetti.executeConfetti();
7193 + // $(this).unbind('mouseenter mouseleave');
7194 + });
7195 + } else if (this.settings('trigger_type') == 'ajax-success') {
7196 + jQuery(document).ajaxComplete(function (event, jqxhr, settings) {
7197 + instanceConfetti.executeConfetti();
7198 + });
7199 + } else if (this.settings('trigger_type') == 'delay') {
7200 + setTimeout(function () {
7201 + instanceConfetti.executeConfetti();
7202 + }, this.settings('trigger_delay.size') ? this.settings('trigger_delay.size') : 1000);
7203 + } else if (this.settings('trigger_type') == 'onview') {
7204 + epObserveTarget($element[0], function () {
7205 + instanceConfetti.executeConfetti();
7206 + });
7207 + } else {
7208 + instanceConfetti.executeConfetti();
7209 + }
7210 +
7211 + }
7212 + }
7213 + });
7214 +
7215 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
7216 + elementorFrontend.elementsHandler.addHandler(Confetti, {
7217 + $element: $scope
7218 + });
7219 + });
7220 +
7221 + elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) {
7222 + elementorFrontend.elementsHandler.addHandler(Confetti, {
7223 + $element: $scope
7224 + });
7225 + });
7226 +
7227 + elementorFrontend.hooks.addAction('frontend/element_ready/container', function ($scope) {
7228 + elementorFrontend.elementsHandler.addHandler(Confetti, {
7229 + $element: $scope
7230 + });
7231 + });
7232 +
7233 + });
7234 +
7235 + }(jQuery, window.elementorFrontend));
7236 + /**
7237 + * Start coupon reveal widget script
7238 + */
7239 + (function ($, elementor) {
7240 + 'use strict';
7241 + var widgetCoupon = function ($scope, $) {
7242 + var $widgetContainer = $scope.find('.bdt-coupon-code'),
7243 + editMode = Boolean(elementorFrontend.isEditMode()),
7244 + $couponExecuted = false;
7245 + if (!$widgetContainer.length) {
7246 + return;
7247 + }
7248 + var $settings = $widgetContainer.data('settings'),
7249 + triggerURL = $settings.triggerURL;
7250 +
7251 + if ($settings.triggerByAction != true) {
7252 + var clipboard = new ClipboardJS($settings.couponMsgId, {
7253 + target: function (trigger) {
7254 + // $trigger.nextElementSibling.addClass('bdt-coupon-showing');
7255 + return trigger.nextElementSibling;
7256 + }
7257 + });
7258 +
7259 + clipboard.on('success', function (event) {
7260 + $(event.trigger).addClass('active');
7261 +
7262 + event.clearSelection();
7263 + setTimeout(function () {
7264 + $(event.trigger).removeClass('active');
7265 + // $($settings.couponId).removeClass('bdt-coupon-showing');
7266 + }, 3000);
7267 + });
7268 + }
7269 +
7270 + if (($settings.couponLayout == 'style-2') && ($settings.triggerByAction == true)) {
7271 + var clipboard = new ClipboardJS($settings.couponId, {
7272 + target: function (trigger) {
7273 + return trigger;
7274 + }
7275 + });
7276 +
7277 + clipboard.on('success', function (event) {
7278 + $widgetContainer.find($settings.couponId).addClass('active');
7279 + event.clearSelection();
7280 + setTimeout(function () {
7281 + $widgetContainer.find($settings.couponId).removeClass('active');
7282 + }, 2000);
7283 + });
7284 +
7285 + // attention
7286 + $widgetContainer.on('click', function () {
7287 + if (!$widgetContainer.hasClass('active') && ($settings.triggerAttention != false)) {
7288 + var $triggerSelector = $settings.triggerInputId;
7289 + $('[name="' + $triggerSelector.substring(1) + '"]').closest('form').addClass('ep-shake-animation-cc');
7290 + setTimeout(function () {
7291 + $('[name="' + $triggerSelector.substring(1) + '"]').closest('form').removeClass('ep-shake-animation-cc');
7292 + }, 5000);
7293 + }
7294 +
7295 + });
7296 + }
7297 +
7298 + var couponObj = {
7299 + decodeCoupon: function (data) {
7300 + jQuery.ajax({
7301 + url: $settings.adminAjaxURL,
7302 + type: 'post',
7303 + data: {
7304 + action: 'element_pack_coupon_code',
7305 + coupon_code: data
7306 + },
7307 + success: function (couponCode) {
7308 + $($settings.couponId).find('.bdt-coupon-code-text').html(couponCode);
7309 + },
7310 + error: function () {
7311 + $($settings.couponId).html('Something wrong, please contact support team.');
7312 + }
7313 + });
7314 + },
7315 + displayCoupon: function ($widgetContainer) {
7316 + $widgetContainer.addClass('active');
7317 +
7318 + },
7319 + triggerURL: function (triggerURL) {
7320 + var target = (true !== $settings.is_external) ? '_self' : '_blank';
7321 + var redirectWindow = window.open(triggerURL, target);
7322 +
7323 + if (triggerURL) {
7324 + // Url contains a #
7325 + if (target == '_self' && triggerURL.indexOf('#') !== -1) {
7326 + var hash = triggerURL.split('#')[1];
7327 + if (hash) {
7328 + $('html, body').animate({
7329 + scrollTop: $('#' + hash).offset().top - 100
7330 + }, 1500);
7331 + // return;
7332 + }
7333 + }
7334 + redirectWindow.location;
7335 + }
7336 + return false;
7337 + },
7338 + formSubmitted: function () {
7339 + this.displayCoupon($widgetContainer);
7340 + if (triggerURL !== false) {
7341 + this.triggerURL(triggerURL);
7342 + }
7343 + this.decodeCoupon($settings.couponCode);
7344 + $couponExecuted = true;
7345 + }
7346 + };
7347 +
7348 +
7349 + $widgetContainer.on('click', function () {
7350 + if (!$widgetContainer.hasClass('active') && ($settings.triggerByAction !== true)) {
7351 + couponObj.displayCoupon($widgetContainer);
7352 + if (triggerURL !== false) {
7353 + setTimeout(function () {
7354 + couponObj.triggerURL(triggerURL);
7355 + }, 2000);
7356 + }
7357 + }
7358 + });
7359 +
7360 + if (!editMode) {
7361 + var triggerInput = $settings.triggerInputId;
7362 + $(document).ajaxComplete(function (event, jqxhr, settings) {
7363 + if (!$couponExecuted) {
7364 + if ((triggerInput !== false) && ($settings.triggerByAction === true)) {
7365 + var str = settings.data;
7366 + if (str.toLowerCase().indexOf(triggerInput.substring(1)) >= 0) {
7367 + couponObj.formSubmitted();
7368 + }
7369 + } else {
7370 + if ($settings.triggerByAction === true) {
7371 + couponObj.formSubmitted();
7372 + }
7373 + }
7374 + }
7375 +
7376 + });
7377 +
7378 + }
7379 +
7380 + };
7381 +
7382 + jQuery(window).on('elementor/frontend/init', function () {
7383 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-coupon-code.default', widgetCoupon);
7384 + });
7385 +
7386 + }(jQuery, window.elementorFrontend));
7387 +
7388 + /**
7389 + * End coupon reveal widget script
7390 + */
7391 + /**
7392 + * Start custom carousel widget script
7393 + */
7394 +
7395 + ( function( $, elementor ) {
7396 +
7397 + 'use strict';
7398 +
7399 + var widgetCustomCarousel = function( $scope, $ ) {
7400 +
7401 + var $carousel = $scope.find( '.bdt-ep-custom-carousel' );
7402 +
7403 + if ( ! $carousel.length ) {
7404 + return;
7405 + }
7406 +
7407 + var $carouselContainer = $carousel.find('.swiper-carousel'),
7408 + $settings = $carousel.data('settings');
7409 +
7410 + const Swiper = elementorFrontend.utils.swiper;
7411 + initSwiper();
7412 + async function initSwiper() {
7413 + var swiper = await new Swiper($carouselContainer, $settings);
7414 +
7415 + if ($settings.pauseOnHover) {
7416 + $($carouselContainer).hover(function () {
7417 + (this).swiper.autoplay.stop();
7418 + }, function () {
7419 + (this).swiper.autoplay.start();
7420 + });
7421 + }
7422 + };
7423 +
7424 + };
7425 +
7426 +
7427 + jQuery(window).on('elementor/frontend/init', function() {
7428 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-custom-carousel.default', widgetCustomCarousel );
7429 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-custom-carousel.bdt-custom-content', widgetCustomCarousel );
7430 + });
7431 +
7432 + }( jQuery, window.elementorFrontend ) );
7433 +
7434 + /**
7435 + * End custom carousel widget script
7436 + */
7437 +
7438 +
7439 + (function ($, elementor) {
7440 +
7441 + 'use strict';
7442 +
7443 + var widgetCarousel = function ($scope, $) {
7444 +
7445 + var $carousel = $scope.find('.bdt-dynamic-carousel');
7446 + if (!$carousel.length) {
7447 + return;
7448 + }
7449 +
7450 + var $carouselContainer = $carousel.find('.swiper-carousel'),
7451 + $settings = $carousel.data('settings');
7452 +
7453 + const Swiper = elementorFrontend.utils.swiper;
7454 + initSwiper();
7455 + async function initSwiper() {
7456 + var swiper = await new Swiper($carouselContainer, $settings);
7457 +
7458 + if ($settings.pauseOnHover) {
7459 + $($carouselContainer).hover(function () {
7460 + (this).swiper.autoplay.stop();
7461 + }, function () {
7462 + (this).swiper.autoplay.start();
7463 + });
7464 + }
7465 +
7466 + };
7467 +
7468 + };
7469 +
7470 +
7471 + jQuery(window).on('elementor/frontend/init', function () {
7472 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-dynamic-carousel.default', widgetCarousel);
7473 +
7474 + });
7475 +
7476 + }(jQuery, window.elementorFrontend));
7477 + ;
7478 + (function ($, elementor) {
7479 + 'use strict';
7480 + $(window).on('elementor/frontend/init', function () {
7481 +
7482 + var ModuleHandler = elementorModules.frontend.handlers.Base,
7483 + BackgroundExpand;
7484 +
7485 + BackgroundExpand = ModuleHandler.extend({
7486 +
7487 + bindEvents: function () {
7488 + this.run();
7489 + },
7490 +
7491 + getDefaultSettings: function () {
7492 + return {
7493 + direction: 'alternate',
7494 + };
7495 + },
7496 +
7497 + settings: function (key) {
7498 + return this.getElementSettings('ep_bg_expand_' + key);
7499 + },
7500 +
7501 + onElementChange: debounce(function (prop) {
7502 + if (prop.indexOf('ep_bg_expand_') !== -1) {
7503 + this.run();
7504 + }
7505 + }, 400),
7506 +
7507 + run: function () {
7508 + var options = this.getDefaultSettings(),
7509 + element = this.$element.get(0);
7510 +
7511 + if ('yes' !== this.settings('enable')) {
7512 + return;
7513 + }
7514 +
7515 + if (this.settings('selector')) {
7516 + element = this.settings('selector');
7517 + }
7518 +
7519 + function initClass(e) {
7520 + $(element).addClass(e);
7521 + }
7522 +
7523 + function terminateClass(e) {
7524 + $(element).removeClass(e);
7525 + }
7526 +
7527 + var tl = gsap.timeline({
7528 + scrollTrigger: {
7529 + // markers : true,
7530 + trigger : $(element),
7531 + start : "top center",
7532 + end : '100% bottom',
7533 + toggleActions: "restart none none reverse",
7534 + onEnter : () => initClass("bdt-bx-active"),
7535 + onEnterBack : () => terminateClass("bdt-bx-active"),
7536 + }
7537 + });
7538 +
7539 + }
7540 + });
7541 +
7542 + elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) {
7543 + elementorFrontend.elementsHandler.addHandler(BackgroundExpand, {
7544 + $element: $scope
7545 + });
7546 + });
7547 +
7548 + elementorFrontend.hooks.addAction('frontend/element_ready/container', function ($scope) {
7549 + elementorFrontend.elementsHandler.addHandler(BackgroundExpand, {
7550 + $element: $scope
7551 + });
7552 + });
7553 +
7554 + });
7555 + }(jQuery, window.elementorFrontend));
7556 + /**
7557 + * Start webhook form widget script
7558 + */
7559 +
7560 + (function ($, elementor) {
7561 + "use strict";
7562 + var widgetWebhookForm = function ($scope, $) {
7563 + var $formWrapper = $scope.find(".bdt-ep-webhook-form.without-recaptcha"),
7564 + $form = $formWrapper.find(".bdt-ep-webhook-form-form"),
7565 + $settings = $formWrapper.data("settings");
7566 +
7567 + if (!$formWrapper.length) {
7568 + return;
7569 + }
7570 +
7571 + $($settings.id).find(".bdt-ep-webhook-form-form").on('submit', function (e) {
7572 + e.preventDefault();
7573 + send_form_data($form);
7574 + });
7575 + };
7576 +
7577 + function send_form_data(form) {
7578 + var langStr = window.ElementPackConfig.contact_form;
7579 +
7580 + var formData = $(form).serialize();
7581 + formData = formData + "&action=submit_webhook_form";
7582 + formData = formData + "&nonce=" + ElementPackConfig.nonce;
7583 +
7584 + $.ajax({
7585 + url: ElementPackConfig.ajaxurl,
7586 + type: "post",
7587 + data: formData,
7588 + beforeSend: function () {
7589 + bdtUIkit.notification({
7590 + message: "<div bdt-spinner></div> " + langStr.sending_msg,
7591 + timeout: false,
7592 + status: "primary",
7593 + });
7594 + },
7595 + success: function (res) {
7596 + let response = JSON.parse(res);
7597 + bdtUIkit.notification.closeAll();
7598 +
7599 + if (true == response.success) {
7600 + bdtUIkit.notification({
7601 + message: '<div bdt-icon="icon: check"></div> ' + response.message,
7602 + });
7603 + } else {
7604 + bdtUIkit.notification({
7605 + message: '<div bdt-icon="icon: close"></div> ' + response.message,
7606 + });
7607 + }
7608 + },
7609 + });
7610 + }
7611 +
7612 + // google invisible captcha
7613 + function elementPackWebFormGIC() {
7614 +
7615 + var langStr = window.ElementPackConfig.contact_form;
7616 +
7617 + return new Promise(function (resolve, reject) {
7618 +
7619 + if (grecaptcha === undefined) {
7620 + bdtUIkit.notification({
7621 + message: '<div bdt-spinner></div> ' + langStr.captcha_nd,
7622 + timeout: false,
7623 + status: 'warning'
7624 + });
7625 + reject();
7626 + }
7627 +
7628 + var response = grecaptcha.getResponse();
7629 +
7630 + if (!response) {
7631 + bdtUIkit.notification({
7632 + message: '<div bdt-spinner></div> ' + langStr.captcha_nr,
7633 + timeout: false,
7634 + status: 'warning'
7635 + });
7636 + reject();
7637 + }
7638 +
7639 + var $webhookForm = $('textarea.g-recaptcha-response').filter(function () {
7640 + return $(this).val() === response;
7641 + }).closest('form.bdt-ep-webhook-form-form');
7642 +
7643 + var contactFormAction = $webhookForm.attr('action');
7644 +
7645 + if (contactFormAction && contactFormAction !== '') {
7646 + send_form_data($webhookForm);
7647 + }
7648 +
7649 + grecaptcha.reset();
7650 +
7651 + }); //end promise
7652 +
7653 + }
7654 +
7655 + //Contact form recaptcha callback, if needed
7656 + window.elementPackWfGICCB = elementPackWebFormGIC;
7657 +
7658 + jQuery(window).on("elementor/frontend/init", function () {
7659 + elementorFrontend.hooks.addAction(
7660 + "frontend/element_ready/bdt-webhook-form.default",
7661 + widgetWebhookForm
7662 + );
7663 + });
7664 + })(jQuery, window.elementorFrontend);
7665 +
7666 + /**
7667 + * End webhook form widget script
7668 + */
7669 + (function ($, elementor) {
7670 +
7671 + 'use strict';
7672 +
7673 + $(window).on('elementor/frontend/init', function ($) {
7674 + var ModuleHandler = elementorModules.frontend.handlers.Base,
7675 + ScrollFillEffect;
7676 +
7677 + ScrollFillEffect = ModuleHandler.extend({
7678 +
7679 + bindEvents: function () {
7680 + this.run();
7681 + },
7682 + onElementChange: debounce(function (prop) {
7683 + if (prop.indexOf('ep_widget_sf_fx_') !== -1) {
7684 + this.run();
7685 + }
7686 + }, 400),
7687 + settings: function (key) {
7688 + return this.getElementSettings('ep_widget_sf_fx_' + key);
7689 + },
7690 + run: function () {
7691 + var $element = this.$element;
7692 +
7693 + if (this.settings('enable') !== 'yes') {
7694 + return;
7695 + }
7696 +
7697 + epObserveTarget($element[0], function () {
7698 + var $selector = jQuery($element).find('.elementor-heading-title, .bdt-heading-tag span, .bdt-ep-advanced-heading-main-title-inner');
7699 + gsap.to($selector, {
7700 + scrollTrigger: {
7701 + trigger: $selector,
7702 + start: "bottom center+=50%",
7703 + end: "bottom center",
7704 + scrub: true,
7705 + },
7706 + backgroundSize: '100% 200%',
7707 + });
7708 + }, {
7709 + root: null, // Use the viewport as the root
7710 + rootMargin: '0px', // No margin around the root
7711 + threshold: 0.8 // 80% visibility (1 - 0.8)
7712 + });
7713 +
7714 + }
7715 + });
7716 +
7717 + elementorFrontend.hooks.addAction('frontend/element_ready/heading.default', function ($scope) {
7718 + elementorFrontend.elementsHandler.addHandler(ScrollFillEffect, {
7719 + $element: $scope
7720 + });
7721 + });
7722 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-animated-heading.default', function ($scope) {
7723 + elementorFrontend.elementsHandler.addHandler(ScrollFillEffect, {
7724 + $element: $scope
7725 + });
7726 + });
7727 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-advanced-heading.default', function ($scope) {
7728 + elementorFrontend.elementsHandler.addHandler(ScrollFillEffect, {
7729 + $element: $scope
7730 + });
7731 + });
7732 + });
7733 +
7734 + }(jQuery, window.elementorFrontend));
7735 + /**
7736 + * Start EDD Category carousel widget script
7737 + */
7738 +
7739 + (function ($, elementor) {
7740 + "use strict";
7741 +
7742 + var widgetProductReviewCarousel = function ($scope, $) {
7743 + var $ProductReviewCarousel = $scope.find(".ep-edd-product-review-carousel");
7744 +
7745 + if (!$ProductReviewCarousel.length) {
7746 + return;
7747 + }
7748 +
7749 + var $ProductReviewCarouselContainer = $ProductReviewCarousel.find(".swiper-carousel"),
7750 + $settings = $ProductReviewCarousel.data("settings");
7751 +
7752 + const Swiper = elementorFrontend.utils.swiper;
7753 + initSwiper();
7754 + async function initSwiper() {
7755 + var swiper = await new Swiper($ProductReviewCarouselContainer, $settings); // this is an example
7756 + if ($settings.pauseOnHover) {
7757 + $($ProductReviewCarouselContainer).hover(
7758 + function () {
7759 + this.swiper.autoplay.stop();
7760 + },
7761 + function () {
7762 + this.swiper.autoplay.start();
7763 + }
7764 + );
7765 + }
7766 + }
7767 + };
7768 +
7769 + jQuery(window).on("elementor/frontend/init", function () {
7770 + elementorFrontend.hooks.addAction(
7771 + "frontend/element_ready/bdt-edd-product-review-carousel.default",
7772 + widgetProductReviewCarousel
7773 + );
7774 + });
7775 + })(jQuery, window.elementorFrontend);
7776 +
7777 + /**
7778 + * End twitter carousel widget script
7779 + */
7780 +
7781 + /**
7782 + * Start EDD Category carousel widget script
7783 + */
7784 +
7785 + (function ($, elementor) {
7786 + "use strict";
7787 +
7788 + var widgetEddCategoryCarousel = function ($scope, $) {
7789 + var $eddCategoryCarousel = $scope.find(".bdt-edd-category-carousel");
7790 +
7791 + if (!$eddCategoryCarousel.length) {
7792 + return;
7793 + }
7794 +
7795 + var $eddCategoryCarouselContainer = $eddCategoryCarousel.find(".swiper-carousel"),
7796 + $settings = $eddCategoryCarousel.data("settings");
7797 +
7798 + const Swiper = elementorFrontend.utils.swiper;
7799 + initSwiper();
7800 + async function initSwiper() {
7801 + var swiper = await new Swiper($eddCategoryCarouselContainer, $settings); // this is an example
7802 + if ($settings.pauseOnHover) {
7803 + $($eddCategoryCarouselContainer).hover(
7804 + function () {
7805 + this.swiper.autoplay.stop();
7806 + },
7807 + function () {
7808 + this.swiper.autoplay.start();
7809 + }
7810 + );
7811 + }
7812 + }
7813 + };
7814 +
7815 + jQuery(window).on("elementor/frontend/init", function () {
7816 + elementorFrontend.hooks.addAction(
7817 + "frontend/element_ready/bdt-edd-category-carousel.default",
7818 + widgetEddCategoryCarousel
7819 + );
7820 + });
7821 + })(jQuery, window.elementorFrontend);
7822 +
7823 + /**
7824 + * End twitter carousel widget script
7825 + */
7826 +
7827 + /**
7828 + * Start EDD product carousel widget script
7829 + */
7830 +
7831 + (function ($, elementor) {
7832 + "use strict";
7833 +
7834 + var widgetEddProductCarousel = function ($scope, $) {
7835 + var $eddProductCarousel = $scope.find(".bdt-edd-product-carousel");
7836 +
7837 + if (!$eddProductCarousel.length) {
7838 + return;
7839 + }
7840 +
7841 + var $eddProductCarouselContainer = $eddProductCarousel.find(".swiper-carousel"),
7842 + $settings = $eddProductCarousel.data("settings");
7843 +
7844 + const Swiper = elementorFrontend.utils.swiper;
7845 + initSwiper();
7846 + async function initSwiper() {
7847 + var swiper = await new Swiper($eddProductCarouselContainer, $settings); // this is an example
7848 + if ($settings.pauseOnHover) {
7849 + $($eddProductCarouselContainer).hover(
7850 + function () {
7851 + this.swiper.autoplay.stop();
7852 + },
7853 + function () {
7854 + this.swiper.autoplay.start();
7855 + }
7856 + );
7857 + }
7858 + }
7859 + };
7860 +
7861 + jQuery(window).on("elementor/frontend/init", function () {
7862 + elementorFrontend.hooks.addAction(
7863 + "frontend/element_ready/bdt-edd-product-carousel.default",
7864 + widgetEddProductCarousel
7865 + );
7866 + });
7867 + })(jQuery, window.elementorFrontend);
7868 +
7869 + /**
7870 + * End twitter carousel widget script
7871 + */
7872 +
7873 + /**
7874 + * Start EDD tabs widget script
7875 + */
7876 +
7877 + (function ($, elementor) {
7878 + 'use strict';
7879 + var widgetTabs = function ($scope, $) {
7880 + var $tabsArea = $scope.find('.bdt-tabs-area'),
7881 + $tabs = $tabsArea.find('.bdt-tabs'),
7882 + $tab = $tabs.find('.bdt-tab');
7883 + if (!$tabsArea.length) {
7884 + return;
7885 + }
7886 + var $settings = $tabs.data('settings');
7887 + var animTime = $settings.hashScrollspyTime;
7888 + var customOffset = $settings.hashTopOffset;
7889 + var navStickyOffset = $settings.navStickyOffset;
7890 + if (navStickyOffset == 'undefined') {
7891 + navStickyOffset = 10;
7892 + }
7893 +
7894 + $scope.find('.bdt-template-modal-iframe-edit-link').each(function () {
7895 + var modal = $($(this).data('modal-element'));
7896 + $(this).on('click', function (event) {
7897 + bdtUIkit.modal(modal).show();
7898 + });
7899 + modal.on('beforehide', function () {
7900 + window.parent.location.reload();
7901 + });
7902 + });
7903 +
7904 +
7905 + function hashHandler($tabs, $tab, animTime, customOffset) {
7906 + // debugger;
7907 + if (window.location.hash) {
7908 + if ($($tabs).find('[data-title="' + window.location.hash.substring(1) + '"]').length) {
7909 + var hashTarget = $('[data-title="' + window.location.hash.substring(1) + '"]').closest($tabs).attr('id');
7910 + $('html, body').animate({
7911 + easing: 'slow',
7912 + scrollTop: $('#' + hashTarget).offset().top - customOffset
7913 + }, animTime, function () {
7914 + //#code
7915 + }).promise().then(function () {
7916 + bdtUIkit.tab($tab).show($('[data-title="' + window.location.hash.substring(1) + '"]').data('tab-index'));
7917 + });
7918 + }
7919 + }
7920 + }
7921 + if ($settings.activeHash == 'yes' && $settings.status != 'bdt-sticky-custom') {
7922 + $(window).on('load', function () {
7923 + hashHandler($tabs, $tab, animTime, customOffset);
7924 + });
7925 + $($tabs).find('.bdt-tabs-item-title').off('click').on('click', function (event) {
7926 + window.location.hash = ($.trim($(this).attr('data-title')));
7927 + });
7928 + $(window).on('hashchange', function (e) {
7929 + hashHandler($tabs, $tab, animTime, customOffset);
7930 + });
7931 + }
7932 + //# code for sticky and also for sticky with hash
7933 + function stickyHachChange($tabs, $tab, navStickyOffset) {
7934 + if ($($tabs).find('[data-title="' + window.location.hash.substring(1) + '"]').length) {
7935 + var hashTarget = $('[data-title="' + window.location.hash.substring(1) + '"]').closest($tabs).attr('id');
7936 + $('html, body').animate({
7937 + easing: 'slow',
7938 + scrollTop: $('#' + hashTarget).offset().top - navStickyOffset
7939 + }, 1000, function () {
7940 + //#code
7941 + }).promise().then(function () {
7942 + bdtUIkit.tab($tab).show($($tab).find('[data-title="' + window.location.hash.substring(1) + '"]').data('tab-index'));
7943 + });
7944 + }
7945 + }
7946 + if ($settings.status == 'bdt-sticky-custom') {
7947 + $($tabs).find('.bdt-tabs-item-title').bind().click('click', function (event) {
7948 + if ($settings.activeHash == 'yes') {
7949 + window.location.hash = ($.trim($(this).attr('data-title')));
7950 + } else {
7951 + $('html, body').animate({
7952 + easing: 'slow',
7953 + scrollTop: $($tabs).offset().top - navStickyOffset
7954 + }, 500, function () {
7955 + //#code
7956 + });
7957 + }
7958 + });
7959 + // # actived Hash#
7960 + if ($settings.activeHash == 'yes' && $settings.status == 'bdt-sticky-custom') {
7961 + $(window).on('load', function () {
7962 + if (window.location.hash) {
7963 + stickyHachChange($tabs, $tab, navStickyOffset);
7964 + }
7965 + });
7966 + $(window).on('hashchange', function (e) {
7967 + stickyHachChange($tabs, $tab, navStickyOffset);
7968 + });
7969 + }
7970 + }
7971 +
7972 + // start linkWidget
7973 + var editMode = Boolean(elementorFrontend.isEditMode());
7974 + var $linkWidget = $settings['linkWidgetSettings'],
7975 + $activeItem = ($settings['activeItem']) - 1;
7976 + if ($linkWidget !== undefined && editMode === false) {
7977 +
7978 + $linkWidget.forEach(function (entry, index) {
7979 +
7980 + if (index == 0) {
7981 + $('#bdt-tab-content-'+$settings['linkWidgetId']).parent().remove();
7982 + $(entry).parent().wrapInner('<div class="bdt-switcher-wrapper" />');
7983 + $(entry).parent().wrapInner('<div id="bdt-tab-content-'+$settings['linkWidgetId']+'" class="bdt-switcher bdt-switcher-item-content" />');
7984 +
7985 + if($settings['activeItem'] == undefined){
7986 + $(entry).addClass('bdt-active');
7987 + }
7988 + }
7989 +
7990 + if($settings['activeItem'] !== undefined && index == $activeItem){
7991 + $(entry).addClass('bdt-active');
7992 + }
7993 +
7994 + $(entry).attr('data-content-id', "tab-" + (index + 1));
7995 +
7996 + });
7997 +
7998 + }
7999 + // end linkWidget
8000 +
8001 +
8002 + };
8003 + jQuery(window).on('elementor/frontend/init', function () {
8004 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-edd-tabs.default', widgetTabs);
8005 + });
8006 + }(jQuery, window.elementorFrontend));
8007 +
8008 + /**
8009 + * End tabs widget script
8010 + */
8011 +
8012 +
8013 +
8014 + /**
8015 + * Start event calendar widget script
8016 + */
8017 +
8018 + (function($, elementor) {
8019 +
8020 + 'use strict';
8021 +
8022 + var widgetEventCarousel = function($scope, $) {
8023 + var $eventCarousel = $scope.find('.bdt-event-calendar');
8024 +
8025 + if (!$eventCarousel.length) {
8026 + return;
8027 + }
8028 +
8029 + var $eventCarouselContainer = $eventCarousel.find('.swiper-carousel'),
8030 + $settings = $eventCarousel.data('settings');
8031 + const Swiper = elementorFrontend.utils.swiper;
8032 + initSwiper();
8033 + async function initSwiper() {
8034 + var swiper = await new Swiper($eventCarouselContainer, $settings);
8035 +
8036 + if ($settings.pauseOnHover) {
8037 + $($eventCarouselContainer).hover(function () {
8038 + (this).swiper.autoplay.stop();
8039 + }, function () {
8040 + (this).swiper.autoplay.start();
8041 + });
8042 + }
8043 + };
8044 +
8045 + };
8046 +
8047 +
8048 + jQuery(window).on('elementor/frontend/init', function() {
8049 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-event-carousel.default', widgetEventCarousel);
8050 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-event-carousel.fable', widgetEventCarousel);
8051 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-event-carousel.altra', widgetEventCarousel);
8052 + });
8053 +
8054 + }(jQuery, window.elementorFrontend));
8055 +
8056 + /**
8057 + * End event calendar widget script
8058 + */
8059 +
8060 +
8061 + /**
8062 + * Start fancy slider widget script
8063 + */
8064 +
8065 + (function ($, elementor) {
8066 +
8067 + 'use strict';
8068 +
8069 + var widgetFancySlider = function ($scope, $) {
8070 +
8071 + var $slider = $scope.find('.bdt-ep-fancy-slider');
8072 +
8073 + if (!$slider.length) {
8074 + return;
8075 + }
8076 +
8077 + var $sliderContainer = $slider.find('.swiper-carousel'),
8078 + $settings = $slider.data('settings');
8079 +
8080 + const Swiper = elementorFrontend.utils.swiper;
8081 + initSwiper();
8082 + async function initSwiper() {
8083 + var swiper = await new Swiper($sliderContainer, $settings);
8084 +
8085 + if ($settings.pauseOnHover) {
8086 + $($sliderContainer).hover(function () {
8087 + (this).swiper.autoplay.stop();
8088 + }, function () {
8089 + (this).swiper.autoplay.start();
8090 + });
8091 + }
8092 + };
8093 + };
8094 +
8095 + jQuery(window).on('elementor/frontend/init', function () {
8096 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-fancy-slider.default', widgetFancySlider);
8097 + });
8098 +
8099 + }(jQuery, window.elementorFrontend));
8100 +
8101 + /**
8102 + * End fancy slider widget script
8103 + */
8104 + /**
8105 + * Start fancy tabs widget script
8106 + */
8107 +
8108 + (function($, elementor) {
8109 +
8110 + 'use strict';
8111 +
8112 + var widgetFancyTabs = function($scope, $) {
8113 +
8114 +
8115 + var $fancyTabs = $scope.find('.bdt-ep-fancy-tabs'),
8116 + $settings = $fancyTabs.data('settings');
8117 +
8118 + var iconBx = document.querySelectorAll('#' + $settings.tabs_id + ' .bdt-ep-fancy-tabs-item');
8119 + var contentBx = document.querySelectorAll('#' + $settings.tabs_id + ' .bdt-ep-fancy-tabs-content');
8120 +
8121 + for (var i = 0; i < iconBx.length; i++) {
8122 + iconBx[i].addEventListener($settings.mouse_event, function() {
8123 + for (var i = 0; i < contentBx.length; i++) {
8124 + contentBx[i].className = 'bdt-ep-fancy-tabs-content';
8125 + }
8126 + document.getElementById(this.dataset.id).className = 'bdt-ep-fancy-tabs-content active';
8127 +
8128 + for (var i = 0; i < iconBx.length; i++) {
8129 + iconBx[i].className = 'bdt-ep-fancy-tabs-item';
8130 + }
8131 + this.className = 'bdt-ep-fancy-tabs-item active';
8132 +
8133 + });
8134 + }
8135 +
8136 + };
8137 +
8138 +
8139 + jQuery(window).on('elementor/frontend/init', function() {
8140 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-fancy-tabs.default', widgetFancyTabs);
8141 + });
8142 +
8143 + }(jQuery, window.elementorFrontend));
8144 +
8145 + /**
8146 + * End fancy tabs widget script
8147 + */
8148 +
8149 +
8150 + /**
8151 + * Start faq widget script
8152 + */
8153 +
8154 + (function($, elementor) {
8155 + 'use strict';
8156 + var widgetPostGallery = function($scope, $) {
8157 + var $faqWrapper = $scope.find('.bdt-faq-wrapper'),
8158 + $faqFilter = $faqWrapper.find('.bdt-ep-grid-filters-wrapper');
8159 + if (!$faqFilter.length) {
8160 + return;
8161 + }
8162 + var $settings = $faqFilter.data('hash-settings');
8163 + var activeHash = $settings.activeHash;
8164 + var hashTopOffset = $settings.hashTopOffset;
8165 + var hashScrollspyTime = $settings.hashScrollspyTime;
8166 +
8167 + function hashHandler($faqFilter, hashScrollspyTime, hashTopOffset) {
8168 + if (window.location.hash) {
8169 + if ($($faqFilter).find('[bdt-filter-control="[data-filter*=\'bdtf-' + window.location.hash.substring(1) + '\']"]').length) {
8170 + var hashTarget = $('[bdt-filter-control="[data-filter*=\'bdtf-' + window.location.hash.substring(1) + '\']"]').closest($faqFilter).attr('id');
8171 + $('html, body').animate({
8172 + easing: 'slow',
8173 + scrollTop: $('#' + hashTarget).offset().top - hashTopOffset
8174 + }, hashScrollspyTime, function() {
8175 + //#code
8176 + }).promise().then(function() {
8177 + $('[bdt-filter-control="[data-filter*=\'bdtf-' + window.location.hash.substring(1) + '\']"]').trigger("click");
8178 + });
8179 + }
8180 + }
8181 + }
8182 +
8183 + if ($settings.activeHash == 'yes') {
8184 + $(window).on('load', function() {
8185 + hashHandler($faqFilter, hashScrollspyTime = 1500, hashTopOffset);
8186 + });
8187 + $($faqFilter).find('.bdt-ep-grid-filter').off('click').on('click', function(event) {
8188 + window.location.hash = ($.trim($(this).context.innerText.toLowerCase())).replace(/\s+/g, '-');
8189 + // hashHandler( $faqFilter, hashScrollspyTime, hashTopOffset);
8190 + });
8191 + $(window).on('hashchange', function(e) {
8192 + hashHandler($faqFilter, hashScrollspyTime, hashTopOffset);
8193 + });
8194 + }
8195 + };
8196 + jQuery(window).on('elementor/frontend/init', function() {
8197 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-faq.default', widgetPostGallery);
8198 + });
8199 + }(jQuery, window.elementorFrontend));
8200 +
8201 + /**
8202 + * End faq widget script
8203 + */
8204 +
8205 +
8206 + /**
8207 + * Start helpdesk widget script
8208 + */
8209 +
8210 + ( function( $, elementor ) {
8211 +
8212 + 'use strict';
8213 +
8214 + var widgetHelpDesk = function( $scope, $ ) {
8215 +
8216 + var $helpdesk = $scope.find( '.bdt-helpdesk' ),
8217 + $helpdeskTooltip = $helpdesk.find('.bdt-helpdesk-icons');
8218 +
8219 + if ( ! $helpdesk.length ) {
8220 + return;
8221 + }
8222 +
8223 + var $tooltip = $helpdeskTooltip.find('> .bdt-tippy-tooltip'),
8224 + widgetID = $scope.data('id');
8225 +
8226 + $tooltip.each( function( index ) {
8227 + tippy( this, {
8228 + allowHTML: true,
8229 + theme: 'bdt-tippy-' + widgetID
8230 + });
8231 + });
8232 +
8233 + };
8234 +
8235 +
8236 + jQuery(window).on('elementor/frontend/init', function() {
8237 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-helpdesk.default', widgetHelpDesk );
8238 + });
8239 +
8240 + }( jQuery, window.elementorFrontend ) );
8241 +
8242 + /**
8243 + * End helpdesk widget script
8244 + */
8245 +
8246 + /**
8247 + * Start honeycombs widget script
8248 + */
8249 +
8250 + (function($, elementor) {
8251 + 'use strict';
8252 + var widgetHoneycombs = function($scope, $) {
8253 + var $honeycombsArea = $scope.find('.bdt-honeycombs-area'),
8254 + $honeycombs = $honeycombsArea.find('.bdt-honeycombs');
8255 + if (!$honeycombsArea.length) {
8256 + return;
8257 + }
8258 + var $settings = $honeycombs.data('settings');
8259 +
8260 + $($honeycombs).honeycombs({
8261 + combWidth: $settings.width,
8262 + margin: $settings.margin,
8263 + threshold: 3,
8264 + widthTablet: $settings.width_tablet,
8265 + widthMobile : $settings.width_mobile,
8266 + viewportLg : $settings.viewport_lg,
8267 + viewportMd : $settings.viewport_md
8268 + });
8269 +
8270 + //loaded class for better showing
8271 + $($honeycombs).addClass('honeycombs-loaded');
8272 +
8273 +
8274 +
8275 + };
8276 + jQuery(window).on('elementor/frontend/init', function() {
8277 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-honeycombs.default', widgetHoneycombs);
8278 + });
8279 + }(jQuery, window.elementorFrontend));
8280 +
8281 + /**
8282 + * End honeycombs widget script
8283 + */
8284 +
8285 +
8286 + (function ($, elementor) {
8287 + $(window).on("elementor/frontend/init", function () {
8288 + const ModuleHandler = elementorModules.frontend.handlers.Base;
8289 +
8290 + class HorizontalScroller extends ModuleHandler {
8291 + bindEvents() {
8292 + this.run();
8293 + }
8294 +
8295 + getDefaultSettings() {
8296 + return {
8297 + allowHTML: true,
8298 + };
8299 + }
8300 +
8301 + settings(key) {
8302 + return this.getElementSettings(`horizontal_scroller_${key}`);
8303 + }
8304 +
8305 + sectionJoiner() {
8306 + const widgetID = this.$element.data("id");
8307 + const sectionList = this.settings("section_list");
8308 + const widgetWrapper = `.elementor-element-${widgetID} .bdt-ep-hc-wrapper`;
8309 +
8310 + const sectionIds = sectionList
8311 + .map((section) => `#${section.horizontal_scroller_section_id}`)
8312 + .filter((id) => document.querySelector(id));
8313 +
8314 + if (!sectionIds.length) return;
8315 +
8316 + const selectedElements = document.querySelectorAll(
8317 + sectionIds.join(", ")
8318 + );
8319 + $(widgetWrapper).append(selectedElements);
8320 + }
8321 +
8322 + horizontalScroller() {
8323 + gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
8324 +
8325 + const widgetID = this.$element.data("id");
8326 + const widgetWrapper = `.elementor-element-${widgetID} .bdt-ep-hc-wrapper`;
8327 + const scroller = document.querySelector(widgetWrapper);
8328 + const navLis = document.querySelectorAll(`${widgetWrapper} nav li`);
8329 +
8330 + let sections = gsap.utils.toArray(
8331 + `${widgetWrapper} > .elementor-element`
8332 + );
8333 + if (!sections.length) return;
8334 +
8335 + const numSections = sections.length - 1;
8336 + const snapVal = 1 / numSections;
8337 + const optionSnap = this.settings("auto_fill") ? snapVal : false;
8338 + let lastIndex = 0;
8339 +
8340 + const tween = gsap.to(sections, {
8341 + xPercent: -100 * numSections,
8342 + ease: "none",
8343 + scrollTrigger: {
8344 + trigger: widgetWrapper,
8345 + pin: true,
8346 + scrub: true,
8347 + snap: optionSnap,
8348 + end: () => `+=${scroller.scrollWidth - innerWidth}`,
8349 + onUpdate: (self) => {
8350 + const newIndex = Math.round(self.progress / snapVal);
8351 + if (this.settings("show_dots") && newIndex !== lastIndex) {
8352 + navLis[lastIndex].classList.remove("is-active");
8353 + navLis[newIndex].classList.add("is-active");
8354 + lastIndex = newIndex;
8355 + }
8356 + },
8357 + },
8358 + });
8359 +
8360 + navLis.forEach((anchor, i) => {
8361 + anchor.addEventListener("click", () => {
8362 + gsap.to(window, {
8363 + scrollTo: {
8364 + y: tween.scrollTrigger.start + i * innerWidth,
8365 + autoKill: false,
8366 + },
8367 + duration: 1,
8368 + });
8369 + });
8370 + });
8371 + }
8372 +
8373 + run() {
8374 + if (elementorFrontend.isEditMode()) return;
8375 +
8376 + const widgetID = this.$element.data("id");
8377 + const widgetContainer = `.elementor-element-${widgetID}`;
8378 +
8379 + ScrollTrigger.matchMedia({
8380 + "(min-width: 1024px)": () => {
8381 + $(widgetContainer).addClass("bdt-ep-hc-active");
8382 + this.sectionJoiner();
8383 + this.horizontalScroller();
8384 + },
8385 + "(max-width: 1023px)": () => {
8386 + $(widgetContainer).removeClass("bdt-ep-hc-active");
8387 + },
8388 + });
8389 + }
8390 + }
8391 +
8392 + elementorFrontend.hooks.addAction(
8393 + "frontend/element_ready/bdt-horizontal-scroller.default",
8394 + function ($scope) {
8395 + elementorFrontend.elementsHandler.addHandler(HorizontalScroller, {
8396 + $element: $scope,
8397 + });
8398 + }
8399 + );
8400 + });
8401 + })(jQuery, window.elementorFrontend);
8402 +
8403 + (function ($, elementor) {
8404 + $(window).on("elementor/frontend/init", function () {
8405 + let ModuleHandler = elementorModules.frontend.handlers.Base,
8406 + Stacker;
8407 +
8408 + Stacker = ModuleHandler.extend({
8409 + bindEvents: function () {
8410 + this.run();
8411 + },
8412 + getDefaultSettings: function () {
8413 + return {
8414 + allowHTML: true,
8415 + };
8416 + },
8417 +
8418 + settings: function (key) {
8419 + return this.getElementSettings("stacker_" + key);
8420 + },
8421 +
8422 + sectionJoiner: function () {
8423 + const widgetID = this.$element.data("id"),
8424 + sectionId = [],
8425 + sectionList = this.settings("section_list"),
8426 + widgetContainer = ".elementor-element-" + widgetID,
8427 + widgetWrapper = widgetContainer + " .bdt-ep-stacker";
8428 +
8429 + sectionList.forEach((section) => {
8430 + sectionId.push("#" + section.stacker_section_id);
8431 + });
8432 +
8433 + //check is id exists
8434 + let haveIds = [];
8435 + let elements;
8436 +
8437 + const topSection = document.querySelector(".elementor-top-section");
8438 + const eConElements = document.getElementsByClassName("e-con");
8439 +
8440 + if (topSection) {
8441 + // Code to handle 'elementor-top-section' existence
8442 + elements = document.querySelectorAll(".elementor-top-section");
8443 + }
8444 +
8445 + if (eConElements.length > 0) {
8446 + // Code to handle 'e-con' existence
8447 + elements = document.querySelectorAll(".elementor-element.e-con");
8448 + }
8449 +
8450 + elements.forEach((element) => {
8451 + var elementsWrapper = element.getAttribute("id");
8452 + haveIds.push("#" + elementsWrapper);
8453 + });
8454 +
8455 + function intersection(arr1, arr2) {
8456 + var temp = [];
8457 + for (var i in arr1) {
8458 + var element = arr1[i];
8459 +
8460 + if (arr2.indexOf(element) > -1) {
8461 + temp.push(element);
8462 + }
8463 + }
8464 + return temp;
8465 + }
8466 + function multi_intersect() {
8467 + var arrays = Array.prototype.slice.apply(arguments).slice(1);
8468 + var temp = arguments[0];
8469 + for (var i in arrays) {
8470 + temp = intersection(arrays[i], temp);
8471 + if (temp == []) {
8472 + break;
8473 + }
8474 + }
8475 + return temp;
8476 + }
8477 +
8478 + var ids = multi_intersect(haveIds, sectionId).toString();
8479 + if (ids) {
8480 + var selectedIDs = document.querySelectorAll(ids);
8481 + $(widgetWrapper).append(selectedIDs);
8482 + }
8483 + //check is id exists
8484 + },
8485 +
8486 + StackerOpacity: function () {},
8487 + StackerScript: function () {
8488 + gsap.registerPlugin(ScrollTrigger);
8489 + let cards;
8490 + const widgetID = this.$element.data("id"),
8491 + widgetContainer = ".elementor-element-" + widgetID;
8492 + let stickDistance = 0;
8493 + let opacityEnabled = this.settings("stacking_opacity") == 'yes' ? true : false;
8494 + let stackingSpace = this.settings("stacking_space")
8495 + ? this.settings("stacking_space").size
8496 + : 40;
8497 + let scrollerStart = this.settings("scroller_start")
8498 + ? this.settings("scroller_start").size + "%"
8499 + : "10%";
8500 +
8501 + // 3D effect settings
8502 + let use3DEffect = this.settings("3d_effect") == 'yes' ? true : false;
8503 + let scaleRatio = this.settings("scale_ratio")
8504 + ? this.settings("scale_ratio").size / 100
8505 + : 0.85;
8506 +
8507 + cards = gsap.utils.toArray(
8508 + widgetContainer + " .bdt-ep-stacker > .elementor-element"
8509 + );
8510 +
8511 + cards.forEach((card, i) => {
8512 + let lastCardST = ScrollTrigger.create({
8513 + trigger: cards[cards.length - 1],
8514 + start: `top-=${0 * i} ${scrollerStart}`,
8515 + });
8516 +
8517 + if(opacityEnabled) {
8518 + gsap.set(card, { opacity: 0 });
8519 + gsap.from(card, {
8520 + opacity: 1,
8521 + scrollTrigger: {
8522 + trigger: card,
8523 + scrub: true,
8524 + start: `top-=${stackingSpace * i} ${scrollerStart}`,
8525 + end: () => lastCardST.start + stickDistance,
8526 + },
8527 + ease: "none",
8528 + });
8529 + }
8530 +
8531 + // Apply 3D effect if enabled
8532 + if(use3DEffect) {
8533 + gsap.set(card, {
8534 + scale: 1,
8535 + y: 0,
8536 + transformOrigin: "center top",
8537 + zIndex: i + 1
8538 + });
8539 +
8540 + gsap.to(card, {
8541 + scale: Math.pow(scaleRatio, cards.length - 1 - i),
8542 + y: 0,
8543 + scrollTrigger: {
8544 + trigger: card,
8545 + scrub: true,
8546 + start: `top-=${stackingSpace * i} ${scrollerStart}`,
8547 + end: () => lastCardST.start + stickDistance,
8548 + },
8549 + ease: "none",
8550 + });
8551 + }
8552 +
8553 + ScrollTrigger.create({
8554 + trigger: card,
8555 + start: `top-=${stackingSpace * i} ${scrollerStart}`,
8556 + end: () => lastCardST.start + stickDistance,
8557 + endTrigger: cards[cards.length - 1],
8558 + pin: true,
8559 + pinSpacing: false,
8560 + ease: "none",
8561 + toggleActions: "restart none none reverse",
8562 + });
8563 + });
8564 + },
8565 +
8566 + run: function () {
8567 + const widgetID = this.$element.data("id"),
8568 + widgetContainer = ".elementor-element-" + widgetID,
8569 + widgetWrapper = widgetContainer + " .bdt-ep-stacker";
8570 +
8571 + var editMode = Boolean(elementorFrontend.isEditMode());
8572 + if (editMode) {
8573 + $(widgetWrapper).append(
8574 + '<div class="bdt-alert-warning" bdt-alert><a class="bdt-alert-close" bdt-close></a><p>Stacker Widget Placed Here (Only Visible for Editor).</p></div>'
8575 + );
8576 + return;
8577 + }
8578 + this.sectionJoiner();
8579 + this.StackerScript();
8580 + },
8581 + });
8582 +
8583 + elementorFrontend.hooks.addAction(
8584 + "frontend/element_ready/bdt-stacker.default",
8585 + function ($scope) {
8586 + elementorFrontend.elementsHandler.addHandler(Stacker, {
8587 + $element: $scope,
8588 + });
8589 + }
8590 + );
8591 + });
8592 + })(jQuery, window.elementorFrontend);
8593 +
8594 + /**
8595 + * Start hover box widget script
8596 + */
8597 +
8598 + (function($, elementor) {
8599 +
8600 + 'use strict';
8601 +
8602 + var widgetHoverBox = function($scope, $) {
8603 +
8604 +
8605 + var $hoverBox = $scope.find('.bdt-ep-hover-box'),
8606 + $settings = $hoverBox.data('settings');
8607 +
8608 + var iconBx = document.querySelectorAll('#' + $settings.box_id + ' .bdt-ep-hover-box-item');
8609 + var contentBx = document.querySelectorAll('#' + $settings.box_id + ' .bdt-ep-hover-box-content');
8610 +
8611 + for (var i = 0; i < iconBx.length; i++) {
8612 + iconBx[i].addEventListener($settings.mouse_event, function() {
8613 + for (var i = 0; i < contentBx.length; i++) {
8614 + contentBx[i].className = 'bdt-ep-hover-box-content'
8615 + }
8616 + document.getElementById(this.dataset.id).className = 'bdt-ep-hover-box-content active';
8617 +
8618 + for (var i = 0; i < iconBx.length; i++) {
8619 + iconBx[i].className = 'bdt-ep-hover-box-item';
8620 + }
8621 + this.className = 'bdt-ep-hover-box-item active';
8622 +
8623 + })
8624 + }
8625 +
8626 + };
8627 +
8628 + var widgetHoverBoxFlexure = function($scope, $) {
8629 + var $hoverBoxFlexure = $scope.find('.bdt-ep-hover-box'),
8630 + $settings = $hoverBoxFlexure.data('settings');
8631 +
8632 + var iconBox = $($hoverBoxFlexure).find('.bdt-ep-hover-box-item');
8633 +
8634 + $(iconBox).on($settings.mouse_event, function(){
8635 + var target = $(this).attr('data-id');
8636 + $('#'+target).siblings().removeClass('active');
8637 + $('[data-id="' + target + '"]').siblings().removeClass('active');
8638 + if($settings.mouse_event == 'click'){
8639 + $('#'+target).toggleClass('active');
8640 + $('[data-id="' + target + '"]').toggleClass('active');
8641 + $('[data-id="' + target + '"]').siblings().addClass('invisiable');
8642 + $($hoverBoxFlexure).find('.bdt-ep-hover-box-item.invisiable').on('click', function(){
8643 + $('[data-id="' + target + '"]').siblings().addClass('invisiable');
8644 + $('[data-id="' + target + '"]').addClass('invisiable');
8645 + });
8646 + $($hoverBoxFlexure).find('.bdt-ep-hover-box-item.active').on('click', function(){
8647 + $('[data-id="' + target + '"]').siblings().removeClass('invisiable');
8648 + $('[data-id="' + target + '"]').removeClass('invisiable');
8649 + });
8650 +
8651 + }else{
8652 + $('#'+target).addClass('active');
8653 + $('[data-id="' + target + '"]').addClass('active');
8654 + $('[data-id="' + target + '"]').siblings().addClass('invisiable');
8655 + }
8656 + });
8657 + if($settings.mouse_event == 'mouseover'){
8658 + $(iconBox).on('mouseleave', function(){
8659 + var target = $(this).attr('data-id');
8660 + $('#'+target).siblings().removeClass('active');
8661 + $('#'+target).removeClass('active');
8662 + $('[data-id="' + target + '"]').siblings().removeClass('active');
8663 + $('[data-id="' + target + '"]').removeClass('active');
8664 + $('[data-id="' + target + '"]').siblings().removeClass('invisiable');
8665 + });
8666 + }
8667 +
8668 + };
8669 +
8670 + jQuery(window).on('elementor/frontend/init', function() {
8671 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-hover-box.default', widgetHoverBox);
8672 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-hover-box.bdt-envelope', widgetHoverBox);
8673 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-hover-box.bdt-flexure', widgetHoverBoxFlexure);
8674 + });
8675 +
8676 + }(jQuery, window.elementorFrontend));
8677 +
8678 + /**
8679 + * End hover box widget script
8680 + */
8681 +
8682 +
8683 + /**
8684 + * Start hover video widget script
8685 + */
8686 +
8687 + (function ($, elementor) {
8688 + 'use strict';
8689 +
8690 + // check video buffer
8691 +
8692 + function videoBufferChecker(videoId) {
8693 + var checkInterval = 50.0; // check every 50 ms (do not use lower values)
8694 + var lastPlayPos = 0;
8695 + var currentPlayPos = 0;
8696 + var bufferingDetected = false;
8697 + var player = document.getElementById(videoId);
8698 +
8699 + setInterval(checkBuffering, checkInterval)
8700 +
8701 + function checkBuffering() {
8702 + currentPlayPos = player.currentTime;
8703 +
8704 + // checking offset should be at most the check interval
8705 + // but allow for some margin
8706 + var offset = (checkInterval - 20) / 2000;
8707 +
8708 + // if no buffering is currently detected,
8709 + // and the position does not seem to increase
8710 + // and the player isn't manually paused...
8711 + if (!bufferingDetected &&
8712 + currentPlayPos < (lastPlayPos + offset) &&
8713 + !player.paused
8714 + ) {
8715 + // console.log("buffering = " + videoId);
8716 + $('#' + videoId).closest('.bdt-hover-video').find('.hover-video-loader').addClass('active');
8717 +
8718 + bufferingDetected = true;
8719 + }
8720 +
8721 + // if we were buffering but the player has advanced,
8722 + // then there is no buffering
8723 + if (
8724 + bufferingDetected &&
8725 + currentPlayPos > (lastPlayPos + offset) &&
8726 + !player.paused
8727 + ) {
8728 + // console.log("not buffering anymore = " + videoId);
8729 + $('#' + videoId).closest('.bdt-hover-video').find('.hover-video-loader').removeClass('active');
8730 + bufferingDetected = false
8731 + }
8732 + lastPlayPos = currentPlayPos
8733 +
8734 +
8735 + }
8736 + }
8737 +
8738 +
8739 + var widgetDefaultSkin = function ($scope, $) {
8740 + var $instaVideo = $scope.find('.bdt-hover-video'),
8741 + $settings = $instaVideo.data('settings');
8742 +
8743 + if (!$instaVideo.length) {
8744 + return;
8745 + }
8746 +
8747 + var video = $($instaVideo).find('.bdt-hover-wrapper-list video');
8748 + var videoProgress;
8749 + setInterval(function () {
8750 + videoProgress = $('.bdt-hover-progress.active');
8751 + }, 100);
8752 +
8753 + $(video).on('mouseenter click', function (e) {
8754 +
8755 + if ($settings.videoReplay == 'yes') {
8756 + $(this)[0].currentTime = 0;
8757 + }
8758 +
8759 + $(this).trigger('play');
8760 +
8761 + videoBufferChecker($(this).attr('id'));
8762 +
8763 + var video = $($instaVideo).find('.bdt-hover-video .bdt-hover-wrapper-list video');
8764 +
8765 + var thisId = $(this).attr('id');
8766 +
8767 + $('#' + thisId).on('ended', function () {
8768 + setTimeout(function (a) {
8769 + $('#' + thisId).trigger('play');
8770 +
8771 + videoBufferChecker(thisId);
8772 +
8773 + }, 1500);
8774 + });
8775 + });
8776 +
8777 +
8778 + $(video).on('mouseout', function (e) {
8779 + // $(this).trigger('pause');
8780 +
8781 + if ($settings.posterAgain == 'yes') {
8782 + $(this)[0].currentTime = 0;
8783 + $(this).trigger('load');
8784 + } else {
8785 + $(this).trigger('pause');
8786 + }
8787 + });
8788 +
8789 + $(video).on('timeupdate', function () {
8790 + var videoBarList = $(video).parent().find('video.active').attr('id');
8791 + var ct = document.getElementById(videoBarList).currentTime;
8792 + var dur = document.getElementById(videoBarList).duration;
8793 +
8794 + var videoProgressPos = ct / dur;
8795 + $($instaVideo).find('.bdt-hover-bar-list').find("[data-id=" + videoBarList + "]").width(videoProgressPos * 100 + "%");
8796 + $($instaVideo).find('.bdt-hover-btn-wrapper').find(".bdt-hover-progress[data-id=" + videoBarList + "]").width(videoProgressPos * 100 + "%");
8797 +
8798 + // if (video.ended) {
8799 + // }
8800 +
8801 +
8802 + });
8803 +
8804 + if ($($instaVideo).find('.autoplay').length > 0) {
8805 + $($instaVideo).find(".bdt-hover-wrapper-list video:first-child").trigger('play');
8806 +
8807 + }
8808 +
8809 + if ($($instaVideo).find('.autoplay').length > 0) {
8810 + var playingVideo = $(video).parent().find('video.active');
8811 +
8812 + $(video).on('timeupdate', function () {
8813 + playingVideo = $(video).parent().find('video.active');
8814 + });
8815 +
8816 + setInterval(function () {
8817 + $(playingVideo).on('ended', function () {
8818 +
8819 + var nextVideoId = $(playingVideo).next().attr('id');
8820 +
8821 + $('#' + nextVideoId).siblings().css("display", 'none').removeClass('active');
8822 + $('#' + nextVideoId).css("display", 'block').addClass('active');
8823 +
8824 + $('#' + nextVideoId).trigger('play');
8825 +
8826 +
8827 + if ($(playingVideo).next('video').length > 0) {
8828 + var firstVideo = $(playingVideo).siblings().first().attr('id');
8829 + $($instaVideo).find("[data-id=" + firstVideo + "]").closest('.bdt-hover-bar-list').find('.bdt-hover-progress').width(0 + '%');
8830 +
8831 + $($instaVideo).find('.bdt-hover-btn-wrapper').find("[data-id=" + nextVideoId + "]").siblings().removeClass('active');
8832 + $($instaVideo).find('.bdt-hover-btn-wrapper').find("[data-id=" + nextVideoId + "]").addClass('active');
8833 +
8834 + $($instaVideo).find('.bdt-hover-btn-wrapper').find(".bdt-hover-progress").width("0%");
8835 +
8836 + } else {
8837 + var firstVideo = $(playingVideo).siblings().first().attr('id');
8838 + // console.log("Dont exists"+firstVideo);
8839 + $('#' + firstVideo).siblings().css("display", 'none').removeClass('active');
8840 + $('#' + firstVideo).css("display", 'block').addClass('active');
8841 + $($instaVideo).find("[data-id=" + firstVideo + "]").closest('.bdt-hover-bar-list').find('.bdt-hover-progress').width(0 + '%');
8842 +
8843 +
8844 + $($instaVideo).find('.bdt-hover-btn-wrapper').find("[data-id=" + firstVideo + "]").siblings().removeClass('active');
8845 + $($instaVideo).find('.bdt-hover-btn-wrapper').find("[data-id=" + firstVideo + "]").addClass('active');
8846 +
8847 + $($instaVideo).find('.bdt-hover-btn-wrapper').find(".bdt-hover-progress").width("0%");
8848 +
8849 + $('#' + firstVideo).trigger('play');
8850 +
8851 + }
8852 +
8853 + });
8854 + }, 1000);
8855 +
8856 + }
8857 +
8858 + $('#' + $settings.id).find('.bdt-hover-btn').on('mouseenter click', function () {
8859 + var videoId = $(this).attr('data-id');
8860 +
8861 + if ($settings.videoReplay == 'yes') {
8862 + $('#' + videoId)[0].currentTime = 0;
8863 + }
8864 +
8865 + $('#' + videoId).trigger('play');
8866 +
8867 + videoBufferChecker(videoId);
8868 +
8869 + $('#' + videoId).siblings().css("display", 'none').removeClass('active');
8870 + $('#' + videoId).css("display", 'block').addClass('active');
8871 + $('.bdt-hover-bar-list .bdt-hover-progress').removeClass('active');
8872 + $('.bdt-hover-bar-list').find("[data-id=" + videoId + "]").addClass('active');
8873 +
8874 + $('.bdt-hover-btn-wrapper').find("[data-id=" + videoId + "]")
8875 + .siblings().removeClass('active');
8876 + $('.bdt-hover-btn-wrapper').find("[data-id=" + videoId + "]")
8877 + .addClass('active');
8878 +
8879 +
8880 + });
8881 +
8882 +
8883 +
8884 +
8885 + };
8886 +
8887 + var widgetVideoAccordion = function ($scope, $) {
8888 + var $videoAccordion = $scope.find('.bdt-hover-video'),
8889 + $settings = $videoAccordion.data('settings');
8890 +
8891 + if (!$videoAccordion.length) {
8892 + return;
8893 + }
8894 +
8895 + var video = $($videoAccordion).find('.bdt-hover-wrapper-list video');
8896 +
8897 + var videoProgress;
8898 + setInterval(function () {
8899 + videoProgress = $('.bdt-hover-progress.active');
8900 + }, 100);
8901 +
8902 + $(video).on('timeupdate', function () {
8903 + var videoBarList = $(video).parent().find('video.active').attr('id');
8904 + var ct = document.getElementById(videoBarList).currentTime;
8905 + var dur = document.getElementById(videoBarList).duration;
8906 + var videoProgressPos = ct / dur;
8907 + $('.bdt-hover-bar-list').find("[data-id=" + videoBarList + "]").width(videoProgressPos * 100 + "%");
8908 + // if (video.ended) {
8909 + // }
8910 + });
8911 +
8912 + // start autoplay
8913 + if ($($videoAccordion).find('.autoplay').length > 0) {
8914 + $($videoAccordion).find(".hover-video-list video:first-child").trigger('play');
8915 + }
8916 +
8917 + if ($($videoAccordion).find('.autoplay').length > 0) {
8918 + var playingVideo = $(video).parent().find('video.active');
8919 +
8920 + $(video).on('timeupdate', function () {
8921 + playingVideo = $(video).parent().find('video.active');
8922 + });
8923 +
8924 + setInterval(function () {
8925 + $(playingVideo).on('ended', function () {
8926 +
8927 + var nextVideoId = $(playingVideo).next().attr('id');
8928 +
8929 + $('#' + nextVideoId).siblings().css("display", 'none').removeClass('active');
8930 + $('#' + nextVideoId).css("display", 'block').addClass('active');
8931 +
8932 + // console.log('playingVideo = '+ $(playingVideo).attr('id'));
8933 +
8934 + $('#' + nextVideoId).trigger('play');
8935 +
8936 + if ($(playingVideo).next('video').length > 0) {
8937 + // console.log("Exists");
8938 + var firstVideo = $(playingVideo).siblings().first().attr('id');
8939 + $($videoAccordion).find("[data-id=" + firstVideo + "]").closest('.bdt-hover-bar-list').find('.bdt-hover-progress').width(0 + '%');
8940 +
8941 + } else {
8942 + var firstVideo = $(playingVideo).siblings().first().attr('id');
8943 + // console.log("Dont exists"+firstVideo);
8944 + $('#' + firstVideo).siblings().css("display", 'none').removeClass('active');
8945 + $('#' + firstVideo).css("display", 'block').addClass('active');
8946 + $($videoAccordion).find("[data-id=" + firstVideo + "]").closest('.bdt-hover-bar-list').find('.bdt-hover-progress').width(0 + '%');
8947 +
8948 +
8949 +
8950 + $('#' + firstVideo).trigger('play');
8951 + }
8952 +
8953 + });
8954 + }, 1000);
8955 +
8956 + }
8957 + // end autoplay
8958 +
8959 + $('#' + $settings.id).find('.bdt-hover-mask-list .bdt-hover-mask').on('mouseenter click', function () {
8960 + var videoId = $(this).attr('data-id');
8961 + $('#' + videoId).siblings().css("display", 'none').removeClass('active');
8962 + $('#' + videoId).css("display", 'block').addClass('active');
8963 + $('#' + videoId).siblings().trigger('pause'); // play item on active
8964 +
8965 + if ($settings.videoReplay == 'yes') {
8966 + $('#' + videoId)[0].currentTime = 0;
8967 +
8968 + }
8969 +
8970 + $('#' + videoId).trigger('play'); // play item on active
8971 +
8972 + videoBufferChecker(videoId);
8973 +
8974 + $('.bdt-hover-bar-list .bdt-hover-progress').removeClass('active');
8975 + $('.bdt-hover-bar-list').find("[data-id=" + videoId + "]").addClass('active');
8976 +
8977 + $('.bdt-hover-mask-list').find("[data-id=" + videoId + "]")
8978 + .siblings().removeClass('active');
8979 + $('.bdt-hover-mask-list').find("[data-id=" + videoId + "]")
8980 + .addClass('active');
8981 +
8982 +
8983 + $('#' + videoId).on('ended', function () {
8984 + setTimeout(function (a) {
8985 + $('#' + videoId).trigger('play');
8986 +
8987 + videoBufferChecker(videoId);
8988 +
8989 + }, 1500);
8990 + });
8991 +
8992 +
8993 + });
8994 + $('.bdt-hover-mask-list').on('mouseout', function (e) {
8995 + // $(this).siblings('.bdt-hover-wrapper-list .hover-video-list').find('video').trigger('pause');
8996 + if ($settings.posterAgain == 'yes') {
8997 + $(this).siblings('.bdt-hover-wrapper-list .hover-video-list').find('video')[0].currentTime = 0;
8998 + $(this).siblings('.bdt-hover-wrapper-list .hover-video-list').find('video').trigger('load');
8999 + } else {
9000 + $(this).siblings('.bdt-hover-wrapper-list .hover-video-list').find('video').trigger('pause');
9001 + }
9002 + });
9003 + };
9004 +
9005 +
9006 + jQuery(window).on('elementor/frontend/init', function () {
9007 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-hover-video.default', widgetDefaultSkin);
9008 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-hover-video.accordion', widgetVideoAccordion);
9009 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-hover-video.vertical', widgetVideoAccordion);
9010 + });
9011 + }(jQuery, window.elementorFrontend));
9012 +
9013 + /**
9014 + * End hover video widget script
9015 + */
9016 +
9017 + /**
9018 + * Start iconnav widget script
9019 + */
9020 +
9021 + ( function( $, elementor ) {
9022 +
9023 + 'use strict';
9024 +
9025 + var widgetIconNav = function( $scope, $ ) {
9026 +
9027 + var $iconnav = $scope.find( 'div.bdt-icon-nav' ),
9028 + $iconnavTooltip = $iconnav.find( '.bdt-icon-nav' );
9029 +
9030 + if ( ! $iconnav.length ) {
9031 + return;
9032 + }
9033 +
9034 + var $tooltip = $iconnavTooltip.find('> .bdt-tippy-tooltip'),
9035 + widgetID = $scope.data('id');
9036 +
9037 + $tooltip.each( function( index ) {
9038 + tippy( this, {
9039 + allowHTML: true,
9040 + theme: 'bdt-tippy-' + widgetID
9041 + });
9042 + });
9043 +
9044 + };
9045 +
9046 +
9047 + jQuery(window).on('elementor/frontend/init', function() {
9048 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-iconnav.default', widgetIconNav );
9049 + });
9050 +
9051 + }( jQuery, window.elementorFrontend ) );
9052 +
9053 + /**
9054 + * End iconnav widget script
9055 + */
9056 +
9057 +
9058 + /**
9059 + * Start iframe widget script
9060 + */
9061 +
9062 + (function ($, elementor) {
9063 +
9064 + 'use strict';
9065 +
9066 + var widgetIframe = function ($scope, $) {
9067 +
9068 + var $iframe = $scope.find('.bdt-iframe > iframe'),
9069 + $autoHeight = $iframe.data('auto_height');
9070 +
9071 + if (!$iframe.length) {
9072 + return;
9073 + }
9074 +
9075 + // Auto height only works when cross origin properly set
9076 +
9077 + $($iframe).recliner({
9078 + throttle: $iframe.data('throttle'),
9079 + threshold: $iframe.data('threshold'),
9080 + live: $iframe.data('live')
9081 + });
9082 +
9083 + if ($autoHeight) {
9084 + $(document).on('lazyshow', $iframe, function () {
9085 + var height = jQuery($iframe).contents().find('html').height();
9086 + jQuery($iframe).height(height);
9087 + });
9088 + }
9089 + };
9090 +
9091 +
9092 + jQuery(window).on('elementor/frontend/init', function () {
9093 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-iframe.default', widgetIframe);
9094 + });
9095 +
9096 + }(jQuery, window.elementorFrontend));
9097 +
9098 + /**
9099 + * End iframe widget script
9100 + */
9101 +
9102 + /**
9103 + * Start image expand widget script
9104 + */
9105 +
9106 + (function ($, elementor) {
9107 +
9108 + 'use strict';
9109 +
9110 + var widgetImageExpand = function ($scope, $) {
9111 +
9112 + var $imageExpand = $scope.find('.bdt-ep-image-expand'),
9113 + $settings = $imageExpand.data('settings');
9114 +
9115 + var wideitem = document.querySelectorAll('#' + $settings.wide_id + ' .bdt-ep-image-expand-item');
9116 +
9117 + $(wideitem).on('click', function () {
9118 + $(this).toggleClass('active');
9119 + $('body').addClass('bdt-ep-image-expanded');
9120 + });
9121 +
9122 + $(document).on('click', 'body.bdt-ep-image-expanded', function (e) {
9123 + if ( e.target.$imageExpand == 'bdt-ep-image-expand' || $(e.target).closest('.bdt-ep-image-expand').length ) {
9124 + } else {
9125 + $('.bdt-ep-image-expand-item').removeClass('active');
9126 +
9127 + $($imageExpand).find('.bdt-ep-image-expand-item .bdt-ep-image-expand-content *').removeClass('bdt-animation-'+$settings.default_animation_type);
9128 + $($imageExpand).find('.bdt-ep-image-expand-button').removeClass('bdt-animation-slide-bottom');
9129 + }
9130 + });
9131 +
9132 + if ( $settings.animation_status == 'yes' ) {
9133 +
9134 + $($imageExpand).find('.bdt-ep-image-expand-item').each(function (i, e) {
9135 +
9136 + var self = $(this),
9137 + $quote = self.find($settings.animation_of),
9138 + mySplitText = new SplitText($quote, {
9139 + type: 'chars, words, lines'
9140 + }),
9141 + splitTextTimeline = gsap.timeline();
9142 +
9143 + gsap.set($quote, {
9144 + perspective: 400
9145 + });
9146 +
9147 + function kill() {
9148 + splitTextTimeline.clear().time(0);
9149 + mySplitText.revert();
9150 + }
9151 +
9152 + $(this).on('click', function () {
9153 + $($imageExpand).find('.bdt-ep-image-expand-button').removeClass('bdt-animation-slide-bottom');
9154 + $($imageExpand).find('.bdt-ep-image-expand-button').addClass('bdt-invisible');
9155 + setTimeout(function () {
9156 +
9157 + kill();
9158 + mySplitText.split({
9159 + type: 'chars, words, lines'
9160 + });
9161 + var stringType = '';
9162 +
9163 +
9164 + if ( 'lines' == $settings.animation_on ) {
9165 + stringType = mySplitText.lines;
9166 + } else if ( 'chars' == $settings.animation_on ) {
9167 + stringType = mySplitText.chars;
9168 + } else {
9169 + stringType = mySplitText.words;
9170 + }
9171 +
9172 + splitTextTimeline.staggerFrom(stringType, 0.5,{
9173 + opacity : 0,
9174 + scale : $settings.anim_scale, //0
9175 + y : $settings.anim_rotation_y, //80
9176 + rotationX : $settings.anim_rotation_x, //180
9177 + transformOrigin: $settings.anim_transform_origin, //0% 50% -50
9178 + }, 0.1).then(function(){
9179 + $($imageExpand).find('.bdt-ep-image-expand-button').removeClass('bdt-invisible');
9180 + $($imageExpand).find('.bdt-ep-image-expand-item.active .bdt-ep-image-expand-button').addClass('bdt-animation-slide-bottom');
9181 + });
9182 +
9183 + splitTextTimeline.play();
9184 + }, 1000);
9185 +
9186 +
9187 + });
9188 +
9189 + });
9190 +
9191 + }else{
9192 + $($imageExpand).on('click', '.bdt-ep-image-expand-item', function (e) {
9193 + // $($imageExpand).find('.bdt-ep-image-expand-item').on('click', function (e) {
9194 + var thisInstance = $(this).attr('id');
9195 + $('#'+thisInstance).siblings('.bdt-ep-image-expand-item').find('.bdt-ep-image-expand-content *').removeClass('bdt-animation-'+$settings.default_animation_type);
9196 + $('#'+thisInstance).find('.bdt-ep-image-expand-content *').removeClass('bdt-animation-'+$settings.default_animation_type);
9197 + setTimeout(function () {
9198 + $('#'+thisInstance+'.active').find('.bdt-ep-image-expand-content *').addClass('bdt-animation-'+$settings.default_animation_type);
9199 + }, 1000);
9200 + });
9201 + }
9202 +
9203 +
9204 + };
9205 +
9206 +
9207 + jQuery(window).on('elementor/frontend/init', function () {
9208 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-image-expand.default', widgetImageExpand);
9209 + });
9210 +
9211 + }(jQuery, window.elementorFrontend));
9212 +
9213 + /**
9214 + * End image expand widget script
9215 + */
9216 +
9217 +
9218 + /**
9219 + * Start image accordion widget script
9220 + */
9221 +
9222 + ; (function ($, elementor) {
9223 +
9224 + 'use strict';
9225 + $(window).on('elementor/frontend/init', function () {
9226 + var ModuleHandler = elementorModules.frontend.handlers.Base,
9227 + ImagePrallaxEffects;
9228 +
9229 + ImagePrallaxEffects = ModuleHandler.extend({
9230 + bindEvents: function () {
9231 + this.run();
9232 + },
9233 + onElementChange: debounce(function (prop) {
9234 + if (prop.indexOf('element_pack_image_parallax_effects_') !== -1) {
9235 + this.run();
9236 + }
9237 + }, 400),
9238 +
9239 + settings: function (key) {
9240 + return this.getElementSettings('element_pack_image_parallax_effects_' + key);
9241 + },
9242 + run: function () {
9243 + var options = this.getDefaultSettings(),
9244 + element = this.$element[0],
9245 + widgetContainer = $(element).find('.elementor-image');
9246 + let image = widgetContainer.find('img').attr('src');
9247 +
9248 + if ('yes' === this.settings('enable')) {
9249 + let $content = `<div class="bdt-image-parallax-wrapper" bdt-parallax="bgy: -200" style="background-image: url(${image});"></div>`;
9250 + $(widgetContainer).append($content);
9251 + }
9252 + }
9253 + });
9254 +
9255 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
9256 + elementorFrontend.elementsHandler.addHandler(ImagePrallaxEffects, {
9257 + $element: $scope
9258 + });
9259 + });
9260 + });
9261 +
9262 + }(jQuery, window.elementorFrontend));
9263 +
9264 + /**
9265 + * End image expand widget script
9266 + */
9267 +
9268 + /**
9269 + * Start instagram widget script
9270 + */
9271 +
9272 + ( function( $, elementor ) {
9273 +
9274 + 'use strict';
9275 +
9276 + var widgetInstagram = function( $scope, $ ) {
9277 +
9278 + var $instagram = $scope.find( '.bdt-instagram' ),
9279 + $settings = $instagram.data('settings'),
9280 + $loadMoreBtn = $instagram.find('.bdt-load-more');
9281 +
9282 + if ( ! $instagram.length ) {
9283 + return;
9284 + }
9285 +
9286 + var $currentPage = $settings.current_page;
9287 +
9288 +
9289 +
9290 + callInstagram();
9291 +
9292 + $($loadMoreBtn).on('click', function(event){
9293 +
9294 + if ($loadMoreBtn.length) {
9295 + $loadMoreBtn.addClass('bdt-load-more-loading');
9296 + }
9297 +
9298 + $currentPage++;
9299 + $settings.current_page = $currentPage;
9300 +
9301 + callInstagram();
9302 + });
9303 +
9304 +
9305 + function callInstagram(){
9306 + var $itemHolder = $instagram.find('.bdt-grid');
9307 +
9308 + jQuery.ajax({
9309 + url: window.ElementPackConfig.ajaxurl,
9310 + type:'post',
9311 + data: $settings,
9312 + success:function(response){
9313 + if($currentPage === 1){
9314 + // $itemHolder.html(response);
9315 + $itemHolder.append(response);
9316 + } else {
9317 + $itemHolder.append(response);
9318 + }
9319 +
9320 + if ($loadMoreBtn.length) {
9321 + $loadMoreBtn.removeClass('bdt-load-more-loading');
9322 + }
9323 +
9324 + }
9325 + });
9326 + }
9327 +
9328 + };
9329 +
9330 +
9331 + jQuery(window).on('elementor/frontend/init', function() {
9332 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-instagram.default', widgetInstagram );
9333 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-instagram.bdt-instagram-carousel', widgetInstagram );
9334 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-instagram.bdt-classic-grid', widgetInstagram );
9335 + });
9336 +
9337 + }( jQuery, window.elementorFrontend ) );
9338 +
9339 + /**
9340 + * End instagram widget script
9341 + */
9342 +
9343 +
9344 + (function ($, elementor) {
9345 + "use strict";
9346 +
9347 + $(window).on("elementor/frontend/init", function () {
9348 + var ModuleHandler = elementorModules.frontend.handlers.Base,
9349 + SvgMaps;
9350 + SvgMaps = ModuleHandler.extend({
9351 + bindEvents: function () {
9352 + this.run();
9353 + },
9354 +
9355 + getDefaultSettings: function () {
9356 + return {};
9357 + },
9358 +
9359 + onElementChange: debounce(function (prop) {
9360 + if (prop.indexOf("svg_maps") !== -1) {
9361 + this.run();
9362 + }
9363 + }, 400),
9364 +
9365 + settings: function (key) {
9366 + return this.getElementSettings("svg_maps_" + key);
9367 + },
9368 + createColorAxisArray: function () {
9369 + const axisColorList = this.settings("region_axis_color");
9370 +
9371 + const colors = [];
9372 + // set default color
9373 + // if (this.settings("default_color") != "") {
9374 + // colors.push(this.settings("default_color"));
9375 + // }
9376 +
9377 + // set color axis
9378 + axisColorList.forEach((color) => {
9379 + if (color.axis_color !== "") {
9380 + colors.push(color.axis_color);
9381 + }
9382 + });
9383 +
9384 + return colors;
9385 + },
9386 +
9387 + createCustomRegion: function (data, options, isLinkable) {
9388 + const regionList = this.settings("array_regions");
9389 + const currentRegionColors = [];
9390 + data.addColumn("string", "Country");
9391 + data.addColumn("number", "Population");
9392 + data.addColumn({ type: "string", role: "tooltip", p: { html: true } });
9393 + regionList.forEach((region, index) => {
9394 + currentRegionColors.push(
9395 + region.active_region_color ? region.active_region_color : "#146C94"
9396 + );
9397 + options.colors = currentRegionColors;
9398 + data.addRows([
9399 + [
9400 + {
9401 + v: region.active_region_code,
9402 + f:
9403 + region.active_region_name !== ""
9404 + ? region.active_region_name
9405 + : region.active_region_code,
9406 + },
9407 + index,
9408 + region.active_tooltip_content,
9409 + ],
9410 + ]);
9411 +
9412 + isLinkable[region.active_region_code] = {
9413 + url: region.region_link ? region.region_link.url : "",
9414 + target:
9415 + region.region_link && !region.region_link.is_external
9416 + ? "_self"
9417 + : "",
9418 + };
9419 + });
9420 + },
9421 + createDataVisRegions: function (isLinkable) {
9422 + const dataVisualArray = [];
9423 + const dataVisualTitle = this.settings("region_value_title");
9424 + const dataRegionList = this.settings("data_visual_array_regions");
9425 + dataVisualArray[0] = ["Country", dataVisualTitle];
9426 +
9427 + dataRegionList.forEach((region) => {
9428 + dataVisualArray.push([
9429 + region.visual_data_region_name,
9430 + region.visual_data_value,
9431 + ]);
9432 +
9433 + isLinkable[region.visual_data_region_name] = {
9434 + url: region.visual_data_region_link
9435 + ? region.visual_data_region_link.url
9436 + : "",
9437 + target:
9438 + region.visual_data_region_link &&
9439 + !region.visual_data_region_link.is_external
9440 + ? "_self"
9441 + : "",
9442 + };
9443 + });
9444 +
9445 + var data = google.visualization.arrayToDataTable(dataVisualArray);
9446 + return {
9447 + data,
9448 + };
9449 + },
9450 + run: function () {
9451 + const self = this;
9452 + var options = this.getDefaultSettings();
9453 + var widgetID = this.$element.data("id");
9454 +
9455 + var $container = this.$element.find(".bdt-svg-maps");
9456 + if (!$container.length) {
9457 + return;
9458 + }
9459 + const $mapWrapper = document.getElementById(`bdt-svg-maps-${widgetID}`);
9460 +
9461 + google.charts.load("current", {
9462 + packages: ["geochart"],
9463 + });
9464 + google.charts.setOnLoadCallback(drawTable);
9465 +
9466 + function drawTable() {
9467 + var data = new google.visualization.DataTable();
9468 + let isLinkable = [];
9469 + let markerIsLinkable = [];
9470 +
9471 + // set region
9472 + switch (self.settings("region_type")) {
9473 + case "continent":
9474 + options.region = self.settings("display_region_continent")
9475 + ? self.settings("display_region_continent")
9476 + : "002";
9477 + break;
9478 +
9479 + case "subcontinent":
9480 + options.region = self.settings("display_region_sub_continent")
9481 + ? self.settings("display_region_sub_continent")
9482 + : "015";
9483 + break;
9484 +
9485 + case "countries":
9486 + options.region = self.settings("display_region_countries")
9487 + ? self.settings("display_region_countries")
9488 + : "AU";
9489 + break;
9490 +
9491 + default:
9492 + options.region = "world";
9493 + break;
9494 + }
9495 + // options.region = self.settings("display_region") ? self.settings("display_region") : "world";
9496 +
9497 +
9498 + options.width = self.settings("width")
9499 + ? self.settings("width").size
9500 + : 600;
9501 + options.height = self.settings("height")
9502 + ? self.settings("height").size
9503 + : 400;
9504 + options.backgroundColor = self.settings("background_color")
9505 + ? self.settings("background_color")
9506 + : "#81d4fa";
9507 + options.datalessRegionColor = self.settings("dataless_region_color")
9508 + ? self.settings("dataless_region_color")
9509 + : "#f8bbd0";
9510 +
9511 + options.tooltip = {
9512 + isHtml: true,
9513 + trigger: self.settings("tooltip_trigger")
9514 + ? self.settings("tooltip_trigger")
9515 + : "focus",
9516 + textStyle: {
9517 + // fontSize: self.settings("tooltip_font_size") ? self.settings("tooltip_font_size") : 14,
9518 + bold:
9519 + self.settings("tooltip_font_weight") === "yes" ? true : false,
9520 + italic:
9521 + self.settings("tooltip_font_style") === "yes" ? true : false,
9522 + },
9523 + };
9524 + // show legend
9525 + if (self.settings("show_legend") !== "yes") {
9526 + options.legend = "none";
9527 + } else {
9528 + options.legend = {
9529 + textStyle: {
9530 + color: self.settings("legend_font_color")
9531 + ? self.settings("legend_font_color")
9532 + : "#000000",
9533 + fontSize: self.settings("legend_font_size")
9534 + ? self.settings("legend_font_size")
9535 + : 16,
9536 + bold:
9537 + self.settings("legend_font_weight") === "yes" ? true : false,
9538 + italic:
9539 + self.settings("legend_font_style") === "yes" ? true : false,
9540 + },
9541 + };
9542 + }
9543 +
9544 + // run initilize code here to get data
9545 + if (self.settings("display_mode") === "regions") {
9546 + if (self.settings("display_type") === "custom") {
9547 + self.createCustomRegion(data, options, isLinkable);
9548 + } else {
9549 + const dataVisRegions = self.createDataVisRegions(isLinkable);
9550 + data = dataVisRegions.data;
9551 + // set color axis
9552 + options.colorAxis = {
9553 + colors: self.createColorAxisArray(),
9554 + };
9555 + }
9556 + }
9557 +
9558 + // Instantiate and draw our chart, passing in some options.
9559 + var chart = new google.visualization.GeoChart($mapWrapper);
9560 + google.visualization.events.addListener(chart, "select", () => {
9561 + const selection = chart.getSelection();
9562 + if (selection.length === 1) {
9563 + const selectedRow = selection[0].row;
9564 + const selectedRegion = data.getValue(selectedRow, 0);
9565 + switch (self.settings("display_mode")) {
9566 + case "regions":
9567 + isLinkable[selectedRegion].url !== ""
9568 + ? window.open(
9569 + isLinkable[selectedRegion].url,
9570 + isLinkable[selectedRegion].target
9571 + )
9572 + : "";
9573 + break;
9574 + case "markers":
9575 + markerIsLinkable[selectedRegion].url !== ""
9576 + ? window.open(
9577 + markerIsLinkable[selectedRegion].url,
9578 + markerIsLinkable[selectedRegion].target
9579 + )
9580 + : "";
9581 + break;
9582 + }
9583 + }
9584 + });
9585 + chart.draw(data, options);
9586 + }
9587 + },
9588 + });
9589 +
9590 + elementorFrontend.hooks.addAction(
9591 + "frontend/element_ready/bdt-svg-maps.default",
9592 + function ($scope) {
9593 + elementorFrontend.elementsHandler.addHandler(SvgMaps, {
9594 + $element: $scope,
9595 + });
9596 + }
9597 + );
9598 + });
9599 + })(jQuery, window.elementorFrontend);
9600 +
9601 + /**
9602 + * Start interactive tabs widget script
9603 + */
9604 +
9605 + (function($, elementor) {
9606 +
9607 + 'use strict';
9608 +
9609 + var widgetInteractiveTabs = function($scope, $) {
9610 +
9611 + var $slider = $scope.find('.bdt-interactive-tabs-content'),
9612 + $tabs = $scope.find('.bdt-interactive-tabs');
9613 +
9614 + if (!$slider.length) {
9615 + return;
9616 + }
9617 +
9618 + var $sliderContainer = $slider.find('.swiper-carousel'),
9619 + $settings = $slider.data('settings'),
9620 + $swiperId = $($settings.id).find('.swiper-carousel');
9621 +
9622 + const Swiper = elementorFrontend.utils.swiper;
9623 + initSwiper();
9624 + async function initSwiper() {
9625 + var swiper = await new Swiper($swiperId, $settings);
9626 + if ($settings.pauseOnHover) {
9627 + $($sliderContainer).hover(function () {
9628 + (this).swiper.autoplay.stop();
9629 + }, function () {
9630 + (this).swiper.autoplay.start();
9631 + });
9632 + }
9633 +
9634 + // start video stop
9635 + var stopVideos = function () {
9636 + var videos = document.querySelectorAll($settings.id + ' .bdt-interactive-tabs-iframe');
9637 + Array.prototype.forEach.call(videos, function (video) {
9638 + // Store the current source
9639 + var src = video.src;
9640 + // Clear the source
9641 + video.src = '';
9642 + // Remove any autoplay parameters from the URL
9643 + src = src.replace(/autoplay=1|autoplay=true/gi, 'autoplay=0');
9644 + // Set the modified source back
9645 + video.src = src;
9646 + });
9647 + };
9648 + // end video stop
9649 +
9650 + $tabs.find('.bdt-interactive-tabs-item:first').addClass('bdt-active');
9651 +
9652 + swiper.on('slideChange', function () {
9653 + $tabs.find('.bdt-interactive-tabs-item').removeClass('bdt-active');
9654 + $tabs.find('.bdt-interactive-tabs-item').eq(swiper.realIndex).addClass('bdt-active');
9655 + stopVideos();
9656 + });
9657 +
9658 + $tabs.find('.bdt-interactive-tabs-wrap .bdt-interactive-tabs-item[data-slide]').on('click', function (e) {
9659 + e.preventDefault();
9660 + var slideno = $(this).data('slide');
9661 + stopVideos();
9662 + swiper.slideTo(slideno + 1);
9663 + });
9664 + };
9665 + };
9666 +
9667 + jQuery(window).on('elementor/frontend/init', function() {
9668 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-interactive-tabs.default', widgetInteractiveTabs);
9669 + });
9670 +
9671 + }(jQuery, window.elementorFrontend));
9672 +
9673 + /**
9674 + * End interactive tabs widget script
9675 + */
9676 +
9677 +
9678 + /**
9679 + * Start logo carousel widget script
9680 + */
9681 +
9682 + (function($, elementor) {
9683 +
9684 + 'use strict';
9685 +
9686 + var widgetLogoCarousel = function($scope, $) {
9687 +
9688 + var $logocarousel = $scope.find('.bdt-logo-carousel-wrapper');
9689 +
9690 + if (!$logocarousel.length) {
9691 + return;
9692 + }
9693 +
9694 + var $tooltip = $logocarousel.find('> .bdt-tippy-tooltip'),
9695 + widgetID = $scope.data('id');
9696 +
9697 + $tooltip.each(function(index) {
9698 + tippy(this, {
9699 + allowHTML: true,
9700 + theme: 'bdt-tippy-' + widgetID
9701 + });
9702 + });
9703 +
9704 + };
9705 +
9706 +
9707 + jQuery(window).on('elementor/frontend/init', function() {
9708 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-logo-carousel.default', widgetLogoCarousel);
9709 + });
9710 +
9711 + }(jQuery, window.elementorFrontend));
9712 +
9713 + /**
9714 + * End logo carousel widget script
9715 + */
9716 +
9717 +
9718 + /**
9719 + * Start lottie icon box widget script
9720 + */
9721 +
9722 + (function ($, elementor) {
9723 +
9724 + 'use strict';
9725 +
9726 + var widgetLottieImage = function ($scope, $) {
9727 +
9728 + var $lottie = $scope.find('.bdt-lottie-container'),
9729 + $settings = $lottie.data('settings');
9730 +
9731 + if (!$lottie.length) {
9732 + return;
9733 + }
9734 +
9735 + var lottieContainer = document.getElementById($($lottie).attr('id'));
9736 +
9737 + function lottieRun(lottieContainer) {
9738 +
9739 + var json_path_url = "";
9740 +
9741 + if ($settings.is_json_url == 1) {
9742 + if ($settings.json_path) {
9743 + json_path_url = $settings.json_path;
9744 + }
9745 + } else {
9746 + if ($settings.json_code) {
9747 + var json_path_data = $settings.json_code;
9748 + var blob = new Blob([json_path_data], { type: 'application/javascript' });
9749 + json_path_url = URL.createObjectURL(blob);
9750 + }
9751 + }
9752 +
9753 + var animation = lottie.loadAnimation({
9754 + container: lottieContainer, // Required
9755 + path: json_path_url, // Required
9756 + renderer: $settings.lottie_renderer, // Required
9757 + autoplay: ('autoplay' === $settings.play_action), // Optional
9758 + loop: $settings.loop, // Optional
9759 + });
9760 + URL.revokeObjectURL(json_path_url);
9761 +
9762 + animation.addEventListener('DOMLoaded', function (e) {
9763 + var firstFrame = animation.firstFrame;
9764 + var totalFrame = animation.totalFrames;
9765 +
9766 + function getFrameNumberByPercent(percent) {
9767 + percent = Math.min(100, Math.max(0, percent));
9768 + return firstFrame + (totalFrame - firstFrame) * percent / 100;
9769 + }
9770 +
9771 + var startPoint = getFrameNumberByPercent($settings.start_point),
9772 + endPoint = getFrameNumberByPercent($settings.end_point);
9773 +
9774 + animation.playSegments([startPoint, endPoint], true);
9775 +
9776 + });
9777 +
9778 + animation.setSpeed($settings.speed);
9779 +
9780 + if ($settings.play_action) {
9781 + if ('column' === $settings.play_action) {
9782 + lottieContainer = $scope.closest('.elementor-element')[0];
9783 + }
9784 + if ('section' === $settings.play_action) {
9785 + lottieContainer = $scope.closest('.elementor-section')[0];
9786 + }
9787 + if ('click' === $settings.play_action) {
9788 + lottieContainer = $scope.closest('.elementor-element')[0];
9789 + lottieContainer.addEventListener('click', function () {
9790 + animation.goToAndPlay(0);
9791 + });
9792 + } else if ('autoplay' !== $settings.play_action) {
9793 + lottieContainer.addEventListener('mouseenter', function () {
9794 + animation.goToAndPlay(0);
9795 + });
9796 + }
9797 + }
9798 + }
9799 +
9800 + if ('scroll' === $settings.view_type) {
9801 + epObserveTarget($scope[0], function () {
9802 + lottieRun(lottieContainer);
9803 + });
9804 + } else {
9805 + lottieRun(lottieContainer);
9806 + }
9807 +
9808 + };
9809 +
9810 +
9811 + jQuery(window).on('elementor/frontend/init', function () {
9812 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-lottie-icon-box.default', widgetLottieImage);
9813 + });
9814 +
9815 + }(jQuery, window.elementorFrontend));
9816 +
9817 + /**
9818 + * End lottie icon box widget script
9819 + */
9820 +
9821 +
9822 + /**
9823 + * Start lottie image widget script
9824 + */
9825 +
9826 + (function ($, elementor) {
9827 +
9828 + 'use strict';
9829 +
9830 + var widgetLottieImage = function ($scope, $) {
9831 +
9832 + var $lottie = $scope.find('.bdt-lottie-container'),
9833 + $settings = $lottie.data('settings');
9834 +
9835 + if (!$lottie.length) {
9836 + return;
9837 + }
9838 +
9839 + var lottieContainer = document.getElementById($($lottie).attr('id'));
9840 +
9841 + function lottieRun(lottieContainer) {
9842 + var json_path_url = "";
9843 +
9844 + if ($settings.is_json_url == 1) {
9845 + if ($settings.json_path) {
9846 + json_path_url = $settings.json_path;
9847 + }
9848 + } else {
9849 + if ($settings.json_code) {
9850 + var json_path_data = $settings.json_code;
9851 + var blob = new Blob([json_path_data], {
9852 + type: 'application/javascript'
9853 + });
9854 + json_path_url = URL.createObjectURL(blob);
9855 + }
9856 + }
9857 +
9858 + var animation = lottie.loadAnimation({
9859 + container: lottieContainer, // Required
9860 + path: json_path_url, // Required
9861 + renderer: $settings.lottie_renderer, // Required
9862 + autoplay: ('autoplay' === $settings.play_action), // Optional
9863 + loop: $settings.loop, // Optional
9864 + });
9865 + URL.revokeObjectURL(json_path_url);
9866 +
9867 + animation.addEventListener('DOMLoaded', function (e) {
9868 + var firstFrame = animation.firstFrame;
9869 + var totalFrame = animation.totalFrames;
9870 +
9871 + function getFrameNumberByPercent(percent) {
9872 + percent = Math.min(100, Math.max(0, percent));
9873 + return firstFrame + (totalFrame - firstFrame) * percent / 100;
9874 + }
9875 +
9876 + var startPoint = getFrameNumberByPercent($settings.start_point),
9877 + endPoint = getFrameNumberByPercent($settings.end_point);
9878 +
9879 + animation.playSegments([startPoint, endPoint], true);
9880 +
9881 + });
9882 +
9883 + animation.setSpeed($settings.speed);
9884 +
9885 + if ($settings.play_action) {
9886 + if ('column' === $settings.play_action) {
9887 + lottieContainer = $scope.closest('.elementor-element')[0];
9888 + }
9889 + if ('section' === $settings.play_action) {
9890 + lottieContainer = $scope.closest('.elementor-section')[0];
9891 + }
9892 + if ('click' === $settings.play_action) {
9893 + lottieContainer.addEventListener('click', function () {
9894 + animation.goToAndPlay(0);
9895 + });
9896 + } else if ('autoplay' !== $settings.play_action) {
9897 + lottieContainer.addEventListener('mouseenter', function () {
9898 + animation.goToAndPlay(0);
9899 + });
9900 + }
9901 + }
9902 + }
9903 +
9904 + if ('scroll' === $settings.view_type) {
9905 + epObserveTarget($scope[0], function () {
9906 + lottieRun(lottieContainer);
9907 + });
9908 + } else {
9909 + lottieRun(lottieContainer);
9910 + }
9911 + };
9912 +
9913 +
9914 + jQuery(window).on('elementor/frontend/init', function () {
9915 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-lottie-image.default', widgetLottieImage);
9916 + });
9917 +
9918 + }(jQuery, window.elementorFrontend));
9919 +
9920 + /**
9921 + * End lottie image widget script
9922 + */
9923 +
9924 +
9925 + /**
9926 + * Start mailchimp widget script
9927 + */
9928 +
9929 + ( function( $, elementor ) {
9930 +
9931 + 'use strict';
9932 +
9933 + var widgetMailChimp = function( $scope, $ ) {
9934 +
9935 + var $mailChimp = $scope.find('.bdt-mailchimp');
9936 +
9937 + if ( ! $mailChimp.length ) {
9938 + return;
9939 + }
9940 +
9941 + var langStr = window.ElementPackConfig.mailchimp;
9942 +
9943 + $mailChimp.on('submit', function(){
9944 +
9945 + var mailchimpform = $(this);
9946 + bdtUIkit.notification({message: '<span bdt-spinner></span> ' + langStr.subscribing, timeout: false, status: 'primary'});
9947 + $.ajax({
9948 + url:mailchimpform.attr('action'),
9949 + type:'POST',
9950 + data:mailchimpform.serialize(),
9951 + success:function(data){
9952 + bdtUIkit.notification.closeAll();
9953 + bdtUIkit.notification({message: data, status: 'success'});
9954 +
9955 + // set local storage for coupon reveal
9956 + // localStorage.setItem("epCouponReveal", 'submitted');
9957 + }
9958 + });
9959 + return false;
9960 +
9961 + });
9962 +
9963 + return false;
9964 +
9965 + };
9966 +
9967 +
9968 + jQuery(window).on('elementor/frontend/init', function() {
9969 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-mailchimp.default', widgetMailChimp );
9970 + });
9971 +
9972 + }( jQuery, window.elementorFrontend ) );
9973 +
9974 + /**
9975 + * End mailchimp widget script
9976 + */
9977 +
9978 +
9979 + /**
9980 + * Start marker widget script
9981 + */
9982 +
9983 + ( function( $, elementor ) {
9984 +
9985 + 'use strict';
9986 +
9987 + var widgetMarker = function( $scope, $ ) {
9988 +
9989 + var $marker = $scope.find( '.bdt-marker-wrapper' );
9990 +
9991 + if ( ! $marker.length ) {
9992 + return;
9993 + }
9994 +
9995 + var $tooltips = $marker.find('.bdt-tippy-tooltip'),
9996 + widgetID = $scope.data('id');
9997 +
9998 + $tooltips.each( function( index ) {
9999 + var $tooltip = $(this);
10000 + var alwaysShow = $tooltip.attr('data-always-show') === 'true';
10001 + var triggerType = $tooltip.attr('data-tippy-trigger') || 'mouseenter focus';
10002 +
10003 + var tippyOptions = {
10004 + allowHTML: true,
10005 + theme: 'bdt-tippy-' + widgetID,
10006 + interactive: true,
10007 + trigger: alwaysShow ? 'manual' : triggerType,
10008 + showOnCreate: false, // Changed from alwaysShow to false to prevent immediate show
10009 + hideOnClick: false
10010 + };
10011 +
10012 + var tippyInstance = tippy(this, tippyOptions);
10013 +
10014 + // Handle always show with delay to prevent CSS class issues
10015 + if (alwaysShow) {
10016 + // Add a longer delay to ensure all CSS classes and animations are properly applied
10017 + setTimeout(function() {
10018 + // Check if element is in viewport before showing
10019 + if (isElementInViewport($tooltip[0])) {
10020 + // Additional check to ensure element is fully rendered
10021 + if ($tooltip.is(':visible')) {
10022 + tippyInstance.show();
10023 + }
10024 + }
10025 + }, 500); // Increased to 500ms delay for better compatibility
10026 + }
10027 +
10028 + // Handle different trigger types
10029 + if (triggerType === 'click' || triggerType === 'mouseenter focus') {
10030 + var tooltipStatus = alwaysShow;
10031 +
10032 + $(this).on('click', function(e) {
10033 + e.preventDefault();
10034 + e.stopPropagation();
10035 +
10036 + tooltipStatus = !tooltipStatus;
10037 +
10038 + if (tooltipStatus) {
10039 + tippyInstance.show();
10040 + } else {
10041 + tippyInstance.hide();
10042 + }
10043 + });
10044 + }
10045 + });
10046 +
10047 + // Helper function to check if element is in viewport
10048 + function isElementInViewport(el) {
10049 + if (typeof el.getBoundingClientRect !== 'function') {
10050 + return true; // Fallback for older browsers
10051 + }
10052 +
10053 + var rect = el.getBoundingClientRect();
10054 + return (
10055 + rect.top >= 0 &&
10056 + rect.left >= 0 &&
10057 + rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
10058 + rect.right <= (window.innerWidth || document.documentElement.clientWidth)
10059 + );
10060 + }
10061 +
10062 + // Handle scroll events for always-show tooltips
10063 + if ($tooltips.filter('[data-always-show="true"]').length > 0) {
10064 + var scrollHandler = function() {
10065 + $tooltips.filter('[data-always-show="true"]').each(function() {
10066 + var $tooltip = $(this);
10067 + var tippyInstance = $tooltip[0]._tippy;
10068 +
10069 + if (tippyInstance && isElementInViewport(this)) {
10070 + if (!tippyInstance.state.isVisible) {
10071 + tippyInstance.show();
10072 + }
10073 + } else if (tippyInstance && tippyInstance.state.isVisible) {
10074 + tippyInstance.hide();
10075 + }
10076 + });
10077 + };
10078 +
10079 + // Throttle scroll events for better performance
10080 + var scrollTimeout;
10081 + $(window).on('scroll', function() {
10082 + if (scrollTimeout) {
10083 + clearTimeout(scrollTimeout);
10084 + }
10085 + scrollTimeout = setTimeout(scrollHandler, 100);
10086 + });
10087 +
10088 + // Initial check on load with multiple attempts to ensure proper initialization
10089 + setTimeout(scrollHandler, 500);
10090 + setTimeout(scrollHandler, 1000);
10091 + setTimeout(scrollHandler, 1500);
10092 + }
10093 +
10094 + };
10095 +
10096 +
10097 + jQuery(window).on('elementor/frontend/init', function() {
10098 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-marker.default', widgetMarker );
10099 + });
10100 +
10101 + }( jQuery, window.elementorFrontend ) );
10102 +
10103 + /**
10104 + * End marker widget script
10105 + */
10106 +
10107 +
10108 + /**
10109 + * Start modal widget script
10110 + */
10111 + (function ($, elementor) {
10112 +
10113 + 'use strict';
10114 +
10115 + var widgetModal = function ($scope, $) {
10116 +
10117 + var $modal = $scope.find('.bdt-modal');
10118 +
10119 + if (!$modal.length) {
10120 + return;
10121 + }
10122 +
10123 + $.each($modal, function (index, val) {
10124 +
10125 + var $this = $(this),
10126 + $settings = $this.data('settings'),
10127 + modalShowed = false,
10128 + modalID = $settings.id,
10129 + displayTimes = $settings.displayTimes,
10130 + scrollDirection = $settings.scrollDirection,
10131 + scrollSelector = $settings.scrollSelector,
10132 + scrollOffset = $settings.scrollOffset,
10133 + splashInactivity = $settings.splashInactivity,
10134 + closeBtnDelayShow = $settings.closeBtnDelayShow,
10135 + delayTime = $settings.delayTime,
10136 + splashDelay = $settings.splashDelay,
10137 + widgetId = $settings.widgetId,
10138 + layout = $settings.layout;
10139 + var editMode = Boolean(elementorFrontend.isEditMode()),
10140 + inactiveTime;
10141 +
10142 + var modal = {
10143 + setLocalize: function () {
10144 +
10145 + // clear cache if user logged in
10146 + if ($('body').hasClass('logged-in') || editMode) {
10147 + if ($settings.cacheOnAdmin !== true) {
10148 + localStorage.removeItem(widgetId + '_expiresIn');
10149 + localStorage.removeItem(widgetId);
10150 + return;
10151 + }
10152 + }
10153 +
10154 + this.clearLocalize();
10155 + var widgetID = widgetId,
10156 + localVal = 0,
10157 + // hours = 4;
10158 + hours = $settings.displayTimesExpire;
10159 +
10160 + var expires = (hours * 60 * 60);
10161 + var now = Date.now();
10162 + var schedule = now + expires * 1000;
10163 +
10164 + if (localStorage.getItem(widgetID) === null) {
10165 + localStorage.setItem(widgetID, localVal);
10166 + localStorage.setItem(widgetID + '_expiresIn', schedule);
10167 + }
10168 + if (localStorage.getItem(widgetID) !== null) {
10169 + var count = parseInt(localStorage.getItem(widgetID));
10170 + count++;
10171 + localStorage.setItem(widgetID, count);
10172 + // this.clearLocalize();
10173 + }
10174 + },
10175 + clearLocalize: function () {
10176 + var localizeExpiry = parseInt(localStorage.getItem(widgetId + '_expiresIn'));
10177 + var now = Date.now(); //millisecs since epoch time, lets deal only with integer
10178 + var schedule = now;
10179 + if (schedule >= localizeExpiry) {
10180 + localStorage.removeItem(widgetId + '_expiresIn');
10181 + localStorage.removeItem(widgetId);
10182 + }
10183 + },
10184 + modalFire: function () {
10185 + if (layout == 'splash' || layout == 'exit' || layout == 'on_scroll') {
10186 + modal.setLocalize();
10187 + var firedNotify = parseInt(localStorage.getItem(widgetId));
10188 + if ((displayTimes !== false) && (firedNotify > displayTimes)) {
10189 + return;
10190 + }
10191 + }
10192 + bdtUIkit.modal($this).show();
10193 + },
10194 + closeBtnDelayShow: function () {
10195 + var $modal = $('#' + modalID);
10196 + $modal.find('#bdt-modal-close-button').hide(0);
10197 + $modal.on("shown", function () {
10198 + $('#bdt-modal-close-button').hide(0).fadeIn(delayTime);
10199 + })
10200 + .on("hide", function () {
10201 + $modal.find('#bdt-modal-close-button').hide(0);
10202 + });
10203 + },
10204 + customTrigger: function () {
10205 + var init = this;
10206 + $(modalID).on('click', function (event) {
10207 + event.preventDefault();
10208 + init.modalFire();
10209 + });
10210 + },
10211 + scrollDetect: function (fn) {
10212 + let last_scroll_position = 0;
10213 + let ticking = false;
10214 + window.addEventListener("scroll", function () {
10215 + let prev_scroll_position = last_scroll_position;
10216 + last_scroll_position = window.scrollY;
10217 + if (!ticking) {
10218 + window.requestAnimationFrame(function () {
10219 + fn(last_scroll_position, prev_scroll_position);
10220 + ticking = false;
10221 + });
10222 + ticking = true;
10223 + }
10224 + });
10225 + },
10226 + modalFireOnSelector: function () {
10227 + var init = this;
10228 + if (scrollDirection) {
10229 + $(window).on('scroll', function () {
10230 + var hT = $(scrollSelector).offset().top,
10231 + hH = $(scrollSelector).outerHeight(),
10232 + wH = $(window).height(),
10233 + wS = $(this).scrollTop();
10234 + var firedId = widgetId + '-fired';
10235 + if (wS > (hT + hH - wH)) {
10236 + if (!$(scrollSelector).hasClass(firedId)) {
10237 + init.modalFire();
10238 + }
10239 + $(scrollSelector).addClass(firedId); // tricks added
10240 + }
10241 + });
10242 + }
10243 + },
10244 + onScroll: function () {
10245 + var init = this;
10246 + this.scrollDetect((scrollPos, previousScrollPos) => {
10247 + var wintop = $(window).scrollTop(),
10248 + docheight = $(document).height(),
10249 + winheight = $(window).height();
10250 + var scrolltrigger = scrollOffset / 100;
10251 + var firedId = widgetId + '-fired';
10252 + if ((previousScrollPos > scrollPos) && scrollDirection == 'up') {
10253 + if (!$('body').hasClass(firedId)) {
10254 + init.modalFire();
10255 + $('body').addClass(firedId);
10256 + }
10257 + } else if ((previousScrollPos < scrollPos) && scrollDirection == 'down' && previousScrollPos !== 0) {
10258 + if ((wintop / (docheight - winheight)) > scrolltrigger) {
10259 + if (!$('body').hasClass(firedId)) {
10260 + init.modalFire();
10261 + $('body').addClass(firedId);
10262 + }
10263 + }
10264 + } else if ((previousScrollPos < scrollPos) && scrollDirection == 'selector' && previousScrollPos !== 0) {
10265 + init.modalFireOnSelector();
10266 + }
10267 + });
10268 + },
10269 + exitPopup: function () {
10270 + var init = this;
10271 + document.addEventListener('mouseleave', function (event) {
10272 + if (
10273 + event.clientY <= 0 ||
10274 + event.clientX <= 0 ||
10275 + (event.clientX >= window.innerWidth || event.clientY >= window.innerHeight)
10276 + ) {
10277 + if (!editMode){
10278 + init.modalFire();
10279 + }
10280 + }
10281 + });
10282 + },
10283 + resetTimer: function () {
10284 + clearTimeout(inactiveTime);
10285 + inactiveTime = setTimeout(this.modalFire, splashInactivity); // time is in milliseconds
10286 + },
10287 + splashInactivity: function () {
10288 + window.onload = this.resetTimer();
10289 + window.onmousemove = this.resetTimer();
10290 + window.onmousedown = this.resetTimer(); // catches touchscreen presses as well
10291 + window.ontouchstart = this.resetTimer(); // catches touchscreen swipes as well
10292 + window.onclick = this.resetTimer(); // catches touchpad clicks as well
10293 + window.onkeydown = this.resetTimer();
10294 + window.addEventListener('scroll', this.resetTimer(), true); // improved; see comments
10295 + },
10296 + splashTiming: function () {
10297 + var init = this;
10298 + setTimeout(function () {
10299 + init.modalFire();
10300 + }, splashDelay);
10301 + },
10302 + splashInit: function () {
10303 + if (!splashInactivity) {
10304 + this.splashTiming();
10305 + return;
10306 + }
10307 + this.splashInactivity();
10308 + },
10309 + default: function () {
10310 + $(modalID).on('click', function (event) {
10311 + event.preventDefault();
10312 + this.modalFire();
10313 + });
10314 + },
10315 + init: function () {
10316 + var init = this;
10317 +
10318 + if (layout == 'default') {
10319 + init.default();
10320 + }
10321 + if (layout == 'splash') {
10322 + init.splashInit();
10323 + }
10324 + if (layout == 'exit') {
10325 + init.exitPopup();
10326 + }
10327 + if (layout == 'on_scroll') {
10328 + init.onScroll();
10329 + }
10330 + if (layout == 'custom') {
10331 + init.customTrigger();
10332 + }
10333 + if (closeBtnDelayShow) {
10334 + init.closeBtnDelayShow();
10335 + }
10336 + }
10337 + };
10338 +
10339 + // kick off the modal
10340 + modal.init();
10341 +
10342 +
10343 + // append section as content
10344 +
10345 + if ($settings !== undefined && editMode === false && $settings.custom_section != false) {
10346 + $($settings.modal_id).addClass('elementor elementor-' + $settings.pageID)
10347 + var $modalContent = $($settings.custom_section);
10348 + var $modalBody = $($settings.modal_id).find('.bdt-modal-body');
10349 + $($modalContent).appendTo($modalBody);
10350 + }
10351 +
10352 + });
10353 + };
10354 +
10355 + jQuery(window).on('elementor/frontend/init', function () {
10356 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-modal.default', widgetModal);
10357 + });
10358 +
10359 + }(jQuery, window.elementorFrontend));
10360 +
10361 + /**
10362 + * End modal widget script
10363 + */
10364 +
10365 + /**
10366 + * Start news ticker widget script
10367 + */
10368 +
10369 + (function ($) {
10370 + "use strict";
10371 + $.epNewsTickerOld = function (element, options) {
10372 +
10373 + var defaults = {
10374 + effect: 'fade',
10375 + direction: 'ltr',
10376 + autoPlay: false,
10377 + interval: 4000,
10378 + scrollSpeed: 2,
10379 + pauseOnHover: false,
10380 + position: 'auto',
10381 + zIndex: 99999
10382 + }
10383 +
10384 + var ticker = this;
10385 + ticker.settings = {};
10386 + ticker._element = $(element);
10387 +
10388 + ticker._label = ticker._element.children(".bdt-news-ticker-label"),
10389 + ticker._news = ticker._element.children(".bdt-news-ticker-content"),
10390 + ticker._ul = ticker._news.children("ul"),
10391 + ticker._li = ticker._ul.children("li"),
10392 + ticker._controls = ticker._element.children(".bdt-news-ticker-controls"),
10393 + ticker._prev = ticker._controls.find(".bdt-news-ticker-prev").parent(),
10394 + ticker._action = ticker._controls.find(".bdt-news-ticker-action").parent(),
10395 + ticker._next = ticker._controls.find(".bdt-news-ticker-next").parent();
10396 +
10397 + ticker._pause = false;
10398 + ticker._controlsIsActive = true;
10399 + ticker._totalNews = ticker._ul.children("li").length;
10400 + ticker._activeNews = 0;
10401 + ticker._interval = false;
10402 + ticker._frameId = null;
10403 +
10404 + /****************************************************/
10405 + /**PRIVATE METHODS***********************************/
10406 + /****************************************************/
10407 +
10408 + var setContainerWidth = function () {
10409 + if (ticker._label.length > 0) {
10410 + if (ticker.settings.direction == 'rtl')
10411 + ticker._news.css({
10412 + "right": ticker._label.outerWidth()
10413 + });
10414 + else
10415 + ticker._news.css({
10416 + "left": ticker._label.outerWidth()
10417 + });
10418 + }
10419 +
10420 + if (ticker._controls.length > 0) {
10421 + var controlsWidth = ticker._controls.outerWidth();
10422 + if (ticker.settings.direction == 'rtl')
10423 + ticker._news.css({
10424 + "left": controlsWidth
10425 + });
10426 + else
10427 + ticker._news.css({
10428 + "right": controlsWidth
10429 + });
10430 + }
10431 +
10432 + if (ticker.settings.effect === 'scroll') {
10433 + var totalW = 0;
10434 + ticker._li.each(function () {
10435 + totalW += $(this).outerWidth();
10436 + });
10437 + totalW += 50;
10438 + ticker._ul.css({
10439 + 'width': totalW
10440 + });
10441 + }
10442 + }
10443 +
10444 +
10445 + var startScrollAnimationLTR = function () {
10446 + var _ulPosition = parseFloat(ticker._ul.css('marginLeft'));
10447 + _ulPosition -= ticker.settings.scrollSpeed / 2;
10448 + ticker._ul.css({
10449 + 'marginLeft': _ulPosition
10450 + });
10451 +
10452 + if (_ulPosition <= -ticker._ul.find('li:first-child').outerWidth()) {
10453 + ticker._ul.find('li:first-child').insertAfter(ticker._ul.find('li:last-child'));
10454 + ticker._ul.css({
10455 + 'marginLeft': 0
10456 + });
10457 + }
10458 + if (ticker._pause === false) {
10459 + ticker._frameId = requestAnimationFrame(startScrollAnimationLTR);
10460 + (window.requestAnimationFrame && ticker._frameId) || setTimeout(startScrollAnimationLTR, 16);
10461 + }
10462 + }
10463 +
10464 + var startScrollAnimationRTL = function () {
10465 + var _ulPosition = parseFloat(ticker._ul.css('marginRight'));
10466 + _ulPosition -= ticker.settings.scrollSpeed / 2;
10467 + ticker._ul.css({
10468 + 'marginRight': _ulPosition
10469 + });
10470 +
10471 + if (_ulPosition <= -ticker._ul.find('li:first-child').outerWidth()) {
10472 + ticker._ul.find('li:first-child').insertAfter(ticker._ul.find('li:last-child'));
10473 + ticker._ul.css({
10474 + 'marginRight': 0
10475 + });
10476 + }
10477 + if (ticker._pause === false)
10478 + ticker._frameId = requestAnimationFrame(startScrollAnimationRTL);
10479 + (window.requestAnimationFrame && ticker._frameId) || setTimeout(startScrollAnimationRTL, 16);
10480 + }
10481 +
10482 + var scrollPlaying = function () {
10483 + if (ticker.settings.direction === 'rtl') {
10484 + if (ticker._ul.width() > ticker._news.width())
10485 + startScrollAnimationRTL();
10486 + else
10487 + ticker._ul.css({
10488 + 'marginRight': 0
10489 + });
10490 + } else
10491 + if (ticker._ul.width() > ticker._news.width())
10492 + startScrollAnimationLTR();
10493 + else
10494 + ticker._ul.css({
10495 + 'marginLeft': 0
10496 + });
10497 + }
10498 +
10499 + var scrollGoNextLTR = function () {
10500 + ticker._ul.stop().animate({
10501 + marginLeft: -ticker._ul.find('li:first-child').outerWidth()
10502 + }, 300, function () {
10503 + ticker._ul.find('li:first-child').insertAfter(ticker._ul.find('li:last-child'));
10504 + ticker._ul.css({
10505 + 'marginLeft': 0
10506 + });
10507 + ticker._controlsIsActive = true;
10508 + });
10509 + }
10510 +
10511 + var scrollGoNextRTL = function () {
10512 + ticker._ul.stop().animate({
10513 + marginRight: -ticker._ul.find('li:first-child').outerWidth()
10514 + }, 300, function () {
10515 + ticker._ul.find('li:first-child').insertAfter(ticker._ul.find('li:last-child'));
10516 + ticker._ul.css({
10517 + 'marginRight': 0
10518 + });
10519 + ticker._controlsIsActive = true;
10520 + });
10521 + }
10522 +
10523 + var scrollGoPrevLTR = function () {
10524 + var _ulPosition = parseInt(ticker._ul.css('marginLeft'), 10);
10525 + if (_ulPosition >= 0) {
10526 + ticker._ul.css({
10527 + 'margin-left': -ticker._ul.find('li:last-child').outerWidth()
10528 + });
10529 + ticker._ul.find('li:last-child').insertBefore(ticker._ul.find('li:first-child'));
10530 + }
10531 +
10532 + ticker._ul.stop().animate({
10533 + marginLeft: 0
10534 + }, 300, function () {
10535 + ticker._controlsIsActive = true;
10536 + });
10537 + }
10538 +
10539 + var scrollGoPrevRTL = function () {
10540 + var _ulPosition = parseInt(ticker._ul.css('marginRight'), 10);
10541 + if (_ulPosition >= 0) {
10542 + ticker._ul.css({
10543 + 'margin-right': -ticker._ul.find('li:last-child').outerWidth()
10544 + });
10545 + ticker._ul.find('li:last-child').insertBefore(ticker._ul.find('li:first-child'));
10546 + }
10547 +
10548 + ticker._ul.stop().animate({
10549 + marginRight: 0
10550 + }, 300, function () {
10551 + ticker._controlsIsActive = true;
10552 + });
10553 + }
10554 +
10555 + var scrollNext = function () {
10556 + if (ticker.settings.direction === 'rtl')
10557 + scrollGoNextRTL();
10558 + else
10559 + scrollGoNextLTR();
10560 + }
10561 +
10562 + var scrollPrev = function () {
10563 + if (ticker.settings.direction === 'rtl')
10564 + scrollGoPrevRTL();
10565 + else
10566 + scrollGoPrevLTR();
10567 + }
10568 +
10569 + var effectTypography = function () {
10570 + ticker._ul.find('li').hide();
10571 + ticker._ul.find('li').eq(ticker._activeNews).width(30).show();
10572 + ticker._ul.find('li').eq(ticker._activeNews).animate({
10573 + width: '100%',
10574 + opacity: 1
10575 + }, 1500);
10576 + }
10577 +
10578 + var effectFade = function () {
10579 + ticker._ul.find('li').hide();
10580 + ticker._ul.find('li').eq(ticker._activeNews).fadeIn();
10581 + }
10582 +
10583 + var effectSlideDown = function () {
10584 + if (ticker._totalNews <= 1) {
10585 + ticker._ul.find('li').animate({
10586 + 'top': 30,
10587 + 'opacity': 0
10588 + }, 300, function () {
10589 + $(this).css({
10590 + 'top': -30,
10591 + 'opacity': 0,
10592 + 'display': 'block'
10593 + })
10594 + $(this).animate({
10595 + 'top': 0,
10596 + 'opacity': 1
10597 + }, 300);
10598 + });
10599 + } else {
10600 + ticker._ul.find('li:visible').animate({
10601 + 'top': 30,
10602 + 'opacity': 0
10603 + }, 300, function () {
10604 + $(this).hide();
10605 + });
10606 +
10607 + ticker._ul.find('li').eq(ticker._activeNews).css({
10608 + 'top': -30,
10609 + 'opacity': 0
10610 + }).show();
10611 +
10612 + ticker._ul.find('li').eq(ticker._activeNews).animate({
10613 + 'top': 0,
10614 + 'opacity': 1
10615 + }, 300);
10616 + }
10617 + }
10618 +
10619 + var effectSlideUp = function () {
10620 + if (ticker._totalNews <= 1) {
10621 + ticker._ul.find('li').animate({
10622 + 'top': -30,
10623 + 'opacity': 0
10624 + }, 300, function () {
10625 + $(this).css({
10626 + 'top': 30,
10627 + 'opacity': 0,
10628 + 'display': 'block'
10629 + })
10630 + $(this).animate({
10631 + 'top': 0,
10632 + 'opacity': 1
10633 + }, 300);
10634 + });
10635 + } else {
10636 + ticker._ul.find('li:visible').animate({
10637 + 'top': -30,
10638 + 'opacity': 0
10639 + }, 300, function () {
10640 + $(this).hide();
10641 + });
10642 +
10643 + ticker._ul.find('li').eq(ticker._activeNews).css({
10644 + 'top': 30,
10645 + 'opacity': 0
10646 + }).show();
10647 +
10648 + ticker._ul.find('li').eq(ticker._activeNews).animate({
10649 + 'top': 0,
10650 + 'opacity': 1
10651 + }, 300);
10652 + }
10653 + }
10654 +
10655 + var effectSlideRight = function () {
10656 + if (ticker._totalNews <= 1) {
10657 + ticker._ul.find('li').animate({
10658 + 'left': '50%',
10659 + 'opacity': 0
10660 + }, 300, function () {
10661 + $(this).css({
10662 + 'left': -50,
10663 + 'opacity': 0,
10664 + 'display': 'block'
10665 + })
10666 + $(this).animate({
10667 + 'left': 0,
10668 + 'opacity': 1
10669 + }, 300);
10670 + });
10671 + } else {
10672 + ticker._ul.find('li:visible').animate({
10673 + 'left': '50%',
10674 + 'opacity': 0
10675 + }, 300, function () {
10676 + $(this).hide();
10677 + });
10678 +
10679 + ticker._ul.find('li').eq(ticker._activeNews).css({
10680 + 'left': -50,
10681 + 'opacity': 0
10682 + }).show();
10683 +
10684 + ticker._ul.find('li').eq(ticker._activeNews).animate({
10685 + 'left': 0,
10686 + 'opacity': 1
10687 + }, 300);
10688 + }
10689 + }
10690 +
10691 + var effectSlideLeft = function () {
10692 + if (ticker._totalNews <= 1) {
10693 + ticker._ul.find('li').animate({
10694 + 'left': '-50%',
10695 + 'opacity': 0
10696 + }, 300, function () {
10697 + $(this).css({
10698 + 'left': '50%',
10699 + 'opacity': 0,
10700 + 'display': 'block'
10701 + })
10702 + $(this).animate({
10703 + 'left': 0,
10704 + 'opacity': 1
10705 + }, 300);
10706 + });
10707 + } else {
10708 + ticker._ul.find('li:visible').animate({
10709 + 'left': '-50%',
10710 + 'opacity': 0
10711 + }, 300, function () {
10712 + $(this).hide();
10713 + });
10714 +
10715 + ticker._ul.find('li').eq(ticker._activeNews).css({
10716 + 'left': '50%',
10717 + 'opacity': 0
10718 + }).show();
10719 +
10720 + ticker._ul.find('li').eq(ticker._activeNews).animate({
10721 + 'left': 0,
10722 + 'opacity': 1
10723 + }, 300);
10724 + }
10725 + }
10726 +
10727 +
10728 + var showThis = function () {
10729 + ticker._controlsIsActive = true;
10730 +
10731 + switch (ticker.settings.effect) {
10732 + case 'typography':
10733 + effectTypography();
10734 + break;
10735 + case 'fade':
10736 + effectFade();
10737 + break;
10738 + case 'slide-down':
10739 + effectSlideDown();
10740 + break;
10741 + case 'slide-up':
10742 + effectSlideUp();
10743 + break;
10744 + case 'slide-right':
10745 + effectSlideRight();
10746 + break;
10747 + case 'slide-left':
10748 + effectSlideLeft();
10749 + break;
10750 + default:
10751 + ticker._ul.find('li').hide();
10752 + ticker._ul.find('li').eq(ticker._activeNews).show();
10753 + }
10754 +
10755 + }
10756 +
10757 + var nextHandler = function () {
10758 + switch (ticker.settings.effect) {
10759 + case 'scroll':
10760 + scrollNext();
10761 + break;
10762 + default:
10763 + ticker._activeNews++;
10764 + if (ticker._activeNews >= ticker._totalNews)
10765 + ticker._activeNews = 0;
10766 +
10767 + showThis();
10768 +
10769 + }
10770 + }
10771 +
10772 + var prevHandler = function () {
10773 + switch (ticker.settings.effect) {
10774 + case 'scroll':
10775 + scrollPrev();
10776 + break;
10777 + default:
10778 + ticker._activeNews--;
10779 + if (ticker._activeNews < 0)
10780 + ticker._activeNews = ticker._totalNews - 1;
10781 +
10782 + showThis();
10783 + }
10784 + }
10785 +
10786 + var playHandler = function () {
10787 + ticker._pause = false;
10788 + if (ticker.settings.autoPlay) {
10789 + switch (ticker.settings.effect) {
10790 + case 'scroll':
10791 + scrollPlaying();
10792 + break;
10793 + default:
10794 + ticker.pause();
10795 + ticker._interval = setInterval(function () {
10796 + ticker.next();
10797 + }, ticker.settings.interval);
10798 + }
10799 + }
10800 + }
10801 +
10802 + var resizeEvent = function () {
10803 + if (ticker._element.width() < 480) {
10804 + ticker._label.hide();
10805 + if (ticker.settings.direction == 'rtl')
10806 + ticker._news.css({
10807 + "right": 0
10808 + });
10809 + else
10810 + ticker._news.css({
10811 + "left": 0
10812 + });
10813 + } else {
10814 + ticker._label.show();
10815 + if (ticker.settings.direction == 'rtl')
10816 + ticker._news.css({
10817 + "right": ticker._label.outerWidth()
10818 + });
10819 + else
10820 + ticker._news.css({
10821 + "left": ticker._label.outerWidth()
10822 + });
10823 + }
10824 + }
10825 +
10826 + /****************************************************/
10827 + /**PUBLIC METHODS************************************/
10828 + /****************************************************/
10829 + ticker.init = function () {
10830 + ticker.settings = $.extend({}, defaults, options);
10831 +
10832 + //ticker._element.append('<div class="bdt-breaking-loading"></div>');
10833 + //window.onload = function(){
10834 +
10835 + //ticker._element.find('.bdt-breaking-loading').hide();
10836 +
10837 + //adding effect type class
10838 + ticker._element.addClass('bdt-effect-' + ticker.settings.effect + ' bdt-direction-' + ticker.settings.direction);
10839 +
10840 + setContainerWidth();
10841 +
10842 + if (ticker.settings.effect != 'scroll')
10843 + showThis();
10844 +
10845 + playHandler();
10846 +
10847 + //set playing status class
10848 + if (!ticker.settings.autoPlay)
10849 + ticker._action.find('span').removeClass('bdt-news-ticker-pause').addClass('bdt-news-ticker-play');
10850 + else
10851 + ticker._action.find('span').removeClass('bdt-news-ticker-play').addClass('bdt-news-ticker-pause');
10852 +
10853 +
10854 + ticker._element.on('mouseleave', function (e) {
10855 + var activePosition = $(document.elementFromPoint(e.clientX, e.clientY)).parents('.bdt-breaking-news')[0];
10856 + if ($(this)[0] === activePosition) {
10857 + return;
10858 + }
10859 +
10860 +
10861 + if (ticker.settings.pauseOnHover === true) {
10862 + if (ticker.settings.autoPlay === true)
10863 + ticker.play();
10864 + } else {
10865 + if (ticker.settings.autoPlay === true && ticker._pause === true)
10866 + ticker.play();
10867 + }
10868 +
10869 + });
10870 +
10871 + ticker._element.on('mouseenter', function () {
10872 + if (ticker.settings.pauseOnHover === true)
10873 + ticker.pause();
10874 + });
10875 +
10876 + ticker._next.on('click', function () {
10877 + if (ticker._controlsIsActive) {
10878 + ticker._controlsIsActive = false;
10879 + ticker.pause();
10880 + ticker.next();
10881 + }
10882 + });
10883 +
10884 + ticker._prev.on('click', function () {
10885 + if (ticker._controlsIsActive) {
10886 + ticker._controlsIsActive = false;
10887 + ticker.pause();
10888 + ticker.prev();
10889 + }
10890 + });
10891 +
10892 + ticker._action.on('click', function () {
10893 + if (ticker._controlsIsActive) {
10894 + if (ticker._action.find('span').hasClass('bdt-news-ticker-pause')) {
10895 + ticker._action.find('span').removeClass('bdt-news-ticker-pause').addClass('bdt-news-ticker-play');
10896 + ticker.stop();
10897 + } else {
10898 + ticker.settings.autoPlay = true;
10899 + ticker._action.find('span').removeClass('bdt-news-ticker-play').addClass('bdt-news-ticker-pause');
10900 + //ticker._pause = false;
10901 + }
10902 + }
10903 + });
10904 +
10905 + resizeEvent();
10906 + //}
10907 +
10908 + $(window).on('resize', function () {
10909 + resizeEvent();
10910 + ticker.pause();
10911 + ticker.play();
10912 + });
10913 +
10914 + }
10915 +
10916 + ticker.pause = function () {
10917 + ticker._pause = true;
10918 + clearInterval(ticker._interval);
10919 + cancelAnimationFrame(ticker._frameId);
10920 + }
10921 +
10922 + ticker.stop = function () {
10923 + ticker._pause = true;
10924 + ticker.settings.autoPlay = false;
10925 + }
10926 +
10927 + ticker.play = function () {
10928 + playHandler();
10929 + }
10930 +
10931 + ticker.next = function () {
10932 + nextHandler();
10933 + }
10934 +
10935 + ticker.prev = function () {
10936 + prevHandler();
10937 + }
10938 + /****************************************************/
10939 + /****************************************************/
10940 + /****************************************************/
10941 + ticker.init();
10942 +
10943 + }
10944 +
10945 + $.fn.epNewsTickerOld = function (options) {
10946 +
10947 + return this.each(function () {
10948 + if (undefined == $(this).data('epNewsTickerOld')) {
10949 + var ticker = new $.epNewsTickerOld(this, options);
10950 + $(this).data('epNewsTickerOld', ticker);
10951 + }
10952 + });
10953 +
10954 + }
10955 +
10956 + })(jQuery);
10957 +
10958 +
10959 +
10960 + (function ($, elementor) {
10961 +
10962 + 'use strict';
10963 +
10964 + var widgetNewsTicker = function ($scope, $) {
10965 +
10966 + var $newsTicker = $scope.find('.bdt-news-ticker'),
10967 + $settings = $newsTicker.data('settings');
10968 +
10969 + if (!$newsTicker.length) {
10970 + return;
10971 + }
10972 +
10973 + $($newsTicker).epNewsTickerOld($settings);
10974 +
10975 + };
10976 +
10977 +
10978 + jQuery(window).on('elementor/frontend/init', function () {
10979 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-news-ticker.default', widgetNewsTicker);
10980 + });
10981 +
10982 + }(jQuery, window.elementorFrontend));
10983 +
10984 + /**
10985 + * End news ticker widget script
10986 + */
10987 +
10988 + ;
10989 + (function ($, elementor) {
10990 + 'use strict';
10991 +
10992 + $(window).on('elementor/frontend/init', function () {
10993 + var ModuleHandler = elementorModules.frontend.handlers.Base,
10994 + Notation;
10995 +
10996 + Notation = ModuleHandler.extend({
10997 +
10998 + bindEvents: function () {
10999 + this.run();
11000 + },
11001 +
11002 + getDefaultSettings: function () {
11003 + return {
11004 + type: 'underline',
11005 + multiline: true
11006 + };
11007 + },
11008 +
11009 + onElementChange: debounce(function (prop) {
11010 + if (prop.indexOf('ep_notation_') !== -1) {
11011 + this.run();
11012 + }
11013 + }, 400),
11014 +
11015 + settings: function (key) {
11016 + return this.getElementSettings('ep_notation_' + key);
11017 + },
11018 +
11019 + run: function () {
11020 +
11021 + if (this.settings('active') != 'yes') {
11022 + return;
11023 + }
11024 +
11025 + var
11026 + $element = this.$element,
11027 + $widgetId = 'ep-' + this.getID(),
11028 + $elementID = this.getID(),
11029 + $globalthis = this;
11030 +
11031 + var $list = this.settings('list');
11032 +
11033 + var rtl = ($("body").hasClass("rtl")) ? true : false;
11034 +
11035 +
11036 + $list.forEach(element => {
11037 + var
11038 + $selectElement = '',
11039 + bracketOn = '',
11040 + options = this.getDefaultSettings();
11041 +
11042 + if (element.ep_notation_select_type == 'widget') {
11043 + if ($('.elementor-editor-active').length > 0) {
11044 + $($globalthis.findElement(' > :not(style)').get(1)).attr('data-notation', $widgetId);
11045 + } else {
11046 + $($globalthis.findElement(' > :not(style)').get(0)).attr('data-notation', $widgetId);
11047 + }
11048 + $selectElement = '[data-notation="' + $widgetId + '"]';
11049 + }
11050 + if (element.ep_notation_select_type == 'custom') {
11051 + var customSelector = element.ep_notation_custom_selector;
11052 +
11053 +
11054 + if (element.ep_notation_custom_selector && customSelector.length > 1) {
11055 + $selectElement = '[data-id="' + $elementID + '"] ' + ' ' + customSelector;
11056 + } else {
11057 + $selectElement = '.-bdt-empty';
11058 + }
11059 +
11060 + }
11061 +
11062 + if (element.ep_notation_type == 'bracket') {
11063 + bracketOn = element.ep_notation_bracket_on;
11064 + bracketOn = bracketOn.split(',');
11065 + options.brackets = bracketOn;
11066 + }
11067 +
11068 + if ($selectElement.length > 0) {
11069 +
11070 + var n1 = document.querySelector($selectElement);
11071 +
11072 + options.type = element.ep_notation_type;
11073 + options.color = element.ep_notation_color || '#f23427';
11074 + options.animationDuration = element.ep_notation_anim_duration.size || 800;
11075 + options.strokeWidth = element.ep_notation_stroke_width.size || 1;
11076 + options.rtl = rtl;
11077 + options.infinityLoop = element.ep_notation_infinity_loop === 'yes';
11078 + options.loopDelay = element.ep_notation_loop_delay ? element.ep_notation_loop_delay.size : 2000;
11079 +
11080 +
11081 +
11082 + if ($($selectElement).length > 0) {
11083 + // Remove any existing rough-annotation SVGs to prevent duplication
11084 + $(n1).siblings('.rough-annotation').remove();
11085 +
11086 + epObserveTarget($element[0], function () {
11087 +
11088 + const t = "http://www.w3.org/2000/svg";
11089 + class e {
11090 + constructor(t) {
11091 + this.seed = t;
11092 + }
11093 + next() {
11094 + return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
11095 + }
11096 + }
11097 +
11098 + function s(t, e, s, i, n) {
11099 + return {
11100 + type: "path",
11101 + ops: c(t, e, s, i, n)
11102 + };
11103 + }
11104 +
11105 + function i(t, e, i) {
11106 + const n = (t || []).length;
11107 + if (n > 2) {
11108 + const s = [];
11109 + for (let e = 0; e < n - 1; e++) s.push(...c(t[e][0], t[e][1], t[e + 1][0], t[e + 1][1], i));
11110 + return e && s.push(...c(t[n - 1][0], t[n - 1][1], t[0][0], t[0][1], i)), {
11111 + type: "path",
11112 + ops: s
11113 + };
11114 + }
11115 + return 2 === n ? s(t[0][0], t[0][1], t[1][0], t[1][1], i) : {
11116 + type: "path",
11117 + ops: []
11118 + };
11119 + }
11120 +
11121 + function n(t, e, s, n, o) {
11122 + return function (t, e) {
11123 + return i(t, !0, e);
11124 + }([
11125 + [t, e],
11126 + [t + s, e],
11127 + [t + s, e + n],
11128 + [t, e + n]
11129 + ], o);
11130 + }
11131 +
11132 + function o(t, e, s, i, n) {
11133 + return function (t, e, s, i) {
11134 + const [n, o] = l(i.increment, t, e, i.rx, i.ry, 1, i.increment * h(.1, h(.4, 1, s), s), s);
11135 + let r = f(n, null, s);
11136 + if (!s.disableMultiStroke) {
11137 + const [n] = l(i.increment, t, e, i.rx, i.ry, 1.5, 0, s), o = f(n, null, s);
11138 + r = r.concat(o);
11139 + }
11140 + return {
11141 + estimatedPoints: o,
11142 + opset: {
11143 + type: "path",
11144 + ops: r
11145 + }
11146 + };
11147 + }(t, e, n, function (t, e, s) {
11148 + const i = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t / 2, 2) + Math.pow(e / 2, 2)) / 2)),
11149 + n = Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * i),
11150 + o = 2 * Math.PI / n;
11151 + let r = Math.abs(t / 2),
11152 + h = Math.abs(e / 2);
11153 + const c = 1 - s.curveFitting;
11154 + return r += a(r * c, s), h += a(h * c, s), {
11155 + increment: o,
11156 + rx: r,
11157 + ry: h
11158 + };
11159 + }(s, i, n)).opset;
11160 + }
11161 +
11162 + function r(t) {
11163 + return t.randomizer || (t.randomizer = new e(t.seed || 0)), t.randomizer.next();
11164 + }
11165 +
11166 + function h(t, e, s, i = 1) {
11167 + return s.roughness * i * (r(s) * (e - t) + t);
11168 + }
11169 +
11170 + function a(t, e, s = 1) {
11171 + return h(-t, t, e, s);
11172 + }
11173 +
11174 + function c(t, e, s, i, n, o = !1) {
11175 + const r = o ? n.disableMultiStrokeFill : n.disableMultiStroke,
11176 + h = u(t, e, s, i, n, !0, !1);
11177 + if (r) return h;
11178 + const a = u(t, e, s, i, n, !0, !0);
11179 + return h.concat(a);
11180 + }
11181 +
11182 + function u(t, e, s, i, n, o, h) {
11183 + const c = Math.pow(t - s, 2) + Math.pow(e - i, 2),
11184 + u = Math.sqrt(c);
11185 + let f = 1;
11186 + f = u < 200 ? 1 : u > 500 ? .4 : -.0016668 * u + 1.233334;
11187 + let l = n.maxRandomnessOffset || 0;
11188 + l * l * 100 > c && (l = u / 10);
11189 + const g = l / 2,
11190 + d = .2 + .2 * r(n);
11191 + let p = n.bowing * n.maxRandomnessOffset * (i - e) / 200,
11192 + _ = n.bowing * n.maxRandomnessOffset * (t - s) / 200;
11193 + p = a(p, n, f), _ = a(_, n, f);
11194 + const m = [],
11195 + w = () => a(g, n, f),
11196 + v = () => a(l, n, f);
11197 + return o && (h ? m.push({
11198 + op: "move",
11199 + data: [t + w(), e + w()]
11200 + }) : m.push({
11201 + op: "move",
11202 + data: [t + a(l, n, f), e + a(l, n, f)]
11203 + })), h ? m.push({
11204 + op: "bcurveTo",
11205 + data: [p + t + (s - t) * d + w(), _ + e + (i - e) * d + w(), p + t + 2 * (s - t) * d + w(), _ + e + 2 * (i - e) * d + w(), s + w(), i + w()]
11206 + }) : m.push({
11207 + op: "bcurveTo",
11208 + data: [p + t + (s - t) * d + v(), _ + e + (i - e) * d + v(), p + t + 2 * (s - t) * d + v(), _ + e + 2 * (i - e) * d + v(), s + v(), i + v()]
11209 + }), m;
11210 + }
11211 +
11212 + function f(t, e, s) {
11213 + const i = t.length,
11214 + n = [];
11215 + if (i > 3) {
11216 + const o = [],
11217 + r = 1 - s.curveTightness;
11218 + n.push({
11219 + op: "move",
11220 + data: [t[1][0], t[1][1]]
11221 + });
11222 + for (let e = 1; e + 2 < i; e++) {
11223 + const s = t[e];
11224 + o[0] = [s[0], s[1]], o[1] = [s[0] + (r * t[e + 1][0] - r * t[e - 1][0]) / 6, s[1] + (r * t[e + 1][1] - r * t[e - 1][1]) / 6], o[2] = [t[e + 1][0] + (r * t[e][0] - r * t[e + 2][0]) / 6, t[e + 1][1] + (r * t[e][1] - r * t[e + 2][1]) / 6], o[3] = [t[e + 1][0], t[e + 1][1]], n.push({
11225 + op: "bcurveTo",
11226 + data: [o[1][0], o[1][1], o[2][0], o[2][1], o[3][0], o[3][1]]
11227 + });
11228 + }
11229 + if (e && 2 === e.length) {
11230 + const t = s.maxRandomnessOffset;
11231 + n.push({
11232 + op: "lineTo",
11233 + data: [e[0] + a(t, s), e[1] + a(t, s)]
11234 + });
11235 + }
11236 + } else 3 === i ? (n.push({
11237 + op: "move",
11238 + data: [t[1][0], t[1][1]]
11239 + }), n.push({
11240 + op: "bcurveTo",
11241 + data: [t[1][0], t[1][1], t[2][0], t[2][1], t[2][0], t[2][1]]
11242 + })) : 2 === i && n.push(...c(t[0][0], t[0][1], t[1][0], t[1][1], s));
11243 + return n;
11244 + }
11245 +
11246 + function l(t, e, s, i, n, o, r, h) {
11247 + const c = [],
11248 + u = [],
11249 + f = a(.5, h) - Math.PI / 2;
11250 + u.push([a(o, h) + e + .9 * i * Math.cos(f - t), a(o, h) + s + .9 * n * Math.sin(f - t)]);
11251 + for (let r = f; r < 2 * Math.PI + f - .01; r += t) {
11252 + const t = [a(o, h) + e + i * Math.cos(r), a(o, h) + s + n * Math.sin(r)];
11253 + c.push(t), u.push(t);
11254 + }
11255 + return u.push([a(o, h) + e + i * Math.cos(f + 2 * Math.PI + .5 * r), a(o, h) + s + n * Math.sin(f + 2 * Math.PI + .5 * r)]), u.push([a(o, h) + e + .98 * i * Math.cos(f + r), a(o, h) + s + .98 * n * Math.sin(f + r)]), u.push([a(o, h) + e + .9 * i * Math.cos(f + .5 * r), a(o, h) + s + .9 * n * Math.sin(f + .5 * r)]), [u, c];
11256 + }
11257 +
11258 + function g(t, e) {
11259 + return {
11260 + maxRandomnessOffset: 2,
11261 + roughness: "highlight" === t ? 3 : 1.5,
11262 + bowing: 1,
11263 + stroke: "#000",
11264 + strokeWidth: 1.5,
11265 + curveTightness: 0,
11266 + curveFitting: .95,
11267 + curveStepCount: 9,
11268 + fillStyle: "hachure",
11269 + fillWeight: -1,
11270 + hachureAngle: -41,
11271 + hachureGap: -1,
11272 + dashOffset: -1,
11273 + dashGap: -1,
11274 + zigzagOffset: -1,
11275 + combineNestedSvgPaths: !1,
11276 + disableMultiStroke: "double" !== t,
11277 + disableMultiStrokeFill: !1,
11278 + seed: e
11279 + };
11280 + }
11281 +
11282 + function d(e, r, h, a, c, u) {
11283 + const f = [];
11284 + let l = h.strokeWidth || 2;
11285 + const d = function (t) {
11286 + const e = t.padding;
11287 + if (e || 0 === e) {
11288 + if ("number" == typeof e) return [e, e, e, e];
11289 + if (Array.isArray(e)) {
11290 + const t = e;
11291 + if (t.length) switch (t.length) {
11292 + case 4:
11293 + return [...t];
11294 + case 1:
11295 + return [t[0], t[0], t[0], t[0]];
11296 + case 2:
11297 + return [...t, ...t];
11298 + case 3:
11299 + return [...t, t[1]];
11300 + default:
11301 + return [t[0], t[1], t[2], t[3]];
11302 + }
11303 + }
11304 + }
11305 + return [5, 5, 5, 5];
11306 + }(h),
11307 + p = void 0 === h.animate || !!h.animate,
11308 + _ = h.iterations || 1,
11309 + m = h.rtl ? 1 : 0,
11310 + w = g("single", u);
11311 + switch (h.type) {
11312 + case "underline": {
11313 + const t = r.y + r.h + d[2];
11314 + for (let e = m; e < _ + m; e++) e % 2 ? f.push(s(r.x + r.w, t, r.x, t, w)) : f.push(s(r.x, t, r.x + r.w, t, w));
11315 + break;
11316 + }
11317 + case "strike-through": {
11318 + const t = r.y + r.h / 2;
11319 + for (let e = m; e < _ + m; e++) e % 2 ? f.push(s(r.x + r.w, t, r.x, t, w)) : f.push(s(r.x, t, r.x + r.w, t, w));
11320 + break;
11321 + }
11322 + case "box": {
11323 + const t = r.x - d[3],
11324 + e = r.y - d[0],
11325 + s = r.w + (d[1] + d[3]),
11326 + i = r.h + (d[0] + d[2]);
11327 + for (let o = 0; o < _; o++) f.push(n(t, e, s, i, w));
11328 + break;
11329 + }
11330 + case "bracket": {
11331 + const t = Array.isArray(h.brackets) ? h.brackets : h.brackets ? [h.brackets] : ["right"],
11332 + e = r.x - 2 * d[3],
11333 + s = r.x + r.w + 2 * d[1],
11334 + n = r.y - 2 * d[0],
11335 + o = r.y + r.h + 2 * d[2];
11336 + for (const h of t) {
11337 + let t;
11338 + switch (h) {
11339 + case "bottom":
11340 + t = [
11341 + [e, r.y + r.h],
11342 + [e, o],
11343 + [s, o],
11344 + [s, r.y + r.h]
11345 + ];
11346 + break;
11347 + case "top":
11348 + t = [
11349 + [e, r.y],
11350 + [e, n],
11351 + [s, n],
11352 + [s, r.y]
11353 + ];
11354 + break;
11355 + case "left":
11356 + t = [
11357 + [r.x, n],
11358 + [e, n],
11359 + [e, o],
11360 + [r.x, o]
11361 + ];
11362 + break;
11363 + case "right":
11364 + t = [
11365 + [r.x + r.w, n],
11366 + [s, n],
11367 + [s, o],
11368 + [r.x + r.w, o]
11369 + ];
11370 + }
11371 + t && f.push(i(t, !1, w));
11372 + }
11373 + break;
11374 + }
11375 + case "crossed-off": {
11376 + const t = r.x,
11377 + e = r.y,
11378 + i = t + r.w,
11379 + n = e + r.h;
11380 + for (let o = m; o < _ + m; o++) o % 2 ? f.push(s(i, n, t, e, w)) : f.push(s(t, e, i, n, w));
11381 + for (let o = m; o < _ + m; o++) o % 2 ? f.push(s(t, n, i, e, w)) : f.push(s(i, e, t, n, w));
11382 + break;
11383 + }
11384 + case "circle": {
11385 + const t = g("double", u),
11386 + e = r.w + (d[1] + d[3]),
11387 + s = r.h + (d[0] + d[2]),
11388 + i = r.x - d[3] + e / 2,
11389 + n = r.y - d[0] + s / 2,
11390 + h = Math.floor(_ / 2),
11391 + a = _ - 2 * h;
11392 + for (let r = 0; r < h; r++) f.push(o(i, n, e, s, t));
11393 + for (let t = 0; t < a; t++) f.push(o(i, n, e, s, w));
11394 + break;
11395 + }
11396 + case "highlight": {
11397 + const t = g("highlight", u);
11398 + l = .95 * r.h;
11399 + const e = r.y + r.h / 2;
11400 + for (let i = m; i < _ + m; i++) i % 2 ? f.push(s(r.x + r.w, e, r.x, e, t)) : f.push(s(r.x, e, r.x + r.w, e, t));
11401 + break;
11402 + }
11403 + case "soft-wave": {
11404 + const t = r.y + r.h + d[2];
11405 + for (let e = m; e < _ + m; e++) {
11406 + const points = [];
11407 + for (let i = 0; i <= r.w; i += 4) {
11408 + const x = r.x + i;
11409 + // Create soft, gentle wave with multiple sine waves for natural flow
11410 + const y = t + Math.sin(i * 0.06) * 8 + Math.cos(i * 0.04) * 4 + Math.sin(i * 0.02) * 2;
11411 + points.push([x, y]);
11412 + }
11413 + f.push(i(points, false, w));
11414 + }
11415 + break;
11416 + }
11417 + }
11418 + if (f.length) {
11419 + const s = function (t) {
11420 + const e = [];
11421 + for (const s of t) {
11422 + let t = "";
11423 + for (const i of s.ops) {
11424 + const s = i.data;
11425 + switch (i.op) {
11426 + case "move":
11427 + t.trim() && e.push(t.trim()), t = `M${s[0]} ${s[1]} `;
11428 + break;
11429 + case "bcurveTo":
11430 + t += `C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;
11431 + break;
11432 + case "lineTo":
11433 + t += `L${s[0]} ${s[1]} `;
11434 + }
11435 + }
11436 + t.trim() && e.push(t.trim());
11437 + }
11438 + return e;
11439 + }(f),
11440 + i = [],
11441 + n = [];
11442 + let o = 0;
11443 + const r = (t, e, s) => t.setAttribute(e, s);
11444 + for (const a of s) {
11445 + const s = document.createElementNS(t, "path");
11446 + if (r(s, "d", a), r(s, "fill", "none"), r(s, "stroke", h.color || "currentColor"), r(s, "stroke-width", "" + l), p) {
11447 + const t = s.getTotalLength();
11448 + i.push(t), o += t;
11449 + }
11450 + e.appendChild(s), n.push(s);
11451 + }
11452 + if (p) {
11453 + let t = 0;
11454 + for (let e = 0; e < n.length; e++) {
11455 + const s = n[e],
11456 + r = i[e],
11457 + h = o ? c * (r / o) : 0,
11458 + u = a + t,
11459 + f = s.style;
11460 + f.strokeDashoffset = "" + r, f.strokeDasharray = "" + r, f.animation = `rough-notation-dash ${h}ms ease-out ${u}ms forwards`, t += h;
11461 + }
11462 + }
11463 + }
11464 + }
11465 + class p {
11466 + constructor(t, e) {
11467 + this._state = "unattached", this._resizing = !1, this._seed = Math.floor(Math.random() * 2 ** 31), this._lastSizes = [], this._animationDelay = 0, this._loopTimeout = null, this._resizeListener = () => {
11468 + this._resizing || (this._resizing = !0, setTimeout(() => {
11469 + this._resizing = !1, "showing" === this._state && this.haveRectsChanged() && this.show();
11470 + }, 400));
11471 + }, this._e = t, this._config = JSON.parse(JSON.stringify(e)), this.attach();
11472 + }
11473 + get animate() {
11474 + return this._config.animate;
11475 + }
11476 + set animate(t) {
11477 + this._config.animate = t;
11478 + }
11479 + get animationDuration() {
11480 + return this._config.animationDuration;
11481 + }
11482 + set animationDuration(t) {
11483 + this._config.animationDuration = t;
11484 + }
11485 + get iterations() {
11486 + return this._config.iterations;
11487 + }
11488 + set iterations(t) {
11489 + this._config.iterations = t;
11490 + }
11491 + get color() {
11492 + return this._config.color;
11493 + }
11494 + set color(t) {
11495 + this._config.color !== t && (this._config.color = t, this.refresh());
11496 + }
11497 + get strokeWidth() {
11498 + return this._config.strokeWidth;
11499 + }
11500 + set strokeWidth(t) {
11501 + this._config.strokeWidth !== t && (this._config.strokeWidth = t, this.refresh());
11502 + }
11503 + get padding() {
11504 + return this._config.padding;
11505 + }
11506 + set padding(t) {
11507 + this._config.padding !== t && (this._config.padding = t, this.refresh());
11508 + }
11509 + attach() {
11510 + if ("unattached" === this._state && this._e.parentElement) {
11511 + // Remove any existing rough-annotation SVGs to prevent duplication
11512 + const existingSvg = this._e.parentElement.querySelector('.rough-annotation');
11513 + if (existingSvg) {
11514 + existingSvg.remove();
11515 + }
11516 +
11517 + ! function () {
11518 + if (!window.__rno_kf_s) {
11519 + const t = window.__rno_kf_s = document.createElement("style");
11520 + t.textContent = "@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }", document.head.appendChild(t);
11521 + }
11522 + }();
11523 + const e = this._svg = document.createElementNS(t, "svg");
11524 + e.setAttribute("class", "rough-annotation");
11525 + const s = e.style;
11526 + s.position = "absolute", s.top = "0", s.left = "0", s.overflow = "visible", s.pointerEvents = "none", s.width = "100px", s.height = "100px";
11527 + const i = "highlight" === this._config.type;
11528 + if (this._e.insertAdjacentElement(i ? "beforebegin" : "afterend", e), this._state = "not-showing", i) {
11529 + const t = window.getComputedStyle(this._e).position;
11530 + (!t || "static" === t) && (this._e.style.position = "relative");
11531 + }
11532 + this.attachListeners();
11533 + }
11534 + }
11535 + detachListeners() {
11536 + window.removeEventListener("resize", this._resizeListener), this._ro && this._ro.unobserve(this._e);
11537 + }
11538 + attachListeners() {
11539 + this.detachListeners(), window.addEventListener("resize", this._resizeListener, {
11540 + passive: !0
11541 + }), !this._ro && "ResizeObserver" in window && (this._ro = new window.ResizeObserver(t => {
11542 + for (const e of t) e.contentRect && this._resizeListener();
11543 + })), this._ro && this._ro.observe(this._e);
11544 + }
11545 + haveRectsChanged() {
11546 + if (this._lastSizes.length) {
11547 + const t = this.rects();
11548 + if (t.length !== this._lastSizes.length) return !0;
11549 + for (let e = 0; e < t.length; e++)
11550 + if (!this.isSameRect(t[e], this._lastSizes[e])) return !0;
11551 + }
11552 + return !1;
11553 + }
11554 + isSameRect(t, e) {
11555 + const s = (t, e) => Math.round(t) === Math.round(e);
11556 + return s(t.x, e.x) && s(t.y, e.y) && s(t.w, e.w) && s(t.h, e.h);
11557 + }
11558 + isShowing() {
11559 + return "not-showing" !== this._state;
11560 + }
11561 + refresh() {
11562 + this.isShowing() && !this.pendingRefresh && (this.pendingRefresh = Promise.resolve().then(() => {
11563 + this.isShowing() && this.show(), delete this.pendingRefresh;
11564 + }));
11565 + }
11566 + show() {
11567 + // Clear any existing loop timeout
11568 + if (this._loopTimeout) {
11569 + clearTimeout(this._loopTimeout);
11570 + this._loopTimeout = null;
11571 + }
11572 +
11573 + switch (this._state) {
11574 + case "unattached":
11575 + break;
11576 + case "showing":
11577 + this.hide(), this._svg && this.render(this._svg, !0);
11578 + break;
11579 + case "not-showing":
11580 + this.attach(), this._svg && this.render(this._svg, !1);
11581 + }
11582 +
11583 + // Handle infinity loop
11584 + if (this._config.infinityLoop && this._config.loopDelay) {
11585 + this._loopTimeout = setTimeout(() => {
11586 + this.hide();
11587 + setTimeout(() => {
11588 + this.show();
11589 + }, 100);
11590 + }, this._config.animationDuration + this._config.loopDelay);
11591 + }
11592 + }
11593 + hide() {
11594 + // Clear loop timeout when hiding
11595 + if (this._loopTimeout) {
11596 + clearTimeout(this._loopTimeout);
11597 + this._loopTimeout = null;
11598 + }
11599 +
11600 + if (this._svg)
11601 + for (; this._svg.lastChild;) this._svg.removeChild(this._svg.lastChild);
11602 + this._state = "not-showing";
11603 + }
11604 + remove() {
11605 + this._svg && this._svg.parentElement && this._svg.parentElement.removeChild(this._svg), this._svg = void 0, this._state = "unattached", this.detachListeners();
11606 + }
11607 + render(t, e) {
11608 + let s = this._config;
11609 + e && (s = JSON.parse(JSON.stringify(this._config)), s.animate = !1);
11610 + const i = this.rects();
11611 + let n = 0;
11612 + i.forEach(t => n += t.w);
11613 + const o = s.animationDuration || 800;
11614 + let r = 0;
11615 + for (let e = 0; e < i.length; e++) {
11616 + const h = o * (i[e].w / n);
11617 + d(t, i[e], s, r + this._animationDelay, h, this._seed), r += h;
11618 + }
11619 + this._lastSizes = i, this._state = "showing";
11620 + }
11621 + rects() {
11622 + const t = [];
11623 + if (this._svg)
11624 + if (this._config.multiline) {
11625 + const e = this._e.getClientRects();
11626 + for (let s = 0; s < e.length; s++) t.push(this.svgRect(this._svg, e[s]));
11627 + } else t.push(this.svgRect(this._svg, this._e.getBoundingClientRect()));
11628 + return t;
11629 + }
11630 + svgRect(t, e) {
11631 + const s = t.getBoundingClientRect(),
11632 + i = e;
11633 + return {
11634 + x: (i.x || i.left) - (s.x || s.left),
11635 + y: (i.y || i.top) - (s.y || s.top),
11636 + w: i.width,
11637 + h: i.height
11638 + };
11639 + }
11640 + }
11641 +
11642 + function _(t, e) {
11643 + return new p(t, e);
11644 + }
11645 +
11646 + function m(t) {
11647 + let e = 0;
11648 + for (const s of t) {
11649 + const t = s;
11650 + t._animationDelay = e;
11651 + e += 0 === t.animationDuration ? 0 : t.animationDuration || 800;
11652 + }
11653 + const s = [...t];
11654 + return {
11655 + show() {
11656 + for (const t of s) t.show();
11657 + },
11658 + hide() {
11659 + for (const t of s) t.hide();
11660 + }
11661 + };
11662 + }
11663 +
11664 + var a1 = _(n1, options);
11665 + a1.show();
11666 + });
11667 + }
11668 +
11669 + }
11670 +
11671 + });
11672 +
11673 +
11674 + }
11675 +
11676 + });
11677 +
11678 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
11679 + elementorFrontend.elementsHandler.addHandler(Notation, {
11680 + $element: $scope
11681 + });
11682 + });
11683 +
11684 + });
11685 +
11686 + }(jQuery, window.elementorFrontend));
11687 +
11688 + /**
11689 + * Start notification widget script
11690 + */
11691 +
11692 + (function ($, elementor) {
11693 +
11694 + 'use strict';
11695 +
11696 + // Notification
11697 + var widgetNotification = function ($scope, $) {
11698 +
11699 + var $avdNotification = $scope.find('.bdt-notification-wrapper'),
11700 + $settings = $avdNotification.data('settings');
11701 +
11702 + if (!$avdNotification.length) {
11703 + return;
11704 + }
11705 +
11706 + if (Boolean(elementorFrontend.isEditMode()) === false) {
11707 + if ($($scope).is('.elementor-hidden-desktop, .elementor-hidden-tablet, .elementor-hidden-mobile')) {
11708 + return;
11709 + }
11710 +
11711 + if ($settings.externalSystem == 'yes' && $settings.externalSystemValid == false) {
11712 + return;
11713 + }
11714 +
11715 + if ($settings.linkWithConfetti === true){
11716 + jQuery.ajax({
11717 + type: "post",
11718 + dataType: "json",
11719 + url: ElementPackConfig.ajaxurl,
11720 + data: {
11721 + action: "ep_connect_confetti",
11722 + data : 'empty'
11723 + },
11724 + success: function () {
11725 + // console.log('done');
11726 + }
11727 + })
11728 + }
11729 +
11730 + }
11731 +
11732 +
11733 + var $settings = $avdNotification.data('settings'),
11734 + id = '#' + $settings.id,
11735 + timeOut = $settings.notifyTimeout,
11736 + notifyType = $settings.notifyType,
11737 + notifyFixPos = $settings.notifyFixPosition,
11738 + editMode = Boolean(elementorFrontend.isEditMode());
11739 +
11740 +
11741 + if (typeof $settings.notifyTimeout === "undefined") {
11742 + timeOut = null;
11743 + }
11744 +
11745 + bdtUIkit.util.on(document, 'beforehide', '[bdt-alert]', function (event) {
11746 + if (notifyFixPos === 'top') {
11747 + $('html').attr('style', 'margin-top: unset !important');
11748 + }
11749 + });
11750 +
11751 + var notification = {
11752 + htmlMarginRemove: function () {
11753 + $('html').css({
11754 + 'margin-top': 'unset !important'
11755 + });
11756 + },
11757 + appendBody: function () {
11758 + $('body > ' + id).slice(1).remove();
11759 + $(id).prependTo($("body"));
11760 + },
11761 + showNotify: function () {
11762 + $(id).removeClass('bdt-hidden');
11763 + },
11764 + notifyFixed: function () {
11765 + this.htmlMarginRemove();
11766 + setTimeout(function () {
11767 + if (notifyFixPos == 'top') {
11768 + var notifyHeight = $('.bdt-notify-wrapper').outerHeight();
11769 + if ($('.admin-bar').length) {
11770 + notifyHeight = notifyHeight + 32;
11771 + $(id).attr('style', 'margin-top: 32px !important');
11772 + }
11773 + $('html').attr('style', 'margin-top: ' + notifyHeight + 'px !important');
11774 + $('html').css({
11775 + 'transition': 'margin-top .8s ease'
11776 + });
11777 + $(window).on('resize', function () {
11778 + notifyHeight = $('.bdt-notify-wrapper').outerHeight();
11779 + if ($('.admin-bar').length) {
11780 + notifyHeight = notifyHeight + 32;
11781 + }
11782 + $('html').attr('style', 'margin-top: ' + notifyHeight + 'px !important');
11783 + });
11784 + }
11785 + }, 1000);
11786 + },
11787 + notifyRelative: function () {
11788 + $('body > ' + id).remove();
11789 + },
11790 + notifyPopup: function () {
11791 + bdtUIkit.notification({
11792 + message: $settings.msg,
11793 + status: $settings.notifyStatus,
11794 + pos: $settings.notifyPosition,
11795 + timeout: timeOut
11796 + });
11797 + },
11798 + notifyFire: function () {
11799 + if (notifyType === 'fixed') {
11800 + if (notifyFixPos !== 'relative') {
11801 + this.appendBody();
11802 + this.notifyFixed();
11803 + } else {
11804 + this.htmlMarginRemove();
11805 + this.notifyRelative();
11806 + }
11807 + } else {
11808 + this.notifyPopup();
11809 + }
11810 + },
11811 + setLocalize: function () {
11812 + if (editMode) {
11813 + this.clearLocalize();
11814 + return;
11815 + }
11816 + var widgetID = $settings.id,
11817 + localVal = 0,
11818 + hours = $settings.displayTimesExpire;
11819 +
11820 + var expires = (hours * 60 * 60);
11821 + var now = Date.now();
11822 + var schedule = now + expires * 1000;
11823 +
11824 + if (localStorage.getItem(widgetID) === null) {
11825 + localStorage.setItem(widgetID, localVal);
11826 + localStorage.setItem(widgetID + '_expiresIn', schedule);
11827 + }
11828 + if (localStorage.getItem(widgetID) !== null) {
11829 + var count = parseInt(localStorage.getItem(widgetID));
11830 + count++;
11831 + localStorage.setItem(widgetID, count);
11832 + // this.clearLocalize();
11833 + }
11834 + },
11835 + clearLocalize: function () {
11836 + var localizeExpiry = parseInt(localStorage.getItem($settings.id + '_expiresIn'));
11837 + var now = Date.now(); //millisecs since epoch time, lets deal only with integer
11838 + var schedule = now;
11839 + if (schedule >= localizeExpiry) {
11840 + localStorage.removeItem($settings.id + '_expiresIn');
11841 + localStorage.removeItem($settings.id);
11842 + }
11843 + },
11844 + notificationInit: function () {
11845 + var init = this;
11846 +
11847 + this.setLocalize();
11848 + var displayTimes = $settings.displayTimes,
11849 + firedNotify = parseInt(localStorage.getItem($settings.id));
11850 +
11851 + if ((displayTimes !== false) && (firedNotify > displayTimes)) {
11852 + return;
11853 + }
11854 +
11855 + this.showNotify();
11856 +
11857 + if ($settings.notifyEvent == 'onload' || $settings.notifyEvent == 'inDelay') {
11858 + $(document).ready(function () {
11859 + setTimeout(function () {
11860 + init.notifyFire();
11861 + }, $settings.notifyInDelay);
11862 + });
11863 + }
11864 + if ($settings.notifyEvent == 'click' || $settings.notifyEvent == 'mouseover') {
11865 + $($settings.notifySelector).on($settings.notifyEvent, function () {
11866 + init.notifyFire();
11867 + });
11868 + }
11869 + },
11870 + };
11871 +
11872 + // kick off the notification widget
11873 + notification.notificationInit();
11874 +
11875 + $('.bdt-notify-wrapper.bdt-position-fixed .bdt-alert-close').on('click', function (e) {
11876 + $('html').attr('style', 'margin-top: unset !important');
11877 + if ($('.admin-bar').length) {
11878 + $('html').attr('style', 'margin-top: 32px !important');
11879 + }
11880 + });
11881 + };
11882 +
11883 + jQuery(window).on('elementor/frontend/init', function () {
11884 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-notification.default', widgetNotification);
11885 + });
11886 +
11887 + }(jQuery, window.elementorFrontend));
11888 +
11889 + /**
11890 + * End notification widget script
11891 + */
11892 + /**
11893 + * Start offcanvas widget script
11894 + */
11895 +
11896 + ( function( $, elementor ) {
11897 +
11898 + 'use strict';
11899 +
11900 + var widgetOffcanvas = function( $scope, $ ) {
11901 +
11902 + var $offcanvas = $scope.find( '.bdt-offcanvas' );
11903 +
11904 + if ( ! $offcanvas.length ) {
11905 + return;
11906 + }
11907 +
11908 +
11909 + $.each($offcanvas, function(index, val) {
11910 +
11911 + var $this = $(this),
11912 + $settings = $this.data('settings'),
11913 + offcanvasID = $settings.id;
11914 +
11915 + if ( $(offcanvasID).length ) {
11916 + // global custom link for a tag
11917 + $(offcanvasID).on('click', function(event){
11918 + event.preventDefault();
11919 + bdtUIkit.offcanvas( $this ).show();
11920 + });
11921 + }
11922 +
11923 + });
11924 +
11925 + };
11926 +
11927 +
11928 + jQuery(window).on('elementor/frontend/init', function() {
11929 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-offcanvas.default', widgetOffcanvas );
11930 + });
11931 +
11932 + }( jQuery, window.elementorFrontend ) );
11933 +
11934 + /**
11935 + * End offcanvas widget script
11936 + */
11937 +
11938 +
11939 + ; (function ($, elementor) {
11940 + 'use strict';
11941 +
11942 + $(window).on('elementor/frontend/init', function () {
11943 + var ModuleHandler = elementorModules.frontend.handlers.Base,
11944 + ScrollingEffect;
11945 +
11946 + ScrollingEffect = ModuleHandler.extend({
11947 +
11948 + bindEvents: function () {
11949 + this.run();
11950 + },
11951 +
11952 + getDefaultSettings: function () {
11953 + return {
11954 + media: false,
11955 + easing: 1,
11956 + viewport: 1,
11957 + };
11958 + },
11959 +
11960 + onElementChange: debounce(function (prop) {
11961 + if (prop.indexOf('ep_parallax_effects') !== -1) {
11962 + this.run();
11963 + }
11964 + }, 400),
11965 +
11966 + settings: function (key) {
11967 + return this.getElementSettings('ep_parallax_effects_' + key);
11968 + },
11969 +
11970 + run: function () {
11971 + var options = this.getDefaultSettings(),
11972 + element = this.$element[0];
11973 +
11974 + if (jQuery(this.$element).hasClass('elementor-section')) {
11975 + element = this.$element.get(0);
11976 + }
11977 +
11978 + if (this.settings('y')) {
11979 + if (this.settings('y_custom_show')) {
11980 + options.y = this.settings('y_custom_value');
11981 + } else {
11982 + if (this.settings('y_start.size') || this.settings('y_end.size')) {
11983 + options.y = [this.settings('y_start.size') || 0, this.settings('y_end.size') || 0];
11984 +
11985 + }
11986 + }
11987 + }
11988 +
11989 + if (this.settings('x')) {
11990 + if (this.settings('x_custom_show')) {
11991 + options.x = this.settings('x_custom_value');
11992 + } else {
11993 + if (this.settings('x_start.size') || this.settings('x_end.size')) {
11994 + options.x = [this.settings('x_start.size'), this.settings('x_end.size')];
11995 + }
11996 + }
11997 + }
11998 +
11999 + if (this.settings('opacity_toggole')) {
12000 + if (this.settings('opacity_custom_show')) {
12001 + options.opacity = this.settings('opacity_custom_value');
12002 + } else {
12003 + if ('htov' === this.settings('opacity')) {
12004 + options.opacity = [0, 1];
12005 + } else if ('vtoh' === this.settings('opacity')) {
12006 + options.opacity = [1, 0];
12007 + }
12008 + }
12009 + }
12010 +
12011 + if (this.settings('blur')) {
12012 + if (this.settings('blur_start.size') || this.settings('blur_end.size')) {
12013 + options.blur = [this.settings('blur_start.size') || 0, this.settings('blur_end.size') || 0];
12014 + }
12015 + }
12016 +
12017 + if (this.settings('rotate')) {
12018 + if (this.settings('rotate_start.size') || this.settings('rotate_end.size')) {
12019 + options.rotate = [this.settings('rotate_start.size') || 0, this.settings('rotate_end.size') || 0];
12020 + }
12021 + }
12022 +
12023 + if (this.settings('scale')) {
12024 + if (this.settings('scale_start.size') || this.settings('scale_end.size')) {
12025 + options.scale = [this.settings('scale_start.size') || 1, this.settings('scale_end.size') || 1];
12026 + }
12027 + }
12028 +
12029 + if (this.settings('hue')) {
12030 + if (this.settings('hue_value.size')) {
12031 + options.hue = this.settings('hue_value.size');
12032 + }
12033 + }
12034 +
12035 + if (this.settings('sepia')) {
12036 + if (this.settings('sepia_value.size')) {
12037 + options.sepia = this.settings('sepia_value.size');
12038 + }
12039 + }
12040 +
12041 + if (this.settings('viewport')) {
12042 + if (this.settings('viewport_start')) {
12043 + options.start = this.settings('viewport_start');
12044 + }
12045 + }
12046 +
12047 + if (this.settings('viewport')) {
12048 + if (this.settings('viewport_end')) {
12049 + options.end = this.settings('viewport_end');
12050 + }
12051 + }
12052 +
12053 + if (this.settings('media_query')) {
12054 + if (this.settings('media_query')) {
12055 + options.media = this.settings('media_query');
12056 + }
12057 + }
12058 +
12059 + if (this.settings('easing')) {
12060 + if (this.settings('easing_value.size')) {
12061 + options.easing = this.settings('easing_value.size');
12062 + }
12063 + }
12064 +
12065 + if (this.settings('target')) {
12066 + if (this.settings('target') === 'section') {
12067 + options.target = '.elementor-section.elementor-element-' + jQuery(element).closest('section').data('id');
12068 + }
12069 + }
12070 +
12071 +
12072 + if (this.settings('show')) {
12073 + if (
12074 + this.settings('y') ||
12075 + this.settings('x') ||
12076 + this.settings('opacity') ||
12077 + this.settings('blur') ||
12078 + this.settings('rotate') ||
12079 + this.settings('scale') ||
12080 + this.settings('hue') ||
12081 + this.settings('sepia') ||
12082 + this.settings('viewport') ||
12083 + this.settings('media_query') ||
12084 + this.settings('easing') ||
12085 + this.settings('target')
12086 + ) {
12087 + bdtUIkit.parallax(element, options);
12088 + }
12089 + }
12090 +
12091 + }
12092 + });
12093 +
12094 +
12095 + elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) {
12096 + elementorFrontend.elementsHandler.addHandler(ScrollingEffect, { $element: $scope });
12097 + });
12098 +
12099 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
12100 + elementorFrontend.elementsHandler.addHandler(ScrollingEffect, { $element: $scope });
12101 + });
12102 + });
12103 + }(jQuery, window.elementorFrontend));
12104 +
12105 + ;
12106 + (function ($, elementor) {
12107 + 'use strict';
12108 + $(window).on('elementor/frontend/init', function () {
12109 + var ModuleHandler = elementorModules.frontend.handlers.Base,
12110 + Particles;
12111 +
12112 + Particles = ModuleHandler.extend({
12113 +
12114 + bindEvents: function () {
12115 + this.run();
12116 + },
12117 +
12118 + getDefaultSettings: function () {
12119 + return {
12120 + allowHTML: true,
12121 + };
12122 + },
12123 +
12124 + onElementChange: debounce(function (prop) {
12125 + if (prop.indexOf('section_particles') !== -1) {
12126 + // window.pJSDom[0].pJS.fn.vendors.destroypJS();
12127 + this.run();
12128 + }
12129 + }, 400),
12130 +
12131 + settings: function (key) {
12132 + return this.getElementSettings('section_particles_' + key);
12133 + },
12134 +
12135 + run: function () {
12136 + var particleID = 'bdt-particle-container-' + this.$element.data('id'),
12137 + widgetID = this.$element.data('id'),
12138 + widgetContainer = $('.elementor-element-' + widgetID);
12139 + this.particleID = particleID;
12140 +
12141 + // start predefined json data
12142 + var jsonData = {
12143 + 'particles': {
12144 + 'number': {
12145 + 'value': 80,
12146 + 'density': {
12147 + 'enable': true,
12148 + 'value_area': 800
12149 + }
12150 + },
12151 + 'color': {
12152 + 'value': '#ffffff'
12153 + },
12154 + 'shape': {
12155 + 'type': 'circle',
12156 + 'stroke': {
12157 + 'width': 0,
12158 + 'color': '#000000'
12159 + },
12160 + 'polygon': {
12161 + 'nb_sides': 5
12162 + },
12163 + 'image': {
12164 + 'src': '',
12165 + 'width': 100,
12166 + 'height': 100
12167 + }
12168 + },
12169 + 'opacity': {
12170 + 'value': 0.5,
12171 + 'random': false,
12172 + 'anim': {
12173 + 'enable': false,
12174 + 'speed': 1,
12175 + 'opacity_min': 0.1,
12176 + 'sync': false
12177 + }
12178 + },
12179 + 'size': {
12180 + 'value': 3,
12181 + 'random': true,
12182 + 'anim': {
12183 + 'enable': false,
12184 + 'speed': 40,
12185 + 'size_min': 0.1,
12186 + 'sync': false
12187 + }
12188 + },
12189 + 'line_linked': {
12190 + 'enable': true,
12191 + 'distance': 150,
12192 + 'color': '#ffffff',
12193 + 'opacity': 0.4,
12194 + 'width': 1
12195 + },
12196 + 'move': {
12197 + 'enable': true,
12198 + 'speed': 6,
12199 + 'direction': 'none',
12200 + 'random': false,
12201 + 'straight': false,
12202 + 'out_mode': 'out',
12203 + 'bounce': false,
12204 + 'attract': {
12205 + 'enable': false,
12206 + 'rotateX': 600,
12207 + 'rotateY': 1200
12208 + }
12209 + }
12210 + },
12211 + 'interactivity': {
12212 + 'detect_on': 'canvas',
12213 + 'events': {
12214 + 'onhover': {
12215 + 'enable': false,
12216 + 'mode': 'repulse'
12217 + },
12218 + 'onclick': {
12219 + 'enable': true,
12220 + 'mode': 'push'
12221 + },
12222 + 'resize': true
12223 + },
12224 + 'modes': {
12225 + 'grab': {
12226 + 'distance': 400,
12227 + 'line_linked': {
12228 + 'opacity': 1
12229 + }
12230 + },
12231 + 'bubble': {
12232 + 'distance': 400,
12233 + 'size': 40,
12234 + 'duration': 2,
12235 + 'opacity': 8,
12236 + 'speed': 3
12237 + },
12238 + 'repulse': {
12239 + 'distance': 200,
12240 + 'duration': 0.4
12241 + },
12242 + 'push': {
12243 + 'particles_nb': 4
12244 + },
12245 + 'remove': {
12246 + 'particles_nb': 2
12247 + }
12248 + }
12249 + },
12250 + 'retina_detect': true
12251 + };
12252 + // end of predefine json data
12253 +
12254 +
12255 + if (this.settings('js') && this.settings('js').length !== 0) {
12256 + jsonData = JSON.parse(this.settings('js'));
12257 + }
12258 +
12259 + if (this.settings('on')) {
12260 + if ($('#' + particleID).length === 0) {
12261 + $(widgetContainer).prepend('<div id="' + particleID + '" class="bdt-particle-container"></div>');
12262 + }
12263 +
12264 + particlesJS(particleID, jsonData);
12265 +
12266 + }
12267 + }
12268 + });
12269 +
12270 + elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) {
12271 + elementorFrontend.elementsHandler.addHandler(Particles, {
12272 + $element: $scope
12273 + });
12274 + });
12275 +
12276 + elementorFrontend.hooks.addAction('frontend/element_ready/container', function ($scope) {
12277 + elementorFrontend.elementsHandler.addHandler(Particles, {
12278 + $element: $scope
12279 + });
12280 + });
12281 +
12282 + });
12283 +
12284 + }(jQuery, window.elementorFrontend));
12285 + /**
12286 + * Start portfolio carousel widget script
12287 + */
12288 +
12289 + (function ($, elementor) {
12290 +
12291 + 'use strict';
12292 +
12293 + var widgetPortfolioCarousel = function ($scope, $) {
12294 +
12295 + var $carousel = $scope.find('.bdt-portfolio-carousel');
12296 +
12297 + if (!$carousel.length) {
12298 + return;
12299 + }
12300 +
12301 + var $carouselContainer = $carousel.find('.swiper-carousel'),
12302 + $settings = $carousel.data('settings');
12303 +
12304 + const Swiper = elementorFrontend.utils.swiper;
12305 + initSwiper();
12306 + async function initSwiper() {
12307 + var swiper = await new Swiper($carouselContainer, $settings);
12308 +
12309 + if ($settings.pauseOnHover) {
12310 + $($carouselContainer).hover(function () {
12311 + (this).swiper.autoplay.stop();
12312 + }, function () {
12313 + (this).swiper.autoplay.start();
12314 + });
12315 + }
12316 +
12317 + };
12318 + };
12319 +
12320 +
12321 + jQuery(window).on('elementor/frontend/init', function () {
12322 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-carousel.default', widgetPortfolioCarousel);
12323 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-carousel.bdt-abetis', widgetPortfolioCarousel);
12324 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-carousel.bdt-fedara', widgetPortfolioCarousel);
12325 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-carousel.bdt-trosia', widgetPortfolioCarousel);
12326 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-carousel.bdt-janes', widgetPortfolioCarousel);
12327 + });
12328 +
12329 + }(jQuery, window.elementorFrontend));
12330 +
12331 + /**
12332 + * End portfolio carousel widget script
12333 + */
12334 + /**
12335 + * Start portfolio gallery widget script
12336 + */
12337 +
12338 + (function ($, elementor) {
12339 + 'use strict';
12340 + // PortfolioGallery
12341 + var widgetPortfolioGallery = function ($scope, $) {
12342 + var $portfolioGalleryWrapper = $scope.find('.bdt-portfolio-gallery-wrapper'),
12343 + $settings = $portfolioGalleryWrapper.data('settings'),
12344 + $portfolioFilter = $portfolioGalleryWrapper.find('.bdt-ep-grid-filters-wrapper');
12345 +
12346 + if (!$portfolioGalleryWrapper.length) {
12347 + return;
12348 + }
12349 +
12350 + if ($settings.tiltShow == true) {
12351 + var elements = document.querySelectorAll($settings.id + " [data-tilt]");
12352 + VanillaTilt.init(elements);
12353 + }
12354 +
12355 + if (!$portfolioFilter.length) {
12356 + return;
12357 + }
12358 + var $settings = $portfolioFilter.data('hash-settings');
12359 + var activeHash = $settings.activeHash;
12360 + var hashTopOffset = $settings.hashTopOffset;
12361 + var hashScrollspyTime = $settings.hashScrollspyTime;
12362 +
12363 + function hashHandler($portfolioFilter, hashScrollspyTime, hashTopOffset) {
12364 + if (window.location.hash) {
12365 + if ($($portfolioFilter).find('[bdt-filter-control="[data-filter*=\'' + window.location.hash.substring(1) + '\']"]').length) {
12366 + var hashTarget = $('[bdt-filter-control="[data-filter*=\'' + window.location.hash.substring(1) + '\']"]').closest($portfolioFilter).attr('id');
12367 + $('html, body').animate({
12368 + easing: 'slow',
12369 + scrollTop: $('#' + hashTarget).offset().top - hashTopOffset
12370 + }, hashScrollspyTime, function () {
12371 + //#code
12372 + }).promise().then(function () {
12373 + $('[bdt-filter-control="[data-filter*=\'' + window.location.hash.substring(1) + '\']"]').trigger("click");
12374 + });
12375 + }
12376 + }
12377 + }
12378 + if ($settings.activeHash == 'yes') {
12379 + $(window).on('load', function () {
12380 + hashHandler($portfolioFilter, hashScrollspyTime = 1500, hashTopOffset);
12381 + });
12382 + $($portfolioFilter).find('.bdt-ep-grid-filter').off('click').on('click', function (event) {
12383 + window.location.hash = ($.trim($(this).context.innerText.toLowerCase())).replace(/\s+/g, '-');
12384 + // hashHandler( $portfolioFilter, hashScrollspyTime, hashTopOffset);
12385 + });
12386 + $(window).on('hashchange', function (e) {
12387 + hashHandler($portfolioFilter, hashScrollspyTime, hashTopOffset);
12388 + });
12389 + }
12390 +
12391 +
12392 + //filter item count
12393 + var categories = {},
12394 + category;
12395 +
12396 + var arr = [];
12397 + var totalItem = 0;
12398 + $($portfolioGalleryWrapper).find(".bdt-portfolio-gallery div[data-filter]").each(function (i, el) {
12399 + category = $(el).data("filter");
12400 + let list = category.split(/\s+/);
12401 + $(list).each(function (i, el) {
12402 + arr.push(el);
12403 + });
12404 + totalItem = totalItem + 1;
12405 + });
12406 +
12407 + var counts = {};
12408 + arr.forEach(function (x) {
12409 + counts[x] = (counts[x] || 0) + 1;
12410 + });
12411 + //print total item result
12412 + $($portfolioGalleryWrapper).find('.bdt-all-count').text(totalItem);
12413 + // print results
12414 + for (var key in counts) {
12415 + $($portfolioGalleryWrapper).find('[data-bdt-target=' + key + '] .bdt-count').text(counts[key]);
12416 + }
12417 +
12418 +
12419 + };
12420 + jQuery(window).on('elementor/frontend/init', function () {
12421 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-gallery.default', widgetPortfolioGallery);
12422 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-gallery.bdt-abetis', widgetPortfolioGallery);
12423 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-gallery.bdt-fedara', widgetPortfolioGallery);
12424 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-gallery.bdt-trosia', widgetPortfolioGallery);
12425 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-portfolio-gallery.bdt-janes', widgetPortfolioGallery);
12426 + });
12427 + }(jQuery, window.elementorFrontend));
12428 +
12429 + /**
12430 + * End portfolio gallery widget script
12431 + */
12432 + (function ($, elementor) {
12433 + 'use strict';
12434 +
12435 + var widgetPostGallery = function ($scope, $) {
12436 + var $postGalleryWrapper = $scope.find('.bdt-post-gallery-wrapper'),
12437 + $bdtPostGallery = $scope.find('.bdt-post-gallery'),
12438 + $settings = $bdtPostGallery.data('settings'),
12439 + $postFilter = $postGalleryWrapper.find('.bdt-ep-grid-filters-wrapper'),
12440 + _skin = (typeof $settings !== 'undefined' && typeof $settings._skin !== 'undefined') ? $settings._skin.split('-').pop() : 'default',
12441 + isEditorMode = $('.elementor-editor-active').length > 0 ? true : false;
12442 +
12443 + const tiltSelector = $settings.id + " [data-tilt]";
12444 +
12445 + if (!$postGalleryWrapper.length) {
12446 + return;
12447 + }
12448 +
12449 + if ($settings.tilt_show == true) {
12450 + initializeTilt(tiltSelector);
12451 + }
12452 +
12453 + if (!$postFilter.length) {
12454 + return;
12455 + }
12456 +
12457 + var $hashSettings = $postFilter.data('hash-settings');
12458 + var activeHash = $hashSettings.activeHash;
12459 + var hashTopOffset = $hashSettings.hashTopOffset || 70;
12460 + var hashScrollspyTime = $hashSettings.hashScrollspyTime || 1000;
12461 +
12462 + var categoryCache = {},
12463 + tabs_header = $postGalleryWrapper.find(".bdt-ep-grid-filter"),
12464 + tabs = tabs_header.find(".bdt-option"),
12465 + loader = $postGalleryWrapper.find("#bdt-loading-image");
12466 +
12467 + // Function to load content via AJAX
12468 + function loadCategoryData(slug) {
12469 + $(loader).show();
12470 +
12471 + if (!isEditorMode && categoryCache[slug]) {
12472 + $bdtPostGallery.fadeOut(200, function () {
12473 + $(this)
12474 + .html(categoryCache[slug])
12475 + .fadeIn(300)
12476 + .css("transform", "translateY(-10px)")
12477 + .animate({ transform: "translateY(0)" }, 300);
12478 + });
12479 + $(loader).hide();
12480 + } else {
12481 + $.ajax({
12482 + url: ElementPackConfig.ajaxurl,
12483 + data: {
12484 + action: "bdt_post_gallery",
12485 + settings: $settings,
12486 + category: slug,
12487 + _skin: _skin,
12488 + nonce: ElementPackConfig.nonce,
12489 + },
12490 + type: "POST",
12491 + dataType: "HTML",
12492 + beforeSend: function () {
12493 + $(loader).show();
12494 + },
12495 + success: function (response) {
12496 + categoryCache[slug] = response;
12497 + $bdtPostGallery.fadeOut(200, function () {
12498 + $(this).html(response).fadeIn(300, function () {
12499 + if ($settings.tilt_show == true) {
12500 + destroyTiltInstances(tiltSelector);
12501 + initializeTilt(tiltSelector);
12502 + observeTiltElements(tiltSelector);
12503 + }
12504 + });
12505 + });
12506 + },
12507 + error: function (response) {
12508 + console.log(response);
12509 + },
12510 + complete: function () {
12511 + $(loader).hide();
12512 + },
12513 + });
12514 + }
12515 + }
12516 +
12517 + // Function to handle hash-based navigation
12518 + function hashHandler() {
12519 + if (window.location.hash) {
12520 + var hash = window.location.hash.substring(1);
12521 + var targetTab = tabs_header.find('[data-slug="' + hash + '"]');
12522 +
12523 + if (targetTab.length) {
12524 + tabs_header.removeClass("bdt-active");
12525 + targetTab.parent().addClass("bdt-active");
12526 +
12527 + loadCategoryData(hash);
12528 +
12529 + $('html, body').animate({
12530 + scrollTop: $postGalleryWrapper.offset().top - hashTopOffset
12531 + }, hashScrollspyTime);
12532 + }
12533 + }
12534 + }
12535 +
12536 + // Initialize hash-based navigation
12537 + if (activeHash) {
12538 + $(window).on('load', function () {
12539 + hashHandler();
12540 + });
12541 +
12542 + $(window).on('hashchange', function () {
12543 + hashHandler();
12544 + });
12545 + }
12546 +
12547 + // Tab click Handle
12548 + tabs.on("click", function (e) {
12549 + e.preventDefault();
12550 + var $this = $(this),
12551 + slug = $this.data("slug");
12552 +
12553 + tabs_header.removeClass("bdt-active");
12554 + $this.parent().addClass("bdt-active");
12555 +
12556 + loadCategoryData(slug);
12557 + });
12558 +
12559 + // Tilt effect functions
12560 + function destroyTiltInstances(selector) {
12561 + var elements = document.querySelectorAll(selector);
12562 + elements.forEach(function (element) {
12563 + if (element.vanillaTilt) {
12564 + element.vanillaTilt.destroy();
12565 + }
12566 + });
12567 + }
12568 +
12569 + function initializeTilt(selector) {
12570 + var elements = document.querySelectorAll(selector);
12571 + if (elements.length > 0) {
12572 + VanillaTilt.init(elements);
12573 + }
12574 + }
12575 +
12576 + function observeTiltElements(selector) {
12577 + var observer = new MutationObserver(function (mutations) {
12578 + mutations.forEach(function (mutation) {
12579 + if (mutation.type === 'childList') {
12580 + initializeTilt(selector);
12581 + }
12582 + });
12583 + });
12584 +
12585 + var container = document.querySelector($settings.id);
12586 + if (container) {
12587 + observer.observe(container, { childList: true, subtree: true });
12588 + }
12589 + }
12590 + };
12591 +
12592 + jQuery(window).on("elementor/frontend/init", function () {
12593 + [
12594 + "bdt-post-gallery.default",
12595 + "bdt-post-gallery.bdt-abetis",
12596 + "bdt-post-gallery.bdt-fedara",
12597 + "bdt-post-gallery.bdt-trosia",
12598 + ].forEach((hook) => elementorFrontend.hooks.addAction(`frontend/element_ready/${hook}`, widgetPostGallery));
12599 + });
12600 + })(jQuery, window.elementorFrontend);
12601 + /**
12602 + * Start post grid tab widget script
12603 + */
12604 +
12605 + ( function( $, elementor ) {
12606 +
12607 + 'use strict';
12608 +
12609 + var widgetPostGridTab = function( $scope, $ ) {
12610 +
12611 + var $postGridTab = $scope.find( '.bdt-post-grid-tab' ),
12612 + gridTab = $postGridTab.find('.gridtab');
12613 +
12614 + if ( ! $postGridTab.length ) {
12615 + return;
12616 + }
12617 +
12618 + $(gridTab).gridtab($postGridTab.data('settings'));
12619 +
12620 + };
12621 +
12622 +
12623 + jQuery(window).on('elementor/frontend/init', function() {
12624 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-post-grid-tab.default', widgetPostGridTab );
12625 + });
12626 +
12627 + }( jQuery, window.elementorFrontend ) );
12628 +
12629 + /**
12630 + * End post grid tab widget script
12631 + */
12632 +
12633 +
12634 + /**
12635 + * Start price table widget script
12636 + */
12637 +
12638 + ( function( $, elementor ) {
12639 +
12640 + 'use strict';
12641 +
12642 + var widgetPriceTable = function( $scope, $ ) {
12643 +
12644 + var $priceTable = $scope.find( '.bdt-price-table' ),
12645 + $featuresList = $priceTable.find( '.bdt-price-table-feature-inner' ),
12646 + $settings = $priceTable.data('settings');
12647 +
12648 + if ( ! $priceTable.length ) {
12649 + return;
12650 + }
12651 +
12652 + if ( $settings.read_more_toggle ) {
12653 +
12654 + var $read_more = $priceTable.find(".bdt-read-more-features");
12655 + var default_load = $priceTable.find(".bdt-read-more-features").data("bdt-default-load");
12656 + var $ul_listing = $priceTable.find(".bdt-price-table-features-list");
12657 +
12658 + // Hide list items beyond the default_load limit
12659 + $ul_listing.each(function() {
12660 + var $list = $(this); // Cache $(this)
12661 + $list.find("li:gt("+default_load+")").hide();
12662 + });
12663 +
12664 + $read_more.off("click").on("click", function(e) {
12665 + e.preventDefault();
12666 + var a = $(this),
12667 + $priceTable = a.closest(".bdt-price-table"),
12668 + $ul_listing = $priceTable.find(".bdt-price-table-features-list"),
12669 + $items_to_toggle = $ul_listing.find("li:gt("+default_load+")"),
12670 + $less_text = a.data("bdt-less"),
12671 + $more_text = a.data("bdt-more");
12672 +
12673 + if (a.hasClass("bdt-more")) {
12674 + // Show items with smooth animation
12675 + $items_to_toggle.each(function(index) {
12676 + var $item = $(this);
12677 + setTimeout(function() {
12678 + $item.slideDown(200);
12679 + }, index * 50); // Staggered animation for each item
12680 + });
12681 + a.text($less_text).addClass("bdt-less").removeClass("bdt-more");
12682 + } else if (a.hasClass("bdt-less")) {
12683 + // Hide items with smooth animation
12684 + $items_to_toggle.slideUp(300);
12685 + a.text($more_text).addClass("bdt-more").removeClass("bdt-less");
12686 + }
12687 + });
12688 +
12689 + }
12690 +
12691 + var $tooltip = $featuresList.find('> .bdt-tippy-tooltip'),
12692 + widgetID = $scope.data('id');
12693 +
12694 + $tooltip.each( function( index ) {
12695 + tippy( this, {
12696 + allowHTML: true,
12697 + theme: 'bdt-tippy-' + widgetID
12698 + });
12699 + });
12700 + };
12701 +
12702 + jQuery(window).on('elementor/frontend/init', function() {
12703 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-price-table.default', widgetPriceTable );
12704 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-price-table.bdt-partait', widgetPriceTable );
12705 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-price-table.bdt-erect', widgetPriceTable );
12706 + });
12707 +
12708 + }( jQuery, window.elementorFrontend ) );
12709 +
12710 + /**
12711 + * End price table widget script
12712 + */
12713 +
12714 +
12715 + /**
12716 + * Start qrcode widget script
12717 + */
12718 +
12719 + ( function( $, elementor ) {
12720 +
12721 + 'use strict';
12722 +
12723 + var widgetQRCode = function( $scope, $ ) {
12724 +
12725 + var $qrcode = $scope.find( '.bdt-qrcode' ),
12726 + image = $scope.find( '.bdt-qrcode-image' );
12727 +
12728 + if ( ! $qrcode.length ) {
12729 + return;
12730 + }
12731 + var settings = $qrcode.data('settings');
12732 + settings.image = image[0];
12733 +
12734 + $($qrcode).qrcode(settings);
12735 +
12736 + };
12737 +
12738 +
12739 + jQuery(window).on('elementor/frontend/init', function() {
12740 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-qrcode.default', widgetQRCode );
12741 + });
12742 +
12743 + }( jQuery, window.elementorFrontend ) );
12744 +
12745 + /**
12746 + * End qrcode widget script
12747 + */
12748 +
12749 +
12750 + (function ($, elementor) {
12751 +
12752 + 'use strict';
12753 + $(window).on('elementor/frontend/init', function () {
12754 + var ModuleHandler = elementorModules.frontend.handlers.Base,
12755 + RevealFX;
12756 +
12757 + RevealFX = ModuleHandler.extend({
12758 + bindEvents: function () {
12759 + this.run();
12760 + },
12761 + settings: function (key) {
12762 + return this.getElementSettings('element_pack_reveal_effects_' + key);
12763 + },
12764 + run: function () {
12765 +
12766 + if ('yes' !== this.settings('enable')) {
12767 + return;
12768 + }
12769 +
12770 + var options = this.getDefaultSettings(),
12771 + widgetID = this.$element.data('id'),
12772 + widgetContainer = $('.elementor-element-' + widgetID);
12773 +
12774 + $(widgetContainer).attr('data-ep-reveal', 'ep-reveal-' + widgetID + '');
12775 +
12776 + const revealID = '*[data-ep-reveal="ep-reveal-' + widgetID + '"]';
12777 + const revealWrapper = document.querySelector(revealID);
12778 + const revealFX = new RevealFx(revealWrapper, {
12779 + revealSettings: {
12780 + bgColors: this.settings('color') ? [this.settings('color')] : ['#333'],
12781 + direction: this.settings('direction') ? String(this.settings('direction')) : String('c'),
12782 + duration: this.settings('speed') ? Number(this.settings('speed.size') * 100) : Number(500),
12783 + easing: this.settings('easing') ? String(this.settings('easing')) : String('easeOutQuint'),
12784 + onHalfway: function (contentEl, ngsrevealerEl) {
12785 + contentEl.style.opacity = 1;
12786 + }
12787 + }
12788 + });
12789 +
12790 + var runReveal = function () {
12791 + revealFX.reveal();
12792 + this.destroy();
12793 + };
12794 +
12795 + epObserveTarget(revealWrapper, function () {
12796 + revealFX.reveal();
12797 + }, {
12798 + root: null, // Use the viewport as the root
12799 + rootMargin: '0px', // No margin around the root
12800 + threshold: 0.8 // 80% visibility (1 - 0.8)
12801 + });
12802 + }
12803 + });
12804 +
12805 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
12806 + elementorFrontend.elementsHandler.addHandler(RevealFX, {
12807 + $element: $scope
12808 + });
12809 + });
12810 + });
12811 +
12812 + }(jQuery, window.elementorFrontend));
12813 + (function ($, elementor) {
12814 + 'use strict';
12815 + $(window).on('elementor/frontend/init', function () {
12816 + var ModuleHandler = elementorModules.frontend.handlers.Base,
12817 + RippleEffects;
12818 +
12819 + RippleEffects = ModuleHandler.extend({
12820 + bindEvents: function () {
12821 + this.run();
12822 + },
12823 + getDefaultSettings: function () {
12824 + return {
12825 + multi: true,
12826 + };
12827 + },
12828 + onElementChange: debounce(function (prop) {
12829 + if (prop.indexOf('ep_ripple_') !== -1) {
12830 + this.run();
12831 + }
12832 + }, 400),
12833 + settings: function (key) {
12834 + return this.getElementSettings('ep_ripple_' + key);
12835 + },
12836 + run: function () {
12837 + if (this.settings('enable') !== 'yes') {
12838 + return;
12839 + }
12840 +
12841 + var $element = this.$element,
12842 + options = this.getDefaultSettings(),
12843 + $widgetId = 'ep-' + this.getID(),
12844 + $widgetClassSelect = '.elementor-element-' + this.getID(),
12845 + $selector = '';
12846 +
12847 + if (this.settings('selector') === 'widgets') {
12848 + $selector = $widgetClassSelect + ' > :first-child';
12849 + }
12850 + if (this.settings('selector') === 'images') {
12851 + $selector = $widgetClassSelect + ' img';
12852 + }
12853 + if (this.settings('selector') === 'buttons') {
12854 + $selector = $widgetClassSelect + ' a';
12855 + }
12856 + if (this.settings('selector') === 'both') {
12857 + $selector = $widgetClassSelect + ' a,' + $widgetClassSelect + ' img';
12858 + }
12859 + if (this.settings('selector') === 'custom' && this.settings('custom_selector')) {
12860 + $selector = $widgetClassSelect + ' ' + this.settings('custom_selector');
12861 + }
12862 +
12863 + if ('' === $selector ) {
12864 + return;
12865 + }
12866 +
12867 + $(document).on('click', '[href="#"]', function (e) { e.preventDefault(); });
12868 + if (this.settings('on')) {
12869 + options.on = this.settings('on');
12870 + }
12871 + if (this.settings('easing')) {
12872 + options.easing = this.settings('easing');
12873 + }
12874 + if (this.settings('duration.size')) {
12875 + options.duration = this.settings('duration.size');
12876 + }
12877 + if (this.settings('opacity.size')) {
12878 + options.opacity = this.settings('opacity.size');
12879 + }
12880 + if (this.settings('color')) {
12881 + options.color = this.settings('color');
12882 + }
12883 +
12884 + document.querySelectorAll($selector).forEach(function (el) {
12885 + if ('IMG' == el.tagName) {
12886 + var $image = $(el);
12887 + $image.wrap('<div id="bdt-ripple-effect-img-wrapper-' + $widgetId + '"></div>');
12888 + window.rippler = $.ripple('#bdt-ripple-effect-img-wrapper-' + $widgetId, options);
12889 + } else {
12890 + window.rippler = $.ripple($selector, options);
12891 + }
12892 + });
12893 + }
12894 + });
12895 +
12896 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
12897 + elementorFrontend.elementsHandler.addHandler(RippleEffects, {
12898 + $element: $scope
12899 + });
12900 + });
12901 + });
12902 +
12903 + }(jQuery, window.elementorFrontend));
12904 +
12905 + /**
12906 + * Start section sticky widget script
12907 + */
12908 +
12909 + (function ($, elementor) {
12910 +
12911 + 'use strict';
12912 +
12913 + // Debounce function to prevent excessive function calls
12914 + function debounce(func, wait) {
12915 + var timeout;
12916 + return function executedFunction() {
12917 + var later = function() {
12918 + clearTimeout(timeout);
12919 + func();
12920 + };
12921 + clearTimeout(timeout);
12922 + timeout = setTimeout(later, wait);
12923 + };
12924 + }
12925 +
12926 + // Function to handle dynamic positioning for sticky elements
12927 + function handleDynamicPositioning($stickyElement) {
12928 + var stickyData = $stickyElement.attr('data-bdt-sticky');
12929 +
12930 + // Check if dynamic positioning is enabled
12931 + if (!stickyData) {
12932 + return;
12933 + }
12934 +
12935 + // Store original position for reference
12936 + var originalOffset = $stickyElement.offset();
12937 + var originalLeft = originalOffset ? originalOffset.left : 0;
12938 + var isPositioned = false;
12939 +
12940 + // Function to calculate inset value
12941 + function calculateInsetValue() {
12942 + var elementWidth = $stickyElement.outerWidth();
12943 + var documentWidth = $(document).width();
12944 + var isRTL = $('html').attr('dir') === 'rtl' || $('body').hasClass('rtl');
12945 +
12946 + return isRTL ?
12947 + Math.max(documentWidth - elementWidth - originalLeft, 0) :
12948 + originalLeft;
12949 + }
12950 +
12951 + // Function to apply or remove positioning
12952 + function updatePositioning(immediate) {
12953 + if ($stickyElement.hasClass('bdt-active')) {
12954 + if (!isPositioned) {
12955 + var insetValue = calculateInsetValue();
12956 + $stickyElement.css({
12957 + 'inset-inline-start': insetValue + 'px',
12958 + 'transition': immediate ? 'none' : 'inset-inline-start 0.15s ease-out'
12959 + });
12960 + isPositioned = true;
12961 + }
12962 + } else {
12963 + if (isPositioned) {
12964 + $stickyElement.css({
12965 + 'inset-inline-start': '',
12966 + 'transition': 'inset-inline-start 0.15s ease-out'
12967 + });
12968 + isPositioned = false;
12969 + }
12970 + }
12971 + }
12972 +
12973 + // Debounced resize handler
12974 + var debouncedResize = debounce(function() {
12975 + if (isPositioned) {
12976 + updatePositioning(true);
12977 + }
12978 + }, 100);
12979 +
12980 + // Update on window resize
12981 + $(window).on('resize', debouncedResize);
12982 +
12983 + // Update when sticky becomes active (using MutationObserver)
12984 + var observer = new MutationObserver(function (mutations) {
12985 + mutations.forEach(function (mutation) {
12986 + if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
12987 + // Use requestAnimationFrame for smooth transitions
12988 + requestAnimationFrame(function() {
12989 + updatePositioning(false);
12990 + });
12991 + }
12992 + });
12993 + });
12994 +
12995 + observer.observe($stickyElement[0], {
12996 + attributes: true,
12997 + attributeFilter: ['class']
12998 + });
12999 +
13000 + // Listen for UIkit sticky events with proper timing
13001 + $stickyElement.on('active', function () {
13002 + requestAnimationFrame(function() {
13003 + updatePositioning(true);
13004 + });
13005 + });
13006 +
13007 + $stickyElement.on('inactive', function () {
13008 + requestAnimationFrame(function() {
13009 + updatePositioning(false);
13010 + });
13011 + });
13012 +
13013 + // Initial check with delay to ensure proper initialization
13014 + setTimeout(function() {
13015 + updatePositioning(true);
13016 + }, 150);
13017 + }
13018 +
13019 + var widgetSectionSticky = function ($scope, $) {
13020 + var $section = $scope;
13021 +
13022 + // Sticky fixes for inner section
13023 + $section.each(function () {
13024 + var $stickyFound = $(this).find('.elementor-inner-section.bdt-sticky');
13025 + if ($stickyFound.length) {
13026 + $stickyFound.wrap('<div class="bdt-sticky-wrapper"></div>');
13027 + }
13028 + });
13029 +
13030 + // Handle dynamic positioning for sticky elements
13031 + var $stickyElements = $section.find('[data-bdt-sticky]');
13032 + if ($stickyElements.length === 0) {
13033 + $stickyElements = $('[data-bdt-sticky]');
13034 + }
13035 +
13036 + $stickyElements.each(function () {
13037 + handleDynamicPositioning($(this));
13038 + });
13039 + };
13040 +
13041 + // Handle elements that might already be present
13042 + $(document).ready(function () {
13043 + $('[data-bdt-sticky]').each(function () {
13044 + handleDynamicPositioning($(this));
13045 + });
13046 + });
13047 +
13048 + // Initialize on Elementor frontend
13049 + $(window).on('elementor/frontend/init', function () {
13050 + elementorFrontend.hooks.addAction('frontend/element_ready/section', widgetSectionSticky);
13051 + });
13052 +
13053 + }(jQuery, window.elementorFrontend));
13054 +
13055 + /**
13056 + * End section sticky widget script
13057 + */
13058 +
13059 + /**
13060 + * Start slideshow widget script
13061 + */
13062 +
13063 + (function($, elementor) {
13064 +
13065 + 'use strict';
13066 +
13067 + var widgetSlideshow = function($scope, $) {
13068 +
13069 + var $slideshow = $scope.find( '.bdt-slideshow' ),
13070 + $thumbNav = $($slideshow).find('.bdt-thumbnav-wrapper > .bdt-thumbnav-scroller');
13071 +
13072 + if ( ! $slideshow.length ) {
13073 + return;
13074 + }
13075 +
13076 + $($thumbNav).mThumbnailScroller({
13077 + axis: 'yx',
13078 + type: 'hover-precise'
13079 + });
13080 +
13081 + };
13082 +
13083 +
13084 + jQuery(window).on('elementor/frontend/init', function() {
13085 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-slideshow.default', widgetSlideshow);
13086 + });
13087 +
13088 + }(jQuery, window.elementorFrontend));
13089 +
13090 + /**
13091 + * End slideshow widget script
13092 + */
13093 +
13094 +
13095 + /**
13096 + * Start vertical menu widget script
13097 + */
13098 +
13099 + (function ($, elementor) {
13100 + 'use strict';
13101 + // Vertical Menu
13102 + var widgetSlinkyVerticalMenu = function ($scope, $) {
13103 + var $vrMenu = $scope.find('.bdt-slinky-vertical-menu');
13104 + var $settings = $vrMenu.attr('id');
13105 + if (!$vrMenu.length) {
13106 + return;
13107 + }
13108 +
13109 + const slinky = $('#'+$settings).slinky();
13110 +
13111 + // Override the _move method to handle RTL (moved from vendor)
13112 + const isRTL = document.documentElement.dir === 'rtl';
13113 + if (isRTL) {
13114 + slinky._move = function(depth) {
13115 + // get current position from the right
13116 + const right = Math.round(parseInt($('#'+$settings).children().first().get(0).style.right)) || 0;
13117 +
13118 + // set the new position from the right
13119 + $('#'+$settings).children().first().css("right", `${right - depth * 100}%`);
13120 + };
13121 + };
13122 + };
13123 +
13124 + jQuery(window).on('elementor/frontend/init', function () {
13125 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-slinky-vertical-menu.default', widgetSlinkyVerticalMenu);
13126 + });
13127 +
13128 + }(jQuery, window.elementorFrontend));
13129 +
13130 + /**
13131 + * End vertical menu widget script
13132 + */
13133 +
13134 +
13135 + ;
13136 + (function ($, elementor) {
13137 + $(window).on('elementor/frontend/init', function () {
13138 + var ModuleHandler = elementorModules.frontend.handlers.Base,
13139 + SoundEffects;
13140 +
13141 + SoundEffects = ModuleHandler.extend({
13142 +
13143 + bindEvents: function () {
13144 + this.run();
13145 + },
13146 +
13147 + getDefaultSettings: function () {
13148 + return {
13149 + event: 'hover',
13150 + };
13151 + },
13152 +
13153 + onElementChange: debounce(function (prop) {
13154 + if (prop.indexOf('ep_sound_effects_') !== -1) {
13155 + this.run();
13156 + }
13157 + }, 400),
13158 +
13159 + settings: function (key) {
13160 + return this.getElementSettings('ep_sound_effects_' + key);
13161 + },
13162 +
13163 + run: function () {
13164 + if (this.settings('active') != 'yes') {
13165 + return;
13166 + }
13167 + var options = this.getDefaultSettings(),
13168 + $element = '',
13169 + $widgetId = 'ep-sound-effects' + this.getID(),
13170 + $widgetIdSelect = '#' + $widgetId,
13171 + $soundAudioSource, $soundAudioSourceMp3;
13172 +
13173 + /**
13174 + * Selector creating...
13175 + */
13176 + $(this.findElement('> :first-child').get(0)).attr('id', $widgetId);
13177 +
13178 + if (this.settings('select_type') === 'widget') {
13179 + $element = $($widgetIdSelect);
13180 + } else if (this.settings('select_type') === 'anchor_tag') {
13181 + $element = $($widgetIdSelect + ' a');
13182 + } else if (this.settings('select_type') === 'custom') {
13183 + if (this.settings('element_selector')) {
13184 + $element = $($widgetIdSelect).find(this.settings('element_selector'));
13185 + }
13186 + }
13187 +
13188 + // audio source
13189 +
13190 + if (this.settings('source') !== 'hosted_url') {
13191 + $soundAudioSource = this.settings('source_local_link') + this.settings('source');
13192 + } else {
13193 + if (this.settings('hosted_url.url')) {
13194 + $soundAudioSource = this.settings('hosted_url.url').replace(/\.[^/.]+$/, "");
13195 + $soundAudioSourceMp3 = this.settings('hosted_url_mp3.url').replace(/\.[^/.]+$/, "");
13196 + }
13197 + }
13198 +
13199 + if (!$soundAudioSource) {
13200 + return;
13201 + }
13202 +
13203 + if (!document.createElement('audio').canPlayType) {
13204 + console.error('Oh man 😩! \nYour browser doesn\'t support audio awesomeness.');
13205 + return function () { }; // return an empty function if `loudLinks` is called again.
13206 + }
13207 +
13208 + // Create audio element and make it awesome
13209 + var audioPlayer = document.createElement('audio'),
13210 + mp3Source = document.createElement('source'),
13211 + oggSource = document.createElement('source'),
13212 + eventsSet = false;
13213 +
13214 + audioPlayer.setAttribute('preload', true); // audio element preload attribute
13215 +
13216 + mp3Source.setAttribute('type', 'audio/mpeg');
13217 + oggSource.setAttribute('type', 'audio/ogg');
13218 +
13219 + // appending the sources to the player element
13220 + audioPlayer.appendChild(mp3Source);
13221 + audioPlayer.appendChild(oggSource);
13222 +
13223 + // appending audioplayer to body
13224 + document.body.appendChild(audioPlayer);
13225 +
13226 + // Play audio
13227 + function playAudio() {
13228 +
13229 + // get the audio source and appending it to <audio>
13230 + var audioSrc = $soundAudioSource, //'http://192.168.1.100/cat-meow',
13231 + soundMp3Link,
13232 + soundOggLink;
13233 +
13234 + if (!audioSrc) {
13235 + return;
13236 + }
13237 +
13238 + if ($soundAudioSourceMp3) {
13239 + soundMp3Link = $soundAudioSourceMp3 + '.mp3';
13240 + }
13241 +
13242 + soundOggLink = audioSrc + '.ogg';
13243 +
13244 + if (!eventsSet) {
13245 + eventsSet = true;
13246 + // mp3Source.addEventListener('error', function () {
13247 + // console.error('😶 D\'oh! The mp3 file URL is wrong!');
13248 + // });
13249 + oggSource.addEventListener('error', function () {
13250 + console.error('😶 D\'oh! The ogg file URL is wrong!');
13251 + });
13252 + }
13253 +
13254 + // Only reset `src` and reload if source is different
13255 + if (soundMp3Link || soundOggLink) {
13256 + if ($soundAudioSourceMp3) {
13257 + mp3Source.setAttribute('src', soundMp3Link);
13258 + }
13259 + oggSource.setAttribute('src', soundOggLink);
13260 +
13261 + audioPlayer.load();
13262 +
13263 + }
13264 +
13265 + audioPlayer.play();
13266 +
13267 + }
13268 +
13269 + // Stop audio
13270 + function stopAudio() {
13271 + audioPlayer.pause();
13272 + audioPlayer.currentTime = 0; // reset to beginning
13273 + }
13274 +
13275 + var initScope = this;
13276 +
13277 + jQuery(document).ready(function () {
13278 + //hover
13279 + if (initScope.settings('event') == 'hover') {
13280 +
13281 + jQuery($element).on('mouseenter', function () {
13282 + playAudio();
13283 + });
13284 + jQuery($element).on('mouseleave', function () {
13285 + stopAudio();
13286 + });
13287 + // jQuery($element).on('touchmove', function () {
13288 + // stopAudio();
13289 + // });
13290 + jQuery($element).on('click', function () {
13291 + stopAudio();
13292 + });
13293 +
13294 + jQuery($element).on('touchstart', function () {
13295 + playAudio();
13296 + });
13297 +
13298 + }
13299 +
13300 + // click
13301 + if (initScope.settings('event') == 'click') {
13302 + $($element).on('click', function () {
13303 + playAudio();
13304 + });
13305 + }
13306 +
13307 + });
13308 +
13309 + }
13310 +
13311 + });
13312 +
13313 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
13314 + elementorFrontend.elementsHandler.addHandler(SoundEffects, {
13315 + $element: $scope
13316 + });
13317 + });
13318 +
13319 + });
13320 +
13321 + })(jQuery, window.elementorFrontend);
13322 +
13323 + /**
13324 + * Start source code widget script
13325 + */
13326 +
13327 + ( function( $, elementor ) {
13328 +
13329 + 'use strict';
13330 +
13331 + var sourceCodeWidget = function( $scope, $ ) {
13332 + var $sourceCode = $scope.find('.bdt-source-code'),
13333 + $preCode = $sourceCode.find('pre > code');
13334 +
13335 + if ( ! $sourceCode.length ) {
13336 + return;
13337 + }
13338 +
13339 + // create clipboard for every copy element
13340 + var clipboard = new ClipboardJS('.bdt-copy-button', {
13341 + target: function target(trigger) {
13342 + return trigger.nextElementSibling;
13343 + }
13344 + });
13345 +
13346 + // do stuff when copy is clicked
13347 + clipboard.on('success', function (event) {
13348 + event.trigger.textContent = 'copied!';
13349 + setTimeout(function () {
13350 + event.clearSelection();
13351 + event.trigger.textContent = 'copy';
13352 + }, 2000);
13353 + });
13354 +
13355 + //if ($lng_type !== undefined && $code !== undefined) {
13356 + Prism.highlightElement($preCode.get(0));
13357 + // }
13358 +
13359 + };
13360 +
13361 + jQuery(window).on('elementor/frontend/init', function() {
13362 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-source-code.default', sourceCodeWidget );
13363 + });
13364 +
13365 + }( jQuery, window.elementorFrontend ) );
13366 +
13367 + /**
13368 + * End source code widget script
13369 + */
13370 +
13371 +
13372 + /**
13373 + * Start switcher widget script
13374 + */
13375 +
13376 + (function ($, elementor) {
13377 +
13378 + 'use strict';
13379 +
13380 + var sectionSwitcher = function ($scope, $) {
13381 + var $switcher = $scope.find('.bdt-switchers'),
13382 + $settings = $switcher.data('settings'),
13383 + $activatorSettings = $switcher.data('activator'),
13384 + $settingsLinkWidget = $switcher.data('bdt-link-widget'),
13385 + editMode = Boolean(elementorFrontend.isEditMode());
13386 +
13387 +
13388 + if ($activatorSettings) {
13389 + const switcherActivator = `#bdt-switcher-activator-${$activatorSettings.id}`;
13390 + const switcherMain = `#bdt-switcher-${$activatorSettings.id}`;
13391 +
13392 + function toggleSwitcher(index) {
13393 + bdtUIkit.switcher(switcherActivator).show(index);
13394 + bdtUIkit.switcher(switcherMain).show(index);
13395 +
13396 + if ($settingsLinkWidget) {
13397 + const showA = index === 0;
13398 + $($settingsLinkWidget.linkWidgetTargetA).css({ 'opacity': showA ? 1 : 0, 'display': showA ? 'block' : 'none' });
13399 + $($settingsLinkWidget.linkWidgetTargetB).css({ 'opacity': showA ? 0 : 1, 'display': showA ? 'none' : 'block' });
13400 + }
13401 + }
13402 +
13403 + bdtUIkit.util.on($activatorSettings.switchA, "click", () => toggleSwitcher(0));
13404 + bdtUIkit.util.on($activatorSettings.switchB, "click", () => toggleSwitcher(1));
13405 + }
13406 +
13407 + if ($settings !== undefined && editMode === false) {
13408 + var $switchAContainer = $switcher.find('.bdt-switcher > div > div > .bdt-switcher-item-a'),
13409 + $switchBContainer = $switcher.find('.bdt-switcher > div > div > .bdt-switcher-item-b'),
13410 + $switcherContentA = $('.elementor').find('.elementor-element' + '#' + $settings['switch-a-content']),
13411 + $switcherContentB = $('.elementor').find('.elementor-element' + '#' + $settings['switch-b-content']);
13412 +
13413 + if ($settings.positionUnchanged !== true) {
13414 + if ($switchAContainer.length && $switcherContentA.length) {
13415 + $($switcherContentA).appendTo($switchAContainer);
13416 + }
13417 +
13418 + if ($switchBContainer.length && $switcherContentB.length) {
13419 + $($switcherContentB).appendTo($switchBContainer);
13420 + }
13421 + }
13422 +
13423 + if ($settings.positionUnchanged == true) {
13424 + $('#bdt-tabs-' + $settings.id).find('.bdt-switcher').remove();
13425 +
13426 + var $switcherContentAAA = $('#' + $settings['switch-a-content']);
13427 + var $switcherContentBBB = $('#' + $settings['switch-b-content']);
13428 +
13429 + $('#' + $settings['switch-a-content']).parent().append(`<div id="bdt-switcher-${$settings.id}" class="bdt-switcher bdt-switcher-item-content" style="width:100%;"></div>`);
13430 +
13431 + $($switcherContentAAA).appendTo($('#bdt-switcher-' + $settings.id));
13432 + $($switcherContentBBB).appendTo($('#bdt-switcher-' + $settings.id));
13433 +
13434 + var $activeA, $activeB = '';
13435 + if ($settings.defaultActive == 'a') {
13436 + $activeA, $activeA = 'bdt-active';
13437 + } else {
13438 + $activeB = 'bdt-active';
13439 + }
13440 +
13441 + $('#' + $settings['switch-a-content']).wrapAll('<div class="bdt-switcher-item-content-inner ' + $activeA + '"></div>');
13442 + $('#' + $settings['switch-b-content']).wrapAll('<div class="bdt-switcher-item-content-inner ' + $activeB + '"></div>');
13443 + }
13444 + }
13445 +
13446 +
13447 + if ($settingsLinkWidget !== undefined && editMode === false) {
13448 + var $targetA = $($settingsLinkWidget.linkWidgetTargetA),
13449 + $targetB = $($settingsLinkWidget.linkWidgetTargetB),
13450 + $switcher = '#bdt-switcher-' + $settingsLinkWidget.id;
13451 +
13452 + if ($settingsLinkWidget.defaultActive == 'a') {
13453 + $targetA.css({
13454 + 'opacity': 1,
13455 + 'display': 'block'
13456 + });
13457 + $targetB.css({
13458 + 'opacity': 0,
13459 + 'display': 'none'
13460 + });
13461 + } else {
13462 + $targetA.css({
13463 + 'opacity': 0,
13464 + 'display': 'none'
13465 + });
13466 + $targetB.css({
13467 + 'opacity': 1,
13468 + 'display': 'block'
13469 + });
13470 + }
13471 +
13472 + $targetA.css({
13473 + 'grid-row-start': 1,
13474 + 'grid-column-start': 1
13475 + });
13476 + $targetB.css({
13477 + 'grid-row-start': 1,
13478 + 'grid-column-start': 1
13479 + });
13480 +
13481 + $targetA.parent().css({
13482 + 'display': 'grid'
13483 + });
13484 +
13485 + bdtUIkit.util.on($switcher, 'shown', function (e) {
13486 + var index = bdtUIkit.util.index(e.target)
13487 + if (index == 0) {
13488 + $targetA.css({
13489 + 'opacity': 1,
13490 + 'display': 'block',
13491 + });
13492 + $targetB.css({
13493 + 'opacity': 0,
13494 + 'display': 'none',
13495 + });
13496 + } else {
13497 + $targetB.css({
13498 + 'opacity': 1,
13499 + 'display': 'block',
13500 + });
13501 + $targetA.css({
13502 + 'opacity': 0,
13503 + 'display': 'none',
13504 + });
13505 + }
13506 +
13507 + })
13508 + }
13509 +
13510 +
13511 + };
13512 +
13513 + jQuery(window).on('elementor/frontend/init', function () {
13514 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-switcher.default', sectionSwitcher);
13515 + });
13516 +
13517 + }(jQuery, window.elementorFrontend));
13518 +
13519 + /**
13520 + * End switcher widget script
13521 + */
13522 + ; (function ($, elementor) {
13523 + $(window).on('elementor/frontend/init', function () {
13524 + let ModuleHandler = elementorModules.frontend.handlers.Base,
13525 + textReadMore;
13526 +
13527 + textReadMore = ModuleHandler.extend({
13528 + bindEvents: function () {
13529 + this.run();
13530 + },
13531 + getDefaultSettings: function () {
13532 + return {
13533 + allowHTML: true,
13534 + };
13535 + },
13536 +
13537 + onElementChange: debounce(function (prop) {
13538 + if (prop.indexOf('ep_text_read_more_') !== -1) {
13539 + this.run();
13540 + }
13541 + }, 400),
13542 +
13543 + settings: function (key) {
13544 + return this.getElementSettings('ep_text_read_more_' + key);
13545 + },
13546 +
13547 + run: function () {
13548 + var tileScroll_ID = 'bdt-tile-scroll-container-' + this.$element.data('id'),
13549 + widgetID = this.$element.data('id'),
13550 + widgetContainer = $('.elementor-element-' + widgetID);
13551 + var button_style = this.settings('button_style');
13552 + if (this.settings('enable') === 'yes') {
13553 + const dReadMore = new DReadMore();
13554 +
13555 + window.addEventListener('resize', function () {
13556 + dReadMore.forEach(function (item) {
13557 + item.update();
13558 + });
13559 + });
13560 + } else {
13561 + return;
13562 + }
13563 +
13564 + }
13565 + });
13566 +
13567 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
13568 + elementorFrontend.elementsHandler.addHandler(textReadMore, {
13569 + $element: $scope
13570 + });
13571 + });
13572 + });
13573 + })(jQuery, window.elementorFrontend);
13574 +
13575 + /**
13576 + * Start table of content widget script
13577 + */
13578 +
13579 + ( function( $, elementor ) {
13580 +
13581 + 'use strict';
13582 +
13583 + var widgetTableOfContent = function( $scope, $ ) {
13584 +
13585 + var $tableOfContent = $scope.find( '.bdt-table-of-content' );
13586 +
13587 + if ( ! $tableOfContent.length ) {
13588 + return;
13589 + }
13590 +
13591 + $($tableOfContent).tocify($tableOfContent.data('settings'));
13592 +
13593 + // Handle incoming hash URLs only if hash navigation is enabled
13594 + var settings = $tableOfContent.data('settings');
13595 + if (settings && settings.hashNavigation) {
13596 + handleHashOnLoad($tableOfContent);
13597 + }
13598 +
13599 + };
13600 +
13601 + function handleHashOnLoad($tableOfContent) {
13602 + var hash = window.location.hash;
13603 + if (hash && hash.length > 1) {
13604 + setTimeout(function() {
13605 + var target = $('[name="' + hash.substring(1) + '"]');
13606 + if (target.length) {
13607 + // Get scroll offset from TOC settings
13608 + var settings = $tableOfContent.data('settings');
13609 + var scrollOffset = settings ? (settings.scrollTo || 0) : 0;
13610 +
13611 + $('html, body').animate({
13612 + scrollTop: target.offset().top - scrollOffset
13613 + }, 800);
13614 + }
13615 + }, 1500);
13616 + }
13617 + }
13618 +
13619 + jQuery(window).on('elementor/frontend/init', function() {
13620 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-table-of-content.default', widgetTableOfContent );
13621 + });
13622 +
13623 + }( jQuery, window.elementorFrontend ) );
13624 +
13625 + /**
13626 + * End table of content widget script
13627 + */
13628 +
13629 +
13630 +
13631 + /**
13632 + * Start table widget script
13633 + */
13634 +
13635 + (function ($, elementor) {
13636 +
13637 + 'use strict';
13638 +
13639 + var widgetTable = function ($scope, $) {
13640 +
13641 + var $tableContainer = $scope.find('.bdt-data-table'),
13642 + $settings = $tableContainer.data('settings'),
13643 + $table = $tableContainer.find('> table'),
13644 + editMode = Boolean(elementorFrontend.isEditMode());
13645 +
13646 + if (!$tableContainer.length) {
13647 + return;
13648 + }
13649 +
13650 + $settings.language = window.ElementPackConfig.data_table.language;
13651 +
13652 + if (editMode) {
13653 + DataTable.ext.errMode = function (s, tn, msg) {
13654 + console.log(msg, tn);
13655 + };
13656 + }
13657 +
13658 + $($table).DataTable($settings);
13659 +
13660 + };
13661 +
13662 +
13663 + jQuery(window).on('elementor/frontend/init', function () {
13664 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-table.default', widgetTable);
13665 + });
13666 +
13667 + }(jQuery, window.elementorFrontend));
13668 +
13669 + /**
13670 + * End table widget script
13671 + */
13672 + /**
13673 + * Start tabs widget script
13674 + */
13675 +
13676 + (function ($, elementor) {
13677 + 'use strict';
13678 + var widgetTabs = function ($scope, $) {
13679 + const $tabsArea = $scope.find('.bdt-tabs-area'),
13680 + $tabs = $tabsArea.find('.bdt-tabs'),
13681 + $tab = $tabs.find('.bdt-tab'),
13682 + editMode = Boolean(elementorFrontend.isEditMode());
13683 +
13684 + if (!$tabsArea.length) {
13685 + return;
13686 + }
13687 + const $settings = $tabs.data('settings'),
13688 + animTime = $settings.hashScrollspyTime,
13689 + customOffset = $settings.hashTopOffset,
13690 + navStickyOffset = $settings.navStickyOffset;
13691 +
13692 + if (navStickyOffset == 'undefined') {
13693 + navStickyOffset = 10;
13694 + }
13695 +
13696 + $scope.find('.bdt-template-modal-iframe-edit-link').each(function () {
13697 + var modal = $($(this).data('modal-element'));
13698 + $(this).on('click', function (event) {
13699 + bdtUIkit.modal(modal).show();
13700 + });
13701 + modal.on('beforehide', function () {
13702 + window.parent.location.reload();
13703 + });
13704 + });
13705 +
13706 +
13707 + function hashHandler($tabs, $tab, animTime, customOffset) {
13708 + // debugger;
13709 + if (window.location.hash) {
13710 + var currentHash = window.location.hash.substring(1);
13711 +
13712 + var currentHash = decodeURIComponent(window.location.hash.substring(1));
13713 +
13714 + var $targetTab = $($tabs).find('[data-title]').filter(function() {
13715 + return $(this).attr('data-title').toLowerCase() === currentHash.toLowerCase();
13716 + });
13717 +
13718 + // Case-insensitive matching
13719 + var $targetTab = $($tabs).find('[data-title]').filter(function() {
13720 + var dataTitle = $.trim($(this).attr('data-title')).toLowerCase();
13721 + var hashValue = $.trim(currentHash).toLowerCase();
13722 + var matches = dataTitle === hashValue;
13723 + return matches;
13724 + });
13725 +
13726 +
13727 + if ($targetTab.length) {
13728 + var hashTarget = $targetTab.closest($tabs).attr('id');
13729 + $('html, body').animate({
13730 + easing: 'slow',
13731 + scrollTop: $('#' + hashTarget).offset().top - customOffset
13732 + }, animTime, function () {
13733 + //#code
13734 + }).promise().then(function () {
13735 +
13736 + try {
13737 + var tabInstance = bdtUIkit.tab($tab);
13738 + tabInstance.show($targetTab.data('tab-index'));
13739 + } catch{}
13740 + });
13741 + }
13742 + }
13743 + }
13744 + if ($settings.activeHash == 'yes' && $settings.status != 'bdt-sticky-custom') {
13745 + $(document).ready(function () {
13746 + setTimeout(function() {
13747 + hashHandler($tabs, $tab, animTime, customOffset);
13748 + }, 100);
13749 + });
13750 + $(window).on('load', function () {
13751 + setTimeout(function() {
13752 + hashHandler($tabs, $tab, animTime, customOffset);
13753 + }, 100);
13754 + });
13755 + $($tabs).find('.bdt-tabs-item-title').off('click').on('click', function (event) {
13756 + event.preventDefault();
13757 + // Encode and Decoded
13758 + const title = $.trim($(this).attr('data-title'));
13759 + // Set encoded hash for logic
13760 + const encoded = encodeURIComponent(title);
13761 + // Update location.hash (encoded, works with browser reloads)
13762 + window.location.hash = encoded;
13763 + // Replace the ugly encoded with friendly version
13764 + history.replaceState(null, null, '#' + title);
13765 + // window.location.hash = ($.trim($(this).attr('data-title')));
13766 + });
13767 + $(window).on('hashchange', function (e) {
13768 + hashHandler($tabs, $tab, animTime, customOffset);
13769 + });
13770 + }
13771 + //# code for sticky and also for sticky with hash
13772 + function stickyHachChange($tabs, $tab, navStickyOffset) {
13773 + var currentHash = window.location.hash.substring(1);
13774 +
13775 + //Decode for both decode and encoding
13776 + var decodedHash = decodeURIComponent(currentHash);
13777 +
13778 + var $targetTab = $($tabs).find('[data-title]').filter(function() {
13779 + return $(this).attr('data-title').toLowerCase() === decodedHash.toLowerCase();
13780 + });
13781 +
13782 + if ($targetTab.length) {
13783 + var hashTarget = $targetTab.closest($tabs).attr('id');
13784 + $('html, body').animate({
13785 + easing: 'slow',
13786 + scrollTop: $('#' + hashTarget).offset().top - navStickyOffset
13787 + }, 1000, function () {
13788 + //#code
13789 + }).promise().then(function () {
13790 + bdtUIkit.tab($tab).show($targetTab.data('tab-index'));
13791 + });
13792 + }
13793 + }
13794 + if ($settings.status == 'bdt-sticky-custom') {
13795 + $($tabs).find('.bdt-tabs-item-title').bind().click('click', function (event) {
13796 + if ($settings.activeHash == 'yes') {
13797 + // Encode and Decoded
13798 + const title = $.trim($(this).attr('data-title'));
13799 + // Set encoded hash for logic
13800 + const encoded = encodeURIComponent(title);
13801 + // Update location.hash (encoded, works with browser reloads)
13802 + window.location.hash = encoded;
13803 + // Replace the ugly encoded with friendly version
13804 + history.replaceState(null, null, '#' + title);
13805 + } else {
13806 + $('html, body').animate({
13807 + easing: 'slow',
13808 + scrollTop: $($tabs).offset().top - navStickyOffset
13809 + }, 500, function () {
13810 + //#code
13811 + });
13812 + }
13813 + });
13814 + // # actived Hash#
13815 + if ($settings.activeHash == 'yes' && $settings.status == 'bdt-sticky-custom') {
13816 + $(document).ready(function () {
13817 + if (window.location.hash) {
13818 + setTimeout(function() {
13819 + stickyHachChange($tabs, $tab, navStickyOffset);
13820 + }, 100);
13821 + }
13822 + });
13823 + $(window).on('load', function () {
13824 + if (window.location.hash) {
13825 + setTimeout(function() {
13826 + stickyHachChange($tabs, $tab, navStickyOffset);
13827 + }, 100);
13828 + }
13829 + });
13830 + $(window).on('hashchange', function (e) {
13831 + stickyHachChange($tabs, $tab, navStickyOffset);
13832 + });
13833 + }
13834 + }
13835 +
13836 + // start linkWidget
13837 +
13838 +
13839 + var $linkWidget = $settings['linkWidgetSettings'],
13840 + $activeItem = ($settings['activeItem']) - 1;
13841 + if ($linkWidget !== undefined && editMode === false) {
13842 +
13843 + $linkWidget.forEach(function (entry, index) {
13844 +
13845 + if (index == 0) {
13846 + $('#bdt-tab-content-' + $settings['linkWidgetId']).parent().remove();
13847 + $(entry).parent().wrapInner('<div class="bdt-switcher-wrapper" />');
13848 + $(entry).parent().wrapInner('<div id="bdt-tab-content-' + $settings['linkWidgetId'] + '" class="bdt-switcher bdt-switcher-item-content" />');
13849 +
13850 + if ($settings['activeItem'] == undefined) {
13851 + $(entry).addClass('bdt-active');
13852 + }
13853 + }
13854 +
13855 + if ($settings['activeItem'] !== undefined && index == $activeItem) {
13856 + $(entry).addClass('bdt-active');
13857 + }
13858 +
13859 + $(entry).attr('data-content-id', "tab-" + (index + 1));
13860 +
13861 + });
13862 +
13863 + /**
13864 + * Sometimes not works UIKIT connect that's why below code
13865 + */
13866 + $tab.find('a').on('click', function () {
13867 + let index = $(this).data('tab-index');
13868 + $('#bdt-tab-content-' + $settings['linkWidgetId'] + '>').removeClass('bdt-active');
13869 + $('#bdt-tab-content-' + $settings['linkWidgetId'] + '>').eq(index).addClass('bdt-active');
13870 + });
13871 +
13872 + }
13873 + // end linkWidget
13874 +
13875 + if (typeof $settings.sectionBg != "undefined") {
13876 + if (typeof $settings.sectionBgSelector == "undefined") {
13877 + return;
13878 + }
13879 + var $id = (($settings.sectionBgSelector) + '-ep-dynamic').substring(1);
13880 +
13881 + if ($(`#${$id}-wrapper`).length) {
13882 + $(`#${$id}-wrapper`).remove();
13883 + }
13884 +
13885 + var dynamicBG = `<div id="${$id}-wrapper" style = "position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; left: 0;" >`;
13886 +
13887 + $($settings.sectionBg).each(function (e) {
13888 +
13889 + let newLine = '<div class="bdt-hidden ' + $id + ' bdt-animation-' + $settings.sectionBgAnim + '" style=" width: 100%; height: 100%; transition: all .5s;">';
13890 + newLine += '<img src = "' + $settings.sectionBg[e] + '" style = " height: 100%; width: 100%; object-fit: cover;" >';
13891 + newLine += '</div>';
13892 + dynamicBG += newLine;
13893 + });
13894 +
13895 + dynamicBG += `</div>`;
13896 +
13897 + $($settings.sectionBgSelector).prepend(dynamicBG);
13898 + var activeIndex = $tab.find('>.bdt-tabs-item.bdt-active').index();
13899 + $(`.${$id}:eq('${activeIndex}')`).removeClass('bdt-hidden');
13900 +
13901 + $tabsArea.find('.bdt-tabs-item-title').on('click', function () {
13902 + let $tabImg = $(this).data('tab-index');
13903 + $('.' + $id + ':eq(' + $tabImg + ')').siblings().addClass('bdt-hidden');
13904 + $('.' + $id + ':eq(' + $tabImg + ')').removeClass('bdt-hidden');
13905 + });
13906 +
13907 + }
13908 +
13909 + // start section link
13910 + var $linkSection = $settings['linkSectionSettings'];
13911 + if ($linkSection !== undefined && editMode === false) {
13912 + $linkSection.forEach(function (entry, index) {
13913 + let $tabContent = $('#bdt-tab-content-' + $settings.linkWidgetId),
13914 + $section = $(entry);
13915 + $tabContent.find('.bdt-tab-content-item' + ':eq(' + index + ')').html($section);
13916 + });
13917 + }
13918 +
13919 + };
13920 + jQuery(window).on('elementor/frontend/init', function () {
13921 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-tabs.default', widgetTabs);
13922 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-acf-tabs.default', widgetTabs);
13923 + });
13924 + }(jQuery, window.elementorFrontend));
13925 +
13926 + /**
13927 + * End tabs widget script
13928 + */
13929 + /**
13930 + * Start tags cloud widget script
13931 + */
13932 +
13933 + (function($, elementor) {
13934 +
13935 + 'use strict';
13936 +
13937 + var widgetTagsCloud = function($scope, $) {
13938 + var $tags_cloud = $scope.find('.bdt-tags-cloud');
13939 +
13940 + if (!$tags_cloud.length) {
13941 + return;
13942 + }
13943 + var $settings = $tags_cloud.data('settings');
13944 + var $tags_color = $settings.basic_tags_bg_type;
13945 + var tags_color_solid = $settings.basic_tags_solid_bg;
13946 +
13947 +
13948 + jQuery.fn.prettyTag = function (options) {
13949 +
13950 + var setting = jQuery.extend({
13951 + randomColor: true, //false to off random color
13952 + tagicon: true, //false to turn off tags icon
13953 + tags_color: options.tags_color
13954 + }, options);
13955 +
13956 +
13957 + return this.each(function () {
13958 + var target = this;
13959 + //add font awesome icon
13960 + if (setting.tagicon == true) {
13961 + var eachTag = $(target).find("a");
13962 + var ti = document.createElement("i");
13963 + $($tags_cloud).find(ti).addClass("fas fa-tags").prependTo(eachTag);
13964 + }
13965 +
13966 + if( setting.tags_color == 'random' ){
13967 + coloredTags();
13968 + }else{
13969 + if (typeof(tags_color_solid) != "undefined"){
13970 + $($tags_cloud).find('.bdt-tags-list li a').css('background-color', tags_color_solid);
13971 + }else{
13972 + $($tags_cloud).find('.bdt-tags-list li a').css('background-color', '#3FB8FD');
13973 + }
13974 + }
13975 +
13976 + //function to make tags colorful
13977 + function coloredTags() {
13978 +
13979 + var totalTags = $($tags_cloud).find("li").length; //to find total cloud tags
13980 + // console.log(totalTags);
13981 + var mct = $($tags_cloud).find("a"); //select all tags links to make them colorful
13982 + /*Array of Colors */
13983 + var tagColor = ["#ff0084", "#ff66ff", "#43cea2", "#D38312", "#73C8A9", "#9D50BB",
13984 + "#780206", "#FF4E50", "#ADD100",
13985 + "#0F2027", "#00c6ff", "#81D8D0", "#5CB3FF", "#95B9C7", "#C11B17", "#3B9C9C", "#FF7F50", "#FFD801", "#79BAEC", "#F660AB", "#3D3C3A", "#3EA055"
13986 + ];
13987 +
13988 + var tag = 0;
13989 + var color = 0; //assign colors to tags with loop, unlimited number of tags can be added
13990 + do {
13991 + if (color > 21) {
13992 + color = 0;
13993 + } //Start again array index if it reaches at last
13994 +
13995 + if (setting.randomColor == true) {
13996 + var $rc = Math.floor(Math.random() * 22);
13997 + $(mct).eq(tag).css({
13998 + //tags random color
13999 + 'background': tagColor[$rc]
14000 + });
14001 + } else {
14002 + $(mct).eq(tag).css({
14003 + //tags color in a sequence
14004 + 'background': tagColor[color]
14005 + });
14006 + }
14007 + tag++;
14008 + color++;
14009 + } while (tag <= totalTags)
14010 +
14011 + }
14012 + });
14013 + };
14014 +
14015 +
14016 + /* End */
14017 +
14018 + $($tags_cloud).find(".bdt-tags-list").prettyTag({'tags_color': $tags_color});
14019 +
14020 + };
14021 +
14022 +
14023 + var widgetSkinAnimated = function($scope, $) {
14024 + var $tags_globe = $scope.find('.bdt-tags-cloud');
14025 + if (!$tags_globe.length) {
14026 + return;
14027 + }
14028 + var $settings = $tags_globe.data('settings');
14029 +
14030 + // Determine animation settings based on animation type
14031 + var animationType = $settings.animationType || 'hover';
14032 + var initial = null;
14033 + var dragControl = $settings.dragControl || false;
14034 + var freezeActive = $settings.freezeActive || false;
14035 +
14036 + // If "always" animation, set initial spin and disable freeze/drag
14037 + if (animationType === 'always') {
14038 + initial = [0.2, 0.1]; // Default spin values
14039 + dragControl = false;
14040 + freezeActive = false;
14041 + }
14042 +
14043 + // Ensure maxSpeed has a minimum value for animation
14044 + var maxSpeed = $settings.maxSpeed || 0.05;
14045 + if (maxSpeed === 0) {
14046 + maxSpeed = 0.05;
14047 + }
14048 +
14049 + try {
14050 + TagCanvas.Start($settings.idmyCanvas, $settings.idTags, {
14051 + textColour : $settings.textColour,
14052 + outlineColour : $settings.outlineColour,
14053 + reverse : true,
14054 + depth : $settings.depth,
14055 + maxSpeed : maxSpeed,
14056 + initial : initial,
14057 + activeCursor : $settings.activeCursor,
14058 + bgColour : $settings.bgColour,
14059 + bgOutlineThickness : $settings.bgOutlineThickness,
14060 + bgRadius : $settings.bgRadius,
14061 + dragControl : dragControl,
14062 + fadeIn : $settings.fadeIn,
14063 + freezeActive : freezeActive,
14064 + outlineDash : $settings.outlineDash,
14065 + outlineDashSpace : $settings.globe_outline_dash_space,
14066 + outlineDashSpeed : $settings.globe_outline_dash_speed,
14067 + outlineIncrease : $settings.outlineIncrease,
14068 + outlineMethod : $settings.outlineMethod,
14069 + outlineRadius : $settings.outlineRadius,
14070 + outlineThickness : $settings.outlineThickness,
14071 + shadow : $settings.shadow,
14072 + shadowBlur : $settings.shadowBlur,
14073 + wheelZoom : $settings.wheelZoom
14074 +
14075 + });
14076 + } catch (e) {
14077 + document.getElementById($settings.idCanvas).style.display = 'none';
14078 + }
14079 +
14080 + };
14081 +
14082 +
14083 + var widgetSkinCloud = function($scope, $) {
14084 + var $tags_cloud = $scope.find('.bdt-tags-cloud');
14085 +
14086 + if (!$tags_cloud.length) {
14087 + return;
14088 + }
14089 + var $settings = $tags_cloud.data('settings');
14090 +
14091 + jQuery(document).ready(function($) {
14092 + function resizeAwesomeCloud() {
14093 + jQuery("#"+$settings.idCloud).awesomeCloud({
14094 + "size": {
14095 + "grid": 9,
14096 + "factor": 1
14097 + },
14098 + "color" : {
14099 + "background" : "rgba(156,145,255,0)", // background color, transparent by default
14100 + // "background" : "rgba(156,145,255,0)", // background color, transparent by default
14101 + "start" : "#20f", // color of the smallest font, if options.color = "gradient""
14102 + "end" : "rgb(200,0,0)" // color of the largest font, if options.color = "gradient"
14103 + },
14104 + "options": {
14105 + "background" :"rgba(165,184,255,0)",
14106 + "color": $settings.cloudColor,
14107 + "sort": "highest" // highest, lowest or random
14108 + },
14109 + "font": "'Times New Roman', Times, serif",
14110 + "shape": $settings.cloudStyle // default
14111 + });
14112 + }
14113 + resizeAwesomeCloud();
14114 + jQuery(window).on("resize", function($) {
14115 + jQuery($tags_cloud).find('#awesomeCloud'+$settings.idCloud).remove();
14116 + resizeAwesomeCloud();
14117 + });
14118 + });
14119 +
14120 + };
14121 +
14122 +
14123 + jQuery(window).on('elementor/frontend/init', function() {
14124 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-tags-cloud.default', widgetTagsCloud);
14125 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-tags-cloud.bdt-animated', widgetSkinAnimated);
14126 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-tags-cloud.bdt-cloud', widgetSkinCloud);
14127 + });
14128 +
14129 + }(jQuery, window.elementorFrontend));
14130 +
14131 + /**
14132 + * End tags cloud widget script
14133 + */
14134 +
14135 +
14136 + /**
14137 + * Start testimonial carousel widget script
14138 + */
14139 +
14140 + ( function( $, elementor ) {
14141 +
14142 + 'use strict';
14143 +
14144 + var widgetTCarousel = function( $scope, $ ) {
14145 +
14146 + var $tCarousel = $scope.find( '.bdt-testimonial-carousel' );
14147 +
14148 + if ( ! $tCarousel.length ) {
14149 + return;
14150 + }
14151 +
14152 + var $tCarouselContainer = $tCarousel.find('.swiper-carousel'),
14153 + $settings = $tCarousel.data('settings');
14154 +
14155 + // Access swiper class
14156 + const Swiper = elementorFrontend.utils.swiper;
14157 + initSwiper();
14158 +
14159 + async function initSwiper() {
14160 +
14161 + var swiper = await new Swiper($tCarouselContainer, $settings);
14162 +
14163 + if ($settings.pauseOnHover) {
14164 + $($tCarouselContainer).hover(function() {
14165 + (this).swiper.autoplay.stop();
14166 + }, function() {
14167 + (this).swiper.autoplay.start();
14168 + });
14169 + }
14170 + };
14171 +
14172 + };
14173 +
14174 +
14175 + jQuery(window).on('elementor/frontend/init', function() {
14176 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-testimonial-carousel.default', widgetTCarousel );
14177 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-testimonial-carousel.bdt-twyla', widgetTCarousel );
14178 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-testimonial-carousel.bdt-vyxo', widgetTCarousel );
14179 + });
14180 +
14181 + }( jQuery, window.elementorFrontend ) );
14182 +
14183 + /**
14184 + * End testimonial carousel widget script
14185 + */
14186 +
14187 +
14188 + /**
14189 + * Start testimonial slider widget script
14190 + */
14191 +
14192 + ( function( $, elementor ) {
14193 +
14194 + 'use strict';
14195 +
14196 + var widgetCustomCarousel = function( $scope, $ ) {
14197 +
14198 + var $carousel = $scope.find( '.bdt-testimonial-slider' );
14199 +
14200 + if ( ! $carousel.length ) {
14201 + return;
14202 + }
14203 +
14204 + var $carouselContainer = $carousel.find('.swiper-carousel'),
14205 + $settings = $carousel.data('settings');
14206 +
14207 + // Access swiper class
14208 + const Swiper = elementorFrontend.utils.swiper;
14209 + initSwiper();
14210 +
14211 + async function initSwiper() {
14212 +
14213 + var swiper = await new Swiper($carouselContainer, $settings);
14214 +
14215 + if ($settings.pauseOnHover) {
14216 + $($carouselContainer).hover(function() {
14217 + (this).swiper.autoplay.stop();
14218 + }, function() {
14219 + (this).swiper.autoplay.start();
14220 + });
14221 + }
14222 + };
14223 +
14224 + };
14225 +
14226 +
14227 + jQuery(window).on('elementor/frontend/init', function() {
14228 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-testimonial-slider.default', widgetCustomCarousel );
14229 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-testimonial-slider.bdt-single', widgetCustomCarousel );
14230 + });
14231 +
14232 + }( jQuery, window.elementorFrontend ) );
14233 +
14234 + /**
14235 + * End testimonial slider widget script
14236 + */
14237 +
14238 +
14239 + /**
14240 + * Start threesixty product viewer widget script
14241 + */
14242 +
14243 + (function ($, elementor) {
14244 +
14245 + 'use strict';
14246 +
14247 + var widgetTSProductViewer = function ($scope, $) {
14248 +
14249 + var $TSPV = $scope.find('.bdt-threesixty-product-viewer'),
14250 + $settings = $TSPV.data('settings'),
14251 + $container = $TSPV.find('> .bdt-tspv-container'),
14252 + $fullScreenBtn = $TSPV.find('> .bdt-tspv-fb');
14253 +
14254 + if (!$TSPV.length) {
14255 + return;
14256 + }
14257 +
14258 + if ($settings.source_type === 'remote') {
14259 + $settings.source = SpriteSpin.sourceArray($settings.source, { frame: $settings.frame_limit, digits: $settings.image_digits });
14260 + }
14261 +
14262 + epObserveTarget($scope[0], function () {
14263 + var $this = $($container);
14264 + $this.spritespin($settings);
14265 + });
14266 +
14267 + $($fullScreenBtn).on('click', function (e) {
14268 + e.preventDefault();
14269 + $($container).spritespin('api').requestFullscreen();
14270 + });
14271 +
14272 + };
14273 +
14274 +
14275 + jQuery(window).on('elementor/frontend/init', function () {
14276 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-threesixty-product-viewer.default', widgetTSProductViewer);
14277 + });
14278 +
14279 + }(jQuery, window.elementorFrontend));
14280 +
14281 + /**
14282 + * End threesixty product viewer widget script
14283 + */
14284 +
14285 +
14286 + ; (function ($, elementor) {
14287 + $(window).on('elementor/frontend/init', function () {
14288 + let ModuleHandler = elementorModules.frontend.handlers.Base,
14289 + TileScroll;
14290 +
14291 + TileScroll = ModuleHandler.extend({
14292 + bindEvents: function () {
14293 + this.run();
14294 + },
14295 + getDefaultSettings: function () {
14296 + return {
14297 + allowHTML: true,
14298 + };
14299 + },
14300 +
14301 + // onElementChange: debounce(function (prop) {
14302 + // if (prop.indexOf('element_pack_tile_scroll') !== -1) {
14303 + // this.run();
14304 + // }
14305 + // }, 400),
14306 +
14307 + settings: function (key) {
14308 + return this.getElementSettings('element_pack_tile_scroll_' + key);
14309 + },
14310 +
14311 + run: function () {
14312 + var tileScroll_ID = 'bdt-tile-scroll-container-' + this.$element.data('id'),
14313 + widgetID = this.$element.data('id'),
14314 + widgetContainer = $('.elementor-element-' + widgetID);
14315 +
14316 + if (this.settings('show') == 'yes') {
14317 + if ($('#' + tileScroll_ID).length === 0) {
14318 + let display = this.settings('display');
14319 + var $content = `
14320 + <div id="${tileScroll_ID}" class="bdt-tile-scroll bdt-tile-scroll--${display}">
14321 + <div class="bdt-tile-scroll__wrap">`;
14322 + this.settings('elements').forEach(element => {
14323 + let images = element.element_pack_tile_scroll_images;
14324 +
14325 + let x_start = element.element_pack_tile_scroll_x_start.size;
14326 + let x_end = element.element_pack_tile_scroll_x_end.size;
14327 + if (display === 'horizontal') {
14328 + var parallax = 'data-bdt-parallax="target: .elementor-element-' + widgetID + '; viewport: 1.1; x:' + x_start + ',' + x_end + '"';
14329 + } else {
14330 + var parallax = 'data-bdt-parallax="y:' + x_start + ',' + x_end + '"';
14331 + }
14332 + $content += `<div class="bdt-tile-scroll__line" ${parallax}>`;
14333 + images.forEach(image => {
14334 + $content += `<div class=" bdt-tile-scroll__line-img" style="background-image:url(${image.url})" loading="lazy"></div>`;
14335 + });
14336 + $content += `</div>`;
14337 + });
14338 + $content += `</div></div>`;
14339 +
14340 + $(widgetContainer).prepend($content);
14341 + }
14342 + }
14343 + }
14344 + });
14345 +
14346 + elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) {
14347 + if (!$scope.hasClass("bdt-tile-scroll-yes")) {
14348 + return;
14349 + }
14350 + elementorFrontend.elementsHandler.addHandler(TileScroll, {
14351 + $element: $scope
14352 + });
14353 + });
14354 + elementorFrontend.hooks.addAction('frontend/element_ready/container', function ($scope) {
14355 + if (!$scope.hasClass("bdt-tile-scroll-yes")) {
14356 + return;
14357 + }
14358 + elementorFrontend.elementsHandler.addHandler(TileScroll, {
14359 + $element: $scope
14360 + });
14361 + });
14362 + });
14363 + }) (jQuery, window.elementorFrontend);
14364 +
14365 + /**
14366 + * Start time zone widget script
14367 + */
14368 +
14369 + (function ($, elementor) {
14370 + 'use strict';
14371 + var widgetTimeZone = function ($scope, $) {
14372 + var $TimeZone = $scope.find('.bdt-time-zone'),
14373 + $settings = $TimeZone.data('settings'),
14374 + timeFormat,
14375 + offset = $settings.gmt,
14376 + dateFormat = $settings.dateFormat,
14377 + enableDST = $settings.enableDST === 'yes';
14378 +
14379 + if (!$TimeZone.length) {
14380 + return;
14381 + }
14382 +
14383 + var timeZoneApp = {
14384 + digitalClock: function () {
14385 + if ($settings.timeHour == '12h') {
14386 + timeFormat = '%I:%M:%S %p';
14387 + } else {
14388 + timeFormat = '%H:%M:%S';
14389 + }
14390 + var dateFormat = $settings.dateFormat;
14391 + if (dateFormat != 'emptyDate') {
14392 + dateFormat = '<div class=\"bdt-time-zone-date\"> ' + $settings.dateFormat + ' </div>'
14393 + } else {
14394 + dateFormat = '';
14395 + }
14396 + var country;
14397 + if ($settings.country != 'emptyCountry') {
14398 + country = '<div class=\"bdt-time-zone-country\">' + $settings.country + '</div>';
14399 + } else {
14400 + country = ' ';
14401 + }
14402 +
14403 + // Check if we should apply DST
14404 + const currentDate = new Date();
14405 + let finalOffset = offset;
14406 + let dstIndicator = '';
14407 +
14408 + if (enableDST && this.isDSTActive(currentDate, offset)) {
14409 + // Add 1 hour for DST if not using local time
14410 + if (offset !== 'local') {
14411 + finalOffset = parseFloat(offset) + 1;
14412 + }
14413 + // Add DST indicator with consistent styling
14414 + dstIndicator = '<small class="bdt-dst-indicator" style="margin-left: 5px;">DST</small>';
14415 + }
14416 +
14417 + var timeZoneFormat = '<div class=\"bdt-time-zone-dt\"> ' + country + ' ' + dateFormat +
14418 + ' <div class=\"bdt-time-zone-time\">' + timeFormat + dstIndicator + '</div> </div>';
14419 +
14420 + if (offset == '') return;
14421 +
14422 + var options = {
14423 + format: timeZoneFormat,
14424 + timeNotation: $settings.timeHour,
14425 + am_pm: true,
14426 + utc: (offset == 'local') ? false : true,
14427 + utcOffset: (offset == 'local') ? null : finalOffset,
14428 + }
14429 +
14430 + $('#' + $settings.id).jclock(options);
14431 + },
14432 + isDSTActive: function(date, offset) {
14433 + // If DST is disabled in settings, return false
14434 + if (!enableDST) return false;
14435 +
14436 + // If using local time, check browser's DST detection
14437 + if (offset === 'local') {
14438 + // Compare January and July to see if DST is observed
14439 + const jan = new Date(date.getFullYear(), 0, 1).getTimezoneOffset();
14440 + const jul = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
14441 + const isDstObserved = jan !== jul;
14442 +
14443 + if (!isDstObserved) return false;
14444 +
14445 + // If DST is observed, check if it's currently active
14446 + const currentOffset = date.getTimezoneOffset();
14447 + return currentOffset === Math.min(jan, jul);
14448 + }
14449 +
14450 + // For specific timezones, use a more accurate approach
14451 + // Numeric offset is assumed to be GMT+X or GMT-X
14452 +
14453 + // Get the current month and day
14454 + const month = date.getMonth(); // 0-11
14455 + const day = date.getDate(); // 1-31
14456 + const numericOffset = parseFloat(offset);
14457 +
14458 + // General DST rules for major regions:
14459 +
14460 + // Northern Hemisphere (Europe, North America, Asia)
14461 + // DST typically starts on last Sunday in March and ends on last Sunday in October
14462 + if (numericOffset >= -12 && numericOffset <= 14) {
14463 + // Northern hemisphere (rough approximation)
14464 + if (numericOffset > 0) {
14465 + // March (2) after ~last Sunday to October (9) before ~last Sunday
14466 + if (month > 2 && month < 9) return true;
14467 +
14468 + // Edge cases: last week of March and last week of October
14469 + if (month === 2 && day >= 25) return true; // Approx last week of March
14470 + if (month === 9 && day <= 25) return true; // Approx last week of October
14471 + }
14472 + // Southern hemisphere (Australia, South America, South Africa, etc.)
14473 + else if (numericOffset < 0 && numericOffset >= -12) {
14474 + // September (8) after ~first Sunday to April (3) before ~first Sunday
14475 + if (month < 3 || month > 8) return true;
14476 +
14477 + // Edge cases: first week of April and last week of September
14478 + if (month === 3 && day <= 7) return true; // Approx first week of April
14479 + if (month === 8 && day >= 25) return true; // Approx last week of September
14480 + }
14481 + }
14482 +
14483 + return false;
14484 + },
14485 + convertToTimeZoneAndFormat: function (date, offset) {
14486 + // Get the UTC time in milliseconds
14487 + const utcTime = date.getTime() + (date.getTimezoneOffset() * 60000);
14488 +
14489 + // Apply DST correction if enabled and active
14490 + let dstOffset = 0;
14491 + if (enableDST && this.isDSTActive(date, offset)) {
14492 + dstOffset = 1; // Add one hour for DST
14493 + }
14494 +
14495 + // Calculate the target time using the offset and DST if applicable
14496 + const targetTime = new Date(utcTime + ((parseFloat(offset) + dstOffset) * 3600000));
14497 +
14498 + // Extract hours, minutes, and seconds
14499 + let hours = targetTime.getHours(),
14500 + minutes = targetTime.getMinutes(),
14501 + seconds = targetTime.getSeconds();
14502 + const ampm = hours >= 12 ? 'PM' : 'AM',
14503 + getDate = targetTime.toDateString();
14504 + hours = hours % 12 || 12; // Convert to 12-hour format and handle midnight (0 AM)
14505 +
14506 + // Add leading zeros to single-digit minutes and seconds
14507 + minutes = minutes < 10 ? '0' + minutes : minutes;
14508 + seconds = seconds < 10 ? '0' + seconds : seconds;
14509 +
14510 + return {
14511 + hours,
14512 + minutes,
14513 + seconds,
14514 + ampm,
14515 + getDate,
14516 + };
14517 + },
14518 + formatDate: function (inputDate, formatOption) {
14519 + var date = new Date(inputDate),
14520 + selectedFormat = formatOption;
14521 +
14522 + if (!selectedFormat) {
14523 + console.error('Invalid format option');
14524 + return '';
14525 + }
14526 +
14527 + // Replace format placeholders
14528 + var formattedDate = selectedFormat.replace(/%([a-zA-Z])/g, function (_, formatCode) {
14529 + switch (formatCode) {
14530 + case 'd':
14531 + return String(date.getDate()).padStart(2, '0');
14532 + case 'm':
14533 + return String(date.getMonth() + 1).padStart(2, '0');
14534 + case 'y':
14535 + return String(date.getFullYear()).slice(-2);
14536 + case 'Y':
14537 + return String(date.getFullYear());
14538 + case 'b':
14539 + return date.toLocaleString('default', {
14540 + month: 'short'
14541 + });
14542 + case 'a':
14543 + return date.toLocaleString('default', {
14544 + weekday: 'short'
14545 + });
14546 + default:
14547 + return formatCode;
14548 + }
14549 + });
14550 +
14551 + return formattedDate;
14552 + },
14553 + date: function () {
14554 + let localDate = new Date(),
14555 + targetOffset = offset,
14556 + result = timeZoneApp.convertToTimeZoneAndFormat(localDate, targetOffset),
14557 + date = result.getDate;
14558 +
14559 + const formattedDate = this.formatDate(date, dateFormat);
14560 + $($TimeZone).find('.bdt-time-zone-date').text(formattedDate);
14561 + },
14562 + updateTime: function () {
14563 + const self = this;
14564 +
14565 + setInterval(function () {
14566 + let localDate = new Date(),
14567 + targetOffset = ('local' === offset) ? localDate.getTimezoneOffset() / -60 : offset,
14568 + result = timeZoneApp.convertToTimeZoneAndFormat(localDate, targetOffset);
14569 +
14570 + let second = result.seconds * 6,
14571 + minute = result.minutes * 6 + second / 60,
14572 + hour = ((result.hours % 12) / 12) * 360 + 90 + minute / 12;
14573 +
14574 + $($TimeZone).find('.bdt-clock-hour').css("transform", "rotate(" + hour + "deg)");
14575 + $($TimeZone).find('.bdt-clock-minute').css("transform", "rotate(" + minute + "deg)");
14576 + $($TimeZone).find('.bdt-clock-second').css("transform", "rotate(" + second + "deg)");
14577 + $($TimeZone).find('.bdt-clock-am-pm').text(result.ampm);
14578 +
14579 + // Add or remove DST indicator for analog clock
14580 + const isDstActive = self.isDSTActive(localDate, targetOffset);
14581 + const $dstIndicator = $($TimeZone).find('.bdt-dst-indicator');
14582 +
14583 + if (isDstActive && enableDST) {
14584 + if ($dstIndicator.length === 0) {
14585 + const $indicator = $('<small class="bdt-dst-indicator" style="margin-left: 5px;">DST</small>');
14586 + $($TimeZone).find('.bdt-clock-am-pm').append($indicator);
14587 + }
14588 + } else {
14589 + $dstIndicator.remove();
14590 + }
14591 +
14592 + }, 1000);
14593 +
14594 + this.date();
14595 + },
14596 + init: function () {
14597 + if ('digital' == $settings.clock_style) {
14598 + this.digitalClock();
14599 + } else {
14600 + this.updateTime();
14601 + }
14602 + }
14603 + }
14604 +
14605 + epObserveTarget($scope[0], function () {
14606 + timeZoneApp.init();
14607 + });
14608 + };
14609 + jQuery(window).on('elementor/frontend/init', function () {
14610 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-time-zone.default', widgetTimeZone);
14611 + });
14612 + }(jQuery, window.elementorFrontend));
14613 +
14614 + /**
14615 + * End time zone widget script
14616 + */
14617 +
14618 + /**
14619 + * Start timeline widget script
14620 + */
14621 +
14622 + ( function( $, elementor ) {
14623 +
14624 + 'use strict';
14625 +
14626 + var widgetTimeline = function( $scope, $ ) {
14627 +
14628 + var $timeline = $scope.find( '.bdt-timeline-skin-olivier' );
14629 +
14630 + if ( ! $timeline.length ) {
14631 + return;
14632 + }
14633 +
14634 + $($timeline).timeline({
14635 + visibleItems : $timeline.data('visible_items'),
14636 + });
14637 +
14638 + };
14639 +
14640 +
14641 + jQuery(window).on('elementor/frontend/init', function() {
14642 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-timeline.bdt-olivier', widgetTimeline );
14643 + });
14644 +
14645 + }( jQuery, window.elementorFrontend ) );
14646 +
14647 + /**
14648 + * End timeline widget script
14649 + */
14650 +
14651 +
14652 + /**
14653 + * Start advanced counter widget script
14654 + */
14655 +
14656 + ;(function($, elementor) {
14657 + 'use strict';
14658 + var widgetAdvancedCounter = function($scope, $) {
14659 + var $AdvancedCounter = $scope.find('.bdt-advanced-counter');
14660 + if (!$AdvancedCounter.length) {
14661 + return;
14662 + }
14663 +
14664 + epObserveTarget($scope[0], function () {
14665 +
14666 + var $settings = $($AdvancedCounter).data('settings');
14667 +
14668 + var options = {
14669 + startVal: $settings.countStart ?? 0,
14670 + numerals: $settings.language,
14671 + decimalPlaces: $settings.decimalPlaces ?? 0,
14672 + duration: $settings.duration ?? 0,
14673 + useEasing: $settings.useEasing !== null,
14674 + useGrouping: $settings.useGrouping !== null,
14675 + separator: $settings.counterSeparator ?? '',
14676 + decimal: $settings.decimalSymbol ?? '',
14677 + prefix: $settings.counterPrefix ?? '',
14678 + suffix: $settings.counterSuffix ?? '',
14679 + };
14680 +
14681 + var demo = new CountUp($settings.id, $settings.countNumber ?? 0, options);
14682 + if (!demo.error) {
14683 + demo.start();
14684 + } else {
14685 + console.error(demo.error);
14686 + }
14687 +
14688 + }, {
14689 + root: null, // Use the viewport as the root
14690 + rootMargin: '0px', // No margin around the root
14691 + threshold: 0.8 // 80% visibility (1 - 0.8)
14692 + });
14693 +
14694 + };
14695 + jQuery(window).on('elementor/frontend/init', function() {
14696 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-total-count.default', widgetAdvancedCounter);
14697 + });
14698 + }(jQuery, window.elementorFrontend));
14699 +
14700 + /**
14701 + * End advanced counter widget script
14702 + */
14703 +
14704 +
14705 + /**
14706 + * Start EDD product carousel widget script
14707 + */
14708 +
14709 + (function ($, elementor) {
14710 + "use strict";
14711 +
14712 + var widgetEddProductCarousel = function ($scope, $) {
14713 + var $eddProductCarousel = $scope.find(".ep-learnpress-carousel");
14714 +
14715 + if (!$eddProductCarousel.length) {
14716 + return;
14717 + }
14718 +
14719 + var $eddProductCarouselContainer = $eddProductCarousel.find(".swiper-carousel"),
14720 + $settings = $eddProductCarousel.data("settings");
14721 +
14722 + const Swiper = elementorFrontend.utils.swiper;
14723 + initSwiper();
14724 + async function initSwiper() {
14725 + var swiper = await new Swiper($eddProductCarouselContainer, $settings); // this is an example
14726 + if ($settings.pauseOnHover) {
14727 + $($eddProductCarouselContainer).hover(
14728 + function () {
14729 + this.swiper.autoplay.stop();
14730 + },
14731 + function () {
14732 + this.swiper.autoplay.start();
14733 + }
14734 + );
14735 + }
14736 + }
14737 + };
14738 +
14739 + jQuery(window).on("elementor/frontend/init", function () {
14740 + elementorFrontend.hooks.addAction(
14741 + "frontend/element_ready/bdt-learnpress-carousel.default",
14742 + widgetEddProductCarousel
14743 + );
14744 + });
14745 + })(jQuery, window.elementorFrontend);
14746 +
14747 + /**
14748 + * End twitter carousel widget script
14749 + */
14750 +
14751 + /**
14752 + * Start twitter carousel widget script
14753 + */
14754 +
14755 + ( function( $, elementor ) {
14756 +
14757 + 'use strict';
14758 +
14759 + var widgetTwitterCarousel = function( $scope, $ ) {
14760 +
14761 + var $twitterCarousel = $scope.find( '.bdt-twitter-carousel' );
14762 +
14763 + if ( ! $twitterCarousel.length ) {
14764 + return;
14765 + }
14766 +
14767 + //console.log($twitterCarousel);
14768 +
14769 + var $twitterCarouselContainer = $twitterCarousel.find('.swiper-carousel'),
14770 + $settings = $twitterCarousel.data('settings');
14771 +
14772 + // Access swiper class
14773 + const Swiper = elementorFrontend.utils.swiper;
14774 + initSwiper();
14775 +
14776 + async function initSwiper() {
14777 +
14778 + var swiper = await new Swiper($twitterCarouselContainer, $settings);
14779 +
14780 + if ($settings.pauseOnHover) {
14781 + $($twitterCarouselContainer).hover(function() {
14782 + (this).swiper.autoplay.stop();
14783 + }, function() {
14784 + (this).swiper.autoplay.start();
14785 + });
14786 + }
14787 + };
14788 + };
14789 +
14790 +
14791 + jQuery(window).on('elementor/frontend/init', function() {
14792 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-twitter-carousel.default', widgetTwitterCarousel );
14793 + });
14794 +
14795 + }( jQuery, window.elementorFrontend ) );
14796 +
14797 + /**
14798 + * End twitter carousel widget script
14799 + */
14800 +
14801 +
14802 + /**
14803 + * Start twitter slider widget script
14804 + */
14805 +
14806 + ( function( $, elementor ) {
14807 +
14808 + 'use strict';
14809 +
14810 + var widgetTwitterSlider = function( $scope, $ ) {
14811 +
14812 + var $twitterSlider = $scope.find( '.bdt-twitter-slider' );
14813 +
14814 + if ( ! $twitterSlider.length ) {
14815 + return;
14816 + }
14817 +
14818 + var $twitterSliderContainer = $twitterSlider.find('.swiper-carousel'),
14819 + $settings = $twitterSlider.data('settings');
14820 +
14821 + // Access swiper class
14822 + const Swiper = elementorFrontend.utils.swiper;
14823 + initSwiper();
14824 +
14825 + async function initSwiper() {
14826 +
14827 + var swiper = await new Swiper($twitterSliderContainer, $settings);
14828 +
14829 + if ($settings.pauseOnHover) {
14830 + $($twitterSliderContainer).hover(function() {
14831 + (this).swiper.autoplay.stop();
14832 + }, function() {
14833 + (this).swiper.autoplay.start();
14834 + });
14835 + }
14836 + };
14837 + };
14838 +
14839 +
14840 + jQuery(window).on('elementor/frontend/init', function() {
14841 + elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-twitter-slider.default', widgetTwitterSlider );
14842 + });
14843 +
14844 + }( jQuery, window.elementorFrontend ) );
14845 +
14846 + /**
14847 + * End twitter slider widget script
14848 + */
14849 +
14850 +
14851 + /**
14852 + * Start user login widget script
14853 + */
14854 +
14855 + (function ($, elementor) {
14856 + "use strict";
14857 +
14858 + window.is_fb_loggedin = false;
14859 + window.is_google_loggedin = false;
14860 +
14861 + var widgetUserLoginForm = {
14862 + loginFormSubmission: function (login_form) {
14863 + var redirect_url = login_form.find(".redirect_after_login").val();
14864 +
14865 + $.ajax({
14866 + type: "POST",
14867 + dataType: "json",
14868 + url: element_pack_ajax_login_config.ajaxurl,
14869 + data: login_form.serialize(),
14870 + beforeSend: function (xhr) {
14871 + bdtUIkit.notification({
14872 + message:
14873 + "<div bdt-spinner></div> " +
14874 + element_pack_ajax_login_config.loadingmessage,
14875 + timeout: false,
14876 + });
14877 + },
14878 + success: function (data) {
14879 + var recaptcha_field = login_form.find(
14880 + ".element-pack-google-recaptcha"
14881 + );
14882 + if (recaptcha_field.length > 0) {
14883 + var recaptcha_id = recaptcha_field.attr("data-widgetid");
14884 + grecaptcha.reset(recaptcha_id);
14885 + grecaptcha.execute(recaptcha_id);
14886 + }
14887 +
14888 + if (data.loggedin == true) {
14889 + bdtUIkit.notification.closeAll();
14890 + bdtUIkit.notification({
14891 + message: "<span bdt-icon='icon: check'></span> " + data.message,
14892 + status: "primary",
14893 + });
14894 + document.location.href = redirect_url;
14895 + } else {
14896 + bdtUIkit.notification.closeAll();
14897 + bdtUIkit.notification({
14898 + message:
14899 + "<div class=\"bdt-flex\"><span bdt-icon='icon: warning'></span><span>" +
14900 + data.message +
14901 + "</span></div>",
14902 + status: "warning",
14903 + });
14904 + }
14905 + },
14906 + error: function (data) {
14907 + bdtUIkit.notification.closeAll();
14908 + bdtUIkit.notification({
14909 + message:
14910 + "<span bdt-icon='icon: warning'></span>" +
14911 + element_pack_ajax_login_config.unknownerror,
14912 + status: "warning",
14913 + });
14914 + },
14915 + });
14916 + },
14917 + get_facebook_user_data: function (widget_wrapper) {
14918 + var redirect_url = widget_wrapper.find(".redirect_after_login").val();
14919 +
14920 + FB.api(
14921 + "/me",
14922 + {
14923 + fields:
14924 + "id, name, first_name, last_name, email, link, gender, locale, picture",
14925 + },
14926 + function (response) {
14927 + var userID = FB.getAuthResponse()["userID"];
14928 + var access_token = FB.getAuthResponse()["accessToken"];
14929 +
14930 + window.is_fb_loggedin = true;
14931 +
14932 + var fb_data = {
14933 + id: response.id,
14934 + name: response.name,
14935 + first_name: response.first_name,
14936 + last_name: response.last_name,
14937 + email: response.email,
14938 + link: response.link,
14939 + };
14940 +
14941 + $.ajax({
14942 + url: window.ElementPackConfig.ajaxurl,
14943 + method: "post",
14944 + data: {
14945 + action: "element_pack_social_facebook_login",
14946 + data: fb_data,
14947 + method: "post",
14948 + dataType: "json",
14949 + userID: userID,
14950 + security_string: access_token,
14951 + lang: element_pack_ajax_login_config.language,
14952 + },
14953 + dataType: "json",
14954 + beforeSend: function (xhr) {
14955 + bdtUIkit.notification({
14956 + message:
14957 + "<div bdt-spinner></div> " +
14958 + element_pack_ajax_login_config.loadingmessage,
14959 + timeout: false,
14960 + });
14961 + },
14962 + success: function (data) {
14963 + if (data.success === true) {
14964 + if (undefined === redirect_url) {
14965 + location.reload();
14966 + } else {
14967 + window.location = redirect_url;
14968 + }
14969 + } else {
14970 + location.reload();
14971 + }
14972 + },
14973 + complete: function (xhr, status) {
14974 + bdtUIkit.notification.closeAll();
14975 + },
14976 + });
14977 + }
14978 + );
14979 + },
14980 +
14981 + load_recaptcha: function () {
14982 + var reCaptchaFields = $(".element-pack-google-recaptcha"),
14983 + widgetID;
14984 +
14985 + if (reCaptchaFields.length > 0) {
14986 + reCaptchaFields.each(function () {
14987 + var self = $(this),
14988 + attrWidget = self.attr("data-widgetid");
14989 + // alert(self.data('sitekey'))
14990 + // Avoid re-rendering as it's throwing API error
14991 + if (typeof attrWidget !== typeof undefined && attrWidget !== false) {
14992 + return;
14993 + } else {
14994 + widgetID = grecaptcha.render($(this).attr("id"), {
14995 + sitekey: self.data("sitekey"),
14996 + callback: function (response) {
14997 + if (response !== "") {
14998 + self.append(
14999 + jQuery("<input>", {
15000 + type: "hidden",
15001 + value: response,
15002 + class: "g-recaptcha-response",
15003 + })
15004 + );
15005 + }
15006 + },
15007 + });
15008 + self.attr("data-widgetid", widgetID);
15009 + }
15010 + });
15011 + }
15012 + },
15013 + };
15014 +
15015 + window.onLoadElementPackLoginCaptcha = widgetUserLoginForm.load_recaptcha;
15016 +
15017 + var widgetUserLoginFormHandler = function ($scope, $) {
15018 + var widget_wrapper = $scope.find(".bdt-user-login");
15019 + var login_form = $scope.find("form.bdt-user-login-form");
15020 + var recaptcha_field = $scope.find(".element-pack-google-recaptcha");
15021 + var fb_button = widget_wrapper.find(".fb_btn_link");
15022 + var google_button = widget_wrapper.find("#google_btn_link");
15023 + var redirect_url = widget_wrapper.find(".redirect_after_login").val();
15024 +
15025 + if (login_form.length > 0) {
15026 + login_form.on("submit", function (e) {
15027 + e.preventDefault();
15028 + widgetUserLoginForm.loginFormSubmission(login_form);
15029 + });
15030 + }
15031 +
15032 + if (
15033 + elementorFrontend.isEditMode() &&
15034 + undefined === recaptcha_field.attr("data-widgetid")
15035 + ) {
15036 + onLoadElementPackLoginCaptcha();
15037 + }
15038 +
15039 + if (recaptcha_field.length > 0) {
15040 + grecaptcha.ready(function () {
15041 + var recaptcha_id = recaptcha_field.attr("data-widgetid");
15042 + grecaptcha.execute(recaptcha_id);
15043 + });
15044 + }
15045 +
15046 + if (fb_button.length > 0) {
15047 + /**
15048 + * Login with Facebook.
15049 + *
15050 + */
15051 + // Fetch the user profile data from facebook.
15052 +
15053 + fb_button.on("click", function () {
15054 + if (!is_fb_loggedin) {
15055 + FB.login(
15056 + function (response) {
15057 + if (response.authResponse) {
15058 + // Get and display the user profile data.
15059 + widgetUserLoginForm.get_facebook_user_data(widget_wrapper);
15060 + } else {
15061 + // $scope.find( '.status' ).addClass( 'error' ).text( 'User cancelled login or did not fully authorize.' );
15062 + }
15063 + },
15064 + { scope: "email" }
15065 + );
15066 + }
15067 + });
15068 + }
15069 +
15070 + /** google */
15071 + if (google_button.length > 0) {
15072 + var client_id = google_button.data("clientid");
15073 +
15074 + /**
15075 + * Login with Google.
15076 + */
15077 + gapi.load("auth2", function () {
15078 + // Retrieve the singleton for the GoogleAuth library and set up the client.
15079 + var auth2 = gapi.auth2.init({
15080 + client_id: client_id,
15081 + cookiepolicy: "single_host_origin",
15082 + });
15083 +
15084 + auth2.attachClickHandler(
15085 + "google_btn_link",
15086 + {},
15087 + function (googleUser) {
15088 + var profile = googleUser.getBasicProfile();
15089 + var name = profile.getName();
15090 + var email = profile.getEmail();
15091 +
15092 + if (window.is_google_loggedin) {
15093 + var id_token = googleUser.getAuthResponse().id_token;
15094 +
15095 + $.ajax({
15096 + url: window.ElementPackConfig.ajaxurl,
15097 + method: "post",
15098 + data: {
15099 + action: "element_pack_social_google_login",
15100 + id_token: id_token,
15101 + },
15102 + dataType: "json",
15103 + beforeSend: function (xhr) {
15104 + bdtUIkit.notification({
15105 + message:
15106 + "<div bdt-spinner></div> " +
15107 + element_pack_ajax_login_config.loadingmessage,
15108 + timeout: false,
15109 + });
15110 + },
15111 + success: function (data) {
15112 + if (data.success === true) {
15113 + if (undefined === redirect_url) {
15114 + location.reload();
15115 + } else {
15116 + window.location = redirect_url;
15117 + }
15118 + }
15119 + },
15120 + complete: function (xhr, status) {
15121 + bdtUIkit.notification.closeAll();
15122 + },
15123 + });
15124 + }
15125 + },
15126 + function (error) {
15127 + // error here
15128 + }
15129 + );
15130 + });
15131 +
15132 + google_button.on("click", function () {
15133 + window.is_google_loggedin = true;
15134 + });
15135 + }
15136 + };
15137 +
15138 + // Password visibility toggle icon
15139 + $(document).on(
15140 + "click",
15141 + ".bdt-user-login .bdt-toggle-pass-wrapper",
15142 + function () {
15143 + var input = $(this).prev("input");
15144 + var icon = $(this).find("i");
15145 +
15146 + if ("password" === input.attr("type")) {
15147 + icon.removeClass("ep-icon-eye-blocked").addClass("ep-icon-eye");
15148 + } else {
15149 + icon.removeClass("ep-icon-eye").addClass("ep-icon-eye-blocked");
15150 + }
15151 + }
15152 + );
15153 +
15154 + jQuery(window).on("elementor/frontend/init", function () {
15155 + elementorFrontend.hooks.addAction(
15156 + "frontend/element_ready/bdt-user-login.default",
15157 + widgetUserLoginFormHandler
15158 + );
15159 + elementorFrontend.hooks.addAction(
15160 + "frontend/element_ready/bdt-user-login.bdt-dropdown",
15161 + widgetUserLoginFormHandler
15162 + );
15163 + elementorFrontend.hooks.addAction(
15164 + "frontend/element_ready/bdt-user-login.bdt-modal",
15165 + widgetUserLoginFormHandler
15166 + );
15167 + });
15168 + })(jQuery, window.elementorFrontend);
15169 +
15170 + /**
15171 + * End user login widget script
15172 + */
15173 +
15174 + /**
15175 + * Start vertical menu widget script
15176 + */
15177 +
15178 + (function ($, elementor) {
15179 + 'use strict';
15180 + // Vertical Menu
15181 + var widgetVerticalMenu = function ($scope, $) {
15182 + var $vrMenu = $scope.find('.bdt-vertical-menu');
15183 + var $settings = $vrMenu.data('settings');
15184 + if (!$vrMenu.length) {
15185 + return;
15186 + }
15187 +
15188 + //.attr("onclick", "event.stopPropagation();");
15189 + $('#' + $settings.id).metisMenu();
15190 +
15191 +
15192 + if ('yes' == $settings.removeParentLink) {
15193 + $($vrMenu).find('.has-arrow').attr('href', 'javascript:void(0);')
15194 + // $($vrMenu).find('.has-arrow').on('click', function () {
15195 + // return false;
15196 + // });
15197 + }
15198 + }
15199 + jQuery(window).on('elementor/frontend/init', function () {
15200 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-vertical-menu.default', widgetVerticalMenu);
15201 + });
15202 +
15203 +
15204 + }(jQuery, window.elementorFrontend));
15205 +
15206 + /**
15207 + * End vertical menu widget script
15208 + */
15209 + /**
15210 + * Start video gallery widget script
15211 + */
15212 +
15213 + (function ($, elementor) {
15214 +
15215 + 'use strict';
15216 +
15217 + var widgetVideoGallery = function ($scope, $) {
15218 +
15219 + var $video_gallery = $scope.find('.rvs-container');
15220 +
15221 + if (!$video_gallery.length) {
15222 + return;
15223 + }
15224 +
15225 + $($video_gallery).rvslider();
15226 +
15227 + };
15228 +
15229 +
15230 + jQuery(window).on('elementor/frontend/init', function () {
15231 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-video-gallery.default', widgetVideoGallery);
15232 + });
15233 +
15234 + }(jQuery, window.elementorFrontend));
15235 +
15236 + /**
15237 + * End video gallery widget script
15238 + */
15239 + (function ($, elementor) {
15240 + "use strict";
15241 + $(window).on("elementor/frontend/init", function () {
15242 + var ModuleHandler = elementorModules.frontend.handlers.Base,
15243 + WCProducts;
15244 +
15245 + WCProducts = ModuleHandler.extend({
15246 + bindEvents: function () {
15247 + this.run();
15248 + },
15249 +
15250 + getDefaultSettings: function () {
15251 + return {};
15252 + },
15253 +
15254 + onElementChange: debounce(function (prop) {
15255 + if (prop.indexOf("wc") !== -1) {
15256 + this.run();
15257 + }
15258 + }, 400),
15259 +
15260 + settings: function (key) {
15261 + return this.getElementSettings("wc_products_" + key);
15262 + },
15263 +
15264 + run: function () {
15265 + const options = this.getDefaultSettings(),
15266 + content = this.settings("enable_ajax_loadmore"),
15267 + container = this.$element.find(".bdt-wc-products");
15268 +
15269 + if (!container.length || content === undefined) {
15270 + return;
15271 + }
15272 +
15273 + const settingsLoadmore = this.settings("show_loadmore"),
15274 + settingsInfiniteScroll = this.settings("show_infinite_scroll"),
15275 + loadButtonContainer = this.$element.find(".bdt-loadmore-container"),
15276 + products = container.find(".bdt-wc-products-wrapper"),
15277 + loadButton = loadButtonContainer.find(".bdt-loadmore");
15278 + let loading = false;
15279 + const settings = container.data("settings");
15280 + let currentItemCount = Number(settings.posts_per_page);
15281 +
15282 + const loadMorePosts = () => {
15283 + const dataSettings = {
15284 + action: "bdt_ep_wc_products_load_more",
15285 + settings: settings,
15286 + per_page: settings.ajax_item_load,
15287 + offset: currentItemCount,
15288 + nonce: settings.nonce,
15289 + paged: settings.paged,
15290 + };
15291 +
15292 + $.ajax({
15293 + url: window.ElementPackConfig.ajaxurl,
15294 + type: "post",
15295 + data: dataSettings,
15296 + success: (response) => {
15297 + $(products).append(response.markup);
15298 + currentItemCount += settings.ajax_item_load;
15299 + settings.paged += 1;
15300 + loading = false;
15301 +
15302 + if (settingsLoadmore === "yes") {
15303 + loadButton.html("Load More");
15304 + }
15305 +
15306 + if ($(response.markup).length < settings.ajax_item_load) {
15307 + loadButton.hide();
15308 + loadButtonContainer.hide();
15309 + }
15310 + },
15311 + });
15312 + };
15313 +
15314 + const handleButtonClick = () => {
15315 + if (!loading) {
15316 + loading = true;
15317 + loadButton.html("Loading...");
15318 + loadMorePosts();
15319 + }
15320 + };
15321 +
15322 + if (settingsLoadmore === "yes") {
15323 + $(loadButton).on("click", handleButtonClick);
15324 + }
15325 +
15326 + if (settingsInfiniteScroll === "yes") {
15327 + $(window).scroll(() => {
15328 + if (
15329 + $(window).scrollTop() ===
15330 + $(document).height() - $(window).height() &&
15331 + !loading
15332 + ) {
15333 + $(loadButton).css("display", "block");
15334 + loading = true;
15335 + loadMorePosts();
15336 + }
15337 + });
15338 + }
15339 + },
15340 + });
15341 + elementorFrontend.hooks.addAction(
15342 + "frontend/element_ready/bdt-wc-products.default",
15343 + function ($scope) {
15344 + elementorFrontend.elementsHandler.addHandler(WCProducts, {
15345 + $element: $scope,
15346 + });
15347 + }
15348 + );
15349 + });
15350 + })(jQuery, window.elementorFrontend);
15351 +
15352 + /**
15353 + * Start weather widget script
15354 + */
15355 +
15356 + (function ($, elementor) {
15357 + 'use strict';
15358 + var widgetWeather = function ($scope, $) {
15359 + var $weatherContainer = $scope.find('.bdt-weather');
15360 + if (!$weatherContainer.length) {
15361 + return;
15362 + }
15363 + var $settings = $weatherContainer.data('settings');
15364 +
15365 + if ($settings.dynamicBG !== false) {
15366 + $($weatherContainer).css('background-image', 'url(' + $settings.url + ')');
15367 + $($weatherContainer).css({
15368 + 'background-size': 'cover',
15369 + 'background-position': 'center center',
15370 + 'background-repeat': 'no-repeat'
15371 + });
15372 + }
15373 +
15374 + };
15375 +
15376 + jQuery(window).on('elementor/frontend/init', function () {
15377 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-weather.default', widgetWeather);
15378 + });
15379 +
15380 + }(jQuery, window.elementorFrontend));
15381 +
15382 + /**
15383 + * End weather widget script
15384 + */
15385 +
15386 + /**
15387 + * Start remote arrows widget script
15388 + */
15389 +
15390 + ;
15391 + (function ($, elementor) {
15392 + 'use strict';
15393 + var widgetRemoteArrows = function ($scope, $) {
15394 + var $remoteArrows = $scope.find('.bdt-remote-arrows'),
15395 + $settings = $remoteArrows.data('settings'),
15396 + editMode = Boolean(elementorFrontend.isEditMode());
15397 +
15398 + if (!$remoteArrows.length) {
15399 + return;
15400 + }
15401 +
15402 + if (!$settings.remoteId) {
15403 + var $parentSection = $scope.closest('.elementor-section, .e-con .e-con-inner');
15404 + $settings['remoteId'] = $parentSection;
15405 + }
15406 +
15407 + if ($($settings.remoteId).find('.swiper').length <= 0) {
15408 + if (editMode == true) {
15409 + $($settings.id + '-notice').removeClass('bdt-hidden');
15410 + }
15411 + return;
15412 + }
15413 +
15414 + $($settings.id + '-notice').addClass('bdt-hidden');
15415 +
15416 + $(document).ready(function () {
15417 + setTimeout(() => {
15418 + const swiperInstance = $($settings.remoteId).find('.swiper')[0].swiper;
15419 +
15420 + $($settings.id).find('.bdt-prev').on("click", function () {
15421 + swiperInstance.slidePrev();
15422 + });
15423 +
15424 + $($settings.id).find('.bdt-next').on("click", function () {
15425 + swiperInstance.slideNext();
15426 + });
15427 +
15428 + }, 3000);
15429 +
15430 + });
15431 +
15432 + };
15433 +
15434 + jQuery(window).on('elementor/frontend/init', function () {
15435 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-remote-arrows.default', widgetRemoteArrows);
15436 + });
15437 +
15438 + }(jQuery, window.elementorFrontend));
15439 +
15440 + /**
15441 + * End remote arrows widget script
15442 + */
15443 + /**
15444 + * Start remote thumbs widget script
15445 + */
15446 +
15447 + ;
15448 + (function ($, elementor) {
15449 + 'use strict';
15450 + var widgetRemoteThumbs = function ($scope, $) {
15451 + var $remoteThumbs = $scope.find('.bdt-remote-thumbs'),
15452 + $settings = $remoteThumbs.data('settings'),
15453 + editMode = Boolean(elementorFrontend.isEditMode());
15454 +
15455 + if (!$remoteThumbs.length) {
15456 + return;
15457 + }
15458 +
15459 + if (!$settings.remoteId) {
15460 + // return;
15461 + var $parentSection = $scope.closest('.elementor-section, .e-con .e-con-inner');
15462 +
15463 + $settings['remoteId'] = $parentSection;
15464 + }
15465 +
15466 + if ($($settings.remoteId).find('.swiper').length <= 0) {
15467 + if (editMode == true) {
15468 + $($settings.id + '-notice').removeClass('bdt-hidden');
15469 + }
15470 + return;
15471 + }
15472 +
15473 + $($settings.id + '-notice').addClass('bdt-hidden');
15474 +
15475 + $(document).ready(function () {
15476 + setTimeout(() => {
15477 + const swiperInstance = $($settings.remoteId).find('.swiper')[0].swiper;
15478 +
15479 + var $slideActive = $($settings.remoteId).find('.swiper-slide-active');
15480 + var realIndex = $slideActive.data('swiper-slide-index')
15481 + if (typeof realIndex === 'undefined') {
15482 + realIndex = $slideActive.index();
15483 + }
15484 +
15485 + $($settings.id).find('.bdt-item:eq(' + realIndex + ')').addClass('bdt-active');
15486 +
15487 + $($settings.id).find('.bdt-item').on("click", function () {
15488 + var index = $(this).data('index');
15489 +
15490 + if ($settings.loopStatus) {
15491 + swiperInstance.slideToLoop(index);
15492 + } else {
15493 + swiperInstance.slideTo(index);
15494 + }
15495 +
15496 + $($settings.id).find('.bdt-item').removeClass('bdt-active');
15497 + $($settings.id).find('.bdt-item:eq(' + index + ')').addClass('bdt-active');
15498 + $($settings.id).addClass('wait--');
15499 +
15500 + });
15501 +
15502 + swiperInstance.on('slideChangeTransitionEnd', function (e) {
15503 + if ($($settings.id).hasClass('wait--')) {
15504 + $($settings.id).removeClass('wait--');
15505 + return;
15506 + } else {
15507 + $($settings.id).find('.bdt-item').removeClass('bdt-active');
15508 + $($settings.id).find('.bdt-item:eq(' + swiperInstance.realIndex + ')').addClass('bdt-active');
15509 + // console.log('*** mySwiper.activeIndex', swiperInstance.realIndex);
15510 + }
15511 +
15512 + });
15513 +
15514 + }, 2500);
15515 +
15516 + });
15517 + };
15518 +
15519 + jQuery(window).on('elementor/frontend/init', function () {
15520 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-remote-thumbs.default', widgetRemoteThumbs);
15521 + });
15522 +
15523 + }(jQuery, window.elementorFrontend));
15524 +
15525 + /**
15526 + * End remote thumbs widget script
15527 + */
15528 + /**
15529 + * Start remote pagination widget script
15530 + */
15531 +
15532 + ;
15533 + (function ($, elementor) {
15534 + 'use strict';
15535 + var widgetRemotePagination = function ($scope, $) {
15536 + var $remotePagination = $scope.find('.bdt-remote-pagination'),
15537 + $settings = $remotePagination.data('settings'),
15538 + editMode = Boolean(elementorFrontend.isEditMode());
15539 +
15540 + if (!$remotePagination.length) {
15541 + return;
15542 + }
15543 +
15544 + if (!$settings.remoteId) {
15545 + // return;
15546 + // try to auto detect
15547 + var $parentSection = $scope.closest('.elementor-section, .e-con .e-con-inner');
15548 +
15549 + $settings['remoteId'] = $parentSection;
15550 + }
15551 +
15552 + if ($($settings.remoteId).find('.swiper').length <= 0) {
15553 + if (editMode == true) {
15554 + $($settings.id + '-notice').removeClass('bdt-hidden');
15555 + }
15556 + return;
15557 + }
15558 +
15559 + $($settings.id + '-notice').addClass('bdt-hidden');
15560 +
15561 + $(document).ready(function () {
15562 + setTimeout(() => {
15563 + const swiperInstance = $($settings.remoteId).find('.swiper')[0].swiper;
15564 +
15565 + var $slideActive = $($settings.remoteId).find('.swiper-slide-active');
15566 + var realIndex = $slideActive.data('swiper-slide-index')
15567 + if (typeof realIndex === 'undefined') {
15568 + realIndex = $slideActive.index();
15569 + }
15570 +
15571 + $($settings.id).find('.bdt-item:eq(' + realIndex + ')').addClass('bdt-active');
15572 +
15573 + $($settings.id).find('.bdt-item').on("click", function () {
15574 + var index = $(this).data('index');
15575 +
15576 + if ($settings.loopStatus) {
15577 + swiperInstance.slideToLoop(index);
15578 + } else {
15579 + swiperInstance.slideTo(index);
15580 + }
15581 +
15582 + $($settings.id).find('.bdt-item').removeClass('bdt-active');
15583 + $($settings.id).find('.bdt-item:eq(' + index + ')').addClass('bdt-active');
15584 + $($settings.id).addClass('wait--');
15585 +
15586 + });
15587 +
15588 + swiperInstance.on('slideChangeTransitionEnd', function (e) {
15589 + if ($($settings.id).hasClass('wait--')) {
15590 + $($settings.id).removeClass('wait--');
15591 + return;
15592 + } else {
15593 + $($settings.id).find('.bdt-item').removeClass('bdt-active');
15594 + $($settings.id).find('.bdt-item:eq(' + swiperInstance.realIndex + ')').addClass('bdt-active');
15595 + // console.log('*** mySwiper.activeIndex', swiperInstance.realIndex);
15596 + }
15597 +
15598 + });
15599 +
15600 + }, 2500);
15601 +
15602 + });
15603 + };
15604 +
15605 + jQuery(window).on('elementor/frontend/init', function () {
15606 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-remote-pagination.default', widgetRemotePagination);
15607 + });
15608 +
15609 + }(jQuery, window.elementorFrontend));
15610 +
15611 + /**
15612 + * End remote pagination widget script
15613 + */
15614 + /**
15615 + * Start remote fraction widget script
15616 + */
15617 +
15618 + ;
15619 + (function ($, elementor) {
15620 + 'use strict';
15621 + var widgetRemoteFraction = function ($scope, $) {
15622 + var $remoteFraction = $scope.find('.bdt-remote-fraction'),
15623 + $settings = $remoteFraction.data('settings'),
15624 + $pad = $settings.pad,
15625 + editMode = Boolean(elementorFrontend.isEditMode());
15626 +
15627 + if (!$remoteFraction.length) {
15628 + return;
15629 + }
15630 +
15631 + if (!$settings.remoteId) {
15632 + // return;
15633 + // try to auto detect
15634 + var $parentSection = $scope.closest('.elementor-section, .e-con .e-con-inner');
15635 +
15636 + $settings['remoteId'] = $parentSection;
15637 + }
15638 +
15639 + if ($($settings.remoteId).find('.swiper').length <= 0) {
15640 + if (editMode == true) {
15641 + $($settings.id + '-notice').removeClass('bdt-hidden');
15642 + }
15643 + return;
15644 + }
15645 +
15646 + $($settings.id + '-notice').addClass('bdt-hidden');
15647 +
15648 + $(document).ready(function () {
15649 + setTimeout(() => {
15650 + const swiperInstance = $($settings.remoteId).find('.swiper')[0].swiper;
15651 +
15652 + var $slideActive = $($settings.remoteId).find('.swiper-slide-active');
15653 + var realIndex = $slideActive.data('swiper-slide-index')
15654 + if (typeof realIndex === 'undefined') {
15655 + realIndex = $slideActive.index();
15656 + }
15657 +
15658 + var $totalSlides = $($settings.remoteId).find('.swiper-slide:not(.swiper-slide-duplicate)').length;
15659 + $totalSlides = $totalSlides + '';
15660 + realIndex = ((realIndex + 1) + '');
15661 +
15662 + $($settings.id).find('.bdt-current').text(realIndex.padStart($pad, "0"));
15663 + $($settings.id).find('.bdt-total').text($totalSlides.padStart($pad, "0"));
15664 +
15665 + swiperInstance.on('slideChangeTransitionEnd', function (e) {
15666 + let item = swiperInstance.realIndex + 1 + '';
15667 + $($settings.id).find('.bdt-current').text(item.padStart($pad, "0"));
15668 + });
15669 +
15670 + }, 2500);
15671 +
15672 + });
15673 + };
15674 +
15675 + jQuery(window).on('elementor/frontend/init', function () {
15676 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-remote-fraction.default', widgetRemoteFraction);
15677 + });
15678 +
15679 + }(jQuery, window.elementorFrontend));
15680 +
15681 + /**
15682 + * End remote fraction widget script
15683 + */
15684 + jQuery(document).ready(function () {
15685 + var $el = jQuery('#ep-hash-link');
15686 +
15687 + if ($el.length <= 0) {
15688 + return;
15689 + }
15690 +
15691 + var $settings = $el.data('settings'),
15692 + selector = jQuery($settings.container).find($settings.selector);
15693 +
15694 + if (selector.length <= 0) {
15695 + return;
15696 + }
15697 +
15698 + jQuery(selector).addClass('ep-hash-link-inner-el');
15699 +
15700 + function ep_linker_builder(e) {
15701 + var specialChars = "!@#$^&%*()+=-[]/{}|:<>?,.",
15702 + rawText = e,
15703 + text = rawText.replace(/\s+/g, "-").toLowerCase();
15704 + text = text.replace(new RegExp("\\" + specialChars, "g"), "");
15705 + return text;
15706 + }
15707 +
15708 + jQuery(selector).each(function (e) {
15709 + var rawText = jQuery(this).text(),
15710 + url = ep_linker_builder(rawText);
15711 + jQuery(this).wrapAll(
15712 + '<a id="ep-hash-link-' +
15713 + e +
15714 + '" data-id="' +
15715 + e +
15716 + '" class="ep-hash-link" href="#' +
15717 + e +
15718 + "_" +
15719 + url +
15720 + '"/>'
15721 + );
15722 + });
15723 +
15724 + if (window.location.hash) {
15725 + var hash = window.location.hash;
15726 + hash = hash.slice(0, 2);
15727 + hash = "ep-hash-link-" + hash.substring(1);
15728 + jQuery("html, body").animate({
15729 + scrollTop: jQuery("#" + hash).offset().top - 150
15730 + },
15731 + 1000
15732 + );
15733 + }
15734 +
15735 + });
15736 + /**
15737 + * Start accordion widget script
15738 + */
15739 +
15740 + ;
15741 + (function ($, elementor) {
15742 + 'use strict';
15743 + var widgetCrypto = function ($scope, $) {
15744 + var $cryptoWidget = $scope.find('.bdt-ep-crypto-currency-card'),
15745 + $settings = $cryptoWidget.data('settings'),
15746 + editMode = Boolean(elementorFrontend.isEditMode());
15747 +
15748 + if (!$cryptoWidget.length) {
15749 + return;
15750 + }
15751 +
15752 + var $options = {
15753 + 'currency': $settings.currency,
15754 + 'limit': 100,
15755 + 'order': 'market_cap_desc',
15756 + };
15757 +
15758 + if ($settings.currency) {
15759 + $options.currency = $settings.currency
15760 + }
15761 + // $options.limit = $settings.limit
15762 + // if ($settings.limit) {
15763 + // }
15764 + if ($settings.order) {
15765 + $options.order = $settings.order
15766 + }
15767 +
15768 + let currency_selected, cryptoDataSettingsValue = $options;
15769 +
15770 + function getData() {
15771 + $.ajax({
15772 + type: "GET",
15773 + // dataType: "json",
15774 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
15775 + data: {
15776 + currency: currency_selected,
15777 + per_page: 1, //limit
15778 + order: cryptoDataSettingsValue.order,
15779 + ids: $settings.ids
15780 + },
15781 +
15782 + }).done(function (data) {
15783 + let itemData = $($cryptoWidget).find('.bdt-crypto-currency-card-item');
15784 + /**
15785 + * @idPriceColumnArray is holding data from current items
15786 + */
15787 +
15788 + let idPriceColumnArray = [];
15789 + for (let i = 0; i < itemData.length; i++) {
15790 + idPriceColumnArray.push({
15791 + // id: itemData[i]["id"],
15792 + id: $(itemData[i]).data('id'),
15793 + current_price: parseFloat($(itemData[i]).find('.bdt-price-text').text()),
15794 + });
15795 + }
15796 +
15797 +
15798 + /**
15799 + * @crypDataParse holding data from crypto live data server
15800 + */
15801 + let cryptDataParse = JSON.parse(data);
15802 + /**
15803 + * changes array
15804 + */
15805 + let changesIdArray = [];
15806 + /**
15807 + * now have to compare this two array of object
15808 + */
15809 + for (let i = 0; i < idPriceColumnArray.length; i++) {
15810 + $.map(cryptDataParse, function (elem, index) {
15811 + if (elem.id === idPriceColumnArray[i].id) {
15812 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
15813 + changesIdArray.push({
15814 + id: idPriceColumnArray[i].id,
15815 + current_price: elem.current_price,
15816 + old_price: idPriceColumnArray[i].current_price,
15817 + });
15818 + }
15819 + }
15820 + });
15821 + }
15822 +
15823 + if (changesIdArray.length !== 0) {
15824 + changesIdArray.forEach(element => {
15825 + $($cryptoWidget).find('[data-id="' + element.id + '"]').addClass('data-changed');
15826 + $($cryptoWidget).find('[data-id="' + element.id + '"]').find('.bdt-price-text').text(element.current_price);
15827 +
15828 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
15829 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
15830 + $($cryptoWidget).find('[data-id="' + element.id + '"] .price-int').text(amount);
15831 +
15832 + });
15833 + }
15834 +
15835 +
15836 + setTimeout(function () {
15837 + $($cryptoWidget).find('.bdt-crypto-currency-card-item').removeClass('data-changed');
15838 + return getData();
15839 + }, 10000);
15840 + });
15841 + }
15842 +
15843 + /**
15844 + * number format
15845 + */
15846 + function numFormatter(num) {
15847 + if (num > 999 && num < 1000000) {
15848 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
15849 + } else if (num > 1000000000) {
15850 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
15851 + } else if (num > 1000000) {
15852 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
15853 + } else if (num < 900) {
15854 + return num; // if value < 1000, nothing to do
15855 + }
15856 + }
15857 + /**
15858 + * defalt onload call will be here
15859 + */
15860 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
15861 + currency_selected = cryptoDataSettingsValue.currency;
15862 + } else {
15863 + currency_selected = "usd"; // default currency settings here
15864 + }
15865 +
15866 + $.ajax({
15867 + type: "GET",
15868 + dataType: "json",
15869 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
15870 + data: {
15871 + currency: currency_selected,
15872 + per_page: cryptoDataSettingsValue.limit, //limit
15873 + order: cryptoDataSettingsValue.order,
15874 + ids: $settings.ids
15875 + },
15876 + success: function (result) {
15877 + $($cryptoWidget).empty();
15878 +
15879 + if (typeof result.data !== "undefined" && result.data.length > 0 && true === result.apiErrors) {
15880 + let output = `<div class="bdt-alert-danger" bdt-alert>
15881 + <a class="bdt-alert-close" bdt-close></a>
15882 + <p>${result.data}</p>
15883 + </div>`;
15884 + $($cryptoWidget).append(output);
15885 + return;
15886 + }
15887 +
15888 +
15889 + var count = 0;
15890 + result.data.forEach(element => {
15891 + count++;
15892 + if (count > 1) {
15893 + return;
15894 + }
15895 +
15896 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
15897 + // let formatAmount = numFormatter(element.current_price);
15898 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
15899 +
15900 + let data = element.price_change_percentage_1h;
15901 + let OneHourData = (Number(data) === data && data % 1 !== 0) ? data.toFixed(2) + "%" : data + "%";
15902 +
15903 + var img_html = '';
15904 + var name_html = '';
15905 + var symble_html = '';
15906 + var price_html = '';
15907 + var hourly_price_html = '';
15908 + var market_cap_rank_html = '';
15909 + var market_cap_html = '';
15910 + var total_volume_html = '';
15911 + var price_change_html = '';
15912 + if (true == $settings.showCurrencyImage) {
15913 + img_html = `<div class="bdt-ep-currency-image">
15914 + <img src="${element.image}" alt="${element.id}">
15915 + </div>`;
15916 + }
15917 + if (true == $settings.showCurrencyShortName) {
15918 + symble_html = `<div class="bdt-ep-currency-short-name">
15919 + <span>${element.symbol}</span>
15920 + </div>`;
15921 + }
15922 + if (true == $settings.showCurrencyName) {
15923 + name_html = `<div class="bdt-crypto-name-wrap"><div class="bdt-ep-currency-name">
15924 + <span>${element.id}</span>
15925 + </div> ${symble_html}</div>`;
15926 + }
15927 + if (true == $settings.showCurrencyChangePrice) {
15928 + hourly_price_html = `<div class="bdt-percentage" title="1 Hour Data Change">${OneHourData}</div>`;
15929 + }
15930 + if (true == $settings.showCurrencyCurrentPrice) {
15931 + price_html = `<div class="bdt-width-1-1 bdt-width-1-2@s"><div class="bdt-ep-current-price">
15932 + <div class="bdt-price">${amount}</div>
15933 + ${hourly_price_html}
15934 + </div></div>`;
15935 + }
15936 + if (true == $settings.showMarketCapRank) {
15937 + market_cap_rank_html = `<div class="bdt-ep-ccc-atribute">
15938 + <span class="bdt-ep-item-text">Market Cap Rank: </span>
15939 + <span>#${element.market_cap_rank}</span>
15940 + </div>`;
15941 + }
15942 + if (true == $settings.showMarketCap) {
15943 + market_cap_html = `<div class="bdt-ep-ccc-atribute">
15944 + <span class="bdt-ep-item-text">Market Cap: </span>
15945 + <span>${element.market_cap}</span>
15946 + </div>`;
15947 + }
15948 + if (true == $settings.showTotalVolume) {
15949 + total_volume_html = `<div class="bdt-ep-ccc-atribute">
15950 + <span class="bdt-ep-item-text">Total Volume: </span>
15951 + <span>${element.total_volume}</span>
15952 + </div>`;
15953 + }
15954 + if (true == $settings.showPriceChange) {
15955 + price_change_html = `<div class="bdt-ep-ccc-atribute">
15956 + <span class="bdt-ep-item-text">24H Change(%): </span>
15957 + <span>${element.price_change_percentage_24h}</span>
15958 + </div>`;
15959 + }
15960 +
15961 + var output = `<div class="bdt-grid" bdt-grid data-id="${element.id}">
15962 +
15963 + <div class="bdt-width-1-1 bdt-width-1-2@s">
15964 + <div class="bdt-ep-currency">
15965 + ${img_html}
15966 + ${name_html}
15967 + </div>
15968 + </div>
15969 +
15970 + ${price_html}
15971 +
15972 + <div class="bdt-width-1-1 bdt-margin-small-top bdt-ep-ccc-atributes bdt-grid-margin bdt-first-column">
15973 +
15974 + ${market_cap_rank_html}
15975 +
15976 + ${market_cap_html}
15977 +
15978 + ${total_volume_html}
15979 +
15980 + ${price_change_html}
15981 +
15982 + </div>
15983 +
15984 + <span class="bdt-price-text bdt-hidden">${element.current_price}</span>
15985 + </div>`;
15986 +
15987 + $($cryptoWidget).append(output);
15988 +
15989 + });
15990 + }
15991 + });
15992 +
15993 + if (true !== editMode) {
15994 + setTimeout(function () {
15995 + getData();
15996 + }, 5000);
15997 + }
15998 +
15999 + };
16000 +
16001 + jQuery(window).on('elementor/frontend/init', function () {
16002 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-card.default', widgetCrypto);
16003 + });
16004 +
16005 + }(jQuery, window.elementorFrontend));
16006 +
16007 + /**
16008 + * End accordion widget script
16009 + */
16010 + /**
16011 + * Start accordion widget script
16012 + */
16013 +
16014 + ;
16015 + (function ($, elementor) {
16016 + 'use strict';
16017 + var widgetCrypto = function ($scope, $) {
16018 + var $cryptoWidget = $scope.find('.bdt-crypto-currency-table'),
16019 + $settings = $cryptoWidget.data('settings'),
16020 + editMode = Boolean(elementorFrontend.isEditMode());
16021 +
16022 + if (!$cryptoWidget.length) {
16023 + return;
16024 + }
16025 +
16026 +
16027 +
16028 + var $options = {
16029 + 'currency': $settings.currency,
16030 + 'limit': 100,
16031 + 'order': 'market_cap_desc',
16032 + };
16033 +
16034 + if ($settings.currency) {
16035 + $options.currency = $settings.currency
16036 + }
16037 + if ($settings.limit) {
16038 + $options.limit = $settings.limit
16039 + }
16040 + if ($settings.order) {
16041 + $options.order = $settings.order
16042 + }
16043 +
16044 + let table, currency_selected, cryptoDataSettingsValue = $options;
16045 +
16046 + function getData() {
16047 + $.ajax({
16048 + type: "GET",
16049 + // dataType: "json",
16050 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
16051 + data: {
16052 + currency: currency_selected,
16053 + per_page: cryptoDataSettingsValue.limit, //limit
16054 + order: cryptoDataSettingsValue.order,
16055 + ids: $settings.ids
16056 + },
16057 +
16058 + }).done(function (data) {
16059 + var tableData = table.rows().data();
16060 + /**
16061 + * @idPriceColumnArray is holding data from current datatable
16062 + */
16063 + let idPriceColumnArray = [];
16064 + for (let i = 0; i < tableData.length; i++) {
16065 + idPriceColumnArray.push({
16066 + id: tableData[i]["id"],
16067 + current_price: tableData[i]["current_price"],
16068 + });
16069 + }
16070 + /**
16071 + * @crypDataParse holding data from crypto live data server
16072 + */
16073 + let cryptDataParse = JSON.parse(data);
16074 + /**
16075 + * changes array
16076 + */
16077 + let changesIdArray = [];
16078 + /**
16079 + * now have to compare this two array of object
16080 + */
16081 + for (let i = 0; i < idPriceColumnArray.length; i++) {
16082 + $.map(cryptDataParse, function (elem, index) {
16083 + if (elem.id === idPriceColumnArray[i].id) {
16084 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
16085 + changesIdArray.push({
16086 + id: idPriceColumnArray[i].id,
16087 + current_price: elem.current_price,
16088 + old_price: idPriceColumnArray[i].current_price,
16089 + });
16090 + }
16091 + }
16092 + });
16093 + }
16094 +
16095 + changesIdArray.filter(function (valueChangesArray, index) {
16096 + let foundindex = 0;
16097 + var filteredData = table.column(1)
16098 + .data()
16099 + .filter(function (value, index) {
16100 + if (value === valueChangesArray.id) {
16101 + foundindex = index;
16102 + table.column(2)
16103 + .nodes()
16104 + .each(function (node, colIndex, dt) {
16105 + if (colIndex === index) {
16106 + table.cell(node)
16107 + .data(valueChangesArray.current_price);
16108 + let nodes = table.column(2).nodes();
16109 + $(nodes[index]).addClass("focus-item");
16110 + }
16111 + });
16112 + }
16113 + return value === valueChangesArray.id ? true : false;
16114 + });
16115 + });
16116 + setTimeout(function () {
16117 + table.column(2)
16118 + .nodes()
16119 + .each(function () {
16120 + $(this).removeClass("focus-item");
16121 + });
16122 + return getData();
16123 + }, 10000);
16124 + });
16125 + }
16126 +
16127 + /**
16128 + * number format
16129 + */
16130 + function numFormatter(num) {
16131 + if (num > 999 && num < 1000000) {
16132 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
16133 + } else if (num > 1000000000) {
16134 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
16135 + } else if (num > 1000000) {
16136 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
16137 + } else if (num < 900) {
16138 + return num; // if value < 1000, nothing to do
16139 + }
16140 + }
16141 + /**
16142 + * defalt onload call will be here
16143 + */
16144 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
16145 + currency_selected = cryptoDataSettingsValue.currency;
16146 + } else {
16147 + currency_selected = "usd"; // default currency settings here
16148 + }
16149 + table = $($settings.tableId).DataTable({
16150 + language : window.ElementPackConfig.data_table.language, // default language override for proper translation
16151 + destroy: true, // fixed the Alert issue in Edit mode
16152 + processing: true,
16153 + serverSide: false,
16154 + searching: $settings.searching,
16155 + ordering: $settings.ordering,
16156 + paging: $settings.paging,
16157 + info: $settings.info,
16158 + pageLength: $settings.pageLength,
16159 + ajax: {
16160 + type: "GET",
16161 + dataType: "json",
16162 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
16163 + data: {
16164 + currency: currency_selected,
16165 + per_page: cryptoDataSettingsValue.limit, //limit
16166 + order: cryptoDataSettingsValue.order,
16167 + ids: $settings.ids
16168 + },
16169 + },
16170 + columns: [{
16171 + data: "market_cap_rank"
16172 + },
16173 + {
16174 + data: "id",
16175 + render: function (data, type, row, meta) {
16176 + return (
16177 + '<div class="bdt-coin"><div class="bdt-coin-image"><img src="' +
16178 + row["image"] +
16179 + '" alt="' +
16180 + row["id"] +
16181 + '"></div><div class="bdt-coin-title"><div class="bdt-coin-name">' +
16182 + row["id"] +
16183 + '</div><div class="bdt-coin-symbol">' +
16184 + row["symbol"] +
16185 + "</div></div></div>"
16186 + );
16187 + },
16188 + },
16189 + {
16190 + data: "current_price",
16191 + render: function (data, type, row, meta) {
16192 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16193 + let val = Number(data) === data && data % 1 !== 0 ? data.toFixed(2) : data; // this is just we are checking if this value is float. then we are just adjusting the two decimal point. otherwise returing the original value
16194 + //return returnCurrencySymbol(upperCaseCurrncyCode) + data;
16195 + return returnCurrencySymbol(upperCaseCurrncyCode) + val;
16196 + },
16197 + },
16198 + {
16199 + data: "price_change_percentage_24h",
16200 + render: function (data, type, row, meta) {
16201 + return Number(data) === data && data % 1 !== 0 ? data.toFixed(2) + "%" : data + "%";
16202 + },
16203 + },
16204 + {
16205 + data: "market_cap",
16206 + render: function (data, type, row, meta) {
16207 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16208 + let formatAmout = numFormatter(data);
16209 + //return returnCurrencySymbol(upperCaseCurrncyCode) + data;
16210 + return returnCurrencySymbol(upperCaseCurrncyCode) + formatAmout;
16211 + },
16212 + },
16213 + {
16214 + data: "total_volume",
16215 + render: function (data, type, row, meta) {
16216 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16217 + let formatAmout = numFormatter(data);
16218 + //return returnCurrencySymbol(upperCaseCurrncyCode) + data;
16219 + return returnCurrencySymbol(upperCaseCurrncyCode) + formatAmout;
16220 + },
16221 + },
16222 + {
16223 + data: "circulating_supply",
16224 + render: function (data, type, row, mata) {
16225 + let formatAmout = numFormatter(data);
16226 + //return data.toFixed(2);
16227 + return formatAmout;
16228 + }
16229 + },
16230 + {
16231 + data: "last_seven_days_changes",
16232 + render: function (data, type, row, meta) {
16233 + return (
16234 + '<input type="hidden" class="hdnInputCanvas-' + row["id"] + '" value="' + data + '"/>' + '<div class="chart-container" style="position: relative; height: 100%; width: 250px"><canvas id="canvas-' + row["id"] + '"></canvas></div>'
16235 + );
16236 + },
16237 + },
16238 + ],
16239 + columnDefs: [{
16240 + searchable: false,
16241 + orderable: false,
16242 + //targets: [0, 8],
16243 + targets: [7],
16244 + }, ],
16245 + //order: [[1, "asc"]],
16246 + order: [
16247 + [0, "asc"]
16248 + ],
16249 + createdRow: function (row, data, index) {
16250 + let getCanvasElement = $("td", row).eq(7);
16251 + //let canvas_id = $(getCanvasElement).find("canvas").attr("id");
16252 + let getHiddenData = $(getCanvasElement).find("input").val();
16253 + let splitData = getHiddenData.split(",");
16254 + /***
16255 + * here we are just getting last 20 values value
16256 + */
16257 + if (splitData && splitData.length > 15) {
16258 + splitData = splitData.slice(0, 14);
16259 + }
16260 + /**
16261 + * end of splice code. this we can remove if any further code found
16262 + */
16263 + const dom_canvas_element = $(getCanvasElement).find("canvas");
16264 + const labels = [],
16265 + dataPointvalue = [];
16266 + splitData.forEach((element, index) => {
16267 + labels.push(index);
16268 + dataPointvalue.push(Number(element));
16269 + });
16270 +
16271 +
16272 + // gradient color chart
16273 +
16274 +
16275 + const dataCharts = {
16276 + labels: labels,
16277 + datasets: [{
16278 + label: "",
16279 + backgroundColor: "rgba(30,135,240,0.2)",
16280 + borderColor: "#1e87f0",
16281 + fill: true,
16282 + lineTension: 0.4,
16283 + pointStyle: 'circle',
16284 + pointBackgroundColor: "transparent",
16285 + pointBorderWidth: 0,
16286 + borderWidth: 2,
16287 + data: dataPointvalue,
16288 + }, ],
16289 + };
16290 + const config = {
16291 + type: "line",
16292 + data: dataCharts,
16293 + options: {
16294 + responsive: true,
16295 + plugins: {
16296 + legend: {
16297 + display: false,
16298 + },
16299 + tooltip: {
16300 + enabled: true,
16301 + callbacks: {
16302 + title: () => ''
16303 + }
16304 + }
16305 + },
16306 + scales: {
16307 + x: {
16308 + ticks: {
16309 + display: false,
16310 + },
16311 + grid: {
16312 + display: false,
16313 + drawBorder: false,
16314 + drawOnChartArea: false,
16315 + drawTicks: false,
16316 + },
16317 + },
16318 + y: {
16319 + ticks: {
16320 + display: false,
16321 + },
16322 + grid: {
16323 + display: false,
16324 + drawBorder: false,
16325 + drawOnChartArea: false,
16326 + drawTicks: false,
16327 + },
16328 + },
16329 + },
16330 + },
16331 + };
16332 + const chart = new Chart(dom_canvas_element, config);
16333 + chart.canvas.parentNode.style.width = "100%";
16334 + chart.canvas.parentNode.style.height = "60px";
16335 + chart.canvas.style.width = "100%";
16336 + chart.canvas.style.height = "60px";
16337 + },
16338 + });
16339 +
16340 + if (true !== editMode) {
16341 + setTimeout(function () {
16342 + getData();
16343 + }, 5000);
16344 + }
16345 +
16346 + };
16347 +
16348 + jQuery(window).on('elementor/frontend/init', function () {
16349 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-table.default', widgetCrypto);
16350 + });
16351 +
16352 + }(jQuery, window.elementorFrontend));
16353 +
16354 + /**
16355 + * End accordion widget script
16356 + */
16357 + /**
16358 + * Start accordion widget script
16359 + */
16360 +
16361 + ;
16362 + (function ($, elementor) {
16363 + 'use strict';
16364 + var widgetCrypto = function ($scope, $) {
16365 + var $cryptoWidget = $scope.find('.bdt-crypto-currency-grid'),
16366 + $settings = $cryptoWidget.data('settings'),
16367 + editMode = Boolean(elementorFrontend.isEditMode());
16368 +
16369 + if (!$cryptoWidget.length) {
16370 + return;
16371 + }
16372 +
16373 + var $options = {
16374 + 'currency': $settings.currency,
16375 + 'limit': 100,
16376 + 'order': 'market_cap_desc',
16377 + };
16378 +
16379 + if ($settings.currency) {
16380 + $options.currency = $settings.currency
16381 + }
16382 + if ($settings.limit) {
16383 + $options.limit = $settings.limit
16384 + }
16385 + if ($settings.order) {
16386 + $options.order = $settings.order
16387 + }
16388 +
16389 + let currency_selected, cryptoDataSettingsValue = $options;
16390 +
16391 + function getData() {
16392 + $.ajax({
16393 + type: "GET",
16394 + // dataType: "json",
16395 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
16396 + data: {
16397 + currency: currency_selected,
16398 + per_page: cryptoDataSettingsValue.limit, //limit
16399 + order: cryptoDataSettingsValue.order,
16400 + ids: $settings.ids
16401 + },
16402 +
16403 + }).done(function (data) {
16404 + let itemData = $($cryptoWidget).find('.bdt-crypto-currency-grid-item');
16405 + /**
16406 + * @idPriceColumnArray is holding data from current items
16407 + */
16408 +
16409 + let idPriceColumnArray = [];
16410 + for (let i = 0; i < itemData.length; i++) {
16411 + idPriceColumnArray.push({
16412 + // id: itemData[i]["id"],
16413 + id: $(itemData[i]).data('id'),
16414 + current_price: parseFloat($(itemData[i]).find('.bdt-price-text').text()),
16415 + });
16416 + }
16417 +
16418 + // console.log(idPriceColumnArray);
16419 +
16420 + /**
16421 + * @crypDataParse holding data from crypto live data server
16422 + */
16423 +
16424 + let cryptDataParse = JSON.parse(data);
16425 + /**
16426 + * changes array
16427 + */
16428 + let changesIdArray = [];
16429 + /**
16430 + * now have to compare this two array of object
16431 + */
16432 + for (let i = 0; i < idPriceColumnArray.length; i++) {
16433 + $.map(cryptDataParse, function (elem, index) {
16434 + if (elem.id === idPriceColumnArray[i].id) {
16435 + // console.log(elem.current_price);
16436 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
16437 + changesIdArray.push({
16438 + id: idPriceColumnArray[i].id,
16439 + current_price: elem.current_price,
16440 + old_price: idPriceColumnArray[i].current_price,
16441 + });
16442 + }
16443 + }
16444 + });
16445 + }
16446 +
16447 + // console.log(changesIdArray);
16448 +
16449 + if (changesIdArray.length !== 0) {
16450 + changesIdArray.forEach(element => {
16451 + $($cryptoWidget).find('[data-id="' + element.id + '"]').addClass('data-changed');
16452 + $($cryptoWidget).find('[data-id="' + element.id + '"]').find('.bdt-price-text').text(element.current_price);
16453 +
16454 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16455 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
16456 + $($cryptoWidget).find('[data-id="' + element.id + '"] .price-int').text(amount);
16457 +
16458 + });
16459 + }
16460 +
16461 +
16462 + setTimeout(function () {
16463 + $($cryptoWidget).find('.bdt-crypto-currency-grid-item').removeClass('data-changed');
16464 + return getData();
16465 + }, 10000);
16466 + });
16467 + }
16468 +
16469 + /**
16470 + * number format
16471 + */
16472 + function numFormatter(num) {
16473 + if (num > 999 && num < 1000000) {
16474 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
16475 + } else if (num > 1000000000) {
16476 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
16477 + } else if (num > 1000000) {
16478 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
16479 + } else if (num < 900) {
16480 + return num; // if value < 1000, nothing to do
16481 + }
16482 + }
16483 + /**
16484 + * defalt onload call will be here
16485 + */
16486 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
16487 + currency_selected = cryptoDataSettingsValue.currency;
16488 + } else {
16489 + currency_selected = "usd"; // default currency settings here
16490 + }
16491 +
16492 + $.ajax({
16493 + type: "GET",
16494 + dataType: "json",
16495 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
16496 + data: {
16497 + currency: currency_selected,
16498 + per_page: cryptoDataSettingsValue.limit, //limit
16499 + order: cryptoDataSettingsValue.order,
16500 + ids: $settings.ids
16501 + },
16502 + success: function (result) {
16503 + $($cryptoWidget).empty();
16504 +
16505 +
16506 + if (typeof result.data !== "undefined" && result.data.length > 0 && true === result.apiErrors) {
16507 + let output = `<div class="bdt-alert-danger" bdt-alert>
16508 + <a class="bdt-alert-close" bdt-close></a>
16509 + <p>${result.data}</p>
16510 + </div>`;
16511 + $($cryptoWidget).append(output);
16512 + return;
16513 + }
16514 +
16515 + var count = 0;
16516 + result.data.forEach(element => {
16517 + count++;
16518 + if (count > cryptoDataSettingsValue.limit) {
16519 + return;
16520 + }
16521 + // console.log(element.id);
16522 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16523 + // let formatAmount = numFormatter(element.current_price);
16524 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
16525 +
16526 + var img_html = '';
16527 + var name_html = '';
16528 + var symble_html = '';
16529 + var price_html = '';
16530 + var price_label_html = '';
16531 + if (true == $settings.showCurrencyImage) {
16532 + img_html = `<div class="bdt-crypto-currency-grid-img">
16533 + <img src="${element.image}" alt="${element.id}">
16534 + </div>`;
16535 + }
16536 + if (true == $settings.showCurrencyShortName) {
16537 + symble_html = `<span>(${element.symbol})</span>`;
16538 + }
16539 + if (true == $settings.showCurrencyName) {
16540 + name_html = `<div class="bdt-crypto-currency-grid-title">
16541 + <h4>${element.id} ${symble_html}</h4>
16542 + </div>`;
16543 + }
16544 + if (true == $settings.showCurrencyPriceLabel) {
16545 + price_label_html = `<div class="bdt-crypto-currency-grid-price-text">
16546 + <span>price</span>
16547 + </div>`;
16548 + }
16549 + if (true == $settings.showCurrencyCurrentPrice) {
16550 + price_html = `${price_label_html}
16551 + <div class="bdt-crypto-currency-grid-price-nu">
16552 + <span class="price-int">${amount}</span>
16553 + </div>`;
16554 + }
16555 +
16556 + var output = `<div class="bdt-crypto-currency-grid-item" data-id="${element.id}">
16557 + <div class="bdt-crypto-currency-grid-content">
16558 + <div class="bdt-crypto-currency-grid-bg">
16559 + <img src="${element.image}" alt="${element.id}">
16560 + </div>
16561 +
16562 + <div class="bdt-crypto-currency-grid-head-content">
16563 + ${img_html}
16564 + ${name_html}
16565 + </div>
16566 + <div class="bdt-crypto-currency-grid-bottom-content">
16567 + ${price_html}
16568 + </div>
16569 + </div>
16570 + <span class="bdt-price-text bdt-hidden">${element.current_price}</span>
16571 + </div>`;
16572 +
16573 + $($cryptoWidget).append(output);
16574 +
16575 + });
16576 + }
16577 + });
16578 +
16579 + if (true !== editMode) {
16580 + setTimeout(function () {
16581 + getData();
16582 + }, 5000);
16583 + }
16584 +
16585 + };
16586 +
16587 + jQuery(window).on('elementor/frontend/init', function () {
16588 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-grid.default', widgetCrypto);
16589 + });
16590 +
16591 + }(jQuery, window.elementorFrontend));
16592 +
16593 + /**
16594 + * End accordion widget script
16595 + */
16596 + /**
16597 + * Start accordion widget script
16598 + */
16599 +
16600 + ;
16601 + (function ($, elementor) {
16602 + 'use strict';
16603 + var widgetCrypto = function ($scope, $) {
16604 + var $cryptoWidget = $scope.find('.bdt-crypto-currency-list'),
16605 + $settings = $cryptoWidget.data('settings'),
16606 + editMode = Boolean(elementorFrontend.isEditMode());
16607 +
16608 + if (!$cryptoWidget.length) {
16609 + return;
16610 + }
16611 +
16612 + var $options = {
16613 + 'currency': $settings.currency,
16614 + 'limit': 100,
16615 + 'order': 'market_cap_desc',
16616 + };
16617 +
16618 + if ($settings.currency) {
16619 + $options.currency = $settings.currency
16620 + }
16621 + if ($settings.limit) {
16622 + $options.limit = $settings.limit
16623 + }
16624 + if ($settings.order) {
16625 + $options.order = $settings.order
16626 + }
16627 +
16628 + let currency_selected, cryptoDataSettingsValue = $options;
16629 +
16630 + function getData() {
16631 + $.ajax({
16632 + type: "GET",
16633 + // dataType: "json",
16634 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
16635 + data: {
16636 + currency: currency_selected,
16637 + per_page: cryptoDataSettingsValue.limit, //limit
16638 + order: cryptoDataSettingsValue.order,
16639 + ids: $settings.ids
16640 + },
16641 +
16642 + }).done(function (data) {
16643 + let itemData = $($cryptoWidget).find('.bdt-crypto-currency-list-item');
16644 + /**
16645 + * @idPriceColumnArray is holding data from current items
16646 + */
16647 +
16648 + let idPriceColumnArray = [];
16649 + for (let i = 0; i < itemData.length; i++) {
16650 + idPriceColumnArray.push({
16651 + // id: itemData[i]["id"],
16652 + id: $(itemData[i]).data('id'),
16653 + current_price: parseFloat($(itemData[i]).find('.bdt-price-text').text()),
16654 + });
16655 + }
16656 +
16657 + // console.log(idPriceColumnArray);
16658 +
16659 + /**
16660 + * @crypDataParse holding data from crypto live data server
16661 + */
16662 + let cryptDataParse = JSON.parse(data);
16663 + /**
16664 + * changes array
16665 + */
16666 + let changesIdArray = [];
16667 + /**
16668 + * now have to compare this two array of object
16669 + */
16670 + for (let i = 0; i < idPriceColumnArray.length; i++) {
16671 + $.map(cryptDataParse, function (elem, index) {
16672 + if (elem.id === idPriceColumnArray[i].id) {
16673 + // console.log(elem.current_price);
16674 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
16675 + changesIdArray.push({
16676 + id: idPriceColumnArray[i].id,
16677 + current_price: elem.current_price,
16678 + old_price: idPriceColumnArray[i].current_price,
16679 + });
16680 + }
16681 + }
16682 + });
16683 + }
16684 +
16685 + // console.log(changesIdArray);
16686 +
16687 + if (changesIdArray.length !== 0) {
16688 + changesIdArray.forEach(element => {
16689 + $($cryptoWidget).find('[data-id="' + element.id + '"]').addClass('data-changed');
16690 + $($cryptoWidget).find('[data-id="' + element.id + '"]').find('.bdt-price-text').text(element.current_price);
16691 +
16692 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16693 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
16694 + $($cryptoWidget).find('[data-id="' + element.id + '"] .price-int').text(amount);
16695 +
16696 + });
16697 + }
16698 +
16699 +
16700 + setTimeout(function () {
16701 + $($cryptoWidget).find('.bdt-crypto-currency-list-item').removeClass('data-changed');
16702 + return getData();
16703 + }, 10000);
16704 + });
16705 + }
16706 +
16707 + /**
16708 + * number format
16709 + */
16710 + function numFormatter(num) {
16711 + if (num > 999 && num < 1000000) {
16712 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
16713 + } else if (num > 1000000000) {
16714 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
16715 + } else if (num > 1000000) {
16716 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
16717 + } else if (num < 900) {
16718 + return num; // if value < 1000, nothing to do
16719 + }
16720 + }
16721 + /**
16722 + * defalt onload call will be here
16723 + */
16724 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
16725 + currency_selected = cryptoDataSettingsValue.currency;
16726 + } else {
16727 + currency_selected = "usd"; // default currency settings here
16728 + }
16729 +
16730 + $.ajax({
16731 + type: "GET",
16732 + dataType: "json",
16733 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
16734 + data: {
16735 + currency: currency_selected,
16736 + per_page: cryptoDataSettingsValue.limit, //limit
16737 + order: cryptoDataSettingsValue.order,
16738 + ids: $settings.ids
16739 + },
16740 + success: function (result) {
16741 + $($cryptoWidget).empty();
16742 + var count = 0;
16743 + result.data.forEach(element => {
16744 + count++;
16745 + if (count > cryptoDataSettingsValue.limit) {
16746 + return;
16747 + }
16748 + // console.log(element.id);
16749 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16750 + // let formatAmount = numFormatter(element.current_price);
16751 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
16752 +
16753 + var img_html = '';
16754 + var name_html = '';
16755 + var symble_html = '';
16756 + var price_html = '';
16757 + if (true == $settings.showCurrencyImage) {
16758 + img_html = `<div class="bdt-crypto-currency-list-img">
16759 + <img src="${element.image}" alt="${element.id}">
16760 + </div>`;
16761 + }
16762 + if (true == $settings.showCurrencyShortName) {
16763 + symble_html = `<span>(${element.symbol})</span>`;
16764 + }
16765 + if (true == $settings.showCurrencyName) {
16766 + name_html = `<div class="bdt-crypto-currency-list-title">
16767 + ${element.id} ${symble_html}
16768 + </div>`;
16769 + }
16770 + if (true == $settings.showCurrencyCurrentPrice) {
16771 + price_html = `<div class="bdt-crypto-currency-list-price">
16772 + <span>${amount}</span>
16773 + </div>`;
16774 + }
16775 +
16776 + var output = `<div class="bdt-crypto-currency-list-item" data-id="${element.id}">
16777 +
16778 + <div class="bdt-crypto-currency-list-content">
16779 + <div class="bdt-crypto-currency-list-inner">
16780 + ${img_html}
16781 + ${name_html}
16782 + </div>
16783 + ${price_html}
16784 + </div>
16785 +
16786 + <span class="bdt-price-text bdt-hidden">${element.current_price}</span>
16787 + </div>`;
16788 +
16789 + $($cryptoWidget).append(output);
16790 +
16791 + });
16792 + }
16793 + });
16794 +
16795 + if (true !== editMode) {
16796 + setTimeout(function () {
16797 + getData();
16798 + }, 5000);
16799 + }
16800 +
16801 + };
16802 +
16803 + jQuery(window).on('elementor/frontend/init', function () {
16804 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-list.default', widgetCrypto);
16805 + });
16806 +
16807 + }(jQuery, window.elementorFrontend));
16808 +
16809 + /**
16810 + * End accordion widget script
16811 + */
16812 + (function ($, elementor) {
16813 +
16814 + 'use strict';
16815 +
16816 + var widgetCrypto = function ($scope, $) {
16817 +
16818 + var $carousel = $scope.find('.bdt-crypto-currency-carousel'),
16819 + $cryptoWidget = $scope.find('.bdt-crypto-currency-carousel'),
16820 + $settings = $cryptoWidget.data('crypto-settings'),
16821 + editMode = Boolean(elementorFrontend.isEditMode());
16822 +
16823 + if (!$carousel.length) {
16824 + return;
16825 + }
16826 +
16827 + var $options = {
16828 + 'currency': $settings.currency,
16829 + 'limit': 100,
16830 + 'order': 'market_cap_desc',
16831 + };
16832 +
16833 + if ($settings.currency) {
16834 + $options.currency = $settings.currency
16835 + }
16836 + if ($settings.limit) {
16837 + $options.limit = $settings.limit
16838 + }
16839 + if ($settings.order) {
16840 + $options.order = $settings.order
16841 + }
16842 +
16843 + let currency_selected, cryptoDataSettingsValue = $options;
16844 +
16845 + function getData() {
16846 + $.ajax({
16847 + type: "GET",
16848 + // dataType: "json",
16849 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
16850 + data: {
16851 + currency: currency_selected,
16852 + per_page: cryptoDataSettingsValue.limit, //limit
16853 + order: cryptoDataSettingsValue.order,
16854 + ids: $settings.ids
16855 + },
16856 +
16857 + }).done(function (data) {
16858 + let itemData = $($cryptoWidget).find('.bdt-crypto-currency-carousel-item');
16859 + /**
16860 + * @idPriceColumnArray is holding data from current items
16861 + */
16862 +
16863 + let idPriceColumnArray = [];
16864 + for (let i = 0; i < itemData.length; i++) {
16865 + idPriceColumnArray.push({
16866 + // id: itemData[i]["id"],
16867 + id: $(itemData[i]).data('id'),
16868 + current_price: parseFloat($(itemData[i]).find('.bdt-price-text').text()),
16869 + });
16870 + }
16871 +
16872 + /**
16873 + * @crypDataParse holding data from crypto live data server
16874 + */
16875 + let cryptDataParse = JSON.parse(data);
16876 + /**
16877 + * changes array
16878 + */
16879 + let changesIdArray = [];
16880 + /**
16881 + * now have to compare this two array of object
16882 + */
16883 + for (let i = 0; i < idPriceColumnArray.length; i++) {
16884 + $.map(cryptDataParse, function (elem, index) {
16885 + if (elem.id === idPriceColumnArray[i].id) {
16886 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
16887 + changesIdArray.push({
16888 + id: idPriceColumnArray[i].id,
16889 + current_price: elem.current_price,
16890 + old_price: idPriceColumnArray[i].current_price,
16891 + });
16892 + }
16893 + }
16894 + });
16895 + }
16896 +
16897 + if (changesIdArray.length !== 0) {
16898 + changesIdArray.forEach(element => {
16899 + $($cryptoWidget).find('[data-id="' + element.id + '"]').addClass('data-changed');
16900 + $($cryptoWidget).find('[data-id="' + element.id + '"]').find('.bdt-price-text').text(element.current_price);
16901 +
16902 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16903 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
16904 + $($cryptoWidget).find('[data-id="' + element.id + '"] .price-int').text(amount);
16905 +
16906 + });
16907 + }
16908 +
16909 +
16910 + setTimeout(function () {
16911 + $($cryptoWidget).find('.bdt-crypto-currency-carousel-item').removeClass('data-changed');
16912 + return getData();
16913 + }, 10000);
16914 + });
16915 + }
16916 +
16917 + /**
16918 + * number format
16919 + */
16920 + function numFormatter(num) {
16921 + if (num > 999 && num < 1000000) {
16922 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
16923 + } else if (num > 1000000000) {
16924 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
16925 + } else if (num > 1000000) {
16926 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
16927 + } else if (num < 900) {
16928 + return num; // if value < 1000, nothing to do
16929 + }
16930 + }
16931 + /**
16932 + * defalt onload call will be here
16933 + */
16934 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
16935 + currency_selected = cryptoDataSettingsValue.currency;
16936 + } else {
16937 + currency_selected = "usd"; // default currency settings here
16938 + }
16939 +
16940 + $.ajax({
16941 + type: "GET",
16942 + dataType: "json",
16943 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
16944 + data: {
16945 + currency: currency_selected,
16946 + per_page: cryptoDataSettingsValue.limit, //limit
16947 + order: cryptoDataSettingsValue.order,
16948 + ids: $settings.ids
16949 + },
16950 + success: function (result) {
16951 + $($cryptoWidget).find('.swiper-wrapper').empty();
16952 + var count = 0;
16953 + result.data.forEach(element => {
16954 + count++;
16955 + if (count > cryptoDataSettingsValue.limit) {
16956 + return;
16957 + }
16958 +
16959 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
16960 + // let formatAmount = numFormatter(element.current_price);
16961 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
16962 +
16963 + var img_html = '';
16964 + var name_html = '';
16965 + var symble_html = '';
16966 + var price_html = '';
16967 + var price_label_html = '';
16968 + if (true == $settings.showCurrencyImage) {
16969 + img_html = `<div class="bdt-crypto-currency-carousel-img">
16970 + <img src="${element.image}" alt="${element.id}">
16971 + </div>`;
16972 + }
16973 + if (true == $settings.showCurrencyShortName) {
16974 + symble_html = `<span>(${element.symbol})</span>`;
16975 + }
16976 + if (true == $settings.showCurrencyName) {
16977 + name_html = `<div class="bdt-crypto-currency-carousel-title">
16978 + <h4>${element.id} ${symble_html}</h4>
16979 + </div>`;
16980 + }
16981 + if (true == $settings.showCurrencyPriceLabel) {
16982 + price_label_html = `<div class="bdt-crypto-currency-carousel-price-text">
16983 + <span>price</span>
16984 + </div>`;
16985 + }
16986 + if (true == $settings.showCurrencyCurrentPrice) {
16987 + price_html = `${price_label_html}
16988 + <div class="bdt-crypto-currency-carousel-price-nu">
16989 + <span class="price-int">${amount}</span>
16990 + </div>`;
16991 + }
16992 +
16993 + var output = `<div class="swiper-slide"><div class="bdt-crypto-currency-carousel-item" data-id="${element.id}">
16994 + <div class="bdt-crypto-currency-carousel-content">
16995 + <div class="bdt-crypto-currency-carousel-bg">
16996 + <img src="${element.image}" alt="${element.id}">
16997 + </div>
16998 +
16999 + <div class="bdt-crypto-currency-carousel-head-content">
17000 + ${img_html}
17001 + ${name_html}
17002 + </div>
17003 + <div class="bdt-crypto-currency-carousel-bottom-content">
17004 + ${price_html}
17005 + </div>
17006 + </div>
17007 + <span class="bdt-price-text bdt-hidden">${element.current_price}</span>
17008 + </div></div>`;
17009 +
17010 + $($cryptoWidget).find('.swiper-wrapper').append(output);
17011 +
17012 + var $carouselContainer = $carousel.find('.swiper-carousel'),
17013 + $carouselSettings = $carousel.data('settings');
17014 +
17015 + const Swiper = elementorFrontend.utils.swiper;
17016 + initSwiper();
17017 + async function initSwiper() {
17018 + var swiper = await new Swiper($carouselContainer, $carouselSettings);
17019 +
17020 + if ($carouselSettings.pauseOnHover) {
17021 + $($carouselContainer).hover(function () {
17022 + (this).swiper.autoplay.stop();
17023 + }, function () {
17024 + (this).swiper.autoplay.start();
17025 + });
17026 + }
17027 +
17028 + };
17029 +
17030 + });
17031 + }
17032 + });
17033 +
17034 + if (true !== editMode) {
17035 + setTimeout(function () {
17036 + getData();
17037 + }, 5000);
17038 + }
17039 +
17040 +
17041 +
17042 + };
17043 +
17044 +
17045 + jQuery(window).on('elementor/frontend/init', function () {
17046 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-carousel.default', widgetCrypto);
17047 + });
17048 +
17049 + }(jQuery, window.elementorFrontend));
17050 + /**
17051 + * Start accordion widget script
17052 + */
17053 +
17054 + ;
17055 + (function ($, elementor) {
17056 + 'use strict';
17057 + var widgetCrypto = function ($scope, $) {
17058 + var $cryptoWidget = $scope.find('.bdt-crypto-currency-chart'),
17059 + $settings = $cryptoWidget.data('settings'),
17060 + editMode = Boolean(elementorFrontend.isEditMode());
17061 +
17062 + if (!$cryptoWidget.length) {
17063 + return;
17064 + }
17065 +
17066 + var $options = {
17067 + 'currency': $settings.currency,
17068 + 'limit': 100,
17069 + 'order': 'market_cap_desc',
17070 + };
17071 +
17072 + if ($settings.currency) {
17073 + $options.currency = $settings.currency
17074 + }
17075 + if ($settings.limit) {
17076 + $options.limit = $settings.limit
17077 + }
17078 + if ($settings.order) {
17079 + $options.order = $settings.order
17080 + }
17081 +
17082 + let currency_selected, cryptoDataSettingsValue = $options;
17083 +
17084 + function getData() {
17085 + $.ajax({
17086 + type: "GET",
17087 + // dataType: "json",
17088 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
17089 + data: {
17090 + currency: currency_selected,
17091 + per_page: cryptoDataSettingsValue.limit, //limit
17092 + order: cryptoDataSettingsValue.order,
17093 + ids: $settings.ids
17094 + },
17095 +
17096 + }).done(function (data) {
17097 + let itemData = $($cryptoWidget).find('.bdt-crypto-currency-chart-item');
17098 + /**
17099 + * @idPriceColumnArray is holding data from current items
17100 + */
17101 +
17102 + let idPriceColumnArray = [];
17103 + for (let i = 0; i < itemData.length; i++) {
17104 + idPriceColumnArray.push({
17105 + // id: itemData[i]["id"],
17106 + id: $(itemData[i]).data('id'),
17107 + current_price: parseFloat($(itemData[i]).find('.bdt-price-text').text()),
17108 + });
17109 + }
17110 +
17111 + // console.log(idPriceColumnArray);
17112 +
17113 + /**
17114 + * @crypDataParse holding data from crypto live data server
17115 + */
17116 + let cryptDataParse = JSON.parse(data);
17117 + /**
17118 + * changes array
17119 + */
17120 + let changesIdArray = [];
17121 + /**
17122 + * now have to compare this two array of object
17123 + */
17124 + for (let i = 0; i < idPriceColumnArray.length; i++) {
17125 + $.map(cryptDataParse, function (elem, index) {
17126 + if (elem.id === idPriceColumnArray[i].id) {
17127 + // console.log(elem.current_price);
17128 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
17129 + changesIdArray.push({
17130 + id: idPriceColumnArray[i].id,
17131 + current_price: elem.current_price,
17132 + old_price: idPriceColumnArray[i].current_price,
17133 + });
17134 + }
17135 + }
17136 + });
17137 + }
17138 +
17139 + // console.log(changesIdArray);
17140 +
17141 + if (changesIdArray.length !== 0) {
17142 + changesIdArray.forEach(element => {
17143 + $($cryptoWidget).find('[data-id="' + element.id + '"]').addClass('data-changed');
17144 + $($cryptoWidget).find('[data-id="' + element.id + '"]').find('.bdt-price-text').text(element.current_price);
17145 +
17146 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
17147 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
17148 + $($cryptoWidget).find('[data-id="' + element.id + '"] .price-int').text(amount);
17149 +
17150 + });
17151 + }
17152 +
17153 +
17154 + setTimeout(function () {
17155 + $($cryptoWidget).find('.bdt-crypto-currency-chart-item').removeClass('data-changed');
17156 + return getData();
17157 + }, 10000);
17158 + });
17159 + }
17160 +
17161 + /**
17162 + * number format
17163 + */
17164 + function numFormatter(num) {
17165 + if (num > 999 && num < 1000000) {
17166 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
17167 + } else if (num > 1000000000) {
17168 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
17169 + } else if (num > 1000000) {
17170 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
17171 + } else if (num < 900) {
17172 + return num; // if value < 1000, nothing to do
17173 + }
17174 + }
17175 + /**
17176 + * defalt onload call will be here
17177 + */
17178 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
17179 + currency_selected = cryptoDataSettingsValue.currency;
17180 + } else {
17181 + currency_selected = "usd"; // default currency settings here
17182 + }
17183 +
17184 + $.ajax({
17185 + type: "GET",
17186 + dataType: "json",
17187 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
17188 + data: {
17189 + currency: currency_selected,
17190 + per_page: cryptoDataSettingsValue.limit, //limit
17191 + order: cryptoDataSettingsValue.order,
17192 + ids: $settings.ids
17193 + },
17194 + success: function (result) {
17195 + $($cryptoWidget).empty();
17196 + var count = 0;
17197 + result.data.forEach(element => {
17198 + count++;
17199 + if (count > cryptoDataSettingsValue.limit) {
17200 + return;
17201 + }
17202 + // console.log(element.id);
17203 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
17204 + // let formatAmount = numFormatter(element.current_price);
17205 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
17206 +
17207 + let data = element.price_change_percentage_1h;
17208 + let OneHourData = (Number(data) === data && data % 1 !== 0) ? data.toFixed(2) + "%" : data + "%";
17209 +
17210 + var name_html = '';
17211 + var symble_html = '';
17212 + var price_html = '';
17213 + var price_change_percentage_1h_html = '';
17214 + if (true == $settings.showCurrencyShortName) {
17215 + symble_html = `<span>(${element.symbol})</span>`;
17216 + }
17217 + if (true == $settings.showCurrencyName) {
17218 + name_html = `<div class="bdt-crypto-currency-chart-title"><h4>${element.id} ${symble_html}</h4></div>`;
17219 + }
17220 + if (true == $settings.showCurrencyCurrentPrice) {
17221 + price_html = `<div class="bdt-crypto-currency-chart-price-l">
17222 + <span class="price-int">${amount}</span>
17223 + </div>`;
17224 + }
17225 + if (true == $settings.showPriceChangePercentage) {
17226 + price_change_percentage_1h_html = `<div class="bdt-crypto-currency-chart-change">
17227 + <span class="bdt-crypto-currency-chart-list-change up" title="1 Hour Data Change">${OneHourData}</span>
17228 + </div>`;
17229 + }
17230 +
17231 + var output = `<div class="bdt-crypto-currency-chart-item" data-id="${element.id}">
17232 + <div class="bdt-crypto-currency-chart-head-content">
17233 + <div class="bdt-crypto-currency-chart-head-inner-content">
17234 + ${name_html}
17235 + ${price_change_percentage_1h_html}
17236 +
17237 + </div>
17238 + <div class="bdt-crypto-currency-chart-bottom-inner-content">
17239 + ${price_html}
17240 + </div>
17241 + </div>
17242 + <div class="bdt-crypto-currency-chart-chart">
17243 + <input type="hidden" class="hdnInputCanvas-${element.id}" value="${element.last_seven_days_changes}"/><div class="chart-container" style="position: relative;"><canvas id="canvas-${element.id}"></canvas></div>
17244 + </div>
17245 + <span class="bdt-price-text bdt-hidden">${element.current_price}</span>
17246 + </div>`;
17247 +
17248 + $($cryptoWidget).append(output);
17249 +
17250 + let getCanvasElement = $($cryptoWidget).find('[data-id="' + element.id + '"]');
17251 + //let canvas_id = $(getCanvasElement).find("canvas").attr("id");
17252 + let getHiddenData = $(getCanvasElement).find("input").val();
17253 + let splitData = getHiddenData.split(",");
17254 + /***
17255 + * here we are just getting last 20 values value
17256 + */
17257 + if (splitData && splitData.length > 15) {
17258 + splitData = splitData.slice(0, 14);
17259 + }
17260 + /**
17261 + * end of splice code. this we can remove if any further code found
17262 + */
17263 + const dom_canvas_element = $(getCanvasElement).find("canvas");
17264 + const labels = [],
17265 + dataPointvalue = [];
17266 + splitData.forEach((element, index) => {
17267 + labels.push(index);
17268 + dataPointvalue.push(Number(element));
17269 + });
17270 +
17271 + const dataCharts = {
17272 + labels: labels,
17273 + datasets: [{
17274 + label: "",
17275 + // backgroundColor: $settings.backgroundColor || "#777",
17276 + // borderColor: $settings.borderColor || "#777",
17277 + backgroundColor: "rgba(30,135,240,0.2)",
17278 + borderColor: "#1e87f0",
17279 + fill: true,
17280 + lineTension: 0.4,
17281 + pointStyle: 'circle',
17282 + pointBackgroundColor: "#1e87f0",
17283 + pointBorderWidth: 1,
17284 + borderWidth: 2,
17285 + data: dataPointvalue,
17286 + }, ],
17287 + };
17288 + const config = {
17289 + type: "line",
17290 + data: dataCharts,
17291 + options: {
17292 + responsive: true,
17293 + plugins: {
17294 + legend: {
17295 + display: false,
17296 + },
17297 + tooltip: {
17298 + enabled: true
17299 + }
17300 + },
17301 + scales: {
17302 + x: {
17303 + ticks: {
17304 + display: false,
17305 + },
17306 + grid: {
17307 + display: false,
17308 + drawBorder: false,
17309 + drawOnChartArea: false,
17310 + drawTicks: false,
17311 + },
17312 + },
17313 + y: {
17314 + ticks: {
17315 + display: false,
17316 + },
17317 + grid: {
17318 + display: false,
17319 + drawBorder: false,
17320 + drawOnChartArea: false,
17321 + drawTicks: false,
17322 + },
17323 + },
17324 + },
17325 + },
17326 + };
17327 + const chart = new Chart(dom_canvas_element, config);
17328 + // chart.canvas.parentNode.style.width = "100%";
17329 + // chart.canvas.parentNode.style.height = "80px";
17330 +
17331 + });
17332 + }
17333 + });
17334 +
17335 + if (true !== editMode) {
17336 + setTimeout(function () {
17337 + getData();
17338 + }, 5000);
17339 + }
17340 + };
17341 +
17342 + jQuery(window).on('elementor/frontend/init', function () {
17343 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-chart.default', widgetCrypto);
17344 + });
17345 +
17346 + }(jQuery, window.elementorFrontend));
17347 +
17348 + /**
17349 + * End accordion widget script
17350 + */
17351 + (function ($, elementor) {
17352 +
17353 + 'use strict';
17354 +
17355 + var widgetCrypto = function ($scope, $) {
17356 +
17357 + var $carousel = $scope.find('.bdt-crypto-currency-chart-carousel'),
17358 + $cryptoWidget = $scope.find('.bdt-crypto-currency-chart-carousel'),
17359 + $settings = $cryptoWidget.data('crypto-settings'),
17360 + editMode = Boolean(elementorFrontend.isEditMode());
17361 +
17362 + if (!$carousel.length) {
17363 + return;
17364 + }
17365 +
17366 + var $options = {
17367 + 'currency': $settings.currency,
17368 + 'limit': 100,
17369 + 'order': 'market_cap_desc',
17370 + };
17371 +
17372 + if ($settings.currency) {
17373 + $options.currency = $settings.currency
17374 + }
17375 + if ($settings.limit) {
17376 + $options.limit = $settings.limit
17377 + }
17378 + if ($settings.order) {
17379 + $options.order = $settings.order
17380 + }
17381 +
17382 + let currency_selected, cryptoDataSettingsValue = $options;
17383 +
17384 + function getData() {
17385 + $.ajax({
17386 + type: "GET",
17387 + // dataType: "json",
17388 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
17389 + data: {
17390 + currency: currency_selected,
17391 + per_page: cryptoDataSettingsValue.limit, //limit
17392 + order: cryptoDataSettingsValue.order,
17393 + ids: $settings.ids
17394 + },
17395 +
17396 + }).done(function (data) {
17397 + let itemData = $($cryptoWidget).find('.bdt-crypto-currency-chart-carousel-item');
17398 + /**
17399 + * @idPriceColumnArray is holding data from current items
17400 + */
17401 +
17402 + let idPriceColumnArray = [];
17403 + for (let i = 0; i < itemData.length; i++) {
17404 + idPriceColumnArray.push({
17405 + // id: itemData[i]["id"],
17406 + id: $(itemData[i]).data('id'),
17407 + current_price: parseFloat($(itemData[i]).find('.bdt-price-text').text()),
17408 + });
17409 + }
17410 +
17411 + /**
17412 + * @crypDataParse holding data from crypto live data server
17413 + */
17414 + let cryptDataParse = JSON.parse(data);
17415 + /**
17416 + * changes array
17417 + */
17418 + let changesIdArray = [];
17419 + /**
17420 + * now have to compare this two array of object
17421 + */
17422 + for (let i = 0; i < idPriceColumnArray.length; i++) {
17423 + $.map(cryptDataParse, function (elem, index) {
17424 + if (elem.id === idPriceColumnArray[i].id) {
17425 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
17426 + changesIdArray.push({
17427 + id: idPriceColumnArray[i].id,
17428 + current_price: elem.current_price,
17429 + old_price: idPriceColumnArray[i].current_price,
17430 + });
17431 + }
17432 + }
17433 + });
17434 + }
17435 +
17436 + if (changesIdArray.length !== 0) {
17437 + changesIdArray.forEach(element => {
17438 + $($cryptoWidget).find('[data-id="' + element.id + '"]').addClass('data-changed');
17439 + $($cryptoWidget).find('[data-id="' + element.id + '"]').find('.bdt-price-text').text(element.current_price);
17440 +
17441 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
17442 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
17443 + $($cryptoWidget).find('[data-id="' + element.id + '"] .price-int').text(amount);
17444 +
17445 + });
17446 + }
17447 +
17448 +
17449 + setTimeout(function () {
17450 + $($cryptoWidget).find('.bdt-crypto-currency-chart-carousel-item').removeClass('data-changed');
17451 + return getData();
17452 + }, 10000);
17453 + });
17454 + }
17455 +
17456 + /**
17457 + * number format
17458 + */
17459 + function numFormatter(num) {
17460 + if (num > 999 && num < 1000000) {
17461 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
17462 + } else if (num > 1000000000) {
17463 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
17464 + } else if (num > 1000000) {
17465 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
17466 + } else if (num < 900) {
17467 + return num; // if value < 1000, nothing to do
17468 + }
17469 + }
17470 + /**
17471 + * defalt onload call will be here
17472 + */
17473 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
17474 + currency_selected = cryptoDataSettingsValue.currency;
17475 + } else {
17476 + currency_selected = "usd"; // default currency settings here
17477 + }
17478 +
17479 + $.ajax({
17480 + type: "GET",
17481 + dataType: "json",
17482 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
17483 + data: {
17484 + currency: currency_selected,
17485 + per_page: cryptoDataSettingsValue.limit, //limit
17486 + order: cryptoDataSettingsValue.order,
17487 + ids: $settings.ids
17488 + },
17489 + success: function (result) {
17490 + $($cryptoWidget).find('.swiper-wrapper').empty();
17491 + var count = 0;
17492 + result.data.forEach(element => {
17493 + count++;
17494 + if (count > cryptoDataSettingsValue.limit) {
17495 + return;
17496 + }
17497 +
17498 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
17499 + // let formatAmount = numFormatter(element.current_price);
17500 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
17501 +
17502 + let data = element.price_change_percentage_1h;
17503 + let OneHourData = (Number(data) === data && data % 1 !== 0) ? data.toFixed(2) + "%" : data + "%";
17504 +
17505 + var name_html = '';
17506 + var symble_html = '';
17507 + var price_html = '';
17508 + var price_change_percentage_1h_html = '';
17509 + if (true == $settings.showCurrencyShortName) {
17510 + symble_html = `<span>(${element.symbol})</span>`;
17511 + }
17512 + if (true == $settings.showCurrencyName) {
17513 + name_html = `<div class="bdt-crypto-currency-chart-carousel-title"><h4>${element.id} ${symble_html}</h4></div>`;
17514 + }
17515 + if (true == $settings.showCurrencyCurrentPrice) {
17516 + price_html = `<div class="bdt-crypto-currency-chart-carousel-price-l">
17517 + <span>${amount}</span>
17518 + </div>`;
17519 + }
17520 + if (true == $settings.showPriceChangePercentage) {
17521 + price_change_percentage_1h_html = `<div class="bdt-crypto-currency-chart-carousel-change">
17522 + <span class="bdt-crypto-currency-chart-carousel-list-change up" title="1 Hour Data Change">${OneHourData}</span>
17523 + </div>`;
17524 + }
17525 +
17526 + var output = `<div class="swiper-slide"><div class="bdt-crypto-currency-chart-carousel-item" data-id="${element.id}">
17527 + <div class="bdt-crypto-currency-chart-carousel-head-content">
17528 + <div class="bdt-crypto-currency-chart-carousel-head-inner-content">
17529 + ${name_html}
17530 + ${price_change_percentage_1h_html}
17531 +
17532 + </div>
17533 + <div class="bdt-crypto-currency-chart-carousel-bottom-inner-content">
17534 + ${price_html}
17535 + </div>
17536 + </div>
17537 + <div class="bdt-crypto-currency-chart-carousel-chart">
17538 + <input type="hidden" class="hdnInputCanvas-${element.id}" value="${element.last_seven_days_changes}"/><div class="chart-container" style="position: relative;"><canvas id="canvas-${element.id}"></canvas></div>
17539 + </div>
17540 + <span class="bdt-price-text bdt-hidden">${element.current_price}</span>
17541 + </div></div>`;
17542 +
17543 + $($cryptoWidget).find('.swiper-wrapper').append(output);
17544 +
17545 + var $carouselContainer = $carousel.find('.swiper-carousel'),
17546 + $carouselSettings = $carousel.data('settings');
17547 +
17548 + const Swiper = elementorFrontend.utils.swiper;
17549 + initSwiper();
17550 + async function initSwiper() {
17551 + var swiper = await new Swiper($carouselContainer, $carouselSettings);
17552 +
17553 + if ($carouselSettings.pauseOnHover) {
17554 + $($carouselContainer).hover(function () {
17555 + (this).swiper.autoplay.stop();
17556 + }, function () {
17557 + (this).swiper.autoplay.start();
17558 + });
17559 + }
17560 +
17561 + };
17562 +
17563 +
17564 +
17565 + let getCanvasElement = $($cryptoWidget).find('[data-id="' + element.id + '"]');
17566 + //let canvas_id = $(getCanvasElement).find("canvas").attr("id");
17567 + let getHiddenData = $(getCanvasElement).find("input").val();
17568 + let splitData = getHiddenData.split(",");
17569 + /***
17570 + * here we are just getting last 20 values value
17571 + */
17572 + if (splitData && splitData.length > 15) {
17573 + splitData = splitData.slice(0, 14);
17574 + }
17575 + /**
17576 + * end of splice code. this we can remove if any further code found
17577 + */
17578 + const dom_canvas_element = $(getCanvasElement).find("canvas");
17579 + const labels = [],
17580 + dataPointvalue = [];
17581 + splitData.forEach((element, index) => {
17582 + labels.push(index);
17583 + dataPointvalue.push(Number(element));
17584 + });
17585 + const dataCharts = {
17586 + labels: labels,
17587 + datasets: [{
17588 + label: "",
17589 + // backgroundColor: $settings.backgroundColor || "#777",
17590 + // borderColor: $settings.borderColor || "#777",
17591 + backgroundColor: "rgba(30,135,240,0.2)",
17592 + borderColor: "#1e87f0",
17593 + fill: true,
17594 + lineTension: 0.4,
17595 + pointStyle: 'circle',
17596 + pointBackgroundColor: "#1e87f0",
17597 + pointBorderWidth: 1,
17598 + borderWidth: 2,
17599 + data: dataPointvalue,
17600 + }, ],
17601 + };
17602 + const config = {
17603 + type: "line",
17604 + data: dataCharts,
17605 + options: {
17606 + responsive: true,
17607 + plugins: {
17608 + legend: {
17609 + display: false,
17610 + },
17611 + tooltip: {
17612 + enabled: true
17613 + }
17614 + },
17615 + scales: {
17616 + x: {
17617 + ticks: {
17618 + display: false,
17619 + },
17620 + grid: {
17621 + display: false,
17622 + drawBorder: false,
17623 + drawOnChartArea: false,
17624 + drawTicks: false,
17625 + },
17626 + },
17627 + y: {
17628 + ticks: {
17629 + display: false,
17630 + },
17631 + grid: {
17632 + display: false,
17633 + drawBorder: false,
17634 + drawOnChartArea: false,
17635 + drawTicks: false,
17636 + },
17637 + },
17638 + },
17639 + },
17640 + };
17641 + const chart = new Chart(dom_canvas_element, config);
17642 + // chart.canvas.parentNode.style.width = "100%";
17643 + // chart.canvas.parentNode.style.height = "80px";
17644 +
17645 +
17646 +
17647 + });
17648 + }
17649 + });
17650 +
17651 + if (true !== editMode) {
17652 + setTimeout(function () {
17653 + getData();
17654 + }, 5000);
17655 + }
17656 +
17657 +
17658 + };
17659 +
17660 +
17661 + jQuery(window).on('elementor/frontend/init', function () {
17662 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-chart-carousel.default', widgetCrypto);
17663 + });
17664 +
17665 + }(jQuery, window.elementorFrontend));
17666 + /**
17667 + * Start accordion widget script
17668 + */
17669 +
17670 + ;
17671 + (function ($, elementor) {
17672 + 'use strict';
17673 + var widgetCrypto = function ($scope, $) {
17674 + var $cryptoWidget = $scope.find('.bdt-crypto-currency-ticker'),
17675 + $settings = $cryptoWidget.data('settings'),
17676 + $tickerSettings = $cryptoWidget.data('ticker-settings'),
17677 + editMode = Boolean(elementorFrontend.isEditMode());
17678 +
17679 + if (!$cryptoWidget.length) {
17680 + return;
17681 + }
17682 +
17683 + // Crypto Data
17684 + var $options = {
17685 + 'currency': $settings.currency,
17686 + 'limit': 100,
17687 + 'order': 'market_cap_desc',
17688 + };
17689 +
17690 + if ($settings.currency) {
17691 + $options.currency = $settings.currency
17692 + }
17693 + if ($settings.limit) {
17694 + $options.limit = $settings.limit
17695 + }
17696 + if ($settings.order) {
17697 + $options.order = $settings.order
17698 + }
17699 +
17700 + let currency_selected, cryptoDataSettingsValue = $options;
17701 +
17702 + function getData() {
17703 + $.ajax({
17704 + type: "GET",
17705 + // dataType: "json",
17706 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto_data',
17707 + data: {
17708 + currency: currency_selected,
17709 + per_page: cryptoDataSettingsValue.limit, //limit
17710 + order: cryptoDataSettingsValue.order,
17711 + ids: $settings.ids
17712 + },
17713 +
17714 + }).done(function (data) {
17715 + let itemData = $($cryptoWidget).find('.bdt-crypto-currency-ticker-item');
17716 + /**
17717 + * @idPriceColumnArray is holding data from current items
17718 + */
17719 +
17720 + let idPriceColumnArray = [];
17721 + for (let i = 0; i < itemData.length; i++) {
17722 + idPriceColumnArray.push({
17723 + // id: itemData[i]["id"],
17724 + id: $(itemData[i]).data('id'),
17725 + current_price: parseFloat($(itemData[i]).find('.bdt-price-text').text()),
17726 + });
17727 + }
17728 +
17729 + // console.log(idPriceColumnArray);
17730 +
17731 + /**
17732 + * @crypDataParse holding data from crypto live data server
17733 + */
17734 + let cryptDataParse = JSON.parse(data);
17735 + /**
17736 + * changes array
17737 + */
17738 + let changesIdArray = [];
17739 + /**
17740 + * now have to compare this two array of object
17741 + */
17742 + for (let i = 0; i < idPriceColumnArray.length; i++) {
17743 + $.map(cryptDataParse, function (elem, index) {
17744 + if (elem.id === idPriceColumnArray[i].id) {
17745 + // console.log(elem.current_price);
17746 + if (elem.current_price !== idPriceColumnArray[i].current_price) {
17747 + changesIdArray.push({
17748 + id: idPriceColumnArray[i].id,
17749 + current_price: elem.current_price,
17750 + old_price: idPriceColumnArray[i].current_price,
17751 + });
17752 + }
17753 + }
17754 + });
17755 + }
17756 +
17757 + // console.log(changesIdArray);
17758 +
17759 + if (changesIdArray.length !== 0) {
17760 + changesIdArray.forEach(element => {
17761 + $($cryptoWidget).find('[data-id="' + element.id + '"]').addClass('data-changed');
17762 + $($cryptoWidget).find('[data-id="' + element.id + '"]').find('.bdt-price-text').text(element.current_price);
17763 +
17764 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
17765 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
17766 + $($cryptoWidget).find('[data-id="' + element.id + '"] .price-int').text(amount);
17767 +
17768 + });
17769 + }
17770 +
17771 +
17772 + setTimeout(function () {
17773 + $($cryptoWidget).find('.bdt-crypto-currency-ticker-item').removeClass('data-changed');
17774 + return getData();
17775 + }, 10000);
17776 + });
17777 + }
17778 +
17779 + /**
17780 + * number format
17781 + */
17782 + function numFormatter(num) {
17783 + if (num > 999 && num < 1000000) {
17784 + return (num / 1000).toFixed(2) + 'K'; // convert to K for number from > 1000 < 1 million
17785 + } else if (num > 1000000000) {
17786 + return (num / 1000000000).toFixed(2) + 'B'; // convert to M for number from > 1 million
17787 + } else if (num > 1000000) {
17788 + return (num / 1000000).toFixed(2) + 'M'; // convert to M for number from > 1 million
17789 + } else if (num < 900) {
17790 + return num; // if value < 1000, nothing to do
17791 + }
17792 + }
17793 + /**
17794 + * defalt onload call will be here
17795 + */
17796 + if (cryptoDataSettingsValue !== undefined && cryptoDataSettingsValue.currency !== undefined) {
17797 + currency_selected = cryptoDataSettingsValue.currency;
17798 + } else {
17799 + currency_selected = "usd"; // default currency settings here
17800 + }
17801 +
17802 + $.ajax({
17803 + type: "GET",
17804 + dataType: "json",
17805 + url: ElementPackConfig.ajaxurl + '?action=ep_crypto',
17806 + data: {
17807 + currency: currency_selected,
17808 + per_page: cryptoDataSettingsValue.limit, //limit
17809 + order: cryptoDataSettingsValue.order,
17810 + ids: $settings.ids
17811 + },
17812 + success: function (result) {
17813 + $($cryptoWidget).find('ul').empty();
17814 + var count = 0;
17815 + result.data.forEach(element => {
17816 + count++;
17817 + if (count > cryptoDataSettingsValue.limit) {
17818 + return;
17819 + }
17820 + // console.log(element.id);
17821 + let upperCaseCurrncyCode = currency_selected.toString().toUpperCase();
17822 + // let formatAmount = numFormatter(element.current_price);
17823 + let amount = returnCurrencySymbol(upperCaseCurrncyCode) + element.current_price;
17824 +
17825 + let data = element.price_change_percentage_1h;
17826 + let OneHourData = (Number(data) === data && data % 1 !== 0) ? data.toFixed(2) + "%" : data + "%";
17827 +
17828 + var img_html = '';
17829 + var name_html = '';
17830 + var symble_html = '';
17831 + var price_html = '';
17832 + var price_change_percentage_1h_html = '';
17833 + if (true == $settings.showCurrencyImage) {
17834 + img_html = `<div class="bdt-crypto-currency-ticker-img">
17835 + <img src="${element.image}" alt="${element.id}">
17836 + </div>`;
17837 + }
17838 + if (true == $settings.showCurrencyShortName) {
17839 + symble_html = `<span>(${element.symbol})</span>`;
17840 + }
17841 + if (true == $settings.showCurrencyName) {
17842 + name_html = `<h3 class="bdt-crypto-currency-ticker-title">
17843 + ${element.id} ${symble_html}
17844 + </h3>`;
17845 + }
17846 + if (true == $settings.showCurrencyCurrentPrice) {
17847 + price_html = `<span class="bdt-crypto-currency-ticker-price">${amount}</span>`;
17848 + }
17849 + if (true == $settings.showPriceChangePercentage) {
17850 + price_change_percentage_1h_html = `<div class="bdt-crypto-currency-ticker-percentage">
17851 + <svg width="25" height="22" viewBox="0 0 20 20" fill="currentColor"
17852 + xmlns="http://www.w3.org/2000/svg">
17853 + <path fill-rule="evenodd"
17854 + d="M6.646 11.646a.5.5 0 01.708 0L10 14.293l2.646-2.647a.5.5 0 01.708.708l-3 3a.5.5 0 01-.708 0l-3-3a.5.5 0 010-.708z"
17855 + clip-rule="evenodd" />
17856 + <path fill-rule="evenodd"
17857 + d="M10 4.5a.5.5 0 01.5.5v9a.5.5 0 01-1 0V5a.5.5 0 01.5-.5z"
17858 + clip-rule="evenodd" />
17859 + </svg>
17860 + <span>${OneHourData}</span>
17861 + </div>`;
17862 + }
17863 +
17864 + var output = `<li class="bdt-crypto-currency-ticker-item" data-id="${element.id}">
17865 +
17866 + <div class="bdt-crypto-currency-ticker-inner-item">
17867 + ${img_html}
17868 + <div class="bdt-crypto-currency-ticker-content">
17869 + ${name_html}
17870 + ${price_html}
17871 + ${price_change_percentage_1h_html}
17872 + </div>
17873 + </div>
17874 +
17875 + <span class="bdt-price-text bdt-hidden">${element.current_price}</span>
17876 + </li>`;
17877 +
17878 + $($cryptoWidget).find('ul').append(output);
17879 +
17880 + });
17881 + }
17882 + });
17883 +
17884 + if (true !== editMode) {
17885 + setTimeout(function () {
17886 + getData();
17887 + }, 7000);
17888 + }
17889 +
17890 + $(document).ready(function () {
17891 + setTimeout(function () {
17892 + $($cryptoWidget).epNewsTicker($tickerSettings);
17893 + }, 7000);
17894 + });
17895 +
17896 + };
17897 +
17898 + jQuery(window).on('elementor/frontend/init', function () {
17899 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-crypto-currency-ticker.default', widgetCrypto);
17900 + });
17901 +
17902 + }(jQuery, window.elementorFrontend));
17903 +
17904 + /**
17905 + * End accordion widget script
17906 + */
17907 + ;
17908 + (function ($, elementor) {
17909 + $(window).on('elementor/frontend/init', function () {
17910 + var ModuleHandler = elementorModules.frontend.handlers.Base,
17911 + RealisticShadow;
17912 +
17913 + RealisticShadow = ModuleHandler.extend({
17914 +
17915 + bindEvents: function () {
17916 + this.run();
17917 + },
17918 +
17919 + getDefaultSettings: function () {
17920 + return {
17921 + allowHTML: true,
17922 + };
17923 + },
17924 +
17925 + onElementChange: debounce(function (prop) {
17926 + if (prop.indexOf('element_pack_ris_') !== -1) {
17927 + this.run();
17928 + }
17929 + }, 400),
17930 +
17931 + settings: function (key) {
17932 + return this.getElementSettings('element_pack_ris_' + key);
17933 + },
17934 +
17935 + run: function () {
17936 + var options = this.getDefaultSettings();
17937 + var widgetID = this.$element.data('id');
17938 + var widgetContainer = $('.elementor-element-' + widgetID);
17939 + var obj = this;
17940 +
17941 + if ('yes' !== this.settings('enable')) {
17942 + return;
17943 + }
17944 +
17945 + if (this.settings('selector')) {
17946 + widgetContainer = $('.elementor-element-' + widgetID).find(this.settings('selector'));
17947 + }
17948 +
17949 + var $image = widgetContainer.find('img');
17950 +
17951 + $image.each(function () {
17952 + var $this = $(this);
17953 + if (!$this.hasClass('element-pack-ris-image')) {
17954 + var $duplicateImage = $this.clone();
17955 + $duplicateImage.addClass('element-pack-ris-image');
17956 +
17957 + var $existingImages = $($this).parent().find('.element-pack-ris-image');
17958 + if ($existingImages.length > 1) {
17959 + $existingImages.not(':first').remove();
17960 + }
17961 +
17962 + if ($existingImages.length < 1) {
17963 + $($this).parent().append($duplicateImage);
17964 + }
17965 +
17966 + widgetContainer.addClass('bdt-realistic-image-shadow');
17967 +
17968 + if (obj.settings('on_hover') === 'yes') {
17969 + widgetContainer.addClass('bdt-hover');
17970 + }
17971 + }
17972 + });
17973 +
17974 + }
17975 + });
17976 +
17977 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
17978 + elementorFrontend.elementsHandler.addHandler(RealisticShadow, {
17979 + $element: $scope
17980 + });
17981 + });
17982 + });
17983 + })(jQuery, window.elementorFrontend);
17984 +
17985 + ;
17986 + (function ($, elementor) {
17987 + $(window).on('elementor/frontend/init', function () {
17988 + var ModuleHandler = elementorModules.frontend.handlers.Base,
17989 + TextGradientBackground;
17990 +
17991 + TextGradientBackground = ModuleHandler.extend({
17992 +
17993 + bindEvents: function () {
17994 + this.run();
17995 + },
17996 +
17997 + getDefaultSettings: function () {
17998 + return {
17999 + allowHTML: true,
18000 + };
18001 + },
18002 +
18003 + onElementChange: debounce(function (prop) {
18004 + if (prop.indexOf('element_pack_tgb_') !== -1) {
18005 + this.run();
18006 + }
18007 + }, 400),
18008 +
18009 + settings: function (key) {
18010 + return this.getElementSettings('element_pack_tgb_' + key);
18011 + },
18012 +
18013 + run: function () {
18014 + var widgetID = this.$element.data('id');
18015 + var widgetContainer = $('.elementor-element-' + widgetID);
18016 +
18017 + if ('yes' !== this.settings('enable')) {
18018 + return;
18019 + }
18020 +
18021 + if (this.settings('selector')) {
18022 + widgetContainer = $('.elementor-element-' + widgetID).find(this.settings('selector'));
18023 +
18024 + // Apply gradient background and text clipping styles to the selected elements
18025 + widgetContainer.each(function () {
18026 + var $this = $(this);
18027 + if (!$this.hasClass('element-pack-tgb-background')) {
18028 + $this.addClass('element-pack-tgb-background');
18029 + }
18030 + $this.css({
18031 + 'background-clip': 'text',
18032 + '-webkit-background-clip': 'text',
18033 + 'color': 'transparent',
18034 + '-webkit-text-fill-color': 'transparent',
18035 + 'text-fill-color': 'transparent'
18036 + });
18037 + });
18038 + }
18039 +
18040 +
18041 + }
18042 + });
18043 +
18044 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
18045 + elementorFrontend.elementsHandler.addHandler(TextGradientBackground, {
18046 + $element: $scope
18047 + });
18048 + });
18049 + });
18050 + })(jQuery, window.elementorFrontend);
18051 +
18052 + /**
18053 + * Start Content Switcher widget script
18054 + */
18055 +
18056 + (function ($, elementor) {
18057 +
18058 + 'use strict';
18059 +
18060 + var widgetFloatingKnowledgebase = function ($scope, $) {
18061 +
18062 + var $floatingKnowledgebase = $scope.find('.bdt-floating-knowledgebase'),
18063 + $btnIcon = $floatingKnowledgebase.find('.bdt-icon-wrapper'),
18064 + $settings = $floatingKnowledgebase.data('settings');
18065 +
18066 + if (!$floatingKnowledgebase.length) {
18067 + return;
18068 + }
18069 +
18070 + ;(function ($) {
18071 + "use strict";
18072 + /*
18073 + *--------------------------------------------------------------------------
18074 + * CONFIG OR SETTINGS - Customize the help center
18075 + *--------------------------------------------------------------------------
18076 + */
18077 + var helpCenterConfig = {
18078 + // primaryColor: "#007bff", // Floating button color
18079 + linkColor: "#007bff", // Color of anchor tags or links
18080 + showHelperText: true, // Helper text beside floating button(true|false)
18081 + helperTextLabel: $settings.helperTextLabel || "Have any queries?<br /><strong>Check Help Center</strong>", // Helper text label
18082 + showContactUsLink: true, // Hide or show contact us link(true|false)
18083 + contactUsLabel: $settings.supportLinkText || "Still no luck? We can help!", // Text of contact us link
18084 + contactUsLink: $settings.supportLink || "/contact-us", // Contact us link
18085 + noResultsLabel: $settings.noSearchResultText || "Sorry, we don’t have any results. Updates are being added all the time.", // No results found text
18086 + resetOnPopupClose: false, // Reset popup back to original state on close(true|false)
18087 + btnZindex: 999, // Z-index property of floating button
18088 + popupZindex: 998, // Z-index property of popup
18089 + onPopupOpen: function () {}, // Callback function which runs on popup open
18090 + onPopupClose: function () {} // Callback function which runs on popup close
18091 + }
18092 +
18093 + var nodesStack = []; // Array to hande "nodes/html-content" back-forth pagination
18094 + var titleStack = []; // Array to hande "title" back-forth pagination
18095 + var jsonData; // JSON data
18096 +
18097 + /**
18098 + * Get the JSON Data and Initialize plugin
18099 + */
18100 +
18101 +
18102 + $.fn.floatingHelpCenter = function () {
18103 + jsonData = $settings.data_source;
18104 + renderHelpCenterBtn(helpCenterConfig); // render popup button
18105 + renderPopup(jsonData); // render popup with JSON data
18106 + }
18107 + /**
18108 + * Renders the help center button using config
18109 + * @param {Object} config - Contains config/preferences
18110 + */
18111 + function renderHelpCenterBtn(config) {
18112 + var $btnWrap = $("<div>", {
18113 + class: "floating-help-center__btn"
18114 + }).css('zIndex', helpCenterConfig.btnZindex);
18115 + $btnWrap.click(togglePopup);
18116 + var $helperText = $("<p>", {
18117 + class: "helper-txt"
18118 + }).html(helpCenterConfig.helperTextLabel);
18119 + var $btn = $("<button>", {
18120 + class: "btn"
18121 + });
18122 + $("#bdt-floating-help-center").append($btnWrap.append(function () {
18123 + if (helpCenterConfig.showHelperText) {
18124 + return $helperText;
18125 + }
18126 + }, $btn));
18127 +
18128 + $btn.append($btnIcon.removeClass('bdt-hidden'));
18129 + }
18130 +
18131 + /**
18132 + * Shows or hide the popup on button click
18133 + */
18134 + function togglePopup() {
18135 + var $popup = $("#bdt-floating-help-center .floating-help-center__popup");
18136 + var $popBtn = $("#bdt-floating-help-center .floating-help-center__btn");
18137 + var popupActiveClass = "floating-help-center__popup--active";
18138 + if ($popup.hasClass(popupActiveClass)) {
18139 + $popup.removeClass(popupActiveClass);
18140 + $popBtn.removeClass(popupActiveClass);
18141 + helpCenterConfig.onPopupClose.call(this);
18142 + } else {
18143 + if (helpCenterConfig.resetOnPopupClose) {
18144 + resetPopupContent();
18145 + }
18146 + $popup.addClass(popupActiveClass);
18147 + $popBtn.addClass(popupActiveClass);
18148 + helpCenterConfig.onPopupOpen.call(this);
18149 + }
18150 + }
18151 +
18152 + /**
18153 + * Renders the popup with populated data
18154 + * @param {Object} data - contains json data
18155 + */
18156 + function renderPopup(data) {
18157 + var $outerWrap = $("<div>", {
18158 + id: "floatingHelpCenterPopup",
18159 + class: "floating-help-center__popup"
18160 + }).css('zIndex', helpCenterConfig.popupZindex);
18161 +
18162 + var $searchOuter = $("<div>", {
18163 + class: "searchbox"
18164 + });
18165 + var $searchIcon = $("<div>", {
18166 + class: "searchbox__search-icon"
18167 + }).html(searchSVG);
18168 + var $input = $("<input>", {
18169 + class: "searchbox__input",
18170 + type: "text",
18171 + placeholder: "Search..."
18172 + });
18173 + var $crossIcon = $("<div>", {
18174 + class: "searchbox__cross-icon"
18175 + }).html(crossSVG).css({
18176 + display: "none"
18177 + });
18178 + var $resizerIcon = $("<div>", {
18179 + class: "bdt-resizer-icon"
18180 + }).html(resizerSVG);
18181 +
18182 + $crossIcon.click(resetPopupContent);
18183 + $resizerIcon.click(() => {
18184 + $outerWrap.toggleClass('bdt-content-expand');
18185 + });
18186 + $input.on("input", searchInputHandler);
18187 + $searchOuter.append($searchIcon, $input, $crossIcon, $resizerIcon);
18188 + var $helpList = $("<ul>", {
18189 + id: "listItemsContainer",
18190 + class: "help-list"
18191 + });
18192 + var $externalLinkWrap = $("<div>", {
18193 + id: "externalLinkWrap",
18194 + class: "external"
18195 + });
18196 + var $externalLink = $("<a>", {
18197 + id: "externalLinkWrap",
18198 + class: "external__link",
18199 + target: "_blank",
18200 + href: helpCenterConfig.contactUsLink
18201 + }).text(helpCenterConfig.contactUsLabel);
18202 + var $externalArrow = $("<span>", {
18203 + class: "external__arrow"
18204 + }).html(externalArrowSVG);
18205 + $externalLinkWrap.append($externalLink.append($externalArrow));
18206 +
18207 + var $headerWrap = $("<div>", {
18208 + id: "headerWrap",
18209 + class: "bdt-header"
18210 + });
18211 +
18212 + if ($settings.logo.url) {
18213 + if ($settings.title) {
18214 + $settings.logo.alt = $settings.title;
18215 + }
18216 +
18217 + $headerWrap.append('<div class="bdt-header-logo"><img src="' + $settings.logo.url + '" alt="' + $settings.logo.alt + '"></div>');
18218 + }
18219 +
18220 + if ($settings.title) {
18221 + $headerWrap.append('<div class="bdt-header-title">' + $settings.title + '</div>');
18222 + }
18223 +
18224 + if ($settings.description) {
18225 + $headerWrap.append('<div class="bdt-header-description">' + $settings.description + '</div>');
18226 + }
18227 +
18228 + $("#bdt-floating-help-center").append($outerWrap.append(function () {
18229 + if (helpCenterConfig.showContactUsLink) {
18230 + return [$headerWrap, $searchOuter, $helpList, $externalLinkWrap];
18231 + }
18232 + return [$headerWrap, $searchOuter, $helpList];
18233 + }));
18234 + setPopupContent(data);
18235 + }
18236 +
18237 + /**
18238 + * Search input listener and sends input query to
18239 + * findObject() function
18240 + */
18241 + function searchInputHandler() {
18242 + var $crossIcon = $("#bdt-floating-help-center .searchbox__cross-icon");
18243 + var query = $(this).val();
18244 + if (query && query !== "") {
18245 + $crossIcon.css({
18246 + display: "block"
18247 + });
18248 + var resultsArr = findObject(jsonData, "title", query, true);
18249 + setPopupContent(resultsArr, "search");
18250 + } else {
18251 + $crossIcon.css({
18252 + display: "none"
18253 + });
18254 + resetPopupContent();
18255 + }
18256 + }
18257 +
18258 + /**
18259 + * Enables or Disables Search Input
18260 + */
18261 + function searchInputReadonlyToggle() {
18262 + var $searchInput = $("#bdt-floating-help-center .searchbox__input");
18263 + $searchInput.attr('readonly', nodesStack.length > 1);
18264 + }
18265 +
18266 + /**
18267 + * Displays the list of questions/title
18268 + * @param {Array} data - Data array
18269 + */
18270 + function renderPopupContentList(data) {
18271 + $.each(data, function (index, listObj) {
18272 + var $listWrap = $("<li>", {
18273 + class: "help-list__item"
18274 + });
18275 + $listWrap.click(function () {
18276 + listItemClickHandler(this);
18277 + });
18278 + var $listArrow = $("<span>", {
18279 + class: "help-list__item-arrow"
18280 + }).html(listArrowSVG);
18281 + var $listText = $("<span>", {
18282 + class: "help-list__item-txt"
18283 + }).html(listObj["title"]);
18284 + $("#bdt-floating-help-center #listItemsContainer").append($listWrap.append($listText, $listArrow));
18285 + });
18286 + }
18287 +
18288 + /**
18289 + * Hides or shows the back button on search input
18290 + */
18291 + function toggleBackButton() {
18292 + $("#bdt-floating-help-center .searchbox__search-icon").unbind();
18293 + nodesStack.length > 1 ?
18294 + $(".searchbox__search-icon").html(backSVG).click(backBtnHandler) :
18295 + $("#bdt-floating-help-center .searchbox__search-icon").html(searchSVG);
18296 +
18297 + if (nodesStack.length > 1) {
18298 + $('#floatingHelpCenterPopup').addClass('bdt-content-expand');
18299 + } else {
18300 + $('#floatingHelpCenterPopup').removeClass('bdt-content-expand');
18301 + }
18302 + }
18303 +
18304 + /**
18305 + * Resets the previous html content before
18306 + * populating with new content
18307 + */
18308 + function resetPreviousState() {
18309 + $("#bdt-floating-help-center #htmlContent, #bdt-floating-help-center #noResultTxt").remove();
18310 + $("#bdt-floating-help-center #listItemsContainer").html("");
18311 + $('#floatingHelpCenterPopup').removeClass('bdt-content-open');
18312 + }
18313 +
18314 + /**
18315 + * Performs set of operations on back button click
18316 + */
18317 + function backBtnHandler() {
18318 + nodesStack.pop();
18319 + titleStack.pop();
18320 + var lastNode = nodesStack.pop();
18321 + var lastTitle = titleStack.pop();
18322 + setInputTitle(lastTitle);
18323 + setPopupContent(lastNode);
18324 + searchInputReadonlyToggle();
18325 + }
18326 +
18327 + /**
18328 + * Checks the data type and calls the rendering functions accordingly
18329 + * @param {Object|Array|String} data - Data to be rendered
18330 + * @param {string} event - Event type(search)
18331 + */
18332 + function setPopupContent(data, event) {
18333 + if (data.length === 0) {
18334 + renderNoResults();
18335 + return;
18336 + }
18337 + if (data.length > 1) {
18338 + beforeSetPopupContent(data, event);
18339 + renderPopupContentList(data);
18340 + return;
18341 + }
18342 + if (event === "search") {
18343 + beforeSetPopupContent(data, event);
18344 + renderPopupContentList(data);
18345 + return;
18346 + }
18347 + var destructuredObj = data.pop();
18348 + if (typeof destructuredObj === "string") {
18349 + beforeSetPopupContent([destructuredObj], event);
18350 + renderHTML("", destructuredObj);
18351 + return;
18352 + }
18353 + if (destructuredObj.hasOwnProperty("nodes")) {
18354 + beforeSetPopupContent(destructuredObj["nodes"], event);
18355 + renderPopupContentList(destructuredObj["nodes"]);
18356 + return;
18357 + }
18358 + beforeSetPopupContent([destructuredObj["html"]], event);
18359 + renderHTML(destructuredObj["title"], destructuredObj["html"]);
18360 + }
18361 +
18362 + /**
18363 + * Performs set of operation before popup content is set
18364 + * @param {Object|Array|string} data - Data to be rendered
18365 + * @param {string} event - Type of event
18366 + */
18367 + function beforeSetPopupContent(data, event) {
18368 + if (event === undefined || event !== "search") {
18369 + nodesStack.push(data);
18370 + }
18371 + toggleBackButton();
18372 + resetPreviousState();
18373 + }
18374 +
18375 + /**
18376 + * Links other objects title in anchor tags
18377 + * in attribute "data-title"
18378 + */
18379 + function anchorDataTitleHandler() {
18380 + $("#bdt-floating-help-center #htmlContent a").click(function () {
18381 + var dataTitle = $(this).attr("data-title");
18382 + if (dataTitle && dataTitle !== "") {
18383 + var resultsArr = findObject(jsonData, "title", dataTitle);
18384 + setInputTitle(dataTitle);
18385 + setPopupContent(resultsArr);
18386 + return false;
18387 + }
18388 + });
18389 + }
18390 +
18391 + /**
18392 + * Resets the popup content to initial state
18393 + */
18394 + function resetPopupContent() {
18395 + nodesStack = [];
18396 + titleStack = [];
18397 + setInputTitle("");
18398 + $("#bdt-floating-help-center .searchbox__cross-icon").css({
18399 + display: "none"
18400 + });
18401 + setPopupContent(jsonData);
18402 + $("#bdt-floating-help-center #htmlContent, #bdt-floating-help-center #noResultTxt").remove();
18403 + }
18404 +
18405 + /**
18406 + * Set's title in searchbar
18407 + * @param {string} title - Title
18408 + */
18409 + function setInputTitle(title) {
18410 + if (title && title !== "") {
18411 + // $("#bdt-floating-help-center .searchbox__input").val(title);
18412 + $("#bdt-floating-help-center .searchbox__input").val(" ");
18413 + titleStack.push(title);
18414 + } else {
18415 + $("#bdt-floating-help-center .searchbox__input").val("");
18416 + }
18417 + }
18418 +
18419 + /**
18420 + * Click handler for lists
18421 + * @param {HTMLElement} listElement - list element
18422 + */
18423 + function listItemClickHandler(listElement) {
18424 + var listTitle = $(listElement).find(".help-list__item-txt").text();
18425 + var matchedObj = findObject(jsonData, "title", listTitle);
18426 + setInputTitle(listTitle);
18427 + setPopupContent(matchedObj);
18428 + searchInputReadonlyToggle();
18429 + }
18430 +
18431 + /**
18432 + * Displays HTML help article
18433 + * @param {string} title - Title of article
18434 + * @param {string} htmlContent - Content of article
18435 + */
18436 + function renderHTML(title, htmlContent) {
18437 + $(".searchbox__cross-icon").css({
18438 + display: "none"
18439 + });
18440 + var $htmlContentElement = $("<div>", {
18441 + id: "htmlContent",
18442 + class: "html-content"
18443 + }).html(htmlContent);
18444 + var articleTitle = title || $("#bdt-floating-help-center .searchbox__input").val();
18445 + $htmlContentElement.prepend($("<h5>", {
18446 + id: "contentTitle",
18447 + class: "html-content__title"
18448 + }).html(articleTitle));
18449 + $htmlContentElement.find("a").not('.callout-block a').css({
18450 + "color": helpCenterConfig.linkColor
18451 + });
18452 + $htmlContentElement.insertBefore("#bdt-floating-help-center #listItemsContainer");
18453 + $('#floatingHelpCenterPopup').addClass('bdt-content-open');
18454 +
18455 + anchorDataTitleHandler();
18456 + }
18457 +
18458 + /**
18459 + * Shows no results message
18460 + */
18461 + function renderNoResults() {
18462 + resetPreviousState();
18463 + var $noResultsLabel = $("<p>", {
18464 + id: "noResultTxt",
18465 + class: "no-result"
18466 + }).html(helpCenterConfig.noResultsLabel);
18467 + if ($("#noResultTxt").length === 0) {
18468 + $noResultsLabel.insertAfter("#bdt-floating-help-center .searchbox");
18469 + }
18470 + }
18471 +
18472 + /**
18473 + * @param {Object} obj - Object where search has to be performed
18474 + * @param {string} key - Attribute Key
18475 + * @param {string} value - Value
18476 + * @param {boolean} performSearch - Search perform or finding value by key
18477 + * @returns {Object} obj - Result filtered object
18478 + */
18479 + function findObject(obj, key, value, performSearch) {
18480 + value = performSearch === true ? value.toUpperCase() : value;
18481 + var results = [];
18482 +
18483 + function recursiveSearch(obj) {
18484 + if (!obj || _typeof(obj) !== "object") {
18485 + return;
18486 + }
18487 + if (performSearch) {
18488 + if (obj[key] && obj[key].toUpperCase().indexOf(value) > -1) {
18489 + results.push(obj);
18490 + }
18491 + } else {
18492 + if (obj[key] === value) {
18493 + results.push(obj);
18494 + }
18495 + }
18496 + Object.keys(obj).forEach(function (k) {
18497 + recursiveSearch(obj[k]);
18498 + });
18499 + }
18500 + recursiveSearch(obj);
18501 + return results;
18502 + }
18503 +
18504 +
18505 + /**
18506 + * Helper function for old browsers
18507 + */
18508 + function _typeof(obj) {
18509 + "@babel/helpers - typeof";
18510 + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
18511 + _typeof = function _typeof(obj) {
18512 + return typeof obj;
18513 + };
18514 + } else {
18515 + _typeof = function _typeof(obj) {
18516 + return obj &&
18517 + typeof Symbol === "function" &&
18518 + obj.constructor === Symbol &&
18519 + obj !== Symbol.prototype ? "symbol" : typeof obj;
18520 + };
18521 + }
18522 + return _typeof(obj);
18523 + }
18524 +
18525 + /**
18526 + * floating help center window object
18527 + * and public functions
18528 + */
18529 + return window.floatingHelpCenter = {
18530 + init: function () {
18531 + $.fn.floatingHelpCenter();
18532 + },
18533 + toggle: function () {
18534 + togglePopup();
18535 + },
18536 + isOpen: function () {
18537 + return $("#bdt-floating-help-centerPopup").hasClass("floating-help-center__popup--active");
18538 + }
18539 + };
18540 +
18541 + })(jQuery);
18542 + // Search icon svg
18543 + var searchSVG = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.2 16.34a7.5 7.5 0 1 1 1.38-1.45l4.2 4.2a1 1 0 1 1-1.42 1.41l-4.16-4.16zm-4.7.16a6 6 0 1 0 0-12 6 6 0 0 0 0 12z"></path></svg>';
18544 +
18545 + // Cross icon svg
18546 + var crossSVG = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M13.06 12.15l5.02-5.03a.75.75 0 1 0-1.06-1.06L12 11.1 6.62 5.7a.75.75 0 1 0-1.06 1.06l5.38 5.38-5.23 5.23a.75.75 0 1 0 1.06 1.06L12 13.2l4.88 4.87a.75.75 0 1 0 1.06-1.06l-4.88-4.87z"></path></svg>';
18547 +
18548 + // Resizer icon svg
18549 + var resizerSVG = '<svg class="bdt-expand" xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="currentColor"><path d="M2.675 21.325v-8.65h2.65v4.15l11.5-11.5h-4.15v-2.65h8.65v8.65h-2.65v-4.15l-11.5 11.5h4.15v2.65Z"></path></svg>';
18550 +
18551 + resizerSVG += '<svg class="bdt-close" xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="currentColor"><path d="m3.075 22.775-1.85-1.85L7.5 14.65H3.35V12H12v8.65H9.35V16.5ZM12 12V3.35h2.65V7.5l6.275-6.275 1.85 1.85L16.5 9.35h4.15V12Z"></path></svg>';
18552 +
18553 + // back icon svg
18554 + var backSVG = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.45 17.97L9.5 12.01a.25.25 0 0 1 0-.36l5.87-5.87a.75.75 0 0 0-1.06-1.06l-5.87 5.87c-.69.68-.69 1.8 0 2.48l5.96 5.96a.75.75 0 0 0 1.06-1.06z"></path></svg>';
18555 +
18556 + // list arrow svg
18557 + var listArrowSVG = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M6.47 4.29l3.54 3.53c.1.1.1.26 0 .36L6.47 11.7a.75.75 0 1 0 1.06 1.06l3.54-3.53c.68-.69.68-1.8 0-2.48L7.53 3.23a.75.75 0 0 0-1.06 1.06z"></path></svg>';
18558 +
18559 + var externalArrowSVG = '<svg fill="#3a3f3f" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M11.268 5.824L5.232 11.86a.75.75 0 1 1-1.06-1.06L10.22 4.75H5.75a.75.75 0 0 1 0-1.5h6.268a.75.75 0 0 1 .75.75v6.243a.75.75 0 0 1-1.5 0v-4.42z" fill="currentColor"></path></svg>';
18560 +
18561 + floatingHelpCenter.init();
18562 +
18563 + }
18564 +
18565 +
18566 + jQuery(window).on('elementor/frontend/init', function () {
18567 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-floating-knowledgebase.default', widgetFloatingKnowledgebase);
18568 + });
18569 +
18570 +
18571 + }(jQuery, window.elementorFrontend));
18572 +
18573 + /**
18574 + * End Content Switcher widget script
18575 + */
18576 + /**
18577 + * Start twitter carousel widget script
18578 + */
18579 +
18580 + (function ($, elementor) {
18581 +
18582 + 'use strict';
18583 +
18584 + var widgetFbFeedCarousel = function ($scope, $) {
18585 +
18586 + var $fbCarousel = $scope.find('.bdt-facebook-feed-carousel');
18587 +
18588 + if (!$fbCarousel.length) {
18589 + return;
18590 + }
18591 +
18592 + var $fbCarouselContainer = $fbCarousel.find('.swiper-carousel'),
18593 + $settings = $fbCarousel.data('settings');
18594 +
18595 + const Swiper = elementorFrontend.utils.swiper;
18596 + initSwiper();
18597 + async function initSwiper() {
18598 + var swiper = await new Swiper($fbCarouselContainer, $settings); // this is an example
18599 + if ($settings.pauseOnHover) {
18600 + $($fbCarouselContainer).hover(function () {
18601 + (this).swiper.autoplay.stop();
18602 + }, function () {
18603 + (this).swiper.autoplay.start();
18604 + });
18605 + }
18606 + };
18607 + };
18608 +
18609 +
18610 + jQuery(window).on('elementor/frontend/init', function () {
18611 + elementorFrontend.hooks.addAction('frontend/element_ready/bdt-facebook-feed-carousel.default', widgetFbFeedCarousel);
18612 + });
18613 +
18614 + }(jQuery, window.elementorFrontend));
18615 +
18616 + /**
18617 + * End twitter carousel widget script
18618 + */
18619 +
18620 +
18621 + ;(function ($, elementor) {
18622 + $(window).on('elementor/frontend/init', function () {
18623 + var ModuleHandler = elementorModules.frontend.handlers.Base;
18624 +
18625 + var BackgroundImageParallaxHandler = ModuleHandler.extend({
18626 +
18627 + bindEvents: function () {
18628 + this.run();
18629 + },
18630 +
18631 + getDefaultSettings: function () {
18632 + return {
18633 + orientation: 'left', // Default orientation
18634 + };
18635 + },
18636 +
18637 + onElementChange: debounce(function (prop) {
18638 + if (prop.indexOf('ep_background_image_parallax_') !== -1) {
18639 + this.run();
18640 + }
18641 + }, 400),
18642 +
18643 + settings: function (key) {
18644 + return this.getElementSettings('ep_background_image_parallax_' + key);
18645 + },
18646 +
18647 + run: function () {
18648 + var options = this.getDefaultSettings();
18649 + var widgetID = this.$element.data('id');
18650 +
18651 + var images = document.querySelectorAll('.elementor-element-' + widgetID + '.bdt-background-image-parallax-yes img');
18652 +
18653 + // Update options if settings exist
18654 + if (this.settings('orientation')) {
18655 + options.orientation = this.settings('orientation');
18656 + }
18657 + //scale
18658 + if (this.settings('scale.size')) {
18659 + options.scale = this.settings('scale.size');
18660 + }
18661 + if (this.settings('delay.size')) {
18662 + options.delay = this.settings('delay.size');
18663 + }
18664 + //transition
18665 + // if (this.settings('transition')) {
18666 + // options.transition = this.settings('transition') || 'cubic-bezier(0,0,0,1)';
18667 + // }
18668 + //max_transition
18669 + // if (this.settings('max_transition')) {
18670 + // options.maxTransition = this.settings('max_transition') || 0;
18671 + // }
18672 +
18673 + //overflow
18674 + if (this.settings('overflow') === 'yes') {
18675 + options.overflow = true;
18676 + } else {
18677 + options.overflow = false;
18678 + }
18679 +
18680 + // Apply SimpleParallax to images
18681 + if (images.length) {
18682 + new SimpleParallax(images, options);
18683 + }
18684 + },
18685 + });
18686 +
18687 + // Add the handler to Elementor widgets
18688 + elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
18689 + elementorFrontend.elementsHandler.addHandler(BackgroundImageParallaxHandler, {
18690 + $element: $scope,
18691 + });
18692 + });
18693 + });
18694 + })(jQuery, window.elementorFrontend);
18695 +
18696 +
18697 + /**
18698 + * Shape Builder with GSAP Animation Integration
18699 + *
18700 + * This module handles the Shape Builder feature with advanced GSAP animations.
18701 + *
18702 + * Features:
18703 + * - Automatic shape positioning within wrappers
18704 + * - GSAP-powered animations with multiple trigger types
18705 + * - Support for 18 different animation effects
18706 + * - Configurable duration, delay, easing, repeat, and yoyo options
18707 + *
18708 + * Animation Trigger Types:
18709 + * - on-load: Animation plays when the page loads
18710 + * - on-hover: Animation plays on mouse hover
18711 + *
18712 + * Available Animations:
18713 + * - Fade: fade-in, fade-in-up, fade-in-down, fade-in-left, fade-in-right
18714 + * - Zoom: zoom-in, zoom-out
18715 + * - Rotate: rotate-in, flip-x, flip-y
18716 + * - Motion: bounce, pulse, swing, shake
18717 + * - Slide: slide-in-left, slide-in-right, slide-in-up, slide-in-down
18718 + */
18719 +
18720 + jQuery(window).on('elementor/frontend/init', () => {
18721 +
18722 + const applyShapeToWrapper = () => {
18723 + jQuery('.bdt-shape-builder').each((i, el) => {
18724 + const $el = jQuery(el);
18725 + const wrapperClass = $el.data('wrapper-id');
18726 +
18727 + if (wrapperClass) {
18728 + const $wrapper = jQuery(`.${wrapperClass}`);
18729 +
18730 + // Ensure wrapper exists before appending
18731 + if ($wrapper.length) {
18732 + // Move shape inside wrapper
18733 + $wrapper.append($el);
18734 + }
18735 + }
18736 + });
18737 + };
18738 +
18739 + // GSAP Animation Handler
18740 + const initShapeAnimations = () => {
18741 + // Handle On Load animations (trigger when entering viewport)
18742 + jQuery('.bdt-shape-builder[data-animation-enabled="true"]').each((i, el) => {
18743 + const $el = jQuery(el);
18744 + const trigger = $el.data('animation-trigger');
18745 +
18746 + // Skip hover animations here, they're handled separately
18747 + if (trigger === 'on-hover') {
18748 + return;
18749 + }
18750 +
18751 + // Only handle on-load animations
18752 + if (trigger !== 'on-load') {
18753 + return;
18754 + }
18755 +
18756 + const animationName = $el.data('animation-name');
18757 + const duration = parseFloat($el.data('animation-duration')) || 1;
18758 + const delay = parseFloat($el.data('animation-delay')) || 0;
18759 + const easing = $el.data('animation-easing') || 'none';
18760 + const repeat = parseInt($el.data('animation-repeat')) || 0;
18761 + const yoyo = $el.data('animation-yoyo');
18762 + const viewport = parseFloat($el.data('animation-viewport')) || 0.1;
18763 +
18764 + // Get animation properties based on animation name
18765 + const getAnimationProps = (name) => {
18766 + const animations = {
18767 + 'fade-in': { opacity: 0 },
18768 + 'fade-in-up': { opacity: 0, y: 50 },
18769 + 'fade-in-down': { opacity: 0, y: -50 },
18770 + 'fade-in-left': { opacity: 0, x: -50 },
18771 + 'fade-in-right': { opacity: 0, x: 50 },
18772 + 'zoom-in': { scale: 0 },
18773 + 'zoom-out': { scale: 2 },
18774 + 'rotate-in': { rotation: -360 },
18775 + 'flip-x': { rotationX: 180 },
18776 + 'flip-y': { rotationY: 180 },
18777 + 'bounce': { y: -30 },
18778 + 'pulse': { scale: 0.9 },
18779 + 'swing': { rotation: 15 },
18780 + 'shake': { x: -10 },
18781 + 'slide-in-left': { x: -100 },
18782 + 'slide-in-right': { x: 100 },
18783 + 'slide-in-up': { y: 100 },
18784 + 'slide-in-down': { y: -100 }
18785 + };
18786 + return animations[name] || { opacity: 0 };
18787 + };
18788 +
18789 + const fromProps = getAnimationProps(animationName);
18790 +
18791 + // Build toProps dynamically - only include properties that were in fromProps
18792 + const toProps = {
18793 + duration: duration,
18794 + delay: delay,
18795 + ease: easing,
18796 + repeat: repeat,
18797 + yoyo: yoyo,
18798 + transformOrigin: 'center center'
18799 + };
18800 +
18801 + // Only reset the properties that were animated
18802 + if ('opacity' in fromProps) toProps.opacity = 1;
18803 + if ('x' in fromProps) toProps.x = 0;
18804 + if ('y' in fromProps) toProps.y = 0;
18805 + if ('scale' in fromProps) toProps.scale = 1;
18806 + if ('rotation' in fromProps) toProps.rotation = 0;
18807 + if ('rotationX' in fromProps) toProps.rotationX = 0;
18808 + if ('rotationY' in fromProps) toProps.rotationY = 0;
18809 +
18810 + // Set transform origin first
18811 + gsap.set(el, { transformOrigin: 'center center' });
18812 +
18813 + // Use Intersection Observer to trigger animation when element enters viewport
18814 + const observer = new IntersectionObserver((entries) => {
18815 + entries.forEach(entry => {
18816 + if (entry.isIntersecting) {
18817 + // Element is in viewport, start animation using fromTo for better control
18818 + gsap.fromTo(el,
18819 + { ...fromProps, transformOrigin: 'center center' },
18820 + toProps
18821 + );
18822 + // Unobserve after animation triggers (one-time animation)
18823 + observer.unobserve(el);
18824 + }
18825 + });
18826 + }, {
18827 + threshold: viewport, // Use dynamic viewport value
18828 + rootMargin: '0px'
18829 + });
18830 +
18831 + // Start observing
18832 + observer.observe(el);
18833 + });
18834 +
18835 + // Handle On Hover animations - Parse data-settings from parent elements
18836 + jQuery('.elementor-element[data-settings]').each((i, parentEl) => {
18837 + const $parent = jQuery(parentEl);
18838 + const settingsAttr = $parent.attr('data-settings');
18839 +
18840 + if (!settingsAttr) {
18841 + return;
18842 + }
18843 +
18844 + let settings;
18845 + try {
18846 + // Decode HTML entities and parse JSON
18847 + const decodedSettings = jQuery('<textarea/>').html(settingsAttr).text();
18848 + settings = JSON.parse(decodedSettings);
18849 + } catch (e) {
18850 + return; // Invalid JSON, skip
18851 + }
18852 +
18853 + // Check if there are shape builder settings with hover animations
18854 + if (!settings.bdt_shape_builder_list || !Array.isArray(settings.bdt_shape_builder_list)) {
18855 + return;
18856 + }
18857 +
18858 + const hoverShapes = settings.bdt_shape_builder_list.filter(shape =>
18859 + shape.shape_builder_animation_popover === 'yes' && shape.animation_trigger_type === 'on-hover'
18860 + );
18861 +
18862 + if (hoverShapes.length === 0) {
18863 + return; // No hover animations in this element
18864 + }
18865 +
18866 + // Create timelines for each hover shape
18867 + const timelines = [];
18868 +
18869 + hoverShapes.forEach(shapeSettings => {
18870 + // Find the actual shape element by ID
18871 + const shapeId = shapeSettings._id;
18872 + const $shapeEl = $parent.find(`.bdt-shape-builder.elementor-repeater-item-${shapeId}`);
18873 +
18874 + if ($shapeEl.length === 0) {
18875 + return; // Shape element not found
18876 + }
18877 +
18878 + const animationName = shapeSettings.animation_name || 'fade-in';
18879 + const duration = (shapeSettings.animation_duration && shapeSettings.animation_duration.size)
18880 + ? parseFloat(shapeSettings.animation_duration.size)
18881 + : 1;
18882 + const easing = shapeSettings.animation_easing || 'none';
18883 +
18884 + // Get animation properties
18885 + const getAnimationProps = (name) => {
18886 + const animations = {
18887 + 'fade-in': { opacity: 0 },
18888 + 'fade-in-up': { y: 50 },
18889 + 'fade-in-down': { y: -50 },
18890 + 'fade-in-left': { x: -50 },
18891 + 'fade-in-right': { x: 50 },
18892 + 'zoom-in': { scale: 0 },
18893 + 'zoom-out': { scale: 2 },
18894 + 'rotate-in': { rotation: -360 },
18895 + 'flip-x': { rotationX: 180 },
18896 + 'flip-y': { rotationY: 180 },
18897 + 'bounce': { y: -30 },
18898 + 'pulse': { scale: 0.9 },
18899 + 'swing': { rotation: 15 },
18900 + 'shake': { x: -10 },
18901 + 'slide-in-left': { x: -100 },
18902 + 'slide-in-right': { x: 100 },
18903 + 'slide-in-up': { y: 100 },
18904 + 'slide-in-down': { y: -100 }
18905 + };
18906 + return animations[name] || { opacity: 0 };
18907 + };
18908 +
18909 + const fromProps = getAnimationProps(animationName);
18910 +
18911 + // Set initial visible state
18912 + gsap.set($shapeEl[0], { opacity: 1 });
18913 +
18914 + // Create timeline for this shape
18915 + const tl = gsap.timeline({ paused: true });
18916 +
18917 + if (['bounce', 'pulse', 'swing', 'shake'].includes(animationName)) {
18918 + // For repeating animations on hover
18919 + tl.to($shapeEl[0], {
18920 + ...fromProps,
18921 + duration: duration / 2,
18922 + ease: easing,
18923 + yoyo: true,
18924 + repeat: 1
18925 + });
18926 + } else {
18927 + // For transition animations
18928 + tl.to($shapeEl[0], {
18929 + ...fromProps,
18930 + duration: duration,
18931 + ease: easing
18932 + });
18933 + }
18934 +
18935 + timelines.push(tl);
18936 + });
18937 +
18938 + // Add hover listeners to parent element
18939 + if (timelines.length > 0) {
18940 + $parent.on('mouseenter.shapeBuilder', () => {
18941 + timelines.forEach(tl => tl.restart());
18942 + }).on('mouseleave.shapeBuilder', () => {
18943 + timelines.forEach(tl => tl.reverse());
18944 + });
18945 + }
18946 + });
18947 + };
18948 +
18949 + // ✅ Trigger for Container (Flexbox layout)
18950 + elementorFrontend.hooks.addAction('frontend/element_ready/container', () => {
18951 + applyShapeToWrapper();
18952 + initShapeAnimations();
18953 + });
18954 +
18955 + // ✅ Trigger for Section (Classic layout)
18956 + elementorFrontend.hooks.addAction('frontend/element_ready/section', () => {
18957 + applyShapeToWrapper();
18958 + initShapeAnimations();
18959 + });
18960 +
18961 + // ✅ Trigger for Column
18962 + elementorFrontend.hooks.addAction('frontend/element_ready/column', () => {
18963 + applyShapeToWrapper();
18964 + initShapeAnimations();
18965 + });
18966 +
18967 + // ✅ Trigger for Inner Section (legacy structure)
18968 + elementorFrontend.hooks.addAction('frontend/element_ready/inner-section', () => {
18969 + applyShapeToWrapper();
18970 + initShapeAnimations();
18971 + });
18972 +
18973 + // ✅ Also run once when the page is fully loaded
18974 + jQuery(window).on('load', () => {
18975 + applyShapeToWrapper();
18976 + initShapeAnimations();
18977 + });
18978 + });
18979 +