// source --> https://www.sierrasdelaventana.com.ar/wp-content/themes/superlist/assets/js/video-providers/youtube.js?ver=b94e7d1a7d744116feaa680fb235238c 
///**
// * Youtube banner video
// */
//
//function youtubeBannerVideo(videoUrl, playerId) {
//    var videoId = YouTubeGetID(videoUrl);
//
//    // 2. This code loads the IFrame Player API code asynchronously.
//    var tag = document.createElement('script');
//    tag.src = "https://www.youtube.com/iframe_api";
//    var firstScriptTag = document.getElementsByTagName('script')[0];
//    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
//
//    // 3. This function creates an <iframe> (and YouTube player)
//    //    after the API code downloads.
//    var player;
//
//    function onYouTubeIframeAPIReady() {
//        player = new YT.Player(playerId, {
//            height: '1400',
//            width: '2000',
//            videoId: videoId,
//            playerVars: {
//                'autoplay': 1,
//                'controls': 0,
//                'rel': 0,
//                'showinfo': 0
//            },
//            events: {
//                'onReady': onPlayerReady
//            }
//        });
//    }
//}
//
//// 4. The API will call this function when the video player is ready.
//function onPlayerReady(event) {
//    player.mute();
//    player.loadPlaylist(videoId);
//    player.setLoop(true);
//    event.target.playVideo();
//}
//
///**
// * Get YouTube ID from various YouTube URL
// * @author: takien
// * @url: http://takien.com
// * For PHP YouTube parser, go here http://takien.com/864
// */
//
//function YouTubeGetID(url){
//    var ID = '';
//    url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
//    if(url[2] !== undefined) {
//        ID = url[2].split(/[^0-9a-z_\-]/i);
//        ID = ID[0];
//    }
//    else {
//        ID = url;
//    }
//    return ID;
//};
// source --> https://www.sierrasdelaventana.com.ar/wp-content/themes/superlist/assets/js/superlist.js?ver=20170427 
jQuery(document).ready(function($) {
    'use strict';

    // iOS fix
    if(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
        document.querySelector('meta[name=viewport]').setAttribute(
            'content',
            'initial-scale=1.0001, minimum-scale=1.0001, maximum-scale=1.0001, user-scalable=no'
        );
    }
    

    /**
     * Action Bar
     */
    // Switch the body classes
    $('.action-bar-chapter a').on('click', function(e) {
       e.preventDefault();

       $(this).closest('ul').find('a').removeClass('active');
       $(this).closest('ul').find('a').each(function() {
           $('body').removeClass($(this).attr('data-action'));
       });
       $('body').addClass($(this).attr('data-action'));
       $(this).addClass('active');
    });

    // Change color combination
    $('.action-bar-chapter table a').on('click', function(e) {
        e.preventDefault();
        $(this).closest('table').find('a').removeClass('active');
        $(this).addClass('active');

        var uri = $(this).attr('href');
        $('#superlist-css').attr('href', uri);
    });

    // Hide/Show
    $('.action-bar-title').on('click', function(e) {
        $('.action-bar-content').toggleClass('open');
    });

    /**
     * Tabs
     */
    $('.listing-categories-tabs a').on('click', function(e) {
        e.preventDefault();
        $(this).tab('show');
    });

    /**
     * Share listing
     */
    $('.share-listing').on('click', function(e) {
        e.preventDefault();
        var modalInner = $(this).next('.modal-inner').clone();
        $('.modal-screen').addClass('open');
        $('.modal-main').html(modalInner);
    });

    /**
     * Modal
     */
    $('.modal-close').on('click', function() {
        $(this).closest('.modal-screen').removeClass('open');
        $('.modal-main').empty();
    });

    $('body').on('keyup', function(e) {
        if ($('.modal-screen').hasClass('open')) {
            if (e.keyCode == 27) {
                $('.modal-screen').removeClass('open');
                $('.modal-main').empty();
            }
        }
    });

    /**
     * Detail menu
     */
    var listingDetailMenu = $('.listing-detail-menu');

    if (listingDetailMenu.length) {
        $('.listing-detail-section').each(function() {
            var title = $('h2', $(this)).first().html();

            if (title === undefined) {
                title = $('h3', $(this)).first().html();
            }

            var id = $(this).attr('id');
            $('ul', listingDetailMenu).append('<li class="' + id  + '"><a href="#' + id + '">' + title + '</a></li>');
        });

        /**
         * Listing menu scroll
         */
        $('.listing-detail-menu a').click(function(e){
            e.preventDefault();

            var id = $(this).attr('href');

            $.scrollTo(id, 1200, {
                axis: 'y',
                offset: -160
            });
        });

        /**
         * Listing menu affix
         */
        if ($('.listing-detail-menu').length !== 0) {
            var height = $('.listing-detail-menu').offset().top;

            if ($('#wpadminbar').height() != null) {
                height -= $('#wpadminbar').height();
            }

            if ($('.header-sticky .header-wrapper').height() != null) {
                height -= 60;
            }

            $('.listing-detail-menu').affix({
                offset: {
                    top: height
                }
            });
        }

        /**
         * Scroll spy
         */
        $('body').scrollspy({
            target: '.listing-detail-menu',
            offset: 160
        });
    }


    /**
     * Detail Price
     */
    var listingDetailPrice = $('.detail-banner-right');

    if (listingDetailPrice.length) {
        var height = $('.detail-banner-right').offset().top;

        if ($('#wpadminbar').height() != null) {
            height -= $('#wpadminbar').height();
        }

        if ($('.header-sticky .header-wrapper').height() != null) {
            height -= 60;
        }

        var wWidth = $(window).width();
        if(wWidth > 767) {
            $('.detail-banner-right').affix({
                offset: {
                    top: height
                }
            });
        }
    }

    // Sticky header
    var isMobile = window.matchMedia("only screen and (max-width: 760px)");

    if (!isMobile.matches) {
        $('.header-sticky .header-wrapper').affix({
            offset: {
                top: 200
            }
        });
    }

    /**
     * Header Action
     */
    $('.header-action').on('click', function(e) {
        e.preventDefault();
        $('.header-post-types').toggleClass('open');
        $('.header-action').toggleClass('open');
    });

    /**
     * Bootstrap Select
     */
    $('select').each(function() {
        if (!$(this).parents('.cmb-repeatable-group').length) {
            $(this).selectpicker({
                noneSelectedText: $(this).data('empty-label'),
                template: {
                    caret: '<i class="fa fa-chevron-down"></i>'
                }
            });
        }
    });

    $('select').on('change', function () {
        if (!$(this).parents('.cmb-repeatable-group').length) {
            $(this).selectpicker('refresh');
        }
    });

    //$('select:not(.cmb2_select)').selectpicker({
    //    noneSelectedText: $(this).data('empty-label'), // does not work
    //    template: {
    //        caret: '<i class="fa fa-chevron-down"></i>'
    //    }
    //});

    /**
     * Background image
     */
    $('*[data-background-image]').each(function() {
        $(this).css({
            'background-image': 'url(' + $(this).data('background-image') + ')'
        });
    });

    /**
     * Bootstrap Tooltip
     */
    $('[data-toggle="tooltip"]').tooltip({
        trigger: 'hover'
    });

    /**
     * Simple map
     */
    var simple_map = $( '#simple-map' );
    if (simple_map.length) {
        var style = simple_map.data( 'styles' );

        simple_map.google_map({
            center: {
                latitude: simple_map.data( 'latitude' ),
                longitude: simple_map.data( 'longitude' )
            },
            zoom: simple_map.data( 'zoom' ),
            zoomControl: true,
            styles: style,
            transparentMarkerImage: simple_map.data( 'transparent-marker-image' ),
            marker: {
                height: 38,
                width: 24
            },
            markers: [{
                latitude: simple_map.data( 'latitude' ),
                longitude: simple_map.data( 'longitude' ),
                marker_content: '<div class="simple-marker"></div>'
            }]
        });
    }






    /**
     * Listing banner map
     */
    var banner_map = $( '#banner-map' );
    if (banner_map.length) {
        var mapType;
        var markerContent;
        var marker = false;
        var markers = [];

        switch(banner_map.data( 'map-type' )) {
            case 'ROADMAP':
                mapType = google.maps.MapTypeId.ROADMAP;
                markerContent = '<div class="simple-marker"></div>';
                break;
            case 'HYBRID':
                mapType = google.maps.MapTypeId.HYBRID;
                markerContent = '<div class="simple-marker-primary"></div>';
                break;
            case 'TERRAIN':
                mapType = google.maps.MapTypeId.TERRAIN;
                markerContent = '<div class="simple-marker-primary"></div>';
                break;
            default:
                mapType = google.maps.MapTypeId.SATELLITE;
                markerContent = '<div class="simple-marker-primary"></div>';
        }

        if (banner_map.data( 'marker' )) {
            marker = {
                height: 38,
                width: 24
            };

            markers = [{
                latitude: banner_map.data( 'latitude' ),
                longitude: banner_map.data( 'longitude' ),
                marker_content: markerContent
            }]
        }

        banner_map.google_map({
            center: {
                latitude: banner_map.data( 'latitude' ),
                longitude: banner_map.data( 'longitude' )
            },
            zoom: banner_map.data( 'zoom' ),
            zoomControl: true,
            rotateControl: false,
            mapTypeId: mapType,
            tilt: 45,
            transparentMarkerImage: banner_map.data( 'transparent-marker-image' ),
            marker: marker,
            markers: markers
        });
    }

    /**
     * Listing Banner Detail Street View
     */
    streetViewInit('banner-street-view');
    streetViewInit('banner-inside-view');

    function streetViewInit(banner_street_view_id) {
        var banner_street_view = $('#' + banner_street_view_id);

        if (banner_street_view.length) {
            new google.maps.StreetViewPanorama(document.getElementById(banner_street_view_id), {
                    position: {
                        lat: banner_street_view.data( 'latitude' ),
                        lng: banner_street_view.data( 'longitude' )
                    },
                    pov: {
                        heading: banner_street_view.data( 'heading' ),
                        pitch: banner_street_view.data( 'pitch' )
                    },
                    zoom: banner_street_view.data( 'zoom' ),
                    linksControl: false,
                    panControl: false,
                    scrollwheel: false,
                    addressControl: false,
                    visible: true
                }
            );
        }
      
    }
    
    


    /**
     * Detail gallery
     */
    var listingGallery = $('.listing-detail-gallery');
    var listingGalleryPreview = $('.listing-detail-gallery-preview-inner');
    var listingGalleryPreviewCount = listingGalleryPreview.data('count');
    var listingGalleryPreviewItems = 7;

    if (listingGallery.length != 0) {
        var loop = true;

        if (listingGallery.length === 1) {
            loop = false;
        }

        listingGallery.owlCarousel({
            items: 1,
            loop: loop,
            autoHeight: true,
            autoplay: true,
            autoplayTimeout:5000,
            smartSpeed: 700,
            navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>']
        });
    }

    if (listingGalleryPreview.length != 0) {
        listingGalleryPreview.owlCarousel({
            items: listingGalleryPreviewItems,
            nav: (listingGalleryPreviewCount > listingGalleryPreviewItems),
            navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>']
        });
    }

    $('.listing-detail-gallery-preview-inner .owl-item:first').addClass('highlighted');

    listingGallery.on('changed.owl.carousel', function(event) {
        var currentIndex = event.item.index - 0; // bug because of "loop: true";
        var firstActiveIndex = $('.listing-detail-gallery-preview-inner .owl-item.active:first').children().data('item-id');
        var lastActiveIndex = $('.listing-detail-gallery-preview-inner .owl-item.active:last').children().data('item-id');

        if ( currentIndex == event.item.count ) {
            currentIndex = 0;
        }

        // Highlight current item
        $('.listing-detail-gallery-preview-inner .owl-item.highlighted').removeClass('highlighted');
        $('.listing-detail-gallery-preview-inner .owl-item:eq(' + currentIndex + ')').addClass('highlighted');

        // Move preview if it is necessary
        if (firstActiveIndex >= currentIndex) {
            for (var i = 0; i <= ( firstActiveIndex - currentIndex ); i++) {
                listingGalleryPreview.trigger('prev.owl.carousel');
            }
        } else if (lastActiveIndex <= currentIndex) {
            for (var i = 0; i <= ( currentIndex - lastActiveIndex ); i++) {
                listingGalleryPreview.trigger('next.owl.carousel');
            }
        }
    });

    // Show in gallery image from preview
    $('.listing-detail-gallery-preview-inner .owl-item').click(function(){
        var itemIndex = $(this).children().data('item-id');
        listingGallery.trigger('to.owl.carousel', [itemIndex, 300]);
    });

    $('.listing-detail-gallery').on('click', function() {
        listingGallery.trigger('stop.owl.autoplay');
    });

    /**
     * Colorbox
     */
    $('.listing-detail-gallery a').colorbox({
        ref: 'listing-gallery',
        maxHeight: '90%',
        maxWidth: '85%'
    });

    /**
     * Listing Detail Bookmark & Like
     */
    $(".detail-banner-btn.bookmark").click(function(){
        $(this).toggleClass("marked");

        var span = $(this).children("span");
        var toggleText = span.data("toggle");
        span.data("toggle", span.text());
        span.text(toggleText);
    });

    /**
     * Social Login
     */
    var title;
    $('.wp-social-login-provider').each(function(){
        title = $(this).attr('title');
        $(this).text(title);
    });

    /**
     * Responsive menu
     */
    function responsiveMenu() {
        var parent_menu = $('.header-nav-primary .menu-item-has-children');

        parent_menu.on('hover', function(e) {
            e.preventDefault();
        });

        parent_menu.on('click', function(e) {
            if (!$(this).hasClass('touched')) {
                e.preventDefault();
                $(this).closest('ul').find('> li').removeClass('touched');
                $(this).toggleClass('touched');
            }
        })
    }

    $(window).resize(function() {
        if ($(window).width() < 768) {
            responsiveMenu();
        }
    });

    if ($(window).width() < 768) {
        responsiveMenu();
    }

    /**
     * Masonry blog
     */
    if ( $('.content .post-masonry').length > 0 ) {
        $('.content').masonry({
            itemSelector: '.post-masonry'
        });
    }
});
// source --> https://www.sierrasdelaventana.com.ar/wp-content/plugins/inventor/libraries/cmb_field_map/js/script.js?ver=b94e7d1a7d744116feaa680fb235238c 
jQuery(document).ready(function($) {
	'use strict';

	var maps = [];

	$( '.cmb-type-pw-map' ).each( function() {
        initializeMap( $( this ) );
	});

	function initializeMap( mapInstance ) {
		var searchInput = mapInstance.find( '.pw-map-search' );
		var mapCanvas = mapInstance.find( '.pw-map' );
		var latitude = mapInstance.find( '.pw-map-latitude' );
		var longitude = mapInstance.find( '.pw-map-longitude' );
		var latLng = new google.maps.LatLng( 0, 0 );
		var zoom = 1;

		// If we have saved values, let's set the position and zoom level
		if ( latitude.val().length > 0 && longitude.val().length > 0 ) {
			latLng = new google.maps.LatLng( latitude.val(), longitude.val() );
			zoom = 17;
		}

		// Map
		var mapOptions = {
			center: latLng,
			zoom: zoom
		};
		var map = new google.maps.Map( mapCanvas[0], mapOptions );

		latitude.on('change', function() {
			map.setCenter( new google.maps.LatLng( latitude.val(), longitude.val() ) );
		});

		longitude.on('change', function() {
			map.setCenter( new google.maps.LatLng( latitude.val(), longitude.val() ) );
		});

		// Marker
		var markerOptions = {
			map: map,
			draggable: true,
			title: 'Drag to set the exact location'
		};
		var marker = new google.maps.Marker( markerOptions );

		if ( latitude.val().length > 0 && longitude.val().length > 0 ) {
			marker.setPosition( latLng );
		}

		// Search
		var autocomplete = new google.maps.places.Autocomplete( searchInput[0] );
		autocomplete.bindTo( 'bounds', map );

		google.maps.event.addListener( autocomplete, 'place_changed', function() {
			var place = autocomplete.getPlace();
			if ( ! place.geometry ) {
				return;
			}

			if ( place.geometry.viewport ) {
				map.fitBounds( place.geometry.viewport );
			} else {
				map.setCenter( place.geometry.location );
				map.setZoom( 17 );
			}

			marker.setPosition( place.geometry.location );

			latitude.val( place.geometry.location.lat() );
			longitude.val( place.geometry.location.lng() );
		});

		$( searchInput ).keypress( function( event ) {
			if ( 13 === event.keyCode ) {
				event.preventDefault();
			}
		});

		// Allow marker to be repositioned
		google.maps.event.addListener( marker, 'drag', function() {
			latitude.val( marker.getPosition().lat() );
			longitude.val( marker.getPosition().lng() );
		});

		maps.push( map );
	}

	// Resize map when meta box is opened
	if ( typeof postboxes !== 'undefined' ) {
		postboxes.pbshow = function () {
			var arrayLength = maps.length;
			for (var i = 0; i < arrayLength; i++) {
				var mapCenter = maps[i].getCenter();
				google.maps.event.trigger( maps[i], 'resize' );
				maps[i].setCenter( mapCenter );
			}
		};
	}

	// When a new row is added, reinitialize Google Maps
	$( '.cmb-repeatable-group' ).on( 'cmb2_add_row', function( event, newRow ) {
		var groupWrap = $( newRow ).closest( '.cmb-repeatable-group' );
		groupWrap.find( '.cmb-type-pw-map' ).each( function() {
			initializeMap( $( this ) );
		});
	});

});
// source --> https://www.sierrasdelaventana.com.ar/wp-content/plugins/inventor/libraries/cmb_field_street_view/js/script.js?ver=b94e7d1a7d744116feaa680fb235238c 
jQuery(document).ready(function($) {

    $.fn.streetView = function() {
        initializeStreetView(this);
    };

	function initializeStreetView( cmbStreetView ) {
        var streetViewElement = $('body');

        // Input elements
        var latitudeElem = cmbStreetView.find('.street-view-latitude');
        var longitudeElem = cmbStreetView.find('.street-view-longitude');
        var zoomElem = cmbStreetView.find('.street-view-zoom');
        var headingElem = cmbStreetView.find('.street-view-heading');
        var pitchElem = cmbStreetView.find('.street-view-pitch');
        var searchElem = cmbStreetView.find( '.street-view-search' );

        var linksControl = (cmbStreetView.hasClass('cmb2-id-listing-inside-view-location')) ? false : true;

        var latitude = 37.812405;
        var longitude = -122.476078;
        var zoom = 1;
        var heading = -18;
        var pitch = 25;
        var pov;

        if ( latitudeElem.length > 0 && longitudeElem.length > 0 && zoomElem.length > 0 && headingElem.length > 0 && pitchElem.length > 0 ) {

            if ( latitudeElem.val().length > 0 && longitudeElem.val().length > 0 && zoomElem.val().length > 0 && headingElem.val().length > 0 && pitchElem.val().length > 0 ) {
                // If we have saved values
                latitude = latitudeElem.val();
                longitude = longitudeElem.val();
                zoom = Math.round(zoomElem.val()*1000)/1000;
                heading = Math.round(headingElem.val()*1000)/1000;
                pitch = Math.round(pitchElem.val()*1000)/1000;
            } else {
                // Default values
                latitudeElem.val(latitude);
                longitudeElem.val(longitude);
                zoomElem.val(zoom);
                headingElem.val(heading);
                pitchElem.val(pitch);
            }

            // Map init
            var map = new google.maps.Map(cmbStreetView.find('#street-view-map')[0], {
                center: new google.maps.LatLng( latitude, longitude ),
                zoom: 11
            });

            // Street View init
            var streetView = new google.maps.StreetViewPanorama(
                cmbStreetView.find('#street-view')[0], {
                    position: new google.maps.LatLng( latitude, longitude ),
                    zoom: zoom,
                    linksControl: linksControl,
                    pov: {
                        heading: heading,
                        pitch: pitch
                    }
                });
            map.setStreetView(streetView);

            // Insert changes into inputs
            streetViewElement.on('mousemove', function(){
                latitudeElem.val(streetView.getPosition().lat());
                longitudeElem.val(streetView.getPosition().lng());
                zoomElem.val(streetView.getZoom());

                pov = streetView.getPov();
                headingElem.val(pov.heading);
                pitchElem.val(pov.pitch);
            });

            // Search
            var autocomplete = new google.maps.places.Autocomplete( searchElem[0] );
            autocomplete.bindTo( 'bounds', map );

            google.maps.event.addListener( autocomplete, 'place_changed', function() {
                var place = autocomplete.getPlace();
                if ( ! place.geometry ) {
                    return;
                }

                if ( place.geometry.viewport ) {
                    map.fitBounds( place.geometry.viewport );
                } else {
                    map.setCenter( place.geometry.location );
                    map.setZoom( 17 );
                }

                streetView.setPosition( new google.maps.LatLng( place.geometry.location.lat(), place.geometry.location.lng()));

                map.setStreetView(streetView);

                latitudeElem.val( place.geometry.location.lat() );
                longitudeElem.val( place.geometry.location.lng() );
            });

            $( searchElem ).keypress( function( event ) {
                if ( 13 === event.keyCode ) {
                    event.preventDefault();
                }
            });
        }
	}

});
// source --> https://www.sierrasdelaventana.com.ar/wp-content/plugins/inventor/libraries/js.cookie.js?ver=b94e7d1a7d744116feaa680fb235238c 
/*!
 * JavaScript Cookie v2.1.1
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
;(function (factory) {
	if (typeof define === 'function' && define.amd) {
		define(factory);
	} else if (typeof exports === 'object') {
		module.exports = factory();
	} else {
		var OldCookies = window.Cookies;
		var api = window.Cookies = factory();
		api.noConflict = function () {
			window.Cookies = OldCookies;
			return api;
		};
	}
}(function () {
	function extend () {
		var i = 0;
		var result = {};
		for (; i < arguments.length; i++) {
			var attributes = arguments[ i ];
			for (var key in attributes) {
				result[key] = attributes[key];
			}
		}
		return result;
	}

	function init (converter) {
		function api (key, value, attributes) {
			var result;
			if (typeof document === 'undefined') {
				return;
			}

			// Write

			if (arguments.length > 1) {
				attributes = extend({
					path: '/'
				}, api.defaults, attributes);

				if (typeof attributes.expires === 'number') {
					var expires = new Date();
					expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
					attributes.expires = expires;
				}

				try {
					result = JSON.stringify(value);
					if (/^[\{\[]/.test(result)) {
						value = result;
					}
				} catch (e) {}

				if (!converter.write) {
					value = encodeURIComponent(String(value))
						.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
				} else {
					value = converter.write(value, key);
				}

				key = encodeURIComponent(String(key));
				key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
				key = key.replace(/[\(\)]/g, escape);

				return (document.cookie = [
					key, '=', value,
					attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
					attributes.path    && '; path=' + attributes.path,
					attributes.domain  && '; domain=' + attributes.domain,
					attributes.secure ? '; secure' : ''
				].join(''));
			}

			// Read

			if (!key) {
				result = {};
			}

			// To prevent the for loop in the first place assign an empty array
			// in case there are no cookies at all. Also prevents odd result when
			// calling "get()"
			var cookies = document.cookie ? document.cookie.split('; ') : [];
			var rdecode = /(%[0-9A-Z]{2})+/g;
			var i = 0;

			for (; i < cookies.length; i++) {
				var parts = cookies[i].split('=');
				var name = parts[0].replace(rdecode, decodeURIComponent);
				var cookie = parts.slice(1).join('=');

				if (cookie.charAt(0) === '"') {
					cookie = cookie.slice(1, -1);
				}

				try {
					cookie = converter.read ?
						converter.read(cookie, name) : converter(cookie, name) ||
						cookie.replace(rdecode, decodeURIComponent);

					if (this.json) {
						try {
							cookie = JSON.parse(cookie);
						} catch (e) {}
					}

					if (key === name) {
						result = cookie;
						break;
					}

					if (!key) {
						result[name] = cookie;
					}
				} catch (e) {}
			}

			return result;
		}

		api.set = api;
		api.get = function (key) {
			return api(key);
		};
		api.getJSON = function () {
			return api.apply({
				json: true
			}, [].slice.call(arguments));
		};
		api.defaults = {};

		api.remove = function (key, attributes) {
			api(key, '', extend(attributes, {
				expires: -1
			}));
		};

		api.withConverter = init;

		return api;
	}

	return init(function () {});
}));
// source --> https://www.sierrasdelaventana.com.ar/wp-content/plugins/inventor/libraries/jquery.chained.remote.custom.min.js?ver=b94e7d1a7d744116feaa680fb235238c 
!function(a){"use strict";a.fn.remoteChained=function(b){var c=a.extend({},a.fn.remoteChained.defaults,b);return c.loading&&(c.clear=!0),this.each(function(){function b(b){var c=a(":selected",d).val();a("option",d).remove();var e=[];if(a.isArray(b))e=a.isArray(b[0])?b:a.map(b,function(b){return a.map(b,function(a,b){return[[b,a]]})});else for(var f in b)b.hasOwnProperty(f)&&e.push([f,b[f]]);for(var g=0;g!==e.length;g++){var h=e[g][0],i=e[g][1];if("selected"!==h){var j=a("<option />").val(h).append(i);a(d).append(j)}else c=i}a(d).children().each(function(){a(this).val()===c+""&&a(this).attr("selected","selected")}),1===a("option",d).size()&&""===a(d).val()?a(d).prop("disabled",!0):a(d).prop("disabled",!1)}var d=this,e=!1;a(c.parents).each(function(){a(this).bind("change",function(){var f={};a(c.parents).each(function(){var b=a(this).attr(c.attribute),e=(a(this).is("select")?a(":selected",this):a(this)).val();f[b]=e,c.depends&&a(c.depends).each(function(){if(d!==this){var b=a(this).attr(c.attribute),e=a(this).val();f[b]=e}}),f=a.extend(f,c.extra)}),e&&a.isFunction(e.abort)&&(e.abort(),e=!1),c.clear&&(c.loading?b.call(d,{"":c.loading}):a("option",d).remove(),a(d).trigger("change")),e=a.getJSON(c.url,f,function(c){b.call(d,c),a(d).trigger("change")})}),c.bootstrap&&(b.call(d,c.bootstrap),c.bootstrap=null),a(this).trigger("change")})})},a.fn.remoteChainedTo=a.fn.remoteChained,a.fn.remoteChained.defaults={attribute:"name",depends:null,bootstrap:null,loading:null,clear:!1}}(window.jQuery||window.Zepto,window,document);