// source --> https://herbalneurocare.it/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=10.7.0 
function on_keydown_remove_from_cart(e){" "===e.key&&(e.preventDefault(),e.currentTarget.click())}function focus_populate_live_region(){var e=["woocommerce-message","woocommerce-error","wc-block-components-notice-banner"].map(function(e){return"."+e+'[role="alert"]'}).join(", "),o=document.querySelectorAll(e);if(0!==o.length){var t=o[0];t.setAttribute("tabindex","-1");var n=setTimeout(function(){t.focus(),clearTimeout(n)},500)}}function refresh_sorted_by_live_region(){var e=document.querySelector(".woocommerce-result-count");if(e){var o=e.innerHTML;e.setAttribute("aria-hidden","true");var t=setTimeout(function(){e.setAttribute("aria-hidden","false"),e.innerHTML="",e.innerHTML=o,clearTimeout(t)},2e3)}}function on_document_ready(){focus_populate_live_region(),refresh_sorted_by_live_region()}jQuery(function(e){e(".woocommerce-ordering").on("change","select.orderby",function(){e(this).closest("form").trigger("submit")}),e("input.qty:not(.product-quantity input.qty)").each(function(){var o=parseFloat(e(this).attr("min"));o>=0&&parseFloat(e(this).val())<o&&e(this).val(o)});var o="store_notice"+(e(".woocommerce-store-notice").data("noticeId")||"");if("hidden"===Cookies.get(o))e(".woocommerce-store-notice").hide();else{function t(o){["Enter"," "].includes(o.key)&&(o.preventDefault(),e(".woocommerce-store-notice__dismiss-link").click())}e(".woocommerce-store-notice").show(),e(".woocommerce-store-notice__dismiss-link").on("click",function n(r){Cookies.set(o,"hidden",{path:"/"}),e(".woocommerce-store-notice").hide(),r.preventDefault(),e(".woocommerce-store-notice__dismiss-link").off("click",n).off("keydown",t)}).on("keydown",t)}e(".woocommerce-input-wrapper span.description").length&&e(document.body).on("click",function(){e(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),e(".woocommerce-input-wrapper").on("click",function(e){e.stopPropagation()}),e(".woocommerce-input-wrapper :input").on("keydown",function(o){var t=e(this).parent().find("span.description");if(27===o.which&&t.length&&t.is(":visible"))return t.prop("aria-hidden",!0).slideUp(250),o.preventDefault(),!1}).on("click focus",function(){var o=e(this).parent(),t=o.find("span.description");o.addClass("currentTarget"),e(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),t.length&&t.is(":hidden")&&t.prop("aria-hidden",!1).slideDown(250),o.removeClass("currentTarget")}),e.scroll_to_notices=function(o){o.length&&e("html, body").animate({scrollTop:o.offset().top-100},1e3)},e('.woocommerce form .woocommerce-Input[type="password"]').wrap('<span class="password-input"></span>'),e(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),e(".password-input").each(function(){const o=e(this).find("input").attr("id");e(this).append('<button type="button" class="show-password-input" aria-label="'+woocommerce_params.i18n_password_show+'" aria-describedBy="'+o+'"></button>')}),e(".show-password-input").on("click",function(o){o.preventDefault(),e(this).hasClass("display-password")?(e(this).removeClass("display-password"),e(this).attr("aria-label",woocommerce_params.i18n_password_show)):(e(this).addClass("display-password"),e(this).attr("aria-label",woocommerce_params.i18n_password_hide)),e(this).hasClass("display-password")?e(this).siblings(['input[type="password"]']).prop("type","text"):e(this).siblings('input[type="text"]').prop("type","password"),e(this).siblings("input").focus()}),e("a.coming-soon-footer-banner-dismiss").on("click",function(o){var t=e(o.target);e.ajax({type:"post",url:t.data("rest-url"),data:{woocommerce_meta:{coming_soon_banner_dismissed:"yes"}},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.data("rest-nonce"))},complete:function(){e("#coming-soon-footer-banner").hide()}})}),"undefined"==typeof wc_add_to_cart_params&&e(document.body).on("keydown",".remove_from_cart_button",on_keydown_remove_from_cart),e(document.body).on("item_removed_from_classic_cart updated_wc_div",focus_populate_live_region)}),document.addEventListener("DOMContentLoaded",on_document_ready);
// source --> https://herbalneurocare.it/wp-content/plugins/js_composer/assets/js/vendors/woocommerce-add-to-cart.js?ver=8.6.1 
( function ( $ ) {
	'use strict';

	$( document ).ready( function () {
		$( 'body' ).on( 'adding_to_cart', function ( event, $button ) {
			if ( $button && $button.hasClass( 'vc_gitem-link' ) ) {
				$button
					.addClass( 'vc-gitem-add-to-cart-loading-btn' )
					.parents( '.vc_grid-item-mini' )
					.addClass( 'vc-woocommerce-add-to-cart-loading' )
					.append( $( '<div class="vc_wc-load-add-to-loader-wrapper"><div class="vc_wc-load-add-to-loader"></div></div>' ) );
			}
		}).on( 'added_to_cart', function ( event, fragments, cart_hash, $button ) {
			if ( 'undefined' === typeof ( $button ) ) {
				$button = $( '.vc-gitem-add-to-cart-loading-btn' );
			}
			if ( $button && $button.hasClass( 'vc_gitem-link' ) ) {
				$button
					.removeClass( 'vc-gitem-add-to-cart-loading-btn' )
					.parents( '.vc_grid-item-mini' )
					.removeClass( 'vc-woocommerce-add-to-cart-loading' )
					.find( '.vc_wc-load-add-to-loader-wrapper' ).remove();
			}
		});
	});
})( window.jQuery );
// source --> https://herbalneurocare.it/wp-content/themes/clinika-child/assets/javascript/kn-iubenda.js?ver=1.0.1 
if ( typeof _iub !== 'undefined' ) {
	var _iub = _iub || [];
	window.googleConsentModeV2 = true;
	if ( typeof _iub.csConfiguration !== 'undefined' ) {
		_iub.csConfiguration.callback = {
			"onReady": function() {},
			"onBeforePreload": function() {
				/*//console.log( 'onBeforePreload' );

				// Initialize the data layer for Google Tag Manager (this should mandatorily be done before the Cookie Solution is loaded)
				window.dataLayer = window.dataLayer || [];
				function gtag(){dataLayer.push(arguments);}

				// Default consent mode is "denied" for both ads and analytics, but delay for 2 seconds until the Cookie Solution is loaded
				gtag( 'consent', 'default', {
					ad_personalization: 'denied',
					ad_storage: 'denied',//old default value
					ad_user_data: 'denied',
					analytics_storage: 'denied',//old default value
					functionality_storage: 'denied',
					personalization_storage: 'denied',
					security_storage: 'denied',
					//wait_for_update: 2000// milliseconds
				});

				// Improve ad click measurement quality (optional)
				gtag( 'set', 'url_passthrough', true );
				// Further redact your ads data (optional)
				gtag( 'set', 'ads_data_redaction', true );*/
			},
			"onPreferenceExpressedOrNotNeeded": function( preference ) {
			//"onPreferenceExpressed": function( preference ) {
				/*//console.log('onPreferenceExpressed', preference);
				var lista_consensi_utente = preference.purposes;
				//console.log( lista_consensi_utente );
				//console.log( lista_consensi_utente[1] );
				//console.log( Object.values( lista_consensi_utente ) );

				//var listPreferences = [];//listPreferences = new Array();
				var listPreferences = {};//listPreferences = new Object();

				for ( var key in lista_consensi_utente ) {
					var value = lista_consensi_utente[key];
					//console.log( 'Chiave: ' + key );

					switch ( parseInt( key ) ) {
						case 1:
							//Tecnici | Strettamente necessari
							//console.log( 'Valore cookie Tecnici: ' + value );
							break;
						case 2:
							//Interazioni e funzionalità semplici
							//console.log( 'Valore cookie Interazioni: ' + value );
							if ( value == true ) {
								listPreferences.functionality_storage = 'granted';
								listPreferences.security_storage = 'granted';
							} else {
								listPreferences.functionality_storage = 'denied';
								listPreferences.security_storage = 'denied';
							}
							break;
						case 3:
							//Miglioramento dell’esperienza
							//console.log( 'Valore cookie Miglioramento esperienza: ' + value );
							if ( value == true ) {
								listPreferences.personalization_storage = 'granted';
							} else {
								listPreferences.personalization_storage = 'denied';
							}
							break;
						case 4:
							//Misurazione
							//console.log( 'Valore cookie Misurazione: ' + value );
							if ( value == true ) {
								listPreferences.analytics_storage = 'granted';
							} else {
								listPreferences.analytics_storage = 'denied';
							}
							break;
						case 5:
							//Targeting e pubblicità
							//Profilazione
							if ( value == true ) {
								listPreferences.ad_storage = 'granted';
								listPreferences.ad_user_data = 'granted'
								listPreferences.ad_personalization = 'granted';
							} else {
								listPreferences.ad_storage = 'denied';
								listPreferences.ad_user_data = 'denied'
								listPreferences.ad_personalization = 'denied';
							}
							break;
					}
				}

				//Sovrascrive i valori precedentemente definiti (anche quelli di Iubenda)
				if ( Object.keys(listPreferences).length > 0 && listPreferences.constructor === Object ) {
					gtag( 'consent', 'update', listPreferences );
				}*/
			},
			//"onBannerClosed": function() {
			"on2ndLayerClosed": function() {
				var iframe = window.document.querySelector( 'iframe' );
				setTimeout( function() {
					//iframe.focus();
					window.focus();
				}, 100 );
			},
		};
	}
};