(function(n){"use strict";UA.Utilities.namespace("UA.Customer.refund");UA.Customer.Refund=function(){return{init:function(){!UA.AppData.Data.Session.IsSignedIn&&n("#refundForm").length>0&&UA.Common.Header.showLoginCustomerModal();var t=window.location.href.split("#");t.length==1?n("#tabs").tabs({active:1}):n("#tabs").tabs();this.bindEvents();this.InitPNRView();this.initReceiptDetail();this.initSubscriptionReceiptDetail();this.DisableTemplateItems()},bindEvents:function(){n(document).on("click",".link-st-refund-status",this.handleRefundStatusSubmit);n(document).on("click",".handleRefPloicyclick",this.handleRefundPolicy);n(document).on("click",".handleclick",this.handleRefundExpand)},DisableTemplateItems:function(){n("#RFPNRDataByMP input[type='text']").attr("disabled",!0);n("#RFPNRDataByMP input[id*='_HasDirectTV']").attr("disabled",!0)},handleExpandFS:function(t,i,r){var u,e,s,o,h,f;for(t.preventDefault(),u=t.currentTarget.id,e="false",UA.UI.InFieldLabel.init(null,null,n("#refundForm")),f=1;f<=i;f++)n("#Ancillary_"+u+f+"")[0].firstChild.firstChild==null||(e="true");if(e=="false"&&n("#collapse_"+u+"").hasClass("icon-toggle-arrow-down-gray"))s=n("#Ancillarycallurl").data("jsonurl-getancillarycallurl"),n("#"+n(t.currentTarget).closest("div").children("div")[0].id).removeClass("visuallyhidden"),o=n("#"+n(t.currentTarget).closest("div").children("div")[0].id).loader({length:8,width:2,radius:8,top:"50%",left:"50%"}),h={type:"POST",url:s,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({RecordLocator:u,tripNumber:r}),timeout:9e4,async:!0,success:function(t){for(var e,c=1;c<=i;c++){n("#"+u+c+"").removeClass("visuallyhidden");n("#NotListedCheckbox_"+u+c+"").css("display","block");n("#click_"+u+c+"").css("display","block");n("#AncillaryNotFound_"+u+c+"").hide();UA.Customer.Refund.initializeItem(n("#AncillaryReceipts_"+u+c+""),0,!0);n("#CheckBox_"+u+c+"").attr("checked",!1);n("#collapse_"+u+"").removeClass("icon-toggle-arrow-down-gray").addClass("icon-toggle-arrow-up-gray");var f=r,s=c-1,h="";if(t.PNRTrips!=null&&t.PNRTrips[f].TripSegment!=null&&t.PNRTrips[f].TripSegment[s].AncillaryItems!=null)for(e=0;e<t.PNRTrips[f].TripSegment[s].AncillaryItems.length;e++)t.PNRTrips[f].TripSegment[s].AncillaryItems[e].IsActiveFlight==!0&&t.PNRTrips[f].TripSegment[s].AncillaryItems[e].AncillaryName=="ETicketNumber"?(h+='<div id="AncillaryView" class="form-row" style="color: gray;font-size:small">',h+='<div class="form-group" style="padding-left: 40px;width:25%;">',h+='<span class="field-validation-valid" aria-hidden="true" data-valmsg-replace="true" data-valmsg-for="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].IsSelected"><\/span>',h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].IsSelected" onclick = "UA.Customer.Refund.checkboxReceiptCount(event)" disabled="disable" class="type-checkbox " id="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected" type="checkbox" value="true" data-val-required="'+n("#translate-text-isSelectedField").text()+'." data-val="true">',h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].IsSelected" type="hidden" value="false">',t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode!=""?(h+=t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="USED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-USED").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="VOID"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-VOID").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="EXCH"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-EXCH").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="OPEN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-OPEN").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="CLOSED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CLOSED").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="REFUNDED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-REFUNDED").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="UNAVAIL"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-UNAVAIL").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="CHECKED IN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CHECKEDIN").text()+")<\/span>":'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode+")<\/span>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].AncillaryName" type="hidden" value="'+n("#translate-text-ETicketNumber").text()+'">'):(h+='<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-active").text()+")<\/span>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].AncillaryName" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].AncillaryName+'">'),h+="<\/div>",h+='<div class="form-group" style="padding-left: 40px;width:25%;">',h+="<span>"+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TravelerName+"<\/span>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].TravelerName" id="PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__TravelerName" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TravelerName+'">',h+="<\/div>",h+='<div class="form-group" style = "padding-left: 140px;width:25%;" >',h+="<span>"+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].ItemNumber+"<\/span>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].ItemNumber" id="PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__ItemNumber" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].ItemNumber+'">',h+="<\/div>",h+="<\/div>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].ConfirmationNumber" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].ConfirmationNumber+'">',h+='<span id="spnActiveFlight" style="color: gray; padding-left: 40px; display: inline;">'+n("#translate-text-activeReservations").text()+' <a class="no-rtad link-underline" id="aHeaderManageRes" href="'+document.getElementById("lblreservationlink").innerText+'">'+n("#translate-text-manageReservations").text()+"<\/a> "+n("#translate-text-activeReservations2").text()+"<\/span>"):(h+='<div id="AncillaryView" class="form-row" style="color:darkblue;font-size:small">',h+='<div class="form-group" style="padding-left: 40px;width:25%;">',h+='<span class="field-validation-valid" aria-hidden="true" data-valmsg-replace="true" data-valmsg-for="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].IsSelected"><\/span>',h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].IsSelected"  class="type-checkbox " onclick = "UA.Customer.Refund.checkboxReceiptCount(event)" id="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected" type="checkbox" value="true" data-val-required="'+n("#translate-text-isSelectedField").text()+'" data-val="true">',h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].IsSelected" type="hidden" value="false">',t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode!=""&&t.PNRTrips[f].TripSegment[s].AncillaryItems[e].AncillaryName=="ETicketNumber"?(h+=t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="USED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-USED").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="VOID"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-VOID").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="EXCH"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-EXCH").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="OPEN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-OPEN").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="CLOSED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CLOSED").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="REFUNDED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-REFUNDED").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="UNAVAIL"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-UNAVAIL").text()+")<\/span>":t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode=="CHECKED IN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CHECKEDIN").text()+")<\/span>":'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TicketStatusCode+")<\/span>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].AncillaryName" type="hidden" value="'+n("#translate-text-ETicketNumber").text()+'">'):(h+='<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__IsSelected">'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].AncillaryName+"<\/label>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].AncillaryName" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].AncillaryName+'">'),h+="<\/div>",h+='<div class="form-group" style="padding-left: 40px;width:25%;">',h+="<span>"+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TravelerName+"<\/span>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].TravelerName" id="PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__TravelerName" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].TravelerName+'">',h+="<\/div>",h+='<div class="form-group" style = "padding-left: 140px;width:25%;" >',h+="<span>"+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].ItemNumber+"<\/span>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].ItemNumber" id="PNRViewModel_PNRTrips_'+f+"__TripSegment_"+s+"__AncillaryItems_"+e+'__ItemNumber" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].ItemNumber+'">',h+="<\/div>",h+="<\/div>",h+='<input name="PNRViewModel.PNRTrips['+f+"].TripSegment["+s+"].AncillaryItems["+e+'].ConfirmationNumber" type="hidden" value="'+t.PNRTrips[f].TripSegment[s].AncillaryItems[e].ConfirmationNumber+'">'),n("#Ancillary_"+u+c+"").html(h)}UA.UI.InFieldLabel.init(null,null,n("#refundForm"));o.loader("destroy")},error:function(){alert("An Error has occured while loading data!");o.loader("destroy")},complete:function(){}};else{if(UA.UI.InFieldLabel.init(null,null,n("#refundForm")),e=="true"&&n("#collapse_"+u+"").hasClass("icon-toggle-arrow-up-gray"))for(f=1;f<=i;f++)n("#"+u+f+"").addClass("visuallyhidden"),n("#collapse_"+u+"").addClass("icon-toggle-arrow-down-gray").removeClass("icon-toggle-arrow-up-gray");else if(e=="true"&&n("#collapse_"+u+"").hasClass("icon-toggle-arrow-down-gray"))for(f=1;f<=i;f++)n("#"+u+f+"").removeClass("visuallyhidden"),n("#collapse_"+u+"").addClass("icon-toggle-arrow-up-gray").removeClass("icon-toggle-arrow-down-gray");else for(f=1;f<=i;f++)n("#"+u+f+"").addClass("visuallyhidden"),n("#collapse_"+u+"").addClass("icon-toggle-arrow-down-gray").removeClass("icon-toggle-arrow-up-gray");return!1}n.ajax(h)},handleRefundPolicy:function(t){t.preventDefault();n(this).find("i").hasClass("icon-toggle-arrow-down-gray")?(n(this).find("i").removeClass("icon-toggle-arrow-down-gray").addClass("icon-toggle-arrow-up-gray"),console.log(n(this).next()),n(this).next().removeClass("hide")):(n(this).find("i").removeClass("icon-toggle-arrow-up-gray").addClass("icon-toggle-arrow-down-gray"),n(this).next().addClass("hide"))},ancillaryNotListedCheck:function(t){var i=t.currentTarget.id;i=i.substring(9,i.length);n("#refundForm").removeData("validator").removeData("unobtrusiveValidation");n.validator.unobtrusive.parse(n("#refundForm"));n("#AncillaryNotFound_"+i+"").is(":hidden")?(n("#AncillaryNotFound_"+i+"").show(),UA.UI.InFieldLabel.init(null,null,n("#refundForm")),n("#AncillaryReceipts_"+i+" input").attr("disabled",!1),UA.Customer.Refund.incrementReceiptCount()):(UA.Customer.Refund.removeAllItems("AncillaryReceipts_"+i+""),UA.UI.InFieldLabel.init(null,null,n("#refundForm")),n("#AncillaryNotFound_"+i+"").hide())},handleAddAncillaryReceipt:function(t){t.preventDefault();var i=n(t.target).closest("div").children().prevObject[0];UA.Customer.Refund.addItem(i.id)},handleRemoveAncillaryReceipt:function(t,i){var u,f,r;t.preventDefault();u=n(t.target).closest("div").children().prevObject[0];n("#refundForm").removeData("validator").removeData("unobtrusiveValidation");n.validator.unobtrusive.parse(n("#refundForm"));f=UA.Customer.Refund.removeItem(u.id,i);f&&(r=u.id,r=r.substring(18,u.length),n("#AncillaryNotFound_"+r+"").hide(),n("#CheckBox_"+r+"").attr("checked",!1))},InitPNRView:function(){n("#RFPNRDataByMP #tblpnrtrip").length>5?(n("#RFPNRDataByMP #tblpnrtrip").slice(5,n("#RFPNRDataByMP #tblpnrtrip").length).addClass("visuallyhidden"),n("#loadMore").text("+ Load More")):n("#loadMore").addClass("visuallyhidden")},handleShowHIdePNRResults:function(){n("#loadMore").text()=="+ Load More"&&(n("#RFPNRDataByMP #tblpnrtrip").slice(0,n("#RFPNRDataByMP #tblpnrtrip").length).removeClass("visuallyhidden"),n("#loadMore").focus());n("#loadMore").text()=="- Show Less"&&(n("#RFPNRDataByMP #tblpnrtrip").slice(5,n("#RFPNRDataByMP #tblpnrtrip").length).addClass("visuallyhidden"),n("#loadMore").focus());n("#loadMore").text()=="- Show Less"?n("#loadMore").text("+ Load More"):n("#loadMore").text("- Show Less")},handleAddFlightPopup:function(){n("#addFlightmodal").modal({containerClass:"modal-add-flight"});n("#Error").addClass("visuallyhidden")},handleAdditionInfoTextBoxInfoChange:function(){var t=1e3;n("#textMessage").keyup(function(){var i=n(this).val().length,u=n(this).val(),r=t-i;i>t&&(n(this).val(u.substring(0,t)),i=n(this).val().length,r=t-i);n("#letterCount").html(r+"/"+t)})},handleRefundSubmit:function(t){var f;t.preventDefault();var i=n(".RFPNRContainerStyle").find("input[type=checkbox]"),r=n("#refundForm").validate(),u=n("#refundForm").valid();n(".RFPNRContainerStyle").length==0&&n("#receiptDetails").css("display")=="none"?(n("#refunditem-error").show(),window.scrollTo(0,n("#refunditem-error").offset().top)):i.length==i.not(":checked").length&&n("#receiptDetails").css("display")=="none"?(n("#refunditem-error").show(),window.scrollTo(0,n("#refunditem-error").offset().top)):u?(n("#refunditem-error").hide(),n("#submitBtn").attr("disabled","disabled"),f=n("#submitBtn").loader({preset:"smallRight"}),n("#refundForm").submit()):(n("#refunditem-error").hide(),r.focusInvalid())},handleRefundStatusSubmit:function(t){var f=n("#refundStatusForm").valid(),i,r,u;f?(t.preventDefault(),n(".link-st-refund-status").attr("disabled","disabled"),i=n(".link-st-refund-status").loader({preset:"btnCenter"}),n(".RefundStatusStyle").css("display","none"),n("#refundid").css("display","none"),n("#refunderror").css("display","none"),n("#refundhelperror").css("display","none"),n("#refund-denied").css("display","none"),n("#refund-pending").css("display","none"),n("#refunddenyerror").css("display","none"),r=n(".link-st-refund-status").data("requesturl"),u={requestid:n("#StausTrackingnumber").val(),Lastname:n("#StatusLastName").val()},n.ajax({url:r,type:"GET",data:u,cache:!1,dataType:"json",success:function(t){var r=null,u;t.res!=null&&(r=JSON.parse(t.res));r!=null?r.RequestSequence!=0&&r.StatusMsgID==null&&r.StatusDescription=="Request Received - pending review"?(n("#refund-pending").css("display","block"),n("#refundHeading").html(r.StatusDescription)):r.RequestSequence!=0&&r.StatusMsgID=="Denied"?(n("#refund-denied").css("display","block"),n("#refundHeading").css("display","block"),n("#refunddenyerror").css("display","block"),n("#refunddenyerror").html(r.StatusDescription)):r.RequestSequence!=0&&r.StatusMsgID=="PendingAdditionalInfo"?(n("#refund-pending").css("display","block"),n("#refundHeading").html(r.StatusDescription)):r.RequestSequence!=0&&r.StatusMsgID=="PendingCheckPrint"?(n("#refund-pending").css("display","block"),n("#refundHeading").html(r.StatusDescription)):r.RequestSequence!=0&&r.StatusMsgID=="PendingPay"?(n("#refund-pending").css("display","block"),n("#refundHeading").html(r.StatusDescription)):r.RequestSequence!=0&&r.StatusMsgID=="Complete"?(n("#refundid").css("display","block"),n("#refundCompleted").html(r.StatusDescription),n(".RefundStatusStyle").css("display","inline-table"),n("#request-number").html(r.RequestSequence),n("#document-number").html(r.RefundedTickets[0]),n("#passenger-name").html(r.PaxName),u=new Date(r.CompletionDate),n("#refund-date").html(u.getMonth()+1+"/"+u.getDate()+"/"+u.getFullYear()),n("#refundvalue").html(r.RefundValue),n("#refundpenalty").html(r.Penalty),n("#refundpayment").html(r.FormOfPayments),n("#refundcurrency").html(r.RefundCurrency)):(n("#refunderror").css("display","block"),n("#refundHeading").css("display","block"),n("#refundhelperror").css("display","block")):(n("#refunderror").css("display","block"),n("#refundHeading").css("display","block"),n("#refundhelperror").css("display","block"));n(".link-st-refund-status").removeAttr("disabled");i.loader("destroy")},error:function(){alert("An Error has occured while loading data!");n(".link-st-refund-status").removeAttr("disabled");i.loader("destroy")}})):validator.focusInvalid()},initReceiptDetail:function(){var t=n("#ReceiptDetailModel_IsVisible").val();t==="true"?(n("#receiptDetails").show(),n("#receiptDetailsList input").attr("disabled",!1),n("#ReceiptDetailModel_IsVisible").val("true")):n("#receiptDetailsList input").attr("disabled",!0)},initSubscriptionReceiptDetail:function(){var t=n("#Subscriptions_SubscriptionNotListed").is(":checked");t===!0?(n("#subscriptionNotFound").show(),n("#subscriptionNotFound input").attr("disabled",!1)):n("#subscriptionNotFound input").attr("disabled",!0)},handleReceiptDetailsClick:function(t){t.preventDefault();n("#receiptDetails").is(":hidden")&&(n("#receiptDetails").show(),n("#receiptDetailsList input").attr("disabled",!1),UA.Customer.Refund.incrementReceiptCount(),n("#ReceiptDetailModel_IsVisible").val("true"))},handleAddReceiptDetail:function(n){n.preventDefault();UA.Customer.Refund.addItem("receiptDetailsList")},handleRemoveReceiptDetail:function(t,i){t.preventDefault();var r=UA.Customer.Refund.removeItem("receiptDetailsList",i);r&&(n("#receiptDetails").hide(),n("#ReceiptDetailModel_IsVisible").val("false"))},handleDirectTv:function(t,i){t.preventDefault();n(i).show();n("#"+n(i).context.id+" :input").attr("disabled",!1);var r=n("#seg_DirectTVItem_Name").html("&reg;").text();n("#seg_DirectTVItem_Name").val("DIRECTV"+r+"");n("#seg_DirectTVItem_Name").attr("disabled",!0);n("#"+n(i).context.id+' :input[id*="_HasDirectTV"]').val(!0);n("#refundForm").find("input").blur()},handleRemoveDirectTV:function(t,i){t.preventDefault();n(i).hide();n("#"+n(i).context.id+" :input").val("");n("#"+n(i).context.id+" :input").attr("disabled",!0);n("#"+n(i).context.id+' :input[id*="_HasDirectTV"]').val(!1)},subscriptiontNotListedCheck:function(){n("#Subscriptions_SubscriptionNotListed").is(":checked")?(n("#subscriptionNotFound").show(),n("#subscriptionReceipts :input").attr("disabled",!1),UA.Customer.Refund.incrementReceiptCount()):(UA.Customer.Refund.removeAllItems("subscriptionReceipts"),n("#subscriptionReceipts input").attr("disabled",!0),n("#subscriptionNotFound").hide())},handleAddSubReceipt:function(n){n.preventDefault();UA.Customer.Refund.addItem("subscriptionReceipts")},handleRemoveSubReceipt:function(t,i){t.preventDefault();var r=UA.Customer.Refund.removeItem("subscriptionReceipts",i);r&&(n("#subscriptionNotFound").hide(),n("#Subscriptions_SubscriptionNotListed").attr("checked",!1),n("#subscriptionReceipts :input").attr("disabled",!0))},initializeItem:function(t,i,r){var s=/(\d+)(?!.*\d)/,e,u,o,f,h;for(r&&t.find(".form-group").removeClass("input-validation-error"),e=t.find(".ifl"),u=0;u<e.length;u++)n(e[u]).attr("for",n(e[u]).attr("for").replace(s,i)),r&&(n(e[u]).removeClass("visuallyhidden"),n(e[u]).attr("style","opacity:1"));for(o=t.find("span"),u=0;u<o.length;u++)n(o[u]).attr("data-valmsg-for")&&n(o[u]).attr("data-valmsg-for",n(o[u]).attr("data-valmsg-for").replace(s,i)),r&&n(o[u]).attr("class","field-validation-valid");for(f=t.find("input"),u=0;u<f.length;u++)n(f[u]).attr("id",n(f[u]).attr("id").replace(s,i)),n(f[u]).attr("name",n(f[u]).attr("name").replace(s,i)),r&&(n(f[u]).val(""),n(f[u]).removeClass("input-validation-error"),n(f[u]).blur());h=t.find("a");h&&h.attr("onclick",h.attr("onclick").replace(s,i))},addItem:function(t){UA.Customer.Refund.incrementReceiptCount();var i=n("#"+t),u=i.children().length,r=i.children().first().clone();UA.Customer.Refund.initializeItem(r,u,!0);i.append(r);UA.UI.InFieldLabel.init(null,null,r);n("#refundForm").removeData("validator").removeData("unobtrusiveValidation");n.validator.unobtrusive.parse(n("#refundForm"))},removeItem:function(t,i){var r,u;if(UA.Customer.Refund.decrementReceiptCount(),r=n("#"+t),i==0&&r.children().length==1)return UA.Customer.Refund.initializeItem(r.children().first(),0,!0),n("#"+t+" input").attr("disabled",!0),!0;for(n(r.children()[i]).remove(),u=i;u<r.children().length;u++)UA.Customer.Refund.initializeItem(n(r.children()[u]),u,!1);return!1},removeAllItems:function(n){while(!UA.Customer.Refund.removeItem(n,0));},checkMaxReceiptCount:function(){var t=UA.Customer.Refund.receiptCounter();console.log("Receipt counter "+t);t>15?(n("#maxReceiptError").show(),n("#submitBtn").attr("disabled",!0),window.setTimeout(function(){n(window).scrollTop(0)},0)):n("#maxReceiptError").is(":visible")&&(n("#maxReceiptError").hide(),n("#submitBtn").attr("disabled",!1))},incrementReceiptCount:function(){var t=UA.Customer.Refund.receiptCounter();t=t+1;n("#ReceiptCount").val(t);UA.Customer.Refund.checkMaxReceiptCount()},decrementReceiptCount:function(){var t=UA.Customer.Refund.receiptCounter();t=t-1;n("#ReceiptCount").val(t);UA.Customer.Refund.checkMaxReceiptCount()},checkboxReceiptCount:function(t){var i=t.target.id,r=n("input[id='"+i+"']:checked").length;r==0?UA.Customer.Refund.decrementReceiptCount():UA.Customer.Refund.incrementReceiptCount()},receiptCounter:function(){return parseInt(n("#ReceiptCount").val())}}}();n(document).ready(function(){UA.Customer.Refund.init()})})(jQuery),function(n){"use strict";UA.Utilities.namespace("UA.Customer.CustomerCommon");UA.Customer.CustomerCommon=function(){return{init:function(){n('input:radio[name="confirmationNumberString"]').change(function(){n(this).is(":checked")&&n(this).val()=="Yes"&&(document.getElementById("ConfirmationNumberString").innerHTML=n('input:radio[name="ConfirmationNumberString"]').val())});this.bindEvents();this.initAirportAutocomplete();this.InitPNRPartialView();this.handleContactMethodClick()},bindEvents:function(){this.InitPNRPartialView();this.handleChangeinPNRViewForAddFlight();n(document).on("click","#AddFlight",this.handleAddFlightPopup);n(document).on("click","#addinfoClick",this.handleAddFlightclick);n(document).on("click","#AdditionalInfoaddinfoClick",this.handleAddFlightAdditionalInfoClick);n(document).on("focusout","#EmailAddress",this.handleEmailAddressChange);n(document).on("click","#addFile",this.handleChooseFile)},handleChangeinPNRViewForAddFlight:function(){n("#tbltrip").each(function(){n(".PNRRadio .radio").text("");n("input[type=radio]",this).get(0).checked=!0})},processContinueAsGuestActions:function(){n.modal.close()},InitPNRPartialView:function(){n("#tbltrip").each(function(){n(".PNRRadio .radio").text("");n("input[type=radio]",this).get(0).checked=!0})},handleShowHIdePNRResults:function(){n("#loadMore").text()=="Load More"&&n("#PNRDataByMP #tbltrip").slice(0,n("#PNRDataByMP #tbltrip").length).removeClass("visuallyhidden");n("#loadMore").text()=="Show Less"&&n("#PNRDataByMP #tbltrip").slice(5,n("#PNRDataByMP #tbltrip").length).addClass("visuallyhidden");n("#loadMore").text()=="Show Less"?n("#loadMore").text("Load More"):n("#loadMore").text("Show Less")},CloseModalPopup:function(){n("#addFlightmodal").dialog("close")},AirpportFieldError:function(t){_.forEach(t,function(t){var i=n('input[name="'+t.elementKey+'"]');i.parent().parent().hasClass("input-validation-error")&&(i.attr("aria-describedby",i.attr("id")+"-error"),i.parent().find(".field-validation-error").show(),i.focus(),i.parent().find(".tt-menu").hide())})},SubmitAddFlightAdditionalInfoRP:function(){var i=n("#AddFlightLastNameforAdditionalIfo").val(),r=n("#AdditionalFlightdate").val(),u=n("#AdditionalOriginalCity").val(),f=n("#AdditionalDestinationCity").val(),e=n("#AdditionalFlightNumber").val(),o=n("#AddFlightAdditionalForm").valid(),s=n("#AddFlightAdditionalForm").validate();if(UA.UI.InFieldLabel.init(null,null,n("#refundForm")),o){n("#AdditionalInfoaddinfoClick").attr("disabled","disabled");var t=n("#AdditionalInfoaddinfoClick").loader({preset:"btnCenter"}),l=parseInt(document.getElementById("clicks").text),h=n("#AddFlightAdditionalcallurl").data("jsonurl-getddditionalinforaddflight"),c={type:"POST",url:h,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({LastName:i,DestinationCity:f,OriginCity:u,FlightDate:r,FlightNumber:e}),timeout:9e4,async:!0,success:function(i){var r,s,u,e,f,o;for(n.modal.close(),r="",s=parseInt(document.getElementById("PnrFLightCount").innerText)+1,s==0&&(s=s+1),r+="<div id=RFPNRDataByMP>",u=s-1;u<i.PNRTrips.length;u++){for(r+='<div id="tbltrip">',r+='<div class="RFPNRContainerStyle" role="presentation">',e=1,f=0;f<i.PNRTrips[u].TripSegment.length;f++){for(r+='<table class="table">',r+="<tbody>",r+='<tr class="RFPNRSegmentRow" onclick="UA.Customer.Refund.handleExpandFS(event,'+i.PNRTrips[u].TripSegment.length+","+u+')" id="'+i.PNRTrips[u].ConfirmationNumber+'">',r+='<td class="RFPNRDataRow RFPNRDataFirstCol"><span class="RFPNRData">'+i.PNRTrips[u].TripSegment[f].DeptDate+'<\/span><input id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DeptAirport" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DeptDate" type="hidden" value="'+i.PNRTrips[u].TripSegment[f].DeptDate+'"><br><span class="RFPNRFNumber">Flight Number:'+i.PNRTrips[u].TripSegment[f].FlightNumber+"<\/span><\/td>",r+='<td class="RFPNRDataRow"><span class="RFPNRData">'+i.PNRTrips[u].TripSegment[f].DeptAirport+"<\/span><br>"+i.PNRTrips[u].TripSegment[f].DeptAirportCity+' <input id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__FlightNumber" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].FlightNumber" type="hidden" value="'+i.PNRTrips[u].TripSegment[f].FlightNumber+'"> <input id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DeptAirport" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DeptAirport" type="hidden" value="'+i.PNRTrips[u].TripSegment[f].DeptAirport+'"> <\/td>',r+='<td class="RFPNRDataRow RFPNRDataRowIcon"><i class="icon-plane-departure-small-black"><\/i><\/td>',r+='<td class="RFPNRDataRow"><span class="RFPNRData">'+i.PNRTrips[u].TripSegment[f].ArrAirport+"<\/span><br>"+i.PNRTrips[u].TripSegment[f].ArrAirportCity+' <input id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__ArrAirport" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].ArrAirport" type="hidden" value="'+i.PNRTrips[u].TripSegment[f].ArrAirport+'"> <\/td>',r+=i.PNRTrips[u].TripSegment[0]==i.PNRTrips[u].TripSegment[f]?'<td class="RFPNRDataRowlast"><a> <i class="icon-toggle-arrow-down-gray" id="collapse_'+i.PNRTrips[u].ConfirmationNumber+'"><\/i><\/a><\/td>':'<td class="RFPNRDataRowlast"> <\/td>',r+="<\/tr>",i.PNRTrips[u].TripSegment[0]!=i.PNRTrips[u].TripSegment[f]&&i.PNRTrips[u].TripSegment.length>1&&(r+='<hr style="margin-left:8em;margin-right :8em;" />'),r+="<\/tbody>",r+="<\/table>",r+="<div id="+i.PNRTrips[u].ConfirmationNumber+e+' class="visuallyhidden">',r+='<div id="directTv_'+i.PNRTrips[u].ConfirmationNumber+e+'" style="padding-bottom: 10px; padding-left: 20px;display: none;">',r+='<div class="form-row form-row-narrow-8px ua-left-offset-25px">',r+='<div class="form-group ua-size-55-12 ua-offset-1-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_Last4CC">'+n("#translate-text-last4CC").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.Last4CC" data-valmsg-replace="true"><\/span><input length="0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-last4CCVal").text()+'<!--EC:V1-->" id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_Last4CC" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.Last4CC" type="text" value="" disabled="disabled"><\/div>',r+='<div class="form-group ua-size-55-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_NoOfPurchases">'+n("#translate-text-numOfPurchases").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.NoOfPurchases" data-valmsg-replace="true"><\/span><input length="0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-numOfPurchasesVal").text()+'<!--EC:V1-->" id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_NoOfPurchases" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.NoOfPurchases" type="text" value="" disabled="disabled"><\/div>',r+="<\/div>",r+='<div class="form-row form-row-narrow-8px ua-left-offset-25px">',r+='<div class="form-group ua-size-55-12 ua-offset-1-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_AmountPaid">'+n("#translate-text-amountPaid").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.AmountPaid" data-valmsg-replace="true"><\/span><input length="0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-amountPaidval").text()+'<!--EC:V1-->" id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_AmountPaid" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.AmountPaid" type="text" value="" disabled="disabled"><\/div>',r+='<div class="form-group ua-size-55-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_SeatNumber">'+n("#translate-text-seat").text()+'<\/label><input length="0" id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_SeatNumber" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.SeatNumber" type="text" value="" disabled="disabled"><input id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+'__DirectTVItem_HasDirectTV" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+'].DirectTVItem.HasDirectTV" type="hidden" value="false" disabled="disabled"><\/div>',r+="<\/div>",r+='<div class="form-row form-row-narrow-8px ua-left-offset-25px">',r+='<a class="form-group ua-no-margin" id="directTvRemove_'+i.PNRTrips[u].ConfirmationNumber+e+'" style="float:right; padding-top:18px;" href="" onclick="UA.Customer.Refund.handleRemoveDirectTV(event,directTv_'+i.PNRTrips[u].ConfirmationNumber+e+');">'+n("#translate-text-remove").text()+"<\/a>",r+="<\/div>",r+="<\/div>",r+="<div id=Ancillary_"+i.PNRTrips[u].ConfirmationNumber+e+">",r+='<div id="AncillaryView_'+i.PNRTrips[u].ConfirmationNumber+e+'" class="form-row" style="color: gray;font-size:small">',r+='<div class="form-group" style="padding-left: 40px;width:25%;">',r+="<\/div>",r+="<\/div>",r+='<div style="padding-left :40px; padding-bottom:20px;padding-top:40px;color:darkblue;font-size:small">',r+='<span aria-hidden="true" class="field-validation-valid" data-valmsg-for="'+i.PNRTrips[u].TripSegment[f].AncillaryNotListed+'" data-valmsg-replace="true"><\/span><input class="type-checkbox" data-val="true" data-val-required="'+n("#translate-text-ancillaryNotListed").text()+'." id="CheckBox_'+i.PNRTrips[u].ConfirmationNumber+e+'" name = "'+i.PNRTrips[u].TripSegment[f].AncillaryNotListed+'" onclick = "UA.Customer.Refund.ancillaryNotListedCheck(event)" type = "checkbox" value = "true">',r+='<input name="'+i.PNRTrips[u].TripSegment[f].AncillaryNotListed+'" type="hidden" value="false"><label class="checkbox" for="CheckBox_'+i.PNRTrips[u].ConfirmationNumber+e+'">'+n("#translate-text-purchaseNotListed").text()+"<\/label >",r+="<\/div>",r+='<div id="AncillaryNotFound_'+i.PNRTrips[u].ConfirmationNumber+e+'" style="padding-bottom: 20px; padding-left: 20px; display:none">',r+='<div id="AncillaryDetails" class="customer-Common">',r+=' <div id="AncillaryReceipts_'+i.PNRTrips[u].ConfirmationNumber+e+'">',o=0;o<i.PNRTrips[u].TripSegment[f].ReceiptDetailsList.length;o++)r+="<div>",r+='<div class="form-row form-row-narrow-8px ua-left-offset-25px">',r+='<div class="form-group ua-size-55-12 ua-offset-1-12" >',r+='<label class="ifl" for="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+"__ReceiptDetailsList_"+o+'__AncillaryItemName">'+n("#translate-text-nameOfItemForRefund").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label>',r+='<span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+"].ReceiptDetailsList["+o+'].AncillaryItemName" data-valmsg-replace="true"><\/span>',r+='<input length = "0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-nameOfItemForRefundVal").text()+'.<!--EC:V1-->" id = "PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+"__ReceiptDetailsList_"+o+'__AncillaryItemName" name = "PNRViewModel.PNRTrips['+u+"].TripSegment["+f+"].ReceiptDetailsList["+o+'].AncillaryItemName" type = "text" value = "" disabled="disabled">',r+="<\/div>",r+='<div class="form-group ua-size-55-12">',r+='<label class="ifl" for="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+"__ReceiptDetailsList_"+o+'__AncillaryItemNumber">'+n("#translate-text-documentNumber").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label>',r+='<span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+"].ReceiptDetailsList["+o+'].AncillaryItemNumber" data-valmsg-replace="true"><\/span>',r+='<input length="0" data-val="true" aria-required="true" data-val-required="'+n("#translate-text-documentNumberVal").text()+'.<!--EC:V142-->" data-val-length-max="14" data-val-regex="'+n("#translate-text-documentNumberVal").text()+'" data-val-regex-pattern="[0-9]{13,14}" id="PNRViewModel_PNRTrips_'+u+"__TripSegment_"+f+"__ReceiptDetailsList_"+o+'__AncillaryItemNumber" maxlength="14" name="PNRViewModel.PNRTrips['+u+"].TripSegment["+f+"].ReceiptDetailsList["+o+'].AncillaryItemNumber" type="text" value="" disabled="disabled">',r+="<\/div>",r+=" <\/div>",r+='<div class="form-row ua-no-margin" id="AncillaryReceipts_'+i.PNRTrips[u].ConfirmationNumber+e+'">',r+=' <form-group style="float:right; padding-right :25px;">',r+=' <a href="" onclick="UA.Customer.Refund.handleRemoveAncillaryReceipt(event,'+o+');">'+n("#translate-text-remove").text()+"<\/a>",r+=" <\/form-group>",r+="<\/div>",r+="<\/div>";r+="<\/div>";r+='<div id="AncillaryReceipts_'+i.PNRTrips[u].ConfirmationNumber+e+'" style="padding-left :20px;">';r+='<a href="" onclick="UA.Customer.Refund.handleAddAncillaryReceipt(event)">'+n("#translate-text-addPurchase").text()+"<\/a>";r+="<\/div>";r+="<\/div>";r+="<\/div>";r+="<\/div>";e=e+1}r+="<\/div>";r+="<br>";r+="<\/div>";s=s+1}r+="<\/div>";r+="<br>";n("#PNRPartialViewContainer").append(r);document.getElementById("PnrFLightCount").innerText=s-1;n("#refundForm").removeData("validator").removeData("unobtrusiveValidation");n.validator.unobtrusive.parse(n("#refundForm"));n("#AdditionalInfoaddinfoClick").removeAttr("disabled");t.loader("destroy")},error:function(){alert("An Error has occured while loading data!");n("#AdditionalInfoaddinfoClick").removeAttr("disabled");t.loader("destroy")},complete:function(){}};n.ajax(c)}else s.focusInvalid()},SubmitAddFlightAdditionalInfoCC:function(){var i=n("#AddFlightLastNameforAdditionalIfo").val(),r=n("#AdditionalFlightdate").val(),u=n("#AdditionalOriginalCity").val(),f=n("#AdditionalDestinationCity").val(),e=n("#AdditionalFlightNumber").val(),o=n("#AddFlightAdditionalForm").valid(),s=n("#AddFlightAdditionalForm").validate();if(o){n("#AdditionalInfoaddinfoClick").attr("disabled","disabled");var t=n("#AdditionalInfoaddinfoClick").loader({preset:"btnCenter"}),l=parseInt(document.getElementById("clicks").text),h=n("#AddFlightAdditionalcallurl").data("jsonurl-getddditionalinforaddflight"),c={type:"POST",url:h,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({LastName:i,DestinationCity:f,OriginCity:u,FlightDate:r,FlightNumber:e}),timeout:9e4,async:!0,success:function(i){var r,e,u,f;for(n.modal.close(),r="",e=parseInt(document.getElementById("PnrFLightCount").innerText)+1,e==0&&(e=e+1),r+="<div id=PNRDataByMP>",u=0;u<i.PNRTrips.length;u++){for(r+='<div id="tbltrip">',r+='<table class="table PNRContainerStyle" role="presentation">',r+="<tbody>",f=0;f<i.PNRTrips[u].TripSegment.length;f++)r+='<tr class="PNRSegmentRow">',r+=i.PNRTrips[u].TripSegment[0]==i.PNRTrips[u].TripSegment[f]?'<td class="PNRRadio"><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="confirmationNumberString" data-valmsg-replace="true"><\/span><input checked="checked" aria-label="Select Flight Option '+e+'" class="type-radio " id="confirmationNumberString_'+i.PNRTrips[u].confirmationNumberString+'" name="confirmationNumberString" type="radio" value="'+i.PNRTrips[u].confirmationNumberString+'"><label class="radio" for="confirmationNumberString_'+i.PNRTrips[u].confirmationNumberString+'"><\/label><\/td>':'<td class="PNRRadio"> <\/td>',r+='<td class="PNRDataRow PNRDataFirstCol"><span class="PNRData">'+i.PNRTrips[u].TripSegment[f].DeptDate+'<\/span><br><span class="PNRFNumber">Flight Number:'+i.PNRTrips[u].TripSegment[f].FlightNumber+"<\/span> <\/td>",r+='<td class="PNRDataRow"><span class="PNRData">'+i.PNRTrips[u].TripSegment[f].DeptAirport+"<\/span><br>"+i.PNRTrips[u].TripSegment[f].DeptAirportCity+"<\/td>",r+='<td class="PNRDataRow PNRDataRowIcon"><i class="icon-plane-departure-small-black"><\/i><\/td>',r+='<td class="PNRDataRow"><span class="PNRData">'+i.PNRTrips[u].TripSegment[f].ArrAirport+"<\/span><br>"+i.PNRTrips[u].TripSegment[f].ArrAirportCity+"<\/td>",r+="<\/tr>";r+="<\/tbody>";r+="<\/table>";r+="<br>";r+="<\/div>";e=e+1}r+="<\/div>";n("#PNRPartialViewContainer").append(r);document.getElementById("PnrFLightCount").innerText=e-1;n("#AdditionalInfoaddinfoClick").removeAttr("disabled");t.loader("destroy")},error:function(){alert("An Error has occured while loading data!");n("#AdditionalInfoaddinfoClick").removeAttr("disabled");t.loader("destroy")},complete:function(){}};n.ajax(c)}else s.focusInvalid()},handleAddFlightAdditionalInfoClick:function(t){t.preventDefault();var r=document.getElementById("lblController").innerText,u=n("#AddFlightAdditionalForm").validate(),o=n("#AddFlightAdditionalForm").valid();if(o){var s=n("#ValidateAirportcallurl").data("jsonurl-validateairportcodeurl"),c=this,e,f=!0,i=[],h=6;n(".airport-autocomplete").find("input").each(function(t){var r,u;t<2*h&&(r=n(this),r.attr("id")&&r.attr("id").length>19?(u=r.attr("id").substr(19,1),n("#TripsForEditSearch_"+u+"__Ignored").length>0?n("#TripsForEditSearch_"+u+"__Ignored").val()==="false"&&i.push({elementKey:r.attr("name"),elementValue:r.val()}):i.push({elementKey:r.attr("name"),elementValue:r.val()})):i.push({elementKey:r.attr("name"),elementValue:r.val()}))});e=n.ajax({cache:!1,url:s,type:"post",contentType:"application/json; charset=utf-8",data:JSON.stringify({airportCodes:i,SearchTypeMain:"Multi"}),traditional:!0});n.when(e).done(function(t){var o,e,s;if(t!==null&&typeof t!="undefined"&&t.length>0){for(o={},e=0;e<t.length;e++)t[e].errorType===2?(s=n('input[name="'+t[e].element+'"]'),o[t[e].element]=s.val().trim()==""?s.data("val-required"):s.data("val-regex"),f=!1):t[e].errorType===3&&(o[t[e].element]=t[e].errorMsg,f=!1);f?(r.toLowerCase()=="customercare"&&UA.Customer.CustomerCommon.SubmitAddFlightAdditionalInfoCC(),r.toLowerCase()=="refund"&&UA.Customer.CustomerCommon.SubmitAddFlightAdditionalInfoRP()):(u.showErrors(o),u.focusInvalid())}else r.toLowerCase()=="customercare"&&UA.Customer.CustomerCommon.SubmitAddFlightAdditionalInfoCC(),r.toLowerCase()=="refund"&&UA.Customer.CustomerCommon.SubmitAddFlightAdditionalInfoRP();setTimeout(function(){UA.Customer.CustomerCommon.AirpportFieldError(i)},1)})}else u.focusInvalid()},InitAddFlightPartialView:function(){n("#tbltrip").each(function(){n(".PNRRadio .radio").text("");n("input[type=radio]",this).get(0).checked=!0});n("#PNRDataByMP #tbltrip").slice(5,n("#PNRDataByMP #tbltrip").length).addClass("visuallyhidden");n("#loadMore").text("Load More")},handleAdditionInfoForAddFilght:function(){n("#AddFlightForm").hide();n("#AddFlightAdditionalForm").show();n("#AddFlightAdditionalForm").trigger("reset");n("#AdditionalOriginalCity").val("");n("#AdditionalDestinationCity").val("");document.getElementById("isAdditionalbtnclick").innerHTML="1";n("#Error").addClass("visuallyhidden")},initAirportAutocomplete:function(){UA.UI.Autocomplete.applyAirportAutocomplete(n("input[data-autocomplete-airport]"))},handleAddFlightPopup:function(){n("#AddFlightAdditionalForm").trigger("reset");n("#AddFlightAdditionalForm").find("input").blur();n("#AdditionalOriginalCity").val("");n("#AdditionalDestinationCity").val("");document.getElementById("clicks").innerHTML=0;n("#AddFlightAdditionalForm").hide();n("#addFlightmodal").modal({containerClass:"modal-add-flight",persist:!0});n("#AddFlightForm").show();n("#AddFlightForm").trigger("reset");n("#AddFlightForm").find("input").blur();n("#Error").addClass("visuallyhidden")},handleAddFlightclick:function(n){n.preventDefault();var t=document.getElementById("lblController").innerText;t.toLowerCase()=="customercare"&&UA.Customer.CustomerCommon.submitAddFlightCC();t.toLowerCase()=="refund"&&UA.Customer.CustomerCommon.submitAddFlightRP()},submitAddFlightRP:function(){var f=n("#AddFlightLastName").val(),e=n("#Reservationnumber").val(),i,r;if(UA.UI.InFieldLabel.init(null,null,n("#refundForm")),i=n("#AddFlightForm").validate(),r=n("#AddFlightForm").valid(),r){n("#addinfoClick").attr("disabled","disabled");var t=n("#addinfoClick").loader({preset:"btnCenter"}),u=parseInt(document.getElementById("clicks").text),o=n("#AddFlightcallurl").data("jsonurl-getaddflightresponseadd"),s={type:"POST",url:o,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({LastName:f,ReservationNumber:e}),timeout:9e4,async:!0,success:function(i){var l,a,v,e,c,r,s,f,o,h;if(i.PNRStatus=="Not Found")u+=1,document.getElementById("clicks").innerHTML=u,n("#Error").removeClass("visuallyhidden"),l=n("#lblfirsterror").text(),a=n("#lblSeconderror").text(),parseInt(document.getElementById("clicks").text)==1?(document.getElementById("Error").innerHTML="<i class=icon-page-error><\/i><span aria - label="+l+">"+l+"<\/span>",n("#addinfoClick").removeAttr("disabled"),t.loader("destroy")):parseInt(document.getElementById("clicks").text)==2&&(n("#AddFlightForm").hide(),n("#AddFlightAdditionalForm").show(),document.getElementById("Error").innerHTML="<i class=icon-page-error><\/i><span aria - label="+a+">"+a+"<\/span>",n("#addinfoClick").removeAttr("disabled"),t.loader("destroy"));else if(i.PNRStatus=="Already Exist")v=document.getElementById("lblAlreadyExist").innerText,n("#Error").removeClass("visuallyhidden"),document.getElementById("Error").innerHTML="<i class=icon-page-error><\/i><span aria - label="+v+">"+v+"<\/span>",n("#addinfoClick").removeAttr("disabled"),t.loader("destroy");else{for(n("#Error").addClass("visuallyhidden"),n.modal.close(),e="",c=parseInt(document.getElementById("PnrFLightCount").innerText)+1,c==0&&(c=c+1),e+="<div id=RFPNRDataByMP>",r=c-1;r<i.PNRTrips.length;r++){for(e+='<div id="tbltrip">',e+='<div class="RFPNRContainerStyle" role="presentation">',s=1,f=0;f<i.PNRTrips[r].TripSegment.length;f++){if(e+='<table class="table">',e+="<tbody>",e+='<tr class="RFPNRSegmentRow" onclick="UA.Customer.Refund.handleExpandFS(event,'+i.PNRTrips[r].TripSegment.length+","+r+')" id="'+i.PNRTrips[r].ConfirmationNumber+'">',e+='<input name="PNRViewModel.PNRTrips['+r+'].TripSegment.Index" value="'+f+'" type="hidden" />',e+='<td class="RFPNRDataRow RFPNRDataFirstCol"><span class="RFPNRData">'+i.PNRTrips[r].TripSegment[f].DeptDate+'<\/span><br><span class="RFPNRFNumber">Flight Number:'+i.PNRTrips[r].TripSegment[f].FlightNumber+"<\/span> <\/td>",e+='<td class="RFPNRDataRow"><span class="RFPNRData">'+i.PNRTrips[r].TripSegment[f].DeptAirport+"<\/span><br>"+i.PNRTrips[r].TripSegment[f].DeptAirportCity+"<\/td>",e+='<td class="RFPNRDataRow RFPNRDataRowIcon"><i class="icon-plane-departure-small-black"><\/i><\/td>',e+='<td class="RFPNRDataRow"><span class="RFPNRData">'+i.PNRTrips[r].TripSegment[f].ArrAirport+"<\/span><br>"+i.PNRTrips[r].TripSegment[f].ArrAirportCity+"<\/td>",e+=i.PNRTrips[r].TripSegment[0]==i.PNRTrips[r].TripSegment[f]?'<td class="RFPNRDataRowlast"><a> <i class="icon-toggle-arrow-down-gray" id="collapse_'+i.PNRTrips[r].ConfirmationNumber+'"><\/i><\/a><\/td>':'<td class="RFPNRDataRowlast"> <\/td>',e+="<\/tr>",i.PNRTrips[r].TripSegment[0]!=i.PNRTrips[r].TripSegment[f]&&i.PNRTrips[r].TripSegment.length>1&&(e+='<hr style="margin-left:3em;margin-right :8em;" />'),e+="<\/tbody>",e+="<\/table>",e+="<div id="+i.PNRTrips[r].ConfirmationNumber+s+' class="visuallyhidden">',e+='<div id="directTv_'+i.PNRTrips[r].ConfirmationNumber+s+'" style="padding-bottom: 10px; padding-left: 20px;display: none;">',e+='<div class="form-row form-row-narrow-8px ua-left-offset-25px">',e+='<div class="form-group ua-size-55-12 ua-offset-1-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_Last4CC">'+n("#translate-text-last4CC").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.Last4CC" data-valmsg-replace="true"><\/span><input length="0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-last4CCVal").text()+'<!--EC:V1-->" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_Last4CC" name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.Last4CC" type="text" value="" disabled="disabled"><\/div>',e+='<div class="form-group ua-size-55-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_NoOfPurchases">'+n("#translate-text-numOfPurchases").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.NoOfPurchases" data-valmsg-replace="true"><\/span><input length="0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-numOfPurchasesVal").text()+'<!--EC:V1-->" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_NoOfPurchases" name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.NoOfPurchases" type="text" value="" disabled="disabled"><\/div>',e+="<\/div>",e+='<div class="form-row form-row-narrow-8px ua-left-offset-25px">',e+='<div class="form-group ua-size-55-12 ua-offset-1-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_AmountPaid">'+n("#translate-text-amountPaid").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.AmountPaid" data-valmsg-replace="true"><\/span><input length="0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-amountPaidval").text()+'<!--EC:V1-->" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_AmountPaid" name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.AmountPaid" type="text" value="" disabled="disabled"><\/div>',e+='<div class="form-group ua-size-55-12"><label class="ifl" for="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_SeatNumber">'+n("#translate-text-seat").text()+'<\/label><input length="0" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_SeatNumber" name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.SeatNumber" type="text" value="" disabled="disabled"><input id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+'__DirectTVItem_HasDirectTV" name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+'].DirectTVItem.HasDirectTV" type="hidden" value="false" disabled="disabled"><\/div>',e+='<a class="form-group ua-no-margin" id="directTvRemove_'+i.PNRTrips[r].ConfirmationNumber+s+'" style="float:right; padding-top:18px;" href="" onclick="UA.Customer.Refund.handleRemoveDirectTV(event,directTv_'+i.PNRTrips[r].ConfirmationNumber+s+');">'+n("#translate-text-remove").text()+"<\/a>",e+="<\/div>",e+="<\/div>",e+="<div id=Ancillary_"+i.PNRTrips[r].ConfirmationNumber+s+">",i.PNRTrips[r].TripSegment[f].AncillaryItems.length>0)for(o=0;o<i.PNRTrips[r].TripSegment[f].AncillaryItems.length;o++)i.PNRTrips[r].TripSegment[f].AncillaryItems[o].IsActiveFlight==!0&&i.PNRTrips[r].TripSegment[f].AncillaryItems[o].AncillaryName=="ETicketNumber"?(e+='<div id="AncillaryView_'+i.PNRTrips[r].ConfirmationNumber+s+'" class="form-row" style="color: gray;font-size:small">',e+='<div class="form-group" style="padding-left: 40px;width:25%;">',e+='<span class="field-validation-valid" aria-hidden="true" data-valmsg-replace="true" data-valmsg-for="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].IsSelected"><\/span>',e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].IsSelected" disabled="disable" onclick = "UA.Customer.Refund.checkboxReceiptCount(event)" class="type-checkbox " id="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected" type="checkbox" value="true" data-val-required="The IsSelected field is required." data-val="true">',e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].IsSelected" type="hidden" value="false">',e+=i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode!=""?i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="USED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-USED").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="VOID"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-VOID").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="EXCH"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-EXCH").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="OPEN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-OPEN").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="CLOSED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CLOSED").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="REFUNDED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-REFUNDED").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="UNAVAIL"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-UNAVAIL").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="CHECKED IN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CHECKEDIN").text()+")<\/span>":'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode+")<\/span>":'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-active").text()+")<\/span>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].AncillaryName" type="hidden" value="'+n("#translate-text-ETicketNumber").text()+'">',e+="<\/div>",e+='<div class="form-group" style="padding-left: 40px;width:25%;">',e+="<span>"+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TravelerName+"<\/span>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].TravelerName" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__TravelerName" type="hidden" value="'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TravelerName+'">',e+="<\/div>",e+='<div class="form-group" style = "padding-left: 140px;width:25%;" >',e+="<span>"+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].ItemNumber+"<\/span>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].ItemNumber" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__ItemNumber" type="hidden" value="'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].ItemNumber+'">',e+="<\/div>",e+="<\/div>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].ConfirmationNumber" type="hidden" value="'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].ConfirmationNumber+'">',e+='<span id="spnActiveFlight" style="color: gray; padding-left: 40px; display: inline;">'+n("#translate-text-activeReservations").text()+' <a class="no-rtad link-underline" id="aHeaderManageRes" href="'+document.getElementById("lblreservationlink").innerText+'"> '+n("#translate-text-manageReservations").text()+"<\/a> "+n("#translate-text-activeReservations2").text()+"<\/span>"):(e+='<div id="AncillaryView" class="form-row" style="color:darkblue;font-size:small">',e+='<div class="form-group" style="padding-left: 40px;width:25%;">',e+='<span class="field-validation-valid" aria-hidden="true" data-valmsg-replace="true" data-valmsg-for="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].IsSelected"><\/span>',e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].IsSelected" onclick = "UA.Customer.Refund.checkboxReceiptCount(event)"  class="type-checkbox " id="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected" type="checkbox" value="true" data-val-required="The IsSelected field is required." data-val="true">',e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].IsSelected" type="hidden" value="false">',i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode!=""&&i.PNRTrips[r].TripSegment[f].AncillaryItems[o].AncillaryName=="ETicketNumber"?(e+=i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="USED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-USED").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="VOID"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-VOID").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="EXCH"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-EXCH").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="OPEN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-OPEN").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="CLOSED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CLOSED").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="REFUNDED"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-REFUNDED").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="UNAVAIL"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-UNAVAIL").text()+")<\/span>":i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode=="CHECKED IN"?'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+n("#translate-text-CHECKEDIN").text()+")<\/span>":'<label class="checkbox" for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+n("#translate-text-ETicketNumber").text()+'<\/label><span style="padding-left: 5px;">('+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TicketStatusCode+")<\/span>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].AncillaryName" type="hidden" value="'+n("#translate-text-ETicketNumber").text()+'">'):(e+='<label class="checkbox"  for="PNRViewModel_PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__IsSelected">'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].AncillaryName+"<\/label>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].AncillaryName" type="hidden" value="'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].AncillaryName+'">'),e+="<\/div>",e+='<div class="form-group" style="padding-left: 40px;width:25%;">',e+="<span>"+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TravelerName+"<\/span>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].TravelerName" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__TravelerName" type="hidden" value="'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].TravelerName+'">',e+="<\/div>",e+='<div class="form-group" style = "padding-left: 140px;width:25%;" >',e+="<span>"+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].ItemNumber+"<\/span>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].ItemNumber" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__AncillaryItems_"+o+'__ItemNumber" type="hidden" value="'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].ItemNumber+'">',e+="<\/div>",e+="<\/div>",e+='<input name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].AncillaryItems["+o+'].ConfirmationNumber" type="hidden" value="'+i.PNRTrips[r].TripSegment[f].AncillaryItems[o].ConfirmationNumber+'">');else e+='<div id="AncillaryView_'+i.PNRTrips[r].ConfirmationNumber+s+'" class="form-row" style="color: gray;font-size:small">',e+='<div class="form-group" style="padding-left: 40px;width:25%;">',e+="<\/div>",e+="<\/div>";for(e+="<\/div>",e+='<div style="padding-left :40px; padding-bottom:20px;padding-top:40px;color:darkblue;font-size:small">',e+='<span aria-hidden="true" class="field-validation-valid" data-valmsg-for="'+i.PNRTrips[r].TripSegment[f].AncillaryNotListed+'" data-valmsg-replace="true"><\/span><input class="type-checkbox" data-val="true" data-val-required="'+n("#translate-text-ancillaryNotListed").text()+'" id="CheckBox_'+i.PNRTrips[r].ConfirmationNumber+s+'" name = "'+i.PNRTrips[r].TripSegment[f].AncillaryNotListed+'" onclick = "UA.Customer.Refund.ancillaryNotListedCheck(event)" type = "checkbox" value = "true">',e+='<input name="'+i.PNRTrips[r].TripSegment[f].AncillaryNotListed+'" type="hidden" value="false"><label class="checkbox" for="CheckBox_'+i.PNRTrips[r].ConfirmationNumber+s+'">'+n("#translate-text-purchaseNotListed").text()+"<\/label >",e+="<\/div>",e+='<div id="AncillaryNotFound_'+i.PNRTrips[r].ConfirmationNumber+s+'" style="padding-bottom: 20px; padding-left: 20px; display:none">',e+='<div id="AncillaryDetails" class="customer-Common">',e+=' <div id="AncillaryReceipts_'+i.PNRTrips[r].ConfirmationNumber+s+'">',h=0;h<i.PNRTrips[r].TripSegment[f].ReceiptDetailsList.length;h++)e+="<div>",e+='<div class="form-row form-row-narrow-8px ua-left-offset-25px">',e+='<div class="form-group ua-size-55-12 ua-offset-1-12" >',e+='<label class="ifl" for="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__ReceiptDetailsList_"+h+'__AncillaryItemName">'+n("#translate-text-nameOfItemForRefund").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label>',e+='<span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].ReceiptDetailsList["+h+'].AncillaryItemName" data-valmsg-replace="true"><\/span>',e+='<input length = "0" aria-required="true" data-val="true" data-val-required="'+n("#translate-text-nameOfItemForRefund").text()+'.<!--EC:V1-->" id = "PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__ReceiptDetailsList_"+h+'__AncillaryItemName" name = "PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].ReceiptDetailsList["+h+'].AncillaryItemName" type = "text" value = "" disabled="disabled" >',e+="<\/div>",e+='<div class="form-group ua-size-55-12">',e+='<label class="ifl" for="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__ReceiptDetailsList_"+h+'__AncillaryItemNumber">'+n("#translate-text-documentNumber").text()+'<em aria-hidden="true" class="rqrd">*<\/em><\/label>',e+='<span aria-hidden="true" class="field-validation-valid" data-valmsg-for="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].ReceiptDetailsList["+h+'].AncillaryItemNumber" data-valmsg-replace="true"><\/span>',e+='<input length="0" data-val="true" aria-required="true" data-val-required="'+n("#translate-text-documentNumberVal").text()+'<!--EC:V142-->" data-val-length-max="14" data-val-regex="'+n("#translate-text-documentNumberVal").text()+'" data-val-regex-pattern="[0-9]{13,14}" id="PNRViewModel_PNRTrips_'+r+"__TripSegment_"+f+"__ReceiptDetailsList_"+h+'__AncillaryItemNumber" maxlength="14" name="PNRViewModel.PNRTrips['+r+"].TripSegment["+f+"].ReceiptDetailsList["+h+'].AncillaryItemNumber" type="text" value="" disabled="disabled">',e+="<\/div>",e+=" <\/div>",e+='<div class="form-row ua-no-margin" id="AncillaryReceipts_'+i.PNRTrips[r].ConfirmationNumber+s+'">',e+=' <form-group style="float:right; padding-right :25px;">',e+='    <a href="" onclick="UA.Customer.Refund.handleRemoveAncillaryReceipt(event,'+h+');">'+n("#translate-text-remove").text()+"<\/a>",e+=" <\/form-group>",e+="<\/div>",e+="<\/div>";e+="<\/div>";e+='<div id="AncillaryReceipts_'+i.PNRTrips[r].ConfirmationNumber+s+'" style="padding-left :20px;">';e+='<a href="" onclick="UA.Customer.Refund.handleAddAncillaryReceipt(event)">'+n("#translate-text-addPurchase").text()+"<\/a>";e+="<\/div>";e+="<\/div>";e+="<\/div>";e+="<\/div>";s=s+1}e+="<\/div>";e+="<br>";e+="<\/div>";c=c+1}e+="<\/div>";n("#PNRPartialViewContainer").append(e);document.getElementById("PnrFLightCount").innerText=c-1;n("#refundForm").removeData("validator").removeData("unobtrusiveValidation");n.validator.unobtrusive.parse(n("#refundForm"));n("#addinfoClick").removeAttr("disabled");t.loader("destroy")}},error:function(){alert("An Error has occured while loading data!");n("#addinfoClick").removeAttr("disabled");t.loader("destroy")},complete:function(){}};n.ajax(s)}else i.focusInvalid()},submitAddFlightCC:function(){var r=n("#AddFlightLastName").val(),u=n("#Reservationnumber").val(),f=n("#AddFlightForm").validate(),e=n("#AddFlightForm").valid();if(e){n("#addinfoClick").attr("disabled","disabled");var t=n("#addinfoClick").loader({preset:"btnCenter"}),i=parseInt(document.getElementById("clicks").text),o=n("#AddFlightcallurl").data("jsonurl-getaddflightresponseadd"),s={type:"POST",url:o,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({LastName:r,ReservationNumber:u}),timeout:9e4,async:!0,success:function(r){var s,h,u,o,f,e;if(r.PNRStatus=="Not Found")i+=1,document.getElementById("clicks").innerHTML=i,n("#Error").removeClass("visuallyhidden"),s=n("#lblfirsterror").text(),h=n("#lblSeconderror").text(),parseInt(document.getElementById("clicks").text)==1?(document.getElementById("Error").innerHTML="<i class=icon-page-error><\/i><span aria - label="+s+">"+s+"<\/span>",n("#addinfoClick").removeAttr("disabled"),t.loader("destroy")):parseInt(document.getElementById("clicks").text)==2&&(n("#AddFlightForm").hide(),n("#AddFlightAdditionalForm").show(),document.getElementById("Error").innerHTML="<i class=icon-page-error><\/i><span aria - label="+h+">"+h+"<\/span>",n("#addinfoClick").removeAttr("disabled"),t.loader("destroy"));else{for(n("#Error").addClass("visuallyhidden"),n.modal.close(),u="",o=parseInt(document.getElementById("PnrFLightCount").innerText)+1,o==0&&(o=o+1),u+="<div id=PNRDataByMP>",f=0;f<r.PNRTrips.length;f++){for(u+='<div id="tbltrip">',u+='<table class="table PNRContainerStyle" role="presentation">',u+="<tbody>",e=0;e<r.PNRTrips[f].TripSegment.length;e++)u+='<tr class="PNRSegmentRow">',u+=r.PNRTrips[f].TripSegment[0]==r.PNRTrips[f].TripSegment[e]?'<td class="PNRRadio"><span aria-hidden="true" class="field-validation-valid" data-valmsg-for="confirmationNumberString" data-valmsg-replace="true"><\/span><input checked="checked" aria-label="Select Flight Option '+o+'" class="type-radio " id="confirmationNumberString_'+r.PNRTrips[f].confirmationNumberString+'" name="confirmationNumberString" type="radio" value="'+r.PNRTrips[f].confirmationNumberString+'"><label class="radio" for="confirmationNumberString_'+r.PNRTrips[f].confirmationNumberString+'"><\/label><\/td>':'<td class="PNRRadio"> <\/td>',u+='<td class="PNRDataRow PNRDataFirstCol"><span class="PNRData">'+r.PNRTrips[f].TripSegment[e].DeptDate+'<\/span><br><span class="PNRFNumber">Flight Number:'+r.PNRTrips[f].TripSegment[e].FlightNumber+"<\/span> <\/td>",u+='<td class="PNRDataRow"><span class="PNRData">'+r.PNRTrips[f].TripSegment[e].DeptAirport+"<\/span><br>"+r.PNRTrips[f].TripSegment[e].DeptAirportCity+"<\/td>",u+='<td class="PNRDataRow PNRDataRowIcon"><i class="icon-plane-departure-small-black"><\/i><\/td>',u+='<td class="PNRDataRow"><span class="PNRData">'+r.PNRTrips[f].TripSegment[e].ArrAirport+"<\/span><br>"+r.PNRTrips[f].TripSegment[e].ArrAirportCity+"<\/td>",u+="<\/tr>";u+="<\/tbody>";u+="<\/table>";u+="<br>";u+="<\/div>";o=o+1}u+="<\/div>";n("#PNRPartialViewContainer").append(u);document.getElementById("PnrFLightCount").innerText=o-1;n("#addinfoClick").removeAttr("disabled");t.loader("destroy")}},error:function(){alert("An Error has occured while loading data!");n("#addinfoClick").removeAttr("disabled");t.loader("destroy")},complete:function(){}};n.ajax(s)}else f.focusInvalid()},handleChooseFile:function(t){var i,r;if(t.preventDefault(),n("#fileWrapper").find("input").length>=3){n("#maxFileCountError").show();return}n("#maxFileCountError").hide();i=1;n("#fileWrapper").find("input").length&&(r=n("#fileWrapper").find("input")[n("#fileWrapper").find("input").length-1],i=parseInt(r.id.substring(4))+1);n("#fileWrapper").append("<div class='fileItem'><input type='file' id='file"+i+"' name='AttachedFiles' accept='.doc, .docx, .jpg, .jpeg, .png, .xlsx, .xls, .pdf, .txt, .csv' style='display:none' onchange='UA.Customer.CustomerCommon.handleOnFileChange("+i+")'><label for='file"+i+"' id='fileLabel"+i+"'>"+n("#filePlaceholderLabel").text()+"<\/label><a class='removeFileBtn' id='removeFile"+i+"' href='' style='padding-left:10px'>"+n("#removeFileLabel").text()+"<\/a><\/div>");n("#file"+i).change(function(t){t.target.files&&n("#fileLabel"+i).text(t.target.files[0].name)});n("#removeFile"+i).on("click",function(t){t.preventDefault();var i=t.target.parentNode,r=t.target.parentNode.parentNode;r.removeChild(i);n("#maxFileCountError").hide()});n("#file"+i)[0].click()},handleEmailAddressChange:function(){var t=n("#EmailAddress").val();n("#EmailAddressToGetBack").parent().find("label").addClass("visuallyhidden");n("#EmailAddressToGetBack").parent().find("label").css("opacity","0");n("#EmailAddressToGetBack").val(t)},handleContactMethodClick:function(){var t=n("input[name='ContactMethod']:checked").val();t=="No"?n("#EmailAddressToGetBack").attr("disabled",!0):n("#EmailAddressToGetBack").removeAttr("disabled")},handleOnFileChange:function(t){var i=n("#file"+t)[0].files[0],r,u;if(i){if(i.size>2097152){n("#fileSizeError").show();n("#file"+t).parent().remove();return}if(n("#fileSizeError").hide(),r=i.name.split(".").pop(),u=["doc","docx","jpg","jpeg","png","xlsx","xls","pdf","txt","csv"],u.indexOf(r.toLowerCase())==-1){n("#fileTypeError").show();n("#file"+t).parent().remove();return}n("#fileTypeError").hide()}},handleAdditionInfoTextBoxInfoChange:function(){var t=1e3;n("#textMessage").keyup(function(){var i=n(this).val().length,u=n(this).val(),r=t-i;i>t&&(n(this).val(u.substring(0,t)),i=n(this).val().length,r=t-i);n("#letterCount").html(r+"/"+t+n("#lblCharacter").text())})}}}();n(document).ready(function(){UA.Customer.CustomerCommon.init()})}(jQuery)