// source --> https://baeckerei-pichler.de/wp-content/plugins/woocommerce-german-market/js/WooCommerce-German-Market-Frontend.min.js?ver=3.56.1 
var gm_hide_ship_to_different_address=!1;jQuery(document).ready(function(e){var t={init:function(){this.remove_totals(),this.register_payment_update(),this.on_update_variation(),this.sepa_direct_debit(),this.sepa_direct_debit_checkout_form_handle(),this.second_checkout_place_order(),this.deactivate_ship_to_different_adress(),this.deactivate_ship_to_different_address_purchase_on_account(),this.shipping_service_provider(),this.product_review_info()},product_review_info:function(){"on"===german_market_legal_info_product_reviews.activated&&e(german_market_legal_info_product_reviews.element).length&&jQuery.post(sepa_ajax_object.ajax_url,{action:"product_review_info"},function(t){e(t).insertBefore(german_market_legal_info_product_reviews.element)}),e(".german-market-legal-information-for-product-reviews.short-after-star-rating").click(function(a){a.preventDefault(),t.product_review_info_handler(e(this))}),e(".german-market-legal-information-for-product-reviews.short-after-star-rating").on("keydown",function(a){("Enter"===a.key||" "===a.key)&&(a.preventDefault(),t.product_review_info_handler(e(this)))}),e(document).mouseup(function(t){var a=e(".german-market-legal-information-for-product-reviews.short-after-star-rating");a.is(t.target)||0!==a.has(t.target).length||(e(".german-market-legal-information-for-product-reviews.short-after-star-rating .full-text").hide(),e(".german-market-legal-information-for-product-reviews.short-after-star-rating .full-text").attr("aria-hidden",!0).attr("aria-expanded",!1))})},product_review_info_handler:function(t){var a=e(t).find(".full-text");e(a).is(":visible")?(e(a).hide(),e(a).attr("aria-hidden",!0).attr("aria-expanded",!1)):(e(a).show(),e(a).attr("aria-hidden",!1).attr("aria-expanded",!0))},sepa_direct_debit_checkout_form_handle:function(){e("#german_market_sepa_use_payment_information").length&&(e(".german-market-sepa-radio-wrapper input.radio-button").length?(e("body").on("change",".german-market-sepa-radio-wrapper input.radio-button",function(){t.sepa_direct_debit_checkout_form_handler(this)}),t.sepa_direct_debit_checkout_form_handler(e(".german-market-sepa-radio-wrapper input.radio-button"))):e(".german-market-sepa-save-payment-information-checkbox").show())},sepa_direct_debit_checkout_form_handler:function(t){e(".german-market-sepa-radio-wrapper label span").css({"font-weight":"bold","margin-left":"calc( 18px + 1em )","margin-bottom":"1em",display:"inline-block"}),!0===e(t).prop("checked")&&("saved"==e(t).val()?(e(t).parents("fieldset").find(".form-row").hide(),e(".german-market-sepa-save-payment-information-checkbox").hide(),e(".gm-sepa-direct-debit-second-checkout-disabled").show()):(e(t).parents("fieldset").find(".form-row").show(),e(".german-market-sepa-save-payment-information-checkbox").show(),e(".gm-sepa-direct-debit-second-checkout-disabled").hide()),e("#gm-sepa-mandate-preview-text").slideUp())},deactivate_ship_to_different_adress(){e("body").on("update_checkout",function(){gm_hide_ship_to_different_address=!1,e("body").trigger("gm_hide_ship_to_different_address"),gm_hide_ship_to_different_address?(e("#ship-to-different-address-checkbox").prop("checked",!1),e(".shipping_address").length&&e(".shipping_address").hide(),e(".woocommerce-shipping-fields").length&&e(".woocommerce-shipping-fields").hide()):e(".woocommerce-shipping-fields").length&&e(".woocommerce-shipping-fields").show()})},deactivate_ship_to_different_address_purchase_on_account:function(){e("body").on("gm_hide_ship_to_different_address",function(){e("#deactivate_ship_to_different_address_if_purchase_on_account").length&&e("#payment_method_german_market_purchase_on_account").length&&(e("#payment_method_german_market_purchase_on_account").prop("checked")?"1"!=e("#deactivate_ship_to_different_address_if_purchase_on_account").val()&&"yes"!=e("#deactivate_ship_to_different_address_if_purchase_on_account").val()||(e("#ship-to-different-address-checkbox").length&&!0===e("#ship-to-different-address-checkbox").prop("checked")&&e(ship_different_address.before_element).length&&(e("#german-market-puchase-on-account-message").length||e(ship_different_address.before_element).before(ship_different_address.message),e("#german-market-puchase-on-account-message").show()),gm_hide_ship_to_different_address||(gm_hide_ship_to_different_address=!0)):e("#german-market-puchase-on-account-message").length&&e("#german-market-puchase-on-account-message").hide())})},second_checkout_place_order:function(){e(":submit.wgm-place-order").click(function(){e(".wgm-place-order-disabled").length&&e(".wgm-place-order-disabled").show()})},setupAjax:function(){"undefined"!=typeof wgm_wpml_ajax_language&&e.ajaxSetup({data:{lang:wgm_wpml_ajax_language}})},remove_totals:function(){1==woocommerce_remove_updated_totals.val&&e(".woocommerce_message").remove()},register_payment_update:function(){1==woocommerce_payment_update.val&&e(document.body).on("change",'input[name="payment_method"]',function(){e("body").trigger("update_checkout")})},on_update_variation:function(){if("gm_default"==german_market_price_variable_products.val){var t=e(".single-product"),a=e(".legacy-itemprop-offers");t.on("show_variation",".variations_form",function(){a.slideUp(),"none"!=german_market_price_variable_theme_extra_element.val&&jQuery(german_market_price_variable_theme_extra_element.val).slideUp()}),t.on("reset_data",".variations_form",function(){a.slideDown(),"none"!=german_market_price_variable_theme_extra_element.val&&jQuery(german_market_price_variable_theme_extra_element.val).slideDown()})}else if("gm_sepcial"==german_market_price_variable_products.val){var t=e(".single-product");t.on("show_variation",".variations_form",function(){var t='<div id="german-market-variation-price"></div>',a=jQuery(".woocommerce-variation-price.woocommerce-variation-price").html();e(".woocommerce-variation-availability").length&&(a+=e(".woocommerce-variation-availability").html()),e(".woocommerce-variation-description").length&&(a+=e(".woocommerce-variation-description").html()),jQuery(".woocommerce-variation.single_variation").hide(),jQuery(".woocommerce-variation-price").hide(),jQuery(".legacy-itemprop-offers").hide(),"none"!=german_market_price_variable_theme_extra_element.val&&jQuery(german_market_price_variable_theme_extra_element.val).hide(),jQuery(".elementor-widget-woocommerce-product-price .price").length&&jQuery(".elementor-widget-woocommerce-product-price .price").hide(),jQuery(".dtwpb-price.price").length&&(jQuery("#german-market-variation-price").length||jQuery(t).insertAfter(".dtwpb-price.price"),jQuery(".dtwpb-price.price").hide(),jQuery(".gm-wp_bakery_woocommerce_get_price_html").length&&jQuery(".gm-wp_bakery_woocommerce_get_price_html").hide()),jQuery(".et_pb_wc_price").length&&(jQuery("#german-market-variation-price").length||jQuery(t).insertAfter(".et_pb_wc_price"),jQuery(".et_pb_wc_price").hide()),jQuery("#german-market-variation-price").length?jQuery("#german-market-variation-price").show():jQuery(t).insertAfter(".legacy-itemprop-offers"),jQuery("#german-market-variation-price").html(a)}),t.on("reset_data",".variations_form",function(){jQuery(".elementor-widget-woocommerce-product-price .price").length&&jQuery(".elementor-widget-woocommerce-product-price .price").show(),jQuery(".dtwpb-price.price").length&&(jQuery(".dtwpb-price.price").show(),jQuery(".gm-wp_bakery_woocommerce_get_price_html").length&&jQuery(".gm-wp_bakery_woocommerce_get_price_html").show()),jQuery(".et_pb_wc_price").length&&jQuery(".et_pb_wc_price").show(),jQuery(".legacy-itemprop-offers").show(),jQuery("#german-market-variation-price").hide(),"none"!=german_market_price_variable_theme_extra_element.val&&jQuery(german_market_price_variable_theme_extra_element.val).show()})}},sepa_direct_debit_show_preview:function(){var t=e(".wc_payment_methods input[name=payment_method]:checked"),a=e(".german-market-sepa-radio-wrapper input.radio-button:checked");if("german_market_sepa_direct_debit"!==t.val())return!1;if("saved"==a.val())return!0;var i={holder:e('[name="german-market-sepa-holder"]').val(),iban:e('[name="german-market-sepa-iban"]').val(),bic:e('[name="german-market-sepa-bic"]').val(),street:e('[name="billing_address_1"]').val(),zip:e('[name="billing_postcode"]').val(),city:e('[name="billing_city"]').val(),country:e('[name="billing_country"]').val()},r=!0;if(jQuery("#german-market-sepa-checkout-fields").is(":visible")){for(key in i)if(!(("bic"==key||"iban"==key||"holder"==key)&&e('[name="german-market-sepa-'+key+'"]').hasClass("gm-required-no"))&&void 0!==i[key]&&""==i[key].trim()){r=!1;break}}else r=!1;return r},sepa_direct_debit_show_preview_do:function(){t.sepa_direct_debit_show_preview()?(e(".gm-sepa-direct-debit-second-checkout-disabled").show(),e(".gm-sepa-direct-debit-order-pay").show()):(e(".gm-sepa-direct-debit-second-checkout-disabled").hide(),e(".gm-sepa-direct-debit-order-pay").hide(),e("#gm-sepa-mandate-preview-text").slideUp())},sepa_direct_debit:function(){e(document.body).on("click","#gm-sepa-mandate-preview-store",function(t){t.preventDefault(),e("#gm-sepa-mandate-preview-text").show()}),e(document.body).on("click","#gm-sepa-mandate-preview",function(t){t.preventDefault();var a=!1;e("#german_market_sepa_use_payment_information").length&&(a=e("#german_market_sepa_use_payment_information").is(":checked"));var i={action:"gm_sepa_direct_debit_mandate_preview",holder:e('[name="german-market-sepa-holder"]').val(),iban:e('[name="german-market-sepa-iban"]').val(),bic:e('[name="german-market-sepa-bic"]').val(),street:e('[name="billing_address_1"]').val(),zip:e('[name="billing_postcode"]').val(),city:e('[name="billing_city"]').val(),country:e('[name="billing_country"]').val(),nonce:sepa_ajax_object.nonce,saved_data:a};jQuery.post(sepa_ajax_object.ajax_url,i,function(t){e("#gm-sepa-mandate-preview-text").html(t),e("#gm-sepa-mandate-preview-text").slideDown(),e("#gm-sepa-mandate-preview-text .close").click(function(){e("#gm-sepa-mandate-preview-text").slideUp()})})}),e("#gm-sepa-mandate-preview").ready(function(){if(e("#gm-sepa-mandate-preview").length){t.sepa_direct_debit_show_preview_do();var a={0:'[name="german-market-sepa-holder"]',1:'[name="german-market-sepa-iban"]',2:'[name="german-market-sepa-bic"]',3:'[name="billing_address_1"]',4:'[name="billing_postcode"]',5:'[name="billing_city"]',6:'[name="billing_country"]'};for(key in a)e(document.body).on("change keyup",a[key],t.sepa_direct_debit_show_preview_do)}}),e(document.body).on("change",'input[name="payment_method"]',function(){"german_market_sepa_direct_debit"==e(this).val()?(t.sepa_direct_debit_show_preview_do(),e(".gm-sepa-direct-debit-second-checkout-disabled").show()):e(".gm-sepa-direct-debit-second-checkout-disabled").hide()}),e(".gm-sepa-direct-debit-second-checkout-disabled").ready(function(){e("#payment_method_german_market_sepa_direct_debit").is(":checked")&&e(".gm-sepa-direct-debit-second-checkout-disabled").show()})},shipping_service_provider:function(){e("body").on("updated_checkout",function(t,a){if(e("#p-shipping-service-provider").length){var i=!0;e('select.shipping_method, input[name^="shipping_method"][type="radio"]:checked, input[name^="shipping_method"][type="hidden"]').each(function(){if(i=e(this).val().includes("local_pickup"))return!1}),i?e("#p-shipping-service-provider").hide():e("#p-shipping-service-provider").show()}})}};t.init()});
// source --> https://baeckerei-pichler.de/wp-content/plugins/order-delivery-date/assets/js/tyche.js?ver=12.10.0 
"use strict";

var tyche = {
	version: '1.2', // version of tyche constructor.
	constructor: tyche,
	extend: function() {
		let target = arguments[ 0 ] || {},
			length = arguments.length,
			self = this,
			option;

		for ( let i = 0; i < length; i++ ) {

			let args = [];

			// Use default target is none was supplied fpr the first iteration.
			if ( 0 === i ) {

				if ( 1 !== length ) {
					continue;
				}

				target = self;
				args = arguments[ 0 ];
			}

			if ( 0 === args.length ) {
				args = arguments[ i ];
			}

			for ( option in args ) {
				target[ option ] = args[ option ];
			}
		}

		return target;
	},
	init: function() {
		// Here we can run codes we want initialized after tyche object core.
		if ( typeof String.prototype.replaceAll == "undefined" ) {
			String.prototype.replaceAll = function( match, replace ) {
				return this.replace( new RegExp( match, 'g' ), () => replace );
			}
		}
	},
	wcap: {}, // Abandoned Cart Pro for WooCommerce.
	orddd: {}, // Order Delivery Date Pro for WooCommerce.
	bkap: {}, // Booking & Appointment Plugin for WooCommerce.
	ac: {}, // Abandoned Cart Pro for WooCommerce.
	pdd: {}, // Product Delivery Date Pro for WooCommerce.
	pif: {}, // Product Input Fields for WooCommerce.
	cos: {}, // Custom Order Status for WooCommerce.
	con: {}, // Custom Order Numbers for WooCommerce.
	dw: {}, // Deposits for WooCommerce.
	pur: {}, // Price by User Role for WooCommerce.
	pgf: {}, // Payment Gateway Based Fees and Discounts for WooCommerce.
	cfp: {}, // Call for Price for WooCommerce.
	cpp: {}, // Currency per Product for WooCommerce.

	// Putting some demo keys here, in case we release new plugins in future, we wouldn't need to update tyche.js file across the plugins.
	dm_1: {},
	dm_2: {},
	dm_3: {},
	dm_4: {},
	dm_5: {},
	dm_6: {},
	dm_7: {},
	dm_8: {},
	dm_9: {},
	dm_10: {},
	dm_11: {},
	dm_12: {},
	dm_13: {},
	dm_14: {},
	dm_15: {},

	// Plugin Deactivation.
	plugin_deactivation: {
		fn: {
			return: function( data, index, return_value = '' ) {
				return 'undefined' !== typeof data[ index ] && '' !== data[ index ] ? ( '' !== return_value ? return_value : data[ index ] ) : ''
			}
		},
		modal: function( $plugin, $data ) {

			if ( '' === tyche.plugin_deactivation.fn.return( $data, 'deactivation_data' ) || '' === tyche.plugin_deactivation.fn.return( $data, 'nonce' ) || '' === tyche.plugin_deactivation.fn.return( $data, 'deactivation_req_msg' ) ) {
				return '';
			}

			let data = $data.deactivation_data,
				nonce = $data.nonce,
				deactivation_req_msg = $data.deactivation_req_msg;

			if ( 'undefined' === typeof data.template || 'undefined' === typeof data.reasons ) {
				return '';
			}

			let template = data.template,
				reasons = data.reasons,
				html = '';

			if ( Array.isArray( reasons ) && reasons.length > 0 ) {
				reasons.forEach( function( item ) {
					html += `
						<li
							class="reason${tyche.plugin_deactivation.fn.return(item,'input_type',' has-input')}${tyche.plugin_deactivation.fn.return(item,'html',' has-html')}"
							data-input-type="${tyche.plugin_deactivation.fn.return(item,'input_type')}"
							data-input-placeholder="${tyche.plugin_deactivation.fn.return(item,'input_placeholder')}">
								<label>
									<span>
										<input type="radio" name="selected-reason" value="${tyche.plugin_deactivation.fn.return(item,'id')}" />
									</span>
									<span>
										${tyche.plugin_deactivation.fn.return(item,'text')}
									</span>
								</label>
							${'' !== tyche.plugin_deactivation.fn.return(item,'html') ? '<div class="reason_html">' + tyche.plugin_deactivation.fn.return(item,'html') + '</div>' : ''}
						</li>`;
				} );

				html += `<input type="hidden" name="nonce" value="${nonce}" />`;

				let modal = jQuery( template.replace( '{PLUGIN}', $plugin ).replace( '{HTML}', html ).replace( '{DEACTIVATION_REQ_MSG}', deactivation_req_msg ) );
				modal.appendTo( jQuery( 'body' ) );

				return modal;
			}
		},

		show_modal: function( modal ) {

			modal.find( '.button' ).removeClass( 'disabled' );

			let btn_deactivate = modal.find( '.button-deactivate' );

			if ( btn_deactivate.length > 0 && modal.hasClass( 'no-confirmation-message' ) && !btn_deactivate.hasClass( 'allow-deactivate' ) ) {
				btn_deactivate.addClass( 'allow-deactivate' );
				modal.find( '.button-skip-deactivate' ).addClass( 'allow-deactivate' );
				modal.find( '.ts-modal-panel' ).removeClass( 'active ' );
				modal.find( '[data-panel-id="reasons"]' ).addClass( 'active' );
			}

			modal.addClass( 'active' );
			jQuery( 'body' ).addClass( 'has-ts-modal' );
		},

		close_modal: function( modal ) {
			modal.removeClass( 'active' );
			jQuery( 'body' ).removeClass( 'has-ts-modal' );
		},

		events: {
			listeners: function( data, modal, plugin ) {
				if ( 0 !== jQuery( `.${plugin}.ts-slug` ).prev( 'a' ) ) {
					jQuery( `.${plugin}.ts-slug` ).prev( 'a' ).on( 'click', function( e ) {
						e.preventDefault();
						tyche.plugin_deactivation.show_modal( modal );
					} );
				}

				modal.on( 'click', '.button-skip-deactivate', function( e ) {
					e.preventDefault();
					jQuery( '.ts-modal-footer p' ).hide();
					tyche.plugin_deactivation.events.button_submit( this, data, plugin, true );
				} );

				modal.on( 'click', '.button-deactivate', function( e ) {
					e.preventDefault();
					jQuery( '.ts-modal-footer p' ).hide();
					tyche.plugin_deactivation.events.button_submit( this, data, plugin );
				} );

				modal.on( 'click', 'input[type="radio"]', function() {
					jQuery( '.ts-modal-footer p' ).hide();
					tyche.plugin_deactivation.events.button_option_selection( this, modal );
				} );

				// If the user has clicked outside the window, cancel it.
				modal.on( 'click', function( e ) {
					tyche.plugin_deactivation.events.button_click_outside_window( e, modal );
				} );
			},

			button_submit: function( $this, $data, plugin, skip = false ) {

				if ( jQuery( $this ).hasClass( 'disabled' ) || !jQuery( $this ).hasClass( 'allow-deactivate' ) ) {
					return;
				}

				let modal = jQuery( $this ).parents( `.${plugin}.ts-modal` ),
					option = jQuery( 'input[type="radio"]:checked' ),
					reason = option.parents( 'li:first' ),
					response = reason.find( 'textarea, input[type="text"]' ),
					reason_id = skip ? 0 : option.val(),
					reason_text = skip ? 'Deactivation Reason Skipped' : reason.text().trim();
					
				if ( 0 === option.length && ! skip ) {
					jQuery( '.ts-modal-footer p' ).css( 'display', 'inline-block' );
					return;
				}

				let	data = {
					'action': 'tyche_plugin_deactivation_submit_action',
					'reason_id': reason_id,
					'reason_text': reason_text,
					'reason_info': 0 !== response.length ? response.val().trim() : '',
					'plugin_short_name': plugin,
					'plugin_name': jQuery( `.${plugin}.ts-slug` ).attr( 'data-plugin' ),
					'nonce': jQuery( 'input[name="nonce"]' ).val()
				};

				let ajax_url = tyche.plugin_deactivation.fn.return( $data, 'ajax_url' ),
					href = jQuery( `.${plugin}.ts-slug` ).prev().prop( 'href' );

				if ( '' !== ajax_url && '' !== href ) {
					jQuery.ajax( {
						url: ajax_url,
						method: 'POST',
						data,
						beforeSend: function() {
							modal.find( '.button-deactivate' ).addClass( 'disabled' );
							modal.find( '.button-skip-deactivate' ).addClass( 'disabled' );
						},
						complete: function() {
							window.location.href = href;
						}
					} );
				}
			},

			button_click_outside_window: function( e, modal ) {

				let target = jQuery( e.target );

				// If the user has clicked anywhere in the modal dialog, just return.
				if ( target.hasClass( 'ts-modal-body' ) || target.hasClass( 'ts-modal-footer' ) ) {
					return;
				}

				// If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
				if ( !target.hasClass( 'button-close' ) && ( target.parents( '.ts-modal-body' ).length > 0 || target.parents( '.ts-modal-footer' ).length > 0 ) ) {
					return;
				}

				tyche.plugin_deactivation.close_modal( modal );
			},

			button_option_selection: function( $this, modal ) {

				modal.find( '.reason-input' ).remove();
				jQuery( $this ).parents( 'ul#reasons-list' ).children( "li.li-active" ).removeClass( "li-active" );
				let parent = jQuery( $this ).parents( 'li:first' );

				if ( parent.hasClass( 'has_html' ) ) {
					parent.addClass( 'li-active' );
				}

				if ( parent.hasClass( 'has-input' ) ) {
					parent.append( jQuery( `<div class="reason-input">${'textfield' === parent.data( 'input-type' ) ? '<input type="text" />' : '<textarea rows="5"></textarea>'}</div>` ) );
					parent.find( 'input, textarea' ).attr( 'placeholder', parent.data( 'input-placeholder' ) ).focus();
				}
			}
		}
	}
}

tyche.init();