// source --> https://giftbag.bg/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=8.3.1 
jQuery(function(o){o(".woocommerce-ordering").on("change","select.orderby",function(){o(this).closest("form").trigger("submit")}),o("input.qty:not(.product-quantity input.qty)").each(function(){var e=parseFloat(o(this).attr("min"));e>=0&&parseFloat(o(this).val())<e&&o(this).val(e)});var e="store_notice"+(o(".woocommerce-store-notice").data("noticeId")||"");"hidden"===Cookies.get(e)?o(".woocommerce-store-notice").hide():o(".woocommerce-store-notice").show(),o(".woocommerce-store-notice__dismiss-link").on("click",function(s){Cookies.set(e,"hidden",{path:"/"}),o(".woocommerce-store-notice").hide(),s.preventDefault()}),o(".woocommerce-input-wrapper span.description").length&&o(document.body).on("click",function(){o(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),o(".woocommerce-input-wrapper").on("click",function(o){o.stopPropagation()}),o(".woocommerce-input-wrapper :input").on("keydown",function(e){var s=o(this).parent().find("span.description");if(27===e.which&&s.length&&s.is(":visible"))return s.prop("aria-hidden",!0).slideUp(250),e.preventDefault(),!1}).on("click focus",function(){var e=o(this).parent(),s=e.find("span.description");e.addClass("currentTarget"),o(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),s.length&&s.is(":hidden")&&s.prop("aria-hidden",!1).slideDown(250),e.removeClass("currentTarget")}),o.scroll_to_notices=function(e){e.length&&o("html, body").animate({scrollTop:e.offset().top-100},1e3)},o('.woocommerce form .woocommerce-Input[type="password"]').wrap('<span class="password-input"></span>'),o(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),o(".password-input").append('<span class="show-password-input"></span>'),o(".show-password-input").on("click",function(){o(this).hasClass("display-password")?o(this).removeClass("display-password"):o(this).addClass("display-password"),o(this).hasClass("display-password")?o(this).siblings(['input[type="password"]']).prop("type","text"):o(this).siblings('input[type="text"]').prop("type","password")})});
// source --> https://giftbag.bg/wp-content/themes/santagift_child/custom.min.js?ver=143fb2b8f5d98f82feb246ecc61db33d 
//product tab
jQuery( document ).ready( function() {

	// double new product slider
	jQuery( '.products_block.woonew' ).each( function( i ) {
		const current_new = wde( '.woonew .woo-carousel' ).find( 'ul.products li' ).length;
		if ( current_new > 7 ) {
			const x = wde( '.woonew .woo-carousel ul.products' ).children();
			for ( i = 0; i < x.length + 1; i += 2 ) {
				x.slice( i, i + 2 ).wrapAll( '<div class="' + i + '"></div>' );
			}
		}
		jQuery( '.woonew .woo-carousel' ).each( function() {
			if ( wde( this ).attr( 'id' ) ) {
				const e = wde( this ).attr( 'id' ).replace( '_woo_carousel', '' );
				const t = wde( this ).find( 'ul.products .product' ).length;
				if ( t > e ) {
					wde( this ).find( 'ul.products' ).addClass( 'owl-carousel' );
					wde( this ).find( 'ul.products' ).owlCarousel( {
						loop: false,
						nav: true,
						dots: false,
						items: e,
						responsive: {
							320: {
								items: 2,
							},
							541: {
								items: 3,
							},
							768: {
								items: 3,
							},
							1025: {
								items: 4,
							},
							1367: {
								items: e,
							},
						},
					} );
				}
			}
		} );
	});
	
});