Number.prototype.formatMoney=function(t,e,i){var r=this,a=(t=isNaN(t=Math.abs(t))?2:t,e=null==e?".":e,i=null==i?",":i,r<0?"-":""),o=parseInt(r=Math.abs(+r||0).toFixed(t))+"",c=(c=o.length)>3?c%3:0;return a+(c?o.substr(0,c)+i:"")+o.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+i)+(t?e+Math.abs(r-o).toFixed(t).slice(2):"")};var mint__travel__calculator={init:function(){new AutoNumeric.multiple(".ivc-inputs_dollars",{currencySymbol:"$ ",decimalPlaces:0,digitGroupSeparator:",",decimalCharacter:".",decimalPlacesOverride:0,minimumValue:-0,maximumValue:9999999999999,currencySymbolPlacement:"p"}),new AutoNumeric.multiple(".ivc-inputs_numbers",{currencySymbol:"",decimalPlaces:0,digitGroupSeparator:",",decimalCharacter:".",decimalPlacesOverride:0,minimumValue:0,maximumValue:9999999999999,currencySymbolPlacement:"s"}),new AutoNumeric(".ivc-inputs_numbers_decimal",{currencySymbol:"$ ",decimalPlaces:2,digitGroupSeparator:",",decimalCharacter:".",decimalPlacesOverride:2,minimumValue:-0,maximumValue:9999999999999.99,currencySymbolPlacement:"p"}),this.listeners(),this.start()},df:0,listeners:function(){jQuery("body").on("click",".ivc-inputs_advanced",function(){var t=jQuery('#mint__travel__calculator input[type="checkbox"]:checked').val();jQuery(this).closest(".ivct-section").find(".ivc-collapse").hasClass("ivc-collapse-up")?(jQuery(this).closest(".ivct-section").find(".ivct-adv.ivct-"+t).slideUp(),jQuery(this).closest(".ivct-section").find(".ivc-collapse").removeClass("ivc-collapse-up").addClass("ivc-collapse-down"),"ivc_section_food"==jQuery(this).closest(".ivct-section").attr("id")&&(jQuery("#ivct-food").slideDown().css("display","flex"),mint__travel__calculator.df=0,jQuery(this).closest(".ivct-section").find('input[type="text"].ivc-food-start').each(function(){AutoNumeric.set(this,"")})),jQuery(this).closest(".ivct-section").find(".ivct-adv.ivct-"+t+' input[type="text"]').each(function(){AutoNumeric.set(this,"")})):jQuery(this).closest(".ivct-section").find(".ivc-collapse").hasClass("ivc-collapse-down")&&(jQuery(this).closest(".ivct-section").find(".ivct-adv.ivct-"+t).slideDown(),jQuery(this).closest(".ivct-section").find(".ivc-collapse").removeClass("ivc-collapse-down").addClass("ivc-collapse-up"),"ivc_section_food"==jQuery(this).closest(".ivct-section").attr("id")&&(jQuery("#ivct-food").slideUp(),mint__travel__calculator.df=1),jQuery(this).closest(".ivct-section").find(".ivct-adv.ivct-"+t+' input[type="text"]').each(function(){AutoNumeric.set(this,"")})),"international"==jQuery('#mint__travel__calculator input[name="ivct-di"]:checked').val()?jQuery("#ivct-dic").css("display","block"):jQuery("#ivct-dic").css("display","none"),mint__travel__calculator.calculate()}),jQuery("body").on("change","#mint__travel__calculator input",function(){mint__travel__calculator.calculate()}),jQuery(".iv-calculator input").keydown(function(){jQuery(this).css("color","#444444")}),jQuery(".ivc-inputs_ico").mouseenter(function(){jQuery(this).parent(".ivc-inputs_label").find(".ivc-inputs_tooltip").css("display","block")}),jQuery(".ivc-inputs_ico").mouseleave(function(){jQuery(this).parent(".ivc-inputs_label").find(".ivc-inputs_tooltip").css("display","none")}),jQuery('#mint__travel__calculator input[name="ivct-di"]').click(function(){jQuery(this).attr("checked",!0),jQuery('#mint__travel__calculator input[name="ivct-di"]').not(this).prop("checked",!1)}),jQuery('#mint__travel__calculator input[name="ivct-di"]').click(function(){"international"==jQuery(this,":checked").val()?jQuery("#ivct-dic").css("display","block"):(jQuery("#ivct-dic").css("display","none"),AutoNumeric.set("#ivct-dic input",""))}),jQuery('#mint__travel__calculator input[name="ivct-type"]').click(function(){jQuery("#ivct-food").css("display","flex"),jQuery("#mint__travel__calculator .ivc-meal_switch").each(function(){jQuery(this).find('input[type="radio"]').first().prop("checked",!0)}),jQuery('#mint__travel__calculator input[name="ivct-di"]').first().prop("checked",!0),jQuery('#mint__travel__calculator input[name="ivct-di"]').last().prop("checked",!1),jQuery(this).attr("checked",!0),jQuery(this).prop("disabled",!0),jQuery('#mint__travel__calculator input[name="ivct-type"]').not(this).prop("checked",!1),jQuery('#mint__travel__calculator input[name="ivct-type"]').not(this).prop("disabled",!1)}),jQuery('#mint__travel__calculator input[name="ivct-type"]').click(function(){jQuery('#mint__travel__calculator input[type="text"]').each(function(){AutoNumeric.set(this,"")});var t=jQuery(this,":checked").val();jQuery(".ivct-type-select").css("display","none"),jQuery(".ivct-"+t).slideDown(),"cruise"==t?(jQuery(".ivct-cruise-app").html("Resort Fee (if applicable):"),jQuery(".ivct-lo-nof-tooltip").html("Number of Nights: Enter the number of nights of your stay")):(jQuery(".ivct-cruise-app").html("Resort Fees:"),jQuery(".ivct-lo-nof-tooltip").html("Number of Nights: Include the number of nights you will need sleep accommodations")),jQuery(".ivct-adv").css("display","none"),jQuery(".ivc-collapse").removeClass("ivc-collapse-up").addClass("ivc-collapse-down"),"other"==t?(jQuery(".ivc-inputs_advanced").css("display","none"),jQuery(".ivct-adv-other").css("display","block"),jQuery("#ivc_section_lodging .ivct-adv-other .ivct-lo-nof-tooltip").html("Other: Include any food related costs anticipated for the trip per person"),jQuery("#ivc_section_food .ivct-adv-other .ivct-lo-nof-tooltip").html("Other: Include any food related costs anticipated for the trip per person"),jQuery("#ivc_section_travel .ivct-adv-other .ivct-lo-nof-tooltip").html("Other: Include any travel related costs anticipated for the trip per person"),jQuery(".ivc-inputs_name-tr").html("Number of Travelers:"),jQuery(".ivc-inputs_name-tr-tooltip").html("Number of Travelers: Include yourself and other members of your travel party that you will be paying for")):(jQuery(".ivc-inputs_advanced").css("display","inline-block"),jQuery("#ivc_section_lodging .ivct-adv-other .ivct-lo-nof-tooltip").html("Other: Include any other travel related costs anticipated for the trip"),jQuery("#ivc_section_food .ivct-adv-other .ivct-lo-nof-tooltip").html("Other: Include the total anticipated cost per meal"),jQuery("#ivc_section_travel .ivct-adv-other .ivct-lo-nof-tooltip").html("Other: Include any other travel related costs anticipated for the trip"),jQuery(".ivc-inputs_name-tr").html("Number of Cabins/Rooms:"),jQuery(".ivc-inputs_name-tr-tooltip").html("Number of Cabins/Rooms: Include the total number of rooms you will need for the duration of the trip."))}),jQuery("body").on("change",'#mint__travel__calculator input[name="ivct-type"]',function(){mint__travel__calculator.start()}),jQuery("#ivc_reset").click(function(){mint__travel__calculator.reset()})},start:function(){this.chart([2200,1500,500,300,500]);var t="#7DF8C4",e="#1B8381";t="#7DF8C4",e="#1B8381",this.over(Math.round(Math.abs(1650/6500*100)),t,e,"Under Budget")},over:function(t,e,i,r){Highcharts.chart("ivc_chart_budget",{chart:{type:"pie",plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1,spacingTop:0,spacingBottom:0,spacingLeft:0,spacingRight:0},title:{text:t+"%
"+r,align:"center",style:{color:"black",fontWeight:"bold"},verticalAlign:"middle",color:"white"},navigator:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1},tooltip:{enabled:!1},plotOptions:{series:{animation:!1,states:{hover:{enabled:!1,brightness:1,opacity:1},inactive:{opacity:1}}},pie:{borderWidth:0,center:["50%","50%"],colors:[i],size:"100%"}},series:[{size:"90%",borderWidth:0,showInLegend:!1,enableMouseTracking:!1,data:[1],animation:!1,colors:[e],dataLabels:{enabled:!1}},{size:"90%",borderWidth:0,innerSize:t+"%",dataLabels:{enabled:!1},allowPointSelect:!1,cursor:"pointer",name:"Browser share",data:[["Budget",100]]}]})},chart:function(t){Highcharts.chart("ivc_chart_growth",{chart:{type:"pie",plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:null},navigator:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1},tooltip:{enabled:!0,useHTML:!0,useHTML:!0,formatter:function(){var e=t.reduce((t,e)=>t+e,0);return'
'+this.point.name+" - $"+this.y.formatMoney(0,".",",")+" ("+(this.y/e*100).formatMoney(0,".",",")+"%)
"}},plotOptions:{series:{animation:!1,states:{hover:{enabled:!1,brightness:0,opacity:1},inactive:{opacity:1}}},pie:{borderWidth:0,size:"100%",allowPointSelect:!1,startAngle:-90,center:["50%","50%"],dataLabels:{distance:-45,color:"white"},colors:["#1B8381","#00A38F","#00CEAA","#7EF8C5","#E0FDF5"]}},series:[{size:"100%",innerSize:"0%",dataLabels:{enabled:!1,useHTML:!0,formatter:function(){this.point.percentage=this.percentage;var t="#ffffff";return t="Medical"!=this.point.name?"#ffffff":"#008582",0==this.percentage?"":'
'+this.point.name+'
'+Highcharts.numberFormat(this.percentage,0)+"%
"}},allowPointSelect:!1,cursor:"pointer",name:"Browser share",data:[["Lodging",t[0]],["Travel",t[1]],["Food &
Drink",t[2]],["Extras",t[3]],["Medical",t[4]]]}]})},reset:function(){jQuery('#mint__travel__calculator input[type="text"]').each(function(){AutoNumeric.set(this,"")}),jQuery("#ivc_return_vacation").html("$"+(0).formatMoney(0,",",",")),jQuery("#ivc_return_expenses").html("$"+(0).formatMoney(0,",",",")),jQuery("#ivc_return_uo").html("+$"+(0).formatMoney(0,",",",")),jQuery(".ivc-total_row.ivc-total_row_full .ivc-total_col").css("background","#00CDA9"),this.start()},calculate:function(){var t={type:jQuery('#mint__travel__calculator input[name="ivct-type"]:checked').val(),amount:parseFloat(AutoNumeric.getNumericString("#ivct__amount"))||0,n_medic:parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_medic"))||0,n_extra:parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_extra"))||0,n_food:parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_food"))||0,n_lodg:parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_lod"))||0,n_travel:parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_travel"))||0,total:{travel:0,lodging:0,food:0,extras:0,medical:0},percent:{travel:0,lodging:0,food:0,extras:0,medical:0},chart_result:[]};if("other"!=t.type?(t.total.travel=this.traveling(),t.total.lodging=this.lodging(),t.total.food=this.food(),t.total.extras=this.extras(),t.total.medical=this.medical()):(t.total.travel=t.n_travel*AutoNumeric.getNumericString("#ivc_section_travel .ivct-adv-other .ivc-inputs_dollars")||0,t.total.lodging=t.n_lodg*parseFloat(AutoNumeric.getNumericString("#ivc_section_lodging .ivct-adv-other .ivc-inputs_dollars"))||0,t.total.food=t.n_food*parseFloat(AutoNumeric.getNumericString("#ivc_section_food .ivct-adv-other .ivc-inputs_dollars"))||0,t.total.extras=t.n_extra*parseFloat(AutoNumeric.getNumericString("#ivc_section_extra .ivct-adv-other .ivc-inputs_dollars"))||0,t.total.medical=t.n_medic*parseFloat(AutoNumeric.getNumericString("#ivc_section_medical .ivct-adv-other .ivc-inputs_dollars"))||0),t.total_expenses=t.total.travel+t.total.lodging+t.total.food+t.total.extras+t.total.medical,t.uo=t.amount-t.total_expenses,t.percent.travel=isNaN(t.total.travel/t.total_expenses)?0:t.total.travel/t.total_expenses*100,t.percent.lodging=isNaN(t.total.lodging/t.total_expenses)?0:t.total.lodging/t.total_expenses*100,t.percent.food=isNaN(t.total.food/t.total_expenses)?0:t.total.food/t.total_expenses*100,t.percent.extras=isNaN(t.total.extras/t.total_expenses)?0:t.total.extras/t.total_expenses*100,t.percent.medical=isNaN(t.total.medical/t.total_expenses)?0:t.total.medical/t.total_expenses*100,t.chart_result=[t.total.lodging,t.total.travel,t.total.food,t.total.extras,t.total.medical],t.radius=t.uo/t.amount*100,t.amountt+e,0)&&this.chart(t.chart_result),jQuery("#ivc_return_vacation").html("$"+t.amount.formatMoney(0,",",",")),jQuery("#ivc_return_expenses").html("$"+t.total_expenses.formatMoney(0,",",",")),t.uo>=0?(jQuery("#ivc_return_uo").html("+$"+Math.abs(t.uo).formatMoney(0,",",",")),jQuery(".ivc-total_row.ivc-total_row_full .ivc-total_col").css("background","#00CDA9")):(jQuery("#ivc_return_uo").html("-$"+Math.abs(t.uo).formatMoney(0,",",",")),jQuery(".ivc-total_row.ivc-total_row_full .ivc-total_col").css("background","#7DF8C4"))},medical:function(){var t=0,e=parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_medic"))||0;return jQuery("#ivc_section_medical .ivc-inputs_dollars").each(function(){t+=parseFloat(AutoNumeric.getNumericString(this)||0)*e}),t},extras:function(){var t=0,e=parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_extra"))||0;return jQuery("#ivc_section_extra .ivc-inputs_dollars").each(function(){t+=parseFloat(AutoNumeric.getNumericString(this)||0)*e}),t},food:function(){var t=0,e=parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_food"))||0,i=(jQuery('#mint__travel__calculator input[name="ivct-type"]:checked').val(),parseFloat(jQuery('#mint__travel__calculator input[name="ivc-first_meal"]:checked').val())),r=parseFloat(jQuery('#mint__travel__calculator input[name="ivc-second_meal"]:checked').val()),a=parseFloat(jQuery('#mint__travel__calculator input[name="ivc-third_meal"]:checked').val()),o=parseFloat(jQuery('#mint__travel__calculator input[name="ivc-fourth_meal"]:checked').val());(0==i&&(i=parseFloat(AutoNumeric.getNumericString("#ivc__other_f"))||0),0==r&&(r=parseFloat(AutoNumeric.getNumericString("#ivc__other_s"))||0),0==a&&(inp.meal.third=parseFloat(AutoNumeric.getNumericString("#ivc__other_t"))||0),0==o&&(o=parseFloat(AutoNumeric.getNumericString("#ivc__other_o"))||0),1==mint__travel__calculator.df)?t+=(i+r+a+o)*e*(parseFloat(AutoNumeric.getNumericString("#ivc__cruise_lo"))||0):t=parseFloat(AutoNumeric.getNumericString("#ivc__food_start_nm")||0)*parseFloat(AutoNumeric.getNumericString("#ivc__food_start_nd")||0)*parseFloat(AutoNumeric.getNumericString("#ivc__food_start_cpm")||0)*e;return t},lodging:function(){var t=0,e=jQuery('#mint__travel__calculator input[name="ivct-type"]:checked').val(),i=parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_lod"))||0;if("cruise"==e){t=(r=parseFloat(AutoNumeric.getNumericString("#ivc__cruise_lo"))||0)*(o=parseFloat(AutoNumeric.getNumericString("#ivc__cruise_lo_costpn"))||0)*i+(c=parseFloat(AutoNumeric.getNumericString("#ivc__lo_fee"))||0)+(parseFloat(AutoNumeric.getNumericString("#ivc__lo_other"))||0)}else{var r=parseFloat(AutoNumeric.getNumericString("#ivc__cruise_lo"))||0,a=parseFloat(AutoNumeric.getNumericString("#ivc__lo_rooms"))||1,o=parseFloat(AutoNumeric.getNumericString("#ivc__lo_costroom"))||0,c=parseFloat(AutoNumeric.getNumericString("#ivc__lo_fee"))||0;t=(parseFloat(AutoNumeric.getNumericString("#ivc__lo_other"))||0)+r*a*o+c*a}return t},traveling:function(){var t=0,e=jQuery('#mint__travel__calculator input[name="ivct-type"]:checked').val(),i=parseFloat(AutoNumeric.getNumericString("#ivc__travelers_num_travel"))||0;return jQuery("#ivc_section_travel .ivc-perperson").each(function(){t+=parseFloat(AutoNumeric.getNumericString(this)||0)*i}),jQuery("#ivc_section_travel .ivc-pertype").each(function(){t+=parseFloat(AutoNumeric.getNumericString(this)||0)}),"flying"==e&&(t+=parseFloat(AutoNumeric.getNumericString("#ivc__travel_td")||0)*i),"driving"==e&&(t+=parseFloat(AutoNumeric.getNumericString("#ivc__travel_nmiles")||0)/parseFloat(AutoNumeric.getNumericString("#ivc__travel_gallons")||1)*parseFloat(AutoNumeric.getNumericString("#ivc__travel_cost_gol")||0)),"cruise"==e&&(t+=parseFloat(AutoNumeric.getNumericString("#ivc__travel_cruise_td")||0)),t}};jQuery(document).ready(function(t){mint__travel__calculator.init()});