PageSourceSearch

https://kisim.com/wp-content/cache/min/1/wp-content/plugins/multip…/script-1da595790394332da6dacebbf17344c3.js

js kisim.com collected 2026-09-27 02:55:35 UTC 8,556 bytes, 13 lines download raw bytes

1jQuery(function($){const multipass={data:{redeem:0,order_total:multipass_data.order_total,open_amount:multipass_data.order_total,vouchers:[],cc_used:!1},init:function(){setTimeout(this.submit_button_state,500);$(document.body).on('update_checkout',this.update_order_totals);$(document.body).on('init_checkout update_checkout payment_method_selected',this.submit_button_state);$(document.body).on('click','.multipass-item button.submit-voucher',this.get_budget);$(document.body).on('click','.multipass-result .show-amount a',this.toggle_edit_redeem_amount);$(document.body).on('change keyup','.multipass-result .edit-amount input',this.update_open_amount_display);$(document.body).on('blur','.multipass-result .edit-amount input',this.validate_redeem_amount);$(document.body).on('click','.multipass-result .edit-amount a',this.update_redeem_amount);$(document.body).on('click','.multipass-review .add-voucher',this.add_voucher);$(document.body).on('click','.multipass-item .remove-voucher',this.remove_voucher);$(document.body).on('click','.multipass-review button.add-cc',this.add_cc);$(document.body).on('checkout_error',this.open_cc_iframe);$(document.body).on('multipass_gateway_ipn_fail',this.cc_ipn_fail)},update_order_totals:function(){let timer=setInterval(function(){if(!$('.blockUI').length){clearInterval(timer);let args={method:'update_cart_totals',nonce:multipass_data.nonce,};$.post(multipass_data.ajax_url,args,function(res){multipass.data.order_total=res;multipass.check_open_amount()})}},100)},submit_button_state:function(){if($('input#payment_method_multipass').is(':checked')){if(multipass.data.redeem>0&&multipass.data.redeem<multipass.data.order_total){$('button#place_order').prop('disabled',!0)}}else{$('button#place_order').prop('disabled',!1)}},get_budget:function(e){e.preventDefault();let $button=$(this),$item=$button.closest('.multipass-item'),args={method:'get_budget',nonce:multipass_data.nonce,card_number:$item.find('.multipass-form input').val()};if($.inArray(args.card_number,multipass.data.vouchers)!==-1){Swal.fire({title:multipass_data.validate_error.title_general,text:multipass_data.validate_error.cant_use_twice,icon:'error',confirmButtonText:multipass_data.validate_error.ok});return!1}
2multipass.data.vouchers.push(args.card_number);$button.hide();$item.find('.multipass-form input').prop('readonly',!0);multipass.before_ajax();$.post(multipass_data.ajax_url,args,function(res){if(res.success){$item.find('.multipass-result').html(res.data.html).show()}else{Swal.fire({title:multipass_data.validate_error.title_general,text:res.data,icon:'error',confirmButtonText:multipass_data.validate_error.ok});$item.find('.multipass-form input').prop('readonly',!1).val('');$button.show()}
3multipass.check_open_amount();multipass.after_ajax()})},toggle_edit_redeem_amount:function(e){e.preventDefault();let $result=$(this).closest('.multipass-result'),amount=$result.find('.multipass-result-inner').data('amount'),total=0,max=0;$result.find('.show-amount').hide();$result.find('.edit-amount').show();$('.multipass-result').not($result).each(function(){total+=parseFloat($(this).find('.edit-amount input').val())});max=amount<=multipass.data.order_total-total?amount:multipass.data.order_total-total;$('.multipass-result .edit-amount input').attr('max',max)},update_open_amount_display:function(){let total=0,value=parseFloat($(this).val()),max=parseFloat($(this).attr('max'));if(value>max){$(this).val(max)}
4if(isNaN(value)){$(this).val(0)}
5$('.multipass-result .edit-amount input').each(function(){total+=parseFloat($(this).val())});$('.multipass-review .multipass-review-title span').html(multipass.format_price(multipass.data.open_amount-total))},validate_redeem_amount:function(e){let value=parseFloat($(this).val()),max=parseFloat($(this).attr('max')),min=parseFloat($(this).attr('min')),order_total=parseFloat($(".multipass-review-title span").text());if(value>max){$(this).val(max)}else if(value<min){$(this).val(min)}
6multipass.update_redeem_amount(e)},update_redeem_amount:function(e){e.preventDefault();let $result=$(e.currentTarget).closest('.multipass-result'),amount=$result.find('input').val();$result.find('.show-amount').show();$result.find('.edit-amount').hide();multipass.check_open_amount();$result.find('.show-amount b').html(multipass.format_price(amount))},add_voucher:function(e){e.preventDefault();let args={method:'input_item',nonce:multipass_data.nonce,}
7multipass.before_ajax();$.post(multipass_data.ajax_url,args,function(res){$('.multipass-items').append(res);$('.multipass-review').hide();multipass.after_ajax();$(document.body).on('blur','.multipass-result .edit-amount input',multipass.validate_redeem_amount)})},remove_voucher:function(e){e.preventDefault();let $item=$(this).closest('.multipass-item'),card_number=$item.find('input').val();multipass.data.vouchers.splice(multipass.data.vouchers.indexOf(card_number),1);$item.remove();multipass.check_open_amount()},add_cc:function(e){e.preventDefault();$('form.checkout .woocommerce-billing-fields').find('input, select, textarea').trigger('validate');
7if($('form.checkout .shipping_address:visible').length){$('form.checkout .shipping_address').find('input, select, textarea').trigger('validate')}
8$('form.checkout input#terms').trigger('validate');if($('form.checkout .woocommerce-invalid').length){$('form.checkout').find('.woocommerce-invalid').first().focus();Swal.fire({title:multipass_data.validate_error.title_general,text:multipass_data.validate_error.text,icon:'error',confirmButtonText:multipass_data.validate_error.ok});return}
9multipass.data.cc_used=!0;$('form.woocommerce-checkout').append('<input type="hidden" name="multipass[cc]" value="1"/>').submit()},open_cc_iframe:function(e,error_message){error_message=$(error_message).text().trim().split(' ');let json;$.each(error_message,function(i,v){try{json=JSON.parse(v)}catch(e){return!0}
10return!1});if(typeof json=='object'&&json.multipass){$('.woocommerce-NoticeGroup').remove();$('html, body').stop();$('form.checkout input, form.checkout textarea').each((i,e)=>{$(e).prop('readonly',!0)});$(document.body).on('click','form.checkout select, #shipping_method input, #shipping_method select, input#ship-to-different-address-checkbox',function(e){e.preventDefault();return!1});$('form.checkout_coupon.woocommerce-form-coupon button').prop('disabled',!0);$('.woocommerce-form-coupon-toggle').hide();let args={method:'cc_gateway',nonce:multipass_data.nonce,amount:multipass.data.open_amount,order_id:json.order_id}
11multipass.before_ajax();$.post(multipass_data.ajax_url,args,function(res){$('.multipass-items').append(res.data);$('.multipass-review').hide();$('form.woocommerce-checkout .place-order').hide();$('a.remove-voucher, span.show-amount a').hide();$('.wc_payment_method:not(.payment_method_multipass)').hide();multipass.after_ajax()})}},cc_ipn_fail:function(e,error_message){multipass.after_cc();Swal.fire({title:multipass_data.validate_error.title_processing,text:error_message,icon:'error',confirmButtonText:multipass_data.validate_error.ok})},before_ajax:function(){$('ul.wc_payment_methods').block({message:null,overlayCSS:{background:'#fff',opacity:0.6}})},after_ajax:function(){$('ul.wc_payment_methods').unblock()},format_price:function(price){price=parseFloat(price).toFixed(multipass_data.price_decimals).toString().replace(/\B(?=(\d{3})+(?!\d))/g,',');return multipass_data.price_format.replace('%2$s',price).replace('%1$s',multipass_data.currency)},check_open_amount:function(){multipass.data.open_amount=parseFloat(multipass.data.order_total).toFixed(2);multipass.data.redeem=0;$('.multipass-result .edit-amount input').each(function(){multipass.data.redeem+=parseFloat($(this).val())});multipass.data.open_amount=parseFloat(multipass.data.order_total-multipass.data.redeem).toFixed(2);if(multipass.data.open_amount>0){$('.multipass-review').show().find('.multipass-review-title span').html(multipass.format_price(multipass.data.open_amount));if($('input#payment_method_multipass').is(':checked')){$('button#place_order').prop('disabled',!0)}
12let args={method:'update_open_amount',nonce:multipass_data.nonce,open_amount:multipass.data.open_amount};$.post(multipass_data.ajax_url,args)}else{$('.multipass-review').hide();if($('input#payment_method_multipass').is(':checked')){$('button#place_order').prop('disabled',!1)}}},after_cc:function(){$('.multipass-item iframe').remove();$('.multipass-review').show();$('form.woocommerce-checkout .place-order').show();$('a.remove-voucher, span.show-amount a').show()}}
13window.multipass=multipass;multipass.init()})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.