!function(i){var n=i("#woocommerce-product-data");n.length&&n.find(".pricing").addClass("show_if_product_pack").end().find(".inventory_tab").addClass("hide_if_product_pack").end().find(".shipping_tab").addClass("hide_if_product_pack").end().find(".linked_product_tab").addClass("hide_if_product_pack").end().find(".attributes_tab").addClass("hide_if_product_pack").end().find("._no_of_product_field").hide().end().find("._pack_validity_field").hide().end().find("#_tax_status").parent().parent().addClass("show_if_product_pack").end(),"product_pack"===i("#product-type").val()&&setTimeout(function(){i(".inventory_tab").hide()},500),i("body").on("woocommerce-product-type-change",function(n,e){i("._no_of_product_field").hide(),i("._pack_validity_field").hide(),i("._enable_recurring_payment_field").hide(),i(".dokan_subscription_pricing").hide(),i("._sale_price_field").show(),i(".dokan_subscription_trial_period").hide(),"product_pack"==e&&(i("._no_of_product_field").show(),i("._pack_validity_field").show(),i("._enable_recurring_payment_field").show(),i("._sale_price_field").hide(),i("#dokan_subscription_enable_trial").is(":checked")&&i(".dokan_subscription_trial_period").show(),i("#_enable_recurring_payment").is(":checked")&&(i(".dokan_subscription_pricing").show(),i("._pack_validity_field").hide()))}),i(".woocommerce_options_panel").on("change","#dokan_subscription_enable_trial",function(){i(".dokan_subscription_trial_period").hide(),i(this).is(":checked")&&i(".dokan_subscription_trial_period").fadeIn()}),i(".woocommerce_options_panel").on("change","#_enable_recurring_payment",function(){i(".dokan_subscription_pricing").hide(),i("._pack_validity_field").show(),i(this).is(":checked")&&(i(".dokan_subscription_pricing").fadeIn(),i("._pack_validity_field").hide())}),i("#woocommerce-product-data").on("change",'[name^="_dokan_subscription_period"], [name^="_dokan_subscription_period_interval"]',function(){i('[name^="_dokan_subscription_length"]').each(function(){var n=i(this),e=n.val(),_=!1;billingInterval=parseInt(i("#_dokan_subscription_period_interval").val()),n.empty(),i.each(dokanSubscription.subscriptionLengths[i("#_dokan_subscription_period").val()],function(e,_){0!=parseInt(e)&&0!=parseInt(e)%billingInterval||n.append(i("<option></option>").attr("value",e).text(_))}),n.children("option").each(function(){if(this.value==e)return _=!0,!1}),_?n.val(e):n.val(0)})})}(jQuery);