(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{uWsw:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var o=r("mrSG"),i=(r("6csJ"),r("yTtk"),r("AcpL"),r("AytR")),s=r("gIcY"),n=(r("y1F6"),r("62Mb")),a=function(){function e(e,t,r){this.flightState=e,this.generalState=t,this.translateService=r,this.FName="",this.LName="",this.Title="",this.getFromSession=function(e){try{if("undefined"!=typeof sessionStorage)return JSON.parse(sessionStorage.getItem(e||""))}catch(t){return}}}return Object.defineProperty(e.prototype,"SearchRequest",{get:function(){return this.flightState.SearchRequestFormGroup},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"SectorType",{get:function(){return this.flightState.SectorType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"SmartPricerResponse",{get:function(){return this.flightState.SmartPricerResponse},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ContactInfoForm",{get:function(){return this.flightState.TravelItineraryFormGrp.controls.ContactInfo},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"PromoCodeFormGroup",{get:function(){if(null!=this.flightState.TravelItineraryFormGrp)return this.flightState.TravelItineraryFormGrp.controls.Auxiliaries.controls[0].controls.Parameters.controls[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"PromoAmountFormGroup",{get:function(){if(null!=this.flightState.TravelItineraryFormGrp)return this.flightState.TravelItineraryFormGrp.controls.Auxiliaries.controls[0].controls.Parameters.controls[2]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"PromoIDFormGroup",{get:function(){if(null!=this.flightState.TravelItineraryFormGrp)return this.flightState.TravelItineraryFormGrp.controls.Auxiliaries.controls[0].controls.Parameters.controls[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"serviceEnquiryForm",{get:function(){return this.flightState&&null!=this.flightState.TravelItineraryFormGrp&&null!=this.flightState.TravelItineraryFormGrp.controls.ServiceEnquiry?this.flightState.TravelItineraryFormGrp.controls.ServiceEnquiry:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contactInfoForm",{get:function(){return this.flightState&&null!=this.flightState.TravelItineraryFormGrp&&null!=this.flightState.TravelItineraryFormGrp.controls.ContactInfo?this.flightState.TravelItineraryFormGrp.controls.ContactInfo:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sessionStorageKey",{get:function(){var e;return function(e){e.postLoginUrl="postLoginUrl",e.userprofile="profile",e.loginstatus="loginstatus",e.transactionid="transactionid",e.loginType="loginType",e.clientid="clientid",e.socialMediaToken="socialMediaToken",e.socialMediaType="SocialMediaType",e.journey="journey"}(e||(e={})),e},enumerable:!0,configurable:!0}),e.prototype.checkPriceChange=function(e,t,r){var o=0,i="",s="I"!==t?this.flightState.SmartPricerResponse.Msg:this.generalState.CreateItineraryResponse.Msg;if("I"!==t&&s){var n=s[0].split("|")[0].indexOf("Previous Amt:-"),a=s[0].substring(n+14,s[0].split("|")[0].length-1);o=parseInt(a)}else o=this.getSmartPricerNetAmount(r);return null!=o&&o!=e&&(i=parseInt(o.toString(),10)0&&(t+=e.NetAmount),e.SSRAmount&&e.SSRAmount>0&&(t+=e.SSRAmount),e.CrossSellAmount&&e.CrossSellAmount>0&&(t+=e.CrossSellAmount)),t},e.prototype.getDomMCNetFare=function(e){var t=0;return"I"==e?this.generalState.GetRetrieveBookingResponse.FlightInfoNew.forEach((function(e){t+=e.NetAmount})):this.flightState.SmartPricerResponse.Trips.forEach((function(e){t+=e.Journey[0].NetFare})),t},e.prototype.checkPriceChangeMC=function(e,t){var r=this,o=0,i="",s="",n=!1;return this.flightState&&("I"==t&&this.generalState.GetRetrieveBookingResponse&&this.generalState.GetRetrieveBookingResponse.FlightInfoNew?o=this.generalState.TotalNetFare:this.flightState.SmartPricerResponse&&this.flightState.SmartPricerResponse.ResponseCodes&&(this.flightState.SmartPricerResponse.ResponseCodes.forEach((function(e){"1500"==e&&(n=!0)})),n&&this.flightState.SmartPricerResponse.Messages.forEach((function(e,t){var i=e.split("|")[0].indexOf("Previous Amt:-");i>0&&r.flightState.SmartPricerResponse&&(r.flightState.SmartPricerResponse.Msg&&r.flightState.SmartPricerResponse.Msg[0]&&(o+=parseInt(r.flightState.SmartPricerResponse.Msg[0].substring(i+14,r.flightState.SmartPricerResponse.Msg[0].split("|")[0].length-1))),r.flightState.SmartPricerResponse.Trips&&r.flightState.SmartPricerResponse.Trips[t]&&r.flightState.SmartPricerResponse.Trips[t].Journey&&r.flightState.SmartPricerResponse.Trips[t].Journey[0]&&r.flightState.SmartPricerResponse.Trips[t].Journey[0].Segments&&(s+=r.flightState.SmartPricerResponse.Trips[t].Journey[0].Segments[0].Flight.DepAirportName+","+r.flightState.SmartPricerResponse.Trips[t].Journey[0].Segments[r.flightState.SmartPricerResponse.Trips[t].Journey[0].Segments.length-1].Flight.ArrAirportName+"|"))}))),n&&null!=o&&o!=e&&(i=parseInt(o.toString(),10)0&&t.Journey&&t.Journey.forEach((function(e){e.Segments&&e.Segments.forEach((function(e){-1===o.map((function(e){return e.Code})).indexOf(e.Flight.VAC)&&o.push({Code:e.Flight.VAC,Name:e.Flight.Airline.split("|")[0],FUID:e.Flight.FUID}),-1===s.map((function(e){return e.Code})).indexOf(e.Flight.VAC)&&s.push({Code:e.Flight.VAC,Name:e.Flight.Airline.split("|")[0],FUID:e.Flight.FUID})}))})),s=o,null!=(r=this.flightState.SmartPricerResponse.Trips[1])&&r.Journey&&r.Journey.length>0&&r.Journey&&r.Journey.forEach((function(e){e.Segments&&e.Segments.forEach((function(e){-1===i.map((function(e){return e.Code})).indexOf(e.Flight.VAC)&&i.push({Code:e.Flight.VAC,Name:e.Flight.Airline.split("|")[0],FUID:e.Flight.FUID}),-1===s.map((function(e){return e.Code})).indexOf(e.Flight.VAC)&&s.push({Code:e.Flight.VAC,Name:e.Flight.Airline.split("|")[0],FUID:e.Flight.FUID})}))}))):(this.flightState.SmartPricerResponse.Trips.forEach((function(e){e.Journey&&e.Journey.forEach((function(e){e.Segments&&e.Segments.forEach((function(e){-1===o.map((function(e){return e.Code})).indexOf(e.Flight.VAC)&&o.push({Code:e.Flight.VAC,Name:e.Flight.Airline.split("|")[0],FUID:e.Flight.FUID}),-1===s.map((function(e){return e.Code})).indexOf(e.Flight.VAC)&&s.push({Code:e.Flight.VAC,Name:e.Flight.Airline.split("|")[0],FUID:e.Flight.FUID})}))}))})),s=o),n.JnyFF=s,n.OnwardFF=o,n.ReturnFF=i,this.flightState.FrequentFlyer=n,"I"==this.SectorType&&this.SearchRequest&&this.SearchRequest.controls&&"RT"==this.SearchRequest.controls.FareType.value)this.flightState.FrequentFlyer.OnwardFF=this.flightState.FrequentFlyer.JnyFF;else if("D"==this.SectorType&&this.SearchRequest&&this.SearchRequest.controls&&"RT"==this.SearchRequest.controls.FareType.value)if(this.flightState.isRSF)this.flightState.FrequentFlyer.OnwardFF=this.flightState.FrequentFlyer.JnyFF;else{if(this.generalState.WebSettings&&this.generalState.WebSettings[0])var a=this.generalState.WebSettings[0].filter((function(e){return"DomLCCchannelcode"==e.Key}))[0].Value;this.flightState.FrequentFlyer&&this.flightState.FrequentFlyer.OnwardFF&&this.flightState.FrequentFlyer.OnwardFF[0]&&this.flightState.FrequentFlyer.OnwardFF[0].Code&&-1===a.indexOf(this.flightState.FrequentFlyer.OnwardFF[0].Code)||this.flightState.FrequentFlyer&&this.flightState.FrequentFlyer.OnwardFF&&this.flightState.FrequentFlyer.OnwardFF[0]&&this.flightState.FrequentFlyer.OnwardFF[0].Code&&this.flightState.FrequentFlyer.ReturnFF&&this.flightState.FrequentFlyer.ReturnFF[0]&&this.flightState.FrequentFlyer.ReturnFF[0].Code&&(this.flightState.FrequentFlyer.OnwardFF[0].Code!=this.flightState.FrequentFlyer.ReturnFF[0].Code||(this.flightState.FrequentFlyer.OnwardFF=this.flightState.FrequentFlyer.JnyFF))}},e.prototype.setSectorToFlightState=function(e){var t=this.getAirportInfoByCode(e.From),r=this.getAirportInfoByCode(e.To),o=this.countryCheck();t&&t.Country.toLocaleLowerCase()==o&&r&&r.Country.toLocaleLowerCase()==o?(this.flightState.SectorType="D",this.generalState&&(this.generalState.SectorType="D")):(this.flightState.SectorType="I",this.generalState&&(this.generalState.SectorType="I"))},e.prototype.checkSectorTypeINT=function(){if(null!=this.flightState.SmartPricerResponse){var e=this.getAirportInfoByCode(this.flightState.SmartPricerResponse.From),t=this.getAirportInfoByCode(this.flightState.SmartPricerResponse.To);return"india"!=e.Country.toLocaleLowerCase()&&"india"!=t.Country.toLocaleLowerCase()}},e.prototype.getAirportInfoByCode=function(e){var t;return e&&e.length>3&&e.match(/\[(.*?)\]/)&&(e=e.match(/\[(.*?)\]/)[1]),null!=this.flightState&&null!=this.flightState.AllAirports&&(t=this.flightState.AllAirports.find((function(t){return t.Code==e}))),t},e.prototype.processPricingResponse=function(e,t,r){var o=this;return null!=e&&null!=e.Trips&&e.Trips.length>0&&e.Trips.forEach((function(e){e.Journey.forEach((function(e){e.Segments.forEach((function(e){e.Flight.AirlineName=o.getAirlineName(t,e.Flight.VAC),e.Flight.DepartureAirportName=o.getAirportsName(r,e.Flight.DepartureCode),e.Flight.ArrivalAirportName=o.getAirportsName(r,e.Flight.ArrivalCode)}))}))})),e},e.prototype.getAirlineName=function(e,t){var r="";return null!=e&&null!=e.filter((function(e){return e.Code==t}))&&e.filter((function(e){return e.Code==t})).length>0&&(r=e.filter((function(e){return e.Code==t}))[0].Name),null==r||""==r||null==r?t:r},e.prototype.getAirportsName=function(e,t){var r="";return null!=e.filter((function(e){return e.Code==t}))&&e.filter((function(e){return e.Code==t})).length>0&&(r=e.filter((function(e){return e.Code==t}))[0].Name),null==r||""==r||null==r?t:r},e.prototype.processInsuranceResponse=function(e,t,r,o){return t=r?parseInt(t.toString())+parseInt(e.toString()):parseInt(t.toString())-parseInt(e.toString()),"undefined"!=typeof sessionStorage&&(sessionStorage.setItem("insuranceFare",JSON.stringify(e)),sessionStorage.setItem("insuranceDays",JSON.stringify(o))),t},e.prototype.setTravelInsuranceSessionValue=function(e,t){sessionStorage.setItem("insuranceFare",JSON.stringify(e)),sessionStorage.setItem("insuranceDays",JSON.stringify(t))},e.prototype.getInsuranceFromSession=function(){var e;return"undefined"!=typeof sessionStorage&&null!=sessionStorage.getItem("insuranceFare")&&""!=sessionStorage.getItem("insuranceFare")&&(e=sessionStorage.getItem("insuranceFare").replace('"',"")),null!=e&&null!=e?parseInt(e):0},e.prototype.setLoginStepStatus=function(e){this.flightState.loginStepCompleted=e},e.prototype.setIsBackToSearch=function(e){this.flightState.isBackToSearch=e},e.prototype.checkTravelerCheckListMC=function(e){null==this.flightState.TravellerCheckList?this.flightState.TravellerCheckList=e:1==e.Country?this.flightState.TravellerCheckList.Country=1:1==e.DOB?this.flightState.TravellerCheckList.DOB=1:1==e.Nationality?this.flightState.TravellerCheckList.Nationality=1:1==e.PDOE?this.flightState.TravellerCheckList.PDOE=1:1==e.PLI?this.flightState.TravellerCheckList.PLI=1:1==e.PassportNo?this.flightState.TravellerCheckList.PassportNo=1:1==e.VisaType?this.flightState.TravellerCheckList.VisaType=1:1==e.IQAMA_No?this.flightState.TravellerCheckList.IQAMA_No=1:1==e.CNIC_No?this.flightState.TravellerCheckList.CNIC_No=1:1==e.National_ID&&(this.flightState.TravellerCheckList.National_ID=1)},e.prototype.checkBRBEnabled=function(e){var t=this;null!=this.flightState.SmartPricerResponse.Trips&&this.flightState.SmartPricerResponse.Trips.length>0&&this.flightState.SmartPricerResponse.Trips[0].Journey[0].Segments.forEach((function(r){var o=e.filter((function(e){return e.Code.trim()==r.Flight.MAC.trim()}));t.flightState.showBaggIns=null!=o||null!=o||o.length>0}))},e.prototype.checkRpiEnabled=function(){var e,t,r=0;return this.generalState&&this.generalState.WebSettings&&this.generalState.WebSettings[0]&&(e=this.generalState.WebSettings[0].filter((function(e){return"RPIdisabledAirlines"==e.Key}))),e.length>0&&e[0].Value&&(t=e[0].Value.split(",")),t&&t.length>0&&this.SmartPricerResponse&&this.SmartPricerResponse.Trips&&this.SmartPricerResponse.Trips.forEach((function(e){e&&e.Journey&&e.Journey.length>0&&t.filter((function(t){return t==e.Journey[0].Provider})).length>0&&r++})),0==r||"RT"==this.flightState.SearchRequest.FareType&&1==r||"RS"==this.flightState.SearchRequest.FareType&&1==r},e.prototype.processReviewSSRResponse=function(e){this.SmartPricerResponse.Trips.forEach((function(t,r){t.Journey[0].Segments.forEach((function(t,o){e.Trips[r]&&e.Trips[r].Journey&&e.Trips[r].Journey.length>0&&e.Trips[r].Journey[0].Segments&&e.Trips[r].Journey[0].Segments.length>0&&e.Trips[r].Journey[0].Segments[o]&&(e.Trips[r].Journey[0].Segments[o].From=t.Flight.DepartureCode,e.Trips[r].Journey[0].Segments[o].To=t.Flight.ArrivalCode)}))})),this.flightState.ReviewSSRResponse=e},e.prototype.processReviewSSRResponseMC=function(e,t){this.SmartPricerResponse.Trips[t].Journey[0].Segments.forEach((function(t,r){e.Trips[0]&&e.Trips[0].Journey&&e.Trips[0].Journey.length>0&&e.Trips[0].Journey[0].Segments&&e.Trips[0].Journey[0].Segments.length>0&&e.Trips[0].Journey[0].Segments[r]&&(e.Trips[0].Journey[0].Segments[r].From=t.Flight.DepartureCode,e.Trips[0].Journey[0].Segments[r].To=t.Flight.ArrivalCode)})),this.flightState.ReviewSSRResponse.Trips[t]=e.Trips[0]},e.prototype.setFareChangeDetails=function(e){this.flightState.SmartPricerResponse.TUI=e.TUI,this.flightState.SmartPricerResponse.NetAmount=e.NetAmount},e.prototype.setFareChangeStatus=function(e){this.flightState.FareChangeStatus=e},e.prototype.getDefaultPromo=function(){var e,t,r,i,s,n="";if(this.flightState&&this.flightState.SmartPricerResponse&&this.flightState.SmartPricerResponse.Trips){if((s=this.flightState.SmartPricerResponse.Trips)&&s.length>0){try{for(var a=o.__values(s),l=a.next();!l.done;l=a.next()){var h=l.value;try{for(var u=(r=void 0,o.__values(h.Journey)),c=u.next();!c.done;c=u.next()){var p=c.value;if(null!==p.Promo&&""!=p.Promo&&""==n){n=p.Promo;break}}}catch(S){r={error:S}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(g){e={error:g}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return n}return""}return""},e.prototype.getDiscount=function(e){var t=0;return e&&e.length>0&&e.forEach((function(e){e.Journey.forEach((function(e){e.Segments.forEach((function(e){t+=e.Fares.TotalCommission}))}))})),t},e.prototype.createPreItinerary=function(){""===this.ContactInfoForm.controls.Email.value&&""!==this.generalState.ClientIDDecrypted&&this.ContactInfoForm.controls.Email.setValue(this.generalState.ClientIDDecrypted),this.generalState.UserDetails&&(""===this.ContactInfoForm.controls.Mobile.value&&""!==this.generalState.UserDetails.MobNumber&&this.ContactInfoForm.controls.Mobile.setValue(this.generalState.UserDetails.MobNumber),this.ContactInfoForm.controls.MobileCountryCode&&""===this.ContactInfoForm.controls.MobileCountryCode.value&&""!==this.generalState.UserDetails.MobileCountryCode.trim()?this.ContactInfoForm.controls.MobileCountryCode.setValue(this.generalState.UserDetails.MobileCountryCode):this.ContactInfoForm.controls.MobileCountryCode&&""===this.ContactInfoForm.controls.MobileCountryCode.value&&""==this.generalState.UserDetails.MobileCountryCode.trim()&&this.ContactInfoForm.controls.MobileCountryCode.setValue(i.a.defaultCountryCode)),this.generalState.GSTFormGroup&&(this.generalState.GSTFormGroup.controls.GSTCompanyName.invalid?(this.ContactInfoForm.controls.GSTCompanyName.setErrors({required:!0}),this.ContactInfoForm.controls.GSTCompanyName.markAsTouched()):this.ContactInfoForm.controls.GSTCompanyName.setValue(this.generalState.GSTFormGroup.controls.GSTCompanyName.value),this.generalState.GSTFormGroup.controls.GSTTIN.invalid?(this.ContactInfoForm.controls.GSTTIN.setErrors({required:!0}),this.ContactInfoForm.controls.GSTTIN.markAsTouched()):this.ContactInfoForm.controls.GSTTIN.setValue(this.generalState.GSTFormGroup.controls.GSTTIN.value),this.generalState.GSTFormGroup.controls.PIN.invalid?(this.ContactInfoForm.controls.PIN.setErrors({required:!0}),this.ContactInfoForm.controls.PIN.markAsTouched()):this.ContactInfoForm.controls.PIN.setValue(this.generalState.GSTFormGroup.controls.PIN.value),this.generalState.GSTFormGroup.controls.GSTAddress.invalid?(this.ContactInfoForm.controls.GSTAddress.setErrors({required:!0}),this.ContactInfoForm.controls.GSTAddress.markAsTouched()):this.ContactInfoForm.controls.GSTAddress.setValue(this.generalState.GSTFormGroup.controls.GSTAddress.value),this.ContactInfoForm.controls.SaveGST.setValue(this.generalState.GSTFormGroup.controls.SaveGST.value),this.generalState.isGSTValidate&&(this.ContactInfoForm.controls.GSTCompanyName.markAsTouched(),this.ContactInfoForm.controls.GSTTIN.markAsTouched(),this.ContactInfoForm.controls.PIN.markAsTouched(),this.ContactInfoForm.controls.GSTAddress.markAsTouched())),this.generalState.PromoFormGroup&&(""!=this.generalState.PromoFormGroup.controls.PromoCode.value||""!=this.generalState.PromoFormGroup.controls.PromoCodeApplied.value)&&this.PromoCodeFormGroup&&this.PromoAmountFormGroup&&this.PromoIDFormGroup&&this.generalState.WalletPromo?(this.PromoCodeFormGroup.controls.Value.setValue(this.generalState.appliedPromo),this.PromoAmountFormGroup.controls.Value.setValue(this.generalState.WalletPromoDiscount),this.PromoIDFormGroup.controls.Value.setValue(this.generalState.PromoFormGroup.controls.EmployeeID.value)):this.generalState.PromoFormGroup&&this.generalState.PromoFormGroup.controls.Amount.value>0&&(""!=this.generalState.PromoFormGroup.controls.PromoCode.value||""!=this.generalState.PromoFormGroup.controls.PromoCodeApplied.value)&&this.PromoCodeFormGroup&&this.PromoAmountFormGroup&&this.PromoIDFormGroup?(this.PromoCodeFormGroup.controls.Value.setValue(this.generalState.appliedPromo),this.PromoAmountFormGroup.controls.Value.setValue(this.generalState.PromoDiscount),this.PromoIDFormGroup.controls.Value.setValue(this.generalState.PromoFormGroup.controls.EmployeeID.value)):this.generalState.PromoFormGroup&&0==this.generalState.PromoFormGroup.controls.Amount.value&&""!=this.getDefaultPromo()&&this.getDiscount(this.flightState.SmartPricerResponse.Trips)>0&&(this.PromoCodeFormGroup.controls.Value.setValue(this.getDefaultPromo()),this.PromoAmountFormGroup.controls.Value.setValue(this.getDiscount(this.flightState.SmartPricerResponse.Trips)),this.PromoIDFormGroup.controls.Value.setValue(this.generalState.PromoFormGroup.controls.EmployeeID.value))},e.prototype.markFormControlTouched=function(e){var t=this;Object.values(e.controls).forEach((function(e){e.controls?t.markFormControlTouched(e):e.markAsTouched()}))},e.prototype.multicityPromoForCreateItinerary=function(e){this.generalState.PromoFormGroup&&this.generalState.MulticityPromo&&this.generalState.MulticityPromo[e]&&this.PromoCodeFormGroup&&this.PromoAmountFormGroup&&this.PromoIDFormGroup&&this.generalState.WalletPromo||this.generalState.PromoFormGroup&&this.generalState.PromoFormGroup.controls.Amount.value>0&&this.generalState.MulticityPromo&&this.generalState.MulticityPromo[e]&&this.generalState.MulticityPromo[e].PromoAmount>0&&this.PromoCodeFormGroup&&this.PromoAmountFormGroup&&this.PromoIDFormGroup?(this.PromoCodeFormGroup.controls.Value.setValue(this.generalState.MulticityPromo[e].PromoCode),this.PromoAmountFormGroup.controls.Value.setValue(this.generalState.MulticityPromo[e].PromoAmount),this.PromoIDFormGroup.controls.Value.setValue(this.generalState.PromoFormGroup.controls.EmployeeID.value)):this.generalState.PromoFormGroup&&0==this.generalState.PromoFormGroup.controls.Amount.value&&""!=this.getDefaultPromo()&&this.getDiscount(this.flightState.SmartPricerResponse.Trips)>0?(this.PromoCodeFormGroup.controls.Value.setValue(this.generalState.MulticityPromo[e].PromoCode),this.PromoAmountFormGroup.controls.Value.setValue(this.generalState.MulticityPromo[e].PromoAmount),this.PromoIDFormGroup.controls.Value.setValue(null)):(this.PromoCodeFormGroup.controls.Value.setValue(""),this.PromoAmountFormGroup.controls.Value.setValue(0),this.PromoIDFormGroup.controls.Value.setValue(null))},e.prototype.setPromoEmpty=function(){this.PromoCodeFormGroup.controls.Value.setValue(""),this.PromoAmountFormGroup.controls.Value.setValue(""),this.PromoIDFormGroup.controls.Value.setValue("")},e.prototype.EnableSSR=function(e){var t=!0,r=!0,o=!0;if(this.SmartPricerResponse&&"IM"==this.SmartPricerResponse.FareType)t=!1;else if(this.SmartPricerResponse&&"ON"==this.SmartPricerResponse.FareType)this.SmartPricerResponse.Trips&&this.SmartPricerResponse.Trips[0]&&this.SmartPricerResponse.Trips[0].Journey&&this.SmartPricerResponse.Trips[0].Journey[0]&&this.SmartPricerResponse.Trips[0].Journey[0].Provider.indexOf("6E")>-1&&(t=this.isCodeShareIndigo(this.SmartPricerResponse.Trips[0]));else if(this.SmartPricerResponse&&"RT"==this.SmartPricerResponse.FareType)this.SmartPricerResponse.Trips&&(this.SmartPricerResponse.Trips[0]&&this.SmartPricerResponse.Trips[0].Journey&&this.SmartPricerResponse.Trips[0].Journey[0]&&this.SmartPricerResponse.Trips[0].Journey[0].Provider.indexOf("6E")>-1&&(r=this.isCodeShareIndigo(this.SmartPricerResponse.Trips[0])),this.SmartPricerResponse.Trips[1]&&this.SmartPricerResponse.Trips[1].Journey&&this.SmartPricerResponse.Trips[1].Journey[0]&&this.SmartPricerResponse.Trips[1].Journey[0].Provider.indexOf("6E")>-1&&(o=this.isCodeShareIndigo(this.SmartPricerResponse.Trips[1]))),r||o||(t=!1);else if(e&&this.SmartPricerResponse&&"DM"==this.SmartPricerResponse.FareType)this.SmartPricerResponse.Trips&&this.SmartPricerResponse.Trips[e]&&this.SmartPricerResponse.Trips[e].Journey&&this.SmartPricerResponse.Trips[e].Journey[0]&&this.SmartPricerResponse.Trips[e].Journey[0].Provider.indexOf("6E")>-1&&(t=this.isCodeShareIndigo(this.SmartPricerResponse.Trips[e]));else if(null==e&&this.SmartPricerResponse&&"DM"==this.SmartPricerResponse.FareType&&this.SmartPricerResponse.Trips)for(var i=0;i0)for(e=0;e0&&t.includes(e)?t.splice(t.indexOf(e),1):t&&t.push(e),t&&t.length>0&&t.forEach((function(e,o){r+=e,o+10)for(var o=0;o0){var i=this.flightState.ReviewSSRResponse.Trips[r].Journey[0].Segments[o].SSR.filter((function(t){return t.Type==e.toString()}));if(i&&i.length>0){t=!0;break}}if(t)break}return t},e.prototype.haveSeatInResponse=function(){var e=!1;if(null!=this.flightState&&null!=this.flightState.seatLayoutResponse&&null!=this.flightState.seatLayoutResponse.Trips)for(var t=0;t0&&null!=this.flightState.seatLayoutResponse.Trips[t].Journey[0].Segments)for(var r=0;r0){e=!0;break}if(e)break}return e},e.prototype.createFareRuleVM=function(){var e=new n.c;return this.flightState&&this.flightState.SmartPricerResponse&&(e.Adt=this.flightState.SmartPricerResponse.ADT,e.Chd=this.flightState.SmartPricerResponse.CHD,e.Inf=this.flightState.SmartPricerResponse.INF),e},e.prototype.checkIsPromoApplied=function(e){var t=!1;return e&&e.Auxiliaries&&e.Auxiliaries[0]&&e.Auxiliaries[0].Parameters&&e.Auxiliaries[0].Parameters[0].Value&&""!==e.Auxiliaries[0].Parameters[0].Value&&""!==e.Auxiliaries[0].Parameters[2].Value&&(t=!0),t},e.prototype.updatePromoInItineraryRequest=function(e,t){this.PromoCodeFormGroup.controls.Value.setValue(""!=e.Code?t:""),this.PromoAmountFormGroup.controls.Value.setValue(e.PromoAmt>0?e.PromoAmt:""),this.PromoIDFormGroup.controls.Value.setValue(""!=e.EmployeeID?e.EmployeeID:"")},e.prototype.ifPromoExistInRequest=function(e){var t=!1;return e&&e.length>0&&e.forEach((function(e){e&&e.Auxiliaries&&e.Auxiliaries[0]&&e.Auxiliaries[0].Parameters&&""!=e.Auxiliaries[0].Parameters[0]&&""!=e.Auxiliaries[0].Parameters[2]&&(t=!0)})),t},e.prototype.updatePromoInItineraryRequestMC=function(e,t){e&&(this.generalState.MulticityPromo[t.SequenceID-1].PromoAmount=e.PromoAmt)},e.prototype.updateNetAmountAndTUIInSmartPricer=function(){var e=this;this.generalState&&this.generalState.GetRetrieveBookingResponse&&this.generalState.GetRetrieveBookingResponse.FlightInfoNew&&this.generalState.GetRetrieveBookingResponse.FlightInfoNew.length>0&&this.generalState.GetRetrieveBookingResponse.FlightInfoNew.forEach((function(t,r){t&&"1500"==t.Code&&(e.SmartPricerResponse.NetAmountArray[r]=t.AirlineNetFare,e.flightState.SmartPricerResponseMC[r]=t.TUI)}))},e.prototype.creditShellBalanceCheck=function(){var e=0,t=0,r=0,o=0,i=0;this.flightState&&this.flightState.SmartPricerResponse&&(this.flightState.SmartPricerResponse.Trips[0]&&this.flightState.SmartPricerResponse.Trips[0].Journey[0]&&this.flightState.SmartPricerResponse.Trips[0].Journey[0].CSBalance&&(t=this.flightState.SmartPricerResponse.Trips[0].Journey[0].CSBalance),o=this.flightState.SmartPricerResponse.ADT+this.flightState.SmartPricerResponse.CHD+this.flightState.SmartPricerResponse.INF,this.flightState.ssrTotalFareVM&&(e=this.flightState.ssrTotalFareVM.Baggage.TotalFare+this.flightState.ssrTotalFareVM.Meals.TotalFare+this.flightState.ssrTotalFareVM.Seat.TotalFare+this.flightState.ssrTotalFareVM.Sports.TotalFare+this.flightState.ssrTotalFareVM.PriorityCheckin.TotalFare+this.flightState.ssrTotalFareVM.PriorityBaggage.TotalFare+this.flightState.ssrTotalFareVM.MISC.TotalFare),e>0&&o>0?(r=e-t)>0&&(i=r/o,this.flightState.SmartPricerResponse.Trips[0].Journey[0].Segments[0].Fares.PTCFare&&this.flightState.SmartPricerResponse.Trips[0].Journey[0].Segments[0].Fares.PTCFare.forEach((function(e){e.CSFare=i}))):this.flightState.SmartPricerResponse.Trips[0].Journey[0].Segments[0].Fares.PTCFare&&this.flightState.SmartPricerResponse.Trips[0].Journey[0].Segments[0].Fares.PTCFare.forEach((function(e){e.CSFare=0})))},e.prototype.countryCheck=function(){try{var e="";return"ON"==this.flightState.SearchType?i.a.CountrySettings.domCountrySettings.forEach((function(t){"ON"==t.searchtype&&(e=t.country)})):"RS"==this.flightState.SearchType||"RT"==this.flightState.SearchType?i.a.CountrySettings.domCountrySettings.forEach((function(t){"RT"==t.searchtype&&(e=t.country)})):"MC"!=this.flightState.SearchType&&"DM"!=this.flightState.SearchType||i.a.CountrySettings.domCountrySettings.forEach((function(t){"MC"==t.searchtype&&(e=t.country)})),e}catch(t){}},e.prototype.setMerchantIDIfGoogleSearch=function(){"undefined"!=typeof sessionStorage&&sessionStorage.getItem("googleSearchMerchantID")&&"undefined"!=sessionStorage.getItem("googleSearchMerchantID")&&(i.a.MerchantSettings.Desktop.AUI=sessionStorage.getItem("googleSearchMerchantID"),i.a.MerchantSettings.Desktop.APIkey=i.a.MerchantSettings.GoogleSearch.APIkey,i.a.MerchantSettings.Mobile.AUI=i.a.MerchantSettings.GoogleSearch.AUI,i.a.MerchantSettings.Mobile.APIkey=i.a.MerchantSettings.GoogleSearch.APIkey)},e.prototype.setConenienceFeeIfGoogleSearch=function(){if(this.generalState.WebSettings&&this.generalState.WebSettings[0]){var e=this.generalState.WebSettings[0].filter((function(e){return"ThirdPartySearchConvinientFee"==e.Key}));e&&e.length>0&&e[0]&&Number(e[0].Value)&&Number(e[0].Value)>0&&(this.generalState.ConvenienceFee=Number(e[0].Value)),this.generalState.ConvenienceFee>0&&this.flightState.SmartPricerResponse&&this.flightState.SmartPricerResponse.ADT>=0&&this.flightState.SmartPricerResponse.CHD>=0&&(this.generalState.ConvenienceFee=this.generalState.ConvenienceFee*(this.flightState.SmartPricerResponse.ADT+this.flightState.SmartPricerResponse.CHD))}},e.prototype.updateFormWithBusinessRule=function(e){var t=this;Object.keys(this.flightState.TravelItineraryFormGrp.get("Travellers").controls).forEach((function(r){var o=t.flightState.TravelItineraryFormGrp.get("Travellers").get(r);if(o.get(e.Category)&&""==o.get(e.Category).value){t.FName=o.get("FName").value,t.LName=o.get("LName").value,t.Title=o.get("Title").value;var i=e.Action.split("|");o instanceof s.k&&(t.checkFormFieldAndUpdate("FName",t.getUpdateCategoryName(i[0]),o,e),t.checkFormFieldAndUpdate("LName",t.getUpdateCategoryName(i[1]),o,e),t.checkFormFieldAndUpdate("Title",t.getUpdateCategoryName(i[2]),o,e))}}))},e.prototype.checkFormFieldAndUpdate=function(e,t,r,o){if(e&&t&&""!=e&&""!=t){var i=this.getUpdateCategoryControlValue(t);"Blank"==t&&r.get(e)?(r.get(e).setValue(""),r.get(e).clearValidators(),r.get(e).updateValueAndValidity(),o.IsAccepted=!0):""!=i?(r.get(e).setValue(i),o.IsAccepted=!0):(r.get(e).setValue(t),o.IsAccepted=!0)}},e.prototype.getUpdateCategoryName=function(e){var t="";return""!=e&&e.length>2?t=e:("BK"==e&&(t="Blank"),"LN"==e&&(t="LName"),"FN"==e&&(t="FName"),"TL"==e&&(t="Title")),t},e.prototype.getUpdateCategoryControlValue=function(e){var t="";return"FName"==e?t=this.FName:"LName"==e?t=this.LName:"Title"==e&&(t=this.Title),t},e.prototype.getBusinessRuleForPaxValidation=function(){return this.flightState&&this.flightState.GetBusinessRuleResponse&&this.flightState.GetBusinessRuleResponse.length>0&&this.flightState.GetBusinessRuleResponse[0]&&this.flightState.GetBusinessRuleResponse[0].BusinessRules&&this.flightState.GetBusinessRuleResponse[0].BusinessRules.length>0&&this.flightState.GetBusinessRuleResponse[0].BusinessRules[0]?this.flightState.GetBusinessRuleResponse[0].BusinessRules.filter((function(e){return e.Action&&""!=e.Action})):void 0},e.prototype.updateInfantDOBValidation=function(e){this.flightState.TravelItineraryFormGrp.controls.Travellers.controls.forEach((function(t){t.value.ID==e.ID&&(t.get("DOB").setErrors({ruleValidation:!0}),t.get("DOB").markAsTouched())}))},e.prototype.updateTravellersValidation=function(){var e=this;this.flightState.TravelItineraryFormGrp&&this.flightState.TravelItineraryFormGrp.controls&&Object.keys(this.flightState.TravelItineraryFormGrp.get("Travellers").controls).forEach((function(t){var r=e.flightState.TravelItineraryFormGrp.get("Travellers").get(t);r instanceof s.k&&(r.get("FName").clearValidators(),r.get("FName").updateValueAndValidity(),r.get("LName").clearValidators(),r.get("LName").updateValueAndValidity())}))},e}()},y1F6:function(e,t){}}]);