!function(a){a(function(){var i={init:function(p){p.find(".quantity").each(function(){var n,t,i=a(this).find("input.qty");i.length&&(n=parseInt(i.prop("min"),10),t=""!==i.prop("max")?parseInt(i.prop("max"),10):1/0,1===n&&n===t?(i.prop("type","hidden"),a(this).addClass("hidden")):a(this).hasClass("hidden")&&(i.prop("type","number"),a(this).removeClass("hidden")))}),p.hasClass("variations_form")&&p.on("show_variation",function(n,t){var i=p.find("input.qty"),a=p.find(".quantity"),e=void 0===t.step||t.step.length?1:parseInt(t.step,10),o=parseInt(t.min_qty,10),t=""!==t.max_qty?parseInt(t.max_qty,10):1/0;1<e&&(e<o?o=(remain=o/e)?e*Math.ceil(remain):o:0<o&&(o=Math.max(o,e)),e<t?t=(remain=t/e)?e*Math.floor(remain):t:t<e&&(t=e)),i.prop("step",e).val(o),i.prop("min",o),i.prop("max",t),1===o&&o===t?(i.prop("type","hidden"),a.addClass("hidden")):a.hasClass("hidden")&&(i.prop("type","number"),a.removeClass("hidden"))})},watch:function(){a("body").on("wc-mmq-init-validation",function(n,t){i.init(t)})}},n=a("body").find(".cart:not(.cart_group)");n.length&&(n.each(function(){i.init(a(this))}),i.watch())})}(jQuery,(document,window));