PageSourceSearch

https://vietdreamtravel.vn/wp-content/themes/traveler/v3/js/main.js

js vietdreamtravel.vn collected 2026-10-09 00:23:18 UTC 64,977 bytes, 1,833 lines download raw bytes

1;
2(function ($) {
3    "use strict";
4    let Header = {
5        $body: $('body'),
6        isValidated: {},
7        init: function () {
8            let base = this;
9            base._mobile_menu(base.$body);
10            base._login_signup(base.$body);
11            base._toglesidebar();
12            base._moreSidebar();
13            base._mobileLocation();
14            base._toolTip();
15            base._toggleSection(base.$body);
16            base._reviewListSingle(base.$body);
17            base._matchHeight(base.$body);
18            base._likeReview();
19            base._languageCurrency();
20            base.initPasswordField();
21            base._BlogSolo();
22			base._tpPayoutIframe();
23        },
24		_tpPayoutIframe: function () {
25            if ( $('body').hasClass('page-template-template-tp-flights-search') || $('body').hasClass('page-template-template-tp-flights-search-modern') ) {
26				$('#tpcwl_wrapper iframe').attr('scrolling', '');
27				if (window.matchMedia("(min-width: 768px)").matches) {
28					$('#tpcwl_wrapper iframe').css('height', '100vh');
29				}
30			}
31        },
32        _languageCurrency: function () {
33            $('.select2-languages').on('change', function () {
34                var target = $('option:selected', this).data('target');
35                if (target) {
36                    window.location.href = target;
37                }
38            });
39            $('.select2-currencies').on('change', function () {
40                var target = $('option:selected', this).data('target');
41                if (target) {
42                    window.location.href = target;
43                }
44            });
45        },
46        _likeReview: function () {
47            $('.st-like-review').on('click', function (e) {
48                e.preventDefault();
49                var me = $(this);
50                var comment_id = me.data('id');
51                $.ajax({
52                    url: st_params.ajax_url,
53                    type: 'post',
54                    dataType: 'json',
55                    data: {
56                        action: 'like_review',
57                        comment_ID: comment_id
58                    },
59                    success: function (res) {
60                        if (res.status) {
61                            $('i', me).toggleClass('fa-thumbs-up fa-thumbs-down');
62                            if ($('.booking-item-review-rate').length) {
63                                $(me).toggleClass('fa-thumbs-up fa-thumbs-down');
64                            }
65                            if (typeof res.data.like_count != undefined) {
66                                res.data.like_count = parseInt(res.data.like_count);
67                                me.parent().find('span').html(res.data.like_count);
68                            }
69                        }
70                    }
71                });
72            });
73        },
74        _reviewListSingle: function (body) {
75            $('.review-list', body).on('click', '.show-more', function (ev) {
76                ev.preventDefault();
77                var parent = $(this).closest('.comment');
78                $(this).css('display', 'none');
79                $('.review', parent).slideDown(200);
80                $('.show-less', parent).css('display', 'block');
81            });
82            $('.review-list', body).on('click', '.show-less', function (ev) {
83                ev.preventDefault();
84                var parent = $(this).closest('.comment');
85                $(this).css('display', 'none');
86                $('.review', parent).slideUp(200);
87                $('.show-more', parent).css('display', 'block');
88            });
89        },
90        _toggleSection: function (body) {
91            body.on('click', '.toggle-section', function (ev) {
92                ev.preventDefault();
93                var t = $(this);
94                var target = t.data('target');
95                if ($('.fas', t).length) {
96                    $('.fas', t).toggleClass('fa-angle-up fa-angle-down');
97                } else {
98                    $('i', t).toggleClass('stt-icon-arrow-up stt-icon-arrow-down');
99                }
100
101                $('[data-toggle-section="' + target + '"]').slideToggle(200);
102                $('.has-matchHeight', body).matchHeight();
103            });
104        },
105        initPasswordField() {
106            $('.field-password svg').on('click', function () {
107                let t = $(this),
108                    parent = t.parents('.field-password');
109
110                if (parent.hasClass('ic-view')) {
111                    parent.addClass('viewing').find('input').attr('type', 'text');
112                    parent.removeClass('ic-view');
113                } else {
114                    parent.removeClass('viewing').find('input').attr('type', 'password');
115                    parent.addClass('ic-view');
116                }
117            });
118        },
119        _BlogSolo(){
120            $(document).on('change', '.search--blog-solo #cat', function () {
121                var $form = $(this).closest('form');
122                $form.trigger('submit');
123            });
124
125        },
126        _matchHeight: function (body) {
127            if ($('.has-matchHeight', body).length) {
128                $('.has-matchHeight', body).matchHeight();
129            }
130        },
131        _mobileLocation: function () {
132            $('.search-form-mobile .dropdown-menu li').on('click', function () {
133                var t = $(this);
134                var parent = t.closest('.search-form-mobile');
135                $('input[name="location_id"]', parent).val(t.data('value'));
136                $('input[name="location_name"]', parent).val(t.find('span').text());
137            });
138        },
139        _toolTip: function () {
140            var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
141            var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
142                return new bootstrap.Tooltip(tooltipTriggerEl)
143            })
144        },
145        _moreSidebar: function () {
146            if ($('.btn-more-item').length) {
147                $('.btn-more-item').each(function () {
148                    var t = $(this);
149                    var parent = t.closest('.item-content');
150                    if (parent.find('ul li').length > 3) {
151                        console.log( t);
152                        t.show();
153                    }
154                    t.on('click', function () {
155                        var countLi = parent.find('ul li.hidden').length;
156                        var max = 3;
157                        if (countLi < 3) {
158                            max = countLi;
159                        }
160                        for (var i = 0; i < max; i++) {
161                            parent.find('ul li.hidden').eq(0).removeClass('hidden');
162                        }
163                        var countLi = parent.find('ul li.hidden').length;
164                        if (countLi <= 0) {
165                            t.hide();
166                        }
167                    });
168                });
169            }
170            if ($('.btn-more-item-v2').length) {
171                $('.btn-more-item-v2').each(function () {
172                    var t = $(this);
173                    var parent = t.closest('.item-content');
174                    if (parent.find('ul li').length > 3) {
175                        console.log( t);
176                        t.show();
177                    }
178                    t.on('click', function () {
179                        var countLi = parent.find('ul li.hidden').length;
180                        var max = 3;
181                        if (countLi < 3) {
182                            max = countLi;
183                        }
184                        for (var i = 0; i < max; i++) {
185                            parent.find('ul li.hidden').eq(0).removeClass('hidden');
186                        }
187                        var countLi = parent.find('ul li.hidden').length;
188                        if (countLi <= 0) {
189                            t.hide();
190                        }
191                    });
192                });
193            }
194        },
195        _toglesidebar: function (body) {
196            /*Sidebar toggle*/
197            if ($('.sidebar-item').length) {
198                $('.sidebar-item').each(function () {
199                    var t = $(this);
200                    if (t.hasClass('open')) {
201                        t.find('.item-content').slideUp();
202                    }
203                });
204            }
205            $('.sidebar-item .item-title').on('click', function () {
206                var t = $(this);
207                t.parent().toggleClass('open');
208                t.parent().find('.item-content').slideToggle();
209            });
210        },
211        _login_signup: function (body) {
212            $('#st-login-form form, #st-login-form-page form', body).on('submit', function (ev) {
213
214                ev.preventDefault();
215                var form = $(this),
216                    loader = form.closest('.modal-content').find('.loader-wrapper'),
217                    message = $('.message-wrapper', form);
218                var data = form.serializeArray();
219                data.push({
220                    name: 'security',
221                    value: st_params._s
222                });
223                message.html('');
224                loader.show();
225                $.post(st_params.ajax_url, data, function (respon) {
226                    if (typeof respon == 'object') {
227                        message.html(respon.message);
228                        setTimeout(function () {
229                            message.html('');
230                        }, 3000);
231                        if (respon.status == 1) {
232                            setTimeout(function () {
233								if ( ! $( '#st-login-form-page' ).length ) {
234									$('.st-sign-up').removeClass('active');
235									$('.st-sign-in').addClass('active');
236									$('.register-component').removeClass('active');
237									$('.login-component').addClass('active');
238								}
239                                if (typeof respon.redirect !== 'undefined') {
240                                    window.location.href = respon.redirect;
241                                }
242
243                            }, 3000);
244                        }
245                    }
246                    loader.hide();
247                }, 'json');
248            });
249            $('#st-register-form form', body).on('submit', function (ev) {
250                ev.preventDefault();
251                var form = $(this),
252                    loader = form.closest('.modal-content').find('.loader-wrapper'),
253                    message = $('.message-wrapper', form);
254                var data = form.serializeArray();
255                data.push({
256                    name: 'security',
257                    value: st_params._s
258                });
259                message.html('');
260                loader.show();
261                $.post(st_params.ajax_url, data, function (respon) {
262                    loader.hide();
263                    if (typeof respon == 'object') {
264                        message.html(respon.message);
265                        if (respon.status == 1) {
266                            swal({
267                                type: 'success',
268                                title: respon.message,
269                                text: respon.sub_message,
270                                showConfirmButton: true,
271                                confirmButtonText: '<i class="fa fa-window-close"></i>',
272                                onClose: function () {
273                                    $('#st-login-form', body).modal('show');
274                                    $('#st-register-form', body).modal('hide');
275                                },
276                                allowOutsideClick: false
277                            });
278                        } else {
279                            message.html(respon.message);
280                            setTimeout(function () {
281                                message.html('');
282                            }, 4000);
283                        }
284                    }
285                }, 'json');
286            });
287            $('#st-forgot-form form, #st-forgot-form-page form', body).on('submit', function (ev) {
288                ev.preventDefault();
289                var form = $(this),
290                    loader = form.closest('.modal-content').find('.loader-wrapper'),
291                    message = $('.message-wrapper', form);
292                var data = form.serializeArray();
293                data.push({
294                    name: 'security',
295                    value: st_params._s
296                });
297                message.html('');
298                loader.show();
299                $.post(st_params.ajax_url, data, function (respon) {
300                    if (typeof respon == 'object') {
301                        message.html(respon.message);
302                        setTimeout(function () {
303                            message.html('');
304                        }, 2000);
305                    }
306                    loader.hide();
307                }, 'json');
308            });
309
310            /*popup login mobile*/
311            $('.toggle-menu--user').on('click',function (ev) {
312                ev.preventDefault();
313                $('#st-login-form').modal('toggle');
314                $('#st-login-form').modal('show');
315            });
316            $('.open-loss-password', body).on('click', function (ev) {
317                ev.preventDefault();
318                $('#st-login-form', body).modal('hide');
319                $('#st-register-form', body).modal('hide');
320                setTimeout(function () {
321                    $('#st-forgot-form', body).modal('show');
322                }, 500);
323            });
324            $('.open-login', body).on('click', function (ev) {
325                ev.preventDefault();
326                $('#st-register-form', body).modal('hide');
327                $('#st-forgot-form', body).modal('hide');
328                setTimeout(function () {
329                    $('#st-login-form', body).modal('show');
330                }, 500);
331            });
332            $('.form-login--solo .open-signup', body).on('click', function (ev) {
333                ev.preventDefault();
334                $('#st-forgot-form', body).modal('hide');
335                $('#st-login-form', body).modal('hide');
336                setTimeout(function () {
337                    $('#st-register-form', body).modal('show');
338                }, 500);
339            });
340        },
341        _mobile_menu: function (body) {
342            var body = $('body');
343            $('.toggle-menu').on('click', function (ev) {
344                ev.preventDefault();
345                toggleBody($('#st-main-menu'));
346                $('#st-main-menu').toggleClass('open');
347            });
348            $('.back-menu').on('click', function (ev) {
349                ev.preventDefault();
350                toggleBody($('#st-main-menu'));
351                $('#st-main-menu').toggleClass('open');
352            });
353
354            function toggleBody(el) {
355                if (el.hasClass('open')) {
356                    body.removeClass( 'modal-open-mb' );
357                } else {
358                    body.addClass( 'modal-open-mb' );
359                }
360            }
361
362            $('#st-main-menu .main-menu .menu-item-has-children .fa').on('click', function () {
363                if (window.matchMedia("(max-width: 991px)").matches) {
364                    $(this).toggleClass('fa-angle-down fa-angle-up');
365                    var parent = $(this).closest('.menu-item-has-children');
366                    $('>.menu-dropdown', parent).toggle();
367
368
369                }
370            });
371            $('#st-main-menu .main-menu .has-mega-menu .fa').on('click', function () {
372                if (window.matchMedia("(max-width: 991px)").matches) {
373                    $(this).toggleClass('fa-angle-down fa-angle-up');
374                    var parent = $(this).closest('.has-mega-menu');
375                    $('>.menu-dropdown', parent).toggle();
376
377
378                }
379            });
380            body.on('click', function (ev) {
381                if ($(ev.target).is('#st-main-menu')) {
382                    toggleBody($(ev.target));
383                    $('#st-main-menu').toggleClass('open');
384                }
385            });
386
387			$("#st-main-menu .login, #st-main-menu .signup").on('click', function () {
388				$("#st-main-menu").removeClass("open");
389			});
390			$(document).on( 'click', '.login-regiter-popup button.close', function (ev) {
391				body.removeClass( 'modal-open-mb' );
392			} );
393        },
394    }
395    Header.init();
396    //Elementor
397    let ST_Elementor = {
398        $body: $('body'),
399        isValidated: {},
400        init: function () {
401            let base = this;
402            base._selectTabServiceList();
403            base._addWishlist();
404        },
405        _addWishlist: function () {
406            $(document).on('click', '.service-add-wishlist.login', function (event) {
407                event.preventDefault();
408                var t = $(this);
409                t.addClass('loading');
410                $.ajax({
411                    url: st_params.ajax_url,
412                    type: "POST",
413                    data: {
414                        action: "st_add_wishlist",
415                        data_id: t.data('id'),
416                        data_type: t.data('type')
417                    },
418                    dataType: "json",
419                }).done(function (html) {
420                    if (html.status == 'true') {
421                        if (html.added == 'true') {
422                            t.addClass('added');
423                        } else {
424                            t.removeClass('added');
425                        }
426                        t.attr('title', html.title);
427                    }
428                    t.removeClass('loading');
429                })
430            });
431        },
432        _selectTabServiceList: function () {
433            $('.st-list-service').each(function () {
434                var t = $(this);
435                var dataTabShowVal = $('.st-list-dropdown .header', t).data('value');
436                $('.multi-service-wrapper .tab-content.' + dataTabShowVal, t).show();
437
438            });
439            $('.st-list-dropdown').each(function () {
440                var t = $(this);
441                var parent = t.closest('.st-list-service');
442                var currentTabList = t.find('.header').data('value');
443                $('.list', t).find('li[data-value="' + currentTabList + '"]').hide();
444                $('.header', t).on('click', function () {
445                    $('.list', t).toggle();
446                });
447                $('.list li', t).on('click', function () {
448                    var me = $(this);
449                    $('.list li', t).removeClass('active');
450                    me.addClass('active');
451                    var dataS = me.data('value');
452                    var dataArg = me.data('arg');
453                    var datastyleitem = me.data('styleitem');
454                    var dataSName = me.text();
455                    $('.header span', t).text(dataSName);
456                    $('.header', t).attr('data-value', dataS);
457                    me.parent().hide();
458                    $.ajax({
459                        url: st_params.ajax_url,
460                        type: "GET",
461                        data: {
462                            'action': "st_list_of_service_" + dataS,
463                            'dataArg': dataArg,
464                            'datastyleitem': datastyleitem,
465                        },
466                        dataType: "json",
467                        beforeSend: function () {
468                            parent.find('.map-content-loading').css('z-index', 99);
469                            parent.find('.map-content-loading').show();
470
471                        },
472                        error: function (jqXHR, textStatus, errorThrown) {},
473                        success: function (res) {
474                            parent.find('.map-content-loading').hide();
475                        },
476                        complete: function (xhr, status) {
477
478                            if (xhr.responseJSON) {
479
480                                parent.find('.multi-service-wrapper').html(xhr.responseJSON.html).hide().fadeIn(1500);
481
482                                $('.multi-service-wrapper .tab-content', parent).hide();
483                                $('.multi-service-wrapper .tab-content.' + dataS, parent).show();
484                                setTimeout(function () {
485                                    $('.multi-service-wrapper .tab-content .has-matchHeight', parent).matchHeight({
486                                        remove: true
487                                    });
488                                    $('.multi-service-wrapper .tab-content .has-matchHeight', parent).matchHeight();
489                                }, 1000);
490                                $('.list li', t).show();
491                                $('.list', t).find('li[data-value="' + dataS + '"]').hide();
492                            }
493                            $('.st-service-slider').each(function () {
494                                $(this).owlCarousel({
495                                    loop: false,
496                                    items: 4,
497                                    margin: 20,
498                                    responsiveClass: true,
499                                    dots: false,
500                                    responsive: {
501                                        0: {
502                                            items: 1,
503                                            nav: false,
504                                            margin: 15,
505                                            dots: true,
506                                        },
507                                        576: {
508                                            items: 2,
509                                            nav: false,
510                                            margin: 15,
511                                            dots: true,
512                                        },
513                                        992: {
514                                            items: 3,
515                                            nav: true,
516                                        },
517                                        1200: {
518                                            items: 4,
519                                            nav: true,
520                                        }
521                                    }
522                                });
523                            });
524                        }
525                    });
526                })
527                $(document).on('mouseup', function (e) {
528                    var container = t;
529                    if (!container.is(e.target) && container.has(e.target).length === 0) {
530                        container.find('.list').hide();
531                    }
532                });
533            });
534        },
535        _resize: function (body) {
536            var timeout_fixed_item;
537            $(window).on('resize', function () {
538                clearTimeout(timeout_fixed_item);
539                timeout_fixed_item = setTimeout(function () {
540
541                    $('.st-hotel-content', 'body').each(function () {
542                        var t = $(this);
543                        $(window).on('scroll', function () {
544                            if ($(window).scrollTop() >= 50 && window.matchMedia('(max-width: 991px)').matches) {
545                                t.css('display', 'flex');
546                            } else {
547                                t.css('display', 'none');
548                            }
549                        });
550                    });
551                }, 1000);
552            }).trigger('resize');
553            //Slider gallery single hotel detail
554            if (window.matchMedia('(min-width: 992px)').matches) {
555                $('.st-gallery', body).each(function () {
556                    var parent = $(this);
557                    var $fotoramaDiv = $('.fotorama', parent).fotorama({
558                        width: parent.data('width'),
559                        nav: parent.data('nav'),
560                        thumbwidth: '135',
561                        thumbheight: '135',
562                        allowfullscreen: parent.data('allowfullscreen')
563                    });
564                    parent.data('fotorama', $fotoramaDiv.data('fotorama'));
565                });
566            } else {
567                $('.st-gallery', body).each(function () {
568                    var parent = $(this);
569                    if (typeof parent.data('fotorama') !== 'undefined') {
570                        parent.data('fotorama').destroy();
571                    }
572                    var $fotoramaDiv = $('.fotorama', parent).fotorama({
573                        width: parent.data('width'),
574                        nav: parent.data('nav'),
575                        thumbwidth: '80',
576                        thumbheight: '80',
577                        allowfullscreen: parent.data('allowfullscreen')
578                    });
579                    parent.data('fotorama', $fotoramaDiv.data('fotorama'));
580                });
581            }
582            if (window.matchMedia('(min-width: 992px)').matches) {
583                $('.full-map').show();
584            } else {
585                $('.full-map').hide();
586            }
587            if (window.matchMedia('(max-width: 991px)').matches) {
588                $('.as').slideDown();
589            }
590
591        },
592
593    }
594    ST_Elementor.init();
595
596    //_selectPayment;
597    if ($('.payment-form .payment-item').length) {
598        $('.payment-form .payment-item').eq(0).find('.st-icheck-item input[type="radio"]').prop('checked', true);
599        $('.payment-form .payment-item').eq(0).find('.dropdown-menu').slideDown();
600    }
601    $('.payment-form .payment-item').each(function (l, i) {
602        var parent = $(this);
603        $('.st-icheck-item input[type="radio"]', parent).on('change', function () {
604            $('.payment-form .payment-item .dropdown-menu').slideUp();
605            if ($(this).is(':checked')) {
606                if ($('.dropdown-menu', parent).length) {
607                    $('.dropdown-menu', parent).slideDown();
608                }
609            }
610        });
611    });
612
613})(jQuery);
614
615function stKeyupsmartSearch(event) {
616    // Declare variables
617    var input, filter, ul, li, a, i, txtValue;
618    input = event.value.toUpperCase();
619    filter = event.value.toUpperCase();
620    parent = event.closest(".destination-search");
621    ul = parent.getElementsByTagName('ul')[0];
622    li = ul.getElementsByTagName('li');
623
624    // Loop through all list items, and hide those who don't match the search query
625    for (i = 0; i < li.length; i++) {
626        //a = li[i].getElementsByTagName("a")[0];
627        txtValue = li[i].textContent || li[i].innerText;
628        if (txtValue.toUpperCase().indexOf(filter) > -1) {
629            li[i].style.display = "";
630        } else {
631            li[i].style.display = "none";
632        }
633    }
634}
635
636
637
638
639var markerGolbal;
640var mapGobal;
641
642function getMapDistance(map) {
643    var bounds = map.getBounds();
644    var center = bounds.getCenter();
645    var ne = bounds.getNorthEast();
646    var r = 3963.0;
647    var lat1 = center.lat() / 57.2958;
648    var lon1 = center.lng() / 57.2958;
649    var lat2 = ne.lat() / 57.2958;
650    var lon2 = ne.lng() / 57.2958;
651    var dis = r * Math.acos(Math.sin(lat1) * Math.sin(lat2) +
652        Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1));
653    return dis;
654}
655
656function initHalfMap(mapEl, mapData, mapLat, mapLng, mapZoom, mapIcon, mapVersion, isMapMove) {
657    var popupPos = mapEl.data('popup-position');
658    if (mapData.length <= 0)
659        mapData = mapEl.data('data_show');
660    if (mapLat.length <= 0)
661        mapLat = mapEl.data('lat');
662    if (mapLng.length <= 0)
663        mapLng = mapEl.data('lng');
664    if (mapZoom.length <= 0)
665        mapZoom = typeof mapEl.data('zoom') !== 'undefined' ? mapEl.data('zoom') : 13;
666    if (mapIcon.length <= 0)
667        mapIcon = mapEl.data('icon');
668
669    if (typeof isMapMove === 'undefined')
670        isMapMove = false;
671
672    if (!isMapMove) {
673        mapGobal = new google.maps.Map(mapEl.get(0), {
674            zoom: mapZoom,
675            center: {
676                lat: parseFloat(mapLat),
677                lng: parseFloat(mapLng)
678            },
679            disableDefaultUI: true
680        });
681    }
682
683    if (!isMapMove) {
684        bounds = new google.maps.LatLngBounds();
685    }
686
687    if (isMapMove) {
688        if (markerGolbal.length) {
689            for (var i = 0; i < markerGolbal.length; i++) {
690                markerGolbal[i].setMap(null);
691            }
692        }
693    }
694
695    if (typeof mapData != 'undefined' && Object.keys(mapData).length) {
696        var marker = [];
697        var ib = [];
698        var c = {};
699
700        markerGolbal = jQuery.map(mapData, function (location, i) {
701
702            if (mapVersion === 'elementorv2') {
703                marker[i] = new MarkerWithLabel({
704                    icon: " ",
705                    position: new google.maps.LatLng(parseFloat(location.lat), parseFloat(location.lng)),
706                    draggable: false,
707                    raiseOnDrag: false,
708                    map: mapGobal,
709                    labelContent: '<div class="inner" data-marker-id="' + location.id + '">' + jQuery(location.content_adv_html).find('.item_price_map span').text() + '</div>',
710                    labelAnchor: new google.maps.Point(0, 0),
711                    labelClass: "stt-price-label"
712                });
713            } else {
714                marker[i] = new google.maps.Marker({
715                    position: {
716                        lat: parseFloat(location.lat),
717                        lng: parseFloat(location.lng)
718                    },
719                    options: {
720                        icon: mapIcon,
721                        animation: isMapMove ? google.maps.Animation.NONE : google.maps.Animation.DROP
722                    },
723                    map: mapGobal
724                });
725            }
726
727
728            if (!isMapMove) {
729                var loc = new google.maps.LatLng(parseFloat(location.lat), parseFloat(location.lng));
730                bounds.extend(loc);
731            }
732
733            var ibOptions = {
734                content: '',
735                disableAutoPan: true,
736                maxWidth: 0,
737                pixelOffset: new google.maps.Size(-135, 20),
738                zIndex: null,
739                boxStyle: {
740                    padding: "0px 0px 0px 0px",
741                    width: "270px",
742                },
743                closeBoxURL: "",
744                cancelBubble: true,
745                infoBoxClearance: new google.maps.Size(1, 1),
746                isHidden: false,
747                pane: "floatPane",
748                enableEventPropagation: true,
749                alignBottom: true
750            };
751            if (window.matchMedia("(min-width: 768px)").matches) {
752                if (popupPos == 'right') {
753                    ibOptions.pixelOffset = new google.maps.Size(35, -208);
754                    ibOptions.alignBottom = false;
755                }
756            }
757            jQuery(window).on('resize', function () {
758                if (window.matchMedia("(min-width: 768px)").matches) {
759                    if (popupPos == 'right') {
760                        ibOptions.pixelOffset = new google.maps.Size(35, -208);
761                        ibOptions.alignBottom = false;
762                    }
763                }
764            });
765
766            google.maps.event.addListener(marker[i], 'click', (function () {
767                var source = location.content_html;
768                var boxText = document.createElement("div");
769                if (window.matchMedia("(min-width: 768px)").matches) {
770                    if (popupPos == 'right') {
771                        boxText.classList.add("right-box");
772                    }
773                }
774                jQuery(window).on('resize', function () {
775                    if (window.matchMedia("(min-width: 768px)").matches) {
776                        if (popupPos == 'right') {
777                            boxText.classList.add("right-box");
778                        }
779                    } else {
780                        boxText.classList.remove("right-box");
781                    }
782                });
783                boxText.style.cssText = "border-radius: 5px; background: #fff; padding: 0px;";
784                boxText.innerHTML = source;
785                ibOptions.content = boxText;
786                var ks = Object.keys(c);
787                if (ks.length) {
788                    for (var j = 0; j < ks.length; j++) {
789                        c[ks[j]].close();
790                    }
791                }
792                ib[i] = new InfoBox(ibOptions);
793                c[i] = ib[i];
794                ib[i].open(mapGobal, this);
795                mapGobal.panTo(ib[i].getPosition());
796                google.maps.event.addListener(ib[i], 'domready', function () {
797                    var closeInfoBox = document.getElementById("close-popup-on-map");
798                    google.maps.event.addDomListener(closeInfoBox, 'click', function () {
799                        ib[i].close();
800                    });
801                });
802            }));
803
804            return marker[i];
805        });
806
807        if (!isMapMove) {
808            customControlGoogleMap(mapEl.get(0), mapGobal);
809        }
810    }
811    if (!isMapMove) {
812        // mapGobal.fitBounds(bounds);
813        mapGobal.panToBounds(bounds);
814    }
815    var listener = google.maps.event.addListener(mapGobal, "idle", function () {
816        if (mapGobal.getZoom() > 16)
817            mapGobal.setZoom(16);
818        google.maps.event.removeListener(listener);
819    });
820
821
822
823    if (mapVersion === 'elementorv2') {
824        google.maps.event.addListener(mapGobal, "dragend", function (ev) {
825            var moveLat = mapGobal.getCenter().lat();
826            var moveLng = mapGobal.getCenter().lng();
827            if (jQuery('#st-move-map').length) {
828                if (jQuery('#st-move-map').is(':checked')) {
829                    let distance = getMapDistance(mapGobal);
830                    jQuery('#st-map-coordinate').val(moveLat + '_' + moveLng + '_' + distance).change();
831                } else {
832                    jQuery('#st-map-coordinate').val("");
833                }
834            }
835        });
836
837        google.maps.event.addListener(mapGobal, "zoom_changed", function (ev) {
838            var moveLat = mapGobal.getCenter().lat();
839            var moveLng = mapGobal.getCenter().lng();
840            if (jQuery('#st-move-map').length) {
841                if (jQuery('#st-move-map').is(':checked')) {
842                    let distance = getMapDistance(mapGobal);
843                    jQuery('#st-map-coordinate').val(moveLat + '_' + moveLng + '_' + distance).change();
844                } else {
845                    jQuery('#st-map-coordinate').val("");
846                }
847            }
848        });
849    }
850}
851var mapStyles = {
852    'silver': [{
853            "elementType": "geometry",
854            "stylers": [{
855                "color": "#f5f5f5"
856            }]
857        },
858        {
859            "elementType": "labels.icon",
860            "stylers": [{
861                "visibility": "off"
862            }]
863        },
864        {
865            "elementType": "labels.text.fill",
866            "stylers": [{
867                "color": "#616161"
868            }]
869        },
870        {
871            "elementType": "labels.text.stroke",
872            "stylers": [{
873                "color": "#f5f5f5"
874            }]
875        },
876        {
877            "featureType": "administrative.land_parcel",
878            "elementType": "labels.text.fill",
879            "stylers": [{
880                "color": "#bdbdbd"
881            }]
882        },
883        {
884            "featureType": "poi",
885            "elementType": "geometry",
886            "stylers": [{
887                "color": "#eeeeee"
888            }]
889        },
890        {
891            "featureType": "poi",
892            "elementType": "labels.text.fill",
893            "stylers": [{
894                "color": "#757575"
895            }]
896        },
897        {
898            "featureType": "poi.park",
899            "elementType": "geometry",
900            "stylers": [{
901                "color": "#e5e5e5"
902            }]
903        },
904        {
905            "featureType": "poi.park",
906            "elementType": "labels.text.fill",
907            "stylers": [{
908                "color": "#9e9e9e"
909            }]
910        },
911        {
912            "featureType": "road",
913            "elementType": "geometry",
914            "stylers": [{
915                "color": "#ffffff"
916            }]
917        },
918        {
919            "featureType": "road.arterial",
920            "elementType": "labels.text.fill",
921            "stylers": [{
922                "color": "#757575"
923            }]
924        },
925        {
926            "featureType": "road.highway",
927            "elementType": "geometry",
928            "stylers": [{
929                "color": "#dadada"
930            }]
931        },
932        {
933            "featureType": "road.highway",
934            "elementType": "labels.text.fill",
935            "stylers": [{
936                "color": "#616161"
937            }]
938        },
939        {
940            "featureType": "road.local",
941            "elementType": "labels.text.fill",
942            "stylers": [{
943                "color": "#9e9e9e"
944            }]
945        },
946        {
947            "featureType": "transit.line",
948            "elementType": "geometry",
949            "stylers": [{
950                "color": "#e5e5e5"
951            }]
952        },
953        {
954            "featureType": "transit.station",
955            "elementType": "geometry",
956            "stylers": [{
957                "color": "#eeeeee"
958            }]
959        },
960        {
961            "featureType": "water",
962            "elementType": "geometry",
963            "stylers": [{
964                "color": "#c9c9c9"
965            }]
966        },
967        {
968            "featureType": "water",
969            "elementType": "labels.text.fill",
970            "stylers": [{
971                "color": "#9e9e9e"
972            }]
973        }
974    ],
975    'retro': [{
976            "elementType": "geometry",
977            "stylers": [{
978                "color": "#ebe3cd"
979            }]
980        },
981        {
982            "elementType": "labels.text.fill",
983            "stylers": [{
984                "color": "#523735"
985            }]
986        },
987        {
988            "elementType": "labels.text.stroke",
989            "stylers": [{
990                "color": "#f5f1e6"
991            }]
992        },
993        {
994            "featureType": "administrative",
995            "elementType": "geometry.stroke",
996            "stylers": [{
997                "color": "#c9b2a6"
998            }]
999        },
1000        {
1001            "featureType": "administrative.land_parcel",
1002            "elementType": "geometry.stroke",
1003            "stylers": [{
1004                "color": "#dcd2be"
1005            }]
1006        },
1007        {
1008            "featureType": "administrative.land_parcel",
1009            "elementType": "labels.text.fill",
1010            "stylers": [{
1011                "color": "#ae9e90"
1012            }]
1013        },
1014        {
1015            "featureType": "landscape.natural",
1016            "elementType": "geometry",
1017            "stylers": [{
1018                "color": "#dfd2ae"
1019            }]
1020        },
1021        {
1022            "featureType": "poi",
1023            "elementType": "geometry",
1024            "stylers": [{
1025                "color": "#dfd2ae"
1026            }]
1027        },
1028        {
1029            "featureType": "poi",
1030            "elementType": "labels.text.fill",
1031            "stylers": [{
1032                "color": "#93817c"
1033            }]
1034        },
1035        {
1036            "featureType": "poi.park",
1037            "elementType": "geometry.fill",
1038            "stylers": [{
1039                "color": "#a5b076"
1040            }]
1041        },
1042        {
1043            "featureType": "poi.park",
1044            "elementType": "labels.text.fill",
1045            "stylers": [{
1046                "color": "#447530"
1047            }]
1048        },
1049        {
1050            "featureType": "road",
1051            "elementType": "geometry",
1052            "stylers": [{
1053                "color": "#f5f1e6"
1054            }]
1055        },
1056        {
1057            "featureType": "road.arterial",
1058            "elementType": "geometry",
1059            "stylers": [{
1060                "color": "#fdfcf8"
1061            }]
1062        },
1063        {
1064            "featureType": "road.highway",
1065            "elementType": "geometry",
1066            "stylers": [{
1067                "color": "#f8c967"
1068            }]
1069        },
1070        {
1071            "featureType": "road.highway",
1072            "elementType": "geometry.stroke",
1073            "stylers": [{
1074                "color": "#e9bc62"
1075            }]
1076        },
1077        {
1078            "featureType": "road.highway.controlled_access",
1079            "elementType": "geometry",
1080            "stylers": [{
1081                "color": "#e98d58"
1082            }]
1083        },
1084        {
1085            "featureType": "road.highway.controlled_access",
1086            "elementType": "geometry.stroke",
1087            "stylers": [{
1088                "color": "#db8555"
1089            }]
1090        },
1091        {
1092            "featureType": "road.local",
1093            "elementType": "labels.text.fill",
1094            "stylers": [{
1095                "color": "#806b63"
1096            }]
1097        },
1098        {
1099            "featureType": "transit.line",
1100            "elementType": "geometry",
1101            "stylers": [{
1102                "color": "#dfd2ae"
1103            }]
1104        },
1105        {
1106            "featureType": "transit.line",
1107            "elementType": "labels.text.fill",
1108            "stylers": [{
1109                "color": "#8f7d77"
1110            }]
1111        },
1112        {
1113            "featureType": "transit.line",
1114            "elementType": "labels.text.stroke",
1115            "stylers": [{
1116                "color": "#ebe3cd"
1117            }]
1118        },
1119        {
1120            "featureType": "transit.station",
1121            "elementType": "geometry",
1122            "stylers": [{
1123                "color": "#dfd2ae"
1124            }]
1125        },
1126        {
1127            "featureType": "water",
1128            "elementType": "geometry.fill",
1129            "stylers": [{
1130                "color": "#b9d3c2"
1131            }]
1132        },
1133        {
1134            "featureType": "water",
1135            "elementType": "labels.text.fill",
1136            "stylers": [{
1137                "color": "#92998d"
1138            }]
1139        }
1140    ],
1141    'dark': [{
1142            "elementType": "geometry",
1143            "stylers": [{
1144                "color": "#212121"
1145            }]
1146        },
1147        {
1148            "elementType": "labels.icon",
1149            "stylers": [{
1150                "visibility": "off"
1151            }]
1152        },
1153        {
1154            "elementType": "labels.text.fill",
1155            "stylers": [{
1156                "color": "#757575"
1157            }]
1158        },
1159        {
1160            "elementType": "labels.text.stroke",
1161            "stylers": [{
1162                "color": "#212121"
1163            }]
1164        },
1165        {
1166            "featureType": "administrative",
1167            "elementType": "geometry",
1168            "stylers": [{
1169                "color": "#757575"
1170            }]
1171        },
1172        {
1173            "featureType": "administrative.country",
1174            "elementType": "labels.text.fill",
1175            "stylers": [{
1176                "color": "#9e9e9e"
1177            }]
1178        },
1179        {
1180            "featureType": "administrative.land_parcel",
1181            "stylers": [{
1182                "visibility": "off"
1183            }]
1184        },
1185        {
1186            "featureType": "administrative.locality",
1187            "elementType": "labels.text.fill",
1188            "stylers": [{
1189                "color": "#bdbdbd"
1190            }]
1191        },
1192        {
1193            "featureType": "poi",
1194            "elementType": "labels.text.fill",
1195            "stylers": [{
1196                "color": "#757575"
1197            }]
1198        },
1199        {
1200            "featureType": "poi.park",
1201            "elementType": "geometry",
1202            "stylers": [{
1203                "color": "#181818"
1204            }]
1205        },
1206        {
1207            "featureType": "poi.park",
1208            "elementType": "labels.text.fill",
1209            "stylers": [{
1210                "color": "#616161"
1211            }]
1212        },
1213        {
1214            "featureType": "poi.park",
1215            "elementType": "labels.text.stroke",
1216            "stylers": [{
1217                "color": "#1b1b1b"
1218            }]
1219        },
1220        {
1221            "featureType": "road",
1222            "elementType": "geometry.fill",
1223            "stylers": [{
1224                "color": "#2c2c2c"
1225            }]
1226        },
1227        {
1228            "featureType": "road",
1229            "elementType": "labels.text.fill",
1230            "stylers": [{
1231                "color": "#8a8a8a"
1232            }]
1233        },
1234        {
1235            "featureType": "road.arterial",
1236            "elementType": "geometry",
1237            "stylers": [{
1238                "color": "#373737"
1239            }]
1240        },
1241        {
1242            "featureType": "road.highway",
1243            "elementType": "geometry",
1244            "stylers": [{
1245                "color": "#3c3c3c"
1246            }]
1247        },
1248        {
1249            "featureType": "road.highway.controlled_access",
1250            "elementType": "geometry",
1251            "stylers": [{
1252                "color": "#4e4e4e"
1253            }]
1254        },
1255        {
1256            "featureType": "road.local",
1257            "elementType": "labels.text.fill",
1258            "stylers": [{
1259                "color": "#616161"
1260            }]
1261        },
1262        {
1263            "featureType": "transit",
1264            "elementType": "labels.text.fill",
1265            "stylers": [{
1266                "color": "#757575"
1267            }]
1268        },
1269        {
1270            "featureType": "water",
1271            "elementType": "geometry",
1272            "stylers": [{
1273                "color": "#000000"
1274            }]
1275        },
1276        {
1277            "featureType": "water",
1278            "elementType": "labels.text.fill",
1279            "stylers": [{
1280                "color": "#3d3d3d"
1281            }]
1282        }
1283    ],
1284    'night': [{
1285            "elementType": "geometry",
1286            "stylers": [{
1287                "color": "#242f3e"
1288            }]
1289        },
1290        {
1291            "elementType": "labels.text.fill",
1292            "stylers": [{
1293                "color": "#746855"
1294            }]
1295        },
1296        {
1297            "elementType": "labels.text.stroke",
1298            "stylers": [{
1299                "color": "#242f3e"
1300            }]
1301        },
1302        {
1303            "featureType": "administrative.locality",
1304            "elementType": "labels.text.fill",
1305            "stylers": [{
1306                "color": "#d59563"
1307            }]
1308        },
1309        {
1310            "featureType": "poi",
1311            "elementType": "labels.text.fill",
1312            "stylers": [{
1313                "color": "#d59563"
1314            }]
1315        },
1316        {
1317            "featureType": "poi.park",
1318            "elementType": "geometry",
1319            "stylers": [{
1320                "color": "#263c3f"
1321            }]
1322        },
1323        {
1324            "featureType": "poi.park",
1325            "elementType": "labels.text.fill",
1326            "stylers": [{
1327                "color": "#6b9a76"
1328            }]
1329        },
1330        {
1331            "featureType": "road",
1332            "elementType": "geometry",
1333            "stylers": [{
1334                "color": "#38414e"
1335            }]
1336        },
1337        {
1338            "featureType": "road",
1339            "elementType": "geometry.stroke",
1340            "stylers": [{
1341                "color": "#212a37"
1342            }]
1343        },
1344        {
1345            "featureType": "road",
1346            "elementType": "labels.text.fill",
1347            "stylers": [{
1348                "color": "#9ca5b3"
1349            }]
1350        },
1351        {
1352            "featureType": "road.highway",
1353            "elementType": "geometry",
1354            "stylers": [{
1355                "color": "#746855"
1356            }]
1357        },
1358        {
1359            "featureType": "road.highway",
1360            "elementType": "geometry.stroke",
1361            "stylers": [{
1362                "color": "#1f2835"
1363            }]
1364        },
1365        {
1366            "featureType": "road.highway",
1367            "elementType": "labels.text.fill",
1368            "stylers": [{
1369                "color": "#f3d19c"
1370            }]
1371        },
1372        {
1373            "featureType": "transit",
1374            "elementType": "geometry",
1375            "stylers": [{
1376                "color": "#2f3948"
1377            }]
1378        },
1379        {
1380            "featureType": "transit.station",
1381            "elementType": "labels.text.fill",
1382            "stylers": [{
1383                "color": "#d59563"
1384            }]
1385        },
1386        {
1387            "featureType": "water",
1388            "elementType": "geometry",
1389            "stylers": [{
1390                "color": "#17263c"
1391            }]
1392        },
1393        {
1394            "featureType": "water",
1395            "elementType": "labels.text.fill",
1396            "stylers": [{
1397                "color": "#515c6d"
1398            }]
1399        },
1400        {
1401            "featureType": "water",
1402            "elementType": "labels.text.stroke",
1403            "stylers": [{
1404                "color": "#17263c"
1405            }]
1406        }
1407    ],
1408    'aubergine': [{
1409            "elementType": "geometry",
1410            "stylers": [{
1411                "color": "#1d2c4d"
1412            }]
1413        },
1414        {
1415            "elementType": "labels.text.fill",
1416            "stylers": [{
1417                "color": "#8ec3b9"
1418            }]
1419        },
1420        {
1421            "elementType": "labels.text.stroke",
1422            "stylers": [{
1423                "color": "#1a3646"
1424            }]
1425        },
1426        {
1427            "featureType": "administrative.country",
1428            "elementType": "geometry.stroke",
1429            "stylers": [{
1430                "color": "#4b6878"
1431            }]
1432        },
1433        {
1434            "featureType": "administrative.land_parcel",
1435            "elementType": "labels.text.fill",
1436            "stylers": [{
1437                "color": "#64779e"
1438            }]
1439        },
1440        {
1441            "featureType": "administrative.province",
1442            "elementType": "geometry.stroke",
1443            "stylers": [{
1444                "color": "#4b6878"
1445            }]
1446        },
1447        {
1448            "featureType": "landscape.man_made",
1449            "elementType": "geometry.stroke",
1450            "stylers": [{
1451                "color": "#334e87"
1452            }]
1453        },
1454        {
1455            "featureType": "landscape.natural",
1456            "elementType": "geometry",
1457            "stylers": [{
1458                "color": "#023e58"
1459            }]
1460        },
1461        {
1462            "featureType": "poi",
1463            "elementType": "geometry",
1464            "stylers": [{
1465                "color": "#283d6a"
1466            }]
1467        },
1468        {
1469            "featureType": "poi",
1470            "elementType": "labels.text.fill",
1471            "stylers": [{
1472                "color": "#6f9ba5"
1473            }]
1474        },
1475        {
1476            "featureType": "poi",
1477            "elementType": "labels.text.stroke",
1478            "stylers": [{
1479                "color": "#1d2c4d"
1480            }]
1481        },
1482        {
1483            "featureType": "poi.park",
1484            "elementType": "geometry.fill",
1485            "stylers": [{
1486                "color": "#023e58"
1487            }]
1488        },
1489        {
1490            "featureType": "poi.park",
1491            "elementType": "labels.text.fill",
1492            "stylers": [{
1493                "color": "#3C7680"
1494            }]
1495        },
1496        {
1497            "featureType": "road",
1498            "elementType": "geometry",
1499            "stylers": [{
1500                "color": "#304a7d"
1501            }]
1502        },
1503        {
1504            "featureType": "road",
1505            "elementType": "labels.text.fill",
1506            "stylers": [{
1507                "color": "#98a5be"
1508            }]
1509        },
1510        {
1511            "featureType": "road",
1512            "elementType": "labels.text.stroke",
1513            "stylers": [{
1514                "color": "#1d2c4d"
1515            }]
1516        },
1517        {
1518            "featureType": "road.highway",
1519            "elementType": "geometry",
1520            "stylers": [{
1521                "color": "#2c6675"
1522            }]
1523        },
1524        {
1525            "featureType": "road.highway",
1526            "elementType": "geometry.stroke",
1527            "stylers": [{
1528                "color": "#255763"
1529            }]
1530        },
1531        {
1532            "featureType": "road.highway",
1533            "elementType": "labels.text.fill",
1534            "stylers": [{
1535                "color": "#b0d5ce"
1536            }]
1537        },
1538        {
1539            "featureType": "road.highway",
1540            "elementType": "labels.text.stroke",
1541            "stylers": [{
1542                "color": "#023e58"
1543            }]
1544        },
1545        {
1546            "featureType": "transit",
1547            "elementType": "labels.text.fill",
1548            "stylers": [{
1549                "color": "#98a5be"
1550            }]
1551        },
1552        {
1553            "featureType": "transit",
1554            "elementType": "labels.text.stroke",
1555            "stylers": [{
1556                "color": "#1d2c4d"
1557            }]
1558        },
1559        {
1560            "featureType": "transit.line",
1561            "elementType": "geometry.fill",
1562            "stylers": [{
1563                "color": "#283d6a"
1564            }]
1565        },
1566        {
1567            "featureType": "transit.station",
1568            "elementType": "geometry",
1569            "stylers": [{
1570                "color": "#3a4762"
1571            }]
1572        },
1573        {
1574            "featureType": "water",
1575            "elementType": "geometry",
1576            "stylers": [{
1577                "color": "#0e1626"
1578            }]
1579        },
1580        {
1581            "featureType": "water",
1582            "elementType": "labels.text.fill",
1583            "stylers": [{
1584                "color": "#4e6d70"
1585            }]
1586        }
1587    ]
1588};
1589
1590function customControlGoogleMap(mapEl, map) {
1591    //==== Top Right area
1592    var topRightArea = document.createElement('div');
1593    topRightArea.className = 'google-control-top-right-area';
1594    var controlFullScreen = document.createElement('div');
1595    controlFullScreen.className = 'google-control-fullscreen google-custom-control';
1596    controlFullScreen.innerHTML = '<img src="' + st_list_map_params.icon_full_screen + '" alt="Full Screen"/>';
1597    topRightArea.appendChild(controlFullScreen);
1598    var controlCloseFullScreen = document.createElement('div');
1599    controlCloseFullScreen.className = 'google-control-closefullscreen google-custom-control hide';
1600    controlCloseFullScreen.innerHTML = '<img src="' + st_list_map_params.icon_close + '" alt="Full Screen"/>';
1601    topRightArea.appendChild(controlCloseFullScreen);
1602    var controlMyLocation = document.createElement('div');
1603    controlMyLocation.className = 'google-control-mylocation google-custom-control';
1604    controlMyLocation.innerHTML = '<img src="' + st_list_map_params.icon_my_location + '" alt="Full Screen"/>';
1605    topRightArea.appendChild(controlMyLocation);
1606    var controlStyles = document.createElement('div');
1607    controlStyles.className = 'google-control-styles google-custom-control';
1608    controlStyles.innerHTML = '<img src="' + st_list_map_params.icon_my_style + '" alt="Full Screen"/><div class="google-control-dropdown"><div class="item">Silver</div><div class="item">Retro</div><div class="item">Dark</div><div class="item">Night</div><div class="item">Aubergine</div></div>';
1609    topRightArea.appendChild(controlStyles);
1610    //==== Bottom Right area
1611    var bottomRightArea = document.createElement('div');
1612    bottomRightArea.className = 'google-control-bottom-right-area';
1613    var controlZoomIn = document.createElement('div');
1614    controlZoomIn.className = 'google-control-zoomin google-custom-control';
1615    controlZoomIn.innerHTML = '<img src="' + st_list_map_params.icon_zoom_in + '" alt="Full Screen"/>';
1616    bottomRightArea.appendChild(controlZoomIn);
1617    var controlZoomOut = document.createElement('div');
1618    controlZoomOut.className = 'google-control-zoomout google-custom-control';
1619    controlZoomOut.innerHTML = '<img src="' + st_list_map_params.icon_zoom_out + '" alt="Full Screen"/>';
1620    bottomRightArea.appendChild(controlZoomOut);
1621    map.controls[google.maps.ControlPosition.RIGHT_TOP].push(topRightArea);
1622    map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(bottomRightArea);
1623    controlFullScreen.addEventListener('click', function () {
1624        controlFullScreen.classList.add('hide');
1625        controlCloseFullScreen.classList.remove('hide');
1626        var element = map.getDiv();
1627        if (element.requestFullscreen) {
1628            element.requestFullscreen();
1629        }
1630        if (element.webkitRequestFullScreen) {
1631            element.webkitRequestFullScreen();
1632        }
1633        if (element.mozRequestFullScreen) {
1634            element.mozRequestFullScreen();
1635        }
1636    });
1637    controlCloseFullScreen.addEventListener('click', function () {
1638        controlFullScreen.classList.remove('hide');
1639        controlCloseFullScreen.classList.add('hide');
1640        if (document.exitFullscreen)
1641            document.exitFullscreen();
1642        else if (document.webkitExitFullscreen)
1643            document.webkitExitFullscreen();
1644        else if (document.mozCancelFullScreen)
1645            document.mozCancelFullScreen();
1646        else if (document.msExitFullscreen)
1647            document.msExitFullscreen();
1648    });
1649    controlMyLocation.addEventListener('click', function () {
1650        if (navigator.geolocation)
1651            navigator.geolocation.getCurrentPosition(function (pos) {
1652                var latlng = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
1653                map.setCenter(latlng);
1654                new google.maps.Marker({
1655                    position: latlng,
1656                    icon: mapEl.data().icon,
1657                    map: map
1658                });
1659            }, function (error) {
1660                console.log('Can not get your Location');
1661            });
1662    });
1663    controlZoomIn.addEventListener('click', function () {
1664        var current = map.getZoom();
1665        map.setZoom(current + 1);
1666    });
1667    controlZoomOut.addEventListener('click', function () {
1668        var current = map.getZoom();
1669        map.setZoom(current - 1);
1670    });
1671    controlStyles.addEventListener('click', function () {
1672        controlStyles.querySelector('.google-control-dropdown').classList.toggle('show');
1673    });
1674    var dropdownStyles = controlStyles.querySelector('.google-control-dropdown');
1675    var items = dropdownStyles.querySelectorAll('.item');
1676    for (var i = 0; i < items.length; i++) {
1677        items[i].addEventListener('click', function () {
1678            var style = this.textContent.toLowerCase();
1679            if (mapStyles[style]) {
1680                map.setOptions({
1681                    styles: mapStyles[style]
1682                });
1683            }
1684        });
1685    }
1686}
1687
1688jQuery(function ($) {
1689    document.querySelectorAll(".select-number-passenger  .st-number  .plus").forEach((input) => input.addEventListener("click", calculate_add));
1690    document.querySelectorAll(".select-number-passenger  .st-number  .minus").forEach((input) => input.addEventListener("click", calculate_minus));
1691
1692    function calculate_add() {
1693        var num_item = $(this).closest('.select-number-passenger');
1694        var num = num_item.find('.st-input-number').val();
1695        var max_val = num_item.find('.st-input-number').data('max');
1696        var value_num = parseInt(num) + 1;
1697        num_item.find('.st-input-number').val(value_num);
1698        num_item.find('strong.num').text(value_num);
1699
1700    }
1701
1702    function calculate_minus() {
1703        var num_item = $(this).closest('.select-number-passenger');
1704        var num = num_item.find('.st-input-number').val();
1705        var min_val = num_item.find('.st-input-number').data('min');
1706        if (parseInt(num) > min_val) {
1707            var value_num = parseInt(num) - 1;
1708            num_item.find('.st-input-number').val(value_num);
1709            num_item.find('strong.num').text(value_num);
1710        }
1711
1712    }
1713    $('.owl-tour-program').each(function () {
1714        var parent = $(this).parent();
1715        var owl = $(this);
1716        owl.owlCarousel({
1717            loop: false,
1718            items: 3,
1719            margin: 20,
1720            responsiveClass: true,
1721            dots: false,
1722            nav: false,
1723            responsive: {
1724                0: {
1725                    items: 1,
1726                    margin: 15,
1727                },
1728                992: {
1729                    items: 2,
1730                },
1731                1200: {
1732                    items: 3,
1733                }
1734            }
1735        });
1736        $('.next', parent).on('click', function (ev) {
1737            ev.preventDefault();
1738            owl.trigger('next.owl.carousel');
1739        });
1740        $('.prev', parent).on('click', function (ev) {
1741            ev.preventDefault();
1742            owl.trigger('prev.owl.carousel');
1743        });
1744        owl.on('resized.owl.carousel', function () {
1745            setTimeout(function () {
1746                if ($('.ovscroll').length) {
1747                    $.fn.getNiceScroll && $('.ovscroll').getNiceScroll().resize();
1748                }
1749            }, 1000);
1750        });
1751    });
1752    $('.owl-tour-program-7').each(function () {
1753        var parent = $(this).parent();
1754        var owl = $(this);
1755        owl.owlCarousel({
1756            loop: false,
1757            items: 1,
1758            margin: 0,
1759            responsiveClass: true,
1760            dots: false,
1761            nav: true,
1762            responsive: {
1763                0: {
1764                    items: 1,
1765                },
1766                992: {
1767                    items: 1,
1768                },
1769                1200: {
1770                    items: 1,
1771                }
1772            }
1773        });
1774        owl.on('resized.owl.carousel', function () {
1775            setTimeout(function () {
1776                if ($('.ovscroll').length) {
1777                    $.fn.getNiceScroll && $('.ovscroll').getNiceScroll().resize();
1778                }
1779            }, 1000);
1780        });
1781    });
1782     /*Slider Service single*/
1783     $('.st-list-tour--slide').each(function(){
1784        $(this).owlCarousel({
1785            loop: false,
1786            items: 3,
1787            margin: 30,
1788            responsiveClass: true,
1789            dots: false,
1790            nav: false,
1791            responsive: {
1792                0: {
1793                    items: 1,
1794                    margin: 15,
1795                    dots: true,
1796                },
1797                768: {
1798                    items: 2,
1799                    margin: 30,
1800                    dots:true,
1801                },
1802                992: {
1803                    items: 3,
1804                    margin: 30,
1805                    dots:false
1806                },
1807                1200: {
1808                    items: 3,
1809                }
1810            }
1811        });
1812   	});
1813
1814	function set_sticky() {
1815		var topSpacing = 0;
1816		if ($(window).width() > 481 && $('body').hasClass('admin-bar')) {
1817			topSpacing = $('#wpadminbar').height()
1818		}
1819		var sticky_header = $('.enable_sticky_header').length;
1820		if (sticky_header) {
1821			$('.header-sticky-menu').sticky({
1822				topSpacing: topSpacing,
1823				zIndex: 9999,
1824			});
1825			return
1826		}
1827		return
1828	}
1829
1830	set_sticky();
1831
1832  /*end*/
1833})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.