@sabstravtech/obtservices 0.2.2210051325 → 0.2.2210051553

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function f(e,t,r,i){var a,n=arguments.length,o=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o}function v(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function y(e,t,r,i){return new(r||(r=Promise))((function(a,n){function o(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))}function b(e,t){var r,i,a,n,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(6===n[0]&&o.label<a[1]){o.label=a[1],a=n;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(n);break}a[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],i=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}}Object.create;function g(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,a,n=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function C(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(S(arguments[t]));return e}Object.create;var A,T,D,P,F,k,_,R,I,O,E,B,N,M,L,w,j,U,H,x,G,V,W,Q,J,Y,K,q,X,Z,z,$,ee,te,re,ie,ae,ne,oe,se,le,ue,ce=function(){};!function(e){e.BeforeSearch="BEFORE_SEARCH",e.AfterSearch="AFTER_SEARCH"}(A||(A={})),function(e){e.CheckIn="CheckIn",e.HandCarry="HandCarry"}(T||(T={})),function(e){e.Open="OPEN",e.Booked="BOOKED",e.Cancelled="CANCELLED",e.BookingFailed="BOOKING_FAILED"}(D||(D={})),function(e){e.Open="OPEN",e.Booked="BOOKED",e.AwaitingApproval="AWAITING_APPROVAL",e.Approved="APPROVED",e.Disapproved="DISAPPROVED",e.PartiallyBooked="PARTIALLY_BOOKED",e.BookingFailed="BOOKING_FAILED"}(P||(P={})),function(e){e.Name="NAME",e.Email="EMAIL"}(F||(F={})),function(e){e.Root="ROOT",e.Tmc="TMC",e.Company="COMPANY",e.Office="OFFICE",e.CompanyGroup="COMPANY_GROUP",e.SelfBook="SELF_BOOK",e.Booker="BOOKER",e.Traveller="TRAVELLER",e.BookerWithSelf="BOOKER_WITH_SELF"}(k||(k={})),function(e){e.Any="Any",e.DdaCar="DDACar",e.CoachLarge="CoachLarge",e.CoachSmall="CoachSmall",e.Economy="Economy",e.EconomyCoach="EconomyCoach",e.EconomyMpvSmall="EconomyMPVSmall",e.EconomyMpvLarge="EconomyMPVLarge",e.EconomySuv="EconomySUV",e.ExecutiveCar="ExecutiveCar",e.ExecutiveSuv="ExecutiveSUV",e.GreenCar="GreenCar",e.GreenExecutive="GreenExecutive",e.GreenSuv="GreenSUV",e.SmallMpv="SmallMPV",e.MediumMpv="MediumMPV",e.LargeMpv="LargeMPV",e.StandardCar="StandardCar",e.Suv="SUV",e.BlackCab="BlackCab",e.HackneyCarriage="HackneyCarriage",e.TaxiSuv="TaxiSUV"}(_||(_={})),function(e){e.Mini="Mini",e.MiniElite="MiniElite",e.Economy="Economy",e.EconomyElite="EconomyElite",e.Compact="Compact",e.CompactElite="CompactElite",e.Intermediate="Intermediate",e.IntermediateElite="IntermediateElite",e.Standard="Standard",e.StandardElite="StandardElite",e.Fullsize="Fullsize",e.FullsizeElite="FullsizeElite",e.Premium="Premium",e.PremiumElite="PremiumElite",e.Luxury="Luxury",e.LuxuryElite="LuxuryElite",e.Oversize="Oversize",e.Special="Special"}(R||(R={})),function(e){e.Manual="Manual",e.Auto="Auto"}(I||(I={})),function(e){e.TwoToThreeDoor="TwoToThreeDoor",e.TwoOrFourDoor="TwoOrFourDoor",e.FourToFiveDoor="FourToFiveDoor",e.WagonOrEstate="WagonOrEstate",e.PassengerVan="PassengerVan",e.Limousine="Limousine",e.Sport="Sport",e.Convertible="Convertible",e.Suv="SUV",e.OpenAirAllTerrain="OpenAirAllTerrain",e.Special="Special",e.PickUpRegularCab="PickUpRegularCab",e.PickUpExtendedCab="PickUpExtendedCab",e.SpecialOfferCar="SpecialOfferCar",e.Coupe="Coupe",e.MonospaceEuropeanUse="MonospaceEuropeanUse",e.MotorHome="MotorHome",e.TwoWheelVehicle="TwoWheelVehicle",e.Roadster="Roadster",e.CommercialVanOrTruck="CommercialVanOrTruck"}(O||(O={})),function(e){e.Company="COMPANY",e.Office="OFFICE",e.User="USER"}(E||(E={})),function(e){e.Marine="MARINE",e.OilGas="OIL_GAS",e.CruiseLine="CRUISE_LINE",e.Wind="WIND",e.Mining="MINING"}(B||(B={})),function(e){e.Aed="AED",e.Afn="AFN",e.All="ALL",e.Amd="AMD",e.Ang="ANG",e.Aoa="AOA",e.Ars="ARS",e.Aud="AUD",e.Awg="AWG",e.Azn="AZN",e.Bam="BAM",e.Bbd="BBD",e.Bdt="BDT",e.Bgn="BGN",e.Bhd="BHD",e.Bif="BIF",e.Bmd="BMD",e.Bnd="BND",e.Bob="BOB",e.Bov="BOV",e.Brl="BRL",e.Bsd="BSD",e.Btn="BTN",e.Bwp="BWP",e.Byn="BYN",e.Bzd="BZD",e.Cad="CAD",e.Cdf="CDF",e.Che="CHE",e.Chf="CHF",e.Chw="CHW",e.Clf="CLF",e.Clp="CLP",e.Cny="CNY",e.Cop="COP",e.Cou="COU",e.Crc="CRC",e.Cuc="CUC",e.Cup="CUP",e.Cve="CVE",e.Czk="CZK",e.Djf="DJF",e.Dkk="DKK",e.Dop="DOP",e.Dzd="DZD",e.Egp="EGP",e.Ern="ERN",e.Etb="ETB",e.Eur="EUR",e.Fjd="FJD",e.Fkp="FKP",e.Gbp="GBP",e.Gel="GEL",e.Ghs="GHS",e.Gip="GIP",e.Gmd="GMD",e.Gnf="GNF",e.Gtq="GTQ",e.Gyd="GYD",e.Hkd="HKD",e.Hnl="HNL",e.Hrk="HRK",e.Htg="HTG",e.Huf="HUF",e.Idr="IDR",e.Ils="ILS",e.Inr="INR",e.Iqd="IQD",e.Irr="IRR",e.Isk="ISK",e.Jmd="JMD",e.Jod="JOD",e.Jpy="JPY",e.Kes="KES",e.Kgs="KGS",e.Khr="KHR",e.Kmf="KMF",e.Kpw="KPW",e.Krw="KRW",e.Kwd="KWD",e.Kyd="KYD",e.Kzt="KZT",e.Lak="LAK",e.Lbp="LBP",e.Lkr="LKR",e.Lrd="LRD",e.Lsl="LSL",e.Lyd="LYD",e.Mad="MAD",e.Mdl="MDL",e.Mga="MGA",e.Mkd="MKD",e.Mmk="MMK",e.Mnt="MNT",e.Mop="MOP",e.Mru="MRU",e.Mur="MUR",e.Mvr="MVR",e.Mwk="MWK",e.Mxn="MXN",e.Mxv="MXV",e.Myr="MYR",e.Mzn="MZN",e.Nad="NAD",e.Ngn="NGN",e.Nio="NIO",e.Nok="NOK",e.Npr="NPR",e.Nzd="NZD",e.Omr="OMR",e.Pab="PAB",e.Pen="PEN",e.Pgk="PGK",e.Php="PHP",e.Pkr="PKR",e.Pln="PLN",e.Pyg="PYG",e.Qar="QAR",e.Ron="RON",e.Rsd="RSD",e.Rub="RUB",e.Rwf="RWF",e.Sar="SAR",e.Sbd="SBD",e.Scr="SCR",e.Sdg="SDG",e.Sek="SEK",e.Sgd="SGD",e.Shp="SHP",e.Sll="SLL",e.Sos="SOS",e.Srd="SRD",e.Ssp="SSP",e.Stn="STN",e.Svc="SVC",e.Syp="SYP",e.Szl="SZL",e.Thb="THB",e.Tjs="TJS",e.Tmt="TMT",e.Tnd="TND",e.Top="TOP",e.Try="TRY",e.Ttd="TTD",e.Twd="TWD",e.Tzs="TZS",e.Uah="UAH",e.Ugx="UGX",e.Usd="USD",e.Usn="USN",e.Uyi="UYI",e.Uyu="UYU",e.Uzs="UZS",e.Vef="VEF",e.Vnd="VND",e.Vuv="VUV",e.Wst="WST",e.Xaf="XAF",e.Xag="XAG",e.Xau="XAU",e.Xba="XBA",e.Xbb="XBB",e.Xbc="XBC",e.Xbd="XBD",e.Xcd="XCD",e.Xdr="XDR",e.Xof="XOF",e.Xpd="XPD",e.Xpf="XPF",e.Xpt="XPT",e.Xsu="XSU",e.Xts="XTS",e.Xua="XUA",e.Xxx="XXX",e.Yer="YER",e.Zar="ZAR",e.Zmw="ZMW",e.Zwl="ZWL"}(N||(N={})),(M=e.ɵb||(e.ɵb={})).K="K",M.M="M",(L=e.ɵc||(e.ɵc={})).M="M",L.F="F",(w=e.ɵd||(e.ɵd={})).Passport="PASSPORT",w.Visa="VISA",w.IdCard="ID_CARD",function(e){e.Cancellation="Cancellation",e.Change="Change",e.NoShow="NoShow",e.Upgrade="Upgrade",e.Other="Other"}(j||(j={})),function(e){e.Flexible="Flexible",e.Lowest="Lowest",e.Negotiated="Negotiated",e.NonNegotiated="NonNegotiated",e.Leisure="Leisure",e.RequestFareRules="RequestFareRules",e.SelectAndPro="SelectAndPro"}(U||(U={})),function(e){e.Any="Any",e.LiteEconomy="LiteEconomy",e.Economy="Economy",e.EconomyRestricted="EconomyRestricted",e.EconomyNoBags="EconomyNoBags",e.EconomyFlexi="EconomyFlexi",e.PremiumEconomy="PremiumEconomy",e.Business="Business",e.PremiumBusiness="PremiumBusiness",e.First="First",e.PremiumFirst="PremiumFirst"}(H||(H={})),function(e){e.Adult="ADULT",e.Child="CHILD",e.Infant="INFANT"}(x||(x={})),function(e){e.All="All",e.First="First",e.Standard="Standard"}(G||(G={})),function(e){e.ReturnJourney="ReturnJourney",e.SingleJourney="SingleJourney"}(V||(V={})),function(e){e.Renfe="Renfe",e.BeNe="BeNe",e.Ntv="Ntv"}(W||(W={})),function(e){e.Placeholder="placeholder",e.Complete="complete"}(Q||(Q={})),function(e){e.BookerOnly="BOOKER_ONLY",e.BookerTravellers="BOOKER_TRAVELLERS",e.NoEmail="NO_EMAIL"}(J||(J={})),function(e){e.User="USER",e.Guest="GUEST"}(Y||(Y={})),function(e){e.Error="ERROR",e.Warn="WARN",e.Info="INFO",e.Http="HTTP",e.Verbose="VERBOSE",e.Debug="DEBUG",e.Silly="SILLY"}(K||(K={})),function(e){e.Login="LOGIN",e.SearchForm="SEARCH_FORM",e.Results="RESULTS",e.MiForm="MI_FORM",e.BasketBeforeConfirm="BASKET_BEFORE_CONFIRM",e.Dashboard="DASHBOARD"}(q||(q={})),(X=e.ɵf||(e.ɵf={})).Adult="ADULT",X.Child="CHILD",X.Infant="INFANT",function(e){e.Mobile="MOBILE",e.Landline="LANDLINE",e.Fax="FAX",e.Other="OTHER"}(Z||(Z={})),(z=e.ɵg||(e.ɵg={})).MealRequest="MEAL_REQUEST",z.SeatingPreference="SEATING_PREFERENCE",z.SpecialNeed="SPECIAL_NEED",z.SeatLocation="SEAT_LOCATION",z.SeatPosition="SEAT_POSITION",z.SeatDirection="SEAT_DIRECTION",function(e){e.Inherited="INHERITED",e.Editable="EDITABLE",e.Visible="VISIBLE",e.Hidden="HIDDEN"}($||($={})),function(e){e.All="All",e.First="First",e.Standard="Standard"}(ee||(ee={})),function(e){e.SingleJourney="SingleJourney",e.ReturnJourney="ReturnJourney",e.OpenReturnJourney="OpenReturnJourney"}(te||(te={})),function(e){e.Origin="Origin",e.Intermediate="Intermediate",e.Destination="Destination",e.Unknown="Unknown"}(re||(re={})),function(e){e.RequestStop="RequestStop",e.PickUpOnly="PickUpOnly",e.SetDownOnly="SetDownOnly",e.Normal="Normal",e.Passing="Passing",e.Unknown="Unknown"}(ie||(ie={})),function(e){e.Low="Low",e.Moderate="Moderate",e.Medium="Medium",e.High="High",e.Extreme="Extreme"}(ae||(ae={})),function(e){e.Flight="FLIGHT",e.Eurostar="EUROSTAR",e.InternationalRail="INTERNATIONAL_RAIL",e.Ferry="FERRY",e.Rail="RAIL",e.Hotel="HOTEL",e.Car="CAR",e.Lounge="LOUNGE",e.FastTrack="FAST_TRACK",e.Parking="PARKING",e.Cab="CAB",e.Coach="COACH"}(ne||(ne={})),function(e){e.None="None",e.Fixed="Fixed",e.Flexible="Flexible"}(oe||(oe={})),function(e){e.ExactTime="ExactTime",e.DepartAfter="DepartAfter",e.ArriveBefore="ArriveBefore"}(se||(se={})),function(e){e.All="ALL",e.Mock="MOCK",e.Lightning="LIGHTNING",e.App="APP"}(le||(le={})),function(e){e.FreeText="FREE_TEXT",e.AutoSuggest="AUTO_SUGGEST",e.Dropdown="DROPDOWN",e.Hidden="HIDDEN"}(ue||(ue={}));var de,he,pe,me,fe,ve,ye,be,ge,Se,Ce=function(e){function r(r){var i=e.call(this)||this;return i.isLoading=new t.BehaviorSubject(!1),i.search=function(e){return t.of([])},Object.assign(i,r),i}return m(r,e),Object.defineProperty(r.prototype,"selectedValues",{get:function(){return this._selectedValues},set:function(e){Object.is(this._selectedValues,e)||(this._selectedValues=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},set:function(e){this.setValue(e)},enumerable:!1,configurable:!0}),r.prototype.isValid=function(){return!this.mandatory||0!==this.selectedValues.length},r.prototype.hasErrors=function(e){var t=this;return new Promise((function(r,i){r(!t.mandatory||e&&0!==e.length?null:{hasErrors:!0})}))},r}(ce),Ae=function(e){function t(t,r){var i,a=this;return(a=e.call(this,t)||this).basketService=r,a.tempValue=a.selectedValues&&(null===(i=a.selectedValues[0])||void 0===i?void 0:i.freeValue)||"",a.defaultValue&&!a.selectedValues.length&&(a.value=a.defaultValue.value,a.setValue(a.defaultValue.value)),a}return m(t,e),t.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].freeValue:""},t.prototype.setValue=function(e){this.tempValue!==e&&(this.tempValue=e,this.selectedValues=[{freeValue:e,basketLevelValue:this.perBooking,userLevelValue:this.perPassenger}])},t.prototype.save=function(e,t,r){this.basketService.setMiFreeValue(e,this,this.selectedValues[0]?this.selectedValues[0].freeValue:"",t,r)},t.prototype.hasErrors=function(t){var r=Object.create(null,{hasErrors:{get:function(){return e.prototype.hasErrors}}});return y(this,void 0,void 0,(function(){var e=this;return b(this,(function(i){return[2,new Promise((function(i,a){if(t&&0!==t.length||i(e.mandatory?{hasErrors:!0}:null),e.valueMask&&t)return e.basketService.validateFreeValeMi(e,t).then((function(e){i(e?null:{hasErrors:!0})}));e.values.length>0?i(e.values.find((function(e){return e.value===t}))?null:{hasErrors:!0}):i(r.hasErrors.call(e,t))}))]}))}))},t}(Ce),Te=function(e){function i(i,a){var n,o=this;return(o=e.call(this,i)||this).basketService=a,o.search=function(e){return e.pipe(r.debounceTime(300),r.distinctUntilChanged(),r.switchMap((function(e){return e.length>2?o.basketService.getMiAutoSugestions(o.id,e,o.isLoading):t.of(o.avaliableItems)})),r.tap((function(e){o.avaliableItems=e})))},(null===(n=o.values)||void 0===n?void 0:n.length)>0?o.avaliableItems=o.values:o.basketService.getMiAutoSugestions(o.id,"",o.isLoading).subscribe((function(e){o.avaliableItems=e,o.defaultValue&&!o.selectedValues.length&&(o.value=o.defaultValue.value,o.setValue(o.defaultValue.valueId))}),(function(){console.error("No values for AutoSugest field")})),o}return m(i,e),i.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},i.prototype.hasErrors=function(e){return y(this,void 0,void 0,(function(){return b(this,(function(t){return e&&0!==e.length?e&&e.id&&this.avaliableItems?[2,this.avaliableItems.find((function(t){return t.id===e.id}))?null:{hasErrors:!0}]:[2,{hasErrors:!0}]:[2,this.mandatory?{hasErrors:!0}:null]}))}))},i.prototype.setValue=function(e){try{var t=this.avaliableItems.find((function(t){return t.id===e}));this.selectedValues=t?[{value:{id:t.id,label:t.label,value:t.value,default:t.default,fixed:t.fixed,agentOnly:t.agentOnly},basketLevelValue:this.perBooking,userLevelValue:this.perPassenger}]:[]}catch(e){this.selectedValues=[]}},i.prototype.save=function(e,t,r){var i,a;this.basketService.setMiSelectedValue(e,this,this.selectedValues[0]?null===(a=null===(i=this.selectedValues[0])||void 0===i?void 0:i.value)||void 0===a?void 0:a.id:"",t,r)},i}(Ce),De=function(e){function t(t){return e.call(this,t)||this}return m(t,e),t.prototype.getValue=function(){return""},t.prototype.setValue=function(e){},t.prototype.save=function(e,t){},t}(Ce),Pe=function(e){function t(t,r){var i,a=this;return(a=e.call(this,t)||this).basketService=r,(null===(i=a.values)||void 0===i?void 0:i.length)>0?a.avaliableItems=a.values:(a.basketService.showErrorModal(),console.error("No values for Dropdown MI field ")),a.defaultValue&&!a.selectedValues.length&&(a.value=a.defaultValue.valueId,a.setValue(a.defaultValue.valueId)),a}return m(t,e),t.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},t.prototype.hasErrors=function(e){return y(this,void 0,void 0,(function(){return b(this,(function(t){try{return[2,!this.avaliableItems.find((function(t){return t.id===e}))&&this.mandatory?{hasErrors:!0}:null]}catch(e){return[2,null]}return[2]}))}))},t.prototype.setValue=function(e){var t=this.avaliableItems.find((function(t){return t.id===e}));this.selectedValues=t?[{value:{id:t.id,label:t.label,value:t.value,default:t.default,fixed:t.fixed,agentOnly:t.agentOnly},basketLevelValue:this.perBooking,userLevelValue:this.perPassenger}]:[]},t.prototype.save=function(e,t,r){this.selectedValues.length&&this.basketService.setMiSelectedValue(e,this,this.selectedValues[0].value.id||"",t,r)},t}(Ce),Fe=function(e,t){switch(e.uiPresentation){case ue.FreeText:return new Ae(e,t);case ue.AutoSuggest:return new Te(e,t);case ue.Hidden:return new De(e);case ue.Dropdown:return new Pe(e,t);default:var r=e.uiPresentation;console.log(r)}return null},ke=function(e,t,r){var i=this;this.basketService=t,this.helpers=r,this.isValidObservers=[],this.basketItem=e;var a=e.managementInfo.reduce((function(t,r){if(r.reason&&!e.requiresReason)return t;var a=Fe(r,i.basketService);return i.isValidObservers.push(a),r.perBooking?t.perItem.push(a):t.perUser.push(a),t}),{perItem:[],perUser:[]}),n=a.perItem,o=a.perUser;this.miPerItem=n,this.miPerUser=e.users.reduce((function(e,t){return e[t.id]={managementInfo:i.helpers.clone(o).map((function(e){var t=Fe(e,i.basketService);return i.isValidObservers.push(t),t}))},e}),{}),this.miPerGuest=e.guests.reduce((function(e,t){return e[t.id]={managementInfo:i.helpers.clone(o).map((function(e){var t=Fe(e,i.basketService);return i.isValidObservers.push(t),t}))},e}),{}),this.users=Object.keys(this.miPerUser),this.guests=Object.keys(this.miPerGuest)};(de=e.LogoutEnum||(e.LogoutEnum={}))[de.LOGOUT=0]="LOGOUT",de[de.STAYIN=1]="STAYIN",(he=e.LocationTypes||(e.LocationTypes={})).City="City",he.Office="Office",he.Airport="Airport",he.TrainStation="Train Station",he.Postcode="Postcode",he.Shortlist="Shortlist",(pe=e.BreatfastTypes||(e.BreatfastTypes={})).BreakfastIncluded="BreakfastIncluded",pe.BreakfastNotIncluded="BreakfastNotIncluded",(me=e.HotelPolicyEnum||(e.HotelPolicyEnum={})).cancellation="cancellation",me.deposit="deposit",me.disabledAccess="disabledAccess",me.general="general",me.guarantee="guarantee",me.refundAvailable="refundAvailable",(fe=e.BookingStatus||(e.BookingStatus={}))[fe.Loading=0]="Loading",fe[fe.AddingItems=1]="AddingItems",fe[fe.AddingTravellers=2]="AddingTravellers",fe[fe.AddingLeadPassenger=3]="AddingLeadPassenger",fe[fe.Failed=4]="Failed",fe[fe.Revalidate=5]="Revalidate",fe[fe.RevalidatingError=6]="RevalidatingError",fe[fe.ChooseMIGroup=7]="ChooseMIGroup",fe[fe.ProvideMi=8]="ProvideMi",fe[fe.SendForApproval=9]="SendForApproval",fe[fe.AwaitingApproval=10]="AwaitingApproval",fe[fe.ApprovedPaymentOption=11]="ApprovedPaymentOption",fe[fe.ApprovedSupplemtal=12]="ApprovedSupplemtal",fe[fe.ApprovedBook=13]="ApprovedBook",fe[fe.PartiallyBooked=14]="PartiallyBooked",fe[fe.Complete=15]="Complete",fe[fe.Expired=16]="Expired",(ve=e.SchemaFormat||(e.SchemaFormat={})).array="array",ve.datetime="date-time",ve.date="date",ve.integer="integer",ve.object="object",ve.select="select",ve.selectQueue="select-queue",ve.string="string",ve.boolean="boolean",ve.countryCode="countryCode",ve.additionalSeatPreference="t_additionalSeatPreference",ve.seatPrefGroups="a_seatPrefGroups",ve.railSeating="railSeating",ve.passport="passport",ve.specialRequests="specialRequests",ve.apis="apis",ve.mandatoryIfEticket="mandatory-if-eticket",ve.mandatoryIfTod="mandatory-if-tod",ve.countryIsoCode="countryIsoCode",ve.address="address",ve.dob="dob",(e.Widgets||(e.Widgets={})).COUNTRY_CODE="COUNTRY_CODE",(ye=e.PreferredFlags||(e.PreferredFlags={}))[ye.none=0]="none",ye[ye.officePreferred=1]="officePreferred",ye[ye.companyPreferred=2]="companyPreferred",ye[ye.tmcPreferred=4]="tmcPreferred",ye[ye.all=7]="all",(be=e.FlightDirectionEnum||(e.FlightDirectionEnum={}))[be.Outbound=1]="Outbound",be[be.Inbound=0]="Inbound",be[be.DualSingleOutbound=2]="DualSingleOutbound",be[be.DualSingleInbound=3]="DualSingleInbound",(ge=e.OBTFlightCabinClass||(e.OBTFlightCabinClass={})).Business="Business",ge.BusinessBranded="BrandedBusiness",ge.EconomyFlexi="EconomyFlexi",ge.EconomyFlexiBranded="BrandedEconomyFlexi",ge.EconomyNoBags="EconomyNoBags",ge.EconomyNoBagsBranded="BrandedEconomyNoBags",ge.EconomyRestricted="EconomyRestricted",ge.EconomyRestrictedBranded="BrandedEconomyRestricted",ge.First="First",ge.FirstBranded="BrandedFirst",ge.PremiumEconomy="PremiumEconomy",ge.PremiumEconomyBranded="BrandedPremiumEconomy",(Se=e.EurostarClassEnum||(e.EurostarClassEnum={})).ANY="Any",Se.BUSINESS_PREMIER="BusinessPremier",Se.STANDARD_PREMIER="StandardPremier",Se.STANDARD="Standard";var _e,Re,Ie,Oe="("+["breakfast not included","breakfast is not included","Breakfast isn't included","Does not include breakfast","EXCL","exel Breakfast","Breakfast Costs","no breakfast"].join(")|(")+")",Ee="("+["BREAKFAST INCLUDED","breakfast","BB","B&B","Bead and breakfast","Bed and breakfast","Bed&Break","INCLUDES BREAK","INCL BED AND BRE","BRKFST","BED AND BRKFST"].join(")|(")+")",Be="("+["Accessibility","Accessible and Disabled","Disabled","Mobility Access"].join(")|(")+")",Ne=new RegExp(Ee,"i"),Me=new RegExp(Oe,"i"),Le=new RegExp(Be,"i");(_e=e.SearchHandler||(e.SearchHandler={})).AVAILABILITY="Availability",_e.FEMALE_FRIENDLY="SOLO Female Friendly",_e.CTM_GREEN_CHOICE="CTM Greener Choice",_e.BREAKFAST_INCLUDED="BreakfastIncluded",_e.BREAKFAST_NOT_INCLUDED="BreakfastNotIncluded",_e.CLIENT="Client",_e.AGENCY="Agency",_e.ANY="Any",(Re=e.MenuSlideEnum||(e.MenuSlideEnum={})).IN="in",Re.OUT="out",Re.FLAT="flat",(Ie=e.RiskLevelRanking||(e.RiskLevelRanking={})).Low="1",Ie.Moderate="2",Ie.Medium="3",Ie.High="4",Ie.Extreme="5";var we;(we=e.ServiceProvider||(e.ServiceProvider={})).Confirma="Conferma",we.Evolvi="Evolvi",we.SabreCarHire="Sabre Car Hire",we.Lounges="Holiday Extras Lounges",we.FastTrack="Holiday Extras Fast Track",we.Parking="Holiday Extras Parking",we.CMAC="CMAC",we.FarelogixLFGNDC="Farelogix LFG NDC",we.BaNdc="BA NDC",we.EurostarSabre="Eurostar (Sabre)",we.Trainline="Trainline",(e.WellbeingEnum||(e.WellbeingEnum={})).WELLBEING="/results/wellbeing";var je,Ue,He=[{label:"Bland",type:e.ɵg.MealRequest},{label:"Child",type:e.ɵg.MealRequest},{label:"Diabetic",type:e.ɵg.MealRequest},{label:"Fruit Plate",type:e.ɵg.MealRequest},{label:"Gluten Free",type:e.ɵg.MealRequest},{label:"Hindu",type:e.ɵg.MealRequest},{label:"Kosher",type:e.ɵg.MealRequest},{label:"Low Fat/Cholesterol",type:e.ɵg.MealRequest},{label:"Low Sodium",type:e.ɵg.MealRequest},{label:"Muslim",type:e.ɵg.MealRequest},{label:"Non-Lactose",type:e.ɵg.MealRequest},{label:"Raw Vegeterian",type:e.ɵg.MealRequest},{label:"Seafood",type:e.ɵg.MealRequest},{label:"Vegan Vegeterian",type:e.ɵg.MealRequest},{label:"Vegeterian Lacto-Ovo",type:e.ɵg.MealRequest},{label:"Aisle",type:e.ɵg.SeatingPreference},{label:"Window",type:e.ɵg.SeatingPreference},{label:"Bassinet",type:e.ɵg.SpecialNeed},{label:"Bicycle",type:e.ɵg.SpecialNeed},{label:"Blind passenger",type:e.ɵg.SpecialNeed},{label:"Deaf passenger",type:e.ɵg.SpecialNeed},{label:"Meet and assist",type:e.ɵg.SpecialNeed},{label:"Wheelchair, can ascend steps",type:e.ɵg.SpecialNeed},{label:"Wheelchair, can walk to seat",type:e.ɵg.SpecialNeed},{label:"Wheelchair, manual",type:e.ɵg.SpecialNeed},{label:"Wheelchair, must be carried",type:e.ɵg.SpecialNeed},{label:"Wheelchair, with dry battery",type:e.ɵg.SpecialNeed},{label:"Wheelchair, with wet battery",type:e.ɵg.SpecialNeed},{label:"Quiet",type:e.ɵg.SeatLocation},{label:"Business",type:e.ɵg.SeatLocation},{label:"Family",type:e.ɵg.SeatLocation},{label:"Aisle",type:e.ɵg.SeatPosition},{label:"Middle",type:e.ɵg.SeatPosition},{label:"Window",type:e.ɵg.SeatPosition},{label:"Individual",type:e.ɵg.SeatPosition},{label:"Front Facing",type:e.ɵg.SeatDirection},{label:"Back Facing",type:e.ɵg.SeatDirection},{label:"Airline Seat",type:e.ɵg.SeatDirection}],xe=[{label:"Passport",type:e.ɵd.Passport},{label:"Visa",type:e.ɵd.Visa},{label:"IdCard",type:e.ɵd.IdCard}],Ge=[{label:"F",type:e.ɵc.F},{label:"M",type:e.ɵc.M}],Ve=[{label:"K",type:e.ɵb.K},{label:"M",type:e.ɵb.M}];(je=e.DifferentInvokdedUserReasons||(e.DifferentInvokdedUserReasons={}))[je.continue=0]="continue",je[je.newBasket=1]="newBasket",je[je.cancel=2]="cancel",je[je.research=3]="research",(Ue=e.DifferentTraveller||(e.DifferentTraveller={}))[Ue.continue=0]="continue",Ue[Ue.newBasket=1]="newBasket",Ue[Ue.cancel=2]="cancel";var We=[e.ɵf.Adult,e.ɵf.Child,e.ɵf.Infant],Qe=function(){function r(r,i){this.basketService=r,this.helpers=i,this.status=new t.BehaviorSubject(e.BookingStatus.Loading),this.basket=new t.BehaviorSubject({}),this.needsToViewMi=!0,this.isUpdating=new t.BehaviorSubject(!1),this.id=null}return r.prototype.loadBasket=function(r){this.id=r,this.basket=new t.BehaviorSubject({}),this.status.next(e.BookingStatus.Loading),this.isUpdating.next(!0),this._loadBasket(r)},r.prototype._loadBasket=function(t){var r=this;this.basketService.loadBasket(t),this.basketService.subsribeToBasket(t,{next:function(t){r.basket.next(t),r.expiredItemInTheBasket()?r.status.next(e.BookingStatus.Expired):r.updateBasket(t)},error:function(e){r.basket.error(e),console.error(e)},complete:function(){r.basket.complete(),console.log("Basket completed")}})},r.prototype.expiredItemInTheBasket=function(){var e;return this.isUpdating.next(!1),this.basket.subscribe((function(t){e=t.basketItems.some((function(e){return e.expired}))})),e},r.prototype.updateBasket=function(t){switch(this.isUpdating.next(!1),t.status){case P.Open:this.workoutOpenState(t);break;case P.AwaitingApproval:this.status.next(this.workoutState(t,e.BookingStatus.AwaitingApproval));break;case P.Approved:this.status.next(this.workoutApprovedState(t));break;case P.Booked:this.status.next(this.workoutState(t,e.BookingStatus.Complete));break;case P.BookingFailed:this.status.next(this.workoutState(t,e.BookingStatus.Failed));break;case P.Disapproved:case P.PartiallyBooked:this.status.next(e.BookingStatus.Failed);break;default:var r=t.status;console.log(r)}},r.prototype.sendBasketForApproval=function(){return this.basketService.sendBasketForApproval(this.id)},r.prototype.workoutApprovedState=function(t){var r=e.BookingStatus.ApprovedBook;return t.basketItems.find((function(e){var t;return(null===(t=e.availablePaymentMethods)||void 0===t?void 0:t.length)>0&&!e.selectedPaymentMethod}))?this.workoutState(t,e.BookingStatus.ApprovedPaymentOption):(t.suppInfo.find((function(e){return e.hasDetails}))&&(r=e.BookingStatus.ApprovedSupplemtal),this.workoutState(t,r))},r.prototype.workoutState=function(t,r){return t.validated?r:(this._hasInvalidPrice(t),e.BookingStatus.Revalidate)},r.prototype.workoutOpenState=function(t){if(0!==t.basketItems.length)if(this._needsCorrectTravellers(t))this.status.next(e.BookingStatus.AddingTravellers);else{if(!this._needLeadPassengers(t))return t.validated?void(this._needsMiGroups(t)?this.status.next(e.BookingStatus.ChooseMIGroup):this.helpers.needsMi(t,this.needsToViewMi)?this.status.next(e.BookingStatus.ProvideMi):this.status.next(e.BookingStatus.SendForApproval)):(this._hasInvalidPrice(t),void this.status.next(e.BookingStatus.Revalidate));this.status.next(e.BookingStatus.AddingLeadPassenger)}else this.status.next(e.BookingStatus.AddingItems)},r.prototype.revalidate=function(){this.basketService.revalidate(this.id)},r.prototype.addTravellers=function(e,t,r,i){void 0===i&&(i=0),this.isUpdating.next(!0),this.basketService.addTravellers(e.id,t,r,i)},r.prototype.setLeadPassenger=function(e,t,r,i){void 0===i&&(i=0),this.isUpdating.next(!0),this.basketService.setLeadPassenger(e.id,t,r,i,r.guest?Y.Guest:Y.User)},r.prototype.setBasketItemMiGroup=function(e,t){this.isUpdating.next(!0),this.basketService.setBasketItemMiGroup(e,t.basketItem.id,t.value)},r.prototype.saveMiGroup=function(e){var t=this;this.isUpdating.next(!0),e.forEach((function(e){t.setBasketItemMiGroup(t.id,e)}))},r.prototype.saveMi=function(e){this.needsToViewMi=!1,this.isUpdating.next(!0),e&&this.basketService.saveMiData(this.id,e)},r.prototype.removeExpiredItems=function(){this.isUpdating.next(!0),this.basketService.removeExpiredItems(this.id)},r.prototype.setBasketItemPaymentOption=function(e,t){return this.isUpdating.next(!0),this.basketService.setBasketItemPaymentOption(this.basket.value,e,t)},r.prototype.bookBasket=function(e,t){if(this.isUpdating.next(!0),e)return this.basketService.bookBasket(this.id,e,t)},r.prototype._needsMiGroups=function(e){return!!e.basketItems.find((function(e){return e.miGroupsAvailable.length>0&&!e.miGroupSelected}))},r.prototype._needsCorrectTravellers=function(e){var t=this;return!!e.basketItems.find((function(e){var r=t._splitTravellers(e);return e.service.type===ne.Parking?!(1===e.adults&&r.adults.length):!(r.adults.length===e.adults&&r.children.length===e.children&&r.infants.length===e.infants)}))},r.prototype._hasInvalidPrice=function(e){return!!e.basketItems.find((function(e){return!e.latestValidationPriceDifference||e.expired}))},r.prototype._needLeadPassengers=function(e){return!!e.basketItems.find((function(e){return!e.leadPassenger}))},r.prototype._splitTravellers=function(t){var r=this;return(t.userPassengerTypes.concat(t.guestPassengerTypes)||[]).reduce((function(i,a,n){var o=r._findUser(t.users,Number(a.id)),s=r._findGuest(t.guests,Number(a.id));switch(a.passengerType){case e.ɵf.Adult:i.adults.push(o||s);break;case e.ɵf.Child:i.children.push(o||s);break;case e.ɵf.Infant:i.infants.push(o||s)}return i}),{adults:[],children:[],infants:[]})},r.prototype._findUser=function(e,t){return e.find((function(e){return Number(e.id)===t}))},r.prototype._findGuest=function(e,t){return e.find((function(e){return Number(e.id)===t}))},r.prototype.getId=function(){return this.id},r}(),Je=function(e,t){this.key=e,this.value=t,this.next=null,this.pre=null},Ye=function(){function e(e){void 0===e&&(e=10),this.size=e,this.cache={},this.count=0,this.head=new Je("",null);var t=new Je("",null);this.head.next=t,t.pre=this.head}return e.prototype.get=function(e){return this.cache[e]?this.cache[e].value:null},e.prototype.set=function(e,t){var r=this.cache[e];r?(r.value=t,this.deleteItem(r),this.addToHead(r)):(this.cache[e]=new Je(e,t),this.addToHead(this.cache[e]))},e.prototype.hasKey=function(e){return this.cache.hasOwnProperty(e)},e.prototype.deleteItem=function(e){e.pre.next=e.next,e.next.pre=e.pre},e.prototype.addToHead=function(e){e.next=this.head.next,e.next.pre=e,e.pre=this.head,this.head.next=e},e}();function Ke(){return function(e,t,r){var i=new Ye,a=r.value;r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=JSON.stringify(e);return i.hasKey(r)||i.set(r,a.apply(this,e)),i.get(r)}}}var qe,Xe,Ze,ze=["GS","AIG","GRP","GU3","GU4","GUC","MPG","2TR","SGU","GSU"],$e=function(){function t(){}return t.prototype.isGroupTicket=function(e){return ze.includes(e.toUpperCase().trim())},t.prototype.minToHour=function(e){return Math.floor(e/60)+"h "+e%60+"m"},t.prototype.makeColonTime=function(e){return e.substring(0,2)+":"+e.substring(2,4)},t.prototype.nonNullMin=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return r&&r[e]&&t.min>Number(r[e])?{item:r,min:Number(r[e])}:t}),{min:Number.MAX_SAFE_INTEGER,item:null}).item},t.prototype.joinByComma=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return s.default.isEmpty(t)&&(e+=t+","),e}),"").slice(0,-1)},t.prototype.mutuallyInclude=function(e,t){try{return e.includes(t)||t.includes(e)}catch(e){return console.warn("Trying to mutually compare undefined variable."),!1}},t.prototype.findByKey=function(e,t,r){return e.filter((function(e){return e[t]===r})).pop()},t.prototype.dateToNgDate=function(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},t.prototype.convertToYYMMDD=function(e){return e.length>6?this.formatDate(this.yyyymmddTimeToMoment(e)):e},t.prototype.formatDateToMMDDYYY=function(e){return l.default(e).format(t.MMDDYY_DATE)},t.prototype.formatDate=function(e){return(e=l.default(e)).format(t.DATE_FORMAT)},t.prototype.formatTime=function(e){try{return e.format(t.TIME_FORMAT)}catch(e){console.error(e)}},t.prototype.formatTimeColon=function(e){return(e=l.default(e)).format(t.TIME_FORMAT_COLON)},t.prototype.formatIsoDate=function(e){return(e=l.default(e)).format(t.ISO_DATA_FORMAT)},t.prototype.formatIsoDateTime=function(e){return(e=l.default(e)).format(t.ISO_DATA_FORMAT_TIME)},t.prototype.formatGraphQLDateTime=function(e){return(e=l.default(e)).format(t.GRAPHQL_DATA_FORMAT_TIME)},t.prototype.formatIsoDateNoHyphans=function(e){return(e=l.default(e)).format(t.ISO_DATA_FORMAT_NO_HYPHANS)},t.prototype.generateTimesList=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=24),void 0===r&&(r=15);for(var i=[],a=0;a<t-e;a++)for(var n=0;n<60;n+=r)i.push(l.default({hour:a,minute:n}).format("HH:mm"));return i},t.prototype.momentToNgDate=function(e){return e=l.default(e),this.dateToNgDate(e.toDate())},t.prototype.ngDateToDate=function(e){return new Date(e.year,e.month-1,e.day)},t.prototype.ngDateToMoment=function(e,t){var r=l.default(this.ngDateToDate(e));if(t){var i=t.split(":");2===i.length?r.set("hours",Number(i[0])).set("minutes",Number(i[1])):r.set("hours",Number(t.substr(0,2))).set("minutes",Number(t.substr(2,2)))}return r},t.prototype.todayToNgbDateStruct=function(){var e=l.default();return{year:e.year(),month:e.month()+1,day:e.date()}},t.prototype.objectToArray=function(e){return Object.keys(e).map((function(t){return e[t]}))},t.prototype.yyyymmddToDate=function(e){return new Date(Number(e.substring(0,4)),Number(e.substring(4,6))-1,Number(e.substring(6,8)))},t.prototype.yyyymmddToMoment=function(e){return l.default(this.yyyymmddToDate(e))},t.prototype.yymmddToMoment=function(e){return l.default(e,"YYMMDD")},t.prototype.yymmddToNgbDate=function(e){return this.momentToNgDate(this.yymmddToMoment(e))},t.prototype.yymmdd_hhmmToMoment=function(e,t){return l.default(e+" "+t,"YYMMDD HHmm")},t.prototype.yyyymmdd_hhmmToMoment=function(e,t){return l.default(e+" "+t,"YYYYMMDD HHmm")},t.prototype.yyyymmddToNgDate=function(e){return this.dateToNgDate(this.yyyymmddToDate(e))},t.prototype.yyyymmddTimeToNgDate=function(e,t){var r=this.yyyymmddToMoment(e).add(Number(t.substring(0,2)),"hours").add(Number(t.substring(2,4)),"minutes");return this.momentToNgDate(r)},t.prototype.yyyymmddTimeToMoment=function(e){return 6===e.length?l.default(""+e,"YYMMDD"):l.default(""+e,"YYYYMMDD")},t.prototype.hhmmToTime=function(e){return e.substring(0,2)+":"+e.substring(2,4)},t.prototype.dateStringToyyyymmdd=function(e){if("string"!=typeof e)return null;var t=/(\d{4})[-\/]?(\d{2})[-\/]?(\d{2})/.exec(e);return t?""+t[1]+t[2]+t[3]:null},t.prototype.timeStringTohh_mm=function(e){if("string"!=typeof e)return null;var t=/(\d{2})[:-]?(\d{2})/.exec(e);return t?t[1]+":"+t[2]:null},t.prototype.stringToBool=function(e){return e&&"false"!==e&&"0"!==e&&"no"!==e&&"n"!==e},t.prototype.clone=function(e){return s.default.cloneDeep(e)},t.prototype.replaceKeysInText=function(e,t){return Object.keys(t).reduce((function(e,r){return e.replace("%"+r,t[r])}),e)},t.prototype.getNextMinuets=function(e,t){return void 0===e&&(e=l.default()),void 0===t&&(t=15),e.minute(Math.ceil(e.minute()/t)*t),e.format("HH:mm")},t.prototype.getNumberOnceValue=function(e){var t=this.guid();return t+"_"+hex_hmac_md5(e,t)},t.prototype.guid=function(){for(var e="",t=0;t<32;t++)e+=this.s4();return e},t.prototype.s4=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},t.prototype.capitaliseFirstLetter=function(e){return e.length>0?e[0].toUpperCase()+e.slice(1).toLowerCase():""},t.prototype.fromObject=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=e.shift(),i=0;r&&i<e.length;i+=1)r=r[e[i]];return r},t.prototype.momentRoundMinutes=function(e,t){var r=(e=l.default(e).startOf("minutes")).minutes()%t;return 0!==r&&(r=t-r),e.add(r,"minute")},t.prototype.round=function(e,t){return l.default(Math.ceil(+e/+t)*+t)},t.prototype.icsFold=function(e){return e.split(/\r\n/g).map((function(e){var t="";for(e=e.trim();e.length>72;)t+=e.slice(0,72)+"\r\n",e=" "+e.slice(72).trim();return e.trim()&&(t+=e),t})).join("\r\n")},t.prototype.splitAddressLine=function(e,t){var r={line:e.replace(/\s+/g," ").trim(),residue:""};if(r.line.length>t){var i=r.line.slice(0,t).lastIndexOf(",");i>0?(r.residue=r.line.slice(i+1).trim(),r.line=r.line.slice(0,i).trim()):(i=r.line.slice(0,t).lastIndexOf(" "))>0?(r.residue=r.line.slice(i+1).trim(),r.line=r.line.slice(0,i)):(r.residue=r.line.slice(t),r.line=r.line.slice(0,t))}return r},t.prototype.daysBetween=function(e,t){return t.diff(e,"days")},t.prototype.mapPromise=function(e,t,r){for(var i=e[Symbol.iterator](),a=[],n=[],o=0,s=function(){var e=i.next();if(!e.done){var r=o++;return Promise.resolve(t(e.value,r)).then((function(e){return a[r]=e,s()}))}};!r||n.length<=r;){var l=s();if(!l)break;n.push(l)}return Promise.all(n).then((function(){return a}))},t.prototype.mapSeriesPromise=function(e,t){return this.mapPromise(e,t,1)},t.prototype.obj2queryString=function(e){return s.default.reduce(e,(function(e,t,r){return""!==e&&(e+="&"),""+e+encodeURIComponent(r)+"="+encodeURIComponent(t)}),"")},t.prototype.stripPunctuation=function(e){return e.replace(/[^a-zA-Z0-9\s]/g,"")},t.prototype.replaceAll=function(e,t,r){return e?e.replace(new RegExp(t,"g"),r):null},t.prototype.dateTime=function(e,t){var r=e.match(/.{1,2}/g),i=t.match(/.{1,2}/g);return"20"+r[0]+"-"+r[1]+"-"+r[2]+"T"+i[0]+":"+i[1]+":00"},t.prototype.alternateJSONStringify=function(e){var t=JSON.stringify(e);return t=t.replace(/"/g,"`")},t.prototype.ConvertObjectToArray=function(e){var t=s.default.values(e);return t=s.default.flatten(t)},t.prototype.addDay=function(e){var t=new Date(e.year,e.month-1,e.day+1);return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}},t.prototype.hashCode=function(e){for(var t=0,r=0;r<e.length;r+=1){t=(t<<5)-t+e.charCodeAt(r),t&=t}return t.toString()},t.prototype.MMddyyToNgb=function(e){return this.momentToNgDate(l.default(e,t.MMDDYY_DATE))},t.prototype.selectedChildrenTravellers=function(e,t){switch(t){case ne.Hotel:case ne.Cab:return[]}return e.filter((function(e){return e.isChild}))},t.prototype.selectedTravellers=function(e,t){switch(t){case ne.Hotel:case ne.Cab:return{adults:e,children:[],infants:[]};default:return e.reduce((function(e,t){return t.isChild?t.isInfant?e.infants.push(t):e.children.push(t):e.adults.push(t),e}),{adults:[],children:[],infants:[]})}},t.prototype.selectedAdultTravellers=function(e,t){switch(t){case ne.Hotel:case ne.Cab:return e}return e.filter((function(e){return!e.isChild&&!e.isInfant}))},t.prototype._isChild=function(e,r){return e instanceof Date?l.default().add(-r,"years").isBefore(l.default(e,t.ISO_DATA_FORMAT),"day"):e.isChild},t.prototype.isChildFlight=function(e){return this._isChild(e,16)},t.prototype.isChildRail=function(e){return this._isChild(e,12)},t.prototype.isChildEurostar=function(e){return this._isChild(e,12)},t.prototype.uniqBy=function(e,t){return s.default.uniqBy(e,t)},t.prototype.isChild=function(e,t){switch(t){case ne.Flight:return this._isChild(e,16);case ne.Rail:return this._isChild(e,12);case ne.Coach:return this._isChild(e,15);case ne.Lounge:return this._isChild(e,12);case ne.Hotel:case ne.Cab:default:return!1}},t.prototype.isInfant=function(e,t){switch(t){case ne.Flight:case ne.Rail:case ne.Coach:case ne.Lounge:return this._isChild(e,0);case ne.Hotel:case ne.Cab:default:return!1}},t.prototype.getAgeType=function(e,t){return this.isChild(e,t)?"C":"A"},t.prototype.getMaxChildAge=function(e){switch(e){case ne.Flight:return l.default().add(-15,"years").format(t.MMDDYY_DATE);case ne.Rail:return l.default().add(-11,"years").format(t.MMDDYY_DATE);case ne.Coach:return l.default().add(-14,"years").format(t.MMDDYY_DATE);case ne.Lounge:return l.default().add(-11,"years").format(t.MMDDYY_DATE)}},t.prototype.getDefaultAdultAge=function(e){switch(e){case ne.Flight:return l.default().add(-26,"years").format(t.MMDDYY_DATE);case ne.Rail:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case ne.Coach:return l.default().add(-25,"years").format(t.MMDDYY_DATE);case ne.Lounge:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case ne.Hotel:case ne.Cab:return l.default().add(-18,"years").format(t.MMDDYY_DATE)}return l.default().add(-18,"years").format(t.MMDDYY_DATE)},t.prototype.transform=function(e,t,r){return s.default.transform(e,t,r)},t.prototype.arrayToObject=function(e,t){return e.filter((function(e){return!!e})).reduce((function(e,r){return r&&r[t]&&(e[r[t]]=r),e}),{})},t.prototype.setFieldInObject=function(e,t,r){if(0===t.length)throw new Error("Invalid field");if(e||(e={}),1===t.length)e[t[0]]=e[t[0]]||[],e[t[0]].push(r);else{var i=t[0];e[i]=this.setFieldInObject(e[i],t.slice(1),r)}return e},t.prototype.arrayToObjectArray=function(e,t){var r=this;return e.filter((function(e){return!!e})).reduce((function(e,i){var a=t.reduce((function(e,t){var a=Array.isArray(t)?t.map((function(e){return r.fieldFromObject(i,e)})).join("_"):r.fieldFromObject(i,t);return e&&a?(e.push(a),e):null}),[]);if(i&&a)return r.setFieldInObject(e,a,i)}),{})},t.prototype.getTerminals=function(e){return e.terminals},t.prototype.fieldFromObject=function(e,t){return(Array.isArray(t)?t:(t||"").split(".")).reduce((function(e,t){return e&&e[t]?e[t]:null}),e)},t.prototype.mapFieldFromObject=function(e){return function(t){return t[e]}},t.prototype.removeNulls=function(e){var t=this;return e?l.default.isMoment(e)?e:Array.isArray(e)?e.map((function(e){return t.removeNulls(e)})).filter((function(e){return!!e}))||null:"object"==typeof e?Object.keys(e).reduce((function(r,i){if("_"!==i[0]){var a=e[i],n=t.removeNulls(a);(null!=n&&"null"!==n||Array.isArray(n)&&n.length>0)&&(r[i]=n)}return r}),{}):e:e},t.prototype.getTravellersId=function(e){if(e)return e.reduce((function(e,t,r){return 0===r?[t.id]:C(e,[t.id])}),[])},t.prototype.sanitizeMomentDates=function(e,t){var r,i;void 0===t&&(t=!1);var a=Object.assign({},e);try{for(var n=g(Object.entries(a)),o=n.next();!o.done;o=n.next()){var s=S(o.value,2),u=s[0],c=s[1];l.default.isMoment(c)&&(a[u]=a[u].toISOString())}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return t&&(console.log("-- sanitizeMomentDates() called --"),console.log("original query: ",e),console.log("sanitized query: ",a)),a},t.prototype.toStrings=function(e,t){var r=this;return Object.entries(t.properties||{}).reduce((function(i,a){var n=S(a,2),o=n[0],s=n[1],l=r._formatValue(e[o],s,(t.required||[]).includes(o));return null!==l&&(i[o]=l),i}),{})},t.prototype._formatValue=function(e,t,r){switch(t.type){case"integer":var i=Number.parseInt(e,10);return Number.isNaN(i)?r?0:null:i;case"string":if(("date-time"===t.format||"date"===t.format)&&e.year)return this.formatIsoDate(this.ngDateToMoment(e));var a=e?e.toString():null;return a&&a.length>0?a:r?"":null;case"object":return e?this.toStrings(e,t):r?{}:null;case"array":return e;case"date":case"date-time":if(e.year)return this.formatIsoDate(this.ngDateToMoment(e));break;case"passport":return e?this.toStrings(e,t):r?{}:null;default:return console.warn("+++ unknown schema type "+t.type+" | returning value as is +++"),e}},t.prototype.makeTimeWindow=function(e,t,r){var i=e.clone().add(t,"hour"),a=e.clone().add(r,"hour");return this.formatTime(i)+"-"+this.formatTime(a)},t.prototype.inRange=function(e,t){return e>=t.min&&e<=t.max},t.prototype.makeUsers=function(t){return t.map((function(t){return{id:t.id,passengerType:t.isChild?e.ɵf.Child:t.isInfant?e.ɵf.Infant:e.ɵf.Adult}}))},t.prototype.makeMomentDayTime=function(e,t,r){var i=l.default();return void 0!==e&&i.add(e,"day"),void 0!==t&&i.set("hours",t),void 0!==r&&i.set("minutes",r),i},t.prototype.sanatizeReturns=function(e,t,r){var i=Object.assign({},e,t);return(r||[]).reduce((function(e,t){var r=e[t];return e[t]=r?"string"==typeof r?l.default(r):r:l.default(),e}),i)},t.prototype.miIsValid=function(e){return 0===e.length||!!e.find((function(e){return e.isValid()}))},t.prototype.isMiValid=function(e,t,r){var i=this,a=Object.values(t||{}),n=Object.values(r||{});return this.miIsValid(e)&&(0===a.length||!!a.find((function(e){return i.miIsValid(e.managementInfo)})))&&(0===n.length||!!n.find((function(e){return i.miIsValid(e.managementInfo)})))},t.prototype.needsMi=function(e,t){var r=this;return e.basketInfoMiDetails.length>0&&(t||!e.basketInfoMiDetails.find((function(e){return r.isMiValid(e.miPerItem,e.miPerUser,e.miPerGuest)})))},t.prototype.findService=function(e,t){return Object.values(e).reduce((function(e,r){return e||r.find((function(e){return e.id===t}))}),null)},t.prototype.allTrue=function(e,t){return e.filter(t).length===e.length},t.prototype.joinFromAttribute=function(e,t,r){return r.map((function(e){return e[t]})).join(e)},t.prototype.splitUpArray=function(e,t,r){void 0===r&&(r=!0);var i=s.default.cloneDeep(e),a=[];if(i.length>t){for(;i.length>=t;)a.push(i.splice(0,t));i.length&&r&&a.push(i)}else a=i;return a},t.prototype.getTimeDifference=function(e,t){return l.default(e).diff(l.default(t),"minutes")},t.prototype.dayDifference=function(e,t){var r=l.default(t).startOf("day").diff(l.default(e).startOf("day"),"day");return r>0?r.toString():""},t.prototype.makeFareRules=function(t,r){var i=r===e.FlightDirectionEnum.Outbound?t.outboundFlights:t.inboundFlights;return{rules:i.reduce((function(e,t){var r,i,a,n,o;return e.cancellation=e.cancellation.concat((null===(r=t.fareConditions)||void 0===r?void 0:r.cancellation)||[]),e.change=e.change.concat((null===(i=t.fareConditions)||void 0===i?void 0:i.change)||[]),e.noShow=e.noShow.concat((null===(a=t.fareConditions)||void 0===a?void 0:a.noShow)||[]),e.upgrade=e.upgrade.concat((null===(n=t.fareConditions)||void 0===n?void 0:n.upgrade)||[]),e.other=e.other.concat((null===(o=t.fareConditions)||void 0===o?void 0:o.other)||[]),e}),{cancellation:[],change:[],noShow:[],upgrade:[],other:[]}),flights:i}},t.prototype.generateIcsFileContents=function(e){return["BEGIN:VCALENDAR\r\n","PRODID:-//Micros Travel//SABS Corporate - MMXIII//EN\r\n","VERSION:2.0\r\n","METHOD:REQUEST\r\n",this.generateIcsFileBodyContent(e),"END:VCALENDAR\r\n"].join("")},t.prototype.generateIcsFileBodyContent=function(e){var t=[];return e.map((function(e,r){var i={dStart:"",dEnd:"",locationFrom:"",locationTo:"",basketId:"",description:"",serviceType:"",summary:""},a="DD MMMM YYYY HH:mm",n=e.service.type,o=e.adults,s=e.children,u=e.bookingThirdPartyReference,c=e.detail,d=e.service;switch(n){case ne.Lounge:i.basketId=e.id,i.dStart=null==c?void 0:c.arrivalDatetime,i.dEnd="",i.summary="Airport Lounge - "+c.name,i.serviceType=d.type.toLowerCase(),i.description=["Lounge: "+c.name+"\r\n","Starts: "+l.default(c.arrivalDatetime).format(a)+"\r\n","Adults: "+o+"\r\n","Children: "+s+"\r\n","Booking Ref: "+u].join("");break;case ne.Cab:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.departs,i.dEnd="",i.summary="Taxi booking - from "+c.fromLocation.address+" to "+c.toLocation.address,i.description=["Pickup Point: "+c.fromLocation.address+"\r\n","Time: "+l.default(c.departs).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.Car:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.pickUpDatetime,i.dEnd=null==c?void 0:c.dropOffDatetime,i.summary="Car booking - from "+c.pickUpLocation.address+" to "+c.dropOffLocation.address,i.description=["Pickup Point: "+c.pickUpLocation.address+"\r\n","Time: "+l.default(c.pickUpDatetime).format(a)+"\r\n","Arrival Point: "+c.dropOffLocation.address+"\r\n","Booking Ref: "+u].join(""),i.locationFrom=c.pickUpLocation.address,i.locationTo=c.dropOffLocation.address;break;case ne.Coach:case ne.FastTrack:case ne.Flight:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.outboundFlights[0].dateTimeDeparting,i.dEnd=null==c?void 0:c.outboundFlights[0].dateTimeArriving,i.summary="Flight Booking - From "+c.outboundFlights[0].originAirport+" to "+c.outboundFlights[0].destinationAirport,i.description=["From: "+c.outboundFlights[0].originAirport+"\r\n","Depart: "+l.default(c.outboundFlights[0].dateTimeDeparting).format(a)+"\r\n","To: "+c.outboundFlights[0].destinationAirport+"\r\n","Arrive: "+l.default(c.outboundFlights[0].dateTimeArriving).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.Hotel:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.checkIn,i.dEnd=null==c?void 0:c.checkOut,i.summary="Hotel booking - "+c.hotelName,i.description=["Hotel: "+c.hotelName+"\r\n","Arrival: "+l.default(c.checkIn).format(a)+"\r\n","Departure: "+l.default(c.checkOut).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.InternationalRail:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.outwardDetail.departureDateTime,i.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,i.locationFrom=c.outwardDetail.departureStationName,i.locationTo=c.outwardDetail.arrivalDateTime,i.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,i.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(a)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.Parking:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.arrivalDatetime,i.dEnd=null==c?void 0:c.departDatetime,i.summary="Airport parking - "+c.name,i.description=["Airport Parking: "+c.name+"\r\n","Booking Ref: "+u].join("");break;case ne.Rail:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.outwardDetail.departureDateTime,i.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,i.locationFrom=c.outwardDetail.departureStationName,i.locationTo=c.outwardDetail.arrivalDateTime,i.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,i.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(a)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(a)+"\r\n","Booking Ref: "+u].join("")}t.push(["BEGIN:VEVENT\r\n",i.dStart?"DTSTART:"+l.default(i.dStart).format("YYYYMMDDTHHmmss")+"\r\n":"",i.dEnd?"DTEND:"+l.default(i.dEnd).format("YYYYMMDDTHHmmss")+"\r\n":"",'ORGANIZER;CN="Do not reply to this email":mailto:do_not_reply@sabscorp.com\r\n',i.locationTo&&i.locationFrom?"LOCATION: "+i.locationTo+" to "+i.locationFrom+" \r\n":"","TRANSP:OPAQUE\r\n","SEQUENCE:0\r\n","UID:"+i.serviceType+"_"+r+"_"+i.basketId+"@sabscorp.com\r\n","DTSTAMP:"+l.default().format("YYYYMMDDTHHmmss")+"\r\n","DESCRIPTION:"+i.description+"\r\n","SUMMARY:"+i.summary+"\r\n","END:VEVENT\r\n"].join(""))})),t.join("")},t.prototype.downloadIcs=function(e,t){var r=document.createElement("a");r.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),r.setAttribute("download",e),r.setAttribute("target","_blank"),r.style.display="none",r.click()},t.prototype.splitStringOnCapitals=function(e,t){void 0===t&&(t=!1);var r=e.split(/(?=[A-Z])/);return t?r.join(" "):r},t.prototype.createFlightFilters=function(e,t){return e.reduce((function(e,t){var r=t.outboundFlights.length-1;e.stops[r]=e.stops[r]||{display:0===r?"Direct":r+" stop"+(1!==r?"s":""),selected:!1,value:r+1};var i=t.inboundFlights?t.inboundFlights.length-1:0,a=i>r?i:r;e.totalStops[a]=e.totalStops[a]||{display:0===a?"Direct":a+" stop"+(1!==a?"s":""),selected:!1,value:a+1};var n=function(t){e.classes[t.cabinClass]=e.classes[t.cabinClass]||{display:t.cabinClass,selected:!1,value:t.cabinClass},e.airlines[t.marketingCarrier]=e.airlines[t.marketingCarrier]||{display:t.marketingCarrierName,selected:!1,value:t.marketingCarrier}};t.outboundFlights.forEach(n);var o=t.baggageAllowance.map((function(e){return e.qty})),s=o.length?Math.min.apply(Math,C(o)):0;e.baggage[s]=e.baggage[s]||{selected:!1,display:s+" bag"+(s>1?"s":""),value:s};var u=function(t,r,i,a,n){var o=t&&t[n]?t[n][i]:void 0;void 0!==o&&(e[r][o]=e[r][o]||{value:t[n][i],display:t[n][a],selected:!1})};u(t.outboundFlights,"depatureAirport","originAirport","originAirportName",0),u(t.outboundFlights,"arrivalAirport","destinationAirport","destinationAirportName",t.outboundFlights.length-1),e.price.min=e.price.min<t.total.price?e.price.min:t.total.price,e.price.max=e.price.max>t.total.price?e.price.max:t.total.price,e.duration.min=e.duration.min<t.outboundTotalDuration?e.duration.min:t.outboundTotalDuration,e.duration.max=e.duration.max>t.outboundTotalDuration?e.duration.max:t.outboundTotalDuration;var c=l.default(t.outboundFlights[0].dateTimeDeparting).get("hour");e.departureTime.min=e.departureTime.min<c?e.departureTime.min:c,e.departureTime.max=e.departureTime.max>c?e.departureTime.max:c;var d=l.default(t.outboundFlights[t.outboundFlights.length-1].dateTimeArriving).get("hour");if(e.arrivalTime.min=e.arrivalTime.min<d?e.arrivalTime.min:d,e.arrivalTime.max=e.arrivalTime.max>d?e.arrivalTime.max:d,t.inboundFlights&&t.inboundFlights.length>0){e.returnDuration.min=e.returnDuration.min<t.inboundTotalDuration?e.returnDuration.min:t.inboundTotalDuration,e.returnDuration.max=e.returnDuration.max>t.inboundTotalDuration?e.returnDuration.max:t.inboundTotalDuration;var h=t&&t.inboundFlights&&t.inboundFlights[0]?l.default(t.inboundFlights[0].dateTimeDeparting).get("hour"):-1;e.returnDepartureTime.min=e.returnDepartureTime.min<h?e.returnDepartureTime.min:h,e.returnDepartureTime.max=e.returnDepartureTime.max>h?e.returnDepartureTime.max:h;var p=l.default(t.outboundFlights[t.outboundFlights.length-1].dateTimeArriving).get("hour");e.returnArrivalTime.min=e.returnArrivalTime.min<p?e.returnArrivalTime.min:p,e.returnArrivalTime.max=e.returnArrivalTime.max>p?e.returnArrivalTime.max:p,(t.inboundFlights||[]).forEach(n),u(t.inboundFlights,"depatureReturnAirport","originAirport","originAirportName",0),u(t.inboundFlights,"arrivalReturnAirport","destinationAirport","destinationAirportName",t.inboundFlights.length-1)}return e}),this.clone(t))},t.prototype.mapOverObject=function(e,t){return Object.entries(e).reduce((function(e,r){return e[r[0]]=t(r[1],r[0]),e}),{})},t.prototype.normaliseMinuteToBase10=function(e){return Math.round(100*e/60)},t.prototype.OBTFlightCabinClassToFlightCabinClass=function(t){var r;return((r={})[e.OBTFlightCabinClass.Business]=H.Business,r[e.OBTFlightCabinClass.BusinessBranded]=H.Business,r[e.OBTFlightCabinClass.EconomyFlexi]=H.EconomyFlexi,r[e.OBTFlightCabinClass.EconomyFlexiBranded]=H.EconomyFlexi,r[e.OBTFlightCabinClass.EconomyNoBags]=H.EconomyNoBags,r[e.OBTFlightCabinClass.EconomyNoBagsBranded]=H.EconomyNoBags,r[e.OBTFlightCabinClass.EconomyRestricted]=H.EconomyRestricted,r[e.OBTFlightCabinClass.EconomyRestrictedBranded]=H.EconomyRestricted,r[e.OBTFlightCabinClass.First]=H.First,r[e.OBTFlightCabinClass.FirstBranded]=H.First,r[e.OBTFlightCabinClass.PremiumEconomy]=H.PremiumEconomy,r[e.OBTFlightCabinClass.PremiumEconomyBranded]=H.PremiumEconomy,r)[t]},t.prototype.FlightCabinClassToBrandedOBTFlightCabinClass=function(t,r){var i,a;return(r?((i={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,i[H.PremiumBusiness]=e.OBTFlightCabinClass.BusinessBranded,i[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,i[H.Economy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,i[H.PremiumFirst]=e.OBTFlightCabinClass.FirstBranded,i[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestrictedBranded,i[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,i[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexiBranded,i[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBagsBranded,i[H.Business]=e.OBTFlightCabinClass.BusinessBranded,i[H.First]=e.OBTFlightCabinClass.FirstBranded,i):((a={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,a[H.PremiumBusiness]=e.OBTFlightCabinClass.Business,a[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestricted,a[H.Economy]=e.OBTFlightCabinClass.EconomyRestricted,a[H.PremiumFirst]=e.OBTFlightCabinClass.First,a[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestricted,a[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,a[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexi,a[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBags,a[H.Business]=e.OBTFlightCabinClass.Business,a[H.First]=e.OBTFlightCabinClass.First,a))[t]},t.prototype.convertMetresToMiles=function(e,t){void 0===t&&(t=-1);var r=e/1609;return t>=0?Number(r.toFixed(t)):r},t.prototype.convertSecondsToHours=function(e,t){void 0===t&&(t=-1);var r=e/60/60;return t>=0?Number(r.toFixed(t)):r},t.prototype.convertSecondsToMins=function(e,t){void 0===t&&(t=-1);var r=e/60;return t>=0?Number(r.toFixed(t)):r},t.prototype.addRailActionRules=function(e,t){return t.reduce((function(e,t){return et(null==t?void 0:t.unavailable)&&(e.unavailable=t.unavailable,e.unavailableMessage=t.unavailableMessage),et(null==t?void 0:t.requiresReason)&&(e.requiresReason=t.requiresReason,e.requiresReasonMessage=t.requiresReasonMessage),e}),e)},t.prototype.map=function(e,t){return Object.assign.apply(Object,C([{}],Object.entries(e).map((function(e){var r,i=S(e,2),a=i[0],n=i[1];return(r={})[a]=t(n),r}))))},t.prototype.mergeObjects=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return s.default.merge(e,t)}),{})},t.prototype.interceptMethodCalls=function(e,t){return new Proxy(e,{get:function(e,r){return"function"==typeof e[r]?new Proxy(e[r],{apply:function(e,i,a){return t(r,a),Reflect.apply(e,i,a)}}):Reflect.get(e,r)}})},t.prototype.getRoundedDownQuarterHour=function(e){var t=e.minutes();return t<=15?e.set("minutes",0):t<=30?e.set("minutes",15):t<=45?e.set("minutes",30):e.set("minutes",45),e},t.prototype.getRoundedUpQuarterHour=function(e){var t=e.minutes();return t<=15?e.set("minutes",15):t<=30?e.set("minutes",30):t<=45?e.set("minutes",45):(e.set("minutes",0),e.add(1,"hour")),e},t}();function et(e){return null!=e}$e.READ_DATE_FORMAT="dd, D MMM YYYY",$e.READ_TIME_FORMAT="HH:mm",$e.DATE_FORMAT="YYMMDD",$e.GRAPHQL_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm:ss",$e.ISO_DATA_FORMAT="YYYY-MM-DD",$e.ISO_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm",$e.ISO_DATA_FORMAT_NO_HYPHANS="YYYYMMDD",$e.TIME_FORMAT="HHmm",$e.TIME_FORMAT_COLON="HH:mm",$e.MMDDYY_DATE="DDMMYYYY",f([Ke(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",Number)],$e.prototype,"getTimeDifference",null),f([Ke(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",String)],$e.prototype,"dayDifference",null),f([Ke(),v("design:type",Function),v("design:paramtypes",[Object,Number]),v("design:returntype",void 0)],$e.prototype,"makeFareRules",null),(qe=e.TaxiFormMode||(e.TaxiFormMode={})).ADDRESS="location",qe.STATION="station",(Xe=e.AirportSearchMode||(e.AirportSearchMode={})).PICKUP="Airport Pick Up",Xe.DROPOFF="Airport drop off",(Ze=e.ActionType||(e.ActionType={})).GET="get",Ze.SAVE="save",Ze.DELETE="delete";var tt,rt=function(r){function i(a,n,o,s,u,c){var d=r.call(this,o,n,s,c)||this;d.cabfetcher=a,d.basketService=u,d.type=ne.Cab,d.travellers=[],d.airportChange=new t.Subject,d.transTypes=[{key:_.Any,value:"Any (1-8 Passengers)",id:8},{key:_.StandardCar,value:"Saloon Car (1-4 Passengers)",id:4},{key:_.BlackCab,value:"Hackney Carriage (1-4 Passengers)",id:4},{key:_.DdaCar,value:"Dda - wheelchair accessible (1-4 Passengers)",id:4},{key:_.MediumMpv,value:"People Carrier (1-7 Passengers)",id:7},{key:_.ExecutiveCar,value:"Executive (1-4 Passengers)",id:4}],d.attributes=[{enabled:!1,key:"wheelchair",value:"Wheelchair (On Request)"},{enabled:!1,key:"call_on_arrival",value:"Call On Arrival"},{enabled:!1,key:"meet_and_greet",value:"Meet And Greet (Charge Applies)"},{enabled:!1,key:"wait_and_return",value:"Wait And Return"}],d.searchTypes=["One-way","Return"],d.airportSearchTypes=["Airport drop off","Airport Pick Up"],d.criteria=["Pick Up Time"],d.mode=e.TaxiFormMode.ADDRESS,d.minSelectDate=l.default(),d.minReturnSelectDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},d._date=null,d.selectedPlaces=[],d._vias=[null,null,null,null],d._searchType=d.searchTypes[0],d._airportSearchType=e.AirportSearchMode.DROPOFF,d._searchCriteria=d.criteria[0],d._outboundDateTime=d.helpers.round(l.default(),l.default.duration(15,"minutes")),d._returnDateTime=d.helpers.round(l.default(),l.default.duration(15,"minutes")),d._flightNumber="",d._returnFlightNumber="",d._terminal=null,d._time=null,d.resultsSessionName=i.STORAGE_SESSION_RESULTS,d.multiResultsSessionName=i.MULTI_STORAGE_SESSION_RESULTS,d.getPassengers=function(){var e=d.adults,t=d.children,r=e+" Adult";return 1!==Number(e)&&(r+="s"),1===Number(t)&&(r+=", "+t+" Child"),Number(t)>1&&(r+=", "+t+" Children"),r};var h=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};d.updateTempParams(s.makeCabHireQuery(h.tempParams));try{var p=o.getSessionItem(i.SECONDARY_STORAGE_SESSION_PARAMS);p&&(d.returnDateTime=l.default(p.tempParams.departs),d.searchType=d.searchTypes[1])}catch(e){console.error("+++ Error recovering return data: ",e," +++")}h.tempParams.fromAddress&&(d.fromAddress=h.tempParams.fromAddress),h.tempParams.toAddress&&(d.toAddress=h.tempParams.toAddress),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){d.travellers=e;var t=d.helpers.selectedTravellers(e,ne.Cab);d.tempParams.adults=t.adults.length,d.tempParams.children=t.children.length,d._isValid()}));var m=o.getSessionItemAsList(d.resultsSessionName)||[];d.fullResults=m,d._cheapestResultPrice=d.updateLowestPrice(m),d.results.next(m||[]);var f=o.getSessionItemAsList(d.multiResultsSessionName)||[];return d.fullMultiResults=f,d.multiResults.next(f),d._isValid(),d.outboundVisibility=new t.BehaviorSubject(!1),d.inboundVisibility=new t.BehaviorSubject(!1),d}return m(i,r),Object.defineProperty(i.prototype,"fromLocation",{get:function(){return this._fromLocation},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toLocation",{get:function(){return this._toLocation},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"searchType",{get:function(){return this._searchType},set:function(e){this._searchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"airportSearchType",{get:function(){return this._airportSearchType},set:function(e){this._airportSearchType=e,(this.fromAddress||this.toAddress)&&this.switchFromAndToLocation()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fromLocationType",{get:function(){return this.tempParams.fromLocationType},set:function(e){this.tempParams.fromLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toLocationType",{get:function(){return this.tempParams.toLocationType},set:function(e){this.tempParams.toLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"searchCriteria",{get:function(){return this._searchCriteria},set:function(e){this._searchCriteria=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outboundDateTime",{get:function(){return this._outboundDateTime},set:function(e){this._outboundDateTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnDateTime",{get:function(){return this._returnDateTime},set:function(e){this._returnDateTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnFlightNumber",{get:function(){return this._returnFlightNumber},set:function(e){this._returnFlightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"airport",{get:function(){return this.tempParams.airport},set:function(e){this.tempParams.airport=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this._terminal},set:function(e){this._terminal=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"departs",{get:function(){return this.tempParams.departs},set:function(e){this.tempParams.departs=e.isValid?e:null,e&&e.isValid()&&(this._date=this.helpers.momentToNgDate(e),this._time=this.helpers.formatTimeColon(e)),this.minReturnSelectDate={day:l.default(e).date(),month:l.default(e).month()+1,year:l.default(e).year()},e.isAfter(this.returnDateTime)&&this.returnDateTime.set("date",e.date()),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"countryCode",{get:function(){return this.tempParams.countryCode},set:function(e){this.tempParams.countryCode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"vias",{get:function(){return this._vias},set:function(e){this._vias=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viasFrom",{get:function(){return this.tempParams.viasFrom},set:function(e){this.tempParams.viasFrom=e,this._vias[0]=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viasTo",{get:function(){return this.tempParams.viasTo},set:function(e){this.tempParams.viasTo=e,this._vias[1]=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"vehicleType",{get:function(){return this.tempParams.vehicleType},set:function(e){this.tempParams.vehicleType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fromAddress",{get:function(){return this.tempParams.fromAddress},set:function(e){this.tempParams.fromAddress=e,this._fromLocation=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fromStation",{get:function(){return this.tempParams.fromStation},set:function(e){this.tempParams.fromStation=e,this._fromLocation=e?{address:e.destination,postcode:e.postcode}:null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toAddress",{get:function(){return this.tempParams.toAddress},set:function(e){this.tempParams.toAddress=e,this._toLocation=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toStation",{get:function(){return this.tempParams.toStation},set:function(e){this.tempParams.toStation=e,this._toLocation=e?{address:e.destination,postcode:e.postcode}:null,this._isValid()},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCabHireQuery());try{this.storageService.removeSessionItem(i.SECONDARY_STORAGE_SESSION_PARAMS)}catch(e){}this._searchType=this.searchTypes[0],this._isValid()},i.prototype.resetParams=function(){this.reset(),this.resetQuery(),this.results.next([]),this.multiResults.next([])},i.prototype._isValid=function(){var e=this;this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams}),this.validationMessages=[],this.tempParams.fromAddress||this.validationMessages.push("From - Enter a location or postcode."),this.tempParams.toAddress||this.validationMessages.push("To - Enter a location or postcode."),this.tempParams.departs.unix()<l.default().unix()&&this.validationMessages.push("Taxi journey cannot be in the past."),this.tempParams.adults+this.tempParams.children<1&&this.validationMessages.push("There must be at least 1 traveller"),this.searchType===this.searchTypes[1]&&this.returnDateTime.isSameOrBefore(this.departs)&&this.validationMessages.push("Return Date/Time must be after outbound date/time"),this.travellers.length>4&&this.transTypes.find((function(t){return t.key===e.tempParams.vehicleType})).id<this.travellers.length&&this.validationMessages.push("The number of passengers exceeds the available vehicle capacity for the "+this.tempParams.vehicleType+" taxi"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype._updateDateTime=function(){this._date&&this._time&&(this.departs=this.helpers.ngDateToMoment(this._date,this._time))},i.prototype.startSearch=function(){if(this.results.next([]),this.multiResults.next([]),this.isValid.value){if(this.searchType===this.searchTypes[1]){var e=this.getSearchQuery(),t=this.getReturnSearchQuery();return console.log("+++ Search Query: ",e," +++"),console.log("+++ Search Return Query: ",t," +++"),this.storageService.setSessionItem(i.SECONDARY_STORAGE_SESSION_PARAMS,{tempParams:t}),this._startMultiSearch([this.cabfetcher.fetchList(this.helpers.removeNulls(e)),this.cabfetcher.fetchList(this.helpers.removeNulls(t))])}e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(this.getSearchQuery())),this._startSearch(this.cabfetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Cab,searchArgs:t,travelDate:this.departs.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(e){var t=e;return t.fromAddress=this.tempParams.fromAddress,t.toAddress=this.tempParams.toAddress,t.fromStation=this.tempParams.fromStation,t.toStation=this.tempParams.toStation,t.viasFrom=this.viasFrom,t.viasTo=this.viasTo,t},i.prototype.startRecentSearch=function(e){this.departs=l.default(e.searchArgs.departs),this.vehicleType=e.searchArgs.vehicleType,this.fromAddress=e.searchArgs.fromAddress,this.toAddress=e.searchArgs.toAddress,this.fromStation=e.searchArgs.fromStation,this.toStation=e.searchArgs.toStation,this._fromLocation=this.createCabHireLocation(this.fromAddress),this._toLocation=this.createCabHireLocation(this.toAddress),this.viasFrom=e.searchArgs.viasFrom,this.viasTo=e.searchArgs.viasTo,this.searchService.startSearches()},i.prototype.getSearchQuery=function(e){void 0===e&&(e=!0);var t={adults:this.tempParams.adults,children:this.tempParams.children,departs:this.tempParams.departs,fromLocation:e?this.createCabHireLocation(this.tempParams.fromAddress):this.tempParams.fromAddress,toLocation:e?this.createCabHireLocation(this.tempParams.toAddress):this.tempParams.toAddress,infants:0,vehicleType:this.vehicleType,vias:this._vias};return this.helpers.removeNulls(t)},i.prototype.getReturnSearchQuery=function(){var e={adults:this.tempParams.adults,children:this.tempParams.children,departs:this._returnDateTime,fromLocation:this.createCabHireLocation(this.tempParams.toAddress),toLocation:this.createCabHireLocation(this.tempParams.fromAddress),infants:0,vehicleType:this.vehicleType,vias:this._vias};return this.helpers.removeNulls(e)},i.prototype.updateOutboundAddress=function(e,t){this.tempParams.fromAddress=this.getAddressFormat(e,t)},i.prototype.updateInboundAddress=function(e,t){this.tempParams.toAddress=this.getAddressFormat(e,t)},i.prototype.createCabHireLocation=function(e){return{address:[null==e?void 0:e.Terminal,null==e?void 0:e.House,null==e?void 0:e.Street,null==e?void 0:e.Town,null==e?void 0:e.Country].filter((function(e){return!!e})).join(","),postcode:null==e?void 0:e.PostCode}},i.prototype.matchAddresses=function(){this._toLocation=this.createCabHireLocation(this.tempParams.toAddress),this._fromLocation=this.createCabHireLocation(this.tempParams.fromAddress),this._isValid()},i.prototype.sortBy=function(e,t){if(t>=0){console.log("here");var r=this.helpers.clone(this.fullMultiResults[t]);r=e?r.sort((function(e,t){return t.price-e.price})):r.sort((function(e,t){return e.price-t.price})),this.fullMultiResults[t]=r,this.multiResults.next(this.fullMultiResults)}else{r=this.helpers.clone(this.fullResults);r=e?r.sort((function(e,t){return t.price-e.price})):null==r?void 0:r.sort((function(e,t){return e.price-t.price})),this.results.next(r)}},i.prototype.getAddressFormat=function(e,t){return{House:this.getAddressFromPlaceDetails(e,["floor","street_number","premise"]),Street:this.getAddressFromPlaceDetails(e,["route","street_name","establishment"]),Town:this.getAddressFromPlaceDetails(e,["postal_town","administrative_area_level_2","locality"]),PostCode:this.getAddressFromPlaceDetails(e,["postcode"]),Country:this.getAddressFromPlaceDetails(e,["country"]),placeDescription:t}},i.prototype.getAddressFromPlaceDetails=function(e,t){var r,i,a=null;if(e&&Array.isArray(e)){var n=function(t){var r=e.filter((function(e){return Array.isArray(e.types)&&e.types.includes(t)}))[0];if(r)return a=r.long_name,"break"};try{for(var o=g(t),s=o.next();!s.done;s=o.next()){if("break"===n(s.value))break}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}return a},i.prototype.getAddressFromAirportDetails=function(e,t){console.log(e);var r=null;return e&&(r={Country:e.country,Street:e.road,PostCode:e.postcode,Town:e.city,placeDescription:t,House:t}),r},i.prototype.setLocationFromAirport=function(t,r){var i=this.getAddressFromAirportDetails(t,r);this.mode===e.TaxiFormMode.STATION&&(this.airportSearchType===e.AirportSearchMode.PICKUP?this.fromAddress=i:this.toAddress=i)},i.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},i.prototype.setOutboundFormVisibility=function(e){this.outboundVisibility.next(e)},i.prototype.setInboundFormVisibility=function(e){this.inboundVisibility.next(e)},i.prototype.getOutboundFormVisibility=function(){return this.outboundVisibility},i.prototype.getInboundFormVisibility=function(){return this.inboundVisibility},i.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n,o,s,l,u=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,c=null===(r=e[ne.Rail])||void 0===r?void 0:r.searchQuery,d=null===(i=e[ne.InternationalRail])||void 0===i?void 0:i.searchQuery,h=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,p=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery,m=null===(o=e[ne.Lounge])||void 0===o?void 0:o.searchQuery,f=null===(s=e[ne.Parking])||void 0===s?void 0:s.searchQuery,v=null===(l=e[ne.Eurostar])||void 0===l?void 0:l.searchQuery;if(u)try{if(e.FLIGHT.inboundDate){var y=e.FLIGHT.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.FLIGHT.outboundDate){y=e.FLIGHT.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from flight item")}else if(c)try{if(e.RAIL.inboundDate){y=e.RAIL.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.RAIL.outboundDate){y=e.RAIL.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from rail item")}else if(d)try{if(e.INTERNATIONAL_RAIL.inboundDate){y=e.INTERNATIONAL_RAIL.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.INTERNATIONAL_RAIL.outboundDate){y=e.INTERNATIONAL_RAIL.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from international rail item")}else if(h)try{if(e.HOTEL.inboundDate){y=e.HOTEL.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.HOTEL.outboundDate){y=e.HOTEL.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from hotel item")}else if(p)try{if(e.CAR.inboundDate){y=e.CAR.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.CAR.outboundDate){y=e.CAR.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from car item")}else if(m)try{if(e.LOUNGE.inboundDate){y=e.LOUNGE.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.LOUNGE.outboundDate){y=e.LOUNGE.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from lounge item")}else if(f)try{if(e.PARKING.inboundDate){y=e.PARKING.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.PARKING.outboundDate){y=e.PARKING.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from parking item")}else if(v)try{if(e.EUROSTAR.inboundDate){y=e.EUROSTAR.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.EUROSTAR.outboundDate){y=e.EUROSTAR.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from eurostar item")}},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t,r,i,a,n=this,o=e.searchQuery;if(o&&(this.departs=l.default(o.departs),this.vehicleType=o.vehicleType,this.fromAddress=this.convertAddressLocation(o.fromLocation.address,o.fromLocation.postcode),this.toAddress=this.convertAddressLocation(o.toLocation.address,o.toLocation.postcode),o.vias)){var s=o.vias;s[0]&&(this.viasFrom=this.convertAddressLocation(null===(t=s[0])||void 0===t?void 0:t.address,null===(r=s[0])||void 0===r?void 0:r.postcode));var u=o.vias;u[1]&&(this.viasTo=this.convertAddressLocation(null===(i=u[1])||void 0===i?void 0:i.address,null===(a=u[1])||void 0===a?void 0:a.postcode))}e.users&&e.users.forEach((function(e){n.searchService.addTraveller(e)}))},i.prototype.convertAddressLocation=function(e,t){for(var r=e.split(","),i="",a=r[r.length-2],n=1;n<r.length-2;n++)i+=r[n]+" ";return{Country:e.slice(-2),House:r[0],PostCode:t,Street:i,Town:a}},i.prototype.getTransType=function(){var e,t=this.tempParams.vehicleType;return(null===(e=this.transTypes.find((function(e){return e.key===t})))||void 0===e?void 0:e.value)||""},i.prototype.addCabHireToBasket=function(t,r){var i,a,n,o,s,l;return y(this,void 0,void 0,(function(){var u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return u=p.sent(),c=null==u?void 0:u.subject.value,d=this.getTermsAndCond(t),c?[4,this.basketService.addToBasket({adults:r.adults,basket:c.id,service:t.sourceId.toString(),detail:{id:t.id,departs:t.departs,supplierName:t.supplierName,estimatedCO2:t.estimatedCO2,fromLocation:{address:r.fromLocation.address,postcode:r.fromLocation.postcode,latitude:t.fromLocation.latitude,longitude:t.fromLocation.longitude},toLocation:{address:r.toLocation.address,postcode:r.toLocation.postcode,latitude:t.toLocation.latitude,longitude:t.toLocation.longitude},vehicleType:t.vehicleType,tripDistanceMetres:t.tripDistanceMetres,tripDurationSeconds:t.tripDurationSeconds,termsAndCond:d},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,co2PerItem:t.co2PerItem,co2PerPassenger:t.co2PerPassenger,outboundDate:r.departs.format(),lowestPrice:(null===(i=this.cheapestPrice)||void 0===i?void 0:i.amount)!=t.price||(null===(a=this.cheapestPrice)||void 0===a?void 0:a.currencyCode)!=t.currency?null===(n=this.cheapestPrice)||void 0===n?void 0:n.amount:null,lowestPriceCurrency:(null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount)!=t.price||(null===(s=this.cheapestPrice)||void 0===s?void 0:s.currencyCode)!=t.currency?null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode:null},u,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(h=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.switchFromAndToLocation=function(){var e=Object.assign({},this.toAddress),t=Object.assign({},this.fromAddress);this.fromAddress=e,this.toAddress=t},i.prototype.updateLowestPrice=function(e){if(!(null==e?void 0:e.length))return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.getTermsAndCond=function(e){var t=l.default(e.departs).format($e.ISO_DATA_FORMAT_TIME);return[{name:"Lowest Price",value:e.price.toString()+" "+e.currency},{name:"Pickup Time",value:t},{name:"Terms and Conditions",value:'<a target="_blank" href="https://www.cmacgroup.com/">www.cmacgroup.com</a>'}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Cab,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r=this;return b(this,(function(i){return t.fromLocation.Street&&t.toLocation.Street?this.mode=e.TaxiFormMode.ADDRESS:(this.mode=e.TaxiFormMode.STATION,this.airportSearchType=t.fromLocation.Street?e.AirportSearchMode.DROPOFF:e.AirportSearchMode.PICKUP,this.searchService.getAirportsList(t.fromLocation.Street?t.toLocation.House:t.fromLocation.House).subscribe((function(e){r.airport=e[0]}))),this.adults=t.adults,this.children=t.children,this.infants=t.infants,this.fromAddress=t.fromLocation,this.toAddress=t.toLocation,this.vehicleType=t.vehicleType,[2]}))}))},i}(c);rt.STORAGE_SESSION_PARAMS="search_cab",rt.SECONDARY_STORAGE_SESSION_PARAMS="secondary_search_cab",rt.STORAGE_SESSION_RESULTS="results_cab",rt.MULTI_STORAGE_SESSION_RESULTS="multi_results_cab",(tt=e.SortTypesCar||(e.SortTypesCar={})).price="price",tt.brand="brand",tt.size="size",tt.preferred="preferred",tt.expensive="expensive";var it=function(i){function a(t,r,n,o,s,u,c){var d=i.call(this,s,n,u,c)||this;d.carhirefetcher=t,d.carHireAvailabilityDetailFetcher=r,d.basketService=o,d._carTypeCodes=[["B","2-3 Door",O.TwoToThreeDoor],["C","2/4 Door",O.TwoOrFourDoor],["D","4-5 Door",O.FourToFiveDoor],["W","Wagon / Estate",O.WagonOrEstate],["V","Passenger Van",O.PassengerVan],["L","Limousine",O.Limousine],["S","Sport",O.Sport],["T","Convertible",O.Convertible],["F","SUV",O.Suv],["J","Open Air All Terrain",O.OpenAirAllTerrain],["X","Special",O.Special],["P","Pickup Regular Cab",O.PickUpRegularCab],["Q","Pickup Extended Cab",O.PickUpExtendedCab],["Z","Special Offer Car",O.SpecialOfferCar],["E","Coupe",O.Coupe],["M","Monospace (Europe)",O.MonospaceEuropeanUse],["R","Recreational Vehicle",O.Suv],["H","Motor Home",O.MotorHome],["Y","2-Wheel Vehicle",O.TwoWheelVehicle],["N","Roadster",O.Roadster],["G","Crossover",O.Suv],["K","Commercial Van Or Truck",O.CommercialVanOrTruck]],d._carAirConditionTypes=[["Any","Any",null],["Y","Yes",!0],["N","No",!1]],d._withinDistance=[{name:"1 mile",value:"1"},{name:"2 miles",value:"2"},{name:"5 miles",value:"5"},{name:"10 miles",value:"10"},{name:"20 miles",value:"20"}],d._carTransmissionCodes=[["M","Manual",I.Manual],["N","Manual 4-Wheel Drive",I.Manual],["C","Manual All-Wheel Drive",I.Manual],["A","Automatic",I.Auto],["B","Automatic 4-Wheel Drive",I.Auto],["D","Automatic All- Wheel Drive",I.Auto]],d._vendors=[{code:"-",name:"Any"},{code:"AC",name:"Ace Rent A Car"},{code:"AD",name:"Advantage Rent A Car"},{code:"AL",name:"Alamo"},{code:"ZI",name:"Avis"},{code:"AT",name:"Atesa"},{code:"ZD",name:"Budget Rent A Car"},{code:"CI",name:"Citer Rent A Car"},{code:"ZR",name:"Dollar Rent A Car"},{code:"DF",name:"Driving Force"},{code:"EY",name:"Economy Rent A Car"},{code:"ET",name:"Enterprise"},{code:"EP",name:"Europcar"},{code:"IM",name:"Europcar Southafrica"},{code:"EZ",name:"Ez Rent A Car"},{code:"FF",name:"Firefly"},{code:"FX",name:"Fox Rent A Car"},{code:"GN",name:"Guerin Car Rental"},{code:"ZE",name:"Hertz"},{code:"LM",name:"L & M Car Rental"},{code:"LL",name:"Localiza"},{code:"MW",name:"Midway Car Rental"},{code:"ZL",name:"National Car Rental System"},{code:"NC",name:"Nextcar"},{code:"NU",name:"Nu Car Rentals"},{code:"ZA",name:"Payless Car Rental"},{code:"PR",name:"Priceless"},{code:"RW",name:"Rent A Wreck"},{code:"SX",name:"Sixt"},{code:"TE",name:"Tempest"},{code:"XF",name:"Test-S Cross Galileo"},{code:"XG",name:"Test-S Cross Trng"},{code:"ZT",name:"Thrifty Car Rental"},{code:"PM",name:"Travelport Test Code"},{code:"SV",name:"U-Save Auto Rental"},{code:"WF",name:"Woodford"}],d._car_classes=[{code:"M",name:"Mini",key:R.Mini,value:"10"},{code:"N",name:"Mini Elite",key:R.MiniElite,value:"20"},{code:"E",name:"Economy",key:R.Economy,value:"30"},{code:"H",name:"Economy Elite",key:R.EconomyElite,value:"40"},{code:"C",name:"Compact",key:R.Compact,value:"50"},{code:"D",name:"Compact Elite",key:R.CompactElite,value:"60"},{code:"I",name:"Intermediate",key:R.Intermediate,value:"70"},{code:"J",name:"Intermediate Elite",key:R.IntermediateElite,value:"80"},{code:"S",name:"Standard",key:R.Standard,value:"90"},{code:"R",name:"Standard Elite",key:R.StandardElite,value:"100"},{code:"F",name:"Full Size",key:R.Fullsize,value:"110"},{code:"G",name:"Full Size Elite",key:R.FullsizeElite,value:"120"},{code:"P",name:"Premium",key:R.Premium,value:"130"},{code:"U",name:"Premium Elite",key:R.PremiumElite,value:"140"},{code:"L",name:"Luxury",key:R.Luxury,value:"150"},{code:"W",name:"Luxury Elite",key:R.LuxuryElite,value:"160"},{code:"O",name:"Oversize",key:R.Oversize,value:"170"},{code:"X",name:"Special",key:R.Special,value:"180"}],d._location_types=[e.LocationTypes.City,e.LocationTypes.Airport,e.LocationTypes.Postcode],d.carClassMap={mini:0,"mini elite":1,economy:2,"economy elite":3,compact:4,"compact special":5,"compact elite":6,intermediate:7,"intermediate elite":8,standard:9,"standard elite":10,"full size":11,"full size elite":12,premium:13,"premium elite":14,luxury:15,"luxury elite":16,oversize:17,special:18},d.type=ne.Car,d._sorting_options=[{value:0,display:"Cheapest First"},{value:1,display:"Most Expensive First"},{value:2,display:"Preferred First"}],d._minDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},d._minInDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},d._pickup_date=null,d._pickup_time=null,d._dropoff_date=null,d._dropoff_time=null,d.resultsSessionName=a.STORAGE_SESSION_RESULTS,d.multiResultsSessionName=a.STORAGE_SESSION_RESULTS;var h=s.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};d.updateTempParams(u.makeCarHireQuery(h.tempParams)),c.fullUserDetails.userConfigs.subscribe((function(e){var t;console.log(e),e&&(null==e?void 0:e.carhire_defaults)&&d.updateTempParams(u.makeCarHireQuery(null===(t=null==e?void 0:e.carhire_defaults)||void 0===t?void 0:t.config))})),u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(e){d.adults=1,d.children=0,d.travellers=(null==e?void 0:e.slice(0,1))||[],d._isValid()}));var p=s.getSessionItemAsList(d.resultsSessionName)||[];return d.fullResults=n.clone(p||[]),d._cheapestResultPrice=d.updateLowestPrice(p),d.results.next(p),d}return m(a,i),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"estimatedMileage",{get:function(){return this.tempParams.estimatedMileage},set:function(e){this.tempParams.estimatedMileage=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickupTime",{get:function(){return this._pickupTime},set:function(e){this._pickupTime=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoffTime",{get:function(){return this._dropoffTime},set:function(e){this._dropoffTime=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodePickupRaw",{get:function(){return this.tempParams.postcodePickupRaw},set:function(e){this.tempParams.postcodePickupRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodeDropoffRaw",{get:function(){return this.tempParams.postcodeDropoffRaw},set:function(e){this.tempParams.postcodeDropoffRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityPickupDepot",{get:function(){return this.tempParams.cityPickupDepot},set:function(e){this.tempParams.cityPickupDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityDropoffDepot",{get:function(){return this.tempParams.cityDropoffDepot},set:function(e){this.tempParams.cityDropoffDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodePickup",{get:function(){return this.tempParams.postcodePickup},set:function(t){this.tempParams.postcodePickup=t,this.tempParams.postcodePickup&&(this.tempParams.locationType=e.LocationTypes.Postcode),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodeDropoff",{get:function(){return this.tempParams.postcodeDropoff},set:function(e){this.tempParams.postcodeDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityPickup",{get:function(){return this.tempParams.cityPickup},set:function(t){this.tempParams.cityPickup=t,this.tempParams.cityPickup&&(this.tempParams.locationType=e.LocationTypes.City,console.log(this.tempParams.locationType)),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityDropoff",{get:function(){return this.tempParams.cityDropoff},set:function(e){this.tempParams.cityDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minDate",{get:function(){return this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minInDate",{get:function(){return this._minInDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_country",{get:function(){return this.tempParams.pickup_country},set:function(e){this.tempParams.pickup_country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_country",{get:function(){return this.tempParams.dropoff_country},set:function(e){this.tempParams.dropoff_country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_location",{get:function(){return this.tempParams.pickup_location},set:function(t){this.tempParams.pickup_location=t,this.tempParams.pickup_location&&(this.tempParams.locationType=e.LocationTypes.Airport),this.return_to_pickup&&(this.dropoff_location=t),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_location",{get:function(){return this.tempParams.dropoff_location},set:function(e){this.tempParams.dropoff_location=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"ngbPickupDate",{get:function(){return this._ngbPickupDate},set:function(e){this._ngbPickupDate=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"ngbDropoffDate",{get:function(){return this._ngbDropoffDate},set:function(e){this._ngbDropoffDate=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_datetime",{get:function(){return this.tempParams.pickup_datetime},set:function(e){this.tempParams.pickup_datetime=e;try{e&&e.isValid()&&(this._ngbPickupDate=this.helpers.momentToNgDate(e),this._pickupTime=l.default(e).format("HH:mm")?l.default(e).format("HH:mm"):"07:30"),this._minInDate={day:e.date(),month:e.month()+1,year:e.year()},e.isSameOrAfter(this.tempParams.dropoff_datetime)&&(this.dropoff_datetime=this.dropoff_datetime.set("date",e.date()).set("month",e.month()).set("year",e.year()))}catch(e){}this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_datetime",{get:function(){return this.tempParams.dropoff_datetime},set:function(e){this.tempParams.dropoff_datetime=e,e&&e.isValid()&&(this._ngbDropoffDate=this.helpers.momentToNgDate(e),this._dropoffTime=l.default(e).format("HH:mm")?l.default(e).format("HH:mm"):"08:30"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_date",{get:function(){return this._pickup_date},set:function(e){this._pickup_date=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_time",{get:function(){return this._pickup_time},set:function(e){this._pickup_time=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_date",{get:function(){return this._dropoff_date},set:function(e){this._dropoff_date=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_time",{get:function(){return this._dropoff_time},set:function(e){this._dropoff_time=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"return_to_pickup",{get:function(){return this.tempParams.return_to_pickup},set:function(e){this.tempParams.return_to_pickup=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenVendor",{get:function(){return this.tempParams.chosenVendor},set:function(e){this.tempParams.chosenVendor=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenDistance",{get:function(){return this.tempParams.chosenDistance},set:function(e){this.tempParams.chosenDistance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carClass",{get:function(){return this.tempParams.carClass},set:function(e){this.tempParams.carClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carType",{get:function(){return this.tempParams.carType},set:function(e){this.tempParams.carType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"transmission",{get:function(){return this.tempParams.transmission},set:function(e){this.tempParams.transmission=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"airCon",{get:function(){return this.tempParams.airCon},set:function(e){this.tempParams.airCon=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"locationType",{get:function(){return this.tempParams.locationType},set:function(e){this.tempParams.locationType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(96).fill(0).map((function(e,t){return{value:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0"),display:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carAirConditionTypes",{get:function(){return this._carAirConditionTypes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"withinDistance",{get:function(){return this._withinDistance},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carTransmissionCodes",{get:function(){return this._carTransmissionCodes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carTypeCodes",{get:function(){return this._carTypeCodes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"vendors",{get:function(){return this._vendors},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortingOptions",{get:function(){return this._sorting_options},enumerable:!1,configurable:!0}),a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCarHireQuery()),this.estimatedMileage=null,this._isValid()},a.prototype._isValid=function(){var t,r,i;if(this.doChecks){switch(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams}),this.validationMessages=[],this.locationType){case e.LocationTypes.Airport:this.pickup_location&&this.pickup_location.destination||this.validationMessages.push("Please supply a pickup location"),this.dropoff_location&&this.dropoff_location.destination||this.validationMessages.push("Please supply a dropoff location");break;case e.LocationTypes.City:this.cityPickup||this.validationMessages.push("Please supply a pickup city"),this.cityDropoff||this.validationMessages.push("Please supply a dropoff city");break;case e.LocationTypes.Postcode:this.postcodePickup||this.validationMessages.push("Please supply a pickup depot"),this.postcodeDropoff||this.validationMessages.push("Please supply a dropoff depot")}this.estimatedMileage&&this.estimatedMileage<=0&&this.validationMessages.push("Estimated Milage must be a positive number.");try{this.pickup_datetime||this.validationMessages.push("Please supply a pickup time and date"),this.dropoff_datetime||this.validationMessages.push("Please supply a drop off time and date"),(null===(t=this.dropoff_datetime)||void 0===t?void 0:t.isSameOrBefore(this.pickup_datetime,"minute"))&&this.validationMessages.push("Dropoff date/time cannot be before or the same as pickup date/time"),(null===(r=this.pickup_datetime)||void 0===r?void 0:r.isBefore(l.default()))&&this.validationMessages.push("Pickup date/time must be after present date/time"),(null===(i=this.dropoff_datetime)||void 0===i?void 0:i.isBefore(l.default()))&&this.validationMessages.push("Dropoff date/time must be after present date/time")}catch(e){}this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)}},a.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(this.getSearchQuery())),this._startSearch(this.carhirefetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Car,searchArgs:t,travelDate:this.pickup_datetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(t){var r=t;switch(this.locationType){case e.LocationTypes.City:r.city={pickupName:this.cityPickup.name,pickupCountryCode:this.cityPickup.countryCode,pickupCity:this.cityPickup.id.toString(),pickupLatitude:this.cityPickup.latitude,pickupLongitude:this.cityPickup.longitude,dropOffName:this.cityDropoff.name,dropoffCountryCode:this.cityDropoff.countryCode,dropoffCity:this.cityDropoff.id.toString(),dropOffLatitude:this.cityDropoff.latitude,dropOffLongitude:this.cityDropoff.longitude,pickupAddressLines:this.cityPickupDepot.addressLines[0],pickupCityName:this.cityPickupDepot.cityName,pickupExtendedLocationCode:this.cityPickupDepot.extendedLocationCode,pickupLocationCode:this.cityPickupDepot.locationCode,pickupVendor:this.cityPickupDepot.vendor,pickupVendorCode:this.cityPickupDepot.vendorCode,chosenDistance:this.chosenDistance,dropOffAddressLines:this.cityDropoffDepot.addressLines[0],dropOffCityName:this.cityDropoffDepot.cityName,dropOffExtendedLocationCode:this.cityDropoffDepot.extendedLocationCode,dropOffLocationCode:this.cityDropoffDepot.locationCode,dropOffVendor:this.cityDropoffDepot.vendor,dropOffVendorCode:this.cityDropoffDepot.vendorCode};break;case e.LocationTypes.Postcode:r.depot={vendorCode:this.postcodePickup.vendorCode,pickupLocationCode:this.postcodePickup.locationCode,pickupExtendedLocationCode:this.postcodePickup.extendedLocationCode,pickupAddressLines:this.postcodePickup.addressLines[0],pickupCityName:this.postcodePickup.cityName,pickupVendor:this.postcodePickup.vendor,dropOffLocationCode:this.postcodeDropoff.locationCode,dropOffExtendedLocationCode:this.postcodeDropoff.extendedLocationCode,dropoffAddressLines:this.postcodeDropoff.addressLines[0],dropoffCityName:this.postcodeDropoff.cityName,dropoffVendor:this.postcodeDropoff.vendor,chosenDistance:this.chosenDistance,pickupPostCode:this.postcodePickupRaw.name,pickupLatitude:this.postcodePickupRaw.latitude,pickupLongitude:this.postcodePickupRaw.longitude,dropoffPostCode:this.postcodeDropoffRaw.name,dropoffLatitude:this.postcodeDropoffRaw.latitude,dropoffLongitude:this.postcodeDropoffRaw.longitude}}return r},a.prototype.startRecentSearch=function(e){this.chosenVendor=e.searchArgs.vendor,this.carClass=e.searchArgs.class,this.carType=e.searchArgs.type,this.transmission=e.searchArgs.transmission,this.airCon=e.searchArgs.aircon,this.estimatedMileage=e.searchArgs.estimatedDailyDistance,this.dropoff_datetime=l.default(e.searchArgs.dropoffDateTime),this.pickup_datetime=l.default(e.searchArgs.pickupDateTime),e.searchArgs.city?this.getParamsForCarbyCity(e.searchArgs.city):e.searchArgs.airport?this.getParamsForCarbyAirport(e.searchArgs.airport):e.searchArgs.depot&&this.getParamsForCarbyPostCode(e.searchArgs.depot)},a.prototype.getParamsForCarbyAirport=function(r){var i=this;this.locationType=e.LocationTypes.Airport,t.combineLatest([this.searchService.getAirportByCode(r.pickupCode),this.searchService.getAirportByCode(r.dropoffCode)]).subscribe((function(e){var t,r,a,n,o,s,l,u,c,d,h,p,m=S(e,2),f=m[0],v=m[1];f&&v&&(i.dropoff_location={destination:f.iataMatch.name,gateway:f.iataMatch.iata,terminals:i.searchService.processTerminals(v.iataMatch.terminals),country:null===(r=null===(t=f.iataMatch)||void 0===t?void 0:t.locationDetails)||void 0===r?void 0:r.country,postcode:null===(n=null===(a=f.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.postcode,countryCode:null===(s=null===(o=f.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.countryCode},i.pickup_location={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:i.searchService.processTerminals(v.iataMatch.terminals),country:null===(u=null===(l=v.iataMatch)||void 0===l?void 0:l.locationDetails)||void 0===u?void 0:u.country,postcode:null===(d=null===(c=v.iataMatch)||void 0===c?void 0:c.locationDetails)||void 0===d?void 0:d.postcode,countryCode:null===(p=null===(h=v.iataMatch)||void 0===h?void 0:h.locationDetails)||void 0===p?void 0:p.countryCode},i.dropoff_country=i.dropoff_location.countryCode,i.pickup_country=i.pickup_location.countryCode,i.searchService.startSearches())}))},a.prototype.getParamsForCarbyCity=function(t){this.locationType=e.LocationTypes.City,this.chosenDistance=t.chosenDistance,this.cityPickup={countryCode:t.pickupCountryCode,id:t.pickupCity,name:t.pickupName,type:e.LocationTypes.City,latitude:t.pickupLatitude,longitude:t.pickupLongitude},this.cityDropoff={countryCode:t.dropoffCountryCode,id:t.dropoffCity,name:t.dropOffName,type:e.LocationTypes.City,latitude:t.dropOffLatitude,longitude:t.dropOffLongitude},this.cityDropoffDepot={addressLines:[t.dropOffAddressLines],cityName:t.dropOffCityName,extendedLocationCode:t.dropOffExtendedLocationCode,locationCode:t.dropOffLocationCode,vendor:t.dropOffVendor,vendorCode:t.dropOffVendorCode},this.cityPickupDepot={addressLines:[t.pickupAddressLines],cityName:t.pickupCityName,extendedLocationCode:t.pickupExtendedLocationCode,locationCode:t.pickupLocationCode,vendor:t.pickupVendor,vendorCode:t.pickupVendorCode},this.searchService.startSearches()},a.prototype.getParamsForCarbyPostCode=function(t){this.locationType=e.LocationTypes.Postcode,this.chosenDistance=t.chosenDistance,this.postcodeDropoff={addressLines:[t.dropoffAddressLines],vendorCode:t.vendorCode,locationCode:t.dropOffLocationCode,extendedLocationCode:t.dropOffExtendedLocationCode,cityName:t.dropoffCityName,vendor:t.dropoffVendor},this.postcodeDropoffRaw={name:t.dropoffPostCode,type:e.LocationTypes.Postcode,latitude:t.dropoffLatitude,longitude:t.dropoffLongitude},this.postcodePickup={addressLines:[t.pickupAddressLines],vendorCode:t.vendorCode,locationCode:t.pickupLocationCode,extendedLocationCode:t.pickupExtendedLocationCode,cityName:t.pickupCityName,vendor:t.pickupVendor},this.postcodePickupRaw={name:t.pickupPostCode,type:e.LocationTypes.Postcode,latitude:t.pickupLatitude,longitude:t.pickupLongitude},this.searchService.startSearches()},a.prototype.getSearchQuery=function(){var t={};switch(this.locationType){case e.LocationTypes.Airport:t.airport={pickupCode:"",dropoffCode:""},t.airport.pickupCode=this.pickup_location.gateway,t.airport.dropoffCode=this.return_to_pickup?this.pickup_location.gateway:this.dropoff_location.gateway;break;case e.LocationTypes.City:t.depot={vendorCode:this.cityPickupDepot.vendorCode,pickupLocationCode:this.cityPickupDepot.locationCode,pickupExtendedLocationCode:this.cityPickupDepot.extendedLocationCode,dropOffLocationCode:this.cityDropoffDepot.locationCode,dropOffExtendedLocationCode:this.cityDropoffDepot.extendedLocationCode};break;case e.LocationTypes.Postcode:t.depot={vendorCode:this.postcodePickup.vendorCode,pickupLocationCode:this.postcodePickup.locationCode,pickupExtendedLocationCode:this.postcodePickup.extendedLocationCode,dropOffLocationCode:this.postcodeDropoff.locationCode,dropOffExtendedLocationCode:this.postcodeDropoff.extendedLocationCode}}return t.dropoffDateTime=this.helpers.formatGraphQLDateTime(this.dropoff_datetime),t.pickupDateTime=this.helpers.formatGraphQLDateTime(this.pickup_datetime),t.aircon=this.airCon,this.locationType===e.LocationTypes.Airport&&(t.vendor="-"===this.chosenVendor?null:this.chosenVendor),t.transmission=this.transmission||null,t.class=this.carClass||null,t.type=this.carType||null,t.estimatedDailyDistance=this.estimatedMileage||null,t.estimatedDailyDistanceUnits=this.estimatedMileage?e.ɵb.M:null,this.helpers.removeNulls(t)},a.prototype.getCarClasses=function(){return t.of(this._car_classes)},a.prototype.getLocationTypes=function(){return t.of(this._location_types)},a.prototype.filterResults=function(e,t){var r=this,i=this.helpers.clone(this.fullResults);i=i.filter((function(t){var i=r.getPrice(t);return i>=e.minPrice&&i<=e.maxPrice})),i=this.filterByTransmissionType(e.transmissions,i),i=this.filterByAirconType(e.airConditioning,i),i=this.filterByCarType(e.types,i),i=this.filterByCompany(e.companies,i),i=this.sortResults(t,i),this.results.next(i)},a.prototype.filterByCompany=function(e,t){var r=e.filter((function(e){return e.selected}));return r.length&&(t=t.filter((function(e){return r.find((function(t){return t.value.toString().toLowerCase()===e.identifiers.vendor.toLowerCase()}))}))),t},a.prototype.filterByCarType=function(e,t){var r=e.filter((function(e){return e.selected}));return r.length&&(t=t.filter((function(e){return r.find((function(t){return t.value.toString().toLowerCase()===e.displayRecord.vehicle.class.toLowerCase()}))}))),t},a.prototype.filterByTransmissionType=function(e,t){var r=e.find((function(e){return e.selected}));if(r&&"Y"!==r.value)try{t=t.filter((function(e){return e.identifiers.vehType[2].toLowerCase()===r.value.toString().toLowerCase()}))}catch(e){console.error("+++ Error filtering transmissions: "+e+" +++")}return t},a.prototype.filterByAirconType=function(e,t){var r=e.find((function(e){return e.selected}));if(r&&"A"!==r.value)try{t=t.filter((function(e){return e.identifiers.vehType[3].toLowerCase()===r.value.toString().toLowerCase()}))}catch(e){console.error("+++ Error filtering aircons: "+e+" +++")}return t},a.prototype.sortResults=function(e,t){var r=this,i=this.helpers.clone(t||this.results.value);switch(e){case 0:i=i.sort((function(e,t){return r.getPrice(e)-r.getPrice(t)}));break;case 1:i=i.sort((function(e,t){return r.getPrice(t)-r.getPrice(e)}));break;case 2:i=this.sortByPreferred(i);break;case 3:i=this.sortByBrand(i);break;case 4:i=this.sortBySize(i)}return this.results.next(i),i},a.prototype.sortExpensive=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){return t.getPrice(r)-t.getPrice(e)}));return this.results.next(r),r},a.prototype.sortCheapest=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){return t.getPrice(e)-t.getPrice(r)}));return this.results.next(r),r},a.prototype.sortBySize=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){var i,a;return i=t.carClassMap[e.displayRecord.vehicle.class.toLowerCase()],a=t.carClassMap[r.displayRecord.vehicle.class.toLowerCase()],i>=0&&a>=0?i-a:-1}));return this.results.next(r),r},a.prototype.sortByBrand=function(e){var t=this.helpers.clone(e||this.results.value).sort((function(e,t){var r=e.identifiers.vendor,i=t.identifiers.vendor;switch(r){case"ZE":r="HE";break;case"ZI":r="AV"}switch(i){case"ZE":i="HE";break;case"ZI":i="AV"}return r<i?-1:r>i?1:0}));return this.results.next(t),t},a.prototype.sortByPreferred=function(e){var t=this.helpers.clone(e||this.results.value).sort((function(e,t){var r=e.tmcPreferred||e.companyPreferred||e.officePreferred?1:0,i=t.tmcPreferred||t.companyPreferred||t.officePreferred?1:0;return r>i?-1:r<i?1:0}));return this.results.next(t),t},a.prototype.getPrice=function(e){try{return Number(e.displayRecord.charges[0].amount)}catch(e){}return 0},a.prototype.getMinPrice=function(e){var t=this;return e.reduce((function(e,r){var i=t.getPrice(r);return i<e&&(e=i),e}),Number.MAX_SAFE_INTEGER)},a.prototype.getMaxPrice=function(e){var t=this;return e.reduce((function(e,r){var i=t.getPrice(r);return i>e&&(e=i),e}),Number.MIN_SAFE_INTEGER)},a.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;r&&(this.chosenVendor=r.vendor,this.carClass=r.class,this.carType=r.type,this.transmission=r.transmission,this.airCon=r.aircon,this.estimatedMileage=r.estimatedDailyDistance,this.dropoff_datetime=l.default(r.dropoffDateTime),this.pickup_datetime=l.default(r.pickupDateTime),r.city?this.getParamsForCarbyCity(r.city):r.airport?this.getParamsForCarbyAirport(r.airport):r.depot&&this.updateSearchForCarbyPostCode(r,e.detail)),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},a.prototype.updateSearchForCarbyPostCode=function(t,r){this.locationType=e.LocationTypes.Postcode,this.chosenDistance=t.chosenDistance,this.postcodeDropoffRaw={name:r.dropOffLocation.postcode,type:e.LocationTypes.Postcode},this.postcodePickupRaw={name:r.pickUpLocation.postcode,type:e.LocationTypes.Postcode}},a.prototype.updateFromPreviousSearches=function(t){var r,i,a,n;console.log("PREPOPULATING CARHIRE FORM");var o=null===(r=t[ne.Flight])||void 0===r?void 0:r.searchQuery,s=null===(i=t[ne.Rail])||void 0===i?void 0:i.searchQuery,l=null===(a=t[ne.Rail])||void 0===a?void 0:a.searchQuery,u=null===(n=t[ne.InternationalRail])||void 0===n?void 0:n.searchQuery;if(o)try{var c=this.searchService.searches[ne.Flight].outBoundDate.toDate(),d=this.searchService.searches[ne.Flight].inboundDate.toDate();this.locationType=e.LocationTypes.Airport,this.pickup_datetime=this.searchService.searches[ne.Flight].outBoundDate,this.dropoff_datetime=this.searchService.searches[ne.Flight].inboundDate,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()},this.pickup_location=this.searchService.searches[ne.Flight].arriveLocation,this.dropoff_location=this.searchService.searches[ne.Flight].arriveLocation,this.pickup_country=this.searchService.searches[ne.Flight].arriveLocation.countryCode,this.dropoff_country=this.searchService.searches[ne.Flight].arriveLocation.countryCode}catch(e){console.error("Error trying to prepopulate carhire from flight item")}else if(s)try{c=this.searchService.searches[ne.Rail].outBoundDateTime.toDate(),d=this.searchService.searches[ne.Rail].inBoundDateTime.toDate();this.pickup_datetime=this.searchService.searches[ne.Rail].outBoundDateTime,this.dropoff_datetime=this.searchService.searches[ne.Rail].inBoundDateTime,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate carhire from rail item")}else if(u)try{c=this.searchService.searches[ne.InternationalRail].outBoundDateTime.toDate(),d=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime.toDate();this.pickup_datetime=this.searchService.searches[ne.InternationalRail].outBoundDateTime,this.dropoff_datetime=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate carhire from international rail item")}else if(l)try{c=this.searchService.searches[ne.Hotel].checkin_date.toDate(),d=this.searchService.searches[ne.Hotel].checkout_date.toDate();this.pickup_datetime=this.searchService.searches[ne.Hotel].checkin_date,this.dropoff_datetime=this.searchService.searches[ne.Hotel].checkout_date,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate carhire from hotel item")}},a.prototype._updatePickupDateTime=function(){if(this._pickup_date&&this._pickup_time){var e=this.helpers.ngDateToMoment(this._pickup_date,this._pickup_time);this.pickup_datetime=e.isValid()?e:null,this._isValid()}},a.prototype._updateDropoffDateTime=function(){if(this._dropoff_date&&this._dropoff_time){var e=this.helpers.ngDateToMoment(this._dropoff_date,this._dropoff_time);this.dropoff_datetime=e.isValid()?e:null,this._isValid()}},a.prototype._updateNgbPickupDateTime=function(){if(this._ngbPickupDate&&this._pickupTime){var e=this.helpers.ngDateToMoment(this._ngbPickupDate,this._pickupTime);this.pickup_datetime=e.isValid()?e:null,this._isValid()}},a.prototype._updateNgbDropoffDateTime=function(){if(this._ngbDropoffDate&&this._dropoffTime){var e=this.helpers.ngDateToMoment(this._ngbDropoffDate,this._dropoffTime);this.dropoff_datetime=e.isValid()?e:null,this._isValid()}},a.prototype.isOverNight=function(){var e=this.pickup_datetime.date();return this.dropoff_datetime.date()-e>=1},a.prototype.updateLowestPrice=function(e){return e.length?{amount:this.getMinPrice(e),currencyCode:e[0].displayRecord.charges[0].currencyCode}:null},a.prototype.getCarHireAvailabilityDetail=function(e,t){return t.value||t.next(!0),this.carHireAvailabilityDetailFetcher.fetchList({locationDetails:e}).pipe(r.take(1),r.map((function(e){return t.value&&t.next(!1),e})))},a.prototype.addCarHireToBasket=function(t,r){var i,a,n,o,s,l,u,c,d,h;return y(this,void 0,void 0,(function(){var p,m,f,v,y,g,S,C,A,T;return b(this,(function(b){switch(b.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return p=b.sent(),(m=null==p?void 0:p.subject.value)?(f=t.co2PerItem,v=t.co2PerPassenger,y=t.displayRecord,g=t.identifiers,S=t.sourceId,C=parseFloat(null!==(a=null===(i=null==y?void 0:y.charges[0])||void 0===i?void 0:i.amount)&&void 0!==a?a:"0"),A=this.getTermsAndCond(t,r),[4,this.basketService.addToBasket({adults:this.adults,basket:m.id,service:S.toString(),detail:{pickUpDatetime:y.pickup,dropOffDatetime:y.dropoff,pickUpLocation:{iata:this.locationType===e.LocationTypes.Airport?g.pickUpLocationCode:"",name:y.pickupLocation.name,address:y.pickupLocation.topLine+", "+y.pickupLocation.city,postcode:y.pickupLocation.postCode},dropOffLocation:{iata:this.locationType===e.LocationTypes.Airport?g.dropOffLocationCode:"",name:y.returnLocation.name,address:y.returnLocation.topLine+", "+y.returnLocation.city,postcode:y.returnLocation.postCode},car:{type:y.vehicle.type,manualTransmission:y.vehicle.transmission.includes(I.Manual)},fareInfo:{title:null===(n=null==t?void 0:t.fareInfo)||void 0===n?void 0:n.title,type:null===(o=null==t?void 0:t.fareInfo)||void 0===o?void 0:o.type,code:null===(s=null==t?void 0:t.fareInfo)||void 0===s?void 0:s.code,supplierCode:null===(l=null==t?void 0:t.fareInfo)||void 0===l?void 0:l.supplierCode},vendorName:y.vendor.name,identifiers:{pickUpLocation:g.pickUpLocation?g.pickUpLocation:"",pickUpLocationCode:g.pickUpLocationCode?g.pickUpLocationCode:"",pickUpExtendedLocationCode:g.pickUpExtendedLocationCode?g.pickUpExtendedLocationCode:"",pickUpLocationName:g.pickUpLocationName?g.pickUpLocationName:"",dropOffLocation:g.dropOffLocation?g.dropOffLocation:"",dropOffLocationCode:g.dropOffLocationCode?g.dropOffLocationCode:"",dropOffExtendedLocationCode:g.dropOffExtendedLocationCode?g.dropOffExtendedLocationCode:"",dropOffLocationName:g.dropOffLocationName?g.dropOffLocationName:"",vehType:g.vehType,vendor:g.vendor},termsAndCond:A},price:C,requiresReason:t.requiresReason,currency:y.charges[0].currencyCode,searchQuery:r,co2PerItem:f,co2PerPassenger:v,outboundDate:new Date(y.pickup).toISOString(),lowestPrice:(null===(u=this.cheapestPrice)||void 0===u?void 0:u.amount)!=C?null===(c=this.cheapestPrice)||void 0===c?void 0:c.amount:null,lowestPriceCurrency:(null===(d=this.cheapestPrice)||void 0===d?void 0:d.amount)!=C?null===(h=this.cheapestPrice)||void 0===h?void 0:h.currencyCode:null},p,this.searchService,this.travellers,t.requiresReason)]):[3,3];case 2:return(T=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,T];case 3:return[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},a.prototype.getTermsAndCond=function(e,t){return[{name:"Additional Driver",value:""},{name:"Age Requirements",value:""},{name:"Cross Border Policy",value:""},{name:"Damage Waiver",value:""},{name:"Debit Card Policy",value:""},{name:"One Way Drop Policy",value:""},{name:"Extended Protection",value:""},{name:"Excess Protection",value:""},{name:"Inclusive Policy",value:""},{name:"Mileage Policy",value:""},{name:"Miscellaneous Policy",value:""},{name:"Forms of Payment",value:""},{name:"Roadside Protection",value:""},{name:"Renter Requirements",value:""},{name:"Third Party Liability",value:""}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Car,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.airCon=e.aircon,this.carClass=e.class,this.transmission=e.transmission,this.chosenVendor=e.vendor,this.carType=e.type,this.return_to_pickup=e.airport.pickupCode==e.airport.dropoffCode,this.searchService.getAirportsList(e.airport.pickupCode).subscribe((function(r){t.pickup_location=r.find((function(t){return t.gateway==e.airport.pickupCode}))})),this.return_to_pickup||this.searchService.getAirportsList(e.airport.dropoffCode).subscribe((function(r){t.dropoff_location=r.find((function(t){return t.gateway==e.airport.dropoffCode}))})),[2]}))}))},a.prototype.checkForPreferred=function(){return!!this.results.value.find((function(e){return e.officePreferred||e.tmcPreferred||e.companyPreferred}))},a}(c);it.STORAGE_SESSION_PARAMS="carhire_params",it.STORAGE_SESSION_RESULTS="carhire_results";var at,nt=function(){this.numberHotelToPreload=Number.MAX_SAFE_INTEGER,this.numberOfHotelsToFetch=5,this.autoFetchHotelTimeout=50,this.autoLogoutTime=60,this.hotelAvalibilityTimeout=2e3,this.maxBasketNumber=5,this.searchTimeout=3e4,this.groupMax=0,this.ADMIN_USER_PANEL_STAGING="https://admin-staging.ctmlightning.co.uk/user",this.ADMIN_USER_PANEL="https://admin.ctmlightning.co.uk/user"},ot=function(e){},st={next:ot},lt=function(){function e(){this.events={}}return e.prototype.getEmmitter=function(e){return this.events[e]=this.events[e]||new t.Subject,this.events[e]},e.prototype.emit=function(e,t){(this.events[e]||st).next(t)},e}();(at=e.FlightDisplayTypes||(e.FlightDisplayTypes={}))[at.returns=1]="returns",at[at.dualSingles=2]="dualSingles";var ut,ct=Object.freeze({stops:{},totalStops:{},mustInclude:{},classes:{},airlines:{},travelPolicy:{},depatureAirport:{},depatureReturnAirport:{},arrivalAirport:{},arrivalReturnAirport:{},baggage:{},fareTypes:{},price:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},duration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},returnDuration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},departureTime:{min:0,max:24},arrivalTime:{min:0,max:24},returnDepartureTime:{min:0,max:24},returnArrivalTime:{min:0,max:24},flightNumber:""});(ut=e.FlightSearchType||(e.FlightSearchType={})).return="return",ut.oneWay="oneWay",ut.multiCity="multiCity";var dt=function(e){this.value=e};dt.MaxFlightClass=new dt("MaxFlightClass"),dt.SSO_no_password=new dt("SSO_no_password"),dt.HideFlightCabinClasses=new dt("hideFlightCabinClasses"),dt.AlternativeRailItineraryEnabled=new dt("alternativeRailItineraryEnabled"),dt.riskMinimumLevel=new dt("riskMinimumLevel"),dt.ENABLE_CHATBOT=new dt("enableChatbot"),dt.LocalCurrency=new dt("local_currency"),dt.HideRailClasses=new dt("hideRailClasses"),dt.AllowOneTravellerPerBasket=new dt("allowOneTravellerPerBasket"),dt.AllowSameTravellesrPerBasket=new dt("allowSameTravellersPerBasket"),dt.FlightDirectDefault=new dt("flightDirectDefault");var ht=function(e){this.value=e};ht.non=new ht("non"),ht.EVI=new ht("evi");var pt,mt=function(){function e(e){this.returnCounts=(e.journeys||[]).reduce((function(e,t){var r;return t.co2PerPassenger&&(e.outboundCounts.count+=1,e.outboundCounts.accum+=t.co2PerPassenger,e.outboundCounts.avg=e.outboundCounts.accum/e.outboundCounts.count,(null===(r=t.inboundFlights)||void 0===r?void 0:r.length)>0&&(e.inboundCounts.count+=1,e.inboundCounts.accum+=t.co2PerPassenger,e.inboundCounts.avg=e.inboundCounts.accum/e.inboundCounts.count)),e}),{outboundCounts:{count:0,accum:0,avg:0},inboundCounts:{count:0,accum:0,avg:0}}),this.multi=(e.multi||[]).map((function(e){return e.results.reduce((function(e,t){return t.co2PerPassenger&&(e.count=e.count+1,e.accum=e.accum+t.co2PerPassenger,e.avg=e.accum/e.count),e}),{count:0,accum:0,avg:0})}))}return e.prototype.makeReturnOutbound=function(e){return this._makeGreenerChoice(this.returnCounts.outboundCounts,e.co2PerPassenger)},e.prototype.makeReturnInbound=function(e){return this._makeGreenerChoice(this.returnCounts.outboundCounts,e.co2PerPassenger)},e.prototype.makeMulti=function(e,t){return this._makeGreenerChoice(this.multi[e],t)},e.prototype._makeGreenerChoice=function(e,t){return{greenerChoice:t&&t<e.avg,greenerChoicePercentage:t&&t<e.avg?t/e.avg:0}},e.prototype._convertToKilograms=function(e){return"KG"!==e.unit?e.amount/2.2:e.amount},e}(),ft={BRU:"ZYR",CRL:"ZYR",ZYR:"ZYR",DLP:"XED",XED:"XED",PAR:"XPG",CDG:"XPG",XPG:"XPG",ORY:"XPG",XEX:"XPG",BVA:"XPG",XGB:"XPG",JDP:"XPG",SPU:"XPG",LBG:"XPG",LIL:"XDB",XDB:"XDB",XFA:"XDB",QDH:"QDH",XQE:"XQE",LON:"QQS",STN:"QQS",LCY:"QQS",LGW:"QQS",LHR:"QQS",LTN:"QQS",SEN:"QQS",BQH:"QQS",QQS:"QQS",QQW:"QQS",RTM:"QRH",QRH:"QRH"},vt={ABZ:"ABD",BHX:"BHM",BLK:"BPM",BOH:"BHM",BRS:"BRI",CWL:"CDF",ORK:"COK",CVT:"COV",DSA:"DON",EMA:"BHM",EDI:"EDB",EXT:"EXC",GLA:"GLC",HUY:"HUL",INV:"INV",LBA:"LDS",LPL:"LIV",LON:"EUS",LCY:"EUS",KIR:"DUB",LDY:"DUB",LGW:"EUS",LHR:"EUS",LTN:"EUS",STN:"SVG",MAN:"MAN",NCL:"NCL",NQY:"NQY",NWI:"NRW",PLH:"PLY",PIK:"GLC",SOU:"SOU",SEN:"SOC",MME:"MBR"};(pt=e.ErmTravellerType||(e.ErmTravellerType={})).Joiner="JOINER",pt.Leaver="LEAVER",pt.None="none";var yt,bt;(yt=e.TimeWindow||(e.TimeWindow={})).Anytime="Anytime",yt.Depart="Depart By",yt.Arrive="Arrive By",(bt=e.FlightSortTypes||(e.FlightSortTypes={})).Cheapest="Cheapest",bt.MostExpensive="Most Expensive",bt.Fastest="Fastest",bt.Preferred="Preferred",bt.LowestEmissions="Lowest Emissions",bt.DepartureTime="Departure Time",bt.ArrivalTime="Arrival Time",bt.Quickest="Quickest",bt.MostDirect="Most Direct",bt.GreenerChoice="Greener Choice";var gt,St=function(i){function a(r,n,o,s,u,c,d,h){var p,m,f=i.call(this,u,n,c,o)||this;f.flightfetcher=r,f.basketService=s,f.applyFlightRules=d,f.modalService=h,f.type=ne.Flight,f.avaliableClasses=new t.BehaviorSubject([]),f.timeCriteriaOptions=new t.BehaviorSubject([]),f.flightOperators=new t.BehaviorSubject([]),f.directDefaultValue=!1,f._negotiated=!1,f._sortArray=[{display:"Cheapest First",value:e.FlightSortTypes.Cheapest},{display:"Most Expensive First",value:e.FlightSortTypes.MostExpensive},{display:"Fastest First",value:e.FlightSortTypes.Fastest},{display:"Preferred Fares First",value:e.FlightSortTypes.Preferred},{display:"Lowest Co2 Emissions First",value:e.FlightSortTypes.LowestEmissions}],f._sortItinaryRoutines=((p={})[e.FlightSortTypes.Cheapest]=function(e,t){return e.total.price-t.total.price},p[e.FlightSortTypes.MostExpensive]=function(e,t){return t.total.price-e.total.price},p[e.FlightSortTypes.Fastest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},p[e.FlightSortTypes.Preferred]=function(e,t){return e.preferred-t.preferred},p[e.FlightSortTypes.LowestEmissions]=function(e,t){return e.co2PerItem-t.co2PerItem},p[e.FlightSortTypes.DepartureTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeDeparting),i=l.default(t.outboundFlights[0].dateTimeDeparting);return r.isBefore(i)?-1:r.isSame(i)?0:1},p[e.FlightSortTypes.ArrivalTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeArriving),i=l.default(t.outboundFlights[0].dateTimeArriving);return r.isBefore(i)?-1:r.isSame(i)?0:1},p[e.FlightSortTypes.Quickest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},p[e.FlightSortTypes.MostDirect]=function(e,t){return e.outboundFlights.length+(e.outboundFlights?e.outboundFlights.length:0)-(t.outboundFlights.length+(t.outboundFlights?t.outboundFlights.length:0))},p[e.FlightSortTypes.GreenerChoice]=function(e,t){return e.greenerChoice!==t.greenerChoice?e.greenerChoice?-1:1:e.greenerChoice?e.greenerChoicePercentage-t.greenerChoicePercentage:0},p),f._sortGroupedRoutines=((m={})[e.FlightSortTypes.Cheapest]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:e.minPrice-t.minPrice},m[e.FlightSortTypes.MostExpensive]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:t.minPrice-e.maxPrice},m[e.FlightSortTypes.Fastest]=function(t,r){return t.direction!==r.direction?t.direction-r.direction:t.direction===e.FlightDirectionEnum.Outbound?t.outboundTotalDuration-r.outboundTotalDuration:t.inboundTotalDuration-r.inboundTotalDuration},m[e.FlightSortTypes.Preferred]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:(t.preferred?1:0)-(e.preferred?1:0)},m[e.FlightSortTypes.GreenerChoice]=function(){return 0},m[e.FlightSortTypes.LowestEmissions]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:e.co2PerItem-t.co2PerItem},m[e.FlightSortTypes.DepartureTime]=function(e,t){if(e.direction!==t.direction)return e.direction-t.direction;var r=l.default(e.departDateTime),i=l.default(t.departDateTime);return r.isBefore(i)?-1:r.isSame(i)?0:1},m[e.FlightSortTypes.ArrivalTime]=function(e,t){if(e.direction!==t.direction)return e.direction-t.direction;var r=l.default(e.arrivalDateTime),i=l.default(t.arrivalDateTime);return r.isBefore(i)?-1:r.isSame(i)?0:1},m[e.FlightSortTypes.Quickest]=function(t,r){return t.direction!==r.direction?t.direction-r.direction:t.direction===e.FlightDirectionEnum.Outbound?t.outboundTotalDuration-r.outboundTotalDuration:(t.inboundTotalDuration?t.inboundTotalDuration:0)-(r.inboundTotalDuration?r.inboundTotalDuration:0)},m[e.FlightSortTypes.MostDirect]=function(t,r){return t.direction!==r.direction?t.direction-r.direction:t.direction===e.FlightDirectionEnum.Outbound?t.outlegs.length-r.outlegs.length:(t.inlegs||[]).length-(r.inlegs||[]).length},m),f._fareTypeArray=[{value:U.Flexible,display:"Flexible"},{value:U.Leisure,display:"Leisure"},{value:U.Lowest,display:"Lowest"},{value:U.Negotiated,display:"Negotiated"},{value:U.NonNegotiated,display:"Non-Negotiated"},{value:U.RequestFareRules,display:"Request Fare Rules"},{value:U.SelectAndPro,display:"Select & Pro"}],f.minimumOutBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},f.minimumInBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},f._grouped=null,f.travellers=null,f.resultsSessionName=a.STORAGE_SESSION_RESULTS,f.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,f._showHotelForm=!1,f._fetchingRules=!1,f._hotelSearchRequested=!1,f.filters=new t.BehaviorSubject(ct),f.duralSingleFilter=new t.BehaviorSubject(ct),f.choosenDisplayType=new t.BehaviorSubject(e.FlightDisplayTypes.returns),f.eurostarFromFlightSearchPerformed=!1,f.railFromFlightSearchPerformed=!1,f._cheapestPriceObject={dualOutbound:{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"},dualInbound:{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"},returns:{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"}},f._multiDestination=[];var v=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};f.userService.fullUserDetails.userConfigs.subscribe((function(e){var t;console.log(e),e&&(f.directDefaultValue=null===(t=f.userService.getUserFavoriteObject(dt.FlightDirectDefault))||void 0===t?void 0:t.value)}));var y=c.makeFlightQuery(v.tempParams);return f.updateTempParams(y),f._originalUserSearch=v.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){f.travellers=e;var t=f.helpers.selectedTravellers(e,ne.Flight);f.tempParams.adults=t.adults.length,f.tempParams.children=t.children.length,f.updateTravellers(),f._isValid()})),o.changeUser.subscribe((function(t){f.timeCriteriaOptions.next([e.TimeWindow.Anytime,e.TimeWindow.Arrive,e.TimeWindow.Depart]),f.flightOperators.next([{code:"BA",name:"British Airways"}]),f.updateAvaliableClasses()})),f.updateTravellers(),f.negotiated=f.tempParams.fareType===U.Negotiated,f}return m(a,i),Object.defineProperty(a.prototype,"fetchingRules",{get:function(){return this._fetchingRules},set:function(e){this._fetchingRules=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cheapestPriceObject",{get:function(){return this._cheapestPriceObject},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(96).fill(0).map((function(e,t){return{value:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0"),display:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"preferredCarriers",{get:function(){return this.tempParams.preferredCarriers},set:function(e){this.tempParams.preferredCarriers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator1",{get:function(){return this.tempParams.preferredCarriers[0]},set:function(e){this.tempParams.preferredCarriers[0]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator2",{get:function(){return this.tempParams.preferredCarriers[1]},set:function(e){this.tempParams.preferredCarriers[1]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator3",{get:function(){return this.tempParams.preferredCarriers[2]},set:function(e){this.tempParams.preferredCarriers[2]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator4",{get:function(){return this.tempParams.preferredCarriers[3]},set:function(e){this.tempParams.preferredCarriers[3]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minDate",{get:function(){return this._minDate=this._minDate||this.helpers.momentToNgDate(l.default()),this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departLocation",{get:function(){return this.tempParams.departLocation},set:function(e){this.tempParams.departLocation=e,"string"==typeof e?this._originAirport="":e&&e.gateway?this._originAirport=e.gateway:this._originAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryOriginAiport",{get:function(){return this._originAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryDestinationAiport",{get:function(){return this._destinationAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departDate",{get:function(){return this._outDate},set:function(e){this._outDate=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departTime",{get:function(){return this._outTime},set:function(e){this._outTime=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outBoundDate",{get:function(){return this.tempParams.outBoundDate},set:function(e){this.tempParams.outBoundDate=e.isValid()?e:null,this.minimumInBoundDate={year:e.year(),month:e.month()+1,day:e.date()},this.tempParams.outBoundDate&&this.tempParams.inboundDate&&this.tempParams.outBoundDate.isAfter(this.tempParams.inboundDate)&&(this.inboundDate=l.default(this.tempParams.outBoundDate).add(1,"day")),this._outDate=this.helpers.momentToNgDate(e),this._outTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnDate",{get:function(){return this._inDate},set:function(e){this._inDate=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveTime",{get:function(){return this._inTime},set:function(e){this._inTime=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inboundDate",{get:function(){return this.tempParams.inboundDate},set:function(e){this.tempParams.inboundDate=e.isValid()?e:null,this._inDate=this.helpers.momentToNgDate(e),this._inTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveLocation",{get:function(){return this.tempParams.arriveLocation},set:function(e){this.tempParams.arriveLocation=e,"string"==typeof e?this._destinationAirport="":e&&e.gateway?this._destinationAirport=e.gateway:this._destinationAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cabinClass",{get:function(){return this.tempParams.cabinClass},set:function(e){this.tempParams.cabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnCabinClass",{get:function(){return this.tempParams.returnCabinClass},set:function(e){this.tempParams.returnCabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isReturn",{get:function(){return this.tempParams.chosenSearchType===e.FlightSearchType.return},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outTimeCriteria",{get:function(){return this.tempParams.outTimeCriteria},set:function(e){this.tempParams.outTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inTimeCriteria",{get:function(){return this.tempParams.inTimeCriteria},set:function(e){this.tempParams.inTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxConnections",{get:function(){return this.tempParams.maxConnections},set:function(e){this.tempParams.maxConnections=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"multiDestination",{get:function(){return this.tempParams.multiDestination},set:function(e){this.tempParams.multiDestination=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"showHotelForm",{get:function(){return this._showHotelForm},set:function(e){this._showHotelForm=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hotelSearchRequested",{get:function(){return this._hotelSearchRequested},set:function(e){this._hotelSearchRequested=e},enumerable:!1,configurable:!0}),a.prototype.setMultiDestinationQuery=function(e){var t=this;return this.helpers.clone(e).reduce((function(e,r){var i={};return i.orig=r.orig.gateway,i.dest=r.dest.gateway,i.date=t.helpers.formatIsoDate(r.date),e.push(i),e}),[])},Object.defineProperty(a.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareTypesValues",{get:function(){return this._fareTypeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareType",{get:function(){return this.tempParams.fareType},set:function(e){this.tempParams.fareType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"negotiated",{get:function(){return this._negotiated},set:function(e){this._negotiated=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"includeNearbyAirports",{get:function(){return this.tempParams.includeNearbyAirports},set:function(e){this.tempParams.includeNearbyAirports=e},enumerable:!1,configurable:!0}),a.prototype.processResults=function(t){var r=this;if(!t)return this._grouped=[],this.multi=[],this.resultQuery=null,[];this.greenerChoice=new mt(t),this._grouped=t.grouped||[],this._ruleActionSummary=Object.assign({},{journeyWhenSelected:{},dualSingleWhenSelected:{},whenSelectedAlone:{}},t.ruleActionSummary||{}),this.resultQuery=this.getSearchQuery(),this.multi=t.multi,this.setFlightDisplayType(e.FlightDisplayTypes.returns),this.currentFilters=this.helpers.createFlightFilters(t.journeys,ct),this.filters.next(this.currentFilters);var i=t.multi.reduce((function(e,t){return e[0===t.order?"outbound":"inbound"]=t.results.reduce((function(e,i){return e[i.uid]=Object.assign({selected:!1,canSelect:!0},r.greenerChoice.makeMulti(t.order,i.co2PerPassenger),i),e}),e[0===t.order?"outbound":"inbound"]),e}),{outbound:{},inbound:{}}),a=this.helpers.createFlightFilters(Object.values(i.inbound),ct);if(this.duralSingleFilter.next(this.helpers.createFlightFilters(Object.values(i.outbound),Object.assign(Object.assign({},ct),{price:a.price,arrivalReturnAirport:a.arrivalAirport,depatureReturnAirport:a.depatureAirport,returnArrivalTime:a.arrivalTime,returnDuration:a.duration,returnDepartureTime:a.departureTime}))),t&&this.searchService.isFlightsGrouped()){var n=(t.journeys||[]).reduce((function(e,t){return e[t.uid]=Object.assign({selected:!1,canSelect:!0},t),e}),{}),o=(t.grouped||[]).reduce(this.makeGroupedObjects(n),[]),s=(t.grouped||[]).reduce(this.makeGroupedObjects(i.outbound),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleOutbound,t})),l=(t.grouped||[]).reduce(this.makeGroupedObjects(i.inbound,!0),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleInbound,t}));this._cheapestPriceObject.returns=o.reduce((function(e,t){var r=t.minPrice;return e.amount>r&&(e.amount=r,Object.values(t.classes).filter((function(e){return null!==e})).length&&(e.currencyCode=Object.values(t.classes).filter((function(e){return null!==e}))[0].currency)),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"}),this._cheapestPriceObject.dualOutbound=s.reduce((function(e,t){var r=t.minPrice;return e.amount>r&&(e.amount=r,Object.values(t.classes).filter((function(e){return null!==e})).length&&(e.currencyCode=Object.values(t.classes).filter((function(e){return null!==e}))[0].currency)),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"}),this._cheapestPriceObject.dualInbound=l.reduce((function(e,t){var r=t.minPrice;return e.amount>r&&(e.amount=r,Object.values(t.classes).filter((function(e){return null!==e})).length&&(e.currencyCode=Object.values(t.classes).filter((function(e){return null!==e}))[0].currency)),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"});var u=C(o,s,l);return console.log("Processed Grouped data",u),u}return t?[t]:[]},a.prototype.makeGroupedObjects=function(t,r){var i=this;return void 0===r&&(r=!1),function(a,n){var o,s=n.boundIndicator===e.FlightDirectionEnum.Outbound,l={type:"FlightGroupedQuoteResult",direction:n.boundIndicator,classes:(o={},o[e.OBTFlightCabinClass.Business]=null,o[e.OBTFlightCabinClass.BusinessBranded]=null,o[e.OBTFlightCabinClass.EconomyFlexi]=null,o[e.OBTFlightCabinClass.EconomyFlexiBranded]=null,o[e.OBTFlightCabinClass.EconomyNoBags]=null,o[e.OBTFlightCabinClass.EconomyNoBagsBranded]=null,o[e.OBTFlightCabinClass.EconomyRestricted]=null,o[e.OBTFlightCabinClass.EconomyRestrictedBranded]=null,o[e.OBTFlightCabinClass.First]=null,o[e.OBTFlightCabinClass.FirstBranded]=null,o[e.OBTFlightCabinClass.PremiumEconomy]=null,o[e.OBTFlightCabinClass.PremiumEconomyBranded]=null,o),originAirport:"",originAirportName:"",destinationAirport:"",destinationAirportName:"",departDateTime:"",arrivalDateTime:"",outboundTotalDuration:0,inboundTotalDuration:0,outlegs:null,inlegs:null,outlegsCount:0,inlegsCount:0,dataSource:"",preferred:!1,companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",outboundFlightNumber:"",operator:"",operatorFull:"",inboundFlightNumber:"",isReturn:!1,minPrice:Number.MAX_SAFE_INTEGER,maxPrice:0,co2PerItem:0,co2PerPassenger:0,gid:n.referenceID,greenerChoice:!1,greenerChoicePercentage:0},u=n.flights;return Object.keys(u).filter((function(e){return"_"!==e[0]})).forEach((function(e){u[e].length&&u[e].forEach((function(a){var n,o,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k=t[a];if(k){s||r?(i.createGroupedItem(l,k.source,k.outboundFlights,k.outboundTotalDuration,k.inboundFlights,k.inboundTotalDuration,k.co2PerItem,k.co2PerPassenger),Object.assign(l,i.greenerChoice.makeReturnOutbound(k))):(i.createGroupedItem(l,k.source,k.inboundFlights,k.inboundTotalDuration,k.outboundFlights,k.outboundTotalDuration,k.co2PerItem,k.co2PerPassenger),Object.assign(l,i.greenerChoice.makeReturnInbound(k)));var _=i.helpers.FlightCabinClassToBrandedOBTFlightCabinClass(e,!!k.baseFareId&&k.baseFareId!==k.uid),R=Math.floor(k.total.price),I=Math.ceil(k.total.price);l.minPrice=l.minPrice<R?l.minPrice:R,l.maxPrice=l.maxPrice>I?l.maxPrice:I,l.companyPreferred=(null===(n=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===n?void 0:n.companyPreferred)||(null===(o=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===o?void 0:o.companyPreferred)||!1,l.companyPreferredMessage=(null===(u=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===u?void 0:u.companyPreferredMessage)||(null===(c=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===c?void 0:c.companyPreferredMessage)||"",l.officePreferred=(null===(d=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===d?void 0:d.officePreferred)||(null===(h=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===h?void 0:h.officePreferred)||!1,l.officePreferredMessage=(null===(p=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===p?void 0:p.officePreferredMessage)||(null===(m=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===m?void 0:m.officePreferredMessage)||"",l.tmcPreferred=(null===(f=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===f?void 0:f.tmcPreferred)||(null===(v=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===v?void 0:v.tmcPreferred)||!1,l.tmcPreferredMessage=(null===(y=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===y?void 0:y.tmcPreferredMessage)||(null===(b=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===b?void 0:b.tmcPreferredMessage)||"",l.preferred=(null===(g=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===g?void 0:g.companyPreferred)||(null===(S=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===S?void 0:S.companyPreferred)||(null===(C=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===C?void 0:C.officePreferred)||(null===(A=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===A?void 0:A.officePreferred)||(null===(T=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===T?void 0:T.tmcPreferred)||(null===(D=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===D?void 0:D.tmcPreferred),(null===(F=null===(P=l.classes[_])||void 0===P?void 0:P.flights)||void 0===F?void 0:F.length)?(l.classes[_].flights.push(k),l.classes[_].minprice=Math.min(l.classes[_].minprice,R),l.classes[_].maxprice=Math.max(l.classes[_].maxprice,I)):l.classes[_]={flights:[k],minprice:R,maxprice:I,currency:k.total.currency}}}))})),l&&Object.values(l.classes).find((function(e){var t;return(null===(t=null==e?void 0:e.flights)||void 0===t?void 0:t.length)>0}))&&a.push(l),a.filter((function(e){return!!e}))}},a.prototype.createGroupedItem=function(e,t,r,i,a,n,o,s){if((null==r?void 0:r.length)&&!e.departDateTime){var l=r[0],u=r[r.length-1];e.originAirport=l.originAirport,e.originAirportName=l.originAirportName,e.destinationAirport=u.destinationAirport,e.destinationAirportName=u.destinationAirportName,e.departDateTime=l.dateTimeDeparting,e.arrivalDateTime=u.dateTimeArriving,e.outboundTotalDuration=i,e.dataSource=t,e.operator=l.marketingCarrier,e.operatorFull=l.marketingCarrierName,e.outlegsCount=r.length,e.outlegs=r,e.outboundFlightNumber=this.helpers.joinFromAttribute("-","marketingFlightNumber",r),e.isReturn=!1,e.co2PerItem=o,e.co2PerPassenger=s}(null==a?void 0:a.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=a.length,e.inlegs=a,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",a),e.isReturn=!0)},a.prototype.makeSessionResults=function(e){return{results:e,grouped:this._grouped,query:this.resultQuery}},a.prototype.getMaxFlightPriceForBrand=function(e){var t=0;return e.forEach((function(e){var r;t<(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.getMinFlightPriceForBrand=function(e){var t=Number.MAX_SAFE_INTEGER;return e.forEach((function(e){var r;t>(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.resetQuery=function(e){void 0===e&&(e=!0),this.updateTempParams(this.searchService.makeFlightQuery()),e&&this._isValid()},a.prototype.resetParams=function(){this.reset(),this.resetQuery()},a.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[],this.tempParams.chosenSearchType===e.FlightSearchType.multiCity?this.multiCityValidation():(this._originAirport||this.validationMessages.push("Please add in a departure location"),this._destinationAirport||this.validationMessages.push("Please add in an arrival destination"),this.tempParams.outBoundDate.isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),this._originAirport&&this._destinationAirport&&this._destinationAirport===this._originAirport&&this.validationMessages.push("Origin and destination airport cannot be the same"),this.isReturn&&this.tempParams.outBoundDate.isSameOrAfter(this.tempParams.inTimeCriteria)&&this.validationMessages.push("Return date must be after the departure date")),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},a.prototype.multiCityValidation=function(){var e=!1,t=!1,r=!1;this.tempParams.multiDestination.map((function(i,a){i.orig||(e=!0,a<2&&(t=!0)),i.orig===i.dest&&(r=!0)})),l.default(this.tempParams.multiDestination[0].date).isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),t&&this.validationMessages.push("Please select landing airport(s)"),e&&this.validationMessages.push("Please select take off airport(s)"),r&&this.validationMessages.push("Take off and landing location(s) cannot be the same")},a.prototype.startSearch=function(){if(this.results.next([]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.flightfetcher.fetchList(e))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.Flight,searchArgs:e,travelDate:this.outBoundDate.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.startRecentSearch=function(r){var i,a,n=this,o=r.searchArgs;if(o.outboundDate){var s=o.outboundDepartureTimeWindow?o.outboundDepartureTimeWindow:o.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(o.outboundDate,s)}if(o.returnDate){var u=o.returnDepartureTimeWindow?o.returnDepartureTimeWindow:o.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(o.returnDate,u)}this.fareType=o.fareType,this.maxConnections=o.maxConnections,o.outboundCabinClass&&(this.cabinClass=o.outboundCabinClass[0]),o.returnCabinClass&&(this.returnCabinClass=o.returnCabinClass[0]),this.includeNearbyAirports=!!o.includeNearbyAirports,this.chosenSearchType=(null===(i=null==o?void 0:o.multiDestination)||void 0===i?void 0:i.length)?e.FlightSearchType.multiCity:o.returnTrip?e.FlightSearchType.return:e.FlightSearchType.oneWay,r.searchArgs.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:r.searchArgs.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,r.searchArgs.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:r.searchArgs.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,(null===(a=null==o?void 0:o.multiDestination)||void 0===a?void 0:a.length)?(this.outBoundDate=l.default(o.multiDestination[0].date),this.updateMultiDestination(o),this.departLocation=this.multiDestination[0].orig,this.arriveLocation=this.multiDestination[0].dest,this.searchService.simultaneousSearchesCheck(!0).then((function(e){n.searchService.startSearches()}))):t.combineLatest([this.searchService.getAirportByCode(r.searchArgs.originAirport),this.searchService.getAirportByCode(r.searchArgs.destinationAirport)]).subscribe((function(e){var t,i,a,o,s,l,u,c,d,h,p,m,f=S(e,2),v=f[0],y=f[1];if(v&&y){if(n.departLocation={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:n.searchService.processTerminals(v.iataMatch.terminals),country:null===(i=null===(t=v.iataMatch)||void 0===t?void 0:t.locationDetails)||void 0===i?void 0:i.country,postcode:null===(o=null===(a=v.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===o?void 0:o.postcode,countryCode:null===(l=null===(s=v.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.countryCode},n.arriveLocation={destination:y.iataMatch.name,gateway:y.iataMatch.iata,terminals:n.searchService.processTerminals(y.iataMatch.terminals),country:null===(c=null===(u=y.iataMatch)||void 0===u?void 0:u.locationDetails)||void 0===c?void 0:c.country,postcode:null===(h=null===(d=y.iataMatch)||void 0===d?void 0:d.locationDetails)||void 0===h?void 0:h.postcode,countryCode:null===(m=null===(p=y.iataMatch)||void 0===p?void 0:p.locationDetails)||void 0===m?void 0:m.countryCode},r.searchArgs.preferredCarriers){var b=[];r.searchArgs.preferredCarriers.map((function(e){n.searchService.getAirlinesList(e).subscribe((function(t){t.map((function(t){t.code===e&&b.push(t)})),n.preferredCarriers=b,n.searchService.startSearches()}))}))}n.searchService.simultaneousSearchesCheck(!0).then((function(e){n.searchService.startSearches()}))}})),this.searchService.startSearches()},a.prototype.updateMultiDestination=function(e){return y(this,void 0,void 0,(function(){var t,r=this;return b(this,(function(i){switch(i.label){case 0:return[4,Promise.all(e.multiDestination.map((function(e){return y(r,void 0,void 0,(function(){var t,r,i;return b(this,(function(a){switch(a.label){case 0:return r=t={date:void 0,dest:void 0,orig:void 0},[4,this.searchService.getAirportsList(e.orig).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.orig}))}))];case 1:return r.orig=a.sent(),i=t,[4,this.searchService.getAirportsList(e.dest).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.dest}))}))];case 2:return i.dest=a.sent(),e.date&&(t.date=l.default(e.date)),[2,t]}}))}))})))];case 1:return t=i.sent(),this.multiDestination=t,[2]}}))}))},a.prototype.makeDepartureTimeWindow=function(t,r,i){return r===e.TimeWindow.Depart?i?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4):null},a.prototype.makeArrivalTimeWindow=function(t,r,i){return r!==e.TimeWindow.Arrive?null:i?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4)},a.prototype.convertRecentSearchDateTime=function(e,t){if(t){var r=t.split("-");return l.default(e).add(l.default.duration(this.helpers.hhmmToTime(r[0]))).clone().add(2,"hour")}return l.default(e)},a.prototype.getSearchQuery=function(){var t=this.tempParams.chosenSearchType===e.FlightSearchType.multiCity;this._multiDestination=t?this.setMultiDestinationQuery(this.tempParams.multiDestination):null,this._multiDestination=this.tempParams.chosenSearchType===e.FlightSearchType.multiCity?this.setMultiDestinationQuery(this.tempParams.multiDestination):[];var r=this.searchService.isFlightsGrouped();return this.helpers.removeNulls(Object.assign({},t?{multiDestination:this._multiDestination}:{originAirport:this._originAirport,destinationAirport:this._destinationAirport,joinerOrLeaver:this.isErmTraveller(),outboundDate:this.helpers.formatIsoDate(this.tempParams.outBoundDate),outboundDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria,r),outboundArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria,r)},{passengers:this._passengers,returnTrip:this.isReturn,outboundCabinClass:this.tempParams.cabinClass?[this.tempParams.cabinClass]:null,requireFreeBag:null,maxConnections:this.tempParams.maxConnections,includeNearbyAirports:this.tempParams.includeNearbyAirports,preferredCarriers:this.tempParams.preferredCarriers.map((function(e){return(null==e?void 0:e.code)?e.code:null})),fareType:this.tempParams.fareType},this.isReturn?{returnDate:this.helpers.formatIsoDate(this.tempParams.inboundDate),returnDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria,r),returnArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria,r),returnCabinClass:this.tempParams.returnCabinClass?[this.tempParams.returnCabinClass]:null}:{}))},a.prototype.isErmTraveller=function(){if(this.searchService.ermTravellerType&&this.searchService.ermTravellerType!==e.ErmTravellerType.None)return this.searchService.ermTravellerType},a.prototype.updateTravellers=function(){for(var e=[],t=0;t<this.tempParams.adults;t+=1)e.push({type:x.Adult});for(t=0;t<this.tempParams.children;t+=1)e.push({type:x.Child});this._passengers=e,this._isValid()},a.prototype.updateAvaliableClasses=function(){var e=this.userService.getUserFavoriteObject(dt.HideFlightCabinClasses)||{any:!1,business:!1,economy:!1,first:!1,premiumEconomy:!1},t=[];e.any||t.push({name:"Any",type:H.Any}),e.economy||t.push({name:"Economy",type:H.Economy}),e.premiumEconomy||t.push({name:"Premium",type:H.PremiumEconomy}),e.business||t.push({name:"Business",type:H.Business}),e.first||t.push({name:"First",type:H.First}),this.cabinClass=this.getUpdatedCabinClass(this.cabinClass,e,t),this.returnCabinClass=this.getUpdatedCabinClass(this.returnCabinClass,e,t),this.avaliableClasses.next(t)},a.prototype.getUpdatedCabinClass=function(e,t,r){switch(e){case H.Any:return t.any?r[0].type:e;case H.Business:return t.business?r[0].type:e;case H.Economy:return t.economy?r[0].type:e;case H.First:return t.first?r[0].type:e;case H.PremiumEconomy:return t.premiumEconomy?r[0].type:e}return e},a.prototype.updateFromPreviousSearches=function(e){},a.prototype.updateSearchFromExpiredBasketItem=function(r){var i=this,a=r.searchQuery;if(a.outboundDate){var n=a.outboundDepartureTimeWindow?a.outboundDepartureTimeWindow:a.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(a.outboundDate,n)}if(a.returnDate){var o=a.returnDepartureTimeWindow?a.returnDepartureTimeWindow:a.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(a.returnDate,o)}this.fareType=a.fareType,this.maxConnections=a.maxConnections,a.outboundCabinClass&&(this.cabinClass=a.outboundCabinClass[0]),a.returnCabinClass&&(this.returnCabinClass=a.returnCabinClass[0]),this.includeNearbyAirports=!!a.includeNearbyAirports,this.chosenSearchType=a.returnTrip?e.FlightSearchType.return:e.FlightSearchType.oneWay,a.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:a.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,a.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:a.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,t.combineLatest([this.searchService.getAirportByCode(a.originAirport),this.searchService.getAirportByCode(a.destinationAirport)]).subscribe((function(e){var t,r,n,o,s,l,u,c,d,h,p,m,f=S(e,2),v=f[0],y=f[1];if(v&&y&&(i.departLocation={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:i.searchService.processTerminals(v.iataMatch.terminals),country:null===(r=null===(t=v.iataMatch)||void 0===t?void 0:t.locationDetails)||void 0===r?void 0:r.country,postcode:null===(o=null===(n=v.iataMatch)||void 0===n?void 0:n.locationDetails)||void 0===o?void 0:o.postcode,countryCode:null===(l=null===(s=v.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.countryCode},i.arriveLocation={destination:y.iataMatch.name,gateway:y.iataMatch.iata,terminals:i.searchService.processTerminals(y.iataMatch.terminals),country:null===(c=null===(u=y.iataMatch)||void 0===u?void 0:u.locationDetails)||void 0===c?void 0:c.country,postcode:null===(h=null===(d=y.iataMatch)||void 0===d?void 0:d.locationDetails)||void 0===h?void 0:h.postcode,countryCode:null===(m=null===(p=y.iataMatch)||void 0===p?void 0:p.locationDetails)||void 0===m?void 0:m.countryCode},a.preferredCarriers)){var b=a.preferredCarriers,g=[];b.map((function(e){i.searchService.getAirlinesList(e).subscribe((function(t){t.map((function(t){t.code===e&&g.push(t)})),i.preferredCarriers=g}))}))}})),r.users&&r.users.forEach((function(e){i.searchService.addTraveller(e)}))},a.prototype.getTotalBaggage=function(e){var t=0,r=JSON.parse(e.additional);return r&&r.outboundFlights?r.outboundFlights.forEach((function(e){e.baggage.forEach((function(e){e.allowance&&e.allowance>t&&(t=e.allowance)}))})):r&&r.baggageAllowance&&r.baggageAllowance.forEach((function(e){e.baggage.qty&&Number(e.baggage.qty)>t&&(t=Number(e.baggage.qty))})),t},a.prototype.isGroupedFlights=function(e){var t;return"FlightGroupedQuoteResult"===(null===(t=e[0])||void 0===t?void 0:t.type)},a.prototype.applyFilters=function(t,r){var i,a,n,o=this;this.currentFilters=t,this.currentSort=r,0===this.fullResults.length&&this.results.next([]);var s=this.selectedGroupFlight?(null===(i=this.selectedGroupFlight.inboundFlights)||void 0===i||i.length,function(t,r){return function(i){return r===e.FlightDirectionEnum.DualSingleInbound||t.includes(i.uid)}}):function(e){return function(e){return!0}},u=function(e,t){var r=Object.values(e).filter((function(e){return e.selected}));return r.length?function(e){return!!r.find((function(r){return t(e,r.value)}))}:function(e){return!0}},c=function(e,t){return e.replace("OUTBOUND_DEPARTURE","outboundFlights.0").replace("OUTBOUND_ARRIVAL","outboundFlights."+(t.outboundFlights.length-1)).replace("INBOUND_DEPARTURE","inboundFlights.0").replace("INBOUND_ARRIVAL","inboundFlights."+((t.inboundFlights||[]).length-1))},d=function(e,t){return function(r){var i,a=(i=o.helpers).fromObject.apply(i,C([r],c(t,r).split(".")));return a>=e.min&&a<=e.max}},h=function(e,t){return function(r){var i,a,n=l.default((i=o.helpers).fromObject.apply(i,C([r],c(t,r).split(".")))).get("hour"),s=l.default((a=o.helpers).fromObject.apply(a,C([r],c(t,r).split(".")))).get("minute"),u=Number(n+"."+o.helpers.normaliseMinuteToBase10(s));return u>=e.min&&u<=e.max}},p=function(e){return function(t,r){return t[e]===r}},m=[],f=[],v=[];m.push(h(t.arrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),m.push(h(t.departureTime,"OUTBOUND_DEPARTURE.dateTimeDeparting")),v.push(d(t.returnDuration,"outboundTotalDuration")),m.push(d(t.duration,"outboundTotalDuration")),m.push(d(t.price,"total.price")),m.push(u(t.stops,(function(e,t){return e.outboundFlights.length===t}))),f.push(u(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),v.push(u(t.totalStops,(function(e,t){return e.outboundFlights.length===t}))),m.push(u(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,C(r)):0)===t}))),m.push(u(t.depatureAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),m.push(u(t.arrivalAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[e.outboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),f.push(d(t.duration,"outboundTotalDuration")),f.push(d(t.price,"total.price")),v.push(d(t.price,"total.price")),f.push(h(t.returnArrivalTime,"INBOUND_ARRIVAL.dateTimeArriving")),v.push(h(t.returnArrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),f.push(h(t.returnDepartureTime,"INBOUND_DEPARTURE.dateTimeDeparting")),f.push(d(t.returnDuration,"inboundTotalDuration")),v.push(d(t.returnDuration,"outboundTotalDuration")),f.push(u(t.stops,(function(e,t){return e.inboundFlights.length===t}))),v.push(u(t.stops,(function(e,t){return e.outboundFlights.length===t}))),f.push(u(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),f.push(u(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,C(r)):0)===t}))),v.push(u(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,C(r)):0)===t}))),f.push(u(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),v.push(u(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),f.push(u(t.arrivalReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[e.inboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),v.push(u(t.arrivalReturnAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[e.outboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t})));var y=[];y.push(u(t.classes,p("cabinClass"))),y.push(u(t.airlines,p("marketingCarrier")));var b=[];b.push(u(t.classes,p("cabinClass"))),b.push(u(t.airlines,p("marketingCarrier")));var g=function(e){return m.reduce((function(t,r){return t=t&&r(e)}),!0)&&(!e.outboundFlights||!!(e.outboundFlights||[]).find((function(e){return!!y.reduce((function(t,r){return t&&r(e)}),!0)})))},A=function(e){var t;return f.reduce((function(t,r){return t&&r(e)}),!0)&&(!(null===(t=e.inboundFlights)||void 0===t?void 0:t.length)||!!(e.inboundFlights||[]).find((function(e){return!!b.reduce((function(t,r){return t&&r(e)}),!0)})))},T=function(e){var t;return v.reduce((function(t,r){return t&&r(e)}),!0)&&(!(null===(t=e.outboundFlights)||void 0===t?void 0:t.length)||!!(e.outboundFlights||[]).find((function(e){return!!b.reduce((function(t,r){return t&&r(e)}),!0)})))},D=(null===(a=this._ruleActionSummary)||void 0===a?void 0:a.dualSingleWhenSelected)&&this._ruleActionSummary.dualSingleWhenSelected[null===(n=this.selectedGroupFlight)||void 0===n?void 0:n.journeyHash]||{},P=function(e,t,r){return o.helpers.fieldFromObject(o._ruleActionSummary,["journeyWhenSelected",e.journeyHash,t])||o.helpers.fieldFromObject(o._ruleActionSummary,["whenSelectedAlone",e.journeyHash,t])||o.helpers.fieldFromObject(D,[e.journeyHash,t])||r},F=function(e){var t;return e.selected=e.uid===(null===(t=o.selectedGroupFlight)||void 0===t?void 0:t.uid),e.unavailable=P(e,"unavailable",!1),e.unavailableMessage=P(e,"unavailableMessage",""),e.requiresReason=P(e,"requiresReason",!1),e.requiresReasonMessage=P(e,"requiresReasonMessage",""),e};if(this.isGroupedFlights(this.fullResults)){var k=this._grouped.find((function(e){return e.referenceID===o.selectedGroupId})),_=Object.values((null==k?void 0:k.flights)||{}).reduce((function(e,t){return Array.isArray(t)?e.concat(t):e}),[]);this.results.next(this.helpers.clone(this.fullResults).filter((function(e){return!!e})).map((function(t){var r=t.direction===e.FlightDirectionEnum.Outbound||t.direction===e.FlightDirectionEnum.DualSingleOutbound?g:t.direction===e.FlightDirectionEnum.DualSingleInbound?T:A;return t.classes=Object.entries(t.classes).reduce((function(e,i){var a=S(i,2),n=a[0],o=a[1];if(o&&o.flights){var l=o.flights.filter((function(e){return!!e})).filter(s(_,t.direction)).filter(r).map(F);l.length>0&&(e[n]=Object.assign(Object.assign({},o),{flights:l}))}return e}),{}),t})).filter((function(e){return e&&Object.keys(e.classes).length>0})).sort(this._sortGroupedRoutines[r]))}else this.results.next(Object.freeze(this.helpers.clone(this.fullResults).map((function(e){var i=o.helpers.clone(e.journeys);if(t.flightNumber&&(i=i.filter((function(e){var r=e.outboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber})),i=e.inboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber}));if(r||i)return e}))),i=i.filter(g),o.isReturn){var a=o.helpers.clone(e.journeys);a=a.filter(A),i=o.mergeOutInBound(i,a)}return i.sort(o._sortItinaryRoutines[r]),{type:"FlightAllQuoteResult",journeys:i}}))))},a.prototype.mergeOutInBound=function(e,t){return Object.values(C(e,t).reduce((function(e,t){var r=t.uid,i=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(r[i[a]]=e[i[a]])}return r}(t,["uid"]);return e[r]||(e[r]=Object.assign(Object.assign(Object.assign({},e[r]||{}),{uid:r}),i)),e}),[]))},a.prototype.updateLowestPrice=function(e){if(e.length&&!this.searchService.isFlightsGrouped()){var t=e[0].journeys;if(t.length){var r=t[0].total.currency;return t.reduce((function(e,t){var r=t.total.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:r})}}},a.prototype.selectGroupedFlight=function(t,r,i){return y(this,void 0,void 0,(function(){var a,n,o=this;return b(this,(function(s){switch(s.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return a=s.sent(),(n=null==a?void 0:a.subject.value)&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.oneWay&&r===e.FlightDirectionEnum.Outbound?(this.bookSingleFlight(a,t),[2]):(!n||this.originalUserSearch.chosenSearchType!==e.FlightSearchType.return||r!==e.FlightDirectionEnum.Outbound&&r!==e.FlightDirectionEnum.DualSingleOutbound||(t.selected?(this.selectedGroupFlight=null,this.selectedGroupId=-1,this.applyFilters(this.currentFilters,this.currentSort)):(this.selectedGroupFlight=t,this.selectedGroupId=i,this.applyFilters(this.currentFilters,this.currentSort),this._updateTravelPolicies()),t.selected=!t.selected),n&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.return&&r===e.FlightDirectionEnum.Inbound&&this.selectedGroupFlight?(this.doBooking(a,t,{outboundFlights:C(t.outboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:C(t.inboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"inbound",0,t)}))),journeyType:"roundtrip",taxes:(t.taxes?t.taxes:[]).map((function(e){return{description:e.description,currency:e.currency,amount:e.amount}})),fareConditions:t.fareConditions},t.outboundFlights[0].dateTimeDepartingUTC,t.inboundFlights[0].dateTimeDepartingUTC),this.selectedGroupFlight.selected=!1,this.selectedGroupFlight=null,this.applyFilters(this.currentFilters,this.currentSort),[2]):(n&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.return&&r===e.FlightDirectionEnum.DualSingleInbound&&this.selectedGroupFlight&&(this.bookSingleFlight(a,this.selectedGroupFlight),this.bookSingleFlight(a,t),this.selectedGroupFlight.selected=!1,this.selectedGroupFlight=null,this.applyFilters(this.currentFilters,this.currentSort)),[2]))}}))}))},a.prototype._updateTravelPolicies=function(){var e=this;if(!(!this.selectedGroupFlight||this._ruleActionSummary.dualSingleWhenSelected&&this._ruleActionSummary.dualSingleWhenSelected[this.selectedGroupFlight.journeyHash])&&this.multi&&0!==this.multi.length){var t=(this.multi||[]).reduce((function(e,t){return 1===t.order&&t.results&&t.results.length>0&&(e=e.concat(t.results)),e}),[]);t.length>0&&(this.rawResults||(this.rawResults=this.storageService.getSessionItem(this.resultsSessionName+"_raw")),this.fetchingRules=!0,console.log(this.rawResults),this.applyFlightRules.fetchOne({selectedOutboundFlight:this.selectedGroupFlight,availableInboundFlights:t,searchId:this.rawResults.searchId}).pipe(r.take(1)).subscribe((function(t){t&&(e._ruleActionSummary=e.helpers.mergeObjects(e._ruleActionSummary,t),e._applyFilter())}),(function(){}),(function(){e.fetchingRules=!1})))}},a.prototype.bookSingleFlight=function(e,t){var r=this;this.doBooking(e,t,{outboundFlights:t.outboundFlights.map((function(e,t){return r.makeSchemaFlights(e,"outbound",0,t)})),inboundFlights:[],journeyType:"single",taxes:t.taxes.map((function(e){return{description:e.description,currency:e.currency,amount:e.amount}})),fareConditions:t.fareConditions},t.outboundFlights[0].dateTimeDeparting)},a.prototype.doBooking=function(t,r,i,a,n){return y(this,void 0,void 0,(function(){var o,s,l,u,c,d;return b(this,(function(h){switch(h.label){case 0:return o=r.sourceId,s=r.co2PerItem,l=r.co2PerPassenger,u=r.total,c={adults:this.adults,basket:t.id,children:this.children,co2PerItem:s,co2PerPassenger:l,currency:u.currency,detail:i,price:u.price,searchQuery:this.resultQuery,service:o.toString(),outboundDate:a,lowestPrice:this.absoluteCheapestPrice.amount!=Math.floor(u.price)||this.absoluteCheapestPrice.currencyCode!=u.currency?this.absoluteCheapestPrice.amount:null,lowestPriceCurrency:this.absoluteCheapestPrice.amount!=Math.floor(u.price)||this.absoluteCheapestPrice.currencyCode!=u.currency?this.absoluteCheapestPrice.currencyCode:null},n&&(c.inboundDate=n),[4,this.basketService.addToBasket(c,t,this.searchService,this.travellers,r.requiresReason)];case 1:return(d=h.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,d]}}))}))},Object.defineProperty(a.prototype,"absoluteCheapestPrice",{get:function(){if(this.cheapestPrice)return this.cheapestPrice;var e={amount:null,currencyCode:null};return this.cheapestPriceObject.dualInbound.amount+this.cheapestPriceObject.dualOutbound.amount<this.cheapestPriceObject.returns.amount&&this.cheapestPriceObject.dualInbound.currencyCode==this.cheapestPriceObject.dualOutbound.currencyCode?(e.amount=this.cheapestPriceObject.dualInbound.amount+this.cheapestPriceObject.dualOutbound.amount,e.currencyCode=this.cheapestPriceObject.dualInbound.currencyCode):e=this.cheapestPriceObject.returns,e},enumerable:!1,configurable:!0}),a.prototype.makeSchemaFlights=function(e,t,r,i){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:i}})},a.prototype.addFlightJourneysToBasket=function(t){return y(this,void 0,void 0,(function(){var r,i,a,n,o,s,u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return r=p.sent(),(null==r?void 0:r.subject.value)?(i=t.sourceId,a=t.co2PerItem,n=t.co2PerPassenger,o=t.total,s=l.default(t.outboundFlights[0].dateTimeDeparting),u=t.inboundFlights.length?l.default(t.inboundFlights[0].dateTimeDeparting):null,c=this.getTermsAndCond(),d={outboundFlights:C(t.outboundFlights.map((function(e,t){return Object.assign({},e)}))),inboundFlights:C(t.inboundFlights.map((function(e,t){return Object.assign({},e)}))),termsAndCond:c,journeyType:"single",taxes:t.taxes.map((function(e){return{description:e.description,currency:e.currency,amount:e.amount}})),fareConditions:t.fareConditions},h={adults:this.adults,basket:r.id,children:this.children,co2PerItem:a,co2PerPassenger:n,currency:o.currency,detail:d,price:o.price,searchQuery:this.resultQuery,service:i.toString(),outboundDate:s.format()},u&&(h.inboundDate=u.format(),d.journeyType="roundtrip"),[2,this.basketService.addToBasket(h,r,this.searchService,this.travellers,t.requiresReason)]):[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},a.prototype.setFlightDisplayType=function(e){this.selectedGroupFlight=null,this.choosenDisplayType.next(e)},a.prototype._applyFilter=function(){this.applyFilters(this.currentFilters,this.currentSort)},a.prototype.openFlightFareRules=function(e,t,r,i){var a=this;(void 0===r&&(r=null),void 0===i&&(i=null),Object.values(e).find((function(e){return e.length})))?this.modalService.open(d.ModalFlightFareComponent,r,{rules:e,from:t[0].originAirport,to:t[t.length-1].destinationAirport,flight:i}):this.searchService.getFlightFareRules(t[0]).subscribe((function(e){a.modalService.open(d.ModalFlightFareComponent,r,{rules:e.results[0],from:t[0].originAirport,to:t[t.length-1].destinationAirport,flight:i})}),(function(e){console.log(e)}))},a.prototype.getTermsAndCond=function(){return[{name:"Penalties",value:""},{name:"Eligibility",value:""},,{name:"Day/time",value:""},{name:"Seasonality",value:""},{name:"Flight Application",value:""},{name:"Advance Reservations/ticketing",value:""},{name:"Maximum Stay",value:""},{name:"Minimum Stay",value:""},{name:"Stopovers",value:""},{name:"Transfers",value:""},{name:"Combinations",value:""},{name:"Blackout Dates",value:""},{name:"Surcharges",value:""},{name:"Accompanied Travel",value:""},{name:"Travel Restrictions",value:""},{name:"Sales Restrictions",value:""},{name:"Hip/mileage Exceptions",value:""},{name:"Ticket Endorsements",value:""},{name:"Children Discounts",value:""},{name:"Tour Conductor Discounts",value:""},{name:"Agent Discounts",value:""},{name:"All Other Discounts",value:""},{name:"Miscellaneous Provisions",value:""},{name:"Fare By Rule",value:""},{name:"Groups",value:""},{name:"Tours",value:""},{name:"Visit Another Country",value:""},{name:"Deposits",value:""},{name:"Voluntary Changes",value:""},{name:"Voluntary Refunds",value:""},{name:"Negotiated Fares",value:""},{name:"Rule Application And Other Conditions",value:""}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Flight,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r,i=this;return b(this,(function(a){switch(a.label){case 0:return this.chosenSearchType=t.multiDestination?e.FlightSearchType.multiCity:t.returnTrip?e.FlightSearchType.return:e.FlightSearchType.oneWay,this.chosenSearchType!=e.FlightSearchType.multiCity?[3,2]:[4,Promise.all(t.multiDestination.map((function(e){return y(i,void 0,void 0,(function(){var t,r,i;return b(this,(function(a){switch(a.label){case 0:return r=t={date:void 0,dest:void 0,orig:void 0},[4,this.searchService.getAirportsList(e.orig).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.orig}))}))];case 1:return r.orig=a.sent(),i=t,[4,this.searchService.getAirportsList(e.dest).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.dest}))}))];case 2:return i.dest=a.sent(),[2,t]}}))}))})))];case 1:return r=a.sent(),this.multiDestination=r,[3,3];case 2:this.searchService.getAirportsList(t.originAirport).subscribe((function(e){i.departLocation=e.find((function(e){return e.gateway==t.originAirport}))})),this.searchService.getAirportsList(t.destinationAirport).subscribe((function(e){i.arriveLocation=e.find((function(e){return e.gateway==t.destinationAirport}))})),a.label=3;case 3:return this.cabinClass=t.outboundCabinClass[0],this.returnCabinClass=this.chosenSearchType!=e.FlightSearchType.return?null:t.returnCabinClass[0],this.includeNearbyAirports=t.includeNearbyAirports,this.adults=t.passengers.filter((function(e){return"ADULT"==e.type})).length,this.children=t.passengers.filter((function(e){return"CHILD"==e.type})).length,[2]}}))}))},a.prototype.updateSerchQuery=function(t){var r=t;switch(this.chosenSearchType){case e.FlightSearchType.multiCity:r.multiDestinationDetail=this.multiDestination;break;case e.FlightSearchType.return:case e.FlightSearchType.oneWay:r.departLocationDetail=this.departLocation,r.arriveLocationDetail=this.arriveLocation}return r},a.prototype.canBeEuroSearched=function(e,t){return void 0===e&&(e=this.departLocation.gateway),void 0===t&&(t=this.arriveLocation.gateway),!(!ft[e]||!ft[t])},a.prototype.canBeRailSearched=function(){return!(!vt[this.departLocation.gateway]||!vt[this.arriveLocation.gateway])},a.prototype.getFareRules=function(e){return{whenSelectedAlone:this._ruleActionSummary.whenSelectedAlone[e],journeyWhenSelected:this._ruleActionSummary.journeyWhenSelected[e]}},a}(c);St.STORAGE_SESSION_PARAMS="search_flight",St.STORAGE_SESSION_RESULTS="results_flight",(gt=e.URLS||(e.URLS={})).AccessToken="accessToken",gt.LOGOUT_URL="logout",gt.Refresh="refreshToken",gt.CONFERMA_THUMBNAIL_URL="https://ssl.conferma.com/Images/PropertyThumbnails/",gt.CONFIRMA_PHOTO_URL="/confermainfo/Info.aspx?mode=media&key=MICROSSABS&id=",gt.CONFIRMA_INFO_URL="/confermainfo/Info.aspx?mode=hotel&key=MICROSSABS&id=",gt.RECOVER_PASSWORD_URL="password/getResetToken",gt.RESET_PASSWORD="password/resetByToken",gt.BECOME_USER="startUserSupport",gt.END_BECOME_USER="endUserSupport",gt.ADMIN_USER_PANEL="https://admin-staging.ctmlightning.co.uk/user";var Ct,At,Tt=function(){this.priceRange={min:0,max:0},this.distanceRange={min:0,max:0},this.chain=[],this.amenitytype=[],this.preferred=[],this.extra=[],this.hotelName="",this.breakfastType=[],this.accessibleRoomType=[]};(Ct=e.HotelView||(e.HotelView={})).LIST="list",Ct.MAP="map",(At=e.SortTypesHotel||(e.SortTypesHotel={})).distance="distance",At.name="name",At.price="price";var Dt=function(i){function a(r,n,o,s,u,c,d,h,p,m,f,v){var y=i.call(this,d,n,h,o)||this;y.hotelFetcher=r,y.environment=s,y.avaliabilityService=u,y.basketService=c,y.httpCallService=p,y.quickListFetcher=m,y.getRailStationFetcher=f,y.applyHotelRulesFetcher=v,y.type=ne.Hotel,y.location_types=new t.BehaviorSubject([]),y.offices=new t.BehaviorSubject([]),y.lastActivePage=new t.BehaviorSubject(null),y.jitRulesReceived=new t.BehaviorSubject(!1),y.reapplySorting=new t.BehaviorSubject(!1),y.galleries={},y.occupied=0,y.results_details={chains:new Set,amenities:[],maxDistance:0},y._bookedTravellers=[],y.filterChange=new t.Subject,y.selectItemMapView=new t.Subject,y.display={minprice:Number.NEGATIVE_INFINITY,maxprice:Number.POSITIVE_INFINITY,filters:{breakfastType:[]}},y.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},y.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},y.localFilters=new Tt,y.currentView=e.HotelView.LIST,y._max_no_of_rooms=4,y._max_rooms_array=new Array(y._max_no_of_rooms).fill(0),y._max_no_of_occupants=8,y._max_occupant_array=new Array(y._max_no_of_occupants).fill(0),y._distance_list=[1,2,5,10,20,25],y._default_currency=null,y.resultsSessionName=a.STORAGE_SESSION_RESULTS,y.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,y.query={},y.filterResults=function(){y.resultsFilterMethod=function(e){return e.filter((function(e){return y.inPriceRange(e)&&y.inDistanceRange(e)&&y.containsHotelname(e)&&y.hasChain(e)&&y.breakfastTypeFilter(e)}))},console.log("nortmal sort results"),y.results.next(y.resultsFilterMethod(y.fullResults))},y.filterLighteningResults=function(){y.resultsFilterMethod=function(e){return e.filter((function(e){return y.containsHotelname(e)&&y.hasChain(e)&&y.hasPreferred(e)&&y.breakfastTypeFilter(e)&&y.getExtraFilter(e)&&y.getAmenitiesFilter(e)&&y.accessibleRoomTypeFilter(e)}))},console.log("lightning sort results");var e=y.resultsFilterMethod(y.fullResults);y.results.next(e),y.reapplySorting.next(!0)},y.results_details.chains=new Set;var b=d.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};y.default_currency=y.tempParams.currency?y.tempParams.currency:y._default_currency,y.updateTempParams(h.makeHotelQuery(b.tempParams)),o.fullUserDetails.userConfigs.subscribe((function(e){var t;console.log(e),e&&(null==e?void 0:e.hotel_defaults)&&y.updateTempParams(h.makeHotelQuery(null===(t=null==e?void 0:e.hotel_defaults)||void 0===t?void 0:t.config))})),h.shouldAddTravellerSubscription()&&h.travellerInformation.subscribe((function(e){y.travellers=e;var t=y.helpers.selectedTravellers(e,ne.Hotel);y.tempParams.no_of_occupants=t.adults.length,y.travellers=e,y._isValid()}));var g=d.getSessionItemAsList(y.resultsSessionName)||[];return g.slice(0,y.environment.numberHotelToPreload).forEach((function(e){y.searchService.canBook(ne.Hotel)&&y.avaliabilityService.getAvailabilityForId(y.makeHotelAvalilityObject(e),e)})),g.forEach((function(e){y.results_details.chains.add(e.group)})),y.fullResults=g,y._cheapestResultPrice=y.updateLowestPrice(g),y.jitRulesReceived.next(!1),y.results.next(g),y._isValid(),y.userService.changeUser.subscribe((function(t){y.location_types.next([e.LocationTypes.Airport,e.LocationTypes.City,e.LocationTypes.Office,e.LocationTypes.Shortlist,e.LocationTypes.TrainStation]),h.shouldFetchAllOffices()&&y.offices.next([])})),y.localFilters=new Tt,y.avaliabilityService.fetching.subscribe((function(e){var t=y.avaliabilityService.maxPriceForCurrency("GBP");t>0&&(y.filters.priceRange.max=t,y.localFilters.priceRange.max=t),y._cheapestResultPrice=y.updateLowestPrice(g),y.searchService.canBook(ne.Hotel)&&(y._applyTravelRules(),y.reapplySorting.next(!0))})),y}return m(a,i),Object.defineProperty(a.prototype,"chains",{get:function(){return C(this.results_details.chains)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"amenities",{get:function(){return C(this.results_details.amenities)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxDistance",{get:function(){return this.filters.distanceRange.max=Math.ceil(Math.max.apply(Math,this.results.value.map((function(e){return e.location.distance})))),this.results_details.maxDistance=this.filters.distanceRange.max,this.results_details.maxDistance},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxPrice",{get:function(){return Math.ceil(this.filters.priceRange.max)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkin_date_ngb",{get:function(){return this._checkin_date_ngb},set:function(e){this._checkin_date_ngb=e,this.tempParams.checkin_date=this.helpers.ngDateToMoment(e),this.checkin_date=this.helpers.ngDateToMoment(e)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkout_date_ngb",{get:function(){return this._checkout_date_ngb},set:function(e){this._checkout_date_ngb=e,this.tempParams.checkout_date=this.helpers.ngDateToMoment(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkin_date",{get:function(){return this.tempParams.checkin_date},set:function(e){e&&e.isValid()&&(this.tempParams.checkin_date=l.default(e),this._checkin_date_ngb=this.helpers.momentToNgDate(e),e.isSameOrBefore(this.tempParams.checkout_date)&&(this.checkout_date=l.default(e).add(1,"day")),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkout_date",{get:function(){return this.tempParams.checkout_date},set:function(e){e&&e.isValid()&&(this.tempParams.checkout_date=e,this.checkout_date_ngb=this.helpers.momentToNgDate(e),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"no_of_rooms",{get:function(){return this.tempParams.no_of_rooms},set:function(e){e>4||e<1||(this.tempParams.no_of_rooms=e,this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"no_of_occupants",{get:function(){return this.tempParams.no_of_occupants},set:function(e){e<1||(this.tempParams.no_of_occupants=e,this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"default_currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"location",{get:function(){return this.tempParams.location},set:function(e){this.tempParams.location=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"formatted_location",{get:function(){return this.tempParams.location?this.tempParams.location.destination:"No Location Set"},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"distance",{get:function(){return this.tempParams.distance},set:function(e){this.tempParams.distance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"prefered_hotels_only",{get:function(){return this.tempParams.prefered_hotels_only},set:function(e){this.tempParams.prefered_hotels_only=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"country",{get:function(){return this.tempParams.country},set:function(e){this.tempParams.country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcode",{get:function(){return this.tempParams.postcode},set:function(e){this.tempParams.postcode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"trainsStation",{get:function(){return this.tempParams.trainsStation},set:function(e){this.tempParams.trainsStation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"office",{get:function(){return this.tempParams.office},set:function(e){this.tempParams.office=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hotel_name",{get:function(){return this.tempParams.hotel_name},set:function(e){this.tempParams.hotel_name=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hotel_chain",{get:function(){return this.tempParams.hotel_chain},set:function(e){this.tempParams.hotel_chain=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"max_rooms_array",{get:function(){return this._max_rooms_array},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"max_occupant_array",{get:function(){return this._max_occupant_array},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"max_no_of_rooms",{get:function(){return this._max_no_of_rooms},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"distance_list",{get:function(){return this._distance_list},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"location_type_select",{get:function(){return this.tempParams.location_type_select},set:function(e){this.tempParams.location_type_select=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"filters",{get:function(){return this.localFilters},enumerable:!1,configurable:!0}),a.prototype.processResults=function(e){var t=this;return this.results_details.maxDistance=0,this.results_details.chains=new Set,e.map((function(e,r){t.results_details.maxDistance=Math.max(t.results_details.maxDistance,e.location.distance),t.filters.distanceRange.max=t.results_details.maxDistance,t.results_details.chains.add(e.group),r<t.environment.numberHotelToPreload&&t.avaliabilityService.getAvailabilityForId(t.makeHotelAvalilityObject(e),e);var i=e.transports.find((function(e){return"Airport"==e.type})),a=e.transports.find((function(e){return"TrainStation"==e.type})),n=e.transports.find((function(e){return"MetroStation"==e.type}));return Object.assign({sortedTags:t.sortTags(e.tags),Details:{distance_airport:i?i.distance:0,distance_metro:a?a.distance:0,distance_rail:n?n.distance:0,airport_details:i,metro_details:a,rail_details:n}},e)}))},a.prototype._applyTravelRules=function(){var e=this,t=this.helpers.clone(this.fullResults||[]).map((function(t){return e.avaliabilityService.updateHotel(t)})).filter((function(e){return Object.keys(e.availableRates||{}).length>0&&!e.receivedJitRules}));0!==t.length&&this.applyHotelRulesFetcher.fetchKeyedObject("id",{data:t}).pipe(r.take(1)).subscribe((function(t){e.fullResults=e.fullResults.map((function(r){return t[r.id]?e.avaliabilityService.setHotelAvalability(t[r.id]):r})),e.fullResults.forEach((function(e){e.availableRates?e.jitRemoveResultRule=!1:e.jitRemoveResultRule=!0}));var r=e.resultsFilterMethod?e.resultsFilterMethod(e.fullResults):e.fullResults;e._cheapestResultPrice=e.updateLowestPrice(r),e.jitRulesReceived.next(!0),e.results.next(r),e.reapplySorting.next(!0)}))},a.prototype.makeLocations=function(e){return this.helpers.arrayToObjectArray(e,["distanceType"])},a.prototype.sortTags=function(e){var t=this;return e?C(e).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(e){return Object.assign(Object.assign({},e),{icon:t.environment.tagMap[e.name]||e.icon})})):[]},a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeHotelQuery()),this.localFilters=new Tt,this.results_details={chains:new Set,amenities:[],maxDistance:0},this._isValid()},a.prototype._isValid=function(){var t,r,i,n,o,s;if(this.doChecks){switch(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams}),this.min_return_date=this.helpers.momentToNgDate(this.tempParams.checkin_date),this.tempParams.checkin_date.isSameOrAfter(this.tempParams.checkout_date)&&(this.checkout_date=l.default(this.tempParams.checkin_date).add(1,"day")),this.validationMessages=[],this.tempParams.location_type_select){case e.LocationTypes.City:this.country||this.validationMessages.push("Please select country"),this.location||this.postcode||this.validationMessages.push("Please select a hotel location or enter a postcode.");break;case e.LocationTypes.Office:"Office"===(null===(t=this.tempParams.location)||void 0===t?void 0:t.type)||this.office||this.validationMessages.push("Please select an office.");break;case e.LocationTypes.Airport:if(null===(r=this.tempParams)||void 0===r?void 0:r.location){(null===(i=this.tempParams.location.airport)||void 0===i?void 0:i.gateway)||this.validationMessages.push("Please select a airport.");break}this.validationMessages.push("Please select a airport.");break;case e.LocationTypes.TrainStation:(null===(o=null===(n=this.tempParams.location)||void 0===n?void 0:n.railstation)||void 0===o?void 0:o.stationCode)||(null===(s=this.trainsStation)||void 0===s?void 0:s.stationCode)||this.validationMessages.push("Please select a train station.");break;case e.LocationTypes.Shortlist:this.country||this.validationMessages.push("Please select country")}this.checkout_date&&this.checkout_date.isSameOrBefore(this.checkin_date)&&this.validationMessages.push("Checkout date must be after checkin date"),this.checkout_date&&this.checkout_date.isBefore(l.default())&&this.validationMessages.push("Checkout date must not be in the past"),this.checkin_date&&this.checkin_date.isBefore(l.default())&&this.validationMessages.push("Checkin date must not be in the past"),this.checkout_date&&this.checkin_date&&this.checkin_date.isAfter(this.checkout_date)&&this.validationMessages.push("Checkout data must be after the checkin date");var u=this.no_of_occupants/this.no_of_rooms;1!==u&&2!==u&&this.validationMessages.push("Occupants per room must be 1 or 2; if you have an odd number of travellers (greater than one); the no of rooms must be equal"),console.log(this.validationMessages),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)}},a.prototype.startSearch=function(){if(this._cheapestResultPrice=null,this.results.next([]),this.jitRulesReceived.next(!1),this.avaliabilityService.reset(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.buildQuery();var t=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(this.getSearchQuery())),this._startSearch(this.tempParams.location_type_select===e.LocationTypes.Shortlist?this.quickListFetcher.fetchList({countryCode:this.country.cCode}):this.hotelFetcher.fetchList(t))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Hotel,searchArgs:t,travelDate:this.checkin_date.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(t){var r,i=t;switch(i.location_type_select=this.location_type_select,(null===(r=this.location)||void 0===r?void 0:r.name)&&(i.cityName=this.location.name),i.location_type_select){case e.LocationTypes.Office:i.officeName=this.office.name;break;case e.LocationTypes.TrainStation:i.trainsStationDetail=this.trainsStation;break;case e.LocationTypes.Airport:i.airportDetail=this.location.airport}return i},a.prototype.startRecentSearch=function(t){var i=this;switch(this.location_type_select=t.searchArgs.location_type_select,this.currency=t.searchArgs.currency,this.distance=t.searchArgs.distance,this.no_of_rooms=t.searchArgs.rooms,this.checkin_date=l.default(t.searchArgs.startDate),this.checkout_date=l.default(t.searchArgs.endDate),this.hotel_name=t.searchArgs.hotelName,t.searchArgs.groupName&&(this.hotel_chain={name:t.searchArgs.groupName}),this.location_type_select){case e.LocationTypes.Airport:this.searchService.getAirportByCode(t.searchArgs.iata).subscribe((function(e){var t={airport:{gateway:e.iataMatch.iata}};i.location=Object.assign(Object.assign({},t),e.iataMatch),i.searchService.startSearches()}));break;case e.LocationTypes.City:this.country={cCode:t.searchArgs.countryCode,cName:""},t.searchArgs.latitude&&t.searchArgs.longitude?this.location={name:t.searchArgs.cityName,latitude:t.searchArgs.latitude,longitude:t.searchArgs.longitude}:t.searchArgs.postOrZipCode&&(this.postcode={name:t.searchArgs.postOrZipCode,type:e.LocationTypes.Postcode}),this.searchService.startSearches();break;case e.LocationTypes.Office:this.searchService.getOffice(t.searchArgs.officeId).pipe(r.take(1)).subscribe((function(e){i.office={id:e.id,name:e.name},i.searchService.startSearches()}));break;case e.LocationTypes.TrainStation:this.getRailStationByCode(t.searchArgs.trainStationCode).subscribe((function(t){i.trainsStation=Object.assign(Object.assign({},t),{type:e.LocationTypes.TrainStation}),i.searchService.startSearches()}));break;case e.LocationTypes.Shortlist:this.country={cCode:t.searchArgs.countryCode,cName:""},this.searchService.startSearches()}},a.prototype.getRailStationByCode=function(e){return e?this.getRailStationFetcher.fetchList({id:null,code:e}).pipe(r.take(1)):t.of()},a.prototype.getSearchQuery=function(e){return void 0===e&&(e=!1),this.buildQuery(e),this.helpers.removeNulls(this.query)},a.prototype.buildQuery=function(t){var r,i,a,n,o,s,l;void 0===t&&(t=!1);var u=t?this.originalUserSearch:this.tempParams;this.userCurrency||(this.userCurrency=null===(r=this.userService.getUserFavoriteObject(dt.LocalCurrency))||void 0===r?void 0:r.currency);var c={startDate:u.checkin_date.format("YYYY-MM-DD"),endDate:u.checkout_date.format("YYYY-MM-DD"),rooms:u.no_of_rooms,adults:u.no_of_occupants,currency:this.userCurrency||u.currency||null,distance:u.distance,distanceType:e.ɵb.M,maxResults:100};switch(this.getRoomNumber(),u.location_type_select){case e.LocationTypes.Airport:c.iata=u.location.airport.gateway;break;case e.LocationTypes.City:c.countryCode=u.country.cCode,this.location?(c.latitude=u.location.latitude,c.longitude=u.location.longitude):u.postcode&&(c.postOrZipCode=u.postcode.name);break;case e.LocationTypes.TrainStation:(null===(a=null===(i=u.location)||void 0===i?void 0:i.railstation)||void 0===a?void 0:a.stationCode)?c.trainStationCode=u.location.railstation.stationCode:(null===(n=u.trainsStation)||void 0===n?void 0:n.stationCode)&&(c.trainStationCode=u.trainsStation.stationCode);break;case e.LocationTypes.Office:(null===(o=u.location)||void 0===o?void 0:o.id)?c.officeId=+u.location.id:(null===(s=u.office)||void 0===s?void 0:s.id)&&(c.officeId=+u.office.id);break;case e.LocationTypes.Shortlist:c.countryCode=u.country.cCode;break;case e.LocationTypes.Postcode:c.countryCode=u.country.cCode,c.postOrZipCode=u.location.name}u.hotel_name&&(c.hotelName=u.hotel_name),u.hotel_chain&&(c.groupName=null===(l=u.hotel_chain)||void 0===l?void 0:l.name),this.query=c},a.prototype.makeHotelAvalilityObject=function(e){var t;return this.userCurrency||(this.userCurrency=null===(t=this.userService.getUserFavoriteObject(dt.LocalCurrency))||void 0===t?void 0:t.currency),{hotel:e.id,startDate:this.helpers.formatIsoDate(this.checkin_date),endDate:this.helpers.formatIsoDate(this.checkout_date),rooms:this.no_of_rooms,occupants:this.no_of_occupants,currency:this.userCurrency||"GBP"}},a.prototype.resultsHaveTag=function(e){var t=this,r=this.fullResults.filter((function(r){var i=r.tags.filter((function(r){if(r.name)return!!t.convertToOneString(r.name).toLowerCase().includes(t.convertToOneString(e).toLowerCase())}));return!!(i&&i.length>0)}));return!!(r&&r.length>0)},a.prototype.inPriceRange=function(e){var t,r,i=this.avaliabilityService.getAvailabilityValue(e);if(i){var a=(null===(r=null===(t=null==i?void 0:i.rooms[0])||void 0===t?void 0:t.currencyConversion)||void 0===r?void 0:r.rate)||1;return this.helpers.inRange(i.maxprice*a,this.filters.priceRange)&&this.helpers.inRange(i.minprice*a,this.filters.priceRange)}return!1},a.prototype.inDistanceRange=function(e){return 0===this.filters.distanceRange.max||this.helpers.inRange(e.location.distance,this.filters.distanceRange)},a.prototype.containsHotelname=function(e){var t=this.filters.hotelName.toLowerCase();return!(t&&t.length>0)||e.name.toLowerCase().includes(t)},a.prototype.inLighteningPriceRange=function(e){var t,r,i=this.avaliabilityService.getAvailabilityValue(e);if(i&&0!==Object.keys(i).length){var a,n=(null===(r=null===(t=null==i?void 0:i.rooms[0])||void 0===t?void 0:t.currencyConversion)||void 0===r?void 0:r.rate)||1,o=0,s=this.helpers.inRange(i.prpn*n,this.filters.priceRange);return o=(null==i?void 0:i.maxprice)?i.maxprice*n:null==i?void 0:i.rooms.reduce((function(e,t){return e>t.total?e:t.total}),0),a=this.helpers.inRange(o,this.filters.priceRange),s&&a}return!0},a.prototype.hasChain=function(e){var t=(this.filters.chain||[]).map((function(e){return e.toLowerCase()}));return!t||!t.length||!!t.find((function(t){return e.group.toLowerCase().includes(t)}))},a.prototype.breakfastTypeFilter=function(t){if(!this.filters.breakfastType.length)return!0;var r=this.getHotelObjectValue(t);if(!r||!(null==r?void 0:r.rooms))return!1;var i=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_INCLUDED),a=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_NOT_INCLUDED);return!!r.rooms.filter((function(e){return i&&a?e:i?e.rateDescription.match(Ne)&&!e.rateDescription.match(Me):a?!e.rateDescription.match(Ne)||e.rateDescription.match(Me):void 0})).length},a.prototype.accessibleRoomTypeFilter=function(e){if(!this.filters.accessibleRoomType.length)return!0;var t=this.getHotelObjectValue(e);return!(!t||!(null==t?void 0:t.rooms))&&!!t.rooms.filter((function(e){return e.rateDescription.match(Le)||e.roomDescription.match(Le)||e.roomType.match(Le)})).length},a.prototype.getHotelObjectValue=function(e){var t=this.avaliabilityService.getAvailabilityForId(this.makeHotelAvalilityObject(e),e);return t||t.value?t.value:null},a.prototype.byMostExpensive=function(){this.sortByPrice(!1)},a.prototype.sortByPrice=function(e,t){var r=this;void 0===e&&(e=!0),void 0===t&&(t=!1);var i=this.fullResults,a=[],n=[];i.map((function(e){var t;(null===(t=r.avaliabilityService.getAvailabilityValue(e))||void 0===t?void 0:t.prpn)?a.push(e):n.push(e)})),a.sort((function(t,i){var a,n,o=null===(a=r.avaliabilityService.getAvailabilityValue(t))||void 0===a?void 0:a.prpn,s=null===(n=r.avaliabilityService.getAvailabilityValue(i))||void 0===n?void 0:n.prpn;return e?o>s?1:s>o?-1:0:o<s?1:s<o?-1:0}));var o=C(a,n);this.results.next(o),t&&(console.log("++ sortByPrice() called ++"),console.log("++ hotel ++",i),console.log("++ hotelsWithPrices ++",a),console.log("++ hotelsWithoutPrices ++",n),console.log("++ sortedHotels ++",o))},a.prototype.sortByName=function(){this.results.next(this.helpers.clone(this.results.value).sort((function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())})))},a.prototype.sortByDistance=function(){var e=this.helpers.clone(this.results.value);try{e=e.sort((function(e,t){return Number(e.location.distance)-Number(t.location.distance)}))}catch(e){console.error("+++ Error sorting by preferred: ",e," +++")}this.results.next(e)},a.prototype.byPreferred=function(){var e=this,t=this.helpers.clone(this.results.value);try{t=t.sort((function(t,r){var i,a,n,o;if(e.preferredToInt(r)-e.preferredToInt(t)!=0)return e.preferredToInt(r)-e.preferredToInt(t);var s=(null===(i=e.avaliabilityService.getAvailabilityValue(t))||void 0===i?void 0:i.prpn)?null===(a=e.avaliabilityService.getAvailabilityValue(t))||void 0===a?void 0:a.prpn:Number.MAX_SAFE_INTEGER,l=(null===(n=e.avaliabilityService.getAvailabilityValue(r))||void 0===n?void 0:n.prpn)?null===(o=e.avaliabilityService.getAvailabilityValue(r))||void 0===o?void 0:o.prpn:Number.MAX_SAFE_INTEGER;return s>l?1:l>s?-1:0}))}catch(e){console.error("+++ Error sorting by preferred: ",e," +++")}this.results.next(t)},a.prototype.preferredToInt=function(e){return(e.preferred.client?2:0)+(e.preferred.consumer?1:0)},a.prototype.intToPreferred=function(e){return{client:2==(2&e),consumer:1==(1&e)}},a.prototype.addFilter=function(e,t){this.localFilters[t].push(e)},a.prototype.removeFilter=function(e,t){var r=this.localFilters;Array.isArray(r[t])&&(r[t]=r[t].filter((function(t){return e!==t})))},a.prototype.resetFilters=function(){this.localFilters.chain=[],this.localFilters.amenitytype=[],this.localFilters.preferred=[],this.localFilters.extra=[],this.localFilters.hotelName="",this.localFilters.breakfastType=[]},a.prototype.updateSearchFromExpiredBasketItem=function(t){var i,a,n,o,s=this,u=t.searchQuery;this.currency=u.currency,this.distance=u.distance,this.no_of_rooms=u.rooms,this.checkin_date=l.default(u.startDate),this.checkout_date=l.default(u.endDate),this.hotel_name=u.hotelName,u.groupName&&(this.hotel_chain={name:u.groupName}),u.iata?(this.location_type_select=e.LocationTypes.Airport,this.searchService.getAirportByCode(u.iata).subscribe((function(e){var t={airport:{gateway:e.iataMatch.iata}};s.location=Object.assign(Object.assign({},t),e.iataMatch)}))):u.latitude&&u.longitude?(this.location_type_select=e.LocationTypes.City,this.location={name:(null===(a=null===(i=t.detail)||void 0===i?void 0:i.hotelAaddress)||void 0===a?void 0:a.town)?null===(o=null===(n=t.detail)||void 0===n?void 0:n.hotelAaddress)||void 0===o?void 0:o.town:"",latitude:u.latitude,longitude:u.longitude}):u.postOrZipCode?(this.location_type_select=e.LocationTypes.Postcode,this.postcode={name:u.postOrZipCode,type:e.LocationTypes.Postcode}):u.officeId?(this.location_type_select=e.LocationTypes.Office,this.searchService.getOffice(u.officeId).pipe(r.take(1)).subscribe((function(e){s.office={id:e.id,name:e.name}}))):u.trainStationCode?(this.location_type_select=e.LocationTypes.TrainStation,this.getRailStationByCode(u.trainStationCode).subscribe((function(t){s.trainsStation=Object.assign(Object.assign({},t),{type:e.LocationTypes.TrainStation})}))):u.countryCode&&(this.location_type_select=e.LocationTypes.Shortlist,this.country={cCode:u.countryCode,cName:""}),t.users&&t.users.forEach((function(e){s.searchService.addTraveller(e)}))},a.prototype.updateFromPreviousSearches=function(t){var r,i,a;console.log("PREPOPULATING HOTEL FORM");var n=null===(r=t[ne.Flight])||void 0===r?void 0:r.searchQuery,o=null===(i=t[ne.Rail])||void 0===i?void 0:i.searchQuery,s=null===(a=t[ne.InternationalRail])||void 0===a?void 0:a.searchQuery;if(n)try{this.location_type_select=e.LocationTypes.Airport,this.checkin_date=this.searchService.searches[ne.Flight].outBoundDate,this.checkout_date=this.searchService.searches[ne.Flight].inboundDate,this.searchService.searches[ne.Flight].arriveLocation.postcode?this.location={name:this.searchService.searches[ne.Flight].arriveLocation.destination,type:"Airport",airport:this.searchService.searches[ne.Flight].arriveLocation}:this.location=null}catch(e){console.error("Error trying to prepopulate hotel from flight item")}else if(o)try{this.location_type_select=e.LocationTypes.TrainStation,this.checkin_date=this.searchService.searches[ne.Rail].outBoundDateTime,this.checkout_date=this.searchService.searches[ne.Rail].inBoundDateTime,this.trainsStation=this.searchService.searches[ne.Rail].travellingTo,this.location=this.searchService.searches[ne.Rail].travellingTo}catch(e){console.error("Error trying to prepopulate hotel from rail item")}else if(s)try{this.location_type_select=e.LocationTypes.TrainStation,this.checkin_date=this.searchService.searches[ne.InternationalRail].outBoundDateTime,this.checkout_date=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime,this.trainsStation=this.searchService.searches[ne.InternationalRail].travellingTo,this.location=this.searchService.searches[ne.InternationalRail].travellingTo}catch(e){console.error("Error trying to prepopulate hotel from international rail item")}},a.prototype.hasPreferred=function(t){var r=this.filters.preferred;return!(r.length&&!r.includes(e.SearchHandler.ANY))||(r.includes(e.SearchHandler.AGENCY)&&r.includes(e.SearchHandler.CLIENT)?!0===t.preferred.consumer&&!0===t.preferred.client:r.includes(e.SearchHandler.AGENCY)?!0===t.preferred.consumer:r.includes(e.SearchHandler.CLIENT)?!0===t.preferred.client:void 0)},a.prototype.atLeastOnePreferredAgentHotel=function(){for(var e=0;e<this.results.value.length;e++)if(this.results.value[e].preferred.consumer)return!0;return!1},a.prototype.atLeastOnePreferredClientHotel=function(){for(var e=0;e<this.results.value.length;e++)if(this.results.value[e].preferred.client)return!0;return!1},a.prototype.getmaxPriceForCurrency=function(e){return this.avaliabilityService.maxPriceForCurrency(e)},a.prototype.getExtraFilter=function(t){var r=this;return this.filters.extra.includes(e.SearchHandler.AVAILABILITY)?!!t.availableRates:!this.filters.extra.includes(e.SearchHandler.FEMALE_FRIENDLY)||t.tags.filter((function(t){return!t.name||r.convertToOneString(t.name).toLowerCase().includes(r.convertToOneString(e.SearchHandler.FEMALE_FRIENDLY).toLowerCase())})).length>0},a.prototype.getAmenitiesFilter=function(e){var t=this,r=!0;return this.filters.amenitytype.forEach((function(i){var a=e.tags.filter((function(e){if(e.name)return!!t.convertToOneString(e.name).toLowerCase().includes(t.convertToOneString(i).toLowerCase())}));return r=!!(a&&a.length>0)})),r},a.prototype.convertToOneString=function(e){return e.replace(/[^a-zA-Z]/g,"")},a.prototype.getImages=function(i){var a=this,n=this.environment.hostBaseUrl+e.URLS.CONFIRMA_PHOTO_URL+i.split(",")[0];return this.galleries[i]?t.of(this.galleries[i]):this.httpCallService.get(n,{responseType:"text"}).pipe(r.map((function(e){if(!e)throw Error("Gallery for "+i+" can not be loaded.");var t=document.createElement("div");t.innerHTML=e;var r=Array.from(t.getElementsByTagName("img")).reduce((function(e,t){return t.src.includes("https://www.vfmii.com/")&&e.push(t.src),e}),[]);if(!r.length)throw Error("There is no media content provided for this hotel "+i);return a.galleries[i]=r})))},a.prototype.addPaginationPage=function(e){var t="PaginationPageCount";return this.storageService.setSessionItem(t,e),this.storageService.getSessionItem(t)},a.prototype.toggleView=function(){this.currentView===e.HotelView.LIST?this.currentView=e.HotelView.MAP:this.currentView=e.HotelView.LIST},a.prototype.calcDayDiff=function(){var e=l.default(this.checkout_date),t=l.default(this.checkin_date);return e.startOf("day").diff(t.startOf("day"),"days")},a.prototype.updateLowestPrice=function(e){var t=Object.keys(this.avaliabilityService.currencies);if(!e.length&&!t.length||!t.length)return null;var r=t[0];return{amount:this.avaliabilityService.currencies[r].minprice,currencyCode:r}},a.prototype.getRoomNumber=function(){for(var e=[],t=0;t<Number(this.tempParams.no_of_rooms);t++){var r={Adults:this.calcRoomOccupancy(this.tempParams.no_of_rooms,this.tempParams.no_of_occupants),Children:0,Infants:0};e.push(r)}for(var i=[],a=0;a<e.length;a++)for(var n=0;n<e[a].Adults;n++)i.push(a+1)},a.prototype.calcRoomOccupancy=function(e,t){console.log("No of Travellers: "+t+"| No of rooms: "+e+" | Assigned: "+this.occupied);var r=Math.ceil(t/e);return t-this.occupied<r&&(console.log("We have run out of occupiers!"),r=t-this.occupied),r<=0&&(r=1),this.occupied+=r,r},a.prototype.addHotelRoomToBasket=function(t,r,i,a){return y(this,void 0,void 0,(function(){var a,n,o,l,u,c,d,h,p,m,f=this;return b(this,(function(v){switch(v.label){case 0:return console.log(t),console.log(r),console.log(i),t.unavailable?[2,e.DifferentInvokdedUserReasons.cancel]:(i.startDate=new Date(i.startDate).toISOString(),i.endDate=new Date(i.endDate).toISOString(),delete(a=Object.assign({},i)).adults,(n=[]).push({rateDescription:r.rateDescription,roomDescription:r.roomDescription,roomId:r.roomId,roomType:r.roomType,rateCode:r.rateCode,checkIn:i.startDate,checkOut:i.endDate}),[4,this.basketService.getDefaultBasket()]);case 1:return o=v.sent(),(l=null==o?void 0:o.subject.value)?(u=this.tempParams.no_of_occupants,c=new Array(this.tempParams.no_of_rooms).fill("TEST"),d=this.tempParams.no_of_rooms===u?1:2,h=s.default.chunk(this.travellers,d),p=t.address,m=this.getTermsAndCond(r,i),[2,c.reduce((function(s,u,c){return y(f,void 0,void 0,(function(){var u,f,v,y,g,S,C,A,T,D;return b(this,(function(b){switch(b.label){case 0:return[4,s];case 1:switch(b.sent()){case e.DifferentInvokdedUserReasons.cancel:return[2,e.DifferentInvokdedUserReasons.cancel];case e.DifferentInvokdedUserReasons.research:return[2,e.DifferentInvokdedUserReasons.research];case e.DifferentInvokdedUserReasons.continue:case e.DifferentInvokdedUserReasons.newBasket:}return[4,this.basketService.addToBasket({adults:d,basket:l.id,service:t.sourceId.toString(),detail:{hotelAddress:{streetName:p.addressLine1,town:p.addressLine2,county:p.addressLine3,postcode:p.postOrZipCode,countryCode:p.countryCode},hotelDescription:t.group,hotelFaxNumber:p.facsimile,hotelPhoneNumber:p.telephone,hotelId:t.id,hotelName:t.name,numberOfRooms:1,rooms:n,termsAndCond:m,hotelPreferred:t.preferred,hotelDistance:{search:t.location.distance.toFixed(2),airport:null===(u=t.transports.find((function(e){return"Airport"==e.type})))||void 0===u?void 0:u.distance.toFixed(2),train:null===(f=t.transports.find((function(e){return"TrainStation"==e.type})))||void 0===f?void 0:f.distance.toFixed(2),metro:null===(v=t.transports.find((function(e){return"MetroStation"==e.type})))||void 0===v?void 0:v.distance.toFixed(2)},location:{longitude:t.location.longitude,latitude:t.location.latitude}},price:r.total,currency:r.currencyCode,searchQuery:a,outboundDate:i.startDate,lowestPrice:(null===(y=this.cheapestPrice)||void 0===y?void 0:y.amount)!=r.total||(null===(g=this.cheapestPrice)||void 0===g?void 0:g.currencyCode)!=r.currencyCode?null===(S=this.cheapestPrice)||void 0===S?void 0:S.amount:null,lowestPriceCurrency:(null===(C=this.cheapestPrice)||void 0===C?void 0:C.amount)!=r.total||(null===(A=this.cheapestPrice)||void 0===A?void 0:A.currencyCode)!=r.currencyCode?null===(T=this.cheapestPrice)||void 0===T?void 0:T.currencyCode:null},o,this.searchService,h[c]||[],r.requiresReason)];case 2:return(D=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,D]}}))}))}),e.DifferentInvokdedUserReasons.continue)]):[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.getTermsAndCond=function(e,t){return[{name:"Rate Information",value:e.rateDescription},{name:"Cancellation Policy",value:e.policies.cancellation},{name:"Rate Code",value:e.rateCode},{name:"Room Information",value:e.roomDescription},{name:"Deposit Amount",value:(e.total*t.rooms).toString()+t.currency}]},a.prototype.saveSearch=function(e){if(void 0===e&&(e=null),this.isValid.value){var t=this.getSearchQuery(),r=this.updateSerchQuery(t);e&&(r.hotelName=e);var i={name:""+l.default(),serviceType:ne.Hotel,searchArgs:r};return this.searchService.saveFavouriteSearch(i)}},a.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r;return b(this,(function(i){return this.no_of_occupants=t.adults,this.no_of_rooms=t.rooms,this.distance=t.distance,this.currency=t.currency,r={latitude:t.latitude,longitude:t.longitude,countryCode:t.countryCode,name:t.cityName},t.trainStationCode?r.type=e.LocationTypes.TrainStation:t.officeId?r.type=e.LocationTypes.Office:t.iata?r.type=e.LocationTypes.Airport:t.postOrZipCode?r.type=e.LocationTypes.Postcode:r.type=e.LocationTypes.City,this.location=r,this.hotel_name=t.hotelName,t.groupName?this.hotel_chain={name:t.groupName}:this.hotel_chain=null,[2]}))}))},a}(c);Dt.STORAGE_SESSION_PARAMS="search_hotel",Dt.STORAGE_SESSION_RESULTS="results_hotel";var Pt=function(r){function i(e,a,n,o,s,u){var c=r.call(this,o,a,s,u)||this;c.loungefetcher=e,c.basketService=n,c.type=ne.Lounge,c.terminals=new t.BehaviorSubject([]),c._flightNumber=null,c._selectedTerminal="",c.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c._date=null,c._time=null,c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS;var d=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(s.makeLoungesQuery(d.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){var t=c.helpers.selectedTravellers(e,ne.Lounge);c.tempParams.adults=t.adults.length,c.tempParams.children=t.children.length,c.travellers=e,c._isValid()}));var h=o.getSessionItemAsList(c.resultsSessionName)||[];return c._cheapestResultPrice=c.updateLowestPrice(h),c.results.next(h||[]),c}return m(i,r),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){var t;this.tempParams.locationCode=e;var r=null===(t=this.terminals)||void 0===t?void 0:t.value;"string"==typeof e?(this._locationCode="",this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this.terminal=null,this.terminals.next(e.terminals),1===r.length&&(this.selectedTerminal=r[0].key),this._isValid()):(this._locationCode=null,this.terminal=null,this.selectedTerminal=null,this.terminals.next([]),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this.tempParams.terminal?this.tempParams.terminal.toString():null},set:function(e){this.tempParams.terminal=e;var t=this.terminals.value.find((function(t,r){if(t.value===e)return!0}));t?this.selectedTerminal=t.key:this.terminals.value&&this.terminals.value.length>0?this.selectedTerminal=this.terminals.value[0].key:this.selectedTerminal="Any Terminal",this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalDatetime",{get:function(){return this.tempParams.arrivalDatetime},set:function(e){e.isValid()?(this.tempParams.arrivalDatetime=e,this._date=this.helpers.momentToNgDate(e),this._time=this.helpers.formatTimeColon(e)):this.tempParams.arrivalDatetime=null,this._isValid()},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeLoungesQuery()),this._isValid()},i.prototype.getSearchQuery=function(){var e={adults:this.tempParams.adults,children:this.tempParams.children,infants:this.tempParams.infants,locationCode:this._locationCode,terminal:"Any"===this.tempParams.terminal?null:this.tempParams.terminal,arrivalDatetime:this.tempParams.arrivalDatetime};return this.helpers.removeNulls(e)},i.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,travellers:this.travellers}),this.validationMessages=[],this._locationCode&&""!==this._locationCode||this.validationMessages.push("You must select airport first."),this.tempParams.arrivalDatetime.unix()<l.default().unix()&&this.validationMessages.push("Outward journey cannot be in the past."),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype._updateDateTime=function(){if(this._date&&this._time){var e=this.helpers.ngDateToMoment(this._date,this._time);this.tempParams.arrivalDatetime=e.isValid()?e:null,this._isValid()}},i.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.loungefetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.Lounge,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.terminal=e.searchArgs.terminal,this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(r){var i,a,n,o,s,l;r&&(t.locationCode={country:null===(a=null===(i=r.iataMatch)||void 0===i?void 0:i.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(o=null===(n=r.iataMatch)||void 0===n?void 0:n.locationDetails)||void 0===o?void 0:o.countryCode,destination:r.iataMatch.name,gateway:r.iataMatch.iata,postcode:null===(l=null===(s=r.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.postcode,terminals:t.searchService.processTerminals(r.iataMatch.terminals)},t.terminal=e.searchArgs.terminal,t.searchService.startSearches())})),this.searchService.startSearches()},i.prototype.sortByPrice=function(e,t){void 0===t&&(t=[]);var r=C(this.fullResults);r.length||(r=t),r=this.sortResultsPrice(r,e),this.results.next(r)},i.prototype.sortResultsPrice=function(e,t){var r=C(e);return r=t?r.sort((function(e,t){return t.price-e.price})):r.sort((function(e,t){return e.price-t.price}))},i.prototype.sortByTerminal=function(e){void 0===e&&(e=[]);var t=C(this.fullResults);t.length||(t=e);this.results.next(t.sort((function(e,t){return-1})))},i.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n;console.log("PREPOPULATING LOUNGE FORM");var o=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,s=null===(r=e[ne.InternationalRail])||void 0===r?void 0:r.searchQuery,l=null===(i=e[ne.Rail])||void 0===i?void 0:i.searchQuery,u=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,c=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery;if(o)try{var d=this.searchService.searches[ne.Flight].outBoundDate.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate lounge from flight item")}else if(l)try{d=this.searchService.searches[ne.Rail].outBoundDateTime.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate lounge from rail item")}else if(s)try{d=this.searchService.searches[ne.InternationalRail].outBoundDateTime.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate lounge from international rail item")}else if(u)try{d=this.searchService.searches[ne.Hotel].checkin_date.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate lounge from hotel item")}else if(c)try{d=this.searchService.searches[ne.Car].pickup_date;this.date=d}catch(e){console.error("Error trying to prepopulate lounge from car item")}},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;r&&(this.arrivalDatetime=l.default(r.arrivalDatetime),this.terminal=r.terminal,this.searchService.getAirportByCode(r.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)})}))),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},i.prototype.addLoungeToBasket=function(t,r){var i,a,n,o,s,l,u;return y(this,void 0,void 0,(function(){var c,d,h,p;return b(this,(function(m){switch(m.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return c=m.sent(),d=null==c?void 0:c.subject.value,h=this.getTermsAndCond(t),d?[4,this.basketService.addToBasket({adults:r.adults,children:r.children,infants:r.infants,basket:d.id,service:t.sourceId.toString(),detail:{arrivalDatetime:r.arrivalDatetime.format(),locationCode:t.code,name:t.name,airportIata:null==r?void 0:r.locationCode,logo:t.lounge.logo,introduction:t.lounge.introduction,covidCopy:t.lounge.misc.covidCopy,cancellationInfo:t.lounge.cancellationInfo,admendmentsInfo:t.lounge.amendmentsInfo,checkInInfo:t.lounge.checkInInfo,dressCode:t.lounge.dressCode,foodAndBeverage:t.lounge.foodAndBeverage,whatsIncludedFood:t.lounge.whatsIncludedFood,whatsIncludedDrinks:t.lounge.whatsIncludedDrinks,whatsIncludedExtras:t.lounge.whatsIncludedExtras,groupInfo:t.lounge.groupInfo,terminal:null===(i=t.lounge.terminal)||void 0===i?void 0:i.toString(),termsAndCond:h},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format(),lowestPrice:(null===(a=this.cheapestPrice)||void 0===a?void 0:a.amount)!=t.price||(null===(n=this.cheapestPrice)||void 0===n?void 0:n.currencyCode)!=t.currency?null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount:null,lowestPriceCurrency:(null===(s=this.cheapestPrice)||void 0===s?void 0:s.amount)!=t.price||(null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode)!=t.currency?null===(u=this.cheapestPrice)||void 0===u?void 0:u.currencyCode:null},c,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(p=m.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,p];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.lounge.name},{name:"Telephone",value:e.lounge.telephone},{name:"Important Information",value:e.lounge.misc.importantInformation},{name:"Introduction",value:e.lounge.introduction},{name:"Dress Code",value:e.lounge.dressCode},{name:"Business Facilities",value:e.lounge.misc.businessfacilities},{name:"Entertainment Facilities",value:e.lounge.misc.entertainmentFacilities},{name:"Disabled Facilities",value:e.lounge.misc.facilitiesdisabled},{name:"Facilities",value:e.lounge.facilities.toString()},{name:"Times",value:"Opens "+e.lounge.openTime+"; Closes "+e.lounge.closeTime},{name:"Directions",value:e.lounge.directions},{name:"Groups",value:e.lounge.groupInfo},{name:"Check-In Time",value:e.lounge.checkInInfo},{name:"Amend Info",value:e.lounge.amendmentsInfo},{name:"Cancel Info",value:e.lounge.cancellationInfo}]},i.prototype.updateLowestPrice=function(e){if(!e.length)return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ne.Lounge,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},i.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.searchService.getAirportsList(e.locationCode).subscribe((function(r){t.locationCode=r.find((function(t){return t.gateway==e.locationCode})),t.terminal=e.terminal})),this.adults=e.adults,this.children=e.children,this.infants=e.infants,[2]}))}))},i}(c);Pt.STORAGE_SESSION_PARAMS="search_lounge",Pt.STORAGE_SESSION_RESULTS="results_lounge";var Ft,kt,_t={AirportFirst:"You must select airport first.",InvardJourney:"Inward journey cannot be in the past.",OutwardJourney:"Outward journey cannot be in the past.",DateOverlapped:"Inward Journey can not be before outward journey"},Rt=function(r){function i(e,a,n,o,s,u){var c=r.call(this,o,a,s,u)||this;c.parkingfetcher=e,c.basketService=n,c.type=ne.Parking,c.terminals=new t.BehaviorSubject([]),c.listViewToggle=new t.BehaviorSubject(null),c.parkingFiltersText={onAirport:"On Airport",meetAndGreet:"Meet and greet",parkAndRide:"Park and ride",parkAndStroll:"Park and stroll",carParkedForYou:"Car parked for you"},c._selectedTerminal="",c.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,c._outdate=null,c._outtime=null,c._indate=null,c._intime=null;var d=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(s.makeParkingQuery(d.tempParams));var h=o.getSessionItemAsList(c.resultsSessionName)||[];return c.results.next(h),c._cheapestResultPrice=c.updateLowestPrice(h),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){c.travellers=(null==e?void 0:e.slice(0,1))||[],c._isValid()})),c}return m(i,r),Object.defineProperty(i.prototype,"outdate",{get:function(){return this._outdate},set:function(e){this._outdate=e,this._outdate&&this._outdate&&(this.arrivalDatetime=this.helpers.ngDateToMoment(this._outdate,this._outtime))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outtime",{get:function(){return this._outtime},set:function(e){this._outtime=e,this._outdate&&this._outtime&&(this.arrivalDatetime=this.helpers.ngDateToMoment(this._outdate,this._outtime))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"departDatetime",{get:function(){return this.tempParams.departDatetime},set:function(e){this.tempParams.departDatetime=e.isValid()?e:null,e&&e.isValid()&&(this._indate=this.helpers.momentToNgDate(e),this._intime=this.helpers.formatTimeColon(e)),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"indate",{get:function(){return this._indate},set:function(e){this._indate=e,this._indate&&this._intime&&(this.departDatetime=this.helpers.ngDateToMoment(this._indate,this._intime))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"intime",{get:function(){return this._intime},set:function(e){this._intime=e,this.departDatetime=this.helpers.ngDateToMoment(this._indate,this._intime)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalDatetime",{get:function(){var e;return null===(e=this.tempParams)||void 0===e?void 0:e.arrivalDatetime},set:function(e){if(this.tempParams.arrivalDatetime=e.isValid?e:null,e&&e.isValid()&&(this._outdate=this.helpers.momentToNgDate(e),this._outtime=this.helpers.formatTimeColon(e),this.departDatetime&&this.departDatetime.isSameOrBefore(this.arrivalDatetime))){var t=this.arrivalDatetime.clone();this.departDatetime=t}this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outFlightNumber",{get:function(){var e;return null===(e=this.tempParams)||void 0===e?void 0:e.outFlightNumber},set:function(e){this.tempParams.outFlightNumber=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recommended",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.recommended)},set:function(e){this.tempParams.recommended=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onAirport",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.onAirport)},set:function(e){this.tempParams.onAirport=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"meetAndGreet",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.meetAndGreet)},set:function(e){this.tempParams.meetAndGreet=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parkAndRide",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.parkAndRide)},set:function(e){this.tempParams.parkAndRide=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parkAndStroll",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.parkAndStroll)},set:function(e){this.tempParams.parkAndStroll=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carParkedForYou",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.carParkedForYou)},set:function(e){this.tempParams.carParkedForYou=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this.tempParams.terminal?this.tempParams.terminal.toString():null},set:function(e){this.tempParams.terminal=e;var t=this.terminals.value.find((function(t,r){if(t.value===e)return!0}));t?this.selectedTerminal=t.key:this.terminals.value&&this.terminals.value.length>0?this.selectedTerminal=this.terminals.value[0].key:this.selectedTerminal="Any Terminal",this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){this.tempParams.locationCode=e,"string"==typeof e?(this._locationCode=null,this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this.terminal=null,this.terminals.next(e.terminals),1===e.terminals.length&&(this.selectedTerminal=e.terminals[0].key),this._isValid()):(this._locationCode=null,this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeParkingQuery()),this._isValid()},i.prototype._isValid=function(){var e,t,r;this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{location:this._locationCode,travellers:this.travellers,tempParams:this.tempParams}),this.validationMessages=[],this._locationCode&&""!==this._locationCode||this.validationMessages.push(_t.AirportFirst),(null===(e=this.tempParams)||void 0===e?void 0:e.arrivalDatetime.unix())<l.default().unix()&&this.validationMessages.push(_t.InvardJourney),(null===(t=this.tempParams)||void 0===t?void 0:t.departDatetime.unix())<l.default().unix()&&this.validationMessages.push(_t.OutwardJourney),(null===(r=this.tempParams.departDatetime)||void 0===r?void 0:r.isBefore(this.tempParams.arrivalDatetime))&&this.validationMessages.push(_t.DateOverlapped),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.parkingfetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.Parking,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.departDatetime=l.default(e.searchArgs.departDatetime),this.outFlightNumber=e.searchArgs.outFlightNumber,this.terminal=e.searchArgs.terminal,this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)},t.searchService.startSearches())})),this.searchService.startSearches()},i.prototype.getSearchQuery=function(){var e={arrivalDatetime:this.tempParams.arrivalDatetime,departDatetime:this.tempParams.departDatetime,locationCode:this._locationCode,outFlightNumber:this.tempParams.outFlightNumber,recommended:this.tempParams.recommended,onAirport:this.tempParams.onAirport,meetAndGreet:this.tempParams.meetAndGreet,parkAndRide:this.tempParams.parkAndRide,parkAndStroll:this.tempParams.parkAndStroll,carParkedForYou:this.tempParams.carParkedForYou,terminal:"Any"===this.tempParams.terminal?null:this.tempParams.terminal};return this.helpers.removeNulls(e)},i.prototype.sortByPrice=function(e){var t=this.helpers.clone(this.results.value)||[];t=e?t.sort((function(e,t){return t.price-e.price})):t.sort((function(e,t){return e.price-t.price})),this.results.next(t)},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.arrivalDatetime=l.default(r.arrivalDatetime),this.departDatetime=l.default(r.departDatetime),this.outFlightNumber=r.outFlightNumber,this.terminal=r.terminal,this.searchService.getAirportByCode(r.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)})})),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},i.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n,o;console.log("PREPOPULATING PARKING FORM");var s=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,l=null===(r=e[ne.Rail])||void 0===r?void 0:r.searchQuery,u=null===(i=e[ne.InternationalRail])||void 0===i?void 0:i.searchQuery,c=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,d=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery,h=null===(o=e[ne.Lounge])||void 0===o?void 0:o.searchQuery;if(s)try{var p=this.searchService.searches[ne.Flight].outBoundDate.toDate(),m=this.searchService.searches[ne.Flight].inboundDate.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from flight item")}else if(l)try{p=this.searchService.searches[ne.Rail].outBoundDateTime.toDate(),m=this.searchService.searches[ne.Rail].inBoundDateTime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate parking from rail item")}else if(u)try{p=this.searchService.searches[ne.InternationalRail].outBoundDateTime.toDate(),m=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate parking from international rail item")}else if(c)try{p=this.searchService.searches[ne.Hotel].checkin_date.toDate(),m=this.searchService.searches[ne.Hotel].checkout_date.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate parking from hotel item")}else if(d)try{p=this.searchService.searches[ne.Car].pickup_datetime.toDate(),m=this.searchService.searches[ne.Car].dropoff_datetime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Car].pickup_location}catch(e){console.error("Error trying to prepopulate parking from car item")}else if(h)try{p=this.searchService.searches[ne.Lounge].arrivalDatetime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Lounge].locationCode}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},i.prototype.addParkingToBasket=function(t,r){var i,a,n,o,s,l;return y(this,void 0,void 0,(function(){var u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return u=p.sent(),c=null==u?void 0:u.subject.value,d=this.getTermsAndCond(t),c?[4,this.basketService.addToBasket({adults:1,basket:c.id,service:t.sourceId.toString(),detail:{arrivalDatetime:r.arrivalDatetime.format(),departDatetime:r.departDatetime.format(),locationCode:t.carPark.code,name:t.carPark.name,requiredInfo:t.requiredInfo,airportIata:r.locationCode,termsAndCond:d},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format(),inboundDate:r.departDatetime.format(),lowestPrice:(null===(i=this.cheapestPrice)||void 0===i?void 0:i.amount)!=t.price||(null===(a=this.cheapestPrice)||void 0===a?void 0:a.currencyCode)!=t.currency?null===(n=this.cheapestPrice)||void 0===n?void 0:n.amount:null,lowestPriceCurrency:(null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount)!=t.price||(null===(s=this.cheapestPrice)||void 0===s?void 0:s.currencyCode)!=t.currency?null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode:null},u,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(h=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.carPark.name},{name:"Telephone",value:e.carPark.telephone},{name:"Important Information",value:e.carPark.misc.importantInformation},{name:"Geo-Position",value:"Latitude "+e.carPark.latitude+"; Longitude "+e.carPark.latitude},{name:"Introduction",value:e.carPark.introduction},{name:"Arrival Procedures",value:e.carPark.arrivalProcedure},{name:"Departure Procedure",value:e.carPark.departureProcedure},{name:"Information",value:e.carPark.information},{name:"Maximum Car Size",value:e.carPark.maximumCarSize},{name:"Directions",value:e.carPark.directions}]},i.prototype.updateLowestPrice=function(e){if(!e.length)return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ne.Parking,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},i.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.searchService.getAirportsList(e.locationCode).subscribe((function(r){t.locationCode=r.find((function(t){return t.gateway==e.locationCode})),t.terminal=e.terminal})),[2]}))}))},i}(c);Rt.STORAGE_SESSION_PARAMS="search_parking",Rt.STORAGE_SESSION_RESULTS="results_parking",(Ft=e.RailDirection||(e.RailDirection={})).Outbound="outbound",Ft.Inbound="inbound",(kt=e.EurostarSearchType||(e.EurostarSearchType={})).return="return",kt.oneWay="oneWay";var It,Ot,Et=Object.freeze({stops:{},totalStops:{},mustInclude:{},classes:{},airlines:{},travelPolicy:{},depatureAirport:{},depatureReturnAirport:{},arrivalAirport:{},arrivalReturnAirport:{},baggage:{},fareTypes:{},price:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},duration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},returnDuration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},departureTime:{min:0,max:2359},arrivalTime:{min:0,max:2359},returnDepartureTime:{min:0,max:2359},returnArrivalTime:{min:0,max:2359},flightNumber:""});(It=e.SortTypesEurostar||(e.SortTypesEurostar={})).CheapestFirst="C",It.EarliestFirst="E",It.LatestFirst="L",It.ExpensiveFirst="M",It.FastestFirst="F",It.Co2First="O",(Ot=e.SortMethod||(e.SortMethod={})).sortByPrice="sortByPrice",Ot.sortByHighestPrice="sortByHighestPrice",Ot.sortByDate="sortByDate",Ot.sortByFastest="sortByFastest",Ot.SortByCarbon="SortByCarbon";var Bt=function(i){function a(r,n,o,s,u,c,d,h){var p=i.call(this,u,n,c,o)||this;p.eurostarFetcher=r,p.basketService=s,p.modalService=d,p.applyFlightRules=h,p.type=ne.Eurostar,p.avaliableClasses=new t.BehaviorSubject([]),p.timeCriteriaOptions=new t.BehaviorSubject([]),p.flightOperators=new t.BehaviorSubject([]),p._negotiated=!1,p._nearby_airports=!1,p._sortArray=[{title:"Price",method:e.SortMethod.sortByPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.CheapestFirst},{title:"Time",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.EarliestFirst},{title:"Time (Descending)",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.LatestFirst}],p._sortArrayLu=[{title:"Price",method:e.SortMethod.sortByPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.CheapestFirst},{title:"Time",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.EarliestFirst}],p._sortArrayGo2=[{title:"Cheapest",method:e.SortMethod.sortByPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.CheapestFirst},{title:"Most Expensive",method:e.SortMethod.sortByHighestPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.ExpensiveFirst},{title:"Time",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.EarliestFirst},{title:"Time (Descending)",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.LatestFirst},{title:"Fastest",method:e.SortMethod.sortByFastest,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.FastestFirst},{title:"Lowest CO2",method:e.SortMethod.SortByCarbon,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.Co2First}],p._fareTypeArray=[{value:U.Flexible,display:"Flexible"},{value:U.Leisure,display:"Leisure"},{value:U.Lowest,display:"Lowest"},{value:U.Negotiated,display:"Negotiated"},{value:U.NonNegotiated,display:"Non-Negotiated"},{value:U.RequestFareRules,display:"Request Fare Rules"},{value:U.SelectAndPro,display:"Select & Pro"}],p.minimumOutBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.minimumInBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.searchTypes=[{value:e.EurostarSearchType.return,display:"Return"},{value:e.EurostarSearchType.oneWay,display:"One-way"}],p.flightsToGroup={},p.grouped=null,p.travellers=null,p.resultsSessionName=a.STORAGE_SESSION_RESULTS,p.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,p._displayAddHotel=!1,p.filters=new t.BehaviorSubject(Et),p.selectedGroupEurostar={item:null,direction:null},p._selectedEurostarFare={item:null,direction:null},p._multiDestination=[],p.minToHour=function(e){return Math.floor(e/60)+"h "+e%60+"m"};var m=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}},f=c.makeEurostarQuery(m.tempParams);p.updateTempParams(f),p._originalUserSearch=m.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){p.travellers=e;var t=p.helpers.selectedTravellers(e,ne.Eurostar);p.tempParams.adults=t.adults.length,p.tempParams.children=t.children.length,p.updateTravellers(),p._isValid()})),o.changeUser.subscribe((function(t){p.timeCriteriaOptions.next([e.TimeWindow.Anytime,e.TimeWindow.Arrive,e.TimeWindow.Depart]),p.updateAvaliableClasses()})),p.updateTravellers();var v=u.getSessionItem(p.resultsSessionName)||{results:[],groupData:{},grouped:[],query:{}};p.fullResults=p.helpers.clone(v.results),p.flightsToGroup=v.groupData||{},p.resultQuery=v.query;p.searchService.isFlightsGrouped();p.results.next(v.results||[]);var y=p.helpers.clone(v.results);return y.length&&p.filters.next(p.helpers.createFlightFilters(y[0].journeys,Et)),p._isValid(),p.negotiated=p.tempParams.fareType===U.Negotiated,p}return m(a,i),Object.defineProperty(a.prototype,"displayAddHotel",{get:function(){return this._displayAddHotel},set:function(e){this._displayAddHotel=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedEurostarFare",{get:function(){return this._selectedEurostarFare.item},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedFareClass",{get:function(){var e,t;return null===(t=null===(e=this._selectedEurostarFare)||void 0===e?void 0:e.item)||void 0===t?void 0:t.class},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(96).fill(0).map((function(e,t){return{value:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0"),display:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"preferredCarriers",{get:function(){return this.tempParams.preferredCarriers},set:function(e){this.tempParams.preferredCarriers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator1",{get:function(){return this.tempParams.preferredCarriers[0]},set:function(e){this.tempParams.preferredCarriers[0]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator2",{get:function(){return this.tempParams.preferredCarriers[1]},set:function(e){this.tempParams.preferredCarriers[1]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator3",{get:function(){return this.tempParams.preferredCarriers[2]},set:function(e){this.tempParams.preferredCarriers[2]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator4",{get:function(){return this.tempParams.preferredCarriers[3]},set:function(e){this.tempParams.preferredCarriers[3]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minDate",{get:function(){return this._minDate=this._minDate||this.helpers.momentToNgDate(l.default()),this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departLocation",{get:function(){return this.tempParams.departLocation},set:function(e){this.tempParams.departLocation=e,"string"==typeof e?this._originAirport="":e&&e.gateway?this._originAirport=e.gateway:this._originAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryOriginAiport",{get:function(){return this._originAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryDestinationAiport",{get:function(){return this._destinationAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departDate",{get:function(){return this._outDate},set:function(e){this._outDate=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departTime",{get:function(){return this._outTime},set:function(e){this._outTime=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outBoundDate",{get:function(){return this.tempParams.outBoundDate},set:function(e){e=l.default(e),this.tempParams.outBoundDate=e.isValid()?e:null,this.minimumInBoundDate={year:e.year(),month:e.month()+1,day:e.date()},this.tempParams.outBoundDate&&this.tempParams.inboundDate&&this.tempParams.outBoundDate.isAfter(this.tempParams.inboundDate)&&(this.inboundDate=l.default(this.tempParams.outBoundDate).add(1,"day")),this._outDate=this.helpers.momentToNgDate(e),this._outTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnDate",{get:function(){return this._inDate},set:function(e){this._inDate=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveTime",{get:function(){return this._inTime},set:function(e){this._inTime=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inboundDate",{get:function(){return this.tempParams.inboundDate},set:function(e){e=l.default(e),this.tempParams.inboundDate=e.isValid()?e:null,this._inDate=this.helpers.momentToNgDate(e),this._inTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveLocation",{get:function(){return this.tempParams.arriveLocation},set:function(e){this.tempParams.arriveLocation=e,"string"==typeof e?this._destinationAirport="":e&&e.gateway?this._destinationAirport=e.gateway:this._destinationAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cabinClass",{get:function(){return this.tempParams.cabinClass},set:function(e){this.tempParams.cabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnCabinClass",{get:function(){return this.tempParams.returnCabinClass},set:function(e){this.tempParams.returnCabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isReturn",{get:function(){return this.tempParams.chosenSearchType===e.EurostarSearchType.return},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outTimeCriteria",{get:function(){return this.tempParams.outTimeCriteria},set:function(e){this.tempParams.outTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inTimeCriteria",{get:function(){return this.tempParams.inTimeCriteria},set:function(e){this.tempParams.inTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxConnections",{get:function(){return this.tempParams.maxConnections},set:function(e){this.tempParams.maxConnections=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"multiDestination",{get:function(){return this.tempParams.multiDestination},set:function(e){this.tempParams.multiDestination=e,this._isValid()},enumerable:!1,configurable:!0}),a.prototype.setMultiDestinationQuery=function(e){var t=this;return this.helpers.clone(e).reduce((function(e,r){var i={};return i.orig=r.orig.gateway,i.dest=r.dest.gateway,i.date=t.helpers.formatIsoDate(r.date),e.push(i),e}),[])},Object.defineProperty(a.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortDropdownValuesLu",{get:function(){return this._sortArrayLu},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortDropdownValuesGo2",{get:function(){return this._sortArrayGo2},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareTypesValues",{get:function(){return this._fareTypeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareType",{get:function(){return this.tempParams.fareType},set:function(e){this.tempParams.fareType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"negotiated",{get:function(){return this._negotiated},set:function(e){this._negotiated=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"includeNearbyAirports",{get:function(){return this.tempParams.includeNearbyAirports},set:function(e){this.tempParams.includeNearbyAirports=e},enumerable:!1,configurable:!0}),a.prototype.processResults=function(e){var t=this;if(this.resultQuery=this.getSearchQuery(),this.multi=e.multi,this.filters.next(this.helpers.createFlightFilters(e.journeys,Et)),e&&this.searchService.isFlightsGrouped()){this._ruleActionSummary=Object.assign({},{journeyWhenSelected:{},dualSingleWhenSelected:{},whenSelectedAlone:{}},e.ruleActionSummary||{});var r=(e.journeys||[]).reduce((function(e,r,i){if(r.outboundFlights.length){var a=t.formatEurostarResults(r.outboundFlights,r.total,r.journeyHash,i);a.co2PerPassenger=r.co2PerPassenger,a.co2PerItem=r.co2PerItem,a.sourceId=r.sourceId,a.total=r.total,a.duration=t.minToHour(r.outboundTotalDuration),e.outbound.find((function(e){return e.dateDeparture===a.dateDeparture&&e.cabinClass===a.cabinClass}))||e.outbound.push(a)}if(r.inboundFlights.length){var n=t.formatEurostarResults(r.inboundFlights,r.total,r.journeyHash,i);n.co2PerPassenger=r.co2PerPassenger,n.co2PerItem=r.co2PerItem,n.sourceId=r.sourceId,n.total=r.total,n.duration=t.minToHour(r.inboundTotalDuration),e.inbound.find((function(e){return e.dateDeparture===n.dateDeparture&&e.cabinClass===n.cabinClass}))||e.inbound.push(n)}return e}),{outbound:[],inbound:[]});return r.outbound=r.outbound.reduce(this.matchFares.bind(this),[]),r.inbound=r.inbound.reduce(this.matchFares.bind(this),[]),[r]}return this._ruleActionSummary=Object.assign({},{journeyWhenSelected:{},dualSingleWhenSelected:{},whenSelectedAlone:{}},e.ruleActionSummary||{}),e?[e]:[]},a.prototype.matchFares=function(e,t){var r=e.find((function(e){return e.dateDeparture===t.dateDeparture}));if(r)switch(t.cabinClass){case H.Economy:case H.EconomyNoBags:case H.EconomyRestricted:r.standardFare=t.standardFare;break;case"Premium":r.standardPremierFare=t.standardPremierFare;break;case H.Business:r.businessPremierFare=t.businessPremierFare;break;default:console.log("how did I get here",t.cabinClass)}else e.push(t);return e},a.prototype.formatEurostarResults=function(e,t,r,i){var a=this,n={dateArrival:null,dateDeparture:null,duration:null,timeArrival:null,timeDeparture:null,co2PerItem:0,co2PerPassenger:0,sourceId:null,total:null,uid:null,cabinClass:null,businessPremierFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1,requiresReason:!1,preferred:!1,preferredMessages:"",companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",unavailable:!1,unavailableMessage:"",requiresReasonMessage:"",canSelect:!1,journeyHash:""},standardFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1,requiresReason:!1,preferred:!1,preferredMessages:"",companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",unavailable:!1,unavailableMessage:"",requiresReasonMessage:"",canSelect:!1,journeyHash:""},standardPremierFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1,requiresReason:!1,preferred:!1,preferredMessages:"",companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",unavailable:!1,unavailableMessage:"",requiresReasonMessage:"",canSelect:!1,journeyHash:""}};return e.forEach((function(e){switch(n.dateArrival=e.dateTimeArriving,n.dateDeparture=e.dateTimeDeparting,n.duration=a.minToHour(e.totalDuration),n.timeArrival=l.default(e.dateTimeArriving).format("HH:mm"),n.timeDeparture=l.default(e.dateTimeDeparting).format("HH:mm"),n.cabinClass=e.cabinClass,n.uid=i,e.cabinClass){case H.EconomyFlexi:case H.EconomyNoBags:case H.EconomyRestricted:case H.Economy:n.standardFare.isDisabled=!1,n.standardFare.fare=e,n.standardFare.price=t.price,n.standardFare.currency=t.currency,n.standardFare.class=e.cabinClass,n.standardFare.selected=!1,n.standardFare.journeyHash=r,n=a.updateRules(n,r,"standardFare");break;case"Premium":n.standardPremierFare.isDisabled=!1,n.standardPremierFare.fare=e,n.standardPremierFare.price=t.price,n.standardPremierFare.currency=t.currency,n.standardPremierFare.class=e.cabinClass,n.standardPremierFare.selected=!1,n.standardPremierFare.journeyHash=r,n=a.updateRules(n,r,"standardPremierFare");break;case H.Business:n.businessPremierFare.isDisabled=!1,n.businessPremierFare.fare=e,n.businessPremierFare.price=t.price,n.businessPremierFare.currency=t.currency,n.businessPremierFare.class=e.cabinClass,n.businessPremierFare.selected=!1,n.businessPremierFare.journeyHash=r,n=a.updateRules(n,r,"businessPremierFare");break;default:console.warn("new class to be implemented: ",e.cabinClass)}})),n},a.prototype.updateRules=function(e,t,r){var i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k,_,R,I,O,E,B,N,M,L,w,j,U,H,x,G,V,W,Q,J,Y,K,q,X,Z,z,$,ee,te,re,ie,ae,ne,oe,se=this,le=this._ruleActionSummary.dualSingleWhenSelected[null===(i=this.selectedGroupFlight)||void 0===i?void 0:i.journeyHash]||{},ue=function(e,t,r){return se.helpers.fieldFromObject(se._ruleActionSummary,["journeyWhenSelected",e,t])||se.helpers.fieldFromObject(se._ruleActionSummary,["whenSelectedAlone",e,t])||se.helpers.fieldFromObject(le,[e,t])||r};switch(r){case"standardFare":e.standardFare.companyPreferred=(null===(a=this._ruleActionSummary.journeyWhenSelected[t])||void 0===a?void 0:a.companyPreferred)||(null===(n=this._ruleActionSummary.whenSelectedAlone[t])||void 0===n?void 0:n.companyPreferred)||!1,e.standardFare.companyPreferredMessage=(null===(o=this._ruleActionSummary.journeyWhenSelected[t])||void 0===o?void 0:o.companyPreferredMessage)||(null===(s=this._ruleActionSummary.whenSelectedAlone[t])||void 0===s?void 0:s.companyPreferredMessage)||"",e.standardFare.officePreferred=(null===(l=this._ruleActionSummary.journeyWhenSelected[t])||void 0===l?void 0:l.officePreferred)||(null===(u=this._ruleActionSummary.whenSelectedAlone[t])||void 0===u?void 0:u.officePreferred)||!1,e.standardFare.officePreferredMessage=(null===(c=this._ruleActionSummary.journeyWhenSelected[t])||void 0===c?void 0:c.officePreferredMessage)||(null===(d=this._ruleActionSummary.whenSelectedAlone[t])||void 0===d?void 0:d.officePreferredMessage)||"",e.standardFare.tmcPreferred=(null===(h=this._ruleActionSummary.journeyWhenSelected[t])||void 0===h?void 0:h.tmcPreferred)||(null===(p=this._ruleActionSummary.whenSelectedAlone[t])||void 0===p?void 0:p.tmcPreferred)||!1,e.standardFare.tmcPreferredMessage=(null===(m=this._ruleActionSummary.journeyWhenSelected[t])||void 0===m?void 0:m.tmcPreferredMessage)||(null===(f=this._ruleActionSummary.whenSelectedAlone[t])||void 0===f?void 0:f.tmcPreferredMessage)||"",e.standardFare.preferred=(null===(v=this._ruleActionSummary.journeyWhenSelected[t])||void 0===v?void 0:v.companyPreferred)||(null===(y=this._ruleActionSummary.whenSelectedAlone[t])||void 0===y?void 0:y.companyPreferred)||(null===(b=this._ruleActionSummary.journeyWhenSelected[t])||void 0===b?void 0:b.officePreferred)||(null===(g=this._ruleActionSummary.whenSelectedAlone[t])||void 0===g?void 0:g.officePreferred)||(null===(S=this._ruleActionSummary.journeyWhenSelected[t])||void 0===S?void 0:S.tmcPreferred)||(null===(C=this._ruleActionSummary.whenSelectedAlone[t])||void 0===C?void 0:C.tmcPreferred),e.standardFare.selected=e.uid===(null===(A=this.selectedGroupFlight)||void 0===A?void 0:A.uid),e.standardFare.unavailable=ue(t,"unavailable",!1),e.standardFare.unavailableMessage=ue(t,"unavailableMessage",""),e.standardFare.requiresReason=ue(t,"requiresReason",!1),e.standardFare.requiresReasonMessage=ue(t,"requiresReasonMessage","");case"standardPremierFare":e.standardPremierFare.companyPreferred=(null===(T=this._ruleActionSummary.journeyWhenSelected[t])||void 0===T?void 0:T.companyPreferred)||(null===(D=this._ruleActionSummary.whenSelectedAlone[t])||void 0===D?void 0:D.companyPreferred)||!1,e.standardPremierFare.companyPreferredMessage=(null===(P=this._ruleActionSummary.journeyWhenSelected[t])||void 0===P?void 0:P.companyPreferredMessage)||(null===(F=this._ruleActionSummary.whenSelectedAlone[t])||void 0===F?void 0:F.companyPreferredMessage)||"",e.standardPremierFare.officePreferred=(null===(k=this._ruleActionSummary.journeyWhenSelected[t])||void 0===k?void 0:k.officePreferred)||(null===(_=this._ruleActionSummary.whenSelectedAlone[t])||void 0===_?void 0:_.officePreferred)||!1,e.standardPremierFare.officePreferredMessage=(null===(R=this._ruleActionSummary.journeyWhenSelected[t])||void 0===R?void 0:R.officePreferredMessage)||(null===(I=this._ruleActionSummary.whenSelectedAlone[t])||void 0===I?void 0:I.officePreferredMessage)||"",e.standardPremierFare.tmcPreferred=(null===(O=this._ruleActionSummary.journeyWhenSelected[t])||void 0===O?void 0:O.tmcPreferred)||(null===(E=this._ruleActionSummary.whenSelectedAlone[t])||void 0===E?void 0:E.tmcPreferred)||!1,e.standardPremierFare.tmcPreferredMessage=(null===(B=this._ruleActionSummary.journeyWhenSelected[t])||void 0===B?void 0:B.tmcPreferredMessage)||(null===(N=this._ruleActionSummary.whenSelectedAlone[t])||void 0===N?void 0:N.tmcPreferredMessage)||"",e.standardPremierFare.preferred=(null===(M=this._ruleActionSummary.journeyWhenSelected[t])||void 0===M?void 0:M.companyPreferred)||(null===(L=this._ruleActionSummary.whenSelectedAlone[t])||void 0===L?void 0:L.companyPreferred)||(null===(w=this._ruleActionSummary.journeyWhenSelected[t])||void 0===w?void 0:w.officePreferred)||(null===(j=this._ruleActionSummary.whenSelectedAlone[t])||void 0===j?void 0:j.officePreferred)||(null===(U=this._ruleActionSummary.journeyWhenSelected[t])||void 0===U?void 0:U.tmcPreferred)||(null===(H=this._ruleActionSummary.whenSelectedAlone[t])||void 0===H?void 0:H.tmcPreferred),e.standardPremierFare.selected=e.uid===(null===(x=this.selectedGroupFlight)||void 0===x?void 0:x.uid),e.standardPremierFare.unavailable=ue(t,"unavailable",!1),e.standardPremierFare.unavailableMessage=ue(t,"unavailableMessage",""),e.standardPremierFare.requiresReason=ue(t,"requiresReason",!1),e.standardPremierFare.requiresReasonMessage=ue(t,"requiresReasonMessage","");case"businessPremierFare":e.businessPremierFare.companyPreferred=(null===(G=this._ruleActionSummary.journeyWhenSelected[t])||void 0===G?void 0:G.companyPreferred)||(null===(V=this._ruleActionSummary.whenSelectedAlone[t])||void 0===V?void 0:V.companyPreferred)||!1,e.businessPremierFare.companyPreferredMessage=(null===(W=this._ruleActionSummary.journeyWhenSelected[t])||void 0===W?void 0:W.companyPreferredMessage)||(null===(Q=this._ruleActionSummary.whenSelectedAlone[t])||void 0===Q?void 0:Q.companyPreferredMessage)||"",e.businessPremierFare.officePreferred=(null===(J=this._ruleActionSummary.journeyWhenSelected[t])||void 0===J?void 0:J.officePreferred)||(null===(Y=this._ruleActionSummary.whenSelectedAlone[t])||void 0===Y?void 0:Y.officePreferred)||!1,e.businessPremierFare.officePreferredMessage=(null===(K=this._ruleActionSummary.journeyWhenSelected[t])||void 0===K?void 0:K.officePreferredMessage)||(null===(q=this._ruleActionSummary.whenSelectedAlone[t])||void 0===q?void 0:q.officePreferredMessage)||"",e.businessPremierFare.tmcPreferred=(null===(X=this._ruleActionSummary.journeyWhenSelected[t])||void 0===X?void 0:X.tmcPreferred)||(null===(Z=this._ruleActionSummary.whenSelectedAlone[t])||void 0===Z?void 0:Z.tmcPreferred)||!1,e.businessPremierFare.tmcPreferredMessage=(null===(z=this._ruleActionSummary.journeyWhenSelected[t])||void 0===z?void 0:z.tmcPreferredMessage)||(null===($=this._ruleActionSummary.whenSelectedAlone[t])||void 0===$?void 0:$.tmcPreferredMessage)||"",e.businessPremierFare.preferred=(null===(ee=this._ruleActionSummary.journeyWhenSelected[t])||void 0===ee?void 0:ee.companyPreferred)||(null===(te=this._ruleActionSummary.whenSelectedAlone[t])||void 0===te?void 0:te.companyPreferred)||(null===(re=this._ruleActionSummary.journeyWhenSelected[t])||void 0===re?void 0:re.officePreferred)||(null===(ie=this._ruleActionSummary.whenSelectedAlone[t])||void 0===ie?void 0:ie.officePreferred)||(null===(ae=this._ruleActionSummary.journeyWhenSelected[t])||void 0===ae?void 0:ae.tmcPreferred)||(null===(ne=this._ruleActionSummary.whenSelectedAlone[t])||void 0===ne?void 0:ne.tmcPreferred),e.businessPremierFare.selected=e.uid===(null===(oe=this.selectedGroupFlight)||void 0===oe?void 0:oe.uid),e.businessPremierFare.unavailable=ue(t,"unavailable",!1),e.businessPremierFare.unavailableMessage=ue(t,"unavailableMessage",""),e.businessPremierFare.requiresReason=ue(t,"requiresReason",!1),e.businessPremierFare.requiresReasonMessage=ue(t,"requiresReasonMessage","")}return e},a.prototype.resetQuery=function(e){void 0===e&&(e=!0),this.updateTempParams(this.searchService.makeEurostarQuery()),e&&this._isValid()},a.prototype.resetParams=function(){this.reset(),this.resetQuery()},a.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[],this._originAirport||this.validationMessages.push("Please add in a departure location"),this._destinationAirport||this.validationMessages.push("Please add in a arrival destination"),this.tempParams.outBoundDate.isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),this._originAirport&&this._destinationAirport&&this._destinationAirport===this._originAirport&&this.validationMessages.push("Origin and destination station cannot be the same"),this.isReturn&&(this.tempParams.outBoundDate.isSameOrAfter(this.tempParams.inTimeCriteria)&&this.validationMessages.push("Return date must be after the departure date"),this.checkCabinMatchisValid()||this.validationMessages.push("The types of cabin classes selected are not compatible. Examples of compatible cabin classes; Any - Any; Standard - Standard; Business - Business")),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},a.prototype.checkCabinMatchisValid=function(){switch(this.tempParams.cabinClass){case H.Any:return this.tempParams.returnCabinClass===H.Any;case H.Economy:case H.PremiumEconomy:return this.tempParams.returnCabinClass!==H.Business&&this.tempParams.returnCabinClass!==H.Any;case H.Business:return!(this.tempParams.returnCabinClass===H.Economy||this.tempParams.returnCabinClass===H.PremiumEconomy||this.tempParams.returnCabinClass===H.Any);default:return!0}},a.prototype.startSearch=function(){if(this.results.next([]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.eurostarFetcher.fetchList(this.getSearchQuery()))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Eurostar,searchArgs:t,travelDate:this.outBoundDate.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(e){var t=e;return this.departLocation&&(t.departLocation=this.departLocation),this.arriveLocation&&(t.arriveLocation=this.arriveLocation),t.outboundCabinClassName=this.turnCabinTypeToName(this.tempParams.cabinClass),this.isReturn&&(t.returnCabinClassName=this.tempParams.cabinClass===this.tempParams.returnCabinClass?t.outboundCabinClassName:this.turnCabinTypeToName(this.tempParams.returnCabinClass)),t},a.prototype.turnCabinTypeToName=function(e){return[this.avaliableClasses.value.find((function(t){return t.type===e})).name]},a.prototype.startRecentSearch=function(t){if(t.searchArgs.outboundDate){var r=t.searchArgs.outboundDepartureTimeWindow?t.searchArgs.outboundDepartureTimeWindow:t.searchArgs.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(t.searchArgs.outboundDate,r)}if(t.searchArgs.returnDate){var i=t.searchArgs.returnDepartureTimeWindow?t.searchArgs.returnDepartureTimeWindow:t.searchArgs.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(t.searchArgs.returnDate,i)}this.fareType=t.searchArgs.fareType,this.maxConnections=t.searchArgs.maxConnections,t.searchArgs.outboundCabinClass&&(this.cabinClass=t.searchArgs.outboundCabinClass[0]),t.searchArgs.returnCabinClass&&(this.returnCabinClass=t.searchArgs.returnCabinClass[0]),this.includeNearbyAirports=t.searchArgs.includeNearbyAirports,this.chosenSearchType=t.searchArgs.returnTrip?e.EurostarSearchType.return:e.EurostarSearchType.oneWay,t.searchArgs.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:t.searchArgs.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,t.searchArgs.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:t.searchArgs.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,this._originAirport=t.searchArgs.originAirport,this._destinationAirport=t.searchArgs.destinationAirport,this.arriveLocation=t.searchArgs.arriveLocation,this.departLocation=t.searchArgs.departLocation,this.searchService.startSearches()},a.prototype.makeDepartureTimeWindow=function(t,r){return r===e.TimeWindow.Depart?this.helpers.makeTimeWindow(t,-2,2):null},a.prototype.makeArrivalTimeWindow=function(t,r){return r!==e.TimeWindow.Arrive?null:this.helpers.makeTimeWindow(t,-2,2)},a.prototype.convertRecentSearchDateTime=function(e,t){if(t){var r=t.split("-");return l.default(e).add(l.default.duration(this.helpers.hhmmToTime(r[0]))).clone().add(2,"hour")}return l.default(e)},a.prototype.getSearchQuery=function(){return this.helpers.removeNulls(Object.assign({},{originAirport:this._originAirport,destinationAirport:this._destinationAirport,outboundDate:this.helpers.formatIsoDate(this.tempParams.outBoundDate),outboundDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria),outboundArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria)},{passengers:this._passengers,returnTrip:this.isReturn,outboundCabinClass:this.tempParams.cabinClass?[this.tempParams.cabinClass]:null,requireFreeBag:null,maxConnections:this.tempParams.maxConnections,includeNearbyAirports:this.tempParams.includeNearbyAirports,preferredCarriers:this.tempParams.preferredCarriers.map((function(e){return(null==e?void 0:e.code)?e.code:null})),fareType:this.tempParams.fareType,withGrouped:null},this.isReturn?{returnDate:this.helpers.formatIsoDate(this.tempParams.inboundDate),returnDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria),returnArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria),returnCabinClass:this.tempParams.returnCabinClass?[this.tempParams.returnCabinClass]:null}:{}))},a.prototype.updateTravellers=function(){for(var e=[],t=0;t<this.tempParams.adults;t+=1)e.push({type:x.Adult});for(t=0;t<this.tempParams.children;t+=1)e.push({type:x.Child});this._passengers=e,this._isValid()},a.prototype.updateAvaliableClasses=function(){this.avaliableClasses.next([{name:"Any",type:H.Any},{name:"Standard (semi flexible)",type:H.Economy},{name:"Standard premier (semi flexible)",type:H.PremiumEconomy},{name:"Business premier (fully flexible)",type:H.Business}])},a.prototype.sortResults=function(t,r,i){var a=this.helpers.clone(i||this.fullResults);switch(t){case e.SortTypesEurostar.CheapestFirst:a=this.sortByPrice(a,r);break;case e.SortTypesEurostar.EarliestFirst:a=this.sortByDate(a,r);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}this.results.next(a)},a.prototype.sortResultsFlightJourneys=function(t,r,i){void 0===r&&(r=!1);var a=this.helpers.clone(i);switch(t){case e.SortTypesEurostar.CheapestFirst:a=this.sortByPriceFlight(a);break;case e.SortTypesEurostar.EarliestFirst:a=this.sortByDateFlight(a,r);break;case e.SortTypesEurostar.LatestFirst:a=this.sortByDateFlightDecending(a,r);break;case e.SortTypesEurostar.ExpensiveFirst:a=this.sortByExpensiveFlight(a);break;case e.SortTypesEurostar.FastestFirst:a=this.sortByFastestFlight(a);break;case e.SortTypesEurostar.Co2First:a=this.sortByCarbonFlight(a);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}return a},a.prototype.sortByPriceFlight=function(e){return e.sort((function(e,t){return Number(e.total.price)-Number(t.total.price)}))},a.prototype.sortByExpensiveFlight=function(e){return e.sort((function(e,t){return Number(t.total.price)-Number(e.total.price)}))},a.prototype.sortByFastestFlight=function(e){return e.sort((function(e,t){return e.outboundTotalDuration!==t.outboundTotalDuration?e.outboundTotalDuration-t.outboundTotalDuration:e.inboundTotalDuration-t.inboundTotalDuration}))},a.prototype.sortByCarbonFlight=function(e){return e.sort((function(e,t){return Number(e.co2PerPassenger)-Number(t.co2PerPassenger)}))},a.prototype.sortByDateFlight=function(e,t){return e.sort((function(e,r){return t?l.default(e.inboundFlights[0].dateTimeDeparting).unix()-l.default(r.inboundFlights[0].dateTimeDeparting).unix():l.default(e.outboundFlights[0].dateTimeDeparting).unix()-l.default(r.outboundFlights[0].dateTimeDeparting).unix()}))},a.prototype.sortByDateFlightDecending=function(e,t){return e.sort((function(e,r){return t?l.default(r.inboundFlights[0].dateTimeDeparting).unix()-l.default(e.inboundFlights[0].dateTimeDeparting).unix():l.default(r.outboundFlights[0].dateTimeDeparting).unix()-l.default(e.outboundFlights[0].dateTimeDeparting).unix()}))},a.prototype.sortByDate=function(e,t){var r=function(e,r){return t?l.default(e.dateDeparture).unix()-l.default(r.dateDeparture).unix():l.default(r.dateDeparture).unix()-l.default(e.dateDeparture).unix()};return[{outbound:e[0].outbound.sort(r),inbound:e[0].inbound.sort(r)}]},a.prototype.sortByPrice=function(e,t){var r=function(e,r){var i=+e.standardFare.price||+e.standardPremierFare.price||+e.businessPremierFare.price,a=+r.standardFare.price||+r.standardPremierFare.price||+r.businessPremierFare.price;return t?i-a:a-i};return[{outbound:e[0].outbound.sort(r),inbound:e[0].inbound.sort(r)}]},a.prototype.updateSearchFromExpiredBasketItem=function(t){var r=this,i=t.searchQuery;if(i.outboundDate){var a=i.outboundDepartureTimeWindow?i.outboundDepartureTimeWindow:i.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(i.outboundDate,a)}if(i.returnDate){var n=i.returnDepartureTimeWindow?i.returnDepartureTimeWindow:i.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(i.returnDate,n)}this.fareType=i.fareType,this.maxConnections=i.maxConnections,i.outboundCabinClass&&(this.cabinClass=i.outboundCabinClass[0]),i.returnCabinClass&&(this.returnCabinClass=i.returnCabinClass[0]),this.includeNearbyAirports=i.includeNearbyAirports,this.chosenSearchType=i.returnTrip?e.EurostarSearchType.return:e.EurostarSearchType.oneWay,i.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:i.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,i.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:i.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,i.originAirport&&this.searchService.lookupEurostarStations(i.originAirport).subscribe((function(e){r.departLocation=e[0]})),i.destinationAirport&&this.searchService.lookupEurostarStations(i.destinationAirport).subscribe((function(e){r.arriveLocation=e[0]})),t.users&&t.users.forEach((function(e){r.searchService.addTraveller(e)}))},a.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n,o,s,u=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,c=null===(r=e[ne.Rail])||void 0===r?void 0:r.searchQuery,d=null===(i=e[ne.InternationalRail])||void 0===i?void 0:i.searchQuery,h=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,p=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery,m=null===(o=e[ne.Lounge])||void 0===o?void 0:o.searchQuery,f=null===(s=e[ne.Parking])||void 0===s?void 0:s.searchQuery;if(u)try{this.outBoundDate=l.default(e.FLIGHT.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.FLIGHT.inboundDate&&(this.inboundDate=l.default(e.FLIGHT.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from flight item")}else if(c)try{this.outBoundDate=l.default(e.RAIL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.RAIL.inboundDate&&(this.inboundDate=l.default(e.RAIL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from rail item")}else if(d)try{this.outBoundDate=l.default(e.INTERNATIONAL_RAIL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.INTERNATIONAL_RAIL.inboundDate&&(this.inboundDate=l.default(e.INTERNATIONAL_RAIL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from international rail item")}else if(h)try{this.outBoundDate=l.default(e.HOTEL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.HOTEL.inboundDate&&(this.inboundDate=l.default(e.HOTEL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from hotel item")}else if(p)try{this.outBoundDate=l.default(e.CAR.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.CAR.inboundDate&&(this.inboundDate=l.default(e.CAR.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from car item")}else if(m)try{this.outBoundDate=l.default(e.LOUNGE.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.LOUNGE.inboundDate&&(this.inboundDate=l.default(e.LOUNGE.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from lounge item")}else if(f)try{this.outBoundDate=l.default(e.PARKING.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.PARKING.inboundDate&&(this.inboundDate=l.default(e.PARKING.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from parking item")}},a.prototype.getTotalBaggage=function(e){var t=0,r=JSON.parse(e.additional);return r&&r.outboundFlights?r.outboundFlights.forEach((function(e){e.baggage.forEach((function(e){e.allowance&&e.allowance>t&&(t=e.allowance)}))})):r&&r.baggageAllowance&&r.baggageAllowance.forEach((function(e){e.baggage.qty&&Number(e.baggage.qty)>t&&(t=Number(e.baggage.qty))})),t},a.prototype.transformMin=function(e){var t=60*Number(e)/100;return(t=t%1<.5?Math.floor(t):Math.ceil(t)).toString().padStart(2,"0")},a.prototype.applyFilters=function(e){var t=this;0===this.fullResults.length&&this.results.next([]);var r,i,a=function(e,t){var r=Object.values(e).filter((function(e){return e.selected}));return r.length?function(e){return!!r.find((function(r){return t(e,r.value)}))}:function(e){return!0}},n=function(e,r){return function(i){var a,n,s=l.default((a=t.helpers).fromObject.apply(a,C([i],o(r,i).split(".")))).get("hour"),u=l.default((n=t.helpers).fromObject.apply(n,C([i],o(r,i).split(".")))).get("minute"),c=Number(""+s.toString().padStart(2,"0")+u.toString().padStart(2,"0"));return c>=e.min&&c<=e.max}},o=function(e,t){return e.replace("OUTBOUND_DEPARTURE","outboundFlights.0").replace("OUTBOUND_ARRIVAL","outboundFlights."+(t.outboundFlights.length-1)).replace("INBOUND_DEPARTURE","inboundFlights.0").replace("INBOUND_ARRIVAL","inboundFlights."+((t.inboundFlights||[]).length-1))},s=function(e){return function(t,r){return t[e]===r}},u=[],c=[];u.push(n(e.arrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),u.push(n(e.departureTime,"OUTBOUND_DEPARTURE.dateTimeDeparting")),u.push((r=e.price,i="total.price",function(e){var a,n=(a=t.helpers).fromObject.apply(a,C([e],o(i,e).split(".")));return n>=r.min&&n<=r.max})),c.push(n(e.returnArrivalTime,"INBOUND_ARRIVAL.dateTimeArriving")),c.push(n(e.returnDepartureTime,"INBOUND_DEPARTURE.dateTimeDeparting"));var d=[];d.push(a(e.classes,s("cabinClass")));var h=[];h.push(a(e.classes,s("cabinClass")));for(var p=function(e,t){return u.reduce((function(t,r){return t=t&&r(e)}),!0)&&(!e.outboundFlights||!!(e.outboundFlights||[]).find((function(e){return!!d.reduce((function(t,r){return t&&r(e)}),!0)})))},m=function(e,t){var r;return c.reduce((function(t,r){return t&&r(e)}),!0)&&(!(null===(r=e.inboundFlights)||void 0===r?void 0:r.length)||!!(e.inboundFlights||[]).find((function(e){return!!h.reduce((function(t,r){return t&&r(e)}),!0)})))},f=this.helpers.clone(this.fullResults),v=0;v<f.length;v++){var y=f[v];y.journeys=y.journeys.filter(p),this.isReturn&&(y.journeys=y.journeys.filter(m)),y.journeys=y.journeys}this.results.next(f)},a.prototype.selectGroupedEurostar=function(t,r,i){var a,n,o,s;return y(this,void 0,void 0,(function(){var l,u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return l=p.sent(),(u=null==l?void 0:l.subject.value)&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.oneWay&&i===e.FlightDirectionEnum.Outbound?(this.doBooking(l,t,{outboundFlights:[this.makeSchemaFlights(r.fare,"outbound",0)],inboundFlights:[],journeyType:"single"},t.dateDeparture,null,r.price,r.requiresReason),[2]):(u&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.return&&(i===e.FlightDirectionEnum.Outbound?(null===(a=this.selectedGroupEurostar)||void 0===a?void 0:a.direction)===e.FlightDirectionEnum.Inbound?(d=this._selectedEurostarFare.item.price>r.price?this._selectedEurostarFare.item.price:r.price,this.doBooking(l,t,{inboundFlights:[this.makeSchemaFlights(this._selectedEurostarFare.item.fare,"inbound",0)],outboundFlights:[this.makeSchemaFlights(r.fare,"outbound",0)],journeyType:"roundtrip"},t.dateDeparture,this.selectedGroupEurostar.item.dateArrival,d,r.requiresReason),this.resetSelectedFares(),this.basketService.toggleMenu(),this.results.next(this.fullResults.map(this.removeSelectedFlags))):(null===(n=this.selectedGroupEurostar)||void 0===n?void 0:n.direction)===e.FlightDirectionEnum.Outbound?(this.resetSelectedFares(),this.results.next(this.fullResults)):(this.selectedGroupEurostar={item:t,direction:i},this._selectedEurostarFare={item:r,direction:i},c=t.uid,this.results.next(this.fullResults.map((function(e){var t=e.outbound.filter((function(e){return c===e.uid}));return{inbound:e.inbound,outbound:t}})))):i===e.FlightDirectionEnum.Inbound&&((null===(o=this.selectedGroupEurostar)||void 0===o?void 0:o.direction)===e.FlightDirectionEnum.Outbound?(d=this._selectedEurostarFare.item.price>r.price?this._selectedEurostarFare.item.price:r.price,this.doBooking(l,t,{outboundFlights:[this.makeSchemaFlights(this._selectedEurostarFare.item.fare,"outbound",0)],inboundFlights:[this.makeSchemaFlights(r.fare,"inbound",0)],journeyType:"roundtrip"},t.dateDeparture,this.selectedGroupEurostar.item.dateArrival,d,r.requiresReason),this.resetSelectedFares(),this.basketService.toggleMenu(),this.results.next(this.fullResults.map(this.removeSelectedFlags))):(null===(s=this.selectedGroupEurostar)||void 0===s?void 0:s.direction)===e.FlightDirectionEnum.Inbound?(this.resetSelectedFares(),this.results.next(this.fullResults)):(this.selectedGroupEurostar={item:t,direction:i},this._selectedEurostarFare={item:r,direction:i},h=t.uid,this.results.next(this.fullResults.map((function(e){return{inbound:e.inbound.filter((function(e){return h===e.uid})),outbound:e.outbound}}))),this._updateTravelPolicies()))),[2])}}))}))},a.prototype._updateTravelPolicies=function(){var e=this;if(this.selectedGroupEurostar&&!this._ruleActionSummary.dualSingleWhenSelected[this._selectedEurostarFare.item.journeyHash]&&this.multi&&0!==this.multi.length){var t=(this.multi||[]).reduce((function(e,t){return 1===t.order&&t.results&&t.results.length>0&&(e=e.concat(t.results)),e}),[]);t.length>0&&(this.rawResults||(this.rawResults=this.storageService.getSessionItem(this.resultsSessionName+"_raw")),console.log(this.rawResults),this.applyFlightRules.fetchOne({selectedOutboundFlight:this.selectedGroupFlight,availableInboundFlights:t,searchId:this.rawResults.searchId}).pipe(r.take(1)).subscribe((function(t){t&&(e._ruleActionSummary=e.helpers.mergeObjects(e._ruleActionSummary,t))})))}},a.prototype.resetSelectedFares=function(){this.selectedGroupEurostar={direction:null,item:null},this._selectedEurostarFare={direction:null,item:null}},a.prototype.removeSelectedFlags=function(e){return{inbound:e.inbound.map((function(e){return e.standardPremierFare.selected=!1,e.standardFare.selected=!1,e.businessPremierFare.selected=!1,e})),outbound:e.outbound.map((function(e){return e.standardPremierFare.selected=!1,e.standardFare.selected=!1,e.businessPremierFare.selected=!1,e}))}},a.prototype.updateLowestPrice=function(e){if(e.length&&!this.searchService.isFlightsGrouped()){var t=e[0].journeys;if(t.length){var r=t[0].total.currency;return t.reduce((function(e,t){var r=t.total.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:r})}}},a.prototype.doBooking=function(t,r,i,a,n,o,s){var l,u;return y(this,void 0,void 0,(function(){var c,d,h,p,m,f;return b(this,(function(v){switch(v.label){case 0:return c=r.sourceId,d=r.co2PerItem,h=r.co2PerPassenger,p=r.total,m={adults:this.adults,basket:t.id,children:this.children,co2PerItem:d,co2PerPassenger:h,currency:p.currency,detail:i,price:o,searchQuery:this.resultQuery,service:c.toString(),outboundDate:a,lowestPrice:null===(l=this.lowestPrice)||void 0===l?void 0:l.amount,lowestPriceCurrency:null===(u=this.lowestPrice)||void 0===u?void 0:u.currencyCode},n&&(m.inboundDate=n),[4,this.basketService.addToBasket(m,t,this.searchService,this.travellers,s)];case 1:return(f=v.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,f]}}))}))},Object.defineProperty(a.prototype,"lowestPrice",{get:function(){if(this.cheapestPrice)return this.cheapestPrice;var e,t=this.fullResults[0].outbound,r=t[0].standardFare.currency;return t.forEach((function(t){(!e||t.standardFare.price<e)&&(e=t.standardFare.price),t.standardPremierFare.price<e&&(e=t.standardPremierFare.price),t.businessPremierFare.price<e&&(e=t.businessPremierFare.price)})),{amount:e,currencyCode:r}},enumerable:!1,configurable:!0}),a.prototype.makeSchemaFlights=function(e,t,r,i){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:i}})},a.prototype.createGroupedItem=function(e,t,r,i,a,n){if((null==r?void 0:r.length)&&!e.departDateTime){var o=r[0],s=r[r.length-1];e.originAirport=o.originAirport,e.originAirportName=o.originAirportName,e.destinationAirport=s.destinationAirport,e.destinationAirportName=s.destinationAirportName,e.departDateTime=o.dateTimeDeparting,e.arrivalDateTime=s.dateTimeArriving,e.outboundTotalDuration=i,e.dataSource=t,e.operator=o.operatingCarrier,e.operatorFull=o.operatingCarrierName,e.outlegsCount=r.length,e.outlegs=r,e.outboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",r),e.isReturn=!1}(null==a?void 0:a.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=a.length,e.inlegs=a,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",a),e.isReturn=!0)},a.prototype.makeSessionResults=function(e){return{results:[],groupData:[],grouped:[],query:this.resultQuery}},a.prototype.getMinFlightPriceForBrand=function(e){var t=Number.MAX_SAFE_INTEGER;return e.forEach((function(e){var r;t>(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.getMaxFlightPriceForBrand=function(e){var t=0;return e.forEach((function(e){var r;t<(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.isOverNight=function(){var e=this.outBoundDate.date();return this.inboundDate.date()-e>=1},a.prototype.addEurostarJourneysToBasket=function(t){return y(this,void 0,void 0,(function(){var r,i,a,n,o,s,u,c,d,h,p,m=this;return b(this,(function(f){switch(f.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return r=f.sent(),(null==r?void 0:r.subject.value)?(i=t.sourceId,a=t.co2PerItem,n=t.co2PerPassenger,o=t.total,s=l.default(t.outboundFlights[0].dateTimeDeparting),u=t.inboundFlights.length?l.default(t.inboundFlights[0].dateTimeDeparting):null,c=this.getTermsAndCond(t),d={outboundFlights:C(t.outboundFlights.map((function(e,t){return m.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:C(t.inboundFlights.map((function(e,t){return m.makeSchemaFlights(e,"inbound",0,t)}))),termsAndCond:c,journeyType:"single"},h={adults:this.adults,basket:r.id,children:this.children,co2PerItem:a,co2PerPassenger:n,currency:o.currency,detail:d,price:o.price,searchQuery:this.resultQuery,service:i.toString(),outboundDate:s.format()},u&&(h.inboundDate=u.format(),d.journeyType="roundtrip"),[4,this.basketService.addToBasket(h,r,this.searchService,this.travellers,t.requiresReason)]):[3,3];case 2:return(p=f.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,p];case 3:return[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},a.prototype.getTermsAndCond=function(e){return[{name:"Penalties",value:""},{name:"Eligibility",value:""},,{name:"Day/time",value:""},{name:"Seasonality",value:""},{name:"Flight Application",value:""},{name:"Advance Reservations/ticketing",value:""},{name:"Maximum Stay",value:""},{name:"Minimum Stay",value:""},{name:"Stopovers",value:""},{name:"Transfers",value:""},{name:"Combinations",value:""},{name:"Blackout Dates",value:""},{name:"Surcharges",value:""},{name:"Accompanied Travel",value:""},{name:"Travel Restrictions",value:""},{name:"Sales Restrictions",value:""},{name:"Hip/mileage Exceptions",value:""},{name:"Ticket Endorsements",value:""},{name:"Children Discounts",value:""},{name:"Tour Conductor Discounts",value:""},{name:"Agent Discounts",value:""},{name:"All Other Discounts",value:""},{name:"Miscellaneous Provisions",value:""},{name:"Fare By Rule",value:""},{name:"Groups",value:""},{name:"Tours",value:""},{name:"Visit Another Country",value:""},{name:"Deposits",value:""},{name:"Voluntary Changes",value:""},{name:"Voluntary Refunds",value:""},{name:"Negotiated Fares",value:""},{name:"Rule Application And Other Conditions",value:""}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Eurostar,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r=this;return b(this,(function(i){return this.fareType=t.fareType,this.includeNearbyAirports=t.includeNearbyAirports,this.chosenSearchType=t.returnTrip?e.EurostarSearchType.return:e.EurostarSearchType.oneWay,this.searchService.getAirportsList(t.originAirport).subscribe((function(e){r.departLocation=e.find((function(e){return e.gateway==t.originAirport}))})),this.searchService.getAirportsList(t.destinationAirport).subscribe((function(e){r.arriveLocation=e.find((function(e){return e.gateway==t.destinationAirport}))})),this._passengers=t.passengers,this.adults=t.passengers.filter((function(e){return"ADULT"==e.type})).length,this.children=t.passengers.filter((function(e){return"CHILD"==e.type})).length,[2]}))}))},a.prototype.openEurostarFareRules=function(e){var t=this,r=C(e.detail.outboundFlights);r[0].fareInfo=r[0].journeyInfo,delete r[0].journeyInfo,this.searchService.getFlightFareRules(r[0]).subscribe((function(e){t.modalService.open(d.ModalFlightFareComponent,null,{rules:e.results[0],from:r[0].originAirport,to:r[r.length-1].destinationAirport})}),(function(e){console.log(e)}))},a.prototype.generateQueryFromFlightQuery=function(t,r,i){return y(this,void 0,void 0,(function(){var a=this;return b(this,(function(n){switch(n.label){case 0:return this.departDate=this.helpers.momentToNgDate(l.default(t.outboundDate,"YYYY-MM-DD")),this.returnDate=this.helpers.momentToNgDate(l.default(t.returnDate,"YYYY-MM-DD")),this._originAirport=this.getEuroLocation(r),this._destinationAirport=this.getEuroLocation(i),[4,this.searchService.lookupEurostarStations(this._originAirport).toPromise().then((function(e){console.log(e),a.departLocation=e[0]}))];case 1:return n.sent(),[4,this.searchService.lookupEurostarStations(this._destinationAirport).toPromise().then((function(e){console.log(e),a.arriveLocation=e[0]}))];case 2:return n.sent(),t.returnTrip?this.chosenSearchType=e.EurostarSearchType.return:this.chosenSearchType=e.EurostarSearchType.oneWay,[2]}}))}))},a.prototype.getEuroLocation=function(e){return ft[e.toUpperCase()]||""},a.prototype.getFareRules=function(e){var t,r;return{whenSelectedAlone:null===(t=this._ruleActionSummary)||void 0===t?void 0:t.whenSelectedAlone[e],journeyWhenSelected:null===(r=this._ruleActionSummary)||void 0===r?void 0:r.journeyWhenSelected[e]}},a}(c);Bt.STORAGE_SESSION_PARAMS="search_eurostar",Bt.STORAGE_SESSION_RESULTS="results_eurostar";var Nt,Mt,Lt,wt=function(){function e(){this.data={},this.current={}}return e.prototype.nextJourney=function(){this.data=Object.entries(this.current).reduce((function(e,t){var r=S(t,2),i=r[0],a=r[1];return e[i]=e[i]||{total:0,types:{}},e[i].types=Object.entries(a.types).reduce((function(e,t){var r=S(t,2),i=r[0],a=r[1];return e[i]=Math.max(e[i]||0,a),e}),e[i].types),e[i].total=Object.values(e[i].types).reduce((function(e,t){return e+t}),0),e}),this.data),this.current={}},e.prototype.addFares=function(e,t,r){this.current[e]=this.current[e]||{total:0,types:{}},this.current[e].total+=r.length,this.current[e].types[t]=r.length},e.prototype.getTicketTypes=function(){return Object.entries(this.data).reduce((function(e,t){var r=S(t,2),i=r[0],a=r[1];return e[i]=a.total,e}),{})},e.prototype.workoutIndexes=function(e){return Object.entries(this.data[e].types).sort((function(e,t){var r=S(e,2),i=r[0],a=(r[1],S(t,2)),n=a[0];a[1];return Number(i.split("_")[1])-Number(n.split("_")[1])})).reduce((function(t,r){for(var i=S(r,2),a=i[0],n=i[1],o=0;o<n;o++)t.push([e,a,o.toString()]);return t}),[])},e}();(Nt=e.RailSearchCriteria||(e.RailSearchCriteria={})).Depart="Depart After",Nt.Arrive="Arrive Before",(Mt=e.RailJourneyFareType||(e.RailJourneyFareType={})).Return="Return",Mt.Single="Single",(Lt=e.RailFareTypes||(e.RailFareTypes={})).dualSingleJourneyFares="dualSingleJourneyFares",Lt.returnJourneyFares="returnJourneyFares",Lt.singleJourneyFares="singleJourneyFares",Lt.openReturnJourneyFares="openReturnJourneyFares",Lt.splitFares="splitFares";var jt,Ut=function(i){function a(r,n,o,s,u,c,d,h){var p=i.call(this,u,o,c,d)||this;p.Railfetcher=r,p.getRailStationFetcher=n,p.basketService=s,p.modalService=h,p._ticketTypes=[e.RailFareTypes.dualSingleJourneyFares,e.RailFareTypes.returnJourneyFares,e.RailFareTypes.singleJourneyFares,e.RailFareTypes.openReturnJourneyFares,e.RailFareTypes.splitFares],p.resultsSessionName=a.STORAGE_SESSION_RESULTS,p.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,p.searchTypes=[{display:"Return",value:te.ReturnJourney},{display:"One-Way",value:te.SingleJourney}],p.classTypes=new t.BehaviorSubject([]),p.airportExpressStations=[{code:"HP1-3",name:"Heathrow T1-3 - Paddington"},{code:"HP4",name:"Heathrow T4 - Paddington"},{code:"HP5",name:"Heathrow T5 - Paddington"},{code:"PH1-3",name:"Paddington - Heathrow T1-3"},{code:"PH4",name:"Paddington - Heathrow T4"},{code:"PH5",name:"Paddington - Heathrow T5"},{code:"GV",name:"Gatwick - Victoria"},{code:"VG",name:"Victoria - Gatwick"},{code:"SL",name:"Stansted - Liverpool Street"},{code:"LS",name:"Liverpool Street - Stansted"}],p.airportExpressStationsCodes={"HP1-3":{dep:"HXX",arr:"PAD"},"PH1-3":{dep:"PAD",arr:"HXX"},HP4:{dep:"HAF",arr:"PAD"},PH4:{dep:"PAD",arr:"HAF"},HP5:{dep:"HWV",arr:"PAD"},PH5:{dep:"PAD",arr:"HWV"},GV:{dep:"GTW",arr:"VIC"},VG:{dep:"VIC",arr:"GTW"},SL:{dep:"SSD",arr:"LST"},LS:{dep:"LST",arr:"SSD"}},p.railCriteria=[e.RailSearchCriteria.Depart,e.RailSearchCriteria.Arrive],p.travelCards=[{display:"Young persons railcard",value:"YNG"},{display:"Disability railcard",value:"DIS"},{display:"Family railcard",value:"FAM"},{display:"Forces railcard",value:"HMF"},{display:"Travel agency discount",value:"TAD"}],p.removePassingPointsFromResults=!0,p.type=ne.Rail,p._bookRailFromLive=!1,p.cheapest=new t.BehaviorSubject({outboundCheapest:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},inboundCheapest:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},cheapestClassTicket:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}},cheapestClassTicketReturn:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}},cheapestClassTicketDual:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}}}),p.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.maxDate={year:l.default().add("month",6).year(),month:l.default().add("month",6).month(),day:l.default().add("month",6).date()},p.summary={},p._outbound_date=null,p._outbound_time=null,p._return_date=null,p._return_time=null;var m=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};return p.updateTempParams(p.searchService.makeRailQuery(m.tempParams)),m.originalUserSearch.transactionIdentifier=null,p._originalUserSearch=m.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){p.travellers=e;var t=p.helpers.selectedTravellers(e,ne.Rail);p.tempParams.noOfAdults=t.adults.length,p.tempParams.noOfChildren=t.children.length,p.travellers=e,p._isValid()})),d.changeUser.subscribe((function(e){p.updateAvaliableClasses()})),p._isValid(),p}return m(a,i),Object.defineProperty(a.prototype,"ticketTypes",{get:function(){return this._ticketTypes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedSection",{get:function(){return this._selectedSection},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedTicket",{get:function(){return this._selectedTicket},set:function(e){this._selectedTicket=e,this._selectedTicket?this._selectedSummary=this._findSummary(this._selectedTicket.journey,this.summary.outbound||[]):this._selectedSummary=null},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedInboundTicket",{get:function(){return this._selectedInboundTicket},set:function(e){var t=this;this._selectedInboundTicket=e,this._selectedInboundTicket?this._selectedInboundSummary=this.summary.return.find((function(e){return e.journeyHash===t._selectedTicket.journey.journeyHash})):this._selectedSummary=null},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"transactionIdentifier",{get:function(){return this.tempParams.transactionIdentifier},set:function(e){this.tempParams.transactionIdentifier=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"bookRailFromLive",{get:function(){return this._bookRailFromLive},set:function(e){this._bookRailFromLive=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"openReturn",{get:function(){return this.tempParams.chosenSearchType===te.OpenReturnJourney},set:function(e){this.tempParams.chosenSearchType=e?te.OpenReturnJourney:te.ReturnJourney,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfAdults",{get:function(){return this.tempParams.noOfAdults},set:function(e){this.tempParams.noOfAdults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfChildren",{get:function(){return this.tempParams.noOfChildren},set:function(e){this.tempParams.noOfChildren=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingTo",{get:function(){return this.tempParams.travellingTo},set:function(e){var t;this.tempParams.travellingTo=e,this._travellingTo="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?this._travellingTo=e.railstation.id:(null==e?void 0:e.id)&&(this._travellingTo=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingFrom",{get:function(){return this.tempParams.travellingFrom},set:function(e){var t;this.tempParams.travellingFrom=e,this._travellingFrom="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?this._travellingFrom=e.railstation.id:(null==e?void 0:e.id)&&(this._travellingFrom=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenRailClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"extraTime",{get:function(){return this.tempParams.extraTime},set:function(e){this.tempParams.extraTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"via",{get:function(){return this.tempParams.via},set:function(e){this.tempParams.via=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"viaLocation",{get:function(){return this.tempParams.viaLocation},set:function(e){var t;this.tempParams.viaLocation=e,this._viaLocation="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)&&(this._viaLocation=e.railstation.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outBoundDateTime",{get:function(){return this.tempParams.outBoundDateTime},set:function(e){this.tempParams.outBoundDateTime=e,e&&e.isValid()&&(this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this.minInboundDate={year:e.year(),month:e.month()+1,day:e.date()},this.outBoundDateTime&&this.inBoundDateTime&&this.outBoundDateTime.isAfter(this.inBoundDateTime)&&(this.inBoundDateTime=this.inBoundDateTime.set("date",e.date()).set("month",e.month()).set("year",e.year())),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outboundCriteria",{get:function(){return this.tempParams.outboundCriteria},set:function(e){this.tempParams.outboundCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inBoundDateTime",{get:function(){return this.tempParams.inBoundDateTime},set:function(e){this.tempParams.inBoundDateTime=e,e&&e.isValid()&&(this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outbound_date",{get:function(){return this._outbound_date},set:function(e){this._outbound_date=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outbound_time",{get:function(){return this._outbound_time},set:function(e){this._outbound_time=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"return_date",{get:function(){return this._return_date},set:function(e){this._return_date=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"return_time",{get:function(){return this._return_time},set:function(e){this._return_time=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnCriteria",{get:function(){return this.tempParams.returnCriteria},set:function(e){this.tempParams.returnCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carnetTicket",{get:function(){return this.tempParams.carnetTicket},set:function(e){this.tempParams.carnetTicket=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"disableAutoDiscounts",{get:function(){return this.tempParams.disableAutoDiscounts},set:function(e){this.tempParams.disableAutoDiscounts=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"prioritiseByPrice",{get:function(){return this.tempParams.prioritiseByPrice},set:function(e){this.tempParams.prioritiseByPrice=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"applyRailcards",{get:function(){return this.tempParams.applyRailcards},set:function(e){e||(this.railCards=[]),this.tempParams.applyRailcards=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"railCards",{get:function(){return this.tempParams.railCards},set:function(e){this.tempParams.railCards=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(48).fill(0).map((function(e,t){return{value:Math.floor(t/2).toString().padStart(2,"0")+(t%2*30).toString().padStart(2,"0"),display:Math.floor(t/2).toString().padStart(2,"0")+":"+(t%2*30).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),a.prototype.getAirportExpressStations=function(){return this.airportExpressStations},Object.defineProperty(a.prototype,"airportExpressStation",{get:function(){return this.tempParams.airportExpressStation},set:function(e){this.tempParams.airportExpressStation=e,this._setAirportExpressStations(),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isAirportExpress",{get:function(){return this.tempParams.isAirportExpress},set:function(e){this.tempParams.isAirportExpress=e,this._isValid()},enumerable:!1,configurable:!0}),a.prototype.setAirportExpressStationIds=function(e){var t=e.departureLocationId,r=e.arrivalLocationId;t&&r&&(this._travellingFrom=t,this._travellingTo=r,this._isValid())},a.prototype._findSummary=function(e,t){return t.find((function(t){return t.journeyHash===e.journeyHash}))},a.prototype.updateLowestPrice=function(e){return this.findCheapestTicket()},a.prototype.processResults=function(e){var t=this;this.updateAvaliableClasses(),this.transactionIdentifier=null;var r=function(e){var t;return Object.assign(Object.assign({},e),{type:null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.toLowerCase(),selected:!1,selectable:!0})},i=function(e){var t;return Object.assign(Object.assign({},e),{type:null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.toLowerCase(),selected:!1,selectable:!0})},a=function(e){return t.helpers.clone(e).sort((function(e,t){var r=l.default(e.departDateTime),i=l.default(t.departDateTime);return r.isBefore(i)?-1:r.isAfter(i)?1:0})).map((function(e){var a=function(e,t){return e.price-t.price},n=(e.dualSingleJourneyFares||[]).sort(a).map(r),o=(e.openReturnJourneyFares||[]).sort(a).map(r),s=(e.returnJourneyFares||[]).sort(a).map(r),l=(e.singleJourneyFares||[]).sort(a).map(r),u=(e.splitFares||[]).sort((function(e,t){return e.price-t.price})).map(i),c=n.map(r),d=o.map(r),h=s.map(r),p=l.map(r),m=u.map(i);return Object.assign(Object.assign({},e),{dualSingleJourneyFares:t.helpers.arrayToObjectArray(c,["type",["terms.ticketTypeCode","price"]]),openReturnJourneyFares:t.helpers.arrayToObjectArray(d,["type",["terms.ticketTypeCode","price"]]),returnJourneyFares:t.helpers.arrayToObjectArray(h,["type",["terms.ticketTypeCode","price"]]),singleJourneyFares:t.helpers.arrayToObjectArray(p,["type",["terms.ticketTypeCode","price"]]),splitFares:t.helpers.arrayToObjectArray(m,["type",["terms.ticketTypeCode","price"]])})}))};return e.map((function(e){t.summary=e.summary;var r=a(e.outbound||[]),i=a(e.return||[]),n=t.makeFareNames([r||[],i||[]]),o=function(e,r){var i=n[r],a=i.getTicketTypes();return Object.entries(a).reduce((function(r,a){var n=S(a,2),o=n[0];n[1];return r[o]=i.workoutIndexes(o).map((function(r){return t.helpers.fieldFromObject(e,r)})),r}),{})},s=function(e){return Object.assign(Object.assign({},e),{returnJourneyFares:o(e.returnJourneyFares,"returnJourneyFares"),openReturnJourneyFares:o(e.openReturnJourneyFares,"openReturnJourneyFares"),dualSingleJourneyFares:o(e.dualSingleJourneyFares,"dualSingleJourneyFares"),singleJourneyFares:o(e.singleJourneyFares,"singleJourneyFares"),splitFares:o(e.splitFares,"splitFares")})},l=r.map(s),u=i.map(s),c=t.updatePrices(l,{cheapestTickets:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},cheapestClassTicket:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}},outboundClassTicket:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}}},!1),d=t.updatePrices(u,{cheapestTickets:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},cheapestClassTicket:c.cheapestClassTicket,outboundClassTicket:c.cheapestClassTicket},!0);return t.cheapest.next({outboundCheapest:c.cheapestTickets,inboundCheapest:d.cheapestTickets,cheapestClassTicket:d.cheapestClassTicket,cheapestClassTicketReturn:c.outboundClassTicket,cheapestClassTicketDual:d.outboundClassTicket}),Object.assign(Object.assign({},e),{outbound:l,return:u})}))},a.prototype.makeFareNames=function(e){var t=this;return["returnJourneyFares","openReturnJourneyFares","dualSingleJourneyFares","singleJourneyFares","splitFares"].reduce((function(r,i){return r[i]=t._makeFareNames(e,i),r}),{returnJourneyFares:new wt,openReturnJourneyFares:new wt,dualSingleJourneyFares:new wt,singleJourneyFares:new wt,splitFares:new wt})},a.prototype._makeFareNames=function(e,t){return s.default.flatten(e||[]).reduce((function(e,r){return r?(Object.entries(r[t]||{}).forEach((function(t){var r=S(t,2),i=r[0],a=r[1];Object.entries(a).forEach((function(t){var r=S(t,2),a=r[0],n=r[1];e.addFares(i,a,n)}))})),e.nextJourney(),e):e}),new wt)},a.prototype.updatePrices=function(t,r,i){var a=function(e,t,r){if(!t||0===t.length)return e;var i=t[0].price;return e.price>0&&e.price<i?e:{price:i,journey:r,fare:t[0]}};return t.reduce((function(t,r){var n,o,l,u,c=function(e,t){return e.price-t.price},d=s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),h=s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return e&&e.class===ee.First})),p=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),m=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===ee.First})),f=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),v=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===ee.First})),y=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),b=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===ee.First})),g=C(p,f,y),S=C(d,g).sort(c),A=C(m,v,b),T=C(h,A).sort(c);if(i||(g.sort(c),T.sort(c)),t.cheapestTickets.dualSingleJourneyFares=a(t.cheapestTickets.dualSingleJourneyFares,s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.openReturnJourneyFares=a(t.cheapestTickets.openReturnJourneyFares,s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.returnJourneyFares=a(t.cheapestTickets.returnJourneyFares,s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return!!e})),r),i){if(t.cheapestClassTicket.inboundStandardClassFare=a(t.cheapestClassTicket.inboundStandardClassFare,S,r),t.cheapestClassTicket.inboundFirstClassFare=a(t.cheapestClassTicket.inboundFirstClassFare,T,r),t.outboundClassTicket.inboundStandardClassFare=a(t.outboundClassTicket.inboundStandardClassFare,g,r),t.outboundClassTicket.inboundFirstClassFare=a(t.outboundClassTicket.inboundFirstClassFare,A,r),(null===(o=null===(n=t.cheapestClassTicket.standardClassFare)||void 0===n?void 0:n.fare)||void 0===o?void 0:o.singleOrReturn)===e.RailJourneyFareType.Single){var D=a(t.cheapestClassTicket.inboundStandardClassFare,d,r);t.cheapestClassTicket.standardClassFare.price>t.outboundClassTicket.standardClassFare.price?t.cheapestClassTicket.standardClassFare=t.outboundClassTicket.standardClassFare:D.price>t.cheapestClassTicket.inboundStandardClassFare.price&&(t.cheapestClassTicket.inboundStandardClassFare=D)}if((null===(u=null===(l=t.cheapestClassTicket.firstClassFare)||void 0===l?void 0:l.fare)||void 0===u?void 0:u.singleOrReturn)===e.RailJourneyFareType.Single){D=a(t.cheapestClassTicket.inboundFirstClassFare,h,r);t.cheapestClassTicket.firstClassFare.price>t.outboundClassTicket.firstClassFare.price?t.cheapestClassTicket.firstClassFare=t.outboundClassTicket.firstClassFare:D.price>t.cheapestClassTicket.inboundFirstClassFare.price&&(t.cheapestClassTicket.inboundFirstClassFare=D)}}else t.cheapestClassTicket.standardClassFare=a(t.cheapestClassTicket.standardClassFare,S,r),t.cheapestClassTicket.firstClassFare=a(t.cheapestClassTicket.firstClassFare,T,r),t.outboundClassTicket.standardClassFare=a(t.outboundClassTicket.standardClassFare,g,r),t.outboundClassTicket.firstClassFare=a(t.outboundClassTicket.firstClassFare,A,r);return t}),r)},a.prototype.selectTicket=function(t,r,i,a,n,o){var s,u,c,h,p,m,f,v;return void 0===o&&(o=!1),y(this,void 0,void 0,(function(){var y,g,S,C,A,T,D,P,F;return b(this,(function(b){switch(b.label){case 0:return i.selectable?this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===i.fareHash?(this.selectedTicket=null,this._applyFilter(),[2]):(y=this.selectedTicket,this.alternativeWellbeing=this.userService.getUserFavoriteObject(dt.AlternativeRailItineraryEnabled),y&&!o&&this.alternativeWellbeing?(g=y.journey,S=r,C=l.default(g.arriveDateTime).diff(l.default(g.departDateTime),"hours",!0),A=l.default(S.arriveDateTime).diff(l.default(S.departDateTime),"hours",!0),T=l.default(S.departDateTime).diff(l.default(g.departDateTime),"day"),[4,this.checkAlternativeHours(C+A,T)]):[3,2]):[2];case 1:return b.sent()&&this.selectTicket(t,r,i,a,n,!0),[3,31];case 2:switch(D=this.originalUserSearch,n){case"singleJourneyFares":return[3,3];case"returnJourneyFares":return[3,7];case"dualSingleJourneyFares":return[3,13];case"openReturnJourneyFares":return[3,19];case"splitFares":return[3,23]}return[3,29];case 3:return(null===(s=null==r?void 0:r.ticketExtras)||void 0===s?void 0:s.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:r})]:[3,5];case 4:P=b.sent(),r.ticketExtras=P||[],b.label=5;case 5:return[4,this.addSingleJourneyToBasket(a,D,r,i)];case 6:return b.sent(),this.selectedTicket=null,[3,30];case 7:return t!==e.RailDirection.Outbound?[3,8]:(this.selectedTicket={journey:r,fare:i},[3,12]);case 8:return this.selectedTicket?(null===(c=null===(u=this.selectedTicket.journey)||void 0===u?void 0:u.ticketExtras)||void 0===c?void 0:c.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,10]:[3,12];case 9:P=b.sent(),y.journey.ticketExtras=P||[],b.label=10;case 10:return[4,this.addReturnJourneyToBasket(a,D,this.selectedTicket.journey,r,this.selectedTicket.fare,i)];case 11:b.sent(),this.selectedTicket=null,b.label=12;case 12:return[3,30];case 13:return t!==e.RailDirection.Outbound?[3,14]:(this.selectedTicket={journey:r,fare:i},[3,18]);case 14:return this.selectedTicket?(null===(p=null===(h=this.selectedTicket.journey)||void 0===h?void 0:h.ticketExtras)||void 0===p?void 0:p.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,16]:[3,18];case 15:P=b.sent(),console.log(P),y.journey.ticketExtras=P||[],b.label=16;case 16:return[4,this.addDualSingleToBasket(a,D,this.selectedTicket.journey,r,this.selectedTicket.fare,i)];case 17:b.sent(),this.selectedTicket=null,b.label=18;case 18:return[3,30];case 19:return(null===(m=null==r?void 0:r.ticketExtras)||void 0===m?void 0:m.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:r})]:[3,21];case 20:P=b.sent(),console.log(P),r.ticketExtras=P||[],b.label=21;case 21:return[4,this.addOpenReturnToBasket(a,D,r,i)];case 22:return b.sent(),this.selectedTicket=null,[3,30];case 23:return t!==e.RailDirection.Outbound?[3,24]:(this.selectedTicket={journey:r,fare:i},[3,28]);case 24:return this.selectedTicket?(null===(v=null===(f=this.selectedTicket.journey)||void 0===f?void 0:f.ticketExtras)||void 0===v?void 0:v.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,26]:[3,28];case 25:P=b.sent(),console.log(P),y.journey.ticketExtras=P||[],b.label=26;case 26:return F=(Math.random()+1).toString(36).substring(3),[4,this.addSplitJourneyToBasket(a,D,this.selectedTicket.journey,r,this.selectedTicket.fare,i,F)];case 27:b.sent(),this.selectedTicket=null,b.label=28;case 28:return[3,30];case 29:n,b.label=30;case 30:this._applyFilter(),b.label=31;case 31:return[2]}}))}))},a.prototype.checkAlternativeHours=function(e,t){return y(this,void 0,void 0,(function(){var r;return b(this,(function(i){switch(i.label){case 0:return r=this.searchService.searches[ne.Rail],this.alternativeWellbeing.enable&&Number(this.alternativeWellbeing.hours)>0&&r.chosenSearchType===te.ReturnJourney&&e>=Number(this.alternativeWellbeing.hours)&&0===t&&this.noOfAdults+this.noOfChildren<=4?[4,this.modalService.open(d.AlternativeRailModalComponent)]:[3,2];case 1:return i.sent()?(this.selectedTicket=null,this._applyFilter(),this.performAlternativeRailAndHotelSearch(),[2,!1]):[2,!0];case 2:return[2,!0];case 3:return[2]}}))}))},a.prototype.performAlternativeRailAndHotelSearch=function(){console.log("+++ Creating the Alternative Search Params +++");var t=this.searchService.search_objects[ne.Hotel],r=this.searchService.search_objects[ne.Rail];t.chosen=!0,r.chosen=!0,t.priority=r.priority;var i=this.searchService.searches[ne.Hotel],a=this.searchService.searches[ne.Rail];a.inBoundDateTime=this.searchService.searches[ne.Rail].inBoundDateTime.add(1,"day"),i.location_type_select=e.LocationTypes.TrainStation,i.location=a.travellingTo,i.trainsStation=a.travellingTo.railstation,i.checkin_date=a.outBoundDateTime,i.checkout_date=a.inBoundDateTime,i.no_of_occupants=a.noOfAdults+a.noOfChildren,i.no_of_rooms=1,i.distance=10,this.searchService.startSearches(e.WellbeingEnum.WELLBEING)},a.prototype.selectTicketNoAdd=function(t,r,i,a,n){var o;return y(this,void 0,void 0,(function(){var a,s;return b(this,(function(l){if(!i.selectable)return console.warn("+++ Rail fare is not selectable +++"),[2];if(a=this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===i.fareHash,s=t===e.RailDirection.Inbound&&(this.selectedInboundTicket&&this.selectedInboundTicket.journey.journeyHash===r.journeyHash&&this.selectedInboundTicket.fare.fareHash===i.fareHash),a||t===e.RailDirection.Inbound&&s)return console.warn("+++ Journey and fare are already selected - breaking out +++"),this._selectedInboundTicket=null,a&&(this.selectedTicket=null,this.applyFilter()),[2];switch((this._selectedSection&&this._selectedSection!==n||"returnJourneyFares"===this._selectedSection&&(null===(o=this.selectedTicket)||void 0===o?void 0:o.fare.identifiers.fareIdentifier)!==i.identifiers.fareIdentifier)&&(this.selectedTicket=null,this._selectedInboundTicket=null),this._selectedSection=n,this.originalUserSearch,n){case"singleJourneyFares":this.selectedTicket={journey:r,fare:i};break;case"returnJourneyFares":case"dualSingleJourneyFares":t===e.RailDirection.Outbound?this.selectedTicket={journey:r,fare:i}:this.selectedTicket&&(this.selectedInboundTicket={journey:r,fare:i});break;case"openReturnJourneyFares":this.selectedTicket={journey:r,fare:i};break;default:n}return this.applyFilter(),[2]}))}))},a.prototype.addToBasket=function(t,r,i,a,n,o){return y(this,void 0,void 0,(function(){return b(this,(function(s){switch(s.label){case 0:return r.chosenSearchType!==te.SingleJourney?[3,2]:[4,this.addSingleJourneyToBasket(t,r,i,a)];case 1:return s.sent(),[3,7];case 2:return"openReturnJourneyFares"!==this.selectedSection?[3,4]:[4,this.addOpenReturnToBasket(t,r,i,a)];case 3:return s.sent(),[3,7];case 4:return"Return"!==a.singleOrReturn?[3,5]:[2,this.addReturnJourneyToBasket(t,r,i,o,a,n)];case 5:return[4,this.addDualSingleToBasket(t,r,i,o,a,n)];case 6:s.sent(),s.label=7;case 7:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.addOpenReturnToBasket=function(e,t,r,i){return y(this,void 0,void 0,(function(){return b(this,(function(a){return[2,this.addSingleJourneyToBasket(e,t,r,i)]}))}))},a.prototype.addDualSingleToBasket=function(t,r,i,a,n,o){var s,l;return y(this,void 0,void 0,(function(){var u,c,d,h,p,m,f,v,y,g,S;return b(this,(function(b){switch(b.label){case 0:return u=this.getSearchQuery(r),(null===(s=null==a?void 0:a.ticketExtras)||void 0===s?void 0:s.length)&&(c=this.createTicketExtrasObject(a.ticketExtras[0])),(null===(l=null==i?void 0:i.ticketExtras)||void 0===l?void 0:l.length)&&(d=this.createTicketExtrasObject(i.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return h=b.sent(),p=null==h?void 0:h.subject.value,m=this.getTermsAndCond(n,i,a),p?(f=this.getLegsFromRailJourneyOption(i),v=this.getLegsFromRailJourneyOption(a),(y=this.findCheapestTicket()).amount=+y.amount.toFixed(2),g={basket:p.id,service:t,detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,price:n.price,legs:f}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:o.providerName,ticketDescription:o.type,legs:v}]},transactionIdentifier:n.identifiers.transactionIdentifier,outbound:{fareIdentifiers:[n.identifiers.fareIdentifier],journeyIdentifier:n.identifiers.journeyIdentifier,isDualSingleReturn:!0,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs),eTicket:!!n.eTicketAvailable},return:{fareIdentifiers:[o.identifiers.fareIdentifier],journeyIdentifier:o.identifiers.journeyIdentifier,isDualSingleReturn:!0,journeyLegs:this.removedScheduledPlatformFromCallingPoints(a.journeyLegs),eTicket:!!o.eTicketAvailable},termsAndCond:m},adults:u.adults,children:u.children,price:Number(Number(n.price+o.price).toFixed(2)),currency:n.currency,searchQuery:u,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:i.arriveDateTime,inboundDate:a.arriveDateTime,lowestPrice:y.amount!=Number(n.price+o.price)||y.currencyCode!=n.currency?y.amount:null,lowestPriceCurrency:y.amount!=Number(n.price+o.price)||y.currencyCode!=n.currency?y.currencyCode:null},c&&(g.detail.return.ticketExtras=c),d&&(g.detail.outbound.ticketExtras=d),[4,this.basketService.addToBasket(g,h,this.searchService,this.travellers,n.requiresReason||o.requiresReason)]):[3,3];case 2:return(S=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,S];case 3:return[2,e.DifferentInvokdedUserReasons.continue]}}))}))},a.prototype.findCheapestTicket=function(){var e;if(!this.fullResults.length)return{amount:0,currencyCode:"GBP"};try{var t,r,i,a;if(this.chosenSearchType==te.SingleJourney)return this.fullResults[0].outbound.forEach((function(e){Object.keys(e.singleJourneyFares).forEach((function(r){var i=e.singleJourneyFares[r].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];i&&(!t||t.price>i.price)&&(t=i)}))})),{amount:t.price,currencyCode:t.currency};if(this.fullResults[0].outbound.forEach((function(e){Object.keys(e.dualSingleJourneyFares).forEach((function(t){var i=e.dualSingleJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];i&&(!r||r.price>i.price)&&(r=i)})),Object.keys(e.returnJourneyFares).forEach((function(t){var r=e.returnJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];r&&(!i||i.price>r.price)&&(i=r)}))})),(null===(e=this.fullResults[0].return)||void 0===e?void 0:e.length)&&this.fullResults[0].return.forEach((function(e){Object.keys(e.dualSingleJourneyFares).forEach((function(t){var r=e.dualSingleJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];r&&(!a||a.price>r.price)&&(a=r)})),Object.keys(e.returnJourneyFares).forEach((function(t){var r=e.returnJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];r&&(!i||i.price>r.price)&&(i=r)}))})),i){if(a){if(r.price+a.price<i.price&&r.currency==a.currency)return{amount:r.price+a.price,currencyCode:r.currency}}else if((null==r?void 0:r.price)<i.price)return{amount:r.price,currencyCode:r.currency};return{amount:i.price,currencyCode:i.currency}}return a?{amount:r.price+a.price,currencyCode:r.currency}:{amount:r.price,currencyCode:r.currency}}catch(e){return console.error(e),{amount:0,currencyCode:"GBP"}}},a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeRailQuery()),this._isValid()},a.prototype._setAirportExpressStations=function(){var e=this.airportExpressStationsCodes[this.airportExpressStation];console.log("--- Parsed Station is :",e),e&&(this._travellingFrom=e.dep,this._travellingTo=e.arr)},a.prototype._isValid=function(){var e,t;if(this.doChecks){this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var r=l.default();this._travellingFrom||this.validationMessages.push("Please Enter a From Location."),this._travellingTo||this.validationMessages.push("Please Enter a To Location."),(null===(e=this.outBoundDateTime)||void 0===e?void 0:e.isBefore(r))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),this.chosenSearchType===te.ReturnJourney&&(null===(t=this.inBoundDateTime)||void 0===t?void 0:t.isSameOrBefore(this.outBoundDateTime))&&this.validationMessages.push("Return Date/Time must be after Departure Date/Time"),this.via&&(this.tempParams.viaLocation||this.validationMessages.push("Please enter a via location.")),this.tempParams.noOfAdults+this.tempParams.noOfChildren<1&&this.validationMessages.push("There must be at least 1 traveller"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)}},a.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery(this.tempParams);return this.tempParams.transactionIdentifier=null,this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.Railfetcher.fetchList(e))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Rail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(e){var t,r,i,a,n=e;return this.isAirportExpress&&(n.isAirportExpress=this.isAirportExpress),this.airportExpressStation&&(n.airportExpressStation=this.airportExpressStation),this.travellingFrom&&(n.travellingFrom=this.travellingFrom),this.travellingTo&&(n.travellingTo=this.travellingTo),this.viaLocation&&(n.viaLocation=this.viaLocation),n.outboundStationCode=null===(r=null===(t=this.travellingFrom)||void 0===t?void 0:t.railstation)||void 0===r?void 0:r.stationCode,n.inboundStationCode=null===(a=null===(i=this.travellingTo)||void 0===i?void 0:i.railstation)||void 0===a?void 0:a.stationCode,n},a.prototype.startRecentSearch=function(e){var t,r;if(this.chosenSearchType=e.searchArgs.journeyType,this.chosenSearchClass=e.searchArgs.class,this.extraTime=e.searchArgs.extraTimeToChange,this.isAirportExpress=e.searchArgs.isAirportExpress,this.airportExpressStation=e.searchArgs.airportExpressStation,this.outBoundDateTime=e.searchArgs.outboundDepartureDateTime?l.default(e.searchArgs.outboundDepartureDateTime):l.default(e.searchArgs.outboundArrivalDateTime),this.outboundCriteria=this.getCriteria(e.searchArgs.outboundDepartureDateTime,e.searchArgs.outboundArrivalDateTime),e.searchArgs.journeyType===te.ReturnJourney&&(this.inBoundDateTime=e.searchArgs.returnDepartureDateTime?l.default(e.searchArgs.returnDepartureDateTime):l.default(e.searchArgs.returnArrivalDateTime),this.returnCriteria=this.getCriteria(e.searchArgs.returnDepartureDateTime,e.searchArgs.returnArrivalDateTime)),this.applyRailcards=!!(null===(r=null===(t=e.searchArgs)||void 0===t?void 0:t.railCardQualifiers)||void 0===r?void 0:r.length),this.applyRailcards&&(this.railCards=e.searchArgs.railCardQualifiers),this.travellingTo=e.searchArgs.travellingTo,this.travellingFrom=e.searchArgs.travellingFrom,e.searchArgs.viaLocation&&(this.via=!0,this.viaLocation=e.searchArgs.viaLocation),e.searchArgs.isAirportExpress){var i={departureLocationId:e.searchArgs.departureLocationId,arrivalLocationId:e.searchArgs.arrivalLocationId};this.setAirportExpressStationIds(i)}e.searchArgs.journeyType===te.OpenReturnJourney&&(this.openReturn=!0),this.searchService.startSearches()},a.prototype._updateOutboundDateTime=function(){if(this._outbound_date&&this._outbound_time){var e=this.helpers.ngDateToMoment(this._outbound_date,this._outbound_time);this.outBoundDateTime=e.isValid()?e:null,this._isValid()}},a.prototype._updateReturnDateTime=function(){if(this._return_date&&this._return_time){var e=this.helpers.ngDateToMoment(this._return_date,this._return_time);this.inBoundDateTime=e.isValid()?e:null,this._isValid()}},a.prototype.getSearchQuery=function(t){var r,i,a,n,o,s,l;this.isAirportExpress&&this.openReturn&&(this.openReturn=!1);var u={countryCode:"GB",journeyType:t.chosenSearchType,adults:t.noOfAdults,arrivalLocationId:null===(i=null===(r=t.travellingTo)||void 0===r?void 0:r.railstation)||void 0===i?void 0:i.id,departureLocationId:null===(n=null===(a=t.travellingFrom)||void 0===a?void 0:a.railstation)||void 0===n?void 0:n.id,children:t.noOfChildren,class:t.chosenSearchClass,extraTimeToChange:t.extraTime,outboundArrivalDateTime:this.helpers.formatGraphQLDateTime(t.outBoundDateTime),outboundDepartureDateTime:this.helpers.formatGraphQLDateTime(t.outBoundDateTime),returnArrivalDateTime:this.helpers.formatGraphQLDateTime(t.inBoundDateTime),returnDepartureDateTime:this.helpers.formatGraphQLDateTime(t.inBoundDateTime),viaLocationId:null===(s=null===(o=t.viaLocation)||void 0===o?void 0:o.railstation)||void 0===s?void 0:s.id,railCardQualifiers:null===(l=t.railCards)||void 0===l?void 0:l.map((function(e){return(null==e?void 0:e.code)||""})),transactionIdentifier:t.transactionIdentifier};switch(0===t.noOfChildren&&(u.children=null),""===this._viaLocation&&(u.viaLocationId=null),t.outboundCriteria){case e.RailSearchCriteria.Depart:u.outboundArrivalDateTime=null;break;case e.RailSearchCriteria.Arrive:u.outboundDepartureDateTime=null;break;default:console.warn("+++ Unknown Criteria: "+this.tempParams.outboundCriteria+" +++")}switch(t.returnCriteria){case e.RailSearchCriteria.Depart:u.returnArrivalDateTime=null;break;case e.RailSearchCriteria.Arrive:u.returnDepartureDateTime=null;break;default:console.warn("+++ Unknown Criteria: "+this.tempParams.returnCriteria+" +++")}switch(t.chosenSearchType){case te.SingleJourney:case te.OpenReturnJourney:u.returnDepartureDateTime=null,u.returnArrivalDateTime=null}return t.isAirportExpress&&(u.arrivalLocationId=this._travellingTo,u.departureLocationId=this._travellingFrom),this.helpers.removeNulls(u)},a.prototype.getCriteria=function(t,r){return t?e.RailSearchCriteria.Depart:r?e.RailSearchCriteria.Arrive:null},a.prototype.updateFromPreviousSearches=function(e){},a.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.chosenSearchType=r.journeyType,this.chosenSearchClass=r.class,this.extraTime=r.extraTimeToChange,this.outBoundDateTime=r.outboundDepartureDateTime?l.default(r.outboundDepartureDateTime):l.default(r.outboundArrivalDateTime),this.outboundCriteria=this.getCriteria(r.outboundDepartureDateTime,r.outboundArrivalDateTime),r.journeyType===te.ReturnJourney&&(this.inBoundDateTime=r.returnDepartureDateTime?l.default(r.returnDepartureDateTime):l.default(r.returnArrivalDateTime),this.returnCriteria=this.getCriteria(r.returnDepartureDateTime,r.returnArrivalDateTime)),r.journeyType===te.OpenReturnJourney&&(this.openReturn=!0),r.departureLocationId&&this.searchService.getRailStationById(r.departureLocationId).subscribe((function(e){t.travellingFrom={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),r.arrivalLocationId&&this.searchService.getRailStationById(r.arrivalLocationId).subscribe((function(e){t.travellingTo={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),r.viaLocationId?(this.via=!0,this.searchService.getRailStationById(r.viaLocationId).subscribe((function(e){t.viaLocation={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}}))):this.viaLocation=null,e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},a.prototype.getRailStation=function(e,i){return 3===e.length?(null==i||i.next(!0),this.getRailStationFetcher.fetchList({code:e}).pipe(r.tap((function(){return null==i?void 0:i.next(!1)})),r.take(1))):t.of()},a.prototype.getSelectedRailJourneyFare=function(){return null},a.prototype.getLegsFromRailJourneyOption=function(e){var t=[];return(null==e?void 0:e.journeyLegs.length)&&(t=e.journeyLegs.map((function(e){return{operator:e.operator,departureDateTime:e.departDateTime,departureStationName:e.depart,arrivalDateTime:e.arriveDateTime,arrivalStationName:e.arrive}}))),t},a.prototype.getLegsFromRailJourneyOptionSplit=function(e,t,r,i){var a=[];return(null==e?void 0:e.journeyLegs.length)&&(a=e.journeyLegs.map((function(e){var a={operator:e.operator,departureDateTime:e.departDateTime,departureStationName:e.depart,arrivalDateTime:e.arriveDateTime,arrivalStationName:e.arrive},n=e.callingPoints.find((function(e){return e.stationCode===t}));return n?0===i?r?(a.arrivalDateTime=n.arrivalDateTime,a.arrivalStationName=n.stationName):(a.departureDateTime=n.departureDateTime,a.departureStationName=n.stationName):r?(a.departureDateTime=n.departureDateTime,a.departureStationName=n.stationName):(a.arrivalDateTime=n.arrivalDateTime,a.arrivalStationName=n.stationName):(a.arrivalDateTime=e.callingPoints[e.callingPoints.length-1].arrivalDateTime,a.arrivalStationName=e.callingPoints[e.callingPoints.length-1].stationName,a.departureDateTime=e.callingPoints[0].departureDateTime,a.departureStationName=e.callingPoints[0].stationName),a}))),a},a.prototype.addSingleJourneyToBasket=function(t,r,i,a){var n;return y(this,void 0,void 0,(function(){var o,s,l,u,c,d,h,p,m;return b(this,(function(f){switch(f.label){case 0:return o=this.getSearchQuery(r),(null===(n=null==i?void 0:i.ticketExtras)||void 0===n?void 0:n.length)&&(s=this.createTicketExtrasObject(i.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return l=f.sent(),u=null==l?void 0:l.subject.value,c=this.getTermsAndCond(a,i),u?(d=this.getLegsFromRailJourneyOption(i),(h=this.findCheapestTicket()).amount=+h.amount.toFixed(2),p={basket:u.id,service:t.toString(),detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.from,supplierTickets:[{supplierName:a.providerName,ticketDescription:a.type,price:a.price,legs:d}]},transactionIdentifier:a.identifiers.transactionIdentifier,outbound:{eTicket:!!a.eTicketAvailable,fareIdentifiers:[a.identifiers.fareIdentifier],journeyIdentifier:a.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs)},termsAndCond:c},adults:o.adults,children:o.children,price:a.price,currency:a.currency,searchQuery:o,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:i.departDateTime,lowestPrice:h.amount!=Number(a.price)||h.currencyCode!=a.currency?h.amount:null,lowestPriceCurrency:h.amount!=Number(a.price)||h.currencyCode!=a.currency?h.currencyCode:null},s&&(p.detail.outbound.ticketExtras=s),[4,this.basketService.addToBasket(p,l,this.searchService,this.travellers,a.requiresReason)]):[3,3];case 2:return(m=f.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,m];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.addReturnJourneyToBasket=function(t,r,i,a,n,o){var s;return y(this,void 0,void 0,(function(){var l,u,c,d,h,p,m,f,v,y;return b(this,(function(b){switch(b.label){case 0:return l=this.getSearchQuery(r),(null===(s=null==i?void 0:i.ticketExtras)||void 0===s?void 0:s.length)&&(u=this.createTicketExtrasObject(i.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return c=b.sent(),d=null==c?void 0:c.subject.value,h=this.getTermsAndCond(n,i,a),d?(p=this.getLegsFromRailJourneyOption(i),m=this.getLegsFromRailJourneyOption(a),(f=this.findCheapestTicket()).amount=+f.amount.toFixed(2),v={basket:d.id,service:t,detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,price:n.price,legs:p}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:o.providerName,ticketDescription:o.type,legs:m}]},transactionIdentifier:n.identifiers.transactionIdentifier,outbound:{eTicket:!!n.eTicketAvailable,fareIdentifiers:[n.identifiers.fareIdentifier],journeyIdentifier:n.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs)},return:{eTicket:!!o.eTicketAvailable,fareIdentifiers:[o.identifiers.fareIdentifier],journeyIdentifier:o.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(a.journeyLegs)},termsAndCond:h},adults:l.adults,children:l.children,price:n.price,currency:n.currency,searchQuery:l,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:i.arriveDateTime,inboundDate:a.arriveDateTime,lowestPrice:f.amount!=Number(n.price)||f.currencyCode!=n.currency?f.amount:null,lowestPriceCurrency:f.amount!=Number(n.price)||f.currencyCode!=n.currency?f.currencyCode:null},u&&(v.detail.outbound.ticketExtras=u),[4,this.basketService.addToBasket(v,c,this.searchService,this.travellers,n.requiresReason||o.requiresReason)]):[3,3];case 2:return(y=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,y];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.addSplitJourneyToBasket=function(t,r,i,a,n,o,s){return y(this,void 0,void 0,(function(){var l,u,c,d,h,p,m,f,v,C,A,T,D,P,F=this;return b(this,(function(k){switch(k.label){case 0:return l=this.getSearchQuery(r),[4,this.basketService.getDefaultBasket()];case 1:if(u=k.sent(),c=null==u?void 0:u.subject.value,d=this.getTermsAndCond(n,i,a),h=function(r,h){return y(F,void 0,void 0,(function(){var p,m,f,v,y,g,S,C;return b(this,(function(b){switch(b.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return u=b.sent(),p=r.outboundSplit,m=r.inboundSplit,f=p.split,v=this.getLegsFromRailJourneyOptionSplit(i,f,!0,h),y=this.getLegsFromRailJourneyOptionSplit(a,f,!1,h),(g=this.findCheapestTicket()).amount=+g.amount.toFixed(2),S={basket:c.id,service:t,detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:v[y.length-1].arrivalDateTime,arrivalStationName:v[y.length-1].arrivalStationName,departureDateTime:v[0].departureDateTime,departureStationName:v[0].departureStationName,splitID:s,supplierTickets:[{supplierName:p.providerName,ticketDescription:p.type,price:p.price,legs:v}]},inwardDetail:{arrivalDateTime:y[y.length-1].arrivalDateTime,arrivalStationName:y[y.length-1].arrivalStationName,departureDateTime:y[0].departureDateTime,departureStationName:y[0].departureStationName,splitID:s,supplierTickets:[{supplierName:m.providerName,ticketDescription:m.type,legs:y}]},transactionIdentifier:p.identifiers.transactionIdentifier,outbound:{eTicket:!!p.eTicketAvailable,fareIdentifiers:[p.identifiers.fareIdentifier],journeyIdentifier:p.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPointsAndSplits(i.journeyLegs,v,f,h,!0)},return:{eTicket:!!m.eTicketAvailable,fareIdentifiers:[m.identifiers.fareIdentifier],journeyIdentifier:m.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPointsAndSplits(a.journeyLegs,y,f,h,!1)},termsAndCond:d},adults:l.adults,children:l.children,price:+p.price.toFixed(2),currency:p.currency,searchQuery:l,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:v[0].arrivalDateTime,inboundDate:y[0].arriveDateTime,lowestPrice:g.amount!=Number(p.price)||g.currencyCode!=p.currency?+g.amount.toFixed(2):null,lowestPriceCurrency:g.amount!=Number(p.price)||g.currencyCode!=p.currency?g.currencyCode:null},[4,this.basketService.addToBasket(S,u,this.searchService,this.travellers,n.requiresReason||o.requiresReason,!!h)];case 2:return(C=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,C]}}))}))},!c)return[3,10];p=[{outboundSplit:n.journey0,inboundSplit:o.journey0},{outboundSplit:n.journey1,inboundSplit:o.journey1}],k.label=2;case 2:k.trys.push([2,7,8,9]),m=g(p.entries()),f=m.next(),k.label=3;case 3:return f.done?[3,6]:(v=S(f.value,2),C=v[0],A=v[1],[4,h(A,C)]);case 4:k.sent(),k.label=5;case 5:return f=m.next(),[3,3];case 6:return[3,9];case 7:return T=k.sent(),D={error:T},[3,9];case 8:try{f&&!f.done&&(P=m.return)&&P.call(m)}finally{if(D)throw D.error}return[7];case 9:return[2,e.DifferentInvokdedUserReasons.cancel];case 10:return[2]}}))}))},a.prototype.removedScheduledPlatformFromCallingPoints=function(e){for(var t=0;t<e.length;t++)for(var r=e[t],i=0;i<r.callingPoints.length;i++){delete r.callingPoints[i].scheduledPlatform}return e},a.prototype.removedScheduledPlatformFromCallingPointsAndSplits=function(e,t,r,i,a){for(var n=JSON.parse(JSON.stringify(e)),o=function(e){var o=t[e],s=n[e];s.arriveDateTime=o.arrivalDateTime,s.departDateTime=o.departureDateTime,s.arrive=o.arrivalStationName,s.depart=o.departureStationName;for(var l=s.callingPoints.findIndex((function(e){return e.stationCode===r})),u=0;u<s.callingPoints.length;u++){delete s.callingPoints[u].scheduledPlatform}s.callingPoints=i?a?s.callingPoints.filter((function(e,t){return t>=l})):s.callingPoints.filter((function(e,t){return t<=l})):a?s.callingPoints.filter((function(e,t){return t<=l})):s.callingPoints.filter((function(e,t){return t>=l}))},s=0;s<n.length;s++)o(s);return n},a.prototype.createTicketExtrasObject=function(e){var t=this.noOfChildren*(null==e?void 0:e.childAmount)+this.noOfAdults*e.adultAmount;return[{type:e.identifiers.type,location:e.identifiers.location,date:e.identifiers.date,price:t}]},a.prototype.calculateTimeDifferenceInMins=function(e){return this.helpers.getTimeDifference(e.arriveDateTime,e.departDateTime).toString()},a.prototype.ticketIsAnETicket=function(){return null},a.prototype.applyFilter=function(){this._applyFilter()},a.prototype._applyFilter=function(){var t=this,r=function(e,r){var i=t._findSummary(r,t.summary.return);return t._selectedSummary?function(r){return r.map((function(r){var a,n,o,s;if(!r)return null;var l=t._selectedSummary[e];return Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),[null===(a=null==l?void 0:l[t.selectedTicket.fare.fareHash])||void 0===a?void 0:a.ruleDataWhenSelectedWith[r.fareHash],i?null===(n=i[e][r.fareHash])||void 0===n?void 0:n.ruleDataWhenSelectedAlone:null])),{selected:r.fareHash===t.selectedTicket.fare.fareHash,selectable:!!t._selectedSummary[e]&&!!(null===(s=null===(o=t._selectedSummary[e][t.selectedTicket.fare.fareHash])||void 0===o?void 0:o.allowedWith)||void 0===s?void 0:s.includes(r.fareHash))})}))}:function(r){return r.map((function(r){return r?Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),i?[i[e][r.fareHash].ruleDataWhenSelectedAlone]:[])),{selected:!1,selectable:!0}):null}))}},i=function(e,r,i){return function(a){var n=t._findSummary(r,t.summary[i]);return a.map((function(r){return r?t.helpers.addRailActionRules(Object.assign(Object.assign({},r),{selected:t.selectedTicket&&r.fareHash===t.selectedTicket.fare.fareHash}),n?[n[e][r.fareHash].ruleDataWhenSelectedAlone]:[]):null}))}};this.results.next(this.helpers.clone(this.fullResults).reduce((function(a,n){var o=Object.assign(Object.assign({},n),{outbound:(n.outbound||[]).map((function(r){return Object.assign(Object.assign({},r),{dualSingleJourneyFares:t.helpers.map(r.dualSingleJourneyFares||{},i("dualSingleJourneyFares",r,e.RailDirection.Outbound)),singleJourneyFares:t.helpers.map(r.singleJourneyFares||{},i("singleJourneyFares",r,e.RailDirection.Outbound)),returnJourneyFares:t.helpers.map(r.returnJourneyFares||{},i("returnJourneyFares",r,e.RailDirection.Outbound)),openReturnJourneyFares:t.helpers.map(r.openReturnJourneyFares||{},i("openReturnJourneyFares",r,e.RailDirection.Outbound)),splitFares:t.helpers.map(r.splitFares||{},i("splitFares",r,e.RailDirection.Outbound))})})),return:(n.return||[]).map((function(e){return Object.assign(Object.assign({},e),{returnJourneyFares:t.helpers.map(e.returnJourneyFares||{},r("returnJourneyFares",e)),dualSingleJourneyFares:t.helpers.map(e.dualSingleJourneyFares||{},r("dualSingleJourneyFares",e)),singleJourneyFares:t.helpers.map(e.singleJourneyFares||{},i("singleJourneyFares",e,"return")),openReturnJourneyFares:t.helpers.map(e.openReturnJourneyFares||{},i("openReturnJourneyFares",e,"return")),splitFares:t.helpers.map(e.splitFares||{},r("splitFares",e))})}))});return a.push(o),a}),[]))},a.prototype.getTermsAndCond=function(e,t,r){return[{name:"Ticket Type Class",value:e.terms.ticketTypeClass},{name:"Ticket Type Conditions Description",value:e.terms.ticketTypeConditionsDescription},{name:"Valid Return Rule",value:e.terms.validReturnRule},{name:"Ticket Type Name",value:e.terms.ticketTypeName},{name:"Change Rule",value:e.terms.changeRule},{name:"Pre Booking Requirement",value:e.terms.preBookingRequirement},{name:"Railcard Discount",value:e.terms.railcardDiscount},{name:"Ticket Type Code",value:e.terms.ticketTypeCode},{name:"Child Discount",value:e.terms.childDiscount},{name:"Valid Out Rule",value:e.terms.validOutRule},{name:"Start Date",value:t.departDateTime},{name:"End Date",value:t.arriveDateTime},{name:"Journey Break Rule",value:e.terms.journeyBreakRule},{name:"Refund Cancellation Rule",value:e.terms.refundCancellationRule},{name:"Journey Type",value:e.terms.journeyType},{name:"Tod Available",value:e.terms.todAvailable},{name:"Return Start Date",value:null==r?void 0:r.departDateTime},{name:"Return End Date",value:null==r?void 0:r.arriveDateTime}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(this.tempParams),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Rail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){switch(this.noOfAdults=e.adults,this.noOfChildren=e.children,this.chosenSearchType=e.journeyType,e.class){case"First":this.chosenRailClass=ee.First;break;case"Any":this.chosenRailClass=ee.All;break;case"Standard":this.chosenRailClass=ee.Standard}return this.getRailStationFetcher.fetchList({id:e.departureLocationId}).subscribe((function(e){t.travellingFrom=e})),this.getRailStationFetcher.fetchList({id:e.arrivalLocationId}).subscribe((function(e){t.travellingTo=e})),e.viaLocationId?(this.getRailStationFetcher.fetchList({id:e.viaLocationId}).subscribe((function(e){t.viaLocation=e})),this.via=!0):(this.viaLocation=null,this.via=!1),[2]}))}))},a.prototype.updateAvaliableClasses=function(){var e=this.userService.getUserFavoriteObject(dt.HideRailClasses)||{any:!1,standard:!1,first:!1},t=[];e.any||t.push({display:"Any",value:ee.All}),e.standard||t.push({display:"Standard",value:ee.Standard}),e.first||t.push({display:"First",value:ee.First}),this.chosenSearchClass=this.getUpdatedCabinClass(this.chosenRailClass,e,t),this.classTypes.next(t)},a.prototype.getUpdatedCabinClass=function(e,t,r){switch(e){case ee.All:return t.any?r[0].value:e;case ee.Standard:return t.standard?r[0].value:e;case ee.First:return t.first?r[0].value:e}},a.prototype.generateQueryFromFlightQuery=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){switch(r.label){case 0:return this.outbound_date=this.helpers.momentToNgDate(l.default(e.outboundDate)),this.return_date=this.helpers.momentToNgDate(l.default(e.returnDate)),[4,this.searchService.getStationLocations(this.getRailLocation(e.destinationAirport)).toPromise().then((function(e){console.log(e),t.travellingTo=e[0]}))];case 1:return r.sent(),[4,this.searchService.getStationLocations(this.getRailLocation(e.originAirport)).toPromise().then((function(e){console.log(e),t.travellingFrom=e[0]}))];case 2:return r.sent(),e.returnTrip?this.chosenSearchType=te.ReturnJourney:this.chosenSearchType=te.SingleJourney,[2]}}))}))},a.prototype.getRailLocation=function(e){return vt[e]||""},a}(c);Ut.STORAGE_SESSION_PARAMS="search_rail",Ut.STORAGE_SESSION_RESULTS="rail_results",Ut.PASSING_POINT="Passing",(jt=e.ages||(e.ages={})).Child="Child",jt.Youth="Youth",jt.Adult="Adult",jt.Senior="Senior";var Ht,xt,Gt=function(){function e(){}return e.hasItem=function(e){return!!e},e.fullname=function(e){return[e.title,e.forename,e.surname].filter(this.hasItem).join(" ")},e.makeTravellerObjectFromUserData=function(e){return{id:e.user_id.toString(),forename:e.forename,surname:e.surname,email:e.username,title:e.title,isChild:!1,isInfant:!1,childDOB:null,guest:!1,name:e.surname+" "+e.forename,dob:e.dob}},e.makeTravellerObjectFromUser=function(e){return{id:e.id.toString(),forename:e.forename,surname:e.surname,email:e.email,username:e.username,title:e.title,isChild:!1,isInfant:!1,childDOB:null,guest:!1,name:e.surname+" "+e.forename,dob:e.dob}},e.equals=function(e,t){return e.id===t.id||e.forename+e.surname===t.forename+t.surname},e.compare=function(t,r){var i=e.fullname(t),a=e.fullname(r);return i===a?0:i<a?-1:1},e}();(Ht=e.SortTypesIrl||(e.SortTypesIrl={})).CheapestFirst="C",Ht.EarliestFirst="E",Ht.LatestFirst="L",Ht.ExpensiveFirst="M",(xt=e.ClassType||(e.ClassType={})).Class_1="1",xt.Class_2="2",xt.Second_Class="2nd Class",xt.First_Class="1st Class";var Vt=function(t){function i(r,a,n,o,s,u,c,d){var h=t.call(this,s,n,u,d)||this;h.Irlfetcher=r,h.irlDiscountCardsFetcher=a,h.basketService=o,h.getIrlSupplierStationFetcher=c,h.resultsSessionName=i.STORAGE_SESSION_RESULTS,h.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,h._sortArray=[{title:"Price",methodRef:e.SortMethod.sortByPrice,icon:"ico-dollar"},{title:"Price (Highest)",methodRef:e.SortMethod.sortByHighestPrice,icon:"ico-calendar"},{title:"Time",methodRef:e.SortMethod.sortByDate,icon:"ico-calendar"}],h.searchTypes=[{display:"Return",value:V.ReturnJourney},{display:"One-Way",value:V.SingleJourney}],h.classTypes=[{display:"Any",value:G.All},{display:"Standard",value:G.Standard},{display:"First",value:G.First}],h.ageRanges=[{key:e.ages.Child,value:"Child (0-3)"},{key:e.ages.Child,value:"Child (4-5)"},{key:e.ages.Child,value:"Child (6-11)"},{key:e.ages.Youth,value:"Youth (12-14)"},{key:e.ages.Youth,value:"Youth (15-25)"},{key:e.ages.Adult,value:"Adult (26-59)"},{key:e.ages.Youth,value:"Senior (60+)"}],h.travelCards=[{display:"Young persons railcard",value:"YNG"},{display:"Disability railcard",value:"DIS"},{display:"Family railcard",value:"FAM"},{display:"Forces railcard",value:"HMF"},{display:"Travel agency discount",value:"TAD"}],h.type=ne.InternationalRail,h.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},h.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},h._supplier=null,h._countryCode=null,h._class=G.All,h._outboundDepartureDateTime=null,h._departureLocationId=null,h._arrivalLocationId=null,h._children=0,h._cheapestStandard=null,h._cheapestFirst=null,h._returnDepartureDateTime=null,h._ageRange=null,h._priceDir=!0,h._dateDir=!0,h._discountCard=[],h._irlDiscountCardsArray=[],h._outbound_date=null,h._outbound_time=null,h._return_date=null,h._return_time=null,h._irlClass=G.All,h._journeytype=V.SingleJourney,h._trainNumber=null,h._additionalInstructions=null;var p=s.getSessionItem(i.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};h.updateTempParams(h.searchService.makeIrlQuery(p.tempParams)),h._originalUserSearch=p.originalUserSearch,u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(t){h.travellers=t,h.travellers[0]&&!h.travellers[0].ageType&&(h.travellers[0].ageType=e.ages.Adult);var r=h.helpers.selectedTravellers(t,ne.InternationalRail);h.tempParams.adults=r.adults.length,h.tempParams.children=r.children.length,h.travellers=t,h._isValid()})),h._isValid();var m=s.getSessionItemAsList(h.resultsSessionName)||[];return h._cheapestResultPrice=h.updateLowestPrice(m),h.fullResults=m,h.results.next(m||[]),h}return m(i,t),Object.defineProperty(i.prototype,"outboundJourneyOptions",{get:function(){return this._outboundJourneyOptions},set:function(e){this._outboundJourneyOptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outboundTicket",{get:function(){return this._outboundTicket},set:function(e){this._outboundTicket=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfAdults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfChildren",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"travellingTo",{get:function(){return this.tempParams.travellingTo},set:function(e){var t;this.tempParams.travellingTo=e,this._travellingTo="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?this._travellingTo=e.railstation.id:(null==e?void 0:e.id)&&(this._travellingTo=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"travellingFrom",{get:function(){return this.tempParams.travellingFrom},set:function(e){var t,r=this;this.tempParams.travellingFrom=e,this._travellingFrom="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?(this._travellingFrom=e.railstation.id,this.supplier=e.railstation.supplier,this.getIrlDiscountCards().subscribe((function(e){r.irlDiscountCardsArray=e}))):(null==e?void 0:e.id)&&(this._travellingFrom=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplier",{get:function(){return this._supplier},set:function(e){this._supplier=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"countryCode",{get:function(){return this._countryCode},set:function(e){this._countryCode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"class",{get:function(){return this._class},set:function(e){this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outboundDepartureDateTime",{get:function(){return this._outboundDepartureDateTime},set:function(e){this.tempParams.outboundDepartureDateTime=e,e&&e.isValid()&&(this._outboundDepartureDateTime=e,this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"departureLocationId",{get:function(){return this._departureLocationId},set:function(e){this.travellingFrom=e,this._departureLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalLocationId",{get:function(){return this._arrivalLocationId},set:function(e){this.travellingTo=e,this._arrivalLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this._children},set:function(e){this._children=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestStandard",{get:function(){return this._cheapestStandard},set:function(e){this._cheapestStandard=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestFirst",{get:function(){return this._cheapestFirst},set:function(e){this._cheapestFirst=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestFirstReturn",{get:function(){return this._cheapestFirstReturn},set:function(e){this._cheapestFirstReturn=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestStandardReturn",{get:function(){return this._cheapestStandardReturn},set:function(e){this._cheapestStandardReturn=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnDepartureDateTime",{get:function(){return this._returnDepartureDateTime},set:function(e){this.tempParams.returnDepartureDateTime=e,e&&e.isValid()&&(this._returnDepartureDateTime=e,this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ageRange",{get:function(){return this._ageRange},set:function(e){this._ageRange=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"priceDir",{get:function(){return this._priceDir},set:function(e){this._priceDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dateDir",{get:function(){return this._dateDir},set:function(e){this._dateDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchClass",{get:function(){return this.tempParams.class},set:function(e){this.tempParams.class=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"discountCard",{get:function(){return this._discountCard},set:function(e){this._discountCard=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"discountCardsList",{get:function(){var e;return(null===(e=this._discountCard)||void 0===e?void 0:e.length)?this._discountCard.map((function(e){return e.id})).join(","):null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"irlDiscountCardsArray",{get:function(){return this._irlDiscountCardsArray},set:function(e){this._irlDiscountCardsArray=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outBoundDateTime",{get:function(){return this.tempParams.outboundDepartureDateTime},set:function(e){this.tempParams.outboundDepartureDateTime=l.default(e),this.minInboundDate={year:e.year(),month:e.month()+1,day:e.date()},e&&e.isValid()&&(this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this.outBoundDateTime&&this.inBoundDateTime&&this.outBoundDateTime.isAfter(this.inBoundDateTime)&&(this.inBoundDateTime=this.outBoundDateTime.clone().add(1,"day")),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"inBoundDateTime",{get:function(){return this.tempParams.returnDepartureDateTime},set:function(e){this.tempParams.returnDepartureDateTime=e,e&&e.isValid()&&(this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outbound_date",{get:function(){return this._outbound_date},set:function(e){this._outbound_date=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outbound_time",{get:function(){return this._outbound_time},set:function(e){this._outbound_time=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"return_date",{get:function(){return this._return_date},set:function(e){this._return_date=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"return_time",{get:function(){return this._return_time},set:function(e){this._return_time=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(48).fill(0).map((function(e,t){return{value:Math.floor(t/2).toString().padStart(2,"0")+(t%2*30).toString().padStart(2,"0"),display:Math.floor(t/2).toString().padStart(2,"0")+":"+(t%2*30).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"offlineRequest",{get:function(){return this.tempParams.offlineRequest},set:function(e){this.tempParams.offlineRequest=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"irlClass",{get:function(){return this._irlClass},set:function(e){this._irlClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"journeyType",{get:function(){return this._journeytype},set:function(e){this._journeytype=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"trainNumber",{get:function(){return this._trainNumber},set:function(e){this._trainNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"additionalInstructions",{get:function(){return this._additionalInstructions},set:function(e){this._additionalInstructions=e},enumerable:!1,configurable:!0}),i.prototype.processResults=function(e){var t;return null===(t=e[0])||void 0===t||t.outbound.forEach((function(e){e.providers[0].ticketOptions.map((function(e,t){return e.selected=!1,e.ShowDetail=!1,e.uid=e.identifiers.journeyIdentifier+"_"+(t+1),e}))})),Object.freeze(e),e},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeIrlQuery()),this.resetIrlForm(),this._isValid()},i.prototype.resetIrlForm=function(){var e=this.helpers.momentRoundMinutes(l.default(),30);this.additionalInstructions="",this.trainNumber="",this.travellingTo="",this.travellingFrom="",this.discountCard=[],this.class=G.All,this.outboundDepartureDateTime=e,this.journeyType=V.SingleJourney,this.offlineRequest=!1},i.prototype._isValid=function(){var e,t;this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var r=l.default();if(this._travellingFrom||this.validationMessages.push("Please Enter a From Location."),this._travellingTo||this.validationMessages.push("Please Enter a To Location."),(null===(e=this.outBoundDateTime)||void 0===e?void 0:e.isBefore(r))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),(null===(t=this.travellers)||void 0===t?void 0:t.length)&&this.tempParams.adults+this.tempParams.children<1){var a=this.helpers.selectedTravellers(this.travellers,ne.InternationalRail);this.tempParams.adults=a.adults.length,this.tempParams.children=a.children.length}this.tempParams.adults+this.tempParams.children<1&&this.validationMessages.push("There must be at least 1 traveller"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)},i.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this._originalUserSearch=Object.freeze(Object.assign({},this.tempParams)),this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.Irlfetcher.fetchList(e).pipe(r.map((function(e){return e}))))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.InternationalRail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(e){var t=e;return this.travellingFrom&&(t.travellingFrom=this.travellingFrom),this.travellingTo&&(t.travellingTo=this.travellingTo),t},i.prototype.startRecentSearch=function(e){this.journeyType=e.searchArgs.journeyType,this.irlClass=e.searchArgs.class,this.travellingTo=e.searchArgs.travellingTo,this.travellingFrom=e.searchArgs.travellingFrom,this.outBoundDateTime=l.default(e.searchArgs.outboundDepartureDateTime),e.searchArgs.journeyType===V.ReturnJourney&&(this.inBoundDateTime=l.default(e.searchArgs.returnDepartureDateTime)),this.searchService.startSearches()},i.prototype._updateOutboundDateTime=function(){if(this._outbound_date&&this._outbound_time){var e=this.helpers.ngDateToMoment(this._outbound_date,this._outbound_time);this.outBoundDateTime=e.isValid()?e:null,this._isValid()}},i.prototype._updateReturnDateTime=function(){if(this._return_date&&this._return_time){var e=this.helpers.ngDateToMoment(this._return_date,this._return_time);this.inBoundDateTime=e.isValid()?e:null,this._isValid()}},i.prototype.getSearchQuery=function(){var t=this;this.travellers?(this.noOfAdults=this.travellers.filter((function(t){return t.ageType===e.ages.Adult||t.ageType===e.ages.Youth||t.ageType===e.ages.Senior})).length,this.noOfChildren=this.travellers.filter((function(t){return t.ageType===e.ages.Child})).length):(this.noOfAdults=this.adults,this.noOfChildren=this.children),!this.supplier&&this.travellingFrom.name&&(this.supplier=this.travellingFrom.railstation.supplier,this.getIrlDiscountCards().subscribe((function(e){t.irlDiscountCardsArray=e})));var r={supplier:this.supplier,countryCode:"GB",irlDiscountCards:this.discountCardsList,class:this.class,outboundDepartureDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.outboundDepartureDateTime),departureLocationId:this._travellingFrom,arrivalLocationId:this._travellingTo,adults:this.tempParams.adults,children:this.tempParams.children,returnDepartureDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.returnDepartureDateTime),journeyType:this.journeyType,offlineRequest:this.tempParams.offlineRequest};switch(0===this.tempParams.children&&(r.children=null),this.tempParams.journeyType){case V.SingleJourney:r.returnDepartureDateTime=null}return this.helpers.removeNulls(r)},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.journeyType=r.journeyType,this.irlClass=r.class,this.outBoundDateTime=l.default(r.outboundDepartureDateTime),r.journeyType===V.ReturnJourney&&(this.inBoundDateTime=l.default(r.returnDepartureDateTime)),r.departureLocationId&&this.searchService.getRailStationById(r.departureLocationId).subscribe((function(e){t.travellingFrom={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),r.arrivalLocationId&&this.searchService.getRailStationById(r.arrivalLocationId).subscribe((function(e){t.travellingTo={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},i.prototype.updateFromPreviousSearches=function(e){if(console.log(e),e.FLIGHT)try{this.outBoundDateTime=l.default(e.FLIGHT.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDateTime.minutes()%30&&(this.outBoundDateTime=this.outBoundDateTime.subtract(this.outBoundDateTime.minutes()%30,"minutes")),e.FLIGHT.inboundDate&&(this.inBoundDateTime=l.default(e.FLIGHT.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inBoundDateTime.minutes()%30&&(this.inBoundDateTime=this.inBoundDateTime.subtract(this.inBoundDateTime.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate international rail from flight item")}else if(e.RAIL)try{this.outBoundDateTime=l.default(e.RAIL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDateTime.minutes()%30&&(this.outBoundDateTime=this.outBoundDateTime.subtract(this.outBoundDateTime.minutes()%30,"minutes")),e.RAIL.inboundDate&&(this.inBoundDateTime=l.default(e.RAIL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inBoundDateTime.minutes()%30&&(this.inBoundDateTime=this.inBoundDateTime.subtract(this.inBoundDateTime.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate international rail from rail item")}},i.prototype.updateCanCombine=function(e){var t=this;(e.identifiers.allowedWith||[]).forEach((function(r){t._canCombine[e.type][r.journeyIdentifier]?t._canCombine[e.type][r.journeyIdentifier].push(r.fareIdentifier):t._canCombine[e.type][r.journeyIdentifier]=[r.fareIdentifier]}))},i.prototype.getLegsFromIrlJourneyOption=function(e){var t=[];return(null==e?void 0:e.segments.length)&&(t=e.segments.map((function(t){return{operator:t.operator||e.providers[0].providerId,departureDateTime:t.departDateTime,departureStationName:t.depart,arrivalDateTime:t.arriveDateTime,arrivalStationName:t.arrive}}))),t},i.prototype.getSelectedIrlTicketOption=function(e,t,r){return e.providers[r].ticketOptions.find((function(e){return e.type===t.type&&(e.price===t.price||e.identifiers.fareIdentifier===t.identifiers.fareIdentifier)}))},i.prototype.addSingleJourneyToBasket=function(t,r,i,a){return y(this,void 0,void 0,(function(){var n,o,s,l,u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return n=p.sent(),(o=null==n?void 0:n.subject.value)?(s=this.getSelectedIrlTicketOption(a,i,0),l=this.getLegsFromIrlJourneyOption(a),u=this.getTermsAndCond(a),c=this.findCheapestTotal(this.fullResults),d={basket:o.id,service:t,detail:{outwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,arrivalStationCode:a.toCode,departureDateTime:a.departDateTime,departureStationName:a.from,departureStationCode:a.fromCode,supplierTickets:[{supplierName:a.providers[0].name,ticketDescription:s.type,price:s.price,legs:l}]},transactionIdentifier:a.identifiers.transactionIdentifier,signature:a.identifiers.signature?a.identifiers.signature:"",outbound:{fareInfo:s.fareInfo,fareIdentifiers:[s.identifiers.fareIdentifier],journeyIdentifier:s.identifiers.journeyIdentifier},supplier:a.providers[0].providerId,termsAndCond:u,railcardsDetail:r.irlDiscountCards?r.irlDiscountCards.split(","):[]},adults:r.adults,price:s.price,currency:s.currency,searchQuery:r,outboundDate:a.departDateTime,lowestPrice:c.amount!=s.price?c.amount:null,lowestPriceCurrency:c.amount!=s.price?c.currencyCode:null},[4,this.basketService.addToBasket(d,n,this.searchService,this.travellers,!1)]):[3,3];case 2:return(h=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.addReturnJourneyToBasket=function(t,r,i,a,n,o){return y(this,void 0,void 0,(function(){var s,l,u,c,d,h,p,m,f,v,y,g,S;return b(this,(function(b){switch(b.label){case 0:return s=n||this.outboundTicket,l=o||this.outboundJourneyOptions,[4,this.basketService.getDefaultBasket()];case 1:return u=b.sent(),(c=null==u?void 0:u.subject.value)?(d=this.getSelectedIrlTicketOption(l,s,0),h=this.getSelectedIrlTicketOption(a,i,0),p=this.getLegsFromIrlJourneyOption(l),m=this.getLegsFromIrlJourneyOption(a),f=this.getTermsAndCond(l),v=this.findCheapestTotal(this.fullResults),y=Number((Number(d.price)+Number(i.price)).toFixed(2)),g={basket:c.id,service:t,detail:{outwardDetail:{arrivalDateTime:l.arriveDateTime,arrivalStationName:l.to,arrivalStationCode:l.toCode,departureStationCode:l.fromCode,departureDateTime:l.departDateTime,departureStationName:l.from,supplierTickets:[{supplierName:l.providers[0].name,ticketDescription:d.type,price:d.price,legs:p}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,arrivalStationCode:a.toCode,departureStationCode:a.fromCode,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:a.providers[0].name,ticketDescription:i.type,legs:m}]},signature:s.identifiers.signature?s.identifiers.signature:"",transactionIdentifier:s.identifiers.transactionIdentifier,outbound:{fareInfo:d.fareInfo,fareIdentifiers:[d.identifiers.fareIdentifier],journeyIdentifier:d.identifiers.journeyIdentifier},return:{fareInfo:h.fareInfo,fareIdentifiers:[h.identifiers.fareIdentifier],journeyIdentifier:h.identifiers.journeyIdentifier},supplier:l.providers[0].providerId,termsAndCond:f,railcardsDetail:r.irlDiscountCards?r.irlDiscountCards.split(","):[]},adults:r.adults,price:y,currency:d.currency,searchQuery:r,outboundDate:l.departDateTime,lowestPrice:v.amount!=y?v.amount:null,lowestPriceCurrency:v.amount!=y?v.currencyCode:null},this.filterSelected(),[4,this.basketService.addToBasket(g,u,this.searchService,this.travellers,!1)]):[3,3];case 2:return(S=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,S];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.updateLowestPrice=function(e){var t,r,i,a;if(!e.length)return null;var n=null===(a=null===(i=null===(r=null===(t=e[0])||void 0===t?void 0:t.outbound[0])||void 0===r?void 0:r.providers[0])||void 0===i?void 0:i.cheapestTicket)||void 0===a?void 0:a.currency;return{amount:this.findCheapestTicket(e),currencyCode:n}},i.prototype.findCheapestTotal=function(e){var t,r,i,a,n,o=this;this.cheapestFirst=null,this.cheapestStandard=null,this.cheapestFirstReturn=null,this.cheapestStandardReturn=null;var s=this.findCheapestTicket(e),l=[];return e.map((function(e){e.return.map((function(e){e.providers.map((function(e){var t=e.cheapestTicket.price;e.ticketOptions.map((function(e){var r,i,a=e.price,n=e.class;"1"===n&&((null===(r=o.cheapestFirstReturn)||void 0===r?void 0:r.price)>a||!o.cheapestFirstReturn)?o.cheapestFirstReturn=e:"2"===n&&((null===(i=o.cheapestStandardReturn)||void 0===i?void 0:i.price)>a||!o.cheapestStandardReturn)&&(o.cheapestStandardReturn=e),a===t&&l.push(t)}))}))}))})),{amount:s+((null===(t=this.cheapestFirstReturn)||void 0===t?void 0:t.price)&&(null===(r=this.cheapestStandardReturn)||void 0===r?void 0:r.price)?Math.min(this.cheapestFirstReturn.price,this.cheapestStandardReturn.price):(null===(i=this.cheapestFirstReturn)||void 0===i?void 0:i.price)?null===(a=this.cheapestFirstReturn)||void 0===a?void 0:a.price:(null===(n=this.cheapestStandardReturn)||void 0===n?void 0:n.price)||0),currencyCode:e[0].outbound[0].providers[0].ticketOptions[0].currency}},i.prototype.findCheapestTicket=function(e){var t=this;if(!e.length)return null;var r=[];return e.map((function(e){e.outbound.map((function(e){e.providers.map((function(e){var i=e.cheapestTicket.price;e.ticketOptions.map((function(e){var a,n,o=e.price,s=e.class;"1"===s&&((null===(a=t.cheapestFirst)||void 0===a?void 0:a.price)>o||!t.cheapestFirst)?t.cheapestFirst=e:"2"===s&&((null===(n=t.cheapestStandard)||void 0===n?void 0:n.price)>o||!t.cheapestStandard)&&(t.cheapestStandard=e),o===i&&r.push(i)}))}))}))})),Math.min(this.cheapestFirst.price,this.cheapestStandard.price)},i.prototype.sortByPrice=function(e){var t=this;void 0===e&&(e=!1),e||(this.priceDir=!this.priceDir);var r=this.filterSelected(this._isFiltered),i=function(e,r){var i,a;return e.providers.forEach((function(e){e.ticketOptions.forEach((function(e){(!i||e.price<i)&&(i=e.price)}))})),r.providers.forEach((function(e){e.ticketOptions.forEach((function(e){(!a||e.price<i)&&(a=e.price)}))})),t.priceDir?i-a:a-i};try{r[0].outbound=r[0].outbound.sort(i),r[0].return=r[0].return.sort(i)}catch(e){console.error("+++ Error sorting by price: "+e+" - returning original results +++")}this.results.next(r)},i.prototype.sortByHighestPrice=function(e){var t=this;void 0===e&&(e=!1),e||(this.priceDir=!this.priceDir);var r=this.filterSelected(this._isFiltered),i=function(e,r){return t.priceDir?r.providers[0].cheapestTicket.price-e.providers[0].cheapestTicket.price:e.providers[0].cheapestTicket.price-r.providers[0].cheapestTicket.price};r[0].outbound=r[0].outbound.sort(i),r[0].return=r[0].return.sort(i),this.results.next(r)},i.prototype.sortByDate=function(e){var t=this;void 0===e&&(e=!1),e||(this.dateDir=!this.dateDir);var r=this.filterSelected(this._isFiltered),i=function(e,r){return t.dateDir?l.default(e.departDateTime).unix()-l.default(r.departDateTime).unix():l.default(r.departDateTime).unix()-l.default(e.departDateTime).unix()};r[0].outbound=r[0].outbound.sort(i),r[0].return=r[0].return.sort(i),this.results.next(r)},i.prototype.addOutboundAndFilter=function(e,t){this.outboundJourneyOptions=t,this.outboundTicket=e,this.filterSelected(!0)},i.prototype.filterSelected=function(e){var t=this;void 0===e&&(e=!1);var r=this.helpers.clone(this.fullResults);try{e?(this._isFiltered=!0,r[0].outbound=[r[0].outbound.find((function(e){return e.departDateTime===t._outboundJourneyOptions.departDateTime&&e.arriveDateTime===t._outboundJourneyOptions.arriveDateTime}))],r[0].outbound[0].providers[0].ticketOptions=r[0].outbound[0].providers[0].ticketOptions.reduce((function(e,r){return r.uid===t._outboundTicket.uid&&(r.selected=!0,e.push(r)),e}),[])):(this._isFiltered=!1,this.outboundJourneyOptions=null,this.outboundTicket=null,r[0].outbound.forEach((function(e){e.providers[0].ticketOptions.map((function(e){return e.selected=!1,e.ShowDetail=!1,e}))})))}catch(e){console.error("+++ Error filtering results: "+e+" - returning original results +++")}return this.results.next(r),r},i.prototype.getIrlDiscountCards=function(){var e=this.supplier;return this.irlDiscountCardsFetcher.fetchList({supplier:e})},i.prototype.getTermsAndCond=function(e){var t,r;return[{name:"Fare Rules",value:null===(r=null===(t=null==e?void 0:e.providers[0])||void 0===t?void 0:t.ticketOptions[0])||void 0===r?void 0:r.fareRules}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.InternationalRail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.generateFilters=function(t){if(null==t?void 0:t.length){var r=null,i=null,a=null,n=null,o=null,s=null,u={},c={};t.forEach((function(t){t.providers[0].ticketOptions.forEach((function(e){(!r||r<e.price)&&(r=Math.ceil(e.price)),(!i||e.price<i)&&(i=Math.floor(e.price))})),a&&!l.default(t.departDateTime).isBefore(l.default(a))||(a=Number(l.default(t.departDateTime).format("HHmm"))),n&&!l.default(t.departDateTime).isAfter(l.default(n))||(n=Number(l.default(t.departDateTime).format("HHmm"))),o&&!l.default(t.arriveDateTime).isBefore(l.default(o))||(o=Number(l.default(t.arriveDateTime).format("HHmm"))),s&&!l.default(t.arriveDateTime).isAfter(l.default(s))||(s=Number(l.default(t.arriveDateTime).format("HHmm"))),c[t.segments.length-1]={key:t.segments.length-1,title:t.segments.length-1+" changes",selected:!1},t.providers[0].ticketOptions.forEach((function(t){"1"===t.class?u.First={key:e.ClassType.Class_1,title:"First",selected:!1}:"2"===t.class&&(u.Second={key:e.ClassType.Class_2,title:"Second",selected:!1})}))}));var d={priceMax:r,priceMin:i,dateArrMax:s,dateArrMin:o,dateDepMax:n,dateDepMin:a,classes:Object.values(u),changes:Object.values(c)};return console.log(d),d}},i.prototype.applyFilters=function(e,t){void 0===t&&(t="O");var r,i=this.helpers.clone(this.fullResults);switch(t){case"O":r=i[0].outbound;break;case"I":r=i[0].return}r=(r=(r=r.filter((function(t){var r=t.providers[0].ticketOptions.filter((function(t){return t.price>=e.priceMin&&t.price<=e.priceMax}));return t.providers[0].ticketOptions=r,r.length}))).filter((function(t){var r=Number(l.default(t.departDateTime).format("HHmm"));return r>=e.dateDepMin&&r<=e.dateDepMax}))).filter((function(t){var r=Number(l.default(t.arriveDateTime).format("HHmm"));return r>=e.dateArrMin&&r<=e.dateArrMax}));var a=e.classes.filter((function(e){return e.selected}));(null==a?void 0:a.length)&&(r=r.filter((function(e){var t=[];return console.log("og tickets:",e.providers[0].ticketOptions),e.providers[0].ticketOptions.forEach((function(e){a.forEach((function(r){e.class===r.key&&t.push(e)}))})),console.log(t),e.providers[0].ticketOptions=t,t.length>0}))),console.log(r);var n=e.changes.filter((function(e){return e.selected}));switch(n.length&&(r=r.filter((function(e){for(var t=0;t<n.length;t++)if(e.segments.length-1===n[t].key)return e}))),t){case"O":i[0].outbound=r;break;case"I":i[0].return=r}this.results.next(i)},i.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.getIrlSupplierStationFetcher.fetchList({id:e.departureLocationId}).subscribe((function(e){t.travellingFrom=e})),this.getIrlSupplierStationFetcher.fetchList({id:e.arrivalLocationId}).subscribe((function(e){t.travellingTo=e})),this.adults=e.adults,this.children=e.children,this.class=e.class,this.countryCode=e.countryCode,this.journeyType="ReturnJourney"===e.journeyType?V.ReturnJourney:V.SingleJourney,this.supplier=e.supplier,[2]}))}))},i}(c);Vt.STORAGE_SESSION_PARAMS="search_irl",Vt.STORAGE_SESSION_RESULTS="irl_results",Vt.PASSING_POINT="Passing";var Wt,Qt,Jt,Yt={type:"string"},Kt={type:"object",properties:{countryCode:Yt,areaCode:Yt,number:Yt,extension:Yt},required:["countryCode","areaCode","number","extension"]},qt={type:"object",properties:{numberOrName:Yt,street:Yt,town:Yt,county:Yt,postcode:Yt,countryCode:Yt},required:["numberOrName","street","town","county","postcode","countryCode"]},Xt=function(){function e(e){this.helpers=e,this.details={numberOrName:"",street:"",town:"",county:"",postcode:"",countryCode:"GB"},this.bookingAddress=new t.BehaviorSubject([])}return e.prototype.updateDetails=function(e){var t=this;this.bookingAddress.next(e.map((function(e){return t.helpers.sanatizeReturns(t.details,e)})))},e}(),Zt=function(){function e(e){this.helpers=e,this.details={countryCode:"",areaCode:"",number:"",extension:""},this.bookingPhoneNumber=new t.BehaviorSubject([])}return e.prototype.updateDetails=function(e){var t=this;this.bookingPhoneNumber.next(e.map((function(e){return t.helpers.sanatizeReturns(t.details,e)})))},e}(),zt=function(){function e(e,t,r,i,a,n){this.user=e,this.getUserFetcher=t,this.helpers=r,this.perPassengerPhoneNumber=i,this.perPassengerAddress=a,this.perPassengerSupplementaryBookingInfoSchema=n,this.userDetails=null,this.userInfo={id:e.id,address:null,phoneNumber:null,supplementaryInfo:null}}return Object.defineProperty(e.prototype,"id",{get:function(){return this.user.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAddress",{get:function(){return null===this.userInfo.address&&this.setUpUserInfo(),this.userInfo.address},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userPhoneNumber",{get:function(){var e;return null===(null===(e=this.userInfo)||void 0===e?void 0:e.phoneNumber)&&this.setUpUserInfo(),this.userInfo.phoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userSupplementaryInfo",{get:function(){return null===this.userInfo.supplementaryInfo&&this.setUpUserInfo(),this.userInfo.supplementaryInfo},enumerable:!1,configurable:!0}),e.prototype.setUpUserInfo=function(){var e=this;this.userInfo.address=new Xt(this.helpers),this.userInfo.phoneNumber=new Zt(this.helpers),this.userInfo.supplementaryInfo=this.perPassengerSupplementaryBookingInfoSchema,this.user.id&&"User"===this.user.__typename&&this.getUserFetcher.fetchOne({id:this.user.id}).pipe(r.take(1)).subscribe((function(t){t&&(e.userDetails=t,e.userInfo.address.updateDetails(null==t?void 0:t.addresses),e.userInfo.phoneNumber.updateDetails(null==t?void 0:t.phoneNumbers))}))},e}(),$t=function(){function t(t,r,i){var a=this;this.basketItem=t,this.helpers=r,this.hasDetails=!1,this.noCovertSelectSchemas=[e.SchemaFormat.railSeating,e.SchemaFormat.passport,e.SchemaFormat.selectQueue],this.basketItem.perPassengerSupplementaryBookingInfoSchema=t.perPassengerSupplementaryBookingInfoSchema?this.processSchema(this.basketItem.perPassengerSupplementaryBookingInfoSchema):null,this.userInfo=this.basketItem.users.map((function(e){return new zt(e,i,r,a.basketItem.perPassengerPhoneNumber,a.basketItem.perPassengerAddress,a.basketItem.perPassengerSupplementaryBookingInfoSchema)})),this.guestInfo=this.basketItem.guests.map((function(e){return new zt(e,i,r,a.basketItem.perPassengerPhoneNumber,a.basketItem.perPassengerAddress,a.basketItem.perPassengerSupplementaryBookingInfoSchema)})),this.address=new Xt(this.helpers),this.phoneNumber=new Zt(this.helpers),this.basketItem.perItemSupplementaryBookingInfoSchema=this.basketItem.perItemSupplementaryBookingInfoSchema?this.processSchema(this.basketItem.perItemSupplementaryBookingInfoSchema||{}):null}return Object.defineProperty(t.prototype,"perItemAddress",{get:function(){return!!this.basketItem.perItemAddress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perItemPhoneNumber",{get:function(){return!!this.basketItem.perItemPhoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perItemSupplementarySchema",{get:function(){return this.basketItem.perItemSupplementaryBookingInfoSchema},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perPassengerAddress",{get:function(){return!!this.basketItem.perPassengerAddress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perPassengerPhoneNumber",{get:function(){return!!this.basketItem.perPassengerPhoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perPassengerSupplementaryBookingInfoSchema",{get:function(){return this.basketItem.perPassengerSupplementaryBookingInfoSchema},enumerable:!1,configurable:!0}),t.prototype.processSchema=function(t){var r=this;return console.warn("processing: ",t),t=this.helpers.clone(t),this.hasDetails=this.perItemAddress||this.perItemPhoneNumber||this.perPassengerAddress||this.perPassengerPhoneNumber,Object.keys(t.properties||{}).forEach((function(i){console.log("here: ",i),r.hasDetails=!0;var a=t.properties[i];"object"===a.type&&(a.format=r.addRailFormat(i)||e.SchemaFormat.object,t.properties[i]=Object.assign(Object.assign({},r.processSchema(a)),{format:r.addRailFormat(i)||e.SchemaFormat.object})),a.format=a.format||r.schemaWidgetToFormat(a.widget)||r.schemaKeyToFormat(i)||r.schemaTypeToFormat(a.type),a.oneOf&&a.oneOf.length>0&&!r.noCovertSelectSchemas.includes(a.format)&&(a.format=e.SchemaFormat.select)})),console.log("+++ has Details: "+this.hasDetails+" +++"),t},t.prototype.schemaKeyToFormat=function(t){switch(t){case e.SchemaFormat.dob:return e.SchemaFormat.datetime}},t.prototype.schemaWidgetToFormat=function(t){switch(t){case e.Widgets.COUNTRY_CODE:return e.SchemaFormat.countryCode;default:return null}},t.prototype.addRailFormat=function(t){switch(t){case e.SchemaFormat.additionalSeatPreference:return e.SchemaFormat.additionalSeatPreference;case e.SchemaFormat.seatPrefGroups:return e.SchemaFormat.seatPrefGroups;case e.SchemaFormat.address:return e.SchemaFormat.address;default:return null}},t.prototype.schemaTypeToFormat=function(t){switch(t){case"string":return e.SchemaFormat.string;case"integer":return e.SchemaFormat.integer;case"object":return e.SchemaFormat.object;case"array":return e.SchemaFormat.array;case"boolean":return e.SchemaFormat.boolean;default:return e.SchemaFormat.string}},t.prototype.createSupplemtalBookingInformation=function(e){var t=this,r={basketItem:this.basketItem.id,userInfo:[],supplementaryInfo:{},paymentMethodDetails:{},guestInfo:[]};return void 0!==e.perItemAddress&&(r.address=this.helpers.toStrings(e.perItemAddress,qt)),void 0!==e.perItemPhoneNumber&&(r.phoneNumber=this.helpers.toStrings(e.perItemPhoneNumber,Kt)),void 0!==e.perItemSupplementarySchema&&(r.supplementaryInfo=this.helpers.toStrings(e.perItemSupplementarySchema,this.perItemSupplementarySchema)),r.userInfo=this.userInfo.map((function(r,i){var a,n,o={id:r.id,supplementaryInfo:{}},s=e["user_"+i]||{};return void 0!==s.perPassengerAddress&&(o.address=t.helpers.toStrings(s.perPassengerAddress,qt)),void 0!==s.perPassengerPhoneNumber&&(o.phoneNumber=t.helpers.toStrings(s.perPassengerPhoneNumber,Kt)),void 0!==s.perPassengerSupplementaryBookingInfoSchema&&(o.supplementaryInfo=t.helpers.toStrings(s.perPassengerSupplementaryBookingInfoSchema,t.perPassengerSupplementaryBookingInfoSchema)),o.supplementaryInfo.dob&&(o.supplementaryInfo.dob=t.helpers.ngDateToMoment(o.supplementaryInfo.dob).isValid()?t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.dob)):t.helpers.formatIsoDate(o.supplementaryInfo.dob)),o.supplementaryInfo.passport&&((null===(a=o.supplementaryInfo.passport.dateOfExpiry)||void 0===a?void 0:a.year)&&(o.supplementaryInfo.passport.dateOfExpiry=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfExpiry))),(null===(n=o.supplementaryInfo.passport.dateOfIssue)||void 0===n?void 0:n.year)&&(o.supplementaryInfo.passport.dateOfIssue=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfIssue))),o.supplementaryInfo.passport.documentId||o.supplementaryInfo.passport.number&&o.supplementaryInfo.passport.dateOfExpiry&&o.supplementaryInfo.passport.dateOfIssue&&o.supplementaryInfo.passport.codeOfIssuingState&&o.supplementaryInfo.passport.gender&&o.supplementaryInfo.passport.nationality||delete o.supplementaryInfo.passport),o})),r.guestInfo=this.guestInfo.map((function(r,i){var a,n,o={id:r.id,supplementaryInfo:{}},s=e["guest_"+i]||{};return void 0!==s.perPassengerAddress&&(o.address=t.helpers.toStrings(s.perPassengerAddress,qt)),void 0!==s.perPassengerPhoneNumber&&(o.phoneNumber=t.helpers.toStrings(s.perPassengerPhoneNumber,Kt)),void 0!==s.perPassengerSupplementaryBookingInfoSchema&&(o.supplementaryInfo=t.helpers.toStrings(s.perPassengerSupplementaryBookingInfoSchema,t.perPassengerSupplementaryBookingInfoSchema)),o.supplementaryInfo.passport&&((null===(a=o.supplementaryInfo.passport.dateOfExpiry)||void 0===a?void 0:a.year)&&(o.supplementaryInfo.passport.dateOfExpiry=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfExpiry))),(null===(n=o.supplementaryInfo.passport.dateOfIssue)||void 0===n?void 0:n.year)&&(o.supplementaryInfo.passport.dateOfIssue=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfIssue))),o.supplementaryInfo.passport.documentId||o.supplementaryInfo.passport.number&&o.supplementaryInfo.passport.dateOfExpiry&&o.supplementaryInfo.passport.dateOfIssue&&o.supplementaryInfo.passport.codeOfIssuingState&&o.supplementaryInfo.passport.gender&&o.supplementaryInfo.passport.nationality||delete o.supplementaryInfo.passport),o})),r},t}();(Wt=e.IncludedType||(e.IncludedType={})).Leg="leg",Wt.Photo="photo",Wt.PhotoAttachment="photo_attachment",Wt.Upa="upa",(Qt=e.IrlDirection||(e.IrlDirection={})).Outbound="out",Qt.Inbound="in",(Jt=e.ErmCompanyType||(e.ErmCompanyType={})).Marine="Marine",Jt.OilAndGas="Oil & Gas",Jt.CruiseLine="Cruise Line",Jt.WindEnergy="Wind Energy";var er=function(e){function t(t,r,i){var a=e.call(this,r)||this;return a.query=t,a.helpers=i,a}return m(t,e),t.prototype.fetchOne=function(e){return this.processCall(this.query.fetch(this.helpers.removeNulls(e)))},t}(h),tr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.applyJITFlightRules},t}(er),rr=function(e){function t(t,r,i){var a=e.call(this,i)||this;return a.query=t,a.helpers=r,a}return m(t,e),t.prototype.fetchList=function(e){return this.processCall(this.query.fetch(this.helpers.removeNulls(e)))},t.prototype.fetchKeyedObject=function(e,t){var i=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?i.helpers.arrayToObject(t,e):null})))},t.prototype.fetchKeyedObjectArray=function(e,t){var i=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?i.helpers.arrayToObjectArray(t,[e]):null})))},t}(h),ir=function(e){function i(t,r,i){return e.call(this,t,r,i)||this}return m(i,e),i.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.applyJITHotelRules.result},i.prototype.processCall=function(e){var i=this;return e.pipe(r.take(1),r.map((function(e){return i.checkError(e.errors),i.getDataFromResult(e)})),r.catchError((function(e){return i.checkError(e),t.of({})})))},i}(rr),ar=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getUserBasket},t}(er),nr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchCabHire)||void 0===r?void 0:r.results},t}(rr),or=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.carHireAvailabilityDetailRequest},t}(rr),sr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchCarHire)||void 0===r?void 0:r.results},t}(rr),lr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getConfermaOfficeNames},t}(rr),ur=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getConfermaOffice},t}(er),cr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=e.data)||void 0===t?void 0:t.getConfermaQuicklist)||void 0===r?void 0:r.results},t}(rr),dr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r,i,a,n,o;return Object.assign(Object.assign({},null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchEurostar)||void 0===r?void 0:r.results),{ruleActionSummary:null===(a=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.searchEurostar)||void 0===a?void 0:a.ruleActionSummary,searchId:null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.searchEurostar)||void 0===o?void 0:o.searchId})},t}(rr),hr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getFlightFareRules},t}(rr),pr=function(e){function t(t,r,i,a){var n=e.call(this,t,r,i)||this;return n.environment=a,n}return m(t,e),t.prototype.fetchList=function(t){var r,i;return(null===(r=this.environment)||void 0===r?void 0:r.groupMax)>0&&(t.groupMax=null===(i=this.environment)||void 0===i?void 0:i.groupMax),e.prototype.fetchList.call(this,t)},t.prototype.getDataFromResult=function(e){var t,r,i,a,n,o;return Object.assign(Object.assign({},null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchFlightsV2)||void 0===r?void 0:r.results),{ruleActionSummary:null===(a=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.searchFlightsV2)||void 0===a?void 0:a.ruleActionSummary,searchId:null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.searchFlightsV2)||void 0===o?void 0:o.searchId})},t}(rr),mr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getCOVIDMicrositeToken},t}(rr),fr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRailcards},t}(rr),vr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRailLiveDepartures},t}(rr),yr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRailStation},t}(rr),br=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getIRLSupplierStation},t}(rr),gr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRiskAlerts},t}(rr),Sr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getUserCompanyOffices},t}(rr),Cr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserCurrentCarbonAllowance},t}(rr),Ar=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserRecentSearches},t}(rr),Tr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserBaskets},t}(rr),Dr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserMIAutoSuggestValues},t}(rr),Pr=function(e){function i(t,r,i){return e.call(this,t,r,i)||this}return m(i,e),i.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getMultipleHotelsAvailability.results},i.prototype.processCall=function(e){var i=this;return e.pipe(r.take(1),r.map((function(e){return i.checkError(e.errors),i.getDataFromResult(e)})),r.catchError((function(e){return i.checkError(e),t.of({})})))},i}(rr),Fr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchHotels)||void 0===r?void 0:r.results},t}(rr),kr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getIRLDiscountCards},t}(rr),_r=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchIRL)||void 0===r?void 0:r.results},t}(rr),Rr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchLounges)||void 0===r?void 0:r.results},t}(rr),Ir=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchParking)||void 0===r?void 0:r.results},t}(rr),Or=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchRail)||void 0===r?void 0:r.results},t}(rr),Er=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirlines},t}(er),Br=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirports},t}(er),Nr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchCities},t}(rr),Mr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchConfermaCities},t}(er),Lr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getCarHireDepots},t}(rr),wr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchHotelChains},t}(rr),jr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchIRLSupplierStations},t}(rr),Ur=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return[null===(t=e.data)||void 0===t?void 0:t.getPostcodeDetails]},t}(rr),Hr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchRailStations},t}(rr),xr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchUserCanBookFor},t}(rr),Gr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserAddresses},t}(rr),Vr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUser},t}(er),Wr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserMessages},t}(rr),Qr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserServices},t}(rr),Jr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserUIConfigs.all},t}(rr),Yr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getFlightSeatMap},t}(rr),Kr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserFavouriteSearches},t}(rr),qr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getConfermaRoomImages},t}(rr),Xr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getCompanies},t}(rr),Zr=function(e){function t(t,r,i){return e.call(this,t,i,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getCompany},t}(er),zr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.emailBasket},t}(rr),$r=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchFastTrack)||void 0===r?void 0:r.results},t}(rr),ei=function(e){function t(t,r,i){return e.call(this,t,i,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.sendOfflineNotification},t}(er),ti=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getHotelChains},t}(rr),ri=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getRailProviders},t}(rr),ii=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getAllAirlines},t}(rr),ai=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getCarHireProviders},t}(rr),ni=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.generateBasketPDF},t}(rr),oi=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.getCancellationInfo},t}(er),si=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getUserGuests},t}(rr),li=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getOffice},t}(rr),ui=function(e){function t(t,r,i){return e.call(this,t,i,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserDefaultMIValue},t}(er),ci=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.emailFerryBookingReq},t}(rr),di=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRedirectApprover},t}(rr),hi=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchCompanyApprovers},t}(rr),pi=function(){};pi.WHITE_CHARS=/[\r\n\t\s]/gm,pi.CAPS=/([A-Z])/g,pi.EMAIL_VALIDATOR=/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,pi.UK_POSTCODE=/^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))\s?[0-9][A-Za-z]{2})$/,pi.EMAIL_REGEX="^(([^<>()\\[\\]\\.,;:\\s@']+(\\.[^<>()\\[\\]\\.,;:\\s@']+)*)|('.+'))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}))$";var mi,fi=function(e){function t(t,r,i,a,n){void 0===n&&(n="Invalid username or password. Please try again");var o=e.call(this,n)||this;return o.reason=t,o.data=r,o.statusText=i,o.error=a,o.name="LoginError",o}return m(t,e),t}(Error);(mi=e.LoginErrorReason||(e.LoginErrorReason={}))[mi.PASSWORD_EXPIRED=0]="PASSWORD_EXPIRED",mi[mi.PASSWORD_CHANGE=1]="PASSWORD_CHANGE",mi[mi.LOGED_IN=2]="LOGED_IN",mi[mi.AUTH_ERROR=3]="AUTH_ERROR",mi[mi.SSO=4]="SSO";var vi,yi=function(){function e(e,t,r){this.username=e,this.password=t,this.overwrite="",r&&(this.overwrite="1")}return e.prototype.getAgent=function(){return"Agent="+encodeURIComponent(this.username.toLowerCase())},e.prototype.getPasswd=function(){return"Passwd="+encodeURIComponent(this.password)},e.prototype.getToken=function(){return"token="+encodeURIComponent(this.token)},e.prototype.getTokenStr=function(){try{return this.getAgent()+"&"+this.getPasswd()+"&overwrite="+this.overwrite+"&"+this.getToken()}catch(e){console.error("Sorry there is no enough information to get token string.")}},e.prototype.getChangePassTokenStr=function(){try{return("\n "+this.getAgent()+"&\n oldpasswd="+encodeURIComponent(this.oldPassword)+"&\n newpasswd="+encodeURIComponent(this.password)+"&\n cnfpasswd="+encodeURIComponent(this.confirmPassword)+"&\n "+this.getToken()).replace(pi.WHITE_CHARS,"")}catch(e){console.error("Sorry there is no enough information to get token string.",e)}},e.prototype.getResetPassTokenStr=function(){try{return("\n newpasswd="+encodeURIComponent(this.password)+"&\n cnfpasswd="+encodeURIComponent(this.confirmPassword)+"&\n "+this.getToken()).replace(pi.WHITE_CHARS,"")}catch(e){console.error("Sorry there is no enough information to get token string.",e)}},e}(),bi=function(){function e(e,r){this.modalService=e,this.basketService=r,this.reasonChecked=new t.BehaviorSubject(null)}return e.prototype.addBasketItem=function(e){return y(this,void 0,void 0,(function(){var t,r,i=this;return b(this,(function(a){switch(a.label){case 0:return e.id!==this.currentBasketid||this.workingOn?[2]:(t=e.basketItems.filter((function(e){return e.requiresReason&&0!==e.managementInfo.filter((function(e){return e.reason&&0===e.selectedValues.length})).length}))).length>0?(this.workingOn={basket:e,required:t.reduce((function(e,t){return e[t.id]=t.managementInfo.filter((function(e){return e.reason&&0===e.selectedValues.length})),e}),{})},[4,this.modalService.open(d.RequiresReasonDialogComponent,{backdrop:"static"},this.workingOn)]):[3,6];case 1:return(r=a.sent())?[4,Promise.all(this.workingOn.basket.basketItems.map((function(e){return Promise.all((e.managementInfo||[]).map((function(e){return r[e.id]?(i.reasonChecked.next({basketId:i.currentBasketid,reason:r[e.id]}),i.basketService.setMiSelectedValue(i.workingOn.basket.id,e,r[e.id],null)):Promise.resolve()})))})))]:[3,3];case 2:return a.sent(),this.workingOn=null,[3,5];case 3:return[4,Promise.all(Object.entries(this.workingOn.required).map((function(e){var t=S(e,2),r=t[0];t[1];return i.basketService.removeBasketItem(i.workingOn.basket.id,i.workingOn.basket.basketItems.find((function(e){return e.id===r})))})))];case 4:a.sent(),this.workingOn=null,this.reasonChecked.next({basketId:this.currentBasketid,reason:"notneeded"}),a.label=5;case 5:return[3,7];case 6:this.reasonChecked.next({basketId:this.currentBasketid,reason:"notneeded"}),a.label=7;case 7:return[2]}}))}))},e}(),gi=function(){function e(e,i,a,n,o){var s=this;this.helpers=i,this.basketService=a,this.getUserFetcher=n,this.requiresService=o,Object.assign(this,{subject:new t.BehaviorSubject(Object.assign(Object.assign({},e),{prices:{},mixedCurrency:!1,count:0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]})),_basketSubject:new t.BehaviorSubject(Object.assign(Object.assign({},e),{prices:{},mixedCurrency:!1,count:0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]})),tempid:e.id,id:e.id,title:e.title,prices:{},mixedCurrency:!1,count:0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]}),this._basketSubject.pipe(r.debounceTime(500)).subscribe((function(e){s.subject.next(e)}),(function(e){s.subject.error(e)}),(function(){s.subject.complete()})),this.next(e)}return e.prototype.destructor=function(){this.subject.complete()},e.prototype.next=function(e){var t,r=this;if((e=this.helpers.clone(e)).status!==P.Approved||void 0!==e.basketItems[0].perItemPhoneNumber){this.id=e.id,this.title=e.title;var i=Object.assign(Object.assign({},e),(e.basketItems||[]).reduce((function(e,t){var i,a,n;return e.prices[t.currency]||(e.prices[t.currency]=0),e.prices[t.currency]+=t.price,e.suppInfo.push(new $t(t,r.helpers,r.getUserFetcher)),t.miGroupsAvailable&&t.miGroupsAvailable.length>0&&e.miGroups.push({type:t.service.type,options:t.miGroupsAvailable,basketItem:t,value:t.miGroupSelected||""}),(null===(i=t.managementInfo)||void 0===i?void 0:i.length)>0&&((null===(a=t.users)||void 0===a?void 0:a.length)>0||(null===(n=t.guests)||void 0===n?void 0:n.length))&&e.basketInfoMiDetails.push(new ke(t,r.basketService,r.helpers)),e}),{prices:{},mixedCurrency:!1,count:(null===(t=e.basketItems)||void 0===t?void 0:t.length)||0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]}));i.mixedCurrency=Object.keys(i.prices).length>1,this._basketSubject.next(i),e.basketItems.every((function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.outwardDetail)||void 0===r?void 0:r.splitID}))&&e.basketItems.length%2||this.requiresService.addBasketItem(e)}else this.basketService.getBasket({convertCurrencyTo:"GBP",id:e.id,withSupplemental:!0}).subscribe((function(e){r.next(e)}))},e}(),Si=function(){function i(r,i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k,_){var R=this;this.acceptNewPriceUpdater=r,this.addItemToBasketUpdater=i,this.addUserToBasketItem=a,this.basketCreator=n,this.basketFetcher=o,this.bookBasketUpdater=s,this.deleteBasketUpdater=l,this.getMiAutoSugestionFetcher=u,this.getUserDefaultMIValueFetcher=c,this.helpers=d,this.removeItemFromBasketUpdater=h,this.revalidateBasketUpdater=p,this.setBasketItemMiGroupUpdater=m,this.setBasketItemMiValueUpdater=f,this.validateMiFreeValue=v,this.sendBasketForApprovalUpdater=y,this.getUserFetcher=b,this.getUserBasketsFetcher=g,this.SetBasketItemLeadPassenger=S,this.moveItemToADifferentBasket=C,this.updateBasketNotesUpdater=A,this.updateBasketTitleUpdater=T,this.setPaymentMethodUpdater=D,this.getCancellationInfoFetcher=P,this.userService=F,this.modalService=k,this.addGuestToBasketItem=_,this.currentBaskets=[],this.highlightBasketItemsEmitter=new t.Subject,this.basketChangeEmitter=new t.BehaviorSubject(""),this.selectedBasketId="",this.baskets=new t.BehaviorSubject([]),this.basketList=[{type:ne.Flight,text:"FLIGHTS",price:0,co2:0},{type:ne.Rail,text:"RAIL",price:0,co2:0},{type:ne.Hotel,text:"HOTELS",price:0,co2:0},{type:ne.Cab,text:"TAXIS",price:0,co2:0},{type:ne.Car,text:"CARS",price:0,co2:0},{type:ne.Eurostar,text:"EUROSTAR",price:0,co2:0},{type:ne.InternationalRail,text:"INTERNATIONAL RAIL",price:0,co2:0},{type:ne.Parking,text:"PARKING",price:0,co2:0},{type:ne.Lounge,text:"LOUNGES",price:0,co2:0},{type:ne.Coach,text:"COACH",price:0,co2:0},{type:ne.FastTrack,text:"FAST_TRACK",price:0,co2:0}],this.basketPrices=new t.BehaviorSubject({total:null,totalCo2:null,list:this.basketList}),this.menuState=e.MenuSlideEnum.OUT,this.requiresService=new bi(k,this),this.userService.changeUser.subscribe({next:function(){R.reset()}})}return Object.defineProperty(i.prototype,"currentBasketID",{get:function(){return this.basketChangeEmitter.value},set:function(e){e!==this.currentBasketID&&this.basketChangeEmitter.next(e)},enumerable:!1,configurable:!0}),i.prototype.getRequiresReasonService=function(){return this.requiresService},i.prototype.reset=function(){var e=this;this.userService.getfullUserDetails(!1).userData.value?this.getUserBasketsFetcher.fetchList({basketStatus:P.Open,user:this.userService.getfullUserDetails(!0).userData.value.user_id.toString()}).pipe(r.take(1)).subscribe((function(t){var r=t.map((function(t){if(t){var r=e.findBasket(t.id);return r||(r=new gi(t,e.helpers,e,e.getUserFetcher,e.requiresService),e.currentBaskets.push(r)),r}})),i=e.helpers.clone(r);if(!e.userService.bobo)return(i=i.filter((function(e){return!e.subject.value.invokedUser}))).length>0?e.currentBasketID=i[0].id:e.currentBasketID=null,void e.baskets.next(r);e.baskets.next(r),r.length>0?e.currentBasketID=r[0].id:e.currentBasketID=null}),(function(e){console.error(e)})):(this.currentBaskets.forEach((function(e){return e.subject.unsubscribe()})),this.currentBaskets=[],this.currentBasketID=null,this.baskets.next(this.currentBaskets))},i.prototype.getAllOpenBaskets=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(i){return[2,this.getUserBasketsFetcher.fetchList({basketStatus:P.Open,user:e}).pipe(r.take(1),r.map((function(e){return e.length&&e.forEach((function(e){if(!t.findBasket(e.id)){var r=new gi(e,t.helpers,t,t.getUserFetcher,t.requiresService);t.currentBaskets.push(r)}})),e}))).toPromise()]}))}))},i.prototype.addToBasket=function(t,i,a,n,o,s){return void 0===n&&(n=[]),y(this,void 0,void 0,(function(){var l,u,c=this;return b(this,(function(d){switch(d.label){case 0:return s?(i=this.findBasket(this.currentBasketID),[3,8]):[3,1];case 1:return[4,this.checkBasketForInvoked(i,this.userService.bobo)];case 2:switch(d.sent()){case e.DifferentInvokdedUserReasons.continue:return[3,3];case e.DifferentInvokdedUserReasons.cancel:return[3,4];case e.DifferentInvokdedUserReasons.newBasket:return[3,5];case e.DifferentInvokdedUserReasons.research:return[3,7]}return[3,8];case 3:return[3,8];case 4:return[2,e.DifferentInvokdedUserReasons.cancel];case 5:return[4,this.createBasket()];case 6:return i=d.sent(),this.currentBasketID=i.id,[3,8];case 7:return this.userService.setBobo(Gt.makeTravellerObjectFromUser(i.subject.value.invokedUser)),[2,e.DifferentInvokdedUserReasons.research];case 8:return(null==(l=this.userService.getUserFavoriteObject(dt.AllowSameTravellesrPerBasket))?void 0:l.value)&&n&&n.length>0?[4,this.isSameTravellesrPerBasket(i,n)]:[3,14];case 9:switch(d.sent()){case e.DifferentTraveller.continue:return[3,10];case e.DifferentTraveller.cancel:return[3,11];case e.DifferentTraveller.newBasket:return[3,12]}return[3,14];case 10:return[3,14];case 11:return[2,e.DifferentInvokdedUserReasons.cancel];case 12:return[4,this.createBasket()];case 13:return i=d.sent(),this.currentBasketID=i.id,[3,14];case 14:return t.basket=i.id,t.convertCurrencyTo="GBP",(null==n?void 0:n.length)>0&&(t.users=this.helpers.makeUsers(n.filter((function(e){return!e.guest}))),t.guests=this.helpers.makeUsers(n.filter((function(e){return e.guest}))),t.leadPassenger=n[0].id,t.leadPassengerType=n[0].guest?Y.Guest:Y.User),t.outboundDate=t.outboundDate?new Date(this.helpers.formatIsoDateTime(t.outboundDate)):t.outboundDate,t.inboundDate=t.inboundDate?new Date(this.helpers.formatIsoDateTime(t.inboundDate)):t.inboundDate,t.requiresReason=o,t=this.checkDetails(t),u=this.userService.findService(t.service).type,this.removeBookedBasket(),t&&i&&this.addItemToBasketUpdater.updateOne(t).pipe(r.take(1)).subscribe((function(e){i.next(Object.assign(Object.assign({},i.subject.value),e)),a.search_objects[u].booking_chosen=!0,a.search_objects[u].chosen=!1;var t=e.basketItems;c.highlightBasketItemsEmitter.next(t),c.basketChangeEmitter.next(e.id)}),(function(e){console.error(e),i.next(i.subject.value)})),[2,e.DifferentInvokdedUserReasons.continue]}}))}))},i.prototype.checkBasketForInvoked=function(t,r){var i;return(null===(i=t.subject.value.invokedUser)||void 0===i?void 0:i.id)!==(null==r?void 0:r.id)?this.modalService.open(d.DifferentInvokdedUserComponent,{},{basketBobo:t.subject.value.invokedUser,currentBobo:r}):Promise.resolve(e.DifferentInvokdedUserReasons.continue)},i.prototype.isSameTravellesrPerBasket=function(t,r){var i,a,n,o=!1;try{o=(null===(a=null===(i=t.subject.value.basketItems[0])||void 0===i?void 0:i.users)||void 0===a?void 0:a.length)===(null==r?void 0:r.length)&&(null===(n=t.subject.value.basketItems[0])||void 0===n?void 0:n.users.every((function(e){return r.some((function(t){return t.id===e.id}))})))}catch(e){console.error("+++ Error determening same travellers: "+e+" +++")}return t.subject.value.basketItems.length>0&&!o?this.modalService.open(d.DifferentTravellerPerBasketComponent,{},{userInBasket:t.subject.value.basketItems[0].users,travellers:r}):Promise.resolve(e.DifferentTraveller.continue)},i.prototype.loadBasket=function(e){var t=this.findBasket(e);t||(t=new gi({id:e,basketItems:[]},this.helpers,this,this.getUserFetcher,this.requiresService),this.currentBaskets.push(t)),this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:e}).subscribe((function(e){t.next(e)}))},i.prototype.subsribeToBasket=function(e,t){var r=this.findBasket(e);r&&r.subject.subscribe(t)},i.prototype.removeExpiredItems=function(e){var t=this;this.findBasket(e).subject.value.basketItems.filter((function(e){return 0!==e.latestValidationPriceDifference||e.expired})).forEach((function(r){t.removeBasketItem(e,r)}))},i.prototype.removeBasketItem=function(e,t){return y(this,void 0,void 0,(function(){var r,i,a=this;return b(this,(function(n){switch(n.label){case 0:return r=this.findBasket(e),t.service.type!==ne.Hotel?[3,4]:(i=r.subject.value.basketItems.filter((function(e){return t.detail.hotelId===e.detail.hotelId&&t.detail.rooms[0].id===e.detail.rooms[0].id&&t.detail.rooms[0].checkIn===e.detail.rooms[0].checkIn&&t.detail.rooms[0].checkOut===e.detail.rooms[0].checkOut}))).length>1?[4,this.modalService.open(d.WarningRemoveModalComponent)]:[3,2];case 1:return n.sent(),i.forEach((function(t){a.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),a.basketChangeEmitter.next(e)}))})),[3,3];case 2:this.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),a.basketChangeEmitter.next(e)})),n.label=3;case 3:return[3,5];case 4:this.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),a.basketChangeEmitter.next(e)})),n.label=5;case 5:return[2]}}))}))},i.prototype.getDefaultBasket=function(e){return void 0===e&&(e=!1),y(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,this.findOrCreateBasket(this.currentBasketID,e).then((function(e){return e}))];case 1:return[2,t.sent()]}}))}))},i.prototype.findBasket=function(e){return this.currentBaskets.find((function(t){return t.id===e||t.tempid===e}))},i.prototype.findOrCreateBasket=function(e,t){return void 0===t&&(t=!1),y(this,void 0,void 0,(function(){var r,i;return b(this,(function(a){switch(a.label){case 0:return r=null,e?[3,7]:[4,this.getAllOpenBaskets(this.userService.getfullUserDetails(!0).userData.value.user_id.toString())];case 1:return i=a.sent(),this.userService.bobo||(i=i.filter((function(e){return!e.invokedUser}))),(null==i?void 0:i.length)?[3,3]:[4,this.createBasket()];case 2:return r=a.sent(),[3,6];case 3:return"BOOKED"!==(r=this.findBasket(i[0].id)).subject.value.status||t?[3,5]:(console.warn("+++ Retrieved basket is in booked status - creating a new one +++"),[4,this.createBasket()]);case 4:r=a.sent(),this.currentBaskets.push(r),a.label=5;case 5:this.baskets.next(this.currentBaskets),a.label=6;case 6:return[3,8];case 7:r=this.findBasket(e),a.label=8;case 8:return[2,r]}}))}))},i.prototype.createBasket=function(){return y(this,void 0,void 0,(function(){var e,t,r;return b(this,(function(i){switch(i.label){case 0:return e={id:"TEMPID_"+l.default().unix().toString(),owner:null,reference:null,title:null,notes:null,createdAt:null,updatedAt:null,basketItems:[],status:null,validated:!1},t=new gi(e,this.helpers,this,this.getUserFetcher,this.requiresService),[4,this.createBasketOnDB(t)];case 1:return r=i.sent(),this.currentBaskets.push(r),this.baskets.next(this.currentBaskets),this.basketChangeEmitter.next(r.id),[2,r]}}))}))},i.prototype.createBasketOnDB=function(e){var t,i,a=this,n=(null===(t=this.userService.bobo)||void 0===t?void 0:t.id)?{invokedUser:null===(i=this.userService.bobo)||void 0===i?void 0:i.id}:{};return new Promise((function(t,i){a.basketCreator.updateOne(n).pipe(r.take(1)).subscribe((function(r){e.id=r.id,e.next(r),t(e)}),(function(e){i(e)}),(function(){}))}))},i.prototype.toggleMenu=function(){this.menuState===e.MenuSlideEnum.IN||this.menuState===e.MenuSlideEnum.FLAT?this.menuState=e.MenuSlideEnum.OUT:this.menuState=e.MenuSlideEnum.IN},i.prototype.closeMenu=function(){this.menuState=e.MenuSlideEnum.IN},i.prototype.getLatestBasketItemForTypes=function(e){return(e||[]).reduce((function(e,t){return e[t.service.type]=t,e}),{})},i.prototype.checkDetails=function(e){var t=this.userService.findService(e.service);if(!t)return console.error("Unable to find service for basket item : "+e.service),null;var r=new u.default;r.addFormat("js-date-time",(function(e){return"object"==typeof e&&e.hasOwnProperty("toISOString")&&(e=e.toISOString()),!isNaN(Date.parse(e))})),r.addFormat("railSeating",(function(){return!0})),r.addFormat("passport",(function(){return!0})),r.addFormat("specialRequest",(function(){return!0}));var i=r.compile(t.detailSchema),a=r.compile(t.searchQuerySchema);if(e.searchQuery=this.helpers.sanitizeMomentDates(e.searchQuery),e.detail=this.helpers.removeNulls(e.detail),!a(e.searchQuery)){var n="Item searchQuery is not valid for "+t.name+" search schema.";return console.warn("searchSchema",t.searchQuerySchema),console.warn("item.searchQuery",e.searchQuery),console.warn("Search Query Validation errors",a.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}if(!i(e.detail)){n="Item detail is not valid for "+t.name+" detail schema.";return console.warn("detailSchema",t.detailSchema),console.warn("item.detail",e.detail),console.warn("Detail errors",i.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}return e.lowestPrice&&(e.lowestPrice=+e.lowestPrice.toFixed(2)),e},i.prototype.getNumberItemsForBasket=function(e){return void 0===e&&(e=null),(null==(e=e||this.findBasket(this.currentBasketID))?void 0:e.subject.value.basketItems.length)||0},i.prototype.removeBasket=function(e){var i=this;if(e)return this.deleteBasketUpdater.updateOne({id:e}).pipe(r.take(1),r.switchMap((function(r){var a,n;return null===(a=i.findBasket(e))||void 0===a||a.destructor(),i.currentBaskets=i.currentBaskets.filter((function(t){return t.id!==e})),i.baskets.next(i.currentBaskets),e===i.currentBasketID&&(i.currentBasketID=(null===(n=i.currentBaskets[0])||void 0===n?void 0:n.id)||null),t.of(r)})))},i.prototype.continueSearchAndBook=function(e,t,r){var i=this.getLatestBasketItemForTypes(e),a=r.getHighestSearchPriorityObject(i);return a?(r.searches[a.type].updateFromPreviousSearches(i),[a.searchUrl]):t},i.prototype.addTravellers=function(t,r,i,a){var n=this;void 0===a&&(a=0);var o=this.findBasket(t);if(a<i.length){var s=i[a],l=s.isChild?e.ɵf.Child:s.isInfant?e.ɵf.Infant:e.ɵf.Adult;s.guest?this.addGuestToBasketItem.updateOne({convertCurrencyTo:"GBP",basketItem:r.id,guests:[{id:s.id,passengerType:l}]}).subscribe((function(){n.addTravellers(o.id,r,i,a+1)})):this.addUserToBasketItem.updateOne({convertCurrencyTo:"GBP",basketItem:r.id,users:[{id:s.id,passengerType:l}],withSupplemental:!1}).subscribe((function(){n.addTravellers(o.id,r,i,a+1)}))}else this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:o.id}).subscribe((function(e){o.subject.next(Object.assign(Object.assign({},o.subject.value),e))}),(function(e){}),(function(){o.next(o.subject.value)}))},i.prototype.setLeadPassenger=function(e,t,r,i,a){var n=this;void 0===i&&(i=0),void 0===a&&(a=Y.User);var o=this.findBasket(e);i<1?this.SetBasketItemLeadPassenger.updateOne({convertCurrencyTo:"GBP",id:t.id,userOrGuest:r.id,withSupplemental:!1,leadPassengerType:a}).subscribe((function(){}),(function(){}),(function(){n.setLeadPassenger(o.id,t,r,i+1)})):this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:o.id}).subscribe((function(e){o.subject.next(Object.assign(Object.assign({},o.subject.value),e))}),(function(e){}),(function(){o.next(o.subject.value)}))},i.prototype.updateBasket=function(e,t){var i=this;return new Promise((function(a,n){t.pipe(r.take(1)).subscribe((function(t){i.findBasket(e).next(t),a()}),(function(t){console.error(t);var r=i.findBasket(e);r.next(r.subject.value),n(t)}),(function(){}))}))},i.prototype.revalidate=function(e){this.updateBasket(e,this.revalidateBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e}))},i.prototype.setBasketItemMiGroup=function(e,t,r){this.updateBasket(e,this.setBasketItemMiGroupUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t,group:r}))},i.prototype.acceptNewPrice=function(e,t){this.updateBasket(e,this.acceptNewPriceUpdater.updateOne({convertCurrencyTo:"GBP",id:t.id}))},i.prototype.validateFreeValeMi=function(e,t){var r=this;return new Promise((function(i,a){r.validateMiFreeValue.test({mi:e.id,freeValue:t}).subscribe(i,a)}))},i.prototype.setMiFreeValue=function(e,t,i,a,n){var o=this;void 0===a&&(a=null);var s=this.findBasket(e),l={convertCurrencyTo:"GBP",mi:t.id,miFreeValue:i};return a&&(n?l.guest=a:l.user=a),new Promise((function(e,t){o.setBasketItemMiValueUpdater.updateOne(l).pipe(r.take(1)).subscribe((function(e){s.next(e)}),(function(e){t(e)}),(function(){e()}))}))},i.prototype.setMiSelectedValue=function(e,t,r,i,a){void 0===i&&(i=null);var n={convertCurrencyTo:"GBP",mi:t.id,miValue:r};return i&&(a?n.guest=i:n.user=i),this.updateBasket(e,this.setBasketItemMiValueUpdater.updateOne(n))},i.prototype.getMiAutoSugestions=function(e,i,a){null==a||a.next(!0);var n=this.getMiAutoSugestionFetcher.fetchList({mi:e,partialValue:i}),o=this.getMiAutoSugestionFetcher.fetchList({mi:e,partialLabel:i});return t.forkJoin([n,o]).pipe(r.map((function(e){var t=S(e,2),r=C(t[0],t[1]);return r=r.filter((function(e,t){return r.findIndex((function(t){return t.id==e.id}))===t})),console.log(r),null==a||a.next(!1),r})))},i.prototype.getUserDefaultMIValue=function(e,t,i){return null==i||i.next(!0),this.getUserDefaultMIValueFetcher.fetchOne({mi:e,user:t}).pipe(r.take(1))},i.prototype.saveMiData=function(e,t){t.forEach((function(t){t.miPerItem.forEach((function(t){t.save(e,null)})),t.users.forEach((function(r){t.miPerUser[r].managementInfo.forEach((function(t){t.save(e,r)}))})),t.guests.forEach((function(r){t.miPerGuest[r].managementInfo.forEach((function(t){t.save(e,r,!0)}))}))}))},i.prototype.sendBasketForApproval=function(e){return this.updateBasket(e,this.sendBasketForApprovalUpdater.updateOne({convertCurrencyTo:"GBP",basket:e}).pipe(r.take(1)))},i.prototype.setBasketItemPaymentOption=function(e,t,r){return this.updateBasket(e.id,this.setPaymentMethodUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,paymentMethod:r}))},i.prototype.bookBasket=function(e,t,r){return this.updateBasket(e,this.bookBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e,supplementaryInfo:t,additionalEmail:r}))},i.prototype.moveBasketItem=function(e,t,r){var i=this;this.moveItemToADifferentBasket.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,newBasket:r}).subscribe((function(){i.loadBasket(e),i.loadBasket(r)}))},i.prototype.updateBasketNotes=function(e,t){this.updateBasket(e,this.updateBasketNotesUpdater.updateOne({convertCurrencyTo:"GBP",id:e,notes:t}))},i.prototype.updateBasketTitle=function(e,t){this.updateBasket(e,this.updateBasketTitleUpdater.updateOne({convertCurrencyTo:"GBP",id:e,newTitle:t}))},i.prototype.getBasket=function(e){return this.basketFetcher.fetchOne(e)},i.prototype.atLeastOneSearchChosen=function(){return!!this.currentBaskets.filter((function(e){return e.subject.value.basketItems.length})).length},i.prototype.getBasketStats=function(e){var t,r,i,a=this,n=(null===(i=null===(r=null===(t=this.baskets.value[e])||void 0===t?void 0:t.subject)||void 0===r?void 0:r.value)||void 0===i?void 0:i.prices)||{},o=Object.keys(n)[0];return o?(this.basketPrices.value.currency=o,this.basketPrices.value.total=this.baskets.value[e].subject.value.prices[o]):this.basketPrices.value.total=0,this.basketPrices.value.list.forEach((function(t){var r,i,n,o,s,l;t.price=null===(n=null===(i=null===(r=a.baskets.value[e])||void 0===r?void 0:r.subject)||void 0===i?void 0:i.value)||void 0===n?void 0:n.basketItems.filter((function(e){return e.service.type===t.type})).reduce((function(e,t){return e+t.price}),0),t.co2=null===(l=null===(s=null===(o=a.baskets.value[e])||void 0===o?void 0:o.subject)||void 0===s?void 0:s.value)||void 0===l?void 0:l.basketItems.filter((function(e){return e.service.type===t.type})).reduce((function(e,t){return e+t.co2PerItem}),0)})),this.basketPrices.value.totalCo2=this.basketPrices.value.list.reduce((function(e,t){return e+t.co2}),0),this.basketPrices},i.prototype.canCancel=function(e){return this.getCancellationInfoFetcher.fetchOne({basketItem:e.id})},i.prototype.removeBookedBasket=function(){this.currentBaskets=this.currentBaskets.reduce((function(e,t){return t.subject.value.status!==P.Booked&&e.push(t),e}),[]),this.baskets.next(this.currentBaskets)},i.prototype.showErrorModal=function(){var e,t,r,i,a=this.userService.fullUserDetails.allDetails.value.office,n=(null==a?void 0:a.supportEmail)||"",o=(null===(e=null==a?void 0:a.supportPhoneNumber)||void 0===e?void 0:e.countryCode)?"+"+(null===(t=null==a?void 0:a.supportPhoneNumber)||void 0===t?void 0:t.countryCode):"",s=(null===(r=null==a?void 0:a.supportPhoneNumber)||void 0===r?void 0:r.number)?null===(i=null==a?void 0:a.supportPhoneNumber)||void 0===i?void 0:i.number:"";this.modalService.open(d.ModalErrorComponent,{},{error:"There are missing values in the Management Information section within your configuration.",miError:!0,email:n,number:o+" "+s})},i}(),Ci="results_hotel_avallibility",Ai=function(){function e(e,r,i,a){this.avalibilityFethcer=e,this.sessionStorage=r,this.helpers=i,this.environment=a,this.data=null,this.behaviours={},this.toFetch=[],this.fetching=new t.BehaviorSubject(!1),this.currencies={}}return e.prototype.readFromSession=function(){var e=this,r=this.sessionStorage.getSessionItem(Ci)||{};return Object.values(r).forEach((function(r){e.behaviours[r.hotelId]=new t.BehaviorSubject(r)})),r},e.prototype.reset=function(){var e=this;this.data={},this.currencies={},this.toFetch=[],this.fetching.next(!1),this.sessionStorage.removeSessionItem(Ci),Object.values(this.data).forEach((function(t){e.behaviours[t.hotelId].complete(),delete e.behaviours[t.hotelId]})),this.behaviours={}},e.prototype.getAvailabilityForId=function(e,r){var i;if(null===(i=null==r?void 0:r.availableRates)||void 0===i?void 0:i.rooms){if(this.behaviours[e.hotel])return this.behaviours[e.hotel];this.behaviours[e.hotel]=new t.BehaviorSubject(null);var a=r.availableRates;return a.minprice=r.availableRates.rooms[0]?r.availableRates.rooms[0].total:0,a.maxprice=a.minprice?r.availableRates.rooms[r.availableRates.rooms.length-1].total:0,this.behaviours[e.hotel].next(a),this.behaviours[e.hotel]}return this.data=this.data||this.readFromSession(),this.behaviours[e.hotel]||this._getAvailabilityForId(e)},e.prototype.getAvailabilityValue=function(e){var t;return this.data=this.data||this.readFromSession(),(null===(t=this.behaviours[e.id])||void 0===t?void 0:t.value)||{}},e.prototype.updateHotel=function(e){return e.availableRates||(e.availableRates=this.getAvailabilityValue(e)),e},e.prototype.setHotelAvalability=function(e){var t;return e.receivedJitRules=!0,e.availableRates&&(null==e?void 0:e.availableRates.hotelId)&&this.behaviours[null===(t=null==e?void 0:e.availableRates)||void 0===t?void 0:t.hotelId]&&(this.data[e.availableRates.hotelId]=e.availableRates,this.behaviours[e.availableRates.hotelId].next(e.availableRates)),e},e.prototype._getAvailabilityForId=function(e){return this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0),this.fetching.value||(this.timeout=window.setTimeout(this.fetchAvalilbility.bind(this),this.environment.autoFetchHotelTimeout)),this.toFetch.push(e),!this.fetching.value&&this.toFetch.length>=this.environment.numberOfHotelsToFetch&&this.fetchAvalilbility(),this.behaviours[e.hotel]=new t.BehaviorSubject(null),this.behaviours[e.hotel]},e.prototype.fetchAvalilbility=function(){var e,t,i,a,n,o=this;this.fetching.next(!0),this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0);var s=this.toFetch.slice(0,this.environment.numberOfHotelsToFetch);this.toFetch=this.toFetch.slice(this.environment.numberOfHotelsToFetch),console.log("Hotels still to fetch",this.toFetch.length);var l={hotel:s.map((function(e){return e.hotel})),currency:null===(e=s[0])||void 0===e?void 0:e.currency,endDate:null===(t=s[0])||void 0===t?void 0:t.endDate,startDate:null===(i=s[0])||void 0===i?void 0:i.startDate,occupants:null===(a=s[0])||void 0===a?void 0:a.occupants,rooms:null===(n=s[0])||void 0===n?void 0:n.rooms};this.avalibilityFethcer.fetchList(l).pipe(r.take(1)).subscribe((function(e){e.forEach((function(e){(e=o.helpers.clone(e)).rooms=(e.rooms||[]).filter((function(e){return e.total>0})).map((function(e){return(e=o.helpers.clone(e)).LocalPrice=e.currencyConversion?e.currencyConversion.localTotal:e.total,e.LocalCurrency=e.currencyConversion?e.currencyConversion.localCode:e.currencyCode,e})),e.currencies=e.rooms.reduce((function(e,t){return t.currencyConversion&&(e[t.currencyConversion.convertedCode]=e[t.currencyConversion.convertedCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},e[t.currencyConversion.convertedCode].maxprice=Math.max(e[t.currencyConversion.convertedCode].maxprice,t.currencyConversion.convertedTotal),e[t.currencyConversion.convertedCode].minprice=Math.min(e[t.currencyConversion.convertedCode].minprice,t.currencyConversion.convertedTotal),o.currencies[t.currencyConversion.localCode]=o.currencies[t.currencyConversion.localCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},o.currencies[t.currencyConversion.localCode].minprice=Math.ceil(Math.min(o.currencies[t.currencyConversion.localCode].minprice,t.currencyConversion.localTotal)),o.currencies[t.currencyConversion.localCode].maxprice=Math.ceil(Math.max(o.currencies[t.currencyConversion.localCode].maxprice,t.currencyConversion.localTotal))),e}),{});var t=e.rooms.map(o.helpers.mapFieldFromObject("total"));t.length||t.push(0),e.minprice=Math.min.apply(Math,C(t)),e.maxprice=Math.max.apply(Math,C(t)),e.rooms=e.rooms,(null==e?void 0:e.hotelId)&&o.behaviours[e.hotelId]&&(o.data[e.hotelId]=e,o.behaviours[e.hotelId].next(e))})),o.sessionStorage.setSessionItem(Ci,e),o.toFetch.length>0?setTimeout((function(){o.fetchAvalilbility()}),o.environment.hotelAvalibilityTimeout):o.fetching.next(!1)}),(function(e){return console.error("+++ Error recovering hotel availabilty: "+e+" - reseting availabilty +++"),o.fetching.next(!1),null}))},e.prototype.maxPriceForCurrency=function(e){return(this.currencies[e]||{maxprice:Number.MAX_VALUE,minprice:Number.MIN_VALUE}).maxprice},e.prototype.numberOfHotelsWithPrice=function(){var e,t,r=0;if(this.data)try{for(var i=g(Object.entries(this.data)),a=i.next();!a.done;a=i.next()){var n=S(a.value,2),o=(n[0],n[1]);(null==o?void 0:o.prpn)&&r++}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e}(),Ti=function(){function e(){}return e.prototype.serialize=function(e){return Object.keys(e).reduce((function(t,r){return(t.length?t+"&":"")+r+"="+encodeURIComponent("object"==typeof e[r]?JSON.stringify(e[r]):e[r])}),"")},e}(),Di="USER_SIGNEDOUT",Pi=function(){function e(e,r,i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g){this.getUserFetcher=e,this.userUiConfigsFetcher=r,this.userProductsFetcher=i,this.userMessagesFetcher=a,this.baseConfirmMessagesUpdater=n,this.getCompaniesFetcher=o,this.getCompanyFetcher=s,this.setUserLanguageUpdater=l,this.editUserUpdater=u,this.createGuestUpdater=c,this.getUserGuestsFetcher=d,this.getOfficeFetcher=h,this.getRedirectApproverFetcher=p,this.addRedirectApproverUpdater=m,this.removeRedirectApproverUpdater=f,this.storageService=v,this.helpers=y,this.webTokenService=b,this.searchCompanyApproversFetcher=g,this.fullUserDetails={bookingAllowedFor:"",messages:new t.BehaviorSubject(null),travllerObject:new t.BehaviorSubject(null),userConfigs:new t.BehaviorSubject(null),userData:new t.BehaviorSubject(null),userServices:new t.BehaviorSubject(null),allDetails:new t.BehaviorSubject(null)},this.changeUser=new t.BehaviorSubject(null),this._bobo=null,this.invokedUserUpdater=b.getInvokedUserObservable()}return e.prototype.setBobo=function(e){var t;return y(this,void 0,void 0,(function(){return b(this,(function(r){return!e||e.id?e===this._bobo||(null==e?void 0:e.id)&&(null==e?void 0:e.id)===(null===(t=this._bobo)||void 0===t?void 0:t.id)?[2,!0]:(this._bobo=e,this.invokedUserUpdater.next(e||null),[2,this.updateServices()]):[2,!1]}))}))},Object.defineProperty(e.prototype,"bobo",{get:function(){return this._bobo},enumerable:!1,configurable:!0}),e.prototype.updateServices=function(){var e=this;return new Promise((function(t,r){e.userProductsFetcher.fetchKeyedObjectArray("type").subscribe((function(t){e.fullUserDetails.userServices.next(t),e.checkEmitUser()}),(function(e){t(!1)}),(function(){return t(!0)}))}))},e.prototype.setUser=function(e){var t=this,i=this.fullUserDetails.userData.value;i&&i.username===e.username||((null==e?void 0:e.user_id)&&this.getUserFetcher.fetchOne({id:e.user_id.toString()}).pipe(r.take(1)).subscribe((function(e){t.fullUserDetails.allDetails.next(e),t.checkEmitUser()})),this.userUiConfigsFetcher.fetchKeyedObject("key").subscribe((function(e){t.fullUserDetails.userConfigs.next(e),t.checkEmitUser()}),(function(e){console.error(e)})),this.userProductsFetcher.fetchKeyedObjectArray("type").subscribe((function(e){t.fullUserDetails.userServices.next(e),t.checkEmitUser()})),this.userMessagesFetcher.fetchList().subscribe((function(e){t.fullUserDetails.messages.next(e),t.checkEmitUser()}),(function(e){console.error(e)})),this.fullUserDetails.travllerObject.next(Gt.makeTravellerObjectFromUserData(e))),(null==e?void 0:e.user_id)&&this.getUserFetcher.fetchOne({id:null==e?void 0:e.user_id.toString()}).pipe(r.take(1)).subscribe((function(e){t.fullUserDetails.allDetails.next(e),t.checkEmitUser()})),this.fullUserDetails.userData.next(e),this.storageService.setSessionItem("lightning_user_data",e)},e.prototype.canBookGuest=function(){return this.fullUserDetails.allDetails.value.canBookGuest},e.prototype.checkEmitUser=function(){this.fullUserDetails.userConfigs.value&&this.fullUserDetails.userData.value&&this.fullUserDetails.userServices.value&&this.fullUserDetails.messages.value&&this.changeUser.next(this.fullUserDetails)},e.prototype.getfullUserDetails=function(e){return void 0===e&&(e=!1),this._getFullUserDetails()},e.prototype._getFullUserDetails=function(){return this.fullUserDetails||this.storageService.getSessionItem("lightning_user_data")},e.prototype.getUserDropdownInfo=function(){var e={name:"Unable to retrieve name.",email:"Unable to rerieve email",account_type:"Unknown",title:""},t=this.getUsersFullname(),r=this.getUserEmail(),i=this.getUserBookingType(),a=this.getUserTitle();return t&&(e.name=t),r&&(e.email=r),i&&(e.account_type=i),a&&(e.title=a),e},e.prototype.getUserTitle=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.title:""},e.prototype.getUserForename=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.forename:""},e.prototype.getUserSurname=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.surname:""},e.prototype.getFullPhoneNumber=function(){return""},e.prototype.getUserEmail=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.username:""},e.prototype.getUserBookingType=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.booker_type:null},e.prototype.getUsersFullname=function(){var e=this.getfullUserDetails();return!(!e||!e.userData)&&e.userData.value.forename+" "+e.userData.value.surname},e.prototype.getUsersTitleAndFullName=function(){var e=this.getfullUserDetails();return!(!e||!e.userData)&&e.userData.value.title+" "+e.userData.value.forename+" "+e.userData.value.surname},e.prototype.getUserFavoriteValue=function(e,t){void 0===t&&(t=ht.non);var r=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(r,e.value,"config",e.value)},e.prototype.getUserFavoriteObject=function(e){var t=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(t,e.value,"config")},e.prototype.getUserFavoriteNumber=function(e){var t=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(t,e.value,"config","value")},e.prototype.isUserFavoriteSet=function(e,t){void 0===t&&(t=ht.non);var r=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(r,e.value,"config","value")},e.prototype.createSelfTraveller=function(){return this.fullUserDetails.travllerObject.value},e.prototype.travellerIsUser=function(e){return!1},e.prototype.emptyUserData=function(){this.fullUserDetails.userData.next(null),this.fullUserDetails.userConfigs.next(null),this.fullUserDetails.userServices.next(null),this.fullUserDetails.messages.next(null),this.changeUser.next(this.fullUserDetails)},e.prototype.createGuestUser=function(e,t,r,i,a,n,o,s,l,u,c){return{isChild:l,isInfant:u,childDOB:c,guest:!0,id:"",forename:t,surname:r,email:i,title:e,name:[e,t,r].join(" ")}},e.prototype.userIsClient=function(){return!0},e.prototype.hasIgnorePolicy=function(){return!1},e.prototype.useAgentCanBookFor=function(){return!0},e.prototype.canBook=function(e){var t=this.fullUserDetails.userServices.value;return t&&!!t[e]},e.prototype.isTraveller=function(){return this.fullUserDetails.userData.value.booker_type===k.Traveller},e.prototype.userIsAgent=function(){return this.fullUserDetails.userData.value.agentBooker},e.prototype.userIsAdmin=function(){return this.fullUserDetails.userData.value.admin},e.prototype.userIsCompanyAdmin=function(){return this.fullUserDetails.userData.value.company_admin},e.prototype.userIsTmcAdmin=function(){return this.fullUserDetails.userData.value.tmc_admin},e.prototype.userTmcId=function(){return this.fullUserDetails.userData.value.tmc_id},e.prototype.isSelfBook=function(){return this.fullUserDetails.userData.value.booker_type===k.SelfBook},e.prototype.isBooker=function(){return this.fullUserDetails.userData.value.booker_type===k.Booker},e.prototype.getUserId=function(){return this.fullUserDetails.userData.value.user_id},e.prototype.userHasServiceProvider=function(e,t){return!!this.fullUserDetails.userServices.value&&!!(this.fullUserDetails.userServices.value[e]||[]).find((function(e){return e.name===t}))},e.prototype.findService=function(e){return this.fullUserDetails.userServices.value?this.helpers.findService(this.fullUserDetails.userServices.value,e):null},e.prototype.getUserMessages=function(){return this.userMessagesFetcher.fetchList()},e.prototype.confirmMessages=function(e){return this.baseConfirmMessagesUpdater.updateOne({messages:e})},e.prototype.userIsRoot=function(){return this.fullUserDetails.userData.value.booker_type===k.Root},e.prototype.userIsSupportAgent=function(){return!!this.fullUserDetails.userData.value.support_agent},e.prototype.getUserCompanies=function(e){return void 0===e&&(e=null),e?this.getCompaniesFetcher.fetchList({query:e}).pipe(r.take(1)):this.getCompaniesFetcher.fetchList().pipe(r.take(1))},e.prototype.getCompanyById=function(e,t){return void 0===t&&(t=!1),this.getCompanyFetcher.fetchOne({id:e}).pipe(r.take(1))},e.prototype.getUserCompany=function(){return this.getCompanyById(this.fullUserDetails.userData.value.company_id.toString())},e.prototype.getUser=function(e){var t=this.getfullUserDetails();return this.getUserFetcher.fetchOne({id:e||t.userData.value.user_id.toString()})},e.prototype.setUserLanguage=function(e){return this.setUserLanguageUpdater.updateOne({language:e})},e.prototype.getDocuments=function(e,t){return this.getUser(t).pipe(r.map((function(e){return e.documents||[]})),r.map((function(t){return e?t.filter((function(t){return t.docType===e})):t})))},e.prototype.editUser=function(e){var t=this;return this.editUserUpdater.updateOne(e).pipe(r.tap((function(e){return t.fullUserDetails.allDetails.next(e)})))},e.prototype.createGuest=function(e){return this.createGuestUpdater.updateOne(e).pipe(r.take(1))},e.prototype.getUserGuests=function(){return this.getUserGuestsFetcher.fetchList()},e.prototype.canInvokeUser=function(){return this.fullUserDetails.allDetails.value.canInvokeUser},e.prototype.getOffice=function(){return this.getOfficeFetcher.fetchList()},e.prototype.getRedirectApprover=function(){return this.getRedirectApproverFetcher.fetchList()},e.prototype.addRedirectApprover=function(e){return this.addRedirectApproverUpdater.updateOne(e).pipe(r.take(1))},e.prototype.removeRedirectApprover=function(e){return this.removeRedirectApproverUpdater.updateOne({id:e})},e.prototype.getUseMiDefaultValues=function(){return this.fullUserDetails.allDetails.value.userMiDefaultValues},e.prototype.isLoggedIn=function(){return!!this.fullUserDetails.allDetails.value},e.prototype.ermCompanyType=function(){return this.fullUserDetails.userData.value.company_type},e.prototype.getSearchCompanyApprovers=function(e){return this.searchCompanyApproversFetcher.fetchList({email:e})},e}(),Fi=function(){function i(e,t,r,i,a,n,o,s){this.userService=e,this.modalService=t,this.http=r,this.router=i,this.eventMessenager=a,this.storageService=n,this.environment=o,this.searchService=s,this.loading=!1,this.isLoggedIn=!1,this.redirectUrl="",this.refreshPromise=null,this.becomingUser=!1,this.unBecomingUser=!1}return i.prototype.checkLogin=function(){return this.refreshToken()},i.prototype.refreshToken=function(){var t=this;return this.refreshPromise=this.refreshPromise||new Promise((function(i,a){t.clearRefresh(),t.http.formEncodedPostNoErrorHandling(e.URLS.Refresh,{}).pipe(r.take(1),r.map((function(e){return t.handleResponse(e)}))).subscribe((function(e){"string"==typeof e?(i(!1),t.autoLogout(i)):(i(!0),t.setRefresh())}),(function(e){t.autoLogout(i)}))})).then((function(e){return t.refreshPromise=null,e})).catch((function(e){throw t.refreshPromise=null,e})),this.refreshPromise},i.prototype.autoLogout=function(e){this.userService.isLoggedIn()||("/logon"!==this.router.url&&"/"!==this.router.url&&this.logout(),e(!1)),"/logon"!==this.router.url&&"/"!==this.router.url?(this.logout(),this.modalService.open(d.AutoLogout,{},{title:"Auto Logout",body:"You have been logged out of the system as your session has timed out. Please log on again to continue",isLoading:!1,options:{buttonCancel:!1,buttonOk:!0,buttonOkText:"Continue"}}).then((function(){e(!1)}))):e(!1)},i.prototype.clearRefresh=function(){this.timeoutSubscription&&(clearTimeout(this.timeoutSubscription),this.timeoutSubscription=null)},i.prototype.setRefresh=function(){this.timeoutSubscription=window.setTimeout(this.refreshToken.bind(this),1e3*this.environment.authRefreshTimeout)},i.prototype.becomeUser=function(t){var i=this;return this.becomingUser=!0,new Promise((function(a,n){i.clearRefresh(),i.storageService.clearSessionData(),i.http.post(e.URLS.BECOME_USER,{username:t}).pipe(r.take(1)).subscribe((function(e){i.becomingUser=!1,console.log(e),i.userService.setUser(e.jwtObject),i.searchService.reset(),i.router.navigate(["main"]),a(!0)}),(function(e){i.becomingUser=!1,n(e)}))}))},i.prototype.endBecomeUserSession=function(){var t=this;return this.unBecomingUser=!0,new Promise((function(i,a){t.clearRefresh(),t.storageService.clearSessionData(),t.searchService.reset(),t.http.post(e.URLS.END_BECOME_USER,{}).pipe(r.take(1)).subscribe((function(e){t.unBecomingUser=!1,console.log(e),t.userService.setUser(e.jwtObject),i(!0)}),(function(e){t.unBecomingUser=!1,a(e)}))}))},i.prototype.login=function(t,i,a){var n=this;return this.userService.emptyUserData(),this.storageService.clearSessionData(),this.clearRefresh(),this.userService.setBobo(null),this.http.formEncodedPostNoErrorHandling(e.URLS.AccessToken,{username:t,password:i}).pipe(r.take(1),r.map((function(e,t){return n.setRefresh(),n.handleResponse(e)})))},i.prototype.handleResponse=function(e){return"object"==typeof e&&e.jwt&&(this.userService.setUser(e.jwtObject),this.isLoggedIn=!0,delete e.jwt,delete e.jwtObject),e},i.prototype.cookieLogin=function(e){return t.of(null)},i.prototype.logout=function(){var t=this;if(this.isLoggedIn){this.userService.isUserFavoriteSet(dt.SSO_no_password);this.clearRefresh(),this.isLoggedIn=!1,this.userService.setBobo(null),this.searchService.removeAllTravellers(),this.userService.emptyUserData(),this.storageService.clearSessionData(),this.http.post(e.URLS.LOGOUT_URL).subscribe((function(e){e.LogoutSuccess||console.warn("You're not logged in, cannot log out.")}),(function(){t.eventMessenager.emit(Di,{}),t.userService.isUserFavoriteSet(dt.SSO_no_password)?t.router.navigate(["logOutDigitsUser"]):t.router.navigate(["logon"])}))}else this.router.navigate(["logon"])},i.prototype.changePassword=function(e){return t.of(null)},i.prototype.resetPassword=function(t,r){return this.http.formEncodedPost(e.URLS.RESET_PASSWORD,{passwordResetToken:t,newPassword:r})},i.prototype.recoverPassword=function(t){return this.http.formEncodedPost(e.URLS.RECOVER_PASSWORD_URL,{username:""+t},"text")},i.prototype.handleError=function(e){var t={error:e};this.modalService.open(d.ModalErrorComponent,{},t)},i}(),ki=function(){function e(){this.openModalEvent=new t.Subject}return e.prototype.open=function(e,t,r){var i=this;return void 0===t&&(t=null),void 0===r&&(r=null),"BaseModalComponent"===e.value?new Promise((function(e,t){})):new Promise((function(a,n){i.openModalEvent.next({type:e,data:r||{},options:t||{},results:a})}))},e.prototype.subscribe=function(e){return this.openModalEvent.subscribe(e)},e}(),_i=function(){function e(e,r,i){var a,n;this.getUserBasketsFetcher=e,this.searchUserCanBookFor=r,this.cancelBookingUpdater=i,this.baskets=new t.BehaviorSubject([]),this._allApprovals=!1,this._basketStatusIconClasses=((a={})[P.Approved]="ico-tick",a[P.AwaitingApproval]="ico-clock",a[P.BookingFailed]="ico-deny",a[P.Disapproved]="ico-deny",a[P.Open]="ico-calendar",a[P.PartiallyBooked]="ico-deny",a[P.Booked]="ico-deny",a),this._serviceTypeIconClasses=((n={})[ne.Cab]="ico-m-taxi",n[ne.Car]="ico-car",n[ne.Coach]="ico-bus",n[ne.Flight]="ico-flight",n[ne.Hotel]="ico-bed",n[ne.FastTrack]="ico-material ico-fast-track",n[ne.InternationalRail]="ico-rail",n[ne.Lounge]="ico-material ico-lounge",n[ne.Parking]="ico-material ico-parking",n[ne.Rail]="ico-rail",n[ne.Eurostar]="ico-material ico-euro",n[ne.Ferry]="ico-rail",n)}return Object.defineProperty(e.prototype,"allApprovals",{get:function(){return this._allApprovals},set:function(e){this._allApprovals=e},enumerable:!1,configurable:!0}),e.prototype.getUserBaskets=function(e,t){var i=this;t.next(!0),this.allApprovals&&(e.user="",e.traveller=""),this.getUserBasketsFetcher.fetchList(e).pipe(r.take(1)).subscribe((function(e){i.baskets.next(e),t.next(!1)}),(function(e){console.error(e),t.next(!1)}))},e.prototype.getSearchUserCanBookFor=function(e,i){return e.length>2?(i.next(!0),this.searchUserCanBookFor.fetchList({email:e}).pipe(r.take(1),r.map((function(e){return i.next(!1),e})))):t.of([])},e.prototype.getServiceTypeFilters=function(e){var t,r,i=[];try{for(var a=g(Object.entries(e.search_objects)),n=a.next();!n.done;n=a.next()){var o=S(n.value,1)[0];i.push(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},e.prototype.getBasketStatusFilters=function(){var e=[];return Object.values(P).forEach((function(t){return e.push(t)})),e},e.prototype.getServiceTypeFilterVanityName=function(e){switch(e){case ne.Cab:return"Taxi";case ne.InternationalRail:return"European Rail";default:return e}},e.prototype.getBasketStatusIconClass=function(e){return this._basketStatusIconClasses[e]||"ico-exclamation"},e.prototype.getServiceTypeIconClass=function(e){return this._serviceTypeIconClasses[e.service.type]||"ico-exclamation"},e.prototype.getTotalPriceForBasketItems=function(e){return e.reduce((function(e,t){return e+t.price}),0)},e.prototype.getTravellerNamesFromBasketItems=function(e){var t=[];return e.map((function(e){e.users.map((function(e){return t.push(e.forename+" "+e.surname)})),e.guests.map((function(e){return t.push(e.forename+" "+e.surname)}))})),t=C(new Set(t))},e.prototype.allBasketItemsMatchStatus=function(e,t){return e.every((function(e){return e.status===t}))},e.prototype.getHotelAddress=function(e){var t=e.county,r=e.postcode,i=e.streetName,a=e.town,n=[];return i&&n.push(i),a&&n.push(a),t&&n.push(t),r&&n.push(r),n.join(", ")},e.prototype.getHotelLocation=function(e){var t=e.county,r=e.town,i=[];return r&&i.push(r),t&&i.push(t),i.join(", ")},e.prototype.cancelBooking=function(e){return this.cancelBookingUpdater.updateOne({basketItem:e})},e}(),Ri=[{cName:"Afghanistan",dCode:"93",cCode:"AF",tCode:"AFG"},{cName:"Aland Islands",dCode:"358",cCode:"AX",tCode:"ALA"},{cName:"Albania",dCode:"355",cCode:"AL",tCode:"ALB"},{cName:"Algeria",dCode:"213",cCode:"DZ",tCode:"DZA"},{cName:"AmericanSamoa",dCode:"1684",cCode:"AS",tCode:"ASM"},{cName:"Andorra",dCode:"376",cCode:"AD",tCode:"AND"},{cName:"Angola",dCode:"244",cCode:"AO",tCode:"AGO"},{cName:"Anguilla",dCode:"1264",cCode:"AI",tCode:"AIA"},{cName:"Antarctica",dCode:"672",cCode:"AQ",tCode:"ATA"},{cName:"Antigua and Barbuda",dCode:"1268",cCode:"AG",tCode:"ATG"},{cName:"Argentina",dCode:"54",cCode:"AR",tCode:"ARG"},{cName:"Armenia",dCode:"374",cCode:"AM",tCode:"ARM"},{cName:"Aruba",dCode:"297",cCode:"AW",tCode:"ABW"},{cName:"Australia",dCode:"61",cCode:"AU",tCode:"AUS"},{cName:"Austria",dCode:"43",cCode:"AT",tCode:"AUT"},{cName:"Azerbaijan",dCode:"994",cCode:"AZ",tCode:"AZE"},{cName:"Bahamas",dCode:"1242",cCode:"BS",tCode:"BHS"},{cName:"Bahrain",dCode:"973",cCode:"BH",tCode:"BHR"},{cName:"Bangladesh",dCode:"880",cCode:"BD",tCode:"BGD"},{cName:"Barbados",dCode:"1246",cCode:"BB",tCode:"BRB"},{cName:"Belarus",dCode:"375",cCode:"BY",tCode:"BLR"},{cName:"Belgium",dCode:"32",cCode:"BE",tCode:"BEL"},{cName:"Belize",dCode:"501",cCode:"BZ",tCode:"BLZ"},{cName:"Benin",dCode:"229",cCode:"BJ",tCode:"BEN"},{cName:"Bermuda",dCode:"1441",cCode:"BM",tCode:"BMU"},{cName:"Bhutan",dCode:"975",cCode:"BT",tCode:"BTN"},{cName:"Bolivia, Plurinational State of",dCode:"591",cCode:"BO",tCode:"BOL"},{cName:"Bosnia and Herzegovina",dCode:"387",cCode:"BA",tCode:"BIH"},{cName:"Botswana",dCode:"267",cCode:"BW",tCode:"BWA"},{cName:"Brazil",dCode:"55",cCode:"BR",tCode:"BRA"},{cName:"British Indian Ocean Territory",dCode:"246",cCode:"IO",tCode:"IOT"},{cName:"Brunei Darussalam",dCode:"673",cCode:"BN",tCode:"BRN"},{cName:"Bulgaria",dCode:"359",cCode:"BG",tCode:"BGR"},{cName:"Burkina Faso",dCode:"226",cCode:"BF",tCode:"BFA"},{cName:"Burundi",dCode:"257",cCode:"BI",tCode:"BDI"},{cName:"Cambodia",dCode:"855",cCode:"KH",tCode:"KHM"},{cName:"Cameroon",dCode:"237",cCode:"CM",tCode:"CMR"},{cName:"Canada",dCode:"1",cCode:"CA",tCode:"CAN"},{cName:"Cape Verde",dCode:"238",cCode:"CV",tCode:"CPV"},{cName:"Cayman Islands",dCode:" 345",cCode:"KY",tCode:"CYM"},{cName:"Central African Republic",dCode:"236",cCode:"CF",tCode:"CAF"},{cName:"Chad",dCode:"235",cCode:"TD",tCode:"TCD"},{cName:"Chile",dCode:"56",cCode:"CL",tCode:"CHL"},{cName:"China",dCode:"86",cCode:"CN",tCode:"CHN"},{cName:"Christmas Island",dCode:"61",cCode:"CX",tCode:"CXR"},{cName:"Cocos (Keeling) Islands",dCode:"61",cCode:"CC",tCode:"CCK"},{cName:"Colombia",dCode:"57",cCode:"CO",tCode:"COL"},{cName:"Comoros",dCode:"269",cCode:"KM",tCode:"COM"},{cName:"Congo",dCode:"242",cCode:"CG",tCode:"COG"},{cName:"Congo, The Democratic Republic of the Congo",dCode:"243",cCode:"CD",tCode:"COD"},{cName:"Cook Islands",dCode:"682",cCode:"CK",tCode:"COK"},{cName:"Costa Rica",dCode:"506",cCode:"CR",tCode:"CRI"},{cName:"Cote d'Ivoire",dCode:"225",cCode:"CI",tCode:"CIV"},{cName:"Croatia",dCode:"385",cCode:"HR",tCode:"HRV"},{cName:"Cuba",dCode:"53",cCode:"CU",tCode:"CUB"},{cName:"Cyprus",dCode:"357",cCode:"CY",tCode:"CYP"},{cName:"Czech Republic",dCode:"420",cCode:"CZ",tCode:"CZE"},{cName:"Denmark",dCode:"45",cCode:"DK",tCode:"DNK"},{cName:"Djibouti",dCode:"253",cCode:"DJ",tCode:"DJI"},{cName:"Dominica",dCode:"1767",cCode:"DM",tCode:"DMA"},{cName:"Dominican Republic",dCode:"1849",cCode:"DO",tCode:"DOM"},{cName:"Ecuador",dCode:"593",cCode:"EC",tCode:"ECU"},{cName:"Egypt",dCode:"20",cCode:"EG",tCode:"EGY"},{cName:"El Salvador",dCode:"503",cCode:"SV",tCode:"SLV"},{cName:"Equatorial Guinea",dCode:"240",cCode:"GQ",tCode:"GNQ"},{cName:"Eritrea",dCode:"291",cCode:"ER",tCode:"ERI"},{cName:"Estonia",dCode:"372",cCode:"EE",tCode:"EST"},{cName:"Ethiopia",dCode:"251",cCode:"ET",tCode:"ETH"},{cName:"Falkland Islands (Malvinas)",dCode:"500",cCode:"FK",tCode:"FLK"},{cName:"Faroe Islands",dCode:"298",cCode:"FO",tCode:"FRO"},{cName:"Fiji",dCode:"679",cCode:"FJ",tCode:"FJI"},{cName:"Finland",dCode:"358",cCode:"FI",tCode:"FIN"},{cName:"France",dCode:"33",cCode:"FR",tCode:"FRA"},{cName:"French Guiana",dCode:"594",cCode:"GF",tCode:"GUF"},{cName:"French Polynesia",dCode:"689",cCode:"PF",tCode:"PYF"},{cName:"Gabon",dCode:"241",cCode:"GA",tCode:"GAB"},{cName:"Gambia",dCode:"220",cCode:"GM",tCode:"GMB"},{cName:"Georgia",dCode:"995",cCode:"GE",tCode:"GEO"},{cName:"Germany",dCode:"49",cCode:"DE",tCode:"DEU"},{cName:"Ghana",dCode:"233",cCode:"GH",tCode:"GHA"},{cName:"Gibraltar",dCode:"350",cCode:"GI",tCode:"GIB"},{cName:"Greece",dCode:"30",cCode:"GR",tCode:"GRC"},{cName:"Greenland",dCode:"299",cCode:"GL",tCode:"GRL"},{cName:"Grenada",dCode:"1473",cCode:"GD",tCode:"GRD"},{cName:"Guadeloupe",dCode:"590",cCode:"GP",tCode:"GLP"},{cName:"Guam",dCode:"1671",cCode:"GU",tCode:"GUM"},{cName:"Guatemala",dCode:"502",cCode:"GT",tCode:"GTM"},{cName:"Guernsey",dCode:"44",cCode:"GG",tCode:"GGY"},{cName:"Guinea",dCode:"224",cCode:"GN",tCode:"GIN"},{cName:"Guinea-Bissau",dCode:"245",cCode:"GW",tCode:"GNB"},{cName:"Guyana",dCode:"595",cCode:"GY",tCode:"GUY"},{cName:"Haiti",dCode:"509",cCode:"HT",tCode:"HTI"},{cName:"Holy See (Vatican City State)",dCode:"379",cCode:"VA",tCode:"VAT"},{cName:"Honduras",dCode:"504",cCode:"HN",tCode:"HND"},{cName:"Hong Kong",dCode:"852",cCode:"HK",tCode:"HKG"},{cName:"Hungary",dCode:"36",cCode:"HU",tCode:"HUN"},{cName:"Iceland",dCode:"354",cCode:"IS",tCode:"ISL"},{cName:"India",dCode:"91",cCode:"IN",tCode:"IND"},{cName:"Indonesia",dCode:"62",cCode:"ID",tCode:"IDN"},{cName:"Iran, Islamic Republic of Persian Gulf",dCode:"98",cCode:"IR",tCode:"IRN"},{cName:"Iraq",dCode:"964",cCode:"IQ",tCode:"IRQ"},{cName:"Ireland",dCode:"353",cCode:"IE",tCode:"IRL"},{cName:"Isle of Man",dCode:"44",cCode:"IM",tCode:"IMN"},{cName:"Israel",dCode:"972",cCode:"IL",tCode:"ISR"},{cName:"Italy",dCode:"39",cCode:"IT",tCode:"ITA"},{cName:"Jamaica",dCode:"1876",cCode:"JM",tCode:"JAM"},{cName:"Japan",dCode:"81",cCode:"JP",tCode:"JPN"},{cName:"Jersey",dCode:"44",cCode:"JE",tCode:"JEY"},{cName:"Jordan",dCode:"962",cCode:"JO",tCode:"JOR"},{cName:"Kazakhstan",dCode:"77",cCode:"KZ",tCode:"KAZ"},{cName:"Kenya",dCode:"254",cCode:"KE",tCode:"KEN"},{cName:"Kiribati",dCode:"686",cCode:"KI",tCode:"KIR"},{cName:"Korea, Democratic People's Republic of Korea",dCode:"850",cCode:"KP",tCode:"PRK"},{cName:"Korea, Republic of South Korea",dCode:"82",cCode:"KR",tCode:"KOR"},{cName:"Kuwait",dCode:"965",cCode:"KW",tCode:"KWT"},{cName:"Kyrgyzstan",dCode:"996",cCode:"KG",tCode:"KGZ"},{cName:"Laos",dCode:"856",cCode:"LA",tCode:"LAO"},{cName:"Latvia",dCode:"371",cCode:"LV",tCode:"LVA"},{cName:"Lebanon",dCode:"961",cCode:"LB",tCode:"LBN"},{cName:"Lesotho",dCode:"266",cCode:"LS",tCode:"LSO"},{cName:"Liberia",dCode:"231",cCode:"LR",tCode:"LBR"},{cName:"Libyan Arab Jamahiriya",dCode:"218",cCode:"LY",tCode:"LBY"},{cName:"Liechtenstein",dCode:"423",cCode:"LI",tCode:"LIE"},{cName:"Lithuania",dCode:"370",cCode:"LT",tCode:"LTU"},{cName:"Luxembourg",dCode:"352",cCode:"LU",tCode:"LUX"},{cName:"Macao",dCode:"853",cCode:"MO",tCode:"MAC"},{cName:"Macedonia",dCode:"389",cCode:"MK",tCode:"MKD"},{cName:"Madagascar",dCode:"261",cCode:"MG",tCode:"MDG"},{cName:"Malawi",dCode:"265",cCode:"MW",tCode:"MWI"},{cName:"Malaysia",dCode:"60",cCode:"MY",tCode:"MYS"},{cName:"Maldives",dCode:"960",cCode:"MV",tCode:"MDV"},{cName:"Mali",dCode:"223",cCode:"ML",tCode:"MLI"},{cName:"Malta",dCode:"356",cCode:"MT",tCode:"MLT"},{cName:"Marshall Islands",dCode:"692",cCode:"MH",tCode:"MHL"},{cName:"Martinique",dCode:"596",cCode:"MQ",tCode:"MTQ"},{cName:"Mauritania",dCode:"222",cCode:"MR",tCode:"MRT"},{cName:"Mauritius",dCode:"230",cCode:"MU",tCode:"MUS"},{cName:"Mayotte",dCode:"262",cCode:"YT",tCode:"MYT"},{cName:"Mexico",dCode:"52",cCode:"MX",tCode:"MEX"},{cName:"Micronesia, Federated States of Micronesia",dCode:"691",cCode:"FM",tCode:"FSM"},{cName:"Moldova",dCode:"373",cCode:"MD",tCode:"MDA"},{cName:"Monaco",dCode:"377",cCode:"MC",tCode:"MCO"},{cName:"Mongolia",dCode:"976",cCode:"MN",tCode:"MNG"},{cName:"Montenegro",dCode:"382",cCode:"ME",tCode:"MNE"},{cName:"Montserrat",dCode:"1664",cCode:"MS",tCode:"MSR"},{cName:"Morocco",dCode:"212",cCode:"MA",tCode:"MAR"},{cName:"Mozambique",dCode:"258",cCode:"MZ",tCode:"MOZ"},{cName:"Myanmar",dCode:"95",cCode:"MM",tCode:"MMR"},{cName:"Namibia",dCode:"264",cCode:"NA",tCode:"NAM"},{cName:"Nauru",dCode:"674",cCode:"NR",tCode:"NRU"},{cName:"Nepal",dCode:"977",cCode:"NP",tCode:"NPL"},{cName:"Netherlands",dCode:"31",cCode:"NL",tCode:"NLD"},{cName:"Netherlands Antilles",dCode:"599",cCode:"AN",tCode:"ANT"},{cName:"New Caledonia",dCode:"687",cCode:"NC",tCode:"NCL"},{cName:"New Zealand",dCode:"64",cCode:"NZ",tCode:"NZL"},{cName:"Nicaragua",dCode:"505",cCode:"NI",tCode:"NIC"},{cName:"Niger",dCode:"227",cCode:"NE",tCode:"NER"},{cName:"Nigeria",dCode:"234",cCode:"NG",tCode:"NGA"},{cName:"Niue",dCode:"683",cCode:"NU",tCode:"NIU"},{cName:"Norfolk Island",dCode:"672",cCode:"NF",tCode:"NFK"},{cName:"Northern Mariana Islands",dCode:"1670",cCode:"MP",tCode:"MNP"},{cName:"Norway",dCode:"47",cCode:"NO",tCode:"NOR"},{cName:"Oman",dCode:"968",cCode:"OM",tCode:"OMN"},{cName:"Pakistan",dCode:"92",cCode:"PK",tCode:"PAK"},{cName:"Palau",dCode:"680",cCode:"PW",tCode:"PLW"},{cName:"Palestinian Territory, Occupied",dCode:"970",cCode:"PS",tCode:"PSE"},{cName:"Panama",dCode:"507",cCode:"PA",tCode:"PAN"},{cName:"Papua New Guinea",dCode:"675",cCode:"PG",tCode:"PNG"},{cName:"Paraguay",dCode:"595",cCode:"PY",tCode:"PRY"},{cName:"Peru",dCode:"51",cCode:"PE",tCode:"PER"},{cName:"Philippines",dCode:"63",cCode:"PH",tCode:"PHL"},{cName:"Pitcairn",dCode:"872",cCode:"PN",tCode:"PCN"},{cName:"Poland",dCode:"48",cCode:"PL",tCode:"POL"},{cName:"Portugal",dCode:"351",cCode:"PT",tCode:"PRT"},{cName:"Puerto Rico",dCode:"1939",cCode:"PR",tCode:"PRI"},{cName:"Qatar",dCode:"974",cCode:"QA",tCode:"QAT"},{cName:"Romania",dCode:"40",cCode:"RO",tCode:"ROU"},{cName:"Russia",dCode:"7",cCode:"RU",tCode:"RUS"},{cName:"Rwanda",dCode:"250",cCode:"RW",tCode:"RWA"},{cName:"Reunion",dCode:"262",cCode:"RE",tCode:"REU"},{cName:"Saint Barthelemy",dCode:"590",cCode:"BL",tCode:"BLM"},{cName:"Saint Helena, Ascension and Tristan Da Cunha",dCode:"290",cCode:"SH",tCode:"SHN"},{cName:"Saint Kitts and Nevis",dCode:"1869",cCode:"KN",tCode:"KNA"},{cName:"Saint Lucia",dCode:"1758",cCode:"LC",tCode:"LCA"},{cName:"Saint Martin",dCode:"590",cCode:"MF",tCode:"MAF"},{cName:"Saint Pierre and Miquelon",dCode:"508",cCode:"PM",tCode:"SPM"},{cName:"Saint Vincent and the Grenadines",dCode:"1784",cCode:"VC",tCode:"VCT"},{cName:"Samoa",dCode:"685",cCode:"WS",tCode:"WSM"},{cName:"San Marino",dCode:"378",cCode:"SM",tCode:"SMR"},{cName:"Sao Tome and Principe",dCode:"239",cCode:"ST",tCode:"STP"},{cName:"Saudi Arabia",dCode:"966",cCode:"SA",tCode:"SAU"},{cName:"Senegal",dCode:"221",cCode:"SN",tCode:"SEN"},{cName:"Serbia",dCode:"381",cCode:"RS",tCode:"SRB"},{cName:"Seychelles",dCode:"248",cCode:"SC",tCode:"SYC"},{cName:"Sierra Leone",dCode:"232",cCode:"SL",tCode:"SLE"},{cName:"Singapore",dCode:"65",cCode:"SG",tCode:"SGP"},{cName:"Slovakia",dCode:"421",cCode:"SK",tCode:"SVK"},{cName:"Slovenia",dCode:"386",cCode:"SI",tCode:"SVN"},{cName:"Solomon Islands",dCode:"677",cCode:"SB",tCode:"SLB"},{cName:"Somalia",dCode:"252",cCode:"SO",tCode:"SOM"},{cName:"South Africa",dCode:"27",cCode:"ZA",tCode:"ZAF"},{cName:"South Sudan",dCode:"211",cCode:"SS",tCode:"SSD"},{cName:"South Georgia and the South Sandwich Islands",dCode:"500",cCode:"GS",tCode:"SGS"},{cName:"Spain",dCode:"34",cCode:"ES",tCode:"ESP"},{cName:"Sri Lanka",dCode:"94",cCode:"LK",tCode:"LKA"},{cName:"Sudan",dCode:"249",cCode:"SD",tCode:"SSD"},{cName:"SuricName",dCode:"597",cCode:"SR",tCode:"SUR"},{cName:"Svalbard and Jan Mayen",dCode:"47",cCode:"SJ",tCode:"SJM"},{cName:"Swaziland",dCode:"268",cCode:"SZ",tCode:"SWZ"},{cName:"Sweden",dCode:"46",cCode:"SE",tCode:"SWE"},{cName:"Switzerland",dCode:"41",cCode:"CH",tCode:"CHE"},{cName:"Syrian Arab Republic",dCode:"963",cCode:"SY",tCode:"SYR"},{cName:"Taiwan",dCode:"886",cCode:"TW",tCode:"TWN"},{cName:"Tajikistan",dCode:"992",cCode:"TJ",tCode:"TJK"},{cName:"Tanzania, United Republic of Tanzania",dCode:"255",cCode:"TZ",tCode:"TZA"},{cName:"Thailand",dCode:"66",cCode:"TH",tCode:"THA"},{cName:"Timor-Leste",dCode:"670",cCode:"TL",tCode:"TLS"},{cName:"Togo",dCode:"228",cCode:"TG",tCode:"TGO"},{cName:"Tokelau",dCode:"690",cCode:"TK",tCode:"TKL"},{cName:"Tonga",dCode:"676",cCode:"TO",tCode:"TON"},{cName:"Trinidad and Tobago",dCode:"1868",cCode:"TT",tCode:"TTO"},{cName:"Tunisia",dCode:"216",cCode:"TN",tCode:"TUN"},{cName:"Turkey",dCode:"90",cCode:"TR",tCode:"TUR"},{cName:"Turkmenistan",dCode:"993",cCode:"TM",tCode:"TKM"},{cName:"Turks and Caicos Islands",dCode:"1649",cCode:"TC",tCode:"TCA"},{cName:"Tuvalu",dCode:"688",cCode:"TV",tCode:"TUV"},{cName:"Uganda",dCode:"256",cCode:"UG",tCode:"UGA"},{cName:"Ukraine",dCode:"380",cCode:"UA",tCode:"UKR"},{cName:"United Arab Emirates",dCode:"971",cCode:"AE",tCode:"ARE"},{cName:"United Kingdom",dCode:"44",cCode:"GB",tCode:"GBR"},{cName:"United States",dCode:"1",cCode:"US",tCode:"USA"},{cName:"Uruguay",dCode:"598",cCode:"UY",tCode:"URY"},{cName:"Uzbekistan",dCode:"998",cCode:"UZ",tCode:"UZB"},{cName:"Vanuatu",dCode:"678",cCode:"VU",tCode:"VUT"},{cName:"Venezuela, Bolivarian Republic of Venezuela",dCode:"58",cCode:"VE",tCode:"VEN"},{cName:"Vietnam",dCode:"84",cCode:"VN",tCode:"VNM"},{cName:"Virgin Islands, British",dCode:"1284",cCode:"VG",tCode:"VGB"},{cName:"Virgin Islands, U.S.",dCode:"1340",cCode:"VI",tCode:"VIR"},{cName:"Wallis and Futuna",dCode:"681",cCode:"WF",tCode:"WLF"},{cName:"Yemen",dCode:"967",cCode:"YE",tCode:"YEM"},{cName:"Zambia",dCode:"260",cCode:"ZM",tCode:"ZMB"},{cName:"Zimbabwe",dCode:"263",cCode:"ZW",tCode:"ZWE"}],Ii=[{gateway:"ZYA",destination:"Amsterdam (ZYA)"},{gateway:"QDH",destination:"Ashford International (Kent) (QDH)"},{gateway:"ZYR",destination:"Brussels Midi (ZYR)"},{gateway:"XQE",destination:"Ebbsfleet International (Kent) (XQE)"},{gateway:"XDB",destination:"Lille Europe (XDB)"},{gateway:"QQS",destination:"London St Pancras International (QQS)"},{gateway:"XED",destination:"Marne La Vallee (Disneyland) (XED)"},{gateway:"XPG",destination:"Paris Gare du Nord (XPG)"},{gateway:"QRH",destination:"Rotterdam (QRH)"}],Oi=function(r){function i(e,a,n,o,s,u){var c=r.call(this,o,a,s,u)||this;c.fasttrackFetcher=e,c.basketService=n,c.type=ne.FastTrack,c.terminals=new t.BehaviorSubject([]),c._minDate=c.helpers.momentToNgDate(l.default()),c._date=null,c._time=null,c._selectedTerminal="",c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS;var d=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};c._originalUserSearch=d.originalUserSearch,c.updateTempParams(s.makeFastTrackQuery(d.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){var t=c.helpers.selectedTravellers(e,ne.FastTrack);c.tempParams.adults=t.adults.length,c.tempParams.children=t.children.length,c.travellers=e,c._isValid()}));var h=o.getSessionItemAsList(c.resultsSessionName)||[];return c._cheapestResultPrice=c.updateLowestPrice(h),c.results.next(h||[]),c}return m(i,r),Object.defineProperty(i.prototype,"minDate",{get:function(){return this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalDatetime",{get:function(){return this.tempParams.arrivalDatetime},set:function(e){e.isValid()?(this.tempParams.arrivalDatetime=e,this._date=this.helpers.momentToNgDate(e),this._time=this.helpers.formatTimeColon(e)):this.tempParams.arrivalDatetime=null,this._isValid()},enumerable:!1,configurable:!0}),i.prototype._updateDateTime=function(){if(this._date&&this._time){var e=this.helpers.ngDateToMoment(this._date,this._time);this.tempParams.arrivalDatetime=e.isValid()?e:null,this._isValid()}},Object.defineProperty(i.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){var t;this.tempParams.locationCode=e;var r=null===(t=this.terminals)||void 0===t?void 0:t.value;"string"==typeof e?(this._locationCode="",this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this.terminal=null,this.terminals.next(e.terminals),1===r.length&&(this.selectedTerminal=r[0].key),this._isValid()):(this._locationCode=null,this.terminal=null,this.selectedTerminal=null,this.terminals.next([]),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this.tempParams.terminal?this.tempParams.terminal.toString():null},set:function(e){this.tempParams.terminal=e;var t=this.terminals.value.find((function(t,r){if(t.value===e)return!0}));t?this.selectedTerminal=t.key:this.terminals.value&&this.terminals.value.length>0?this.selectedTerminal=this.terminals.value[0].key:this.selectedTerminal="Any Terminal",this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e,this._isValid()},enumerable:!1,configurable:!0}),i.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[],this.locationCode||this.validationMessages.push("Please add in a airport location"),this.tempParams.arrivalDatetime.isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeFastTrackQuery()),this._isValid()},i.prototype.startSearch=function(){if(this.results.next([]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.fasttrackFetcher.fetchList(e))}return Promise.resolve(!1)},i.prototype.getSearchQuery=function(){var e={adults:this.tempParams.adults,children:this.tempParams.children?this.tempParams.children:null,locationCode:this._locationCode,arrivalDatetime:this.tempParams.arrivalDatetime};return this.helpers.removeNulls(e)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.FastTrack,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.terminal=e.searchArgs.terminal,this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(r){var i,a,n,o,s,l;r&&(t.locationCode={country:null===(a=null===(i=r.iataMatch)||void 0===i?void 0:i.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(o=null===(n=r.iataMatch)||void 0===n?void 0:n.locationDetails)||void 0===o?void 0:o.countryCode,destination:r.iataMatch.name,gateway:r.iataMatch.iata,postcode:null===(l=null===(s=r.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.postcode,terminals:t.searchService.processTerminals(r.iataMatch.terminals)},t.terminal=e.searchArgs.terminal,t.searchService.startSearches())})),this.searchService.startSearches()},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.arrivalDatetime=l.default(r.arrivalDatetime),this.searchService.getAirportByCode(r.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)})}))},i.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING LOUNGE FORM"),null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[ne.Flight].outBoundDate.toDate();this.date={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},i.prototype.updateLowestPrice=function(e){if(!e.length)return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.addFastTrackToBasket=function(t,r){var i,a,n,o,s,l,u;return y(this,void 0,void 0,(function(){var c,d,h,p;return b(this,(function(m){switch(m.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return c=m.sent(),d=null==c?void 0:c.subject.value,h=this.getTermsAndCond(t),d?[4,this.basketService.addToBasket({adults:r.adults,children:r.children,basket:d.id,service:t.sourceId.toString(),detail:{arrivalDatetime:r.arrivalDatetime.format(),locationCode:t.code,name:t.name,airportIata:null==r?void 0:r.locationCode,terminal:null===(i=t.terminal)||void 0===i?void 0:i.toString(),termsAndCond:h},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format(),lowestPrice:(null===(a=this.cheapestPrice)||void 0===a?void 0:a.amount)!=t.price||(null===(n=this.cheapestPrice)||void 0===n?void 0:n.currencyCode)!=t.currency?null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount:null,lowestPriceCurrency:(null===(s=this.cheapestPrice)||void 0===s?void 0:s.amount)!=t.price||(null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode)!=t.currency?null===(u=this.cheapestPrice)||void 0===u?void 0:u.currencyCode:null},c,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(p=m.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,p];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.name},{name:"Important Information",value:e.importantInfo},{name:"Extra Information",value:e.extraInfo}]},i.prototype.applyFilters=function(e,t){var r=this.helpers.clone(this.fullResults);r=r.filter((function(t){return t.price>=e.minPrice&&t.price<=e.maxPrice})),r=this.sortResults(t,r),this.results.next(r)},i.prototype.sortResults=function(e,t){var r=this.helpers.clone(t||this.results.value);switch(e){case 0:r=r.sort((function(e,t){return e.price-t.price}));break;case 1:r=r.sort((function(e,t){return t.price-e.price}))}return this.results.next(r),r},i.prototype.getMinPrice=function(e){return e.reduce((function(e,t){return t.price<e&&(e=t.price),e}),Number.MAX_SAFE_INTEGER)},i.prototype.getMaxPrice=function(e){return e.reduce((function(e,t){return t.price>e&&(e=t.price),e}),Number.MIN_SAFE_INTEGER)},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ne.FastTrack,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},i}(c);Oi.STORAGE_SESSION_PARAMS="search_fasttrack",Oi.STORAGE_SESSION_RESULTS="results_fasttrack",function(e){e.None="NONE",e.Fixed="FIXED",e.Flexible="FLEXIBLE"}(vi||(vi={}));var Ei,Bi=function(t){function r(i,a,n,o,s,u){var c=t.call(this,o,a,s,u)||this;c.emailFerryFetcher=i,c.basketService=n,c.type=ne.Ferry,c._ticketTypes=[vi.None,vi.Fixed,vi.Flexible],c.allowOpenReturn=!0,c.searchTypes=[{display:"Return",value:V.ReturnJourney},{display:"One-Way",value:V.SingleJourney}],c._journeytype=V.ReturnJourney,c._ferryTimeCritia=[se.ExactTime,se.DepartAfter,se.ArriveBefore],c.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c._outbound_date=null,c._outbound_time=null,c._return_date=null,c._return_time=null,c.resultsSessionName=r.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=r.STORAGE_SESSION_RESULTS;var d=o.getSessionItem(r.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};return c._originalUserSearch=d.originalUserSearch,c.updateTempParams(s.makeFerryQuery(d.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(t){c.travellers=t,c.travellers[0]&&!c.travellers[0].ageType&&(c.travellers[0].ageType=e.ages.Adult),c.travellers=t,c._isValid()})),c}return m(r,t),Object.defineProperty(r.prototype,"ticketTypes",{get:function(){return this._ticketTypes},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"journeyType",{get:function(){return this._journeytype},set:function(e){this._journeytype=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ferryTimeCritia",{get:function(){return this._ferryTimeCritia},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fromLocation",{get:function(){return this.tempParams.fromLocation},set:function(e){this.tempParams.fromLocation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"toLocation",{get:function(){return this.tempParams.toLocation},set:function(e){this.tempParams.toLocation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBehalfOfEmail",{get:function(){return this.tempParams.onBehalfOfEmail},set:function(e){this.tempParams.onBehalfOfEmail=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"passengers",{get:function(){return this.tempParams.passengers},set:function(e){this.tempParams.passengers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"departTimeType",{get:function(){return this.tempParams.departTimeType},set:function(e){this.tempParams.departTimeType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"returnTimeType",{get:function(){return this.tempParams.returnTimeType},set:function(e){this.tempParams.returnTimeType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"preferredTicketType",{get:function(){return this.tempParams.preferredTicketType},set:function(e){this.tempParams.preferredTicketType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"carDetails",{get:function(){return this.tempParams.carDetails},set:function(e){this.tempParams.carDetails=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"additionalInfo",{get:function(){return this.tempParams.additionalInfo},set:function(e){this.tempParams.additionalInfo=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"departDateTime",{get:function(){return this.tempParams.departDateTime},set:function(e){this.tempParams.departDateTime=e,e&&e.isValid()&&(this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this.minInboundDate={year:e.year(),month:e.month()+1,day:e.date()},this.departDateTime&&this.returnDateTime&&this.departDateTime.isAfter(this.returnDateTime)&&(this.returnDateTime=this.returnDateTime.set("date",e.date()).set("month",e.month()).set("year",e.year())),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"returnDateTime",{get:function(){return this.tempParams.returnDateTime},set:function(e){this.tempParams.returnDateTime=e,e&&e.isValid()&&(this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(48).fill(0).map((function(e,t){return{value:Math.floor(t/2).toString().padStart(2,"0")+(t%2*30).toString().padStart(2,"0"),display:Math.floor(t/2).toString().padStart(2,"0")+":"+(t%2*30).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"outbound_date",{get:function(){return this._outbound_date},set:function(e){this._outbound_date=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"outbound_time",{get:function(){return this._outbound_time},set:function(e){this._outbound_time=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"return_date",{get:function(){return this._return_date},set:function(e){this._return_date=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"return_time",{get:function(){return this._return_time},set:function(e){this._return_time=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),r.prototype._isValid=function(){var e,t,i,a,n;this.storageService.setSessionItem(r.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var o=l.default();this.fromLocation||this.validationMessages.push("Please Enter a From Location."),this.toLocation||this.validationMessages.push("Please Enter a To Location."),(null===(e=this.carDetails)||void 0===e?void 0:e.make)&&(null===(t=this.carDetails)||void 0===t?void 0:t.model)&&(null===(i=this.carDetails)||void 0===i?void 0:i.reg)||this.validationMessages.push("Please supply all car details."),(null===(a=this.travellers)||void 0===a?void 0:a.length)||this.validationMessages.push("There must be at least 1 traveller"),(null===(n=this.departDateTime)||void 0===n?void 0:n.isBefore(o))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)},r.prototype.processResults=function(e){return[e]},r.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeFerryQuery()),this._isValid()},r.prototype.startSearch=function(){if(this.results.next([!1]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(r.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this._startSearch(this.emailFerryFetcher.fetchList(e))}return Promise.resolve(!1)},r.prototype.getSearchQuery=function(){this.travellers&&(this.passengers=this.travellers.map((function(e){var t;if(e.dob){var r=Math.abs((new Date).getTime()-new Date(e.dob).getTime());t=Math.floor(r/864e5/365)}return{name:e.name,age:(null==t?void 0:t.toString())||"Not specified"}})));var e={fromLocation:this.tempParams.fromLocation,toLocation:this.tempParams.toLocation,departDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.departDateTime),returnDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.returnDateTime),onBehalfOfEmail:this.travellers[0].email,passengers:this.passengers,departTimeType:this.tempParams.departTimeType,preferredTicketType:this.tempParams.preferredTicketType,carDetails:this.tempParams.carDetails,additionalInfo:this.tempParams.additionalInfo};return this.helpers.removeNulls(e)},r.prototype.startRecentSearch=function(){},r.prototype.updateLowestPrice=function(){},r.prototype.updateFromPreviousSearches=function(){},r.prototype.updateSearchFromExpiredBasketItem=function(){},r.prototype._updateOutboundDateTime=function(){if(this._outbound_date&&this._outbound_time){var e=this.helpers.ngDateToMoment(this._outbound_date,this._outbound_time);this.departDateTime=e.isValid()?e:null,this._isValid()}},r.prototype._updateReturnDateTime=function(){if(this._return_date&&this._return_time){var e=this.helpers.ngDateToMoment(this._return_date,this._return_time);this.returnDateTime=e.isValid()?e:null,this._isValid()}},r}(c);Bi.STORAGE_SESSION_PARAMS="search_ferry",Bi.STORAGE_SESSION_RESULTS="results_ferry",e.MAX_TRAVELLERS=8,(Ei=e.TravellerSearchTypes||(e.TravellerSearchTypes={})).email="email",Ei.name="name",Ei.employeeNumber="employeeNumber";var Ni=function(){function i(r,a,n,o,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k,_,R,I,O,E,B,N,M,L,w,j,U,H,x,G,V,W,Q,J,Y,K,q,X,Z,z,$,ee,te,re,ie,ae,oe,se,le,ue,ce,de,he,pe,me,fe,ve){var ye,be=this;this.searchAirportsFetcher=r,this.searchAirlinesFetcher=a,this.storageService=n,this.userService=o,this.modalService=l,this.router=u,this.helpers=c,this.hotelAvalibilityService=d,this.citiesFetcher=h,this.confermaCitiesFetcher=p,this.postcodeFetcher=m,this.railStationFetcher=f,this.saveUserAddressUpdater=v,this.userAddressesFetcher=y,this.basketService=b,this.getUserCompanyOfficesFetcher=g,this.searchHotelChainsFetcher=S,this.getConfermaRoomImagesFetcher=C,this.baseValidateIsPostcodeValidTester=A,this.depotFetcher=T,this.confermaOfficeNamesFetcher=D,this.confermaOfficeFetcher=P,this.baseDeleteUserAddressUpdater=F,this.baseDeleteRecentSearchUpdater=k,this.baseSaveRecentSearchUpdater=_,this.getUserCurrentCarbonAllowanceFetcher=R,this.baseSaveFavouriteSearchUpdater=I,this.getRailStationFetcher=G,this.getIrlSupplierStationFetcher=V,this.webTokenService=W,this.riskAlertsFetcher=Q,this.getUserRecentSearchesFetcher=Y,this.getRailCardsFetcher=K,this.getCovidMicrositeTokenFetcher=q,this.searchUsersCanBookForFetcher=Z,this.searchIrlStationsFetcher=z,this.irlDiscountCardsFetcher=$,this.getFlightFareRulesFetcher=ee,this.getFlightSeatMapFetcher=te,this.getRailLiveDeparturesFetcher=re,this.getUserFavouriteSearchesFetcher=oe,this.deleteFavouriteSearchUpdater=se,this.emailBasketFetcher=le,this.sendOfflineNotificationFetcher=ce,this.getHotelChainsFetcher=de,this.getRailProvidersFetcher=he,this.getAllAirlinesFetcher=pe,this.getCarHireProvidersFetcher=me,this.baseGenerateBasketPdfFetcher=fe,this.emailFerryFetcher=ve,this.traveller_error=!1,this.travellerInformation=new t.BehaviorSubject([]),this.errors=new t.BehaviorSubject([]),this.searchLoadingDone=new t.BehaviorSubject(!1),this.searchTimedOut=new t.BehaviorSubject(!1),this.newSearchStarted=new t.BehaviorSubject(!1),this.firstLoad=!0,this.highest_search_priority=8,this.show_errors=!1,this.travellerValidationMessages=[],this.search_loading=!1,this.search_airport_loading=!1,this.allSubscription=new t.Subscription,this.searchesSubscription=new t.Subscription,this.selectedTravellers=[],this.selectedPlaces=[],this.countries=Ri,this.eurostations=s.default.toArray(Ii),this._ermTravellerType=e.ErmTravellerType.None,console.log("Enterpise search service being inited"),console.log("Newly created search objects: ",this.searches),this.search_objects={},this.searches=((ye={})[ne.Cab]=null,ye[ne.Car]=null,ye[ne.Coach]=null,ye[ne.Eurostar]=null,ye[ne.FastTrack]=null,ye[ne.Ferry]=null,ye[ne.Flight]=null,ye[ne.Hotel]=null,ye[ne.InternationalRail]=null,ye[ne.Lounge]=null,ye[ne.Parking]=null,ye[ne.Rail]=null,ye),this.selectedTravellers=this.storageService.getSessionItemAsList(i.SESSION_TRAVELLER),this.travellerInformation.next(this.selectedTravellers),o.fullUserDetails.userServices.subscribe((function(e){e&&(be.createSearchObjects(E,c,b,n,o,B,M,ae,l,L,O,d,N,J,G,ie,w,j,U,x,$,V,ue,ve,H,X),be.search_objects=be._searchObjectsDefault=Object.keys(be.search_objects).reduce((function(t,r){return t[r].enabled=!!e&&!!e[r],e&&e[r]||(t[r].chosen=!1,t[r].originalChosen=!1),t}),be.search_objects)),be.determineHighestSearchPriority()})),Array.isArray(this.countries)&&(this.countries=this.countries.sort((function(e,t){return e.cName<t.cName?-1:e.cName>t.cName?1:0}))),W.autoLogoutConfig=this.getAutoLogoutConfig()}return Object.defineProperty(i.prototype,"ermTravellerType",{get:function(){return this._ermTravellerType},set:function(t){this._ermTravellerType=t,this.ermTravellerType===e.ErmTravellerType.Joiner||this.ermTravellerType===e.ErmTravellerType.Leaver?sessionStorage.setItem("search_ERM_traveller_type",this.ermTravellerType):sessionStorage.removeItem("search_ERM_traveller_type")},enumerable:!1,configurable:!0}),i.prototype.createSearchObjects=function(e,t,r,i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P){var F;this.search_objects&&0!==Object.values(this.search_objects).length||(this.search_objects=this.helpers.clone(this.init_search_objects()),this.searches=((F={})[ne.Lounge]=new Pt(e,t,r,i,this,a),F[ne.Parking]=new Rt(n,t,r,i,this,a),F[ne.Flight]=new St(o,t,a,r,i,this,s,l),F[ne.Hotel]=new Dt(u,t,a,c,d,r,i,this,h,p,m,f),F[ne.Car]=new it(v,y,t,r,i,this,a),F[ne.Cab]=new rt(b,t,i,this,r,a),F[ne.InternationalRail]=new Vt(g,S,t,r,i,this,C,a),F[ne.FastTrack]=new Oi(A,t,r,i,this,a),F[ne.Coach]=null,F[ne.Ferry]=new Bi(T,t,r,i,this,a),F[ne.Rail]=new Ut(D,m,t,r,i,this,a,l),F[ne.Eurostar]=new Bt(P,t,a,r,i,this,l,s),F))},i.prototype.ngOnDestroy=function(){this.allSubscription&&this.allSubscription.unsubscribe()},i.prototype.reset=function(){this.resetAllSearchItems(),this.basketService.reset()},i.prototype.resetAllSearchItems=function(){Object.values(this.searches).forEach((function(e){null==e||e.reset()})),this.removeAllTravellers(),this.resetTravellerType(),this.resetSearchObjects()},i.prototype.resetTravellerType=function(){sessionStorage.removeItem("search_ERM_traveller_type"),this.ermTravellerType=e.ErmTravellerType.None},i.prototype.getUserCurrentCarbonAllowance=function(e,t){t&&t.next(!0);var i={user:e};return this.getUserCurrentCarbonAllowanceFetcher.fetchList(i).pipe(r.take(1),r.map((function(e){return e})))},i.prototype.getRiskAlerts=function(e,t,i,a){a&&a.next(!0);var n={minLevel:e,maxLevel:t,countryIsoCode:i};return this.riskAlertsFetcher.fetchList(n).pipe(r.take(1),r.map((function(e){return a&&a.next(!1),e})))},i.prototype.getAirportsList=function(e,i,a,n,o,s,l){var u=this;if(e.length>2){a&&a.next(!0);var c={query:e};return i&&(c.countryCode=i),"boolean"==typeof n&&(c.hasLounge=n),"boolean"==typeof o&&(c.hasParking=o),"boolean"==typeof s&&(c.hasFastTrack=s),this.searchAirportsFetcher.fetchOne(c).pipe(r.take(1),r.map((function(e){if(a&&a.next(!1),e&&e.generalMatches){var t=u.helpers.clone(e.generalMatches);return l&&(t=t.filter((function(e){return e.icao}))),t.map((function(e){var t,r,i;return{destination:e.name,gateway:e.iata,terminals:u.processTerminals(e.terminals),country:null===(t=null==e?void 0:e.locationDetails)||void 0===t?void 0:t.country,postcode:null===(r=null==e?void 0:e.locationDetails)||void 0===r?void 0:r.postcode,countryCode:null===(i=null==e?void 0:e.locationDetails)||void 0===i?void 0:i.countryCode}}))}})))}return t.of([])},i.prototype.getAirlinesList=function(e,i){var a=this;if(e.length>=2){i&&i.next(!0);var n={query:e};return this.searchAirlinesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(e){if(i&&i.next(!1),e&&e.generalMatches)return a.helpers.clone(e.generalMatches).map((function(e){return{code:e.iata,name:e.name}}))})))}return t.of([])},i.prototype.getAirportLocations=function(t,i,a,n,o,s,l){return this.getAirportsList(t,i,a,n,o,s,l).pipe(r.map((function(t){return t.map((function(t){return{name:t.destination,type:e.LocationTypes.Airport,airport:t}}))})))},i.prototype.getCityLocations=function(e,t,r,i){if(!(e.length<=2))return i?this.getConfermaCityLocations(e,t,r):this._getCityLocations(e,t,r)},i.prototype._getCityLocations=function(t,i,a){null==a||a.next(!0);var n={query:t};i&&(n.countryCode=i);return this.citiesFetcher.fetchList(n).pipe(r.take(1),r.map((function(t){var r=t.map((function(t){return{name:t.name,longitude:t.coordinates.longitude,latitude:t.coordinates.latitude,type:e.LocationTypes.City,countryCode:t.countryCode,id:t.id}}));return null==a||a.next(!1),r})))},i.prototype.getConfermaCityLocations=function(t,i,a){null==a||a.next(!0);var n={cityName:t};i&&(n.countryCode=i);return this.confermaCitiesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(t){return null==a||a.next(!1),(null==t?void 0:t.suggestions)?t.suggestions.map((function(t){return{name:t.name,longitude:t.longitude,latitude:t.latitude,type:e.LocationTypes.City,countryCode:i||("false"!=t.countryCode&&"true"!=t.countryCode?t.countryCode:null)}})):[]})))},i.prototype.getCarHireDepots=function(e,t,r,i){null==i||i.next(!0);var a={latitude:e,longitude:t};return r&&(a.radius=r),this.depotFetcher.fetchList(a)},i.prototype.getPostcodeList=function(i){return pi.UK_POSTCODE.test(i)?this.postcodeFetcher.fetchList({postcode:i}).pipe(r.map((function(t){return t.map((function(t){return{name:t.postcode,type:e.LocationTypes.Postcode,latitude:t.latitude,longitude:t.longitude}}))}))):t.of([])},i.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},i.prototype.getSelectedPlaceById=function(e){return this.selectedPlaces.find((function(t){return t.place_id===e}))},i.prototype.getConfirmaOffices=function(i){if((null==i?void 0:i.length)>2){return this.confermaOfficeNamesFetcher.fetchList().pipe(r.take(1),r.map((function(t){return(null==t?void 0:t.results)?t.results.map((function(t){return{name:t.name,type:e.LocationTypes.Office,id:t.id}})):[]})))}return t.of([])},i.prototype.getOfficeLocations=function(i){if(i.length>2){return this.getUserCompanyOfficesFetcher.fetchList().pipe(r.take(1),r.map((function(t){return t.map((function(t){return{name:t.name,office:t.addresses[0],type:e.LocationTypes.Office}}))})))}return t.of([])},i.prototype.getStationLocations=function(i,a,n){return void 0===n&&(n=!1),i.length>2?(null==a||a.next(!0),this.railStationFetcher.fetchList({query:i,hasTod:n}).pipe(r.take(1),r.map((function(t){return a&&a.next(!1),t?t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name,railstation:t}})):[]})))):t.of([])},i.prototype.getRailStationById=function(e){return e?this.getRailStationFetcher.fetchList({id:e}).pipe(r.take(1)):t.of()},i.prototype.searchIrlStationsLocations=function(i,a){return i.length>2?(null==a||a.next(!0),this.searchIrlStationsFetcher.fetchList({query:i}).pipe(r.take(1),r.map((function(t){return a&&a.next(!1),t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name+" ("+t.supplier+")",railstation:t}}))})))):t.of([])},i.prototype.getHotelLocationsList=function(i,a,n){return i.length>2?pi.UK_POSTCODE.test(i)?this.getPostcodeList(i):((null==n?void 0:n.value)||n.next(!0),t.forkJoin([this.getAirportLocations(i,a,n),this.getCityLocations(i,a,n,this.userService.userHasServiceProvider(ne.Hotel,e.ServiceProvider.Confirma)),this.getStationLocations(i,n),this.getConfirmaOffices(i)]).pipe(r.map((function(e){return(null==n?void 0:n.value)&&n.next(!1),e.reduce((function(e,t){return e.push.apply(e,C(t)),e}),[])})))):t.of([])},i.prototype.getStationsAndAirportsList=function(e,i,a){return e.length>2?((null==a?void 0:a.value)||a.next(!0),t.forkJoin([this.getAirportLocations(e,i,a),this.getStationLocations(e,a)]).pipe(r.map((function(e){return(null==a?void 0:a.value)&&a.next(!1),e.reduce((function(e,t){return e.push.apply(e,C(t)),e}),[])})))):t.of([])},i.prototype.removeTraveller=function(e){this._removeTraveller(e),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},i.prototype._removeTraveller=function(e){this.userService.bobo&&this.userService.bobo.id===e.id||(this.selectedTravellers=this.selectedTravellers.filter((function(t){return!Gt.equals(t,e)})))},i.prototype.removeAllTravellers=function(){var e=this;console.log("remove all travellers called!"),console.log(this.selectedTravellers),this.selectedTravellers||(this.selectedTravellers=[]),this.selectedTravellers.forEach((function(t){e._removeTraveller(t)})),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},i.prototype.addTraveller=function(e){this.travellerAlreadyAdded(e)||this.currentNoOfTravellersGreaterOrEqualToMax()||(this.selectedTravellers.push(e),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation())},i.prototype.currentNoOfTravellersGreaterOrEqualToMax=function(){return this.selectedTravellers.length>=this.maxTravellers()},i.prototype.maxTravellers=function(){var t=this.userService.getUserFavoriteObject(dt.AllowSameTravellesrPerBasket);return(null==t?void 0:t.value)&&(e.MAX_TRAVELLERS=+t.value),this.canUseTravellerProfile()?1:e.MAX_TRAVELLERS},i.prototype.travellerAlreadyAdded=function(e){return!!this.selectedTravellers.find((function(t){return Gt.equals(t,e)}))},i.prototype.canUseTravellerProfile=function(){return!1},i.prototype.getCurrentNoOfTravellers=function(){return this.selectedTravellers.length},i.prototype.updateTravellerInformation=function(){this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.travellerInformation.next(C(this.selectedTravellers)),this.searches[ne.Rail]&&(this.searches[ne.Rail].railCards=new Array(this.selectedTravellers.length).fill({name:"",code:""},0,this.selectedTravellers.length))},i.prototype.determineHighestSearchPriority=function(){return this.highest_search_priority=this._getHighestSearchPriorityObject().highest},i.prototype.getHighestSearchPriorityObject=function(e){return this._getHighestSearchPriorityObject(e).currentItem},i.prototype._getHighestSearchPriorityObject=function(e){return void 0===e&&(e={}),Object.values(this.search_objects).reduce((function(t,r){var i=t.highest,a=t.currentItem;if(r.chosen&&r.priority<i){if(!e[r.type])return{highest:r.priority,currentItem:r};r.chosen=!1}return{highest:i,currentItem:a}}),{highest:Number.MAX_SAFE_INTEGER,currentItem:null})},i.prototype.getSelectedOptions=function(){var e=this;return Object.keys(this.search_objects).reduce((function(t,r){var i;return(null===(i=e.search_objects[r])||void 0===i?void 0:i.chosen)&&t.push(r),t}),[])},i.prototype.hasSimpleGuests=function(){return!1},i.prototype.setGetMeThereSearchObjects=function(){console.log("+++ Setting GetMeThere Search Objects +++"),this.search_objects=this.helpers.clone(this.getMeThereSearchObjects())},i.prototype.resetSearchParams=function(){console.log("Reseting Search Params!"),this.search_objects=this.helpers.clone(this.init_search_objects()),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.search_objects),Object.values(this.searches).forEach((function(e){null==e||e.reset()}))},i.prototype.canSearch=function(e){var t,r;return this.determineHighestSearchPriority(),!!(this.search_objects[e]&&(console.log("can search here"),(null===(t=this.search_objects[e])||void 0===t?void 0:t.chosen)&&this.hasHighestSearchPriority(null===(r=this.search_objects[e])||void 0===r?void 0:r.priority)))&&(console.log(e+" can be searched"),!0)},i.prototype.hasHighestSearchPriority=function(e){return this.determineHighestSearchPriority(),e<=this.highest_search_priority},i.prototype.getAllErrorMessages=function(){var e=this,t=Object.entries(this.search_objects).reduce((function(t,r){var i=S(r,2),a=i[0],n=i[1];return(null==n?void 0:n.chosen)&&e.canSearch(a)&&t.push.apply(t,C(e.searches[a].validationMessages)),t}),this.travellerValidationMessages);return this.errors.next(t),t},i.prototype.travellersContainUser=function(){var e=this;return!!this.selectedTravellers.find((function(t){return t.id===e.userService.getUserId().toString()}))},i.prototype.validateTravellers=function(){switch(this.travellerValidationMessages=[],this.userService.fullUserDetails.userData.value.booker_type){case k.SelfBook:1===this.selectedTravellers.length&&this.travellersContainUser()||this.travellerValidationMessages.push("Current user must be a traveller");break;case k.BookerWithSelf:(this.selectedTravellers.length<1||!this.travellersContainUser())&&(this.travellerValidationMessages.push("Please add your self."),this.traveller_error=!0);break;case k.Booker:case k.Company:case k.CompanyGroup:case k.Office:case k.Tmc:case k.Root:this.selectedTravellers.length>=1||(this.travellerValidationMessages.push("Please select at least one traveller"),this.traveller_error=!0);break;default:return this.travellerValidationMessages.push("Unrecognised user type! - Please contact support."),!1}return 0===this.travellerValidationMessages.length},i.prototype.findPaxInTravellers=function(e){return this.selectedTravellers.find((function(t){return e===t.email}))},i.prototype.validateForms=function(){var e=this._findSearchObtect();return this.getAllErrorMessages(),!!e&&(this.errors.next(this.searches[e.type].messages.value),this.validateTravellers()&&this.searches[e.type].isValid.value)},i.prototype._findSearchObtect=function(){var e=this;return Object.values(this.search_objects).find((function(t){return!!t&&t.priority===e.highest_search_priority&&t.chosen}))},i.prototype.startSearches=function(e){var t,r=this;this.newSearchStarted.next(!0),this.search_loading=!0,(t=this._findSearchObtect())&&(t.chosen=!0),sessionStorage.getItem("search_ERM_traveller_type")&&(this.ermTravellerType=sessionStorage.getItem("search_ERM_traveller_type")),t&&!this.router.url.includes(t.resultUrl)&&this.router.navigate([t.resultUrl]);try{Promise.all(Object.values(this.searches).map((function(e){var t,i,a;return e&&r.search_objects[e.type]&&((null===(t=r.search_objects[e.type])||void 0===t?void 0:t.chosen)||e.type===ne.Rail&&(null===(i=r.searches[ne.Flight])||void 0===i?void 0:i.railFromFlightSearchPerformed)||e.type===ne.Eurostar&&(null===(a=r.searches[ne.Flight])||void 0===a?void 0:a.eurostarFromFlightSearchPerformed))?e.startSearch():Promise.resolve(!1)}))).finally((function(){var i;r.search_loading=!1,r.searchLoadingDone.next(!0),e?(r.router.navigate([e]),r.searches.INTERNATIONAL_RAIL&&r.submitIrlForm()):(null===(i=r.search_objects[ne.Ferry])||void 0===i?void 0:i.chosen)&&(r.router.navigate([t.searchUrl]),r.searches[ne.Ferry].reset(),r.modalService.open(d.OfflineRequestDialogComponent,{centered:!0,size:"md"}))}))}catch(e){console.error(e),this.search_loading=!1,this.searchLoadingDone.next(!0)}},i.prototype.getTaxiStationLocations=function(e,r){return e.length<3?t.of([]):t.of([{destination:"Manchester Airpot",isairport:!0,supplier_code:"MAN",address:"Manchester Airport",postcode:"M90 1QX"},{destination:"Manchester Piccadilly",isairport:!1,supplier_code:"MMAN",address:"Manchester Piccadilly",postcode:"M1 2PZ"},{destination:"London Heathrow",isairport:!0,supplier_code:"LHR",address:"London Heathrow Airport",postcode:"TW6 1EW"}])},i.prototype.getAddresses=function(e){return t.of([{House:"Cecil Court",Street:"28-36 Cecil Road",Town:"Hale",PostCode:"WA15 9PB",Country:"UK"}])},i.prototype.getUserAddresses=function(e){return this.userAddressesFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{ID:e.id,House:e.numberOrName,Street:e.street,Town:e.town,PostCode:e.postcode,Country:e.countryCode}}))})))},i.prototype.deleteUserAddressByID=function(e){return this.baseDeleteUserAddressUpdater.updateOne({id:e})},i.prototype.getHotelChain=function(e,i){if(e.length>2){null==i||i.next(!0);return this.searchHotelChainsFetcher.fetchList({query:e}).pipe(r.take(1),r.map((function(e){var t=e.map((function(e){return{name:e}}));return null==i||i.next(!1),t})))}return t.of([])},i.prototype.getOfficeNames=function(e){return this.confermaOfficeNamesFetcher.fetchList().pipe(r.take(1),r.map((function(e){var t;if(e)return null===(t=null==e?void 0:e.results)||void 0===t?void 0:t.map((function(e){return{id:e.id,name:e.name}}))})))},i.prototype.getOffice=function(e){return e?this.confermaOfficeFetcher.fetchOne({officeId:e}).pipe(r.take(1),r.map((function(e){if(e)return e.results}))):t.of()},i.prototype.getAllHotelChains=function(){return this.getHotelChainsFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},i.prototype.getAllRailProviders=function(){return this.getRailProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},i.prototype.getCarHireProivders=function(){return this.getCarHireProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},i.prototype.getAllAirlines=function(){return this.getAllAirlinesFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return e}))})))},i.prototype.getRailCards=function(){return this.getRailCardsFetcher.fetchList().pipe(r.take(1),r.map((function(e){if(e)return e.map((function(e){return{name:e.name,code:e.code}})).sort((function(e,t){return e.name.localeCompare(t.name)}))})))},i.prototype.getAirportByCode=function(e){return e?this.searchAirportsFetcher.fetchOne({query:e}).pipe(r.take(1),r.map((function(e){return e}))):t.of()},i.prototype.init_search_objects=function(){return{}},i.prototype.getMeThereSearchObjects=function(){return{}},i.prototype.getSelectedtravellers=function(){return this.selectedTravellers},i.prototype.resetSearchObjects=function(){this.search_objects=this._searchObjectsDefault},i.prototype.processTerminals=function(e){var t=[];return e.includes("1")||e.includes("2")||e.includes("3")||e.includes("4")||e.includes("5")?(t.push({key:"Any Terminal",value:"Any"}),e.forEach((function(e){t.push({key:"Terminal "+e,value:""+e})}))):1===e.length?t.push({key:e[0]+" Terminal",value:"Any"}):(t.push({key:"Any Terminal",value:"Any"}),e.forEach((function(e){t.push({key:e+" Terminal",value:""+e})}))),t},i.prototype.saveUserAddress=function(e){return y(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return e?[4,this.saveUserAddressUpdater.updateOne(e).toPromise()]:[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},i.prototype.canBook=function(e){return!!this.userService.canBook(e)},i.prototype.isPostcodeVaild=function(e){return this.baseValidateIsPostcodeValidTester.test({postcode:e})},i.prototype.makeCabHireQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i={adults:0,airport:null,children:0,countryCode:null,departs:this.helpers.makeMomentDayTime(),fromAddress:null,fromStation:null,fromLocationType:e.TaxiFormMode.ADDRESS,infants:0,toAddress:null,toStation:null,toLocationType:e.TaxiFormMode.ADDRESS,vehicleType:_.Any,viasFrom:null,viasTo:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],t)),["departs"])},i.prototype.makeCarHireQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={adults:0,airCon:null,carClass:null,carType:null,children:0,chosenVendor:null,chosenDistance:"5",cityDropoff:null,cityDropoffDepot:null,cityPickup:null,cityPickupDepot:null,dropoff_country:"GB",dropoff_datetime:null,dropoff_location:null,estimatedMileage:null,locationType:null,pickup_country:null,pickup_datetime:null,pickup_location:null,postcodeDropoff:null,postcodeDropoffRaw:null,postcodePickup:null,postcodePickupRaw:null,return_to_pickup:!0,transmission:null};return this.helpers.sanatizeReturns(r,Object.assign.apply(Object,C([{}],e)),["pickup_datetime","dropoff_datetime"])},i.prototype.makeFlightQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.helpers.makeMomentDayTime(),a=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(i,30),o=this.helpers.momentRoundMinutes(a,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:null,departLocation:null,fareType:U.Flexible,inboundDate:n,inTimeCriteria:e.TimeWindow.Depart,maxConnections:null,includeNearbyAirports:!1,multiDestination:[],outBoundDate:o,outTimeCriteria:e.TimeWindow.Depart,preferredCarriers:[null,null,null,null],returnCabinClass:H.Any};return this.helpers.sanatizeReturns(s,Object.assign.apply(Object,C([{}],t)),["outBoundDate","inboundDate"])},i.prototype.makeHotelQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i={checkin_date:l.default().set("hour",23).set("minute",59),checkout_date:l.default().add(1,"day").set("hour",23).set("minute",59),country:{cCode:"GB",cName:"United Kingdom"},currency:"GBP",distance:5,hotel_availability:null,hotel_chain:null,hotel_name:null,location_type_select:e.LocationTypes.Airport,location:null,no_of_occupants:1,no_of_rooms:1,office:null,postcode:null,prefered_hotels_only:!1,trainsStation:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],t)),["checkin_date","checkout_date"])},i.prototype.makeLoungesQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={adults:0,arrivalDatetime:l.default(),children:0,infants:0,locationCode:null,terminal:null};return this.helpers.sanatizeReturns(r,Object.assign.apply(Object,C([{}],e)),["arrivalDatetime"])},i.prototype.makeParkingQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.makeMomentDayTime(),i=this.helpers.makeMomentDayTime(1),a=this.helpers.momentRoundMinutes(r,30),n=this.helpers.momentRoundMinutes(i,30),o={arrivalDatetime:a,carParkedForYou:null,departDatetime:n,locationCode:null,meetAndGreet:null,onAirport:null,outFlightNumber:null,parkAndRide:null,parkAndStroll:null,recommended:null,terminal:null};return this.helpers.sanatizeReturns(o,Object.assign.apply(Object,C([{}],e)),["arrivalDatetime","departDatetime"])},i.prototype.makeRailQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.helpers.momentRoundMinutes(l.default(),30),a={airportExpressStation:null,applyRailcards:!1,carnetTicket:!1,chosenSearchClass:ee.All,chosenSearchType:te.ReturnJourney,disableAutoDiscounts:!1,extraTime:!1,inBoundDateTime:i,isAirportExpress:!1,noOfAdults:0,noOfChildren:0,outboundCriteria:e.RailSearchCriteria.Depart,outBoundDateTime:i,prioritiseByPrice:!1,returnCriteria:e.RailSearchCriteria.Depart,travellingFrom:null,travellingTo:null,via:!1,viaLocation:null,railCards:[],transactionIdentifier:null};return this.helpers.sanatizeReturns(a,Object.assign.apply(Object,C([{}],t)),["inBoundDateTime","outBoundDateTime"])},i.prototype.makeIrlQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.momentRoundMinutes(l.default(),30),i={supplier:null,countryCode:"",journeyType:V.ReturnJourney,class:null,outboundDepartureDateTime:r,travellingFrom:null,travellingTo:null,adults:0,children:0,returnDepartureDateTime:r,irlDiscountCards:null,offlineRequest:!1};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],e)),["returnDepartureDateTime","outboundDepartureDateTime"])},i.prototype.makeEurostarQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.helpers.makeMomentDayTime(),a=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(i,30),o=this.helpers.momentRoundMinutes(a,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:e.EurostarSearchType.return,departLocation:null,fareType:U.Flexible,inboundDate:n,inTimeCriteria:e.TimeWindow.Depart,maxConnections:null,includeNearbyAirports:!1,multiDestination:[],outBoundDate:o,outTimeCriteria:e.TimeWindow.Depart,preferredCarriers:[null,null,null,null],returnCabinClass:H.Any};return this.helpers.sanatizeReturns(s,Object.assign.apply(Object,C([{}],t)),["outBoundDate","inboundDate"])},i.prototype.makeFastTrackQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={adults:0,arrivalDatetime:l.default(),children:0,locationCode:null};return this.helpers.sanatizeReturns(r,Object.assign.apply(Object,C([{}],e)),["arrivalDatetime"])},i.prototype.makeFerryQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.momentRoundMinutes(l.default(),30),i={fromLocation:null,toLocation:"",departDateTime:r,onBehalfOfEmail:null,departTimeType:se.DepartAfter,returnTimeType:se.DepartAfter,passengers:[],carDetails:{make:"",model:"",reg:""},preferredTicketType:oe.Fixed,returnDateTime:r,additionalInfo:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],e)),["departDateTime","returnDateTime"])},i.prototype.shouldAddTravellerSubscription=function(){return!1},i.prototype.getAutoLogoutConfig=function(){return{}},i.prototype.shouldFetchAllOffices=function(){return!1},i.prototype.isFlightsGrouped=function(){return!1},i.prototype.getCountryFullNameFromCountryCode=function(e){for(var t=0;t<this.countries.length;t++){var r=this.countries[t];if(r.cCode===e)return r.cName}return"Unknown"},i.prototype.getUserRecentSearches=function(e,t){null==t||t.next(!0);var i={serviceType:e};return this.getUserRecentSearchesFetcher.fetchList(i).pipe(r.take(1),r.map((function(e){var r=e.map((function(e){return{id:e.id,name:e.name,serviceType:e.serviceType,searchArgs:e.searchArgs,createdAt:e.createdAt,updatedAt:e.updatedAt,travelDate:e.travelDate,travellers:e.travellers}}));return null==t||t.next(!1),r})))},i.prototype.getUserFavouriteSearches=function(e,t){null==t||t.next(!0);var i={serviceType:e};return this.getUserFavouriteSearchesFetcher.fetchList(i).pipe(r.take(1),r.tap((function(e){null==t||t.next(!1)})))},i.prototype.deleteRecentSearchByID=function(e){return this.baseDeleteRecentSearchUpdater.updateOne({id:e})},i.prototype.deleteFavouriteSearchByID=function(e){return this.deleteFavouriteSearchUpdater.updateOne({id:e})},i.prototype.saveRecentSearch=function(e){e&&!this.selectedTravellers.find((function(e){return e.guest}))&&this.baseSaveRecentSearchUpdater.updateOne(e).pipe(r.take(1)).subscribe()},i.prototype.getCovidMicrositeToken=function(){return this.getCovidMicrositeTokenFetcher.fetchList()},i.prototype.lookupEurostarStations=function(e){return console.log("term| ",e),""===e?t.of(this.eurostations):t.of(this.eurostations.filter((function(t){return t.destination.toLowerCase().indexOf(e.toLowerCase())>-1})))},i.prototype.searchTravellers=function(t,i){var a=this,n=this.userService.getUserBookingType();if(this.traveller_error=!1,n&&n!==k.SelfBook&&n!==k.Traveller&&t.length>=1){var o=t.toLowerCase().match(/([\w])+/g),s={};switch(i){case e.TravellerSearchTypes.name:s.userName=o.length>1?o[0]:t;break;case e.TravellerSearchTypes.email:s.email=t;break;case e.TravellerSearchTypes.employeeNumber:s.employeeId=t}return this.searchUsersCanBookForFetcher.fetchList(s).pipe(r.map((function(e){return e?a.helpers.clone(e).sort((function(e,t){return e.surname<t.surname?-1:e.surname>t.surname?1:0})):[]})))}},i.prototype.getFlightFareRules=function(e){return this.getFlightFareRulesFetcher.fetchList({flight:e})},i.prototype.getRailLiveDepartures=function(e,t){return this.getRailLiveDeparturesFetcher.fetchList({stationCode:e,departDateTime:t})},i.prototype.getFlightSeatMap=function(e){return this.getFlightSeatMapFetcher.fetchList({flight:e}).pipe(r.map((function(e){if(e)return e.results})))},i.prototype.saveFavouriteSearch=function(e){return this.baseSaveFavouriteSearchUpdater.updateOne(e)},i.prototype.getConfermaRoomImages=function(e){if(e)return this.getConfermaRoomImagesFetcher.fetchList({hotelId:e}).pipe(r.take(1))},i.prototype.emailBasket=function(e){return this.emailBasketFetcher.fetchList({id:e})},i.prototype.generateBasketPdf=function(e){return this.baseGenerateBasketPdfFetcher.fetchList({id:e})},i.prototype.submitIrlForm=function(){var e,t=this,r=this.userService.getUserEmail(),i=this.searches[ne.InternationalRail],a=[];if(this.allSubscription.add(this.travellerInformation.subscribe((function(t){a=t.map((function(e,t){var r;if(e.dob){var a=Math.abs((new Date).getTime()-new Date(e.dob).getTime());r=Math.floor(a/864e5/365)}return{name:e.name,age:(null==r?void 0:r.toString())||e.ageType||"Not specified",discountCard:i.discountCard[t]?i.discountCard[t].name:"None",loyaltyCard:"None"}})),e=t[0].email?t[0].email:r}))),this.allSubscription.add(i.results.subscribe((function(e){var r,i;(null===(r=e[0])||void 0===r?void 0:r.jrfreference)&&(t.jrfReference=null===(i=e[0])||void 0===i?void 0:i.jrfreference)}))),this.jrfReference&&a){a=a.map((function(e,t){return Object.assign(Object.assign({},e),{discountCard:i.discountCard[t]?i.discountCard[t].name:"None",loyaltyCard:"None"})}));var n={trainNumber:i.trainNumber||"Any",departureStation:i.travellingFrom.name,destinationStation:i.travellingTo.name,outboundDate:i.outBoundDateTime,inboundDate:i.inBoundDateTime,additionalInfo:i.additionalInstructions||"No additional instructions",serviceClass:i.irlClass||"Any",offlineReference:this.jrfReference,onBehalfOf:e,passengers:a};console.log(n),this.sendOfflineNotification(n).subscribe((function(e){e.success?t.modalService.open(d.OfflineRequestDialogComponent,{centered:!0,size:"md"},{jrfReference:t.jrfReference}):t.modalService.open(d.ModalErrorComponent,{centered:!0},{error:"Unable to send offline notification"})})),this.searches[ne.InternationalRail].reset(),this.search_objects[ne.InternationalRail].chosen=!1}},i.prototype.sendOfflineNotification=function(e){return this.sendOfflineNotificationFetcher.fetchOne(e)},i.prototype.getCountries=function(){return this.countries},i.prototype.simultaneousSearchesCheck=function(e){return void 0===e&&(e=!1),y(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return t=this.helpers.clone(this.init_search_objects()),this.userService.canBook(ne.Flight)&&(this.searches[ne.Flight].eurostarFromFlightSearchPerformed=!1,this.searches[ne.Flight].railFromFlightSearchPerformed=!1),this.search_objects[ne.Eurostar]&&(this.search_objects[ne.Eurostar].priority=t[ne.Eurostar].priority,this.search_objects[ne.Eurostar].resultUrl=t[ne.Eurostar].resultUrl),this.search_objects[ne.Rail]&&(this.search_objects[ne.Rail].priority=t[ne.Rail].priority,this.search_objects[ne.Rail].resultUrl=t[ne.Rail].resultUrl),!this.search_objects[ne.Flight].chosen||!this.userService.canBook(ne.Rail)||this.search_objects[ne.Rail].chosen&&!e?[3,2]:this.searches[ne.Flight].canBeRailSearched()?(console.log("+++ Can be rail searched +++"),[4,this.searches[ne.Rail].generateQueryFromFlightQuery(this.searches[ne.Flight].getSearchQuery())]):[3,2];case 1:r.sent(),console.log(this.searches[ne.Rail]),this.searches[ne.Flight].railFromFlightSearchPerformed=!0,this.search_objects[ne.Rail].priority=this.search_objects.FLIGHT.priority,this.search_objects[ne.Rail].resultUrl=this.search_objects.FLIGHT.resultUrl,r.label=2;case 2:return!this.search_objects[ne.Flight].chosen||!this.userService.canBook(ne.Eurostar)||this.search_objects[ne.Eurostar].chosen&&!e?[3,4]:this.searches[ne.Flight].canBeEuroSearched()?[4,this.searches[ne.Eurostar].generateQueryFromFlightQuery(this.searches[ne.Flight].getSearchQuery(),this.searches[ne.Flight].departLocation.gateway,this.searches[ne.Flight].arriveLocation.gateway)]:[3,4];case 3:r.sent(),this.searches[ne.Flight].eurostarFromFlightSearchPerformed=!0,this.search_objects[ne.Eurostar].priority=this.search_objects.FLIGHT.priority,this.search_objects[ne.Eurostar].resultUrl=this.search_objects.FLIGHT.resultUrl,r.label=4;case 4:return[2]}}))}))},i.prototype.turnOffAllChosenProduct=function(){var e=this;Object.keys(this.search_objects).map((function(t){e.search_objects[t].chosen=!1}))},i}();Ni.SESSION_TRAVELLER="search_travellers";var Mi=function(){},Li=function(){function t(e,t,r){this.modalOpenerService=e,this.router=r,this._jwtToken=null,this.timer=null,this.timeoutDuration=3600,this.autoLogoutConfig={},this._bobo=null,this._boboFetched=!1,this.timeOutDuration=t.autoLogoutTime}return Object.defineProperty(t.prototype,"timeOutDuration",{set:function(e){this.timeoutDuration=60*e-60},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jwtToken",{get:function(){return this._jwtToken||null},set:function(e){e!==this.jwtToken&&(this._jwtToken=e)},enumerable:!1,configurable:!0}),t.prototype.getInvokedUserObservable=function(){var e=this;if(this._boboFetched)throw new Error("Only one service can access the service which should be the searchService");return this._boboFetched=!0,Object.freeze({next:function(t){e._bobo=!t||t.id?t:null}})},t.prototype._updateTimer=function(){var e=this;window.clearTimeout(this.timer),this.timer=null,console.log("Resetting auto log out"),this.timer=window.setTimeout((function(){e.checkToLogout()}),6e4)},t.prototype.checkToLogout=function(){var t,r=this;l.default().unix()-((null===(t=this.lastUpdated)||void 0===t?void 0:t.unix())||0)>this.timeoutDuration?(this.timer=null,this.lastUpdated=l.default(),"/logon"!==this.router.url&&"/"!==this.router.url&&this.modalOpenerService.open(d.AutoLogout,this.autoLogoutConfig,{}).then((function(t){t!==e.LogoutEnum.LOGOUT?r._updateTimer():r._jwtToken=null}))):this._updateTimer()},t}(),wi=function(){function e(e,t){this.httpService=e,this.helpers=t}return e.prototype.getAmenitiesForFlight=function(e){return new t.BehaviorSubject([])},e.prototype.parseAmenities=function(e){var t=e.linked,r=function(e,t){return t.find((function(t){return t.id==e}))};return e.data.map((function(e){var i=r(e.links.segments[0],t.segments);return{seat:r(i.links.seat.toString(),t.seats),wifi:r(i.links.wifi.toString(),t.wifis),power:r(i.links.power.toString(),t.entertainments),entertainment:r(i.links.entertainment.toString(),t.entertainments),fresh_food:r(i.links.fresh_food.toString(),t.fresh_foods),beverage:r(i.links.beverage.toString(),t.beverages),layout:r(i.links.layout.toString(),t.layouts),aircraft:r(i.links.aircraft.toString(),t.aircrafts)}}))},e.prototype.convertClassString=function(e){switch(e){case"ECONOMY":return"ECON";case"PREMIUM ECONOMY":return"PREMECON";case"BUSINESS":return"BUSINESS";case"FIRST":return"FIRST";default:return"ECON"}},e.prototype.getUpasForFlight=function(e){var r=this,i=new t.BehaviorSubject([]);return e.LegDetails.map((function(e){return{segments:[{dep:e.depPoint,arr:e.arrPoint,carrier:e.touropID,flt_no:e.transNo.substr(e.touropID.length),dep_date:r.helpers.formatIsoDate(r.helpers.yymmddToMoment(e.dateDep)),cabin_id:r.convertClass(e.seatClassBasic.toUpperCase())}]}})),i},e.prototype.convertClass=function(e){switch(e){case"ECONOMY":return 1;case"PREMIUM ECONOMY":return 2;case"BUSINESS":return 3;case"FIRST":return 4;default:return 1}},e.prototype.parseResponse=function(e){var t=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join("_")},r=function(e){return e.attributes},i=e.included.reduce((function(e,r){return e[t(r.type,r.id)]=r,e}),{}),a=function(e){return i[function(e){return t(e.type,e.id)}(e)]};return e.data.relationships.legs.data.map((function(e){var t=a(e).relationships.leg_fares.data.map(a).filter((function(e){return!!e.relationships.fare.data}));return{brands:t.map((function(e){return a(e.relationships.fare.data)})).map(r),upas:t.map((function(e){return e.relationships.leg_fare_segments.data.map(a)})).map((function(e){return e.map((function(e){return e.relationships.upas.data.map(a).map((function(e){return{id:e.id,details:r(e)}})).reduce((function(e,t){return e[t.id]=t.details,e}),{})}))}))}}))},e}();f([Ke(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],wi.prototype,"getAmenitiesForFlight",null),f([Ke(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],wi.prototype,"getUpasForFlight",null);var ji=function(e){function t(t,r){var i=e.call(this,r)||this;return i.query=t,i}return m(t,e),t.prototype.test=function(e){return this.processCall(this.query.fetch(e))},t}(h),Ui=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.validateUserMIFreeValue},t}(ji),Hi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.isPostcodeValid},t}(ji),xi=function(e){function t(t,r){var i=e.call(this,r)||this;return i.query=t,i}return m(t,e),t.prototype.updateOne=function(e){return this.processCall(this.query.mutate(e))},t}(h),Gi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.acceptNewPrice},t}(xi),Vi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.addItemToBasket},t}(xi),Wi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.addUserToBasketItem},t}(xi),Qi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.bookBasket},t}(xi),Ji=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.createBasket},t}(xi),Yi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.moveItemToADifferentBasket},t}(xi),Ki=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteBasket},t}(xi),qi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.removeItemFromBasket},t}(xi),Xi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteUserAddress},t}(xi),Zi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteRecentSearch},t}(xi),zi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.revalidateBasket},t}(xi),$i=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.saveUserAddress},t}(xi),ea=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.sendBasketForApproval},t}(xi),ta=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemLeadPassenger},t}(xi),ra=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemMIGroup},t}(xi),ia=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemMIValue},t}(xi),aa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.updateBasketTitle},t}(xi),na=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.baseUpdateBasketNotes},t}(xi),oa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.saveRecentSearch},t}(xi),sa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemPaymentMethod},t}(xi),la=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.confirmMessages},t}(xi),ua=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.cancelBooking},t}(xi),ca=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.saveFavouriteSearch},t}(xi),da=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteFavouriteSearch},t}(xi),ha=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.setUserLanguage},t}(xi),pa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.editUser},t}(xi),ma=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.createGuest},t}(xi),fa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.addGuestToBasketItem},t}(xi),va=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.addRedirectApprover},t}(xi),ya=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.removeRedirectApprover},t}(xi);e.AbstractHttpCallService=Ti,e.AddressImpl=Xt,e.Airlines=[{label:"12 North",value:"12"},{label:"1time Airline",value:"1T"},{label:"3 Valleys Airlines",value:"3V"},{label:"40-mile Air",value:"Q5"},{label:"88",value:"47"},{label:"Aban Air",value:"K5"},{label:"Abelag Aviation",value:"W9"},{label:"Absa - Aerolinhas Brasileiras",value:"M3"},{label:"Abu Dhabi Amiri Flight",value:"MO"},{label:"Abx Air",value:"GB"},{label:"Access Air",value:"ZA"},{label:"Ada Air",value:"ZY"},{label:"Adam Air",value:"KI"},{label:"Adc Airlines",value:"Z7"},{label:"Adria Airways",value:"JP"},{label:"Aegean Airlines",value:"A3"},{label:"Aer Arann",value:"RE"},{label:"Aer Lingus",value:"EI"},{label:"Aereonautica Militare",value:"JY"},{label:"Aero Airlines",value:"EE"},{label:"Aero Asia International",value:"E4"},{label:"Aero Benin",value:"EM"},{label:"Aero Brazil",value:"BZ"},{label:"Aero California",value:"JR"},{label:"Aero Condor Peru",value:"Q6"},{label:"Aero Contractors",value:"AJ"},{label:"Aero Flight",value:"GV"},{label:"Aero Lanka",value:"QL"},{label:"Aero Lloyd (yp)",value:"YP"},{label:"Aero Mongolia",value:"M0"},{label:"Aero Services Executive",value:"W4"},{label:"Aero Vip",value:"2D"},{label:"Aero-charter Ukraine",value:"DW"},{label:"Aero-service",value:"BF"},{label:"Aero-tropics Air Services",value:"HC"},{label:"Aerocondor",value:"2B"},{label:"Aeroflot Russian Airlines",value:"SU"},{label:"Aeroflot-don",value:"D9"},{label:"Aerolane",value:"XL"},{label:"Aeroline Gmbh",value:"7E"},{label:"Aerolineas Argentinas",value:"AR"},{label:"Aerolineas Galapagos (aerogal)",value:"2K"},{label:"Aerolitoral",value:"5D"},{label:"Aeromar",value:"BQ"},{label:"Aeromar",value:"VW"},{label:"Aeromexpress",value:"QO"},{label:"Aeromist-kharkiv",value:"HT"},{label:"Aerom�xico",value:"AM"},{label:"Aeropelican Air Services",value:"OT"},{label:"Aeroper",value:"PL"},{label:"Aerorep",value:"P5"},{label:"Aerosur",value:"5L"},{label:"Aerosvit Airlines",value:"VV"},{label:"Aeroworld",value:"W4"},{label:"Africa West",value:"FK"},{label:"African Safari Airways",value:"QS"},{label:"Afrinat International Airlines",value:"Q9"},{label:"Afriqiyah Airways",value:"8U"},{label:"Aguilar Connect",value:"3X"},{label:"Aigle Azur",value:"ZI"},{label:"Air Afrique",value:"RK"},{label:"Air Algerie",value:"AH"},{label:"Air Alpha Greenland",value:"GD"},{label:"Air Alps Aviation",value:"A6"},{label:"Air Andaman (2y)",value:"2Y"},{label:"Air Arabia Egypt",value:"E5"},{label:"Air Arabia",value:"G9"},{label:"Air Armenia",value:"QN"},{label:"Air Astana",value:"KC"},{label:"Air Atlanta Icelandic",value:"CC"},{label:"Air Atlantique",value:"KI"},{label:"Air Austral",value:"UU"},{label:"Air Bagan",value:"W9"},{label:"Air Baltic",value:"BT"},{label:"Air Bangladesh",value:"B9"},{label:"Air Berlin",value:"AB"},{label:"Air Bosna",value:"JA"},{label:"Air Botswana",value:"BP"},{label:"Air Bourbon",value:"ZB"},{label:"Air Burkina",value:"2J"},{label:"Air Burundi",value:"8Y"},{label:"Air Busan",value:"BX"},{label:"Air Cal",value:"TY"},{label:"Air Caledonie International",value:"SB"},{label:"Air Canada Jazz",value:"QK"},{label:"Air Canada",value:"AC"},{label:"Air Cara�bes",value:"TX"},{label:"Air Cargo Carriers",value:"2Q"},{label:"Air Central",value:"NV"},{label:"Air Chathams",value:"CV"},{label:"Air China",value:"CA"},{label:"Air City",value:"4F"},{label:"Air Class Lineas Aereas",value:"QD"},{label:"Air Comores International",value:"GG"},{label:"Air Contractors",value:"AG"},{label:"Air Corridor",value:"QC"},{label:"Air Dayiti",value:"H9"},{label:"Air Dolomiti",value:"EN"},{label:"Air Europa",value:"UX"},{label:"Air Europe",value:"PE"},{label:"Air Exel",value:"XT"},{label:"Air Fiji",value:"PC"},{label:"Air Finland",value:"OF"},{label:"Air Florida",value:"QH"},{label:"Air Foyle",value:"GS"},{label:"Air France",value:"AF"},{label:"Air Gabon",value:"GN"},{label:"Air Georgia",value:"DA"},{label:"Air Georgian",value:"ZX"},{label:"Air Glaciers",value:"7T"},{label:"Air Greenland",value:"GL"},{label:"Air Guinee Express",value:"2U"},{label:"Air Guyane",value:"GG"},{label:"Air Hamburg (aho)",value:"HH"},{label:"Air Hong Kong",value:"LD"},{label:"Air Horizon",value:"8C"},{label:"Air Iceland",value:"NY"},{label:"Air India Express",value:"IX"},{label:"Air India Limited",value:"AI"},{label:"Air Indus",value:"PP"},{label:"Air Italy",value:"I9"},{label:"Air Ivoire",value:"VU"},{label:"Air Jamaica",value:"JM"},{label:"Air Japan",value:"NQ"},{label:"Air Kazakhstan",value:"9Y"},{label:"Air Kiribati",value:"4A"},{label:"Air Koryo",value:"JS"},{label:"Air Lithuania",value:"TT"},{label:"Air Lituanica",value:"LT"},{label:"Air Luxor Gb",value:"L8"},{label:"Air Luxor",value:"LK"},{label:"Air Macau",value:"NX"},{label:"Air Madagascar",value:"MD"},{label:"Air Madrid",value:"NM"},{label:"Air Malawi",value:"QM"},{label:"Air Malta",value:"KM"},{label:"Air Marshall Islands",value:"CW"},{label:"Air Mauritanie",value:"MR"},{label:"Air Mauritius",value:"MK"},{label:"Air Mediterranee",value:"DR"},{label:"Air Mekong",value:"P8"},{label:"Air Midwest",value:"ZV"},{label:"Air Mobility Command",value:"MC"},{label:"Air Moldova",value:"9U"},{label:"Air Namibia",value:"SW"},{label:"Air New Zealand",value:"NZ"},{label:"Air Nippon Network Co. Ltd.",value:"EH"},{label:"Air Nippon",value:"EL"},{label:"Air Niugini",value:"PX"},{label:"Air North Charter - Canada",value:"4N"},{label:"Air Nostrum",value:"YW"},{label:"Air One",value:"AP"},{label:"Air Pacific",value:"FJ"},{label:"Air Paradise International",value:"AD"},{label:"Air Pegasus",value:"OP"},{label:"Air Philippines",value:"2P"},{label:"Air Plus Comet",value:"A7"},{label:"Air Rarotonga",value:"GZ"},{label:"Air S",value:"KY"},{label:"Air Sahara",value:"S2"},{label:"Air Saint Pierre",value:"PJ"},{label:"Air Salone",value:"20"},{label:"Air Santo Domingo",value:"EX"},{label:"Air Senegal International",value:"V7"},{label:"Air Serbia",value:"JU"},{label:"Air Service Gabon",value:"G8"},{label:"Air Service",value:"M3"},{label:"Air Seychelles",value:"HM"},{label:"Air Sinai",value:"4D"},{label:"Air Slovakia",value:"GM"},{label:"Air Srpska",value:"RB"},{label:"Air Tahiti Nui",value:"TN"},{label:"Air Tahiti",value:"VT"},{label:"Air Tanzania",value:"TC"},{label:"Air Togo",value:"YT"},{label:"Air Transat",value:"TS"},{label:"Air Transport International",value:"8C"},{label:"Air Turks And Caicos",value:"JY"},{label:"Air Ukraine",value:"6U"},{label:"Air Urga",value:"3N"},{label:"Air Vanuatu",value:"NF"},{label:"Air Vegas",value:"6V"},{label:"Air Via",value:"VL"},{label:"Air Vistara",value:"UK"},{label:"Air Wales",value:"6G"},{label:"Air Wisconsin",value:"ZW"},{label:"Air Zimbabwe",value:"UM"},{label:"Airasia X",value:"D7"},{label:"Airasia",value:"AK"},{label:"Airblue",value:"ED"},{label:"Airborne Express",value:"GB"},{label:"Airbridge Cargo",value:"RU"},{label:"Airbus France",value:"4Y"},{label:"Airbus Industrie",value:"AP"},{label:"Aircompany Yakutia",value:"R3"},{label:"Aires",value:"4C"},{label:"Airlinair",value:"A5"},{label:"Airlines Of Tasmania",value:"FO"},{label:"Airlines Png",value:"CG"},{label:"Airlink Zambia",value:"K8"},{label:"Airnorth",value:"TL"},{label:"Airone Atlantic",value:"00"},{label:"Airone Continental",value:"00"},{label:"Airone Polska",value:"U1"},{label:"Airrussia",value:"R8"},{label:"Airstars",value:"PL"},{label:"Airtran Airways",value:"FL"},{label:"Alaska Airlines",value:"AS"},{label:"Alaska Central Express",value:"KO"},{label:"Albanian Airlines",value:"LV"},{label:"Albarka Air",value:"F4"},{label:"Alidaunia",value:"D4"},{label:"Alitalia Express",value:"XM"},{label:"Alitalia",value:"AZ"},{label:"All Africa",value:"9A"},{label:"All America Ar",value:"2R"},{label:"All America Bopy",value:"0P"},{label:"All America Br",value:"1Y"},{label:"All America Cl",value:"1R"},{label:"All America Co",value:"0Y"},{label:"All America Mx",value:"0M"},{label:"All America Us",value:"AG"},{label:"All America",value:"A2"},{label:"All Argentina Express",value:"Z0"},{label:"All Argentina",value:"L1"},{label:"All Asia",value:"L9"},{label:"All Australia",value:"88"},{label:"All Colombia",value:"7O"},{label:"All Europe",value:"N9"},{label:"All Nippon Airways",value:"NH"},{label:"All Spain",value:"N7"},{label:"Allegiant Air",value:"G4"},{label:"Allegro",value:"LL"},{label:"Alliance Air",value:"CD"},{label:"Alliance Airlines",value:"QQ"},{label:"Almasria Universal Airlines",value:"UJ"},{label:"Aloha Airlines",value:"AQ"},{label:"Alpi Eagles",value:"E8"},{label:"Alpine Air Express",value:"5A"},{label:"Alrosa Mirny Air Enterprise",value:"6R"},{label:"Amadeus Global Travel Distribution",value:"1A"},{label:"Amaszonas",value:"Z8"},{label:"Amber Air",value:"0A"},{label:"America West Airlines",value:"HP"},{label:"American Airlines",value:"AA"},{label:"American Eagle Airlines",value:"MQ"},{label:"American Falcon",value:"WK"},{label:"Amerijet International",value:"M6"},{label:"Amsterdam Airlines",value:"WD"},{label:"Ansett Australia",value:"AN"},{label:"Antinea Airlines",value:"HO"},{label:"Antrak Air",value:"04"},{label:"Aom French Airlines",value:"IW"},{label:"Apache Air",value:"ZM"},{label:"Arctic Circle Air Service",value:"5F"},{label:"Arcus-air Logistic",value:"ZE"},{label:"Ariana Afghan Airlines",value:"FG"},{label:"Arik Air",value:"W3"},{label:"Arik Niger",value:"Q9"},{label:"Arkefly",value:"OR"},{label:"Arkia Israel Airlines",value:"IZ"},{label:"Armavia",value:"U8"},{label:"Armenian International Airways",value:"MV"},{label:"Arrow Air",value:"JW"},{label:"Aserca Airlines",value:"R7"},{label:"Asia Overnight Express",value:"OE"},{label:"Asia Wings",value:"Y5"},{label:"Asian Express Airlines",value:"HJ"},{label:"Asian Spirit",value:"6K"},{label:"Asian Wings Airways",value:"AW"},{label:"Asiana Airlines",value:"OZ"},{label:"Askari Aviation",value:"4K"},{label:"Astar Air Cargo",value:"ER"},{label:"Astraeus",value:"5W"},{label:"Astrakhan Airlines",value:"OB"},{label:"Astral Aviation",value:"8V"},{label:"Atifly",value:"A1"},{label:"Atlant-soyuz Airlines",value:"3G"},{label:"Atlantic Airways",value:"RC"},{label:"Atlantic Southeast Airlines",value:"EV"},{label:"Atlantis European Airways",value:"TD"},{label:"Atlas Air",value:"5Y"},{label:"Atlas Blue",value:"8A"},{label:"Atlasjet",value:"KK"},{label:"Atran Cargo Airlines",value:"V8"},{label:"Atyrau Air Ways",value:"IP"},{label:"Augsburg Airways",value:"IQ"},{label:"Aurigny Air Services",value:"GR"},{label:"Aus-air",value:"NO"},{label:"Austral Lineas Aereas",value:"AU"},{label:"Australian Airlines",value:"AO"},{label:"Austrian Airlines",value:"OS"},{label:"Avcom",value:"J6"},{label:"Avensa",value:"VE"},{label:"Aviabus",value:"U1"},{label:"Aviaexpress",value:"RX"},{label:"Avialeasing Aviation Company",value:"EC"},{label:"Avianca - Aerovias Nacionales De Colombia",value:"AV"},{label:"Avient Aviation",value:"Z3"},{label:"Avies",value:"U3"},{label:"Avirex",value:"G2"},{label:"Avolar Aerolineas",value:"V5"},{label:"Aws Express",value:"B0"},{label:"Axis Airways",value:"6V"},{label:"Azerbaijan Airlines",value:"J2"},{label:"Azul",value:"AD"},{label:"B&h Airlines",value:"JA"},{label:"BMI",value:"BD"},{label:"Ba Cityflyer",value:"CJ"},{label:"Bach Flugbetriebsges",value:"B4"},{label:"Bahamasair",value:"UP"},{label:"Baikotovitchestrian Airlines",value:"BU"},{label:"Baker Aviation",value:"8Q"},{label:"Bal Bashkirian Airlines",value:"V9"},{label:"Baltic Air Lines",value:"B1"},{label:"Bangkok Airways",value:"PG"},{label:"Bankair",value:"B4"},{label:"Barents Airlink",value:"8N"},{label:"Bassaka Airlines",value:"5B"},{label:"Bayu Indonesia Air",value:"BM"},{label:"Bearskin Lake Air Service",value:"JV"},{label:"Belair Airlines",value:"4T"},{label:"Belavia Belarusian Airlines",value:"B2"},{label:"Bellview Airlines",value:"B3"},{label:"Bemidji Airlines",value:"CH"},{label:"Benin Golf Air",value:"A8"},{label:"Bering Air",value:"8E"},{label:"Berjaya Air",value:"J8"},{label:"Big Sky Airlines",value:"GQ"},{label:"Biman Bangladesh Airlines",value:"BG"},{label:"Binter Canarias",value:"NT"},{label:"Bismillah Airlines",value:"5Z"},{label:"Black Stallion Airways",value:"BZ"},{label:"Blue Air",value:"0B"},{label:"Blue Dart Aviation",value:"BZ"},{label:"Blue Panorama Airlines",value:"BV"},{label:"Blue Sky America",value:"BU"},{label:"Blue Wings",value:"QW"},{label:"Blue1",value:"KF"},{label:"Bluebird Cargo",value:"BF"},{label:"Bmibaby",value:"WW"},{label:"Boston-maine Airways",value:"E9"},{label:"Bouraq Indonesia Airlines",value:"BO"},{label:"Boutique Air (priv)",value:"4B"},{label:"Bra-transportes Aereos",value:"7R"},{label:"Braathens",value:"BU"},{label:"Braniff International Airways",value:"BN"},{label:"Bravo Air Congo",value:"K6"},{label:"Brazil Air",value:"GB"},{label:"Brit Air",value:"DB"},{label:"British Airways",value:"BA"},{label:"British International Helicopters",value:"BS"},{label:"British Mediterranean Airways",value:"KJ"},{label:"Brussels Airlines",value:"SN"},{label:"Budgetair",value:"1K"},{label:"Buffalo Airways",value:"J4"},{label:"Bulgaria Air",value:"FB"},{label:"Buquebus L�neas A�reas",value:"BQ"},{label:"Businessair",value:"8B"},{label:"Buzz",value:"UK"},{label:"Cal Cargo Air Lines",value:"5C"},{label:"California Western",value:"KT"},{label:"Calima Aviacion",value:"XG"},{label:"Calm Air",value:"MO"},{label:"Camai Air",value:"R9"},{label:"Cameroon Airlines",value:"UY"},{label:"Canadian Airlines",value:"CP"},{label:"Canadian National Airways",value:"CN"},{label:"Canadian North",value:"5T"},{label:"Canadian Western Airlines",value:"W2"},{label:"Canadian World",value:"10"},{label:"Canjet",value:"C6"},{label:"Canxplorer",value:"C2"},{label:"Canxpress",value:"C1"},{label:"Cape Air",value:"9K"},{label:"Capital Cargo International Airlines",value:"PT"},{label:"Cargo 360",value:"GG"},{label:"Cargo Plus Aviation",value:"8L"},{label:"Cargoitalia",value:"2G"},{label:"Cargojet Airways",value:"W8"},{label:"Cargolux",value:"CV"},{label:"Caribbean Airlines",value:"BW"},{label:"Caribbean Star Airlines",value:"8B"},{label:"Caribbean Wings",value:"XP"},{label:"Carpatair",value:"V3"},{label:"Caspian Airlines",value:"RV"},{label:"Cathay Pacific",value:"CX"},{label:"Cayman Airways",value:"KX"},{label:"Cb Airways Uk ( Interliging Flights )",value:"1F"},{label:"Ccml Airlines",value:"CB"},{label:"Cebu Pacific",value:"5J"},{label:"Centavia",value:"7N"},{label:"Centralwings",value:"C0"},{label:"Centre-avia",value:"J7"},{label:"Centurion Air Cargo",value:"WE"},{label:"Chalks Ocean Airways",value:"OP"},{label:"Champion Air",value:"MG"},{label:"Changan Airlines",value:"2Z"},{label:"Chari Aviation Services",value:"S8"},{label:"Chautauqua Airlines",value:"RP"},{label:"Chc Airways",value:"AW"},{label:"Cheapflyinginternational",value:"WL"},{label:"Chicago Express",value:"C8"},{label:"China Airlines",value:"CI"},{label:"China Cargo Airlines",value:"CK"},{label:"China Eastern Airlines",value:"MU"},{label:"China Northern Airlines",value:"CJ"},{label:"China Northwest Airlines",value:"WH"},{label:"China Postal Airlines",value:"8Y"},{label:"China Southern Airlines",value:"CZ"},{label:"China United Airlines",value:"HR"},{label:"China Xinhua Airlines",value:"XO"},{label:"Chitaavia",value:"X7"},{label:"Chongqing Airlines",value:"OQ"},{label:"Ciel Canadien",value:"YC"},{label:"Cielos Airlines",value:"A2"},{label:"Cimber Air",value:"QI"},{label:"Cirrus Airlines",value:"C9"},{label:"City Airline",value:"CF"},{label:"City Airways",value:"E8"},{label:"City Connexion Airlines",value:"G3"},{label:"Cityjet",value:"WX"},{label:"Civil Air Transport",value:"CT"},{label:"Club Air",value:"6P"},{label:"Coast Air",value:"BX"},{label:"Colgan Air",value:"9L"},{label:"Comair",value:"MN"},{label:"Comair",value:"OH"},{label:"Commutair",value:"C5"},{label:"Comores Airlines",value:"KR"},{label:"Compania Mexicargo",value:"GJ"},{label:"Compass Airlines",value:"CP"},{label:"Condor Flugdienst",value:"DE"},{label:"Consorcio Aviaxsa",value:"6A"},{label:"Contact Air",value:"C3"},{label:"Continental Airlines",value:"CO"},{label:"Continental Airways",value:"PC"},{label:"Continental Micronesia",value:"CS"},{label:"Conviasa",value:"V0"},{label:"Copa Airlines",value:"CM"},{label:"Copenhagen Express",value:"0X"},{label:"Corsairfly",value:"SS"},{label:"Corse-mediterranee",value:"XK"},{label:"Cosmic Air",value:"F5"},{label:"Croatia Airlines",value:"OU"},{label:"Crossair Europe",value:"QE"},{label:"Cubana De Aviaci�n",value:"CU"},{label:"Cyprus Airways",value:"CY"},{label:"Czech Airlines",value:"OK"},{label:"DBA",value:"DI"},{label:"Daallo Airlines",value:"D3"},{label:"Dagestan Airlines",value:"N2"},{label:"Dalavia",value:"H8"},{label:"Darwin Airline",value:"0D"},{label:"Das Air Cargo",value:"WD"},{label:"Dat Danish Air Transport",value:"DX"},{label:"Dauair",value:"D5"},{label:"Delta Air Lines",value:"DL"},{label:"Dennis Sky",value:"DH"},{label:"Dense Airways",value:"KP"},{label:"Dense Connection",value:"KZ"},{label:"Deutsche Luftverkehrsgesellschaft (dlt)",value:"DW"},{label:"Deutsche Luftverkehrsgesellschaft",value:"DW"},{label:"Deutsche Rettungsflugwacht",value:"1I"},{label:"Dhl De Guatemala",value:"L3"},{label:"Dhl International",value:"ES"},{label:"Dinar",value:"D7"},{label:"Dirgantara Air Service",value:"AW"},{label:"Discovery Airways",value:"DH"},{label:"Djibouti Airlines",value:"D8"},{label:"Dobrolet",value:"QD"},{label:"Domenican Airlines",value:"D1"},{label:"Dominicana De Aviaci",value:"DO"},{label:"Domodedovo Airlines",value:"E3"},{label:"Donbassaero",value:"5D"},{label:"Dragonair",value:"KA"},{label:"Druk Air",value:"KB"},{label:"East African Safari Air",value:"S9"},{label:"East African",value:"QU"},{label:"Eastar Jet",value:"ZE"},{label:"Eastern Airways",value:"T3"},{label:"Eastern Atlantic Virtual Airlines",value:"13"},{label:"Eastland Air",value:"DK"},{label:"Eastwind Airlines",value:"W9"},{label:"Easyjet",value:"U2"},{label:"Edelweiss Air",value:"WK"},{label:"Egyptair",value:"MS"},{label:"El Al Israel Airlines",value:"LY"},{label:"El-buraq Air Transport",value:"UZ"},{label:"Elk Airways",value:"--"},{label:"Elysian Airlines",value:"E4"},{label:"Emirates",value:"EK"},{label:"Empire Airlines",value:"EM"},{label:"Empresa Ecuatoriana De Aviacion",value:"EU"},{label:"Enkor Jsc",value:"G8"},{label:"Eos Airlines",value:"E0"},{label:"Epic Holiday",value:"FA"},{label:"Era Alaska",value:"7H"},{label:"Eritrean Airlines",value:"B8"},{label:"Estafeta Carga Aerea",value:"E7"},{label:"Estonian Air",value:"OV"},{label:"Ethiopian Airlines",value:"ET"},{label:"Etihad Airways",value:"EY"},{label:"Eujet",value:"VE"},{label:"Euro Harmony",value:"EH"},{label:"Eurocypria Airlines",value:"UI"},{label:"Eurofly Service",value:"GJ"},{label:"Euroline",value:"4L"},{label:"Eurolot",value:"K2"},{label:"Euromanx Airways",value:"3W"},{label:"Europe Jet",value:"EX"},{label:"European Air Express",value:"EA"},{label:"European Air Transport",value:"QY"},{label:"European Aviation Air Charter",value:"E7"},{label:"Europesky",value:"ES"},{label:"Eurowings",value:"EW"},{label:"Eva Air",value:"BR"},{label:"Evergreen International Airlines",value:"EZ"},{label:"Excel Airways",value:"JN"},{label:"Execair Aviation",value:"MB"},{label:"Executive Airlines",value:"OW"},{label:"Expo Aviation",value:"8D"},{label:"Express One International",value:"EO"},{label:"Expressjet",value:"XE"},{label:"Far Eastern Air Transport",value:"EF"},{label:"Faroejet",value:"F6"},{label:"Faso Airways",value:"F3"},{label:"Federal Express",value:"FX"},{label:"Felix Airways",value:"FU"},{label:"Fika Salaama Airlines",value:"N8"},{label:"Finalair Congo",value:"4S"},{label:"Finnair",value:"AY"},{label:"Finncomm Airlines",value:"FC"},{label:"Firefly",value:"FY"},{label:"First Air",value:"7F"},{label:"First Choice Airways",value:"DP"},{label:"Fischer Air",value:"8F"},{label:"Flightline",value:"B5"},{label:"Florida Coastal Airlines",value:"PA"},{label:"Florida West International Airways",value:"RF"},{label:"Fly Air",value:"F2"},{label:"Fly Brasil",value:"F1"},{label:"Fly Colombia ( Interliging Flights )",value:"3F"},{label:"Fly Dubai",value:"FZ"},{label:"Fly Europa",value:"ER"},{label:"Fly France",value:"FF"},{label:"Fly Illi",value:"IL"},{label:"Fly Me Sweden",value:"SH"},{label:"Fly One",value:"F5"},{label:"Fly Romania",value:"X5"},{label:"Fly540",value:"5H"},{label:"Flybaboo",value:"F7"},{label:"Flybe",value:"BE"},{label:"Flyglobespan",value:"B4"},{label:"Flyhigh Airlines Ireland (fh)",value:"FH"},{label:"Flylal",value:"TE"},{label:"Flynordic",value:"LF"},{label:"Flyportugal",value:"PO"},{label:"Formosa Airlines",value:"VY"},{label:"Four Star Aviation / Four Star Cargo",value:"HK"},{label:"Fox Linhas Aereas",value:"FX"},{label:"Fra Air",value:"X9"},{label:"Freedom Air",value:"FP"},{label:"Frontier Airlines",value:"F9"},{label:"Frontier Flying Service",value:"2F"},{label:"Futura International Airways",value:"FH"},{label:"Gabon Airlines",value:"GY"},{label:"Gadair European Airlines",value:"GP"},{label:"Galaxy Air",value:"7O"},{label:"Gambia International Airlines",value:"GC"},{label:"Gandalf Airlines",value:"G7"},{label:"Garuda Indonesia",value:"GA"},{label:"Gazpromavia",value:"4G"},{label:"Gb Airways",value:"GT"},{label:"Gemini Air Cargo",value:"GR"},{label:"Georgian Airways",value:"A9"},{label:"Georgian National Airlines",value:"QB"},{label:"German International Air Lines",value:"GM"},{label:"Germania",value:"ST"},{label:"Germanwings",value:"4U"},{label:"Germanxl",value:"GX"},{label:"Gestair",value:"GP"},{label:"Ghana International Airlines",value:"G0"},{label:"Global Airlines",value:"0G"},{label:"Global Freightways",value:"F5"},{label:"Globus",value:"GH"},{label:"Go Air",value:"G8"},{label:"Godutch",value:"GD"},{label:"Gojet Airlines",value:"G7"},{label:"Gol Transportes A�reos",value:"G3"},{label:"Golden Air",value:"DC"},{label:"Gorkha Airlines",value:"G1"},{label:"Grant Aviation",value:"GS"},{label:"Great Lakes Airlines",value:"ZK"},{label:"Great Wall Airlines",value:"IJ"},{label:"Greenfly",value:"XX"},{label:"Grupo Taca",value:"TA"},{label:"Guine Bissaur Airlines",value:"G6"},{label:"Guinee Airlines",value:"J9"},{label:"Gujarat Airways",value:"G8"},{label:"Gulf Air Bahrain",value:"GF"},{label:"Gulisano Airways",value:"GU"},{label:"Hageland Aviation Services",value:"H6"},{label:"Hahn Air",value:"HR"},{label:"Hainan Airlines",value:"HU"},{label:"Haiti Ambassador Airlines",value:"2T"},{label:"Hamburg International",value:"4R"},{label:"Hankook Air Us",value:"H1"},{label:"Hankook Airline",value:"HN"},{label:"Hapagfly",value:"HF"},{label:"Harbor Airlines",value:"HB"},{label:"Harmony Airways",value:"HQ"},{label:"Hawaiian Airlines",value:"HA"},{label:"Heavylift Cargo Airlines",value:"HN"},{label:"Heli France",value:"8H"},{label:"Helijet",value:"JB"},{label:"Helios Airways",value:"ZU"},{label:"Hellas Jet",value:"T4"},{label:"Hellenic Airways",value:"1H"},{label:"Hellenic Imperial Airways",value:"HT"},{label:"Hello",value:"HW"},{label:"Helvetic Airways",value:"2L"},{label:"Hemus Air",value:"DU"},{label:"Hewa Bora Airways",value:"EO"},{label:"Hexair",value:"UD"},{label:"Hi Fly",value:"5K"},{label:"Himalayan Airlines",value:"HC"},{label:"Hokkaido International Airlines",value:"HD"},{label:"Hola Airlines",value:"H5"},{label:"Homer Air",value:"MR"},{label:"Hong Kong Airlines",value:"HX"},{label:"Hong Kong Express Airways",value:"UO"},{label:"Horizon Air",value:"QX"},{label:"Horizon Airlines",value:"BN"},{label:"I-fly",value:"H5"},{label:"Ibc Airways",value:"II"},{label:"Iberia Airlines",value:"IB"},{label:"Iberia Express",value:"I2"},{label:"Iberworld",value:"TY"},{label:"Ibex Airlines",value:"FW"},{label:"Icelandair",value:"FI"},{label:"Illinois Airways",value:"IL"},{label:"Imair Airlines",value:"IK"},{label:"Inavia Internacional",value:"Z5"},{label:"Independence Air",value:"DH"},{label:"Indian Airlines",value:"IC"},{label:"Indigo Airlines",value:"6E"},{label:"Indigo",value:"I9"},{label:"Indonesia Airasia",value:"QZ"},{label:"Indonesia Sky",value:"I5"},{label:"Indonesian Airlines",value:"IO"},{label:"Indya Airline Group",value:"G1"},{label:"Intelijet Airways",value:"IJ"},{label:"Inter Islands Airlines",value:"H4"},{label:"Interair South Africa",value:"D6"},{label:"Interavia Airlines",value:"ZA"},{label:"Intercontinental De Aviaci",value:"RS"},{label:"Interlink Airlines",value:"ID"},{label:"International Business Air",value:"6I"},{label:"International Europe",value:"9I"},{label:"Intersky",value:"3L"},{label:"Interstate Airline",value:"I4"},{label:"Iran Air",value:"IR"},{label:"Iran Aseman Airlines",value:"EP"},{label:"Iraqi Airways",value:"IA"},{label:"Island Air (wp)",value:"WP"},{label:"Island Express",value:"2S"},{label:"Island Spirit",value:"IP"},{label:"Islas Airways",value:"IF"},{label:"Islena De Inversiones",value:"WC"},{label:"Israir",value:"6H"},{label:"Itali Airlines",value:"9X"},{label:"Itek Air",value:"GI"},{label:"Izair",value:"H9"},{label:"Jal Express",value:"JC"},{label:"Jalways",value:"JO"},{label:"Japan Air System",value:"JD"},{label:"Japan Airlines Domestic",value:"JL"},{label:"Japan Airlines",value:"JL"},{label:"Japan Asia Airways",value:"EG"},{label:"Japan Regio",value:"ZX"},{label:"Japan Transocean Air",value:"NU"},{label:"Jat Airways",value:"JU"},{label:"Jatayu Airlines",value:"VJ"},{label:"Jayrow",value:",,"},{label:"Jazeera Airways",value:"J9"},{label:"Jeju Air",value:"7C"},{label:"Jet Airways",value:"9W"},{label:"Jet2.com",value:"LS"},{label:"Jet4you",value:"8J"},{label:"Jetairfly",value:"JF"},{label:"Jetblue Airways",value:"B6"},{label:"Jetclub",value:"0J"},{label:"Jetsgo",value:"SG"},{label:"Jetstar Airways",value:"JQ"},{label:"Jetstar Asia Airways",value:"3K"},{label:"Jetstar Pacific",value:"BL"},{label:"Jett8 Airlines Cargo",value:"JX"},{label:"Jettor Airlines",value:"NR"},{label:"Jetx Airlines",value:"GX"},{label:"Jin Air",value:"LJ"},{label:"Jordan Aviation",value:"R5"},{label:"Joy Air",value:"JR"},{label:"Juneyao Airlines",value:"HO"},{label:"Jusur Airways",value:"JX"},{label:"KSY",value:"KY"},{label:"Kabo Air",value:"N2"},{label:"Kalitta Air",value:"K4"},{label:"Kam Air",value:"RQ"},{label:"Kampuchea Airlines",value:"E2"},{label:"Karat",value:"V2"},{label:"Kavminvodyavia",value:"KV"},{label:"Kd Avia",value:"KD"},{label:"Kenmore Air",value:"M5"},{label:"Kenya Airways",value:"KQ"},{label:"Keystone Air Services",value:"BZ"},{label:"Kharkiv Airlines",value:"KH"},{label:"Kibris T",value:"KY"},{label:"Kingfisher Airlines",value:"IT"},{label:"Kish Air",value:"Y9"},{label:"Kiwi International Air Lines",value:"KP"},{label:"Klm Cityhopper",value:"WA"},{label:"Klm Royal Dutch Airlines",value:"KL"},{label:"Kogalymavia Air Company",value:"7K"},{label:"Komiinteravia",value:"8J"},{label:"Koralblue Airlines",value:"K7"},{label:"Korean Air",value:"KE"},{label:"Korongo Airlines",value:"ZC"},{label:"Kostromskie Avialinii",value:"K1"},{label:"Krasnojarsky Airlines",value:"7B"},{label:"Krylo Airlines",value:"K9"},{label:"Kuban Airlines",value:"GW"},{label:"Kunpeng Airlines",value:"VD"},{label:"Kuwait Airways",value:"KU"},{label:"Kuzu Airlines Cargo",value:"GO"},{label:"Kyrgyz Airlines",value:"N5"},{label:"Kyrgyzstan Airlines",value:"R8"},{label:"Kyrgyzstan",value:"QH"},{label:"L",value:"MJ"},{label:"L.a.b. Flying Service",value:"JF"},{label:"Lacsa",value:"LR"},{label:"Lagun Air",value:"N6"},{label:"Lai - Linea Aerea Iaaca",value:"KG"},{label:"Lan Airlines",value:"LA"},{label:"Lan Argentina",value:"4M"},{label:"Lan Express",value:"LU"},{label:"Lan Peru",value:"LP"},{label:"Lankair",value:"IK"},{label:"Lao Airlines",value:"QV"},{label:"Laoag International Airlines",value:"L7"},{label:"Lauda Air",value:"NG"},{label:"Lcm Airlines",value:"LQ"},{label:"Lebanese Air Transport",value:"LQ"},{label:"Leeward Islands Air Transport",value:"LI"},{label:"Liberty Airways",value:"LE"},{label:"Libyan Arab Airlines",value:"LN"},{label:"Line Blue",value:"L8"},{label:"Linea Aerea De Servicio Ejecutivo Regional",value:"8Z"},{label:"Linea Aerea Sapsa",value:"L7"},{label:"Linea Turistica Aerotuy",value:"LD"},{label:"Lineas Aereas Azteca",value:"ZE"},{label:"Linhas A",value:"LM"},{label:"Lion Mentari Airlines",value:"JT"},{label:"Lionxpress",value:"C4"},{label:"Livingston",value:"LM"},{label:"Llloyd Helicopters",value:"::"},{label:"Lloyd Aereo Boliviano",value:"LB"},{label:"Locair",value:"ZQ"},{label:"Lot Polish Airlines",value:"LO"},{label:"Lsm Airlines",value:"PQ"},{label:"Lsm Airlines",value:"YZ"},{label:"Lsm International",value:"II"},{label:"Lte International Airways",value:"XO"},{label:"Ltu Austria",value:"L3"},{label:"Ltu International",value:"LT"},{label:"Luchsh Airlines",value:"L4"},{label:"Luftfahrtgesellschaft Walter",value:"HE"},{label:"Lufthansa Cargo",value:"LH"},{label:"Lufthansa Cityline",value:"CL"},{label:"Lufthansa",value:"LH"},{label:"Lufttaxi Fluggesellschaft",value:"DV"},{label:"Lufttransport",value:"L5"},{label:"Luxair",value:"LG"},{label:"Lviv Airlines",value:"5V"},{label:"Lynden Air Cargo",value:"L2"},{label:"Macair Airlines",value:"CC"},{label:"Mahan Air",value:"W5"},{label:"Mahfooz Aviation",value:"M2"},{label:"Malaysia Airlines",value:"MH"},{label:"Maldivo Airlines",value:"ML"},{label:"Malindo Air",value:"OD"},{label:"Malm� Aviation",value:"TF"},{label:"Malta Air Charter",value:"R5"},{label:"Mal�v",value:"MA"},{label:"Mandala Airlines",value:"RI"},{label:"Mandarin Airlines",value:"AE"},{label:"Mango",value:"JE"},{label:"Mars Rk",value:"6V"},{label:"Marsland Aviation",value:"M7"},{label:"Martinair",value:"MP"},{label:"Marusya Airways",value:"Y8"},{label:"Maryland Air",value:"M1"},{label:"Marysya Airlines",value:"M4"},{label:"Masair",value:"M7"},{label:"Mat Airways",value:"6F"},{label:"Mat Macedonian Airlines",value:"IN"},{label:"Mauritania Airlines International",value:"L6"},{label:"Mavial Magadan Airlines",value:"H5"},{label:"Maxair",value:"8M"},{label:"Maxjet Airways",value:"MY"},{label:"Maya Island Air",value:"MW"},{label:"Menajet",value:"IM"},{label:"Meridiana",value:"IG"},{label:"Merpati Nusantara Airlines",value:"MZ"},{label:"Mesa Airlines",value:"YV"},{label:"Mesaba Airlines",value:"XJ"},{label:"Metro Batavia",value:"7P"},{label:"Mexicana De Aviaci",value:"MX"},{label:"Mexicanalink",value:"I6"},{label:"Miami Air International",value:"GL"},{label:"Miat Mongolian Airlines",value:"OM"},{label:"Michael Airlines",value:"DF"},{label:"Middle East Airlines",value:"ME"},{label:"Midway Airlines",value:"JI"},{label:"Midwest Airlines (egypt)",value:"MY"},{label:"Midwest Airlines",value:"YX"},{label:"Mng Airlines",value:"MB"},{label:"Moldavian Airlines",value:"2M"},{label:"Monarch Airlines",value:"ZB"},{label:"Mongolian International Air Lines",value:"7M"},{label:"Montenegro Airlines",value:"YM"},{label:"Moskovia Airlines",value:"3R"},{label:"Motor Sich",value:"M9"},{label:"Mount Cook Airlines",value:"NM"},{label:"Mountain Air Company",value:"N4"},{label:"Myanma Airways",value:"UB"},{label:"Myanmar Airways International",value:"8M"},{label:"Mytravel Airways",value:"VZ"},{label:"NCCTEST",value:"NC"},{label:"Naka Nihon Airlines Service",value:"NV"},{label:"Nantucket Airlines",value:"DV"},{label:"Nas Air",value:"XY"},{label:"Nasair",value:"UE"},{label:"National Air Cargo",value:"N8"},{label:"National Airlines",value:"N4"},{label:"National Airlines",value:"N7"},{label:"National Airlines",value:"NA"},{label:"National Jet Systems",value:"NC"},{label:"Nationwide Airlines",value:"CE"},{label:"Nauru Air Corporation",value:"ON"},{label:"Neos",value:"NO"},{label:"Nepal Airlines",value:"RA"},{label:"Netjets",value:"1I"},{label:"New England Airlines",value:"EJ"},{label:"Next Brasil",value:"XB"},{label:"Nextjet",value:"2N"},{label:"Niki",value:"HG"},{label:"Nile Air",value:"NP"},{label:"Nippon Cargo Airlines",value:"KZ"},{label:"Nok Air",value:"DD"},{label:"Nordeste Linhas Aereas Regionais",value:"JH"},{label:"Nordic Global Airlines",value:"NJ"},{label:"Nordic Regional",value:"6N"},{label:"North Flying",value:"M3"},{label:"North-wright Airways",value:"HW"},{label:"Northern Air Cargo",value:"NC"},{label:"Northwest Airlines",value:"NW"},{label:"Northwest Regional Airlines",value:"FY"},{label:"Northwestern Air",value:"J3"},{label:"Norwegian Air Shuttle",value:"DY"},{label:"Norwegian Long Haul As",value:"DU"},{label:"Nouvel Air Tunisie",value:"BJ"},{label:"Nova Airline",value:"M4"},{label:"Novair",value:"1I"},{label:"Nuevo Continente",value:"N6"},{label:"Oasis Hong Kong Airlines",value:"O8"},{label:"Ocean Airlines",value:"VC"},{label:"Oceanair",value:"O6"},{label:"Oconnor Airlines",value:"UQ"},{label:"Olympic Airlines",value:"OA"},{label:"Oman Air",value:"WY"},{label:"Omni Air International",value:"OY"},{label:"Omskavia Airline",value:"N3"},{label:"Onechina",value:"1C"},{label:"Onur Air",value:"8Q"},{label:"Open Skies Consultative Commission",value:"1L"},{label:"Orbit Airlines Azerbaijan",value:"O1"},{label:"Orchid Airlines",value:"OI"},{label:"Orenburg Airlines",value:"R2"},{label:"Orient Thai Airlines",value:"OX"},{label:"Origin Pacific Airways",value:"QO"},{label:"Ostfriesische Lufttransport",value:"OL"},{label:"Our Airline",value:"ON"},{label:"Overland Airways",value:"OJ"},{label:"Ozark Air Lines",value:"OZ"},{label:"Ozjet Airlines",value:"O7"},{label:"Pace Airlines",value:"Y5"},{label:"Pacific Blue",value:"DJ"},{label:"Pacific Coastal Airline",value:"8P"},{label:"Pacific East Asia Cargo Airlines",value:"Q8"},{label:"Pacific Southwest Airlines",value:"PS"},{label:"Pacific Wings",value:"LW"},{label:"Pakistan International Airlines",value:"PK"},{label:"Palair Macedonia",value:"3D"},{label:"Palau Trans Pacific Airline",value:"GP"},{label:"Palestinian Airlines",value:"PF"},{label:"Pamir Airways",value:"NR"},{label:"Pan Air",value:"PV"},{label:"Pan American Airways",value:"PA"},{label:"Pan American World Airways",value:"PA"},{label:"Panafrican Airways",value:"PQ"},{label:"Panam World Airways",value:"WQ"},{label:"Pantanal Linhas A�reas",value:"P8"},{label:"Paramount Airways",value:"I7"},{label:"Parmiss Airlines (ipv)",value:"PA"},{label:"Pb Air",value:"9Q"},{label:"Pearl Airways",value:"HP"},{label:"Pegasus Airlines",value:"PC"},{label:"Peninsula Airways",value:"KS"},{label:"Perm Airlines",value:"P9"},{label:"Philippine Airlines",value:"PR"},{label:"Phuket Air",value:"9R"},{label:"Piedmont Airlines (1948-1989)",value:"PI"},{label:"Pinnacle Airlines",value:"9E"},{label:"Pluna",value:"PU"},{label:"Pmtair",value:"U4"},{label:"Polar Air Cargo",value:"PO"},{label:"Polynesian Airlines",value:"PH"},{label:"Polynesian Blue",value:"DJ"},{label:"Porter Airlines",value:"PD"},{label:"Portugalia",value:"NI"},{label:"Potomac Air",value:"BK"},{label:"Precision Air",value:"PW"},{label:"President Airlines",value:"TO"},{label:"Primaris Airlines",value:"FE"},{label:"Private Wings Flugcharter",value:"8W"},{label:"Qantas",value:"QF"},{label:"Qatar Airways",value:"QR"},{label:"Qatxpress",value:"C3"},{label:"Rainbow Air (rai)",value:"RN"},{label:"Rainbow Air Canada",value:"RY"},{label:"Rainbow Air Euro",value:"RU"},{label:"Rainbow Air Polynesia",value:"RX"},{label:"Rainbow Air Us",value:"RM"},{label:"Red Wings",value:"WZ"},{label:"Redhill Aviation",value:"8L"},{label:"Reem Air",value:"V4"},{label:"Regional Air Iceland",value:"9N"},{label:"Regional Express",value:"ZL"},{label:"Regional Paraguaya",value:"P7"},{label:"Regionalia Chile",value:"9J"},{label:"Regionalia M�xico",value:"N4"},{label:"Regionalia Uruguay",value:"2X"},{label:"Regionalia Venezuela",value:"9X"},{label:"Regionsair",value:"3C"},{label:"Reno Air",value:"QQ"},{label:"Republic Airlines",value:"RW"},{label:"Republic Express Airlines",value:"RH"},{label:"Rexair Virtuel",value:"RR"},{label:"Rico Linhas A",value:"C7"},{label:"Rio Grande Air",value:"E2"},{label:"Rio Sul Servi",value:"SL"},{label:"Rossiya-russian Airlines",value:"FV"},{label:"Royal Air Cambodge",value:"VJ"},{label:"Royal Air Force Of Oman",value:"RS"},{label:"Royal Air Force",value:"RR"},{label:"Royal Air Maroc",value:"AT"},{label:"Royal Airlines",value:"R0"},{label:"Royal Airways",value:"KG"},{label:"Royal Aruban Airline",value:"V5"},{label:"Royal Britain",value:"7V"},{label:"Royal Brunei Airlines",value:"BI"},{label:"Royal Falcon",value:"RL"},{label:"Royal Jordanian",value:"RJ"},{label:"Royal Khmer Airlines",value:"RK"},{label:"Royal Nepal Airlines",value:"RA"},{label:"Royal Southern Airlines.",value:"R1"},{label:"Royal Tongan Airlines",value:"WR"},{label:"Russian Sky Airlines",value:"P7"},{label:"Rwandair Express",value:"WB"},{label:"Ryan International Airlines",value:"RD"},{label:"Ryanair",value:"FR"},{label:"R�gional",value:"YS"},{label:"S7 Airlines",value:"S7"},{label:"Saeta",value:"EH"},{label:"Safair",value:"FA"},{label:"Salsa D,,haiti",value:"SO"},{label:"Sama Airlines",value:"ZS"},{label:"Samara Airlines",value:"E5"},{label:"Samurai Airlines",value:"07"},{label:"San Juan Airlines",value:"2G"},{label:"Santa Barbara Airlines",value:"S3"},{label:"Saratov Aviation Division",value:"6W"},{label:"Sat Airlines",value:"HZ"},{label:"Sata Air Acores",value:"SP"},{label:"Sata International",value:"S4"},{label:"Satena",value:"9R"},{label:"Saudi Arabian Airlines",value:"SV"},{label:"Scandinavian Airlines System",value:"SK"},{label:"Scat Air",value:"DV"},{label:"Scoot",value:"TZ"},{label:"Seaborne Airlines",value:"BB"},{label:"Seaport Airlines",value:"K5"},{label:"Senegal Airlines",value:"DN"},{label:"Serbian Airlines",value:"S1"},{label:"Servicios De Transportes A",value:"FS"},{label:"Shaheen Air International",value:"NL"},{label:"Shandong Airlines",value:"SC"},{label:"Shanghai Airlines",value:"FM"},{label:"Shanxi Airlines",value:"8C"},{label:"Sharp Airlines",value:"SH"},{label:"Shenzhen Airlines",value:"ZH"},{label:"Shovkoviy Shlyah",value:"S8"},{label:"Shuttle America",value:"S5"},{label:"Sibaviatrans",value:"5M"},{label:"Sichuan Airlines",value:"3U"},{label:"Siem Reap Airways",value:"FT"},{label:"Sierra National Airlines",value:"LJ"},{label:"Silk Way Airlines",value:"ZP"},{label:"Silkair",value:"MI"},{label:"Singapore Airlines Cargo",value:"SQ"},{label:"Singapore Airlines",value:"SQ"},{label:"Sita",value:"XS"},{label:"Skagway Air Service",value:"N5"},{label:"Sky Airline",value:"H2"},{label:"Sky Express",value:"G3"},{label:"Sky Express",value:"XW"},{label:"Sky Eyes",value:"I6"},{label:"Sky Regional",value:"RS"},{label:"Sky Trek International Airlines",value:"1I"},{label:"Sky Wing Pacific",value:"C7"},{label:"Sky Work Airlines",value:"SX"},{label:"Skybus Airlines",value:"SX"},{label:"Skyeurope",value:"NE"},{label:"Skyjet Airlines",value:"UQ"},{label:"Skyking Turks And Caicos Airways",value:"RU"},{label:"Skymark Airlines",value:"BC"},{label:"Skynet Airlines",value:"SI"},{label:"Skynet Asia Airways",value:"6J"},{label:"Skyservice Airlines",value:"5G"},{label:"Skywalk Airlines",value:"AL"},{label:"Skyways Express",value:"JZ"},{label:"Skywest",value:"OO"},{label:"Slok Air Gambia",value:"S0"},{label:"Slovak Airlines",value:"6Q"},{label:"Snowbird Airlines",value:"S8"},{label:"Sochi Air Chater",value:"Q3"},{label:"Sochi Air Express",value:"Q4"},{label:"Sochi Air",value:"CQ"},{label:"Solomon Airlines",value:"IE"},{label:"Sosoliso Airlines",value:"SO"},{label:"South African Airways",value:"SA"},{label:"South East Asian Airlines",value:"DG"},{label:"Southern Winds Airlines",value:"A4"},{label:"Southjet Cargo",value:"78"},{label:"Southjet Connect",value:"77"},{label:"Southjet",value:"76"},{label:"Southwest Airlines",value:"WN"},{label:"Spanair",value:"JK"},{label:"Spicejet",value:"SG"},{label:"Spike Airlines",value:"S0"},{label:"Spirit Airlines",value:"NK"},{label:"Spirit Of Manila Airlines",value:"SM"},{label:"Spring Airlines Japan",value:"IJ"},{label:"Spring Airlines",value:"9S"},{label:"Srilankan Airlines",value:"UL"},{label:"Sriwijaya Air",value:"SJ"},{label:"Star Flyer",value:"7G"},{label:"Star1 Airlines",value:"V9"},{label:"Starling Airlines Spain",value:"SX"},{label:"Sterling Airlines",value:"NB"},{label:"Stp Airways",value:"8F"},{label:"Sudan Airways",value:"SD"},{label:"Sun Air (fiji)",value:"PI"},{label:"Sun Air Of Scandinavia",value:"EZ"},{label:"Sun Country Airlines",value:"SY"},{label:"Sun Dor",value:"7L"},{label:"Sunexpress",value:"XQ"},{label:"Sunshine Express Airlines",value:"CQ"},{label:"Sunwing Airlines",value:"WG"},{label:"Superior Aviation",value:"SO"},{label:"Surinam Airways",value:"PY"},{label:"Svyaz Rossiya",value:"7R"},{label:"Swe Fly",value:"WV"},{label:"Swedjet Airways",value:"VD"},{label:"Swedline Express",value:"SM"},{label:"Swiss International Air Lines",value:"LX"},{label:"Swissair",value:"SR"},{label:"Syrian Arab Airlines",value:"RB"},{label:"T.j. Air",value:"TJ"},{label:"Taag Angola Airlines",value:"DT"},{label:"Tacv",value:"VR"},{label:"Tam Brazilian Airlines",value:"JJ"},{label:"Tam Mercosur",value:"PZ"},{label:"Tame",value:"EQ"},{label:"Tampa",value:"QT"},{label:"Tandem Aero",value:"TQ"},{label:"Tap Portugal",value:"TP"},{label:"Tarom",value:"RO"},{label:"Tassili Airlines",value:"SF"},{label:"Tatarstan Airlines",value:"U9"},{label:"Tavrey Airlines",value:"T6"},{label:"Teamline Air",value:"L9"},{label:"Texas Spirit",value:"XS"},{label:"Texas Wings",value:"TQ"},{label:"Thai Air Cargo",value:"T2"},{label:"Thai Airasia",value:"FD"},{label:"Thai Airways International",value:"TG"},{label:"Thai Sky Airlines",value:"9I"},{label:"Thai Star Airlines",value:"T9"},{label:"Thomas Cook Airlines",value:"FQ"},{label:"Thomas Cook Airlines",value:"MT"},{label:"Thomsonfly",value:"BY"},{label:"Three",value:"H3"},{label:"Tiara Air",value:"3P"},{label:"Tiger Airways Australia",value:"TT"},{label:"Tiger Airways",value:"TR"},{label:"Titan Airways",value:"ZT"},{label:"Tnt Airways",value:"3V"},{label:"Tobruk Air",value:"7T"},{label:"Tol-air Services",value:"TI"},{label:"Tom,,s & Co Airliners",value:"&T"},{label:"Tomp Airlines",value:"ZT"},{label:"Tower Air",value:"FF"},{label:"Tramm Airlines",value:"9F"},{label:"Trans Maldivian Airways",value:"M8"},{label:"Trans Mediterranean Airlines",value:"TL"},{label:"Trans Pas Air",value:"T6"},{label:"Trans States Airlines",value:"AX"},{label:"Trans World Airlines",value:"TW"},{label:"Transaero Airlines",value:"UN"},{label:"Transasia Airways",value:"GE"},{label:"Transavia France",value:"TO"},{label:"Transavia Holland",value:"HV"},{label:"Transaviaexport",value:"AL"},{label:"Transbrasil Airlines",value:"TH"},{label:"Transeuropean Airlines",value:"UE"},{label:"Transholding System",value:"YO"},{label:"Transholding",value:"TI"},{label:"Transmeridian Airlines",value:"T9"},{label:"Transmile Air Services",value:"TH"},{label:"Transnusa Air",value:"M8"},{label:"Transrussiaairlines",value:"1E"},{label:"Transwest Air",value:"9T"},{label:"Trasbrasil",value:"TB"},{label:"Trast Aero",value:"S5"},{label:"Travel Service",value:"QS"},{label:"Tri-mg Intra Asia Airlines",value:"GY"},{label:"Trip Linhas A",value:"8R"},{label:"Tropic Air",value:"PM"},{label:"Tropical Airways",value:"M7"},{label:"Tropical Linhas Aereas",value:"T1"},{label:"Tui Airlines Belgium",value:"TB"},{label:"Tuifly Nordic",value:"6B"},{label:"Tuifly",value:"X3"},{label:"Tulip Air",value:"TD"},{label:"Tuninter",value:"UG"},{label:"Tunisair",value:"TU"},{label:"Turan Air",value:"3T"},{label:"Turkish Airlines",value:"TK"},{label:"Turkmenistan Airlines",value:"T5"},{label:"Tway Airlines",value:"TW"},{label:"Twin Jet",value:"T7"},{label:"Tyrolean Airways",value:"VO"},{label:"Ukraine International Airlines",value:"PS"},{label:"Ukrainian Cargo Airways",value:"6Z"},{label:"Um Airlines",value:"UF"},{label:"Uni Air",value:"B7"},{label:"United Airlines",value:"UA"},{label:"United Airways",value:"4H"},{label:"United Parcel Service",value:"5X"},{label:"Ural Airlines",value:"U6"},{label:"Us Airways",value:"US"},{label:"Usa Jet Airlines",value:"U7"},{label:"Usa Sky Cargo",value:"E1"},{label:"Usa3000 Airlines",value:"U5"},{label:"Utair Aviation",value:"UT"},{label:"Uzbekistan Airways",value:"HY"},{label:"V Air",value:"ZV"},{label:"V Australia Airlines",value:"VA"},{label:"Valuair",value:"VF"},{label:"Valuejet",value:"J7"},{label:"Varig Log",value:"LC"},{label:"Vasp",value:"VP"},{label:"Via Conectia Airlines",value:"6V"},{label:"Via L�neas A�reas",value:"V1"},{label:"Viaggio Air",value:"VM"},{label:"Vickjet",value:"KT"},{label:"Vietnam Airlines",value:"VN"},{label:"Viking Hellas",value:"VQ"},{label:"Vim Airlines",value:"NN"},{label:"Virgin America",value:"VX"},{label:"Virgin Atlantic Airways",value:"VS"},{label:"Virgin Australia",value:"VA"},{label:"Virgin Blue",value:"DJ"},{label:"Virgin Express",value:"TV"},{label:"Virgin Nigeria Airways",value:"VK"},{label:"Virgin Pacific",value:"VH"},{label:"Virginwings",value:"YY"},{label:"Vision Airlines (v2)",value:"V2"},{label:"Viva Macau",value:"ZG"},{label:"Vivacolombia",value:"5Z"},{label:"Vladivostok Air",value:"XF"},{label:"Vlm Airlines",value:"VG"},{label:"Voestar",value:"8K"},{label:"Volare Airlines",value:"VE"},{label:"Volaris",value:"Y4"},{label:"Volga-dnepr Airlines",value:"VI"},{label:"Volotea Airways",value:"V7"},{label:"Volotea Costa Rica",value:"9V"},{label:"Voyageur Airways",value:"VC"},{label:"Vrg Linhas Aereas",value:"RG"},{label:"Vuela Cuba",value:"6C"},{label:"Vueling Airlines",value:"VY"},{label:"Vuola Italia",value:"4S"},{label:"Webjet Linhas A",value:"WJ"},{label:"Welcome Air",value:"2W"},{label:"West Air China",value:"PN"},{label:"West Air Sweden",value:"PT"},{label:"Western Airlines",value:"WA"},{label:"Westjet Encore",value:"WR"},{label:"Westjet",value:"WS"},{label:"Westward Airways",value:"CN"},{label:"Wider�e",value:"WF"},{label:"Wind Jet",value:"IV"},{label:"Wings Air",value:"IW"},{label:"Wings Of Alaska",value:"K5"},{label:"Wizz Air Hungary",value:"8Z"},{label:"Wizz Air Ukraine",value:"WU"},{label:"Wizz Air",value:"W6"},{label:"World Airways",value:"WO"},{label:"World Experience Airline",value:"W1"},{label:"World Scale Airlines",value:"W3"},{label:"Worldways",value:"WG"},{label:"Wright Air Service",value:"8V"},{label:"Xair Usa",value:"XA"},{label:"Xiamen Airlines",value:"MF"},{label:"Xl Airways France",value:"SE"},{label:"Xpto",value:"XP"},{label:"Xtra Airways",value:"XP"},{label:"Yamal Airlines",value:"YL"},{label:"Yangtze River Express",value:"Y8"},{label:"Yellowtail",value:"YE"},{label:"Yemenia",value:"IY"},{label:"Yunnan Airlines",value:"3Q"},{label:"ZIP",value:"3J"},{label:"Zabaikal Airlines",value:"Z6"},{label:"Zabaykalskii Airlines",value:"ZP"},{label:"Zambian Airways",value:"Q3"},{label:"Zenith International Airline",value:"ZN"},{label:"Zimex Aviation",value:"C4"},{label:"Zoom Airlines",value:"Z4"},{label:"Zuliana De Aviacion",value:"OD"}],e.AuthInfo=yi,e.BaseAcceptNewPriceUpdater=Gi,e.BaseAddGuestToBasketItemUpdater=fa,e.BaseAddItemToBasketUpdater=Vi,e.BaseAddRedirectApproverUpdater=va,e.BaseAddUserToBasketItemUpdater=Wi,e.BaseApplyJitFlightRulesFetcher=tr,e.BaseBookBasketUpdater=Qi,e.BaseCabhireQuoteFetcher=nr,e.BaseCancelBookingUpdater=ua,e.BaseCarHireAvailabilityDetailFetcher=or,e.BaseCarhireQuoteFetcher=sr,e.BaseConfermaOfficeFetcher=ur,e.BaseConfermaOfficeNamesFetcher=lr,e.BaseConfirmMessagesUpdater=la,e.BaseCreateBasketUpdater=Ji,e.BaseCreateGuestUpdater=ma,e.BaseDeleteBasketUpdater=Ki,e.BaseDeleteFavouriteSearchUpdater=da,e.BaseDeleteRecentSearchUpdater=Zi,e.BaseDeleteUserAddressUpdater=Xi,e.BaseEditUserUpdater=pa,e.BaseEmailBasketFetcher=zr,e.BaseEmailFerryBookingFetcher=ci,e.BaseEnterpriseBasketService=Si,e.BaseEnterpriseMyBookingsService=_i,e.BaseEnterpriseSearch=c,e.BaseEnterpriseSearchService=Ni,e.BaseEnvironment=nt,e.BaseEurostarQuoteFetcher=dr,e.BaseEventMessenager=lt,e.BaseFastTrackQuoteFetcher=$r,e.BaseFlightQuoteFetcher=pr,e.BaseGenerateBasketPdfFetcher=ni,e.BaseGetAllAirlinesFetcher=ii,e.BaseGetBasketFetcher=ar,e.BaseGetCancellationInfoFetcher=oi,e.BaseGetCarHireProvidersFetcher=ai,e.BaseGetCompaniesFetcher=Xr,e.BaseGetCompanyFetcher=Zr,e.BaseGetConfermaRoomImagesFetcher=qr,e.BaseGetCovidMicrositeTokenFetcher=mr,e.BaseGetFlightFareRulesFetcher=hr,e.BaseGetFlightSeatMapFetcher=Yr,e.BaseGetHotelChainsFetcher=ti,e.BaseGetIrlSupplierStationFetcher=br,e.BaseGetMiAutoSugestionFetcher=Dr,e.BaseGetOfficeFetcher=li,e.BaseGetRailLiveDeparturesFetcher=vr,e.BaseGetRailProvidersFetcher=ri,e.BaseGetRailStationFetcher=yr,e.BaseGetRailcardsFetcher=fr,e.BaseGetRiskAlertsFetcher=gr,e.BaseGetUserBasketsFetcher=Tr,e.BaseGetUserCompanyOfficesFetcher=Sr,e.BaseGetUserCurrentCarbonAllowanceFetcher=Cr,e.BaseGetUserDefaultMIValueFetcher=ui,e.BaseGetUserFavouriteSearchesFetcher=Kr,e.BaseGetUserFetcher=Vr,e.BaseGetUserGuestsFetcher=si,e.BaseGetUserRecentSearchesFetcher=Ar,e.BaseHelperRoutines=$e,e.BaseHotelAvalibilityQuoteFetcher=Pr,e.BaseHotelAvalibilityService=Ai,e.BaseHotelQuoteFetcher=Fr,e.BaseHotelRulesFetcher=ir,e.BaseIrlDiscountCardFetcher=kr,e.BaseIrlQuoteFetcher=_r,e.BaseLogonService=Fi,e.BaseLoungeQuoteFetcher=Rr,e.BaseModalOpenerService=ki,e.BaseNetworkCall=h,e.BaseParkingQuoteFetcher=Ir,e.BaseRailQuoteFetcher=Or,e.BaseRedirectApproverFetcher=di,e.BaseRemoveItemFromBasketUpdater=qi,e.BaseRemoveRedirectApproverUpdater=ya,e.BaseRequiresReasonService=bi,e.BaseRevalidateBasketUpdater=zi,e.BaseRouteHappyService=wi,e.BaseSaveFavouriteSearchUpdater=ca,e.BaseSaveRecentSearchUpdater=oa,e.BaseSaveUserAddressUpdater=$i,e.BaseSearchAirlinesFetcher=Er,e.BaseSearchAirportsFetcher=Br,e.BaseSearchCityFetcher=Nr,e.BaseSearchCompanyApproversFetcher=hi,e.BaseSearchConfermaCityFetcher=Mr,e.BaseSearchConfermaQuicklistFetcher=cr,e.BaseSearchDepotFetcher=Lr,e.BaseSearchHotelChainsFetcher=wr,e.BaseSearchIrlStationsFetcher=jr,e.BaseSearchPostcodeFetcher=Ur,e.BaseSearchRailStationsFetcher=Hr,e.BaseSearchUsersCanBookForFetcher=xr,e.BaseSendBasketForApprovalUpdater=ea,e.BaseSendOfflineNotificationFetcher=ei,e.BaseSetBasketItemLeadPassengerUpdater=ta,e.BaseSetBasketItemMiGroupUpdater=ra,e.BaseSetBasketItemMiValueUpdater=ia,e.BaseSetPaymentOptionUpdater=sa,e.BaseSetUserLanguageUpdater=ha,e.BaseStorageService=Mi,e.BaseUpdateBasketNoteUpdater=na,e.BaseUpdateBasketTitleUpdater=aa,e.BaseUserAddressesFetcher=Gr,e.BaseUserMessagesFetcher=Wr,e.BaseUserProductsFetcher=Qr,e.BaseUserService=Pi,e.BaseUserUiConfigsFetcher=Jr,e.BaseValidateIsPostcodeValidTester=Hi,e.BaseValidateMiFreeValueTester=Ui,e.BaseWebTokenService=Li,e.BasemoveBasketItemToBasket=Yi,e.BasketInfoMiDetailsImpl=ke,e.BookableBasket=Qe,e.CabHireEnterpriseSearch=rt,e.CarCompanies=[{label:"Advantage Rent A Car",value:"Advantage Rent A Car"},{label:"Alamo",value:"Alamo"},{label:"Avis",value:"Avis"},{label:"Budget Rent A Car",value:"Budget Rent A Car"},{label:"Dollar Rent A Car",value:"Dollar Rent A Car"},{label:"Enterprise",value:"Enterprise"},{label:"Euromobil",value:"Euromobil"},{label:"Europcar",value:"Europcar"},{label:"Fox Rent A Car",value:"Fox Rent A Car"},{label:"Hertz",value:"Hertz"},{label:"National Car Rental System",value:"National Car Rental System"},{label:"Payless Car Rental",value:"Payless Car Rental"},{label:"Sixt",value:"Sixt"},{label:"Southwest Car Rental",value:"Southwest Car Rental"},{label:"Thrifty Car Rental",value:"Thrifty Car Rental"}],e.CarhireEnterpriseSearch=it,e.DEFAULT_FLIGHT_FILTERS=ct,e.DistanceType=Ve,e.DocTypes=xe,e.EurostarEnterpriseSearch=Bt,e.FlightEnterpriseSearch=St,e.Genders=Ge,e.HotelChains=[{label:"Abba Hotels",value:"Abba Hotels"},{label:"Abode Hotels",value:"Abode Hotels"},{label:"AC Hotels",value:"AC Hotels"},{label:"Accor Group",value:"Accor Group"},{label:"Accor",value:"Accor"},{label:"Adam's Mark",value:"Adam's Mark"},{label:"Affinia Hotels",value:"Affinia Hotels"},{label:"Alias Hotels",value:"Alias Hotels"},{label:"Amber Hotels Germany",value:"Amber Hotels Germany"},{label:"Americas Best Value Inns",value:"Americas Best Value Inns"},{label:"Americinn",value:"Americinn"},{label:"Amerihost Inn",value:"Amerihost Inn"},{label:"Amerisuites",value:"Amerisuites"},{label:"Ana Hotels",value:"Ana Hotels"},{label:"Antoinette Hotels",value:"Antoinette Hotels"},{label:"Apex Hotels",value:"Apex Hotels"},{label:"Arora International",value:"Arora International"},{label:"Ascott Group",value:"Ascott Group"},{label:"Atel Htl Network",value:"Atel Htl Network"},{label:"Austria Trend Hotel & Resorts",value:"Austria Trend Hotel & Resorts"},{label:"Barcelo Hotels",value:"Barcelo Hotels"},{label:"Bastion Hotels",value:"Bastion Hotels"},{label:"Baymont",value:"Baymont"},{label:"Beales Hotels",value:"Beales Hotels"},{label:"Best Eastern",value:"Best Eastern"},{label:"Best Inns",value:"Best Inns"},{label:"Best Western Hotels",value:"Best Western Hotels"},{label:"Bewleys",value:"Bewleys"},{label:"Bilderberg Group",value:"Bilderberg Group"},{label:"Blue Tree Hotels",value:"Blue Tree Hotels"},{label:"Boscolo Hotels",value:"Boscolo Hotels"},{label:"Brend Hotel Group",value:"Brend Hotel Group"},{label:"Bridgestreet",value:"Bridgestreet"},{label:"Britannia",value:"Britannia"},{label:"Caesar Park Hotels",value:"Caesar Park Hotels"},{label:"Cairn Hotels",value:"Cairn Hotels"},{label:"Camino Real",value:"Camino Real"},{label:"Campanile",value:"Campanile"},{label:"Candlewood Suites",value:"Candlewood Suites"},{label:"Carlton Hotel Collection",value:"Carlton Hotel Collection"},{label:"Castle Hotel Group",value:"Castle Hotel Group"},{label:"Cedar Court Hotels",value:"Cedar Court Hotels"},{label:"Cendant",value:"Cendant"},{label:"Choice Hotels",value:"Choice Hotels"},{label:"Citadine Hotels",value:"Citadine Hotels"},{label:"Clarion Hotels",value:"Clarion Hotels"},{label:"Clifton Hotels",value:"Clifton Hotels"},{label:"Club Quarters Hotels",value:"Club Quarters Hotels"},{label:"Coast Hotels & Resorts",value:"Coast Hotels & Resorts"},{label:"Comfort",value:"Comfort"},{label:"Concorde Hotels",value:"Concorde Hotels"},{label:"Conrad Hotels",value:"Conrad Hotels"},{label:"Contemporary Hotels",value:"Contemporary Hotels"},{label:"Copthorne & Millennium Hotels",value:"Copthorne & Millennium Hotels"},{label:"Corus",value:"Corus"},{label:"Country Inn & Suites Hotels",value:"Country Inn & Suites Hotels"},{label:"Courtyard By Marriott",value:"Courtyard By Marriott"},{label:"Crerar Hotels",value:"Crerar Hotels"},{label:"Crowne Plaza",value:"Crowne Plaza"},{label:"Cumulus Hotels",value:"Cumulus Hotels"},{label:"Dakota Hotel Group",value:"Dakota Hotel Group"},{label:"Dan Hotels Corporation",value:"Dan Hotels Corporation"},{label:"Days Inn",value:"Days Inn"},{label:"De Vere Hotels",value:"De Vere Hotels"},{label:"Delta Hotels",value:"Delta Hotels"},{label:"Derag Hotels",value:"Derag Hotels"},{label:"Design Hotels",value:"Design Hotels"},{label:"Destination Hotels",value:"Destination Hotels"},{label:"Dhillon Hotels",value:"Dhillon Hotels"},{label:"Disney World Hotels",value:"Disney World Hotels"},{label:"Distinct Hotels",value:"Distinct Hotels"},{label:"Distinguished Hotels",value:"Distinguished Hotels"},{label:"Dolce Hotels",value:"Dolce Hotels"},{label:"Dorint Hotels",value:"Dorint Hotels"},{label:"Doubletree Hotels",value:"Doubletree Hotels"},{label:"Doyle Collection",value:"Doyle Collection"},{label:"Drury Inn & Suites",value:"Drury Inn & Suites"},{label:"Econo Lodge",value:"Econo Lodge"},{label:"Elizabeth Hotels",value:"Elizabeth Hotels"},{label:"Embassy Suites",value:"Embassy Suites"},{label:"English Lakes Hotels",value:"English Lakes Hotels"},{label:"English Rose Hotels",value:"English Rose Hotels"},{label:"Etap",value:"Etap"},{label:"Eton Town House Group",value:"Eton Town House Group"},{label:"Exclusive Hotels",value:"Exclusive Hotels"},{label:"Executive Hotels And Resorts",value:"Executive Hotels And Resorts"},{label:"Extended Stayamerica",value:"Extended Stayamerica"},{label:"Fairfield Inn",value:"Fairfield Inn"},{label:"Fairmont Hotels",value:"Fairmont Hotels"},{label:"Fiesta Americana",value:"Fiesta Americana"},{label:"Fine Individual Hotels",value:"Fine Individual Hotels"},{label:"Firmdale Hotels",value:"Firmdale Hotels"},{label:"First Hotels",value:"First Hotels"},{label:"FJB Hotels",value:"FJB Hotels"},{label:"Focus Hotels",value:"Focus Hotels"},{label:"Folio Hotels",value:"Folio Hotels"},{label:"Forestdale Hotels",value:"Forestdale Hotels"},{label:"Formule 1",value:"Formule 1"},{label:"Four Pillars",value:"Four Pillars"},{label:"Four Seasons",value:"Four Seasons"},{label:"Fullers Hotels & Inns",value:"Fullers Hotels & Inns"},{label:"Gaylord Entertainment",value:"Gaylord Entertainment"},{label:"Genares Resrv SVC",value:"Genares Resrv SVC"},{label:"Golden Tulip",value:"Golden Tulip"},{label:"Grand Hospitality",value:"Grand Hospitality"},{label:"Grange Hotels",value:"Grange Hotels"},{label:"Great Southern Hotel Group",value:"Great Southern Hotel Group"},{label:"Greene King Pub Company",value:"Greene King Pub Company"},{label:"Gresham Hotel Group",value:"Gresham Hotel Group"},{label:"Guesthouse International",value:"Guesthouse International"},{label:"Guoman Hotel",value:"Guoman Hotel"},{label:"Hampton Inn",value:"Hampton Inn"},{label:"Hand Picked Hotels",value:"Hand Picked Hotels"},{label:"Hanover International Hotels",value:"Hanover International Hotels"},{label:"Harrahs Casinos",value:"Harrahs Casinos"},{label:"Hastings Hotels",value:"Hastings Hotels"},{label:"Hawthorn Suites",value:"Hawthorn Suites"},{label:"Heritage Serviced Apartments",value:"Heritage Serviced Apartments"},{label:"Hesperia Hotels",value:"Hesperia Hotels"},{label:"Hilton Garden Inn",value:"Hilton Garden Inn"},{label:"Hilton Hotels",value:"Hilton Hotels"},{label:"Historic House Hotels",value:"Historic House Hotels"},{label:"Holiday Inn Express",value:"Holiday Inn Express"},{label:"Holiday Inn Garden Court",value:"Holiday Inn Garden Court"},{label:"Holiday Inns",value:"Holiday Inns"},{label:"Homestead",value:"Homestead"},{label:"Homewood Suites By Hilton",value:"Homewood Suites By Hilton"},{label:"Hotel Indigo",value:"Hotel Indigo"},{label:"Hotel Sierra",value:"Hotel Sierra"},{label:"Hotusa",value:"Hotusa"},{label:"Howard Johnson",value:"Howard Johnson"},{label:"Hyatt",value:"Hyatt"},{label:"Ibis",value:"Ibis"},{label:"Indigo Hotels",value:"Indigo Hotels"},{label:"Innkeepers Lodge",value:"Innkeepers Lodge"},{label:"Inter Hotel",value:"Inter Hotel"},{label:"Intercontinental",value:"Intercontinental"},{label:"Interstate Htls/rsrts",value:"Interstate Htls/rsrts"},{label:"Jameson Inn",value:"Jameson Inn"},{label:"Joie De Vivre Hospitality",value:"Joie De Vivre Hospitality"},{label:"Jolly Hotels",value:"Jolly Hotels"},{label:"Jumeirah Hotels",value:"Jumeirah Hotels"},{label:"Jurys Hotel Group",value:"Jurys Hotel Group"},{label:"Kempinski Hotels",value:"Kempinski Hotels"},{label:"Keytel International",value:"Keytel International"},{label:"Kimpton Group",value:"Kimpton Group"},{label:"Knights Inn",value:"Knights Inn"},{label:"KSL Resorts",value:"KSL Resorts"},{label:"Kyriad Hotels",value:"Kyriad Hotels"},{label:"La Quinta Inns",value:"La Quinta Inns"},{label:"Lakeside Hotels",value:"Lakeside Hotels"},{label:"Lakeside International",value:"Lakeside International"},{label:"Le Meridien Hotels",value:"Le Meridien Hotels"},{label:"Leading Hotels Of The World",value:"Leading Hotels Of The World"},{label:"Legacy Hotels",value:"Legacy Hotels"},{label:"Lindner Hotels",value:"Lindner Hotels"},{label:"Loews",value:"Loews"},{label:"Luxe Worldwide Hotels",value:"Luxe Worldwide Hotels"},{label:"Lynch Group ",value:"Lynch Group "},{label:"Macdonald Hotels",value:"Macdonald Hotels"},{label:"Magnolia Hotels",value:"Magnolia Hotels"},{label:"Mainstay Suites",value:"Mainstay Suites"},{label:"Maldron",value:"Maldron"},{label:"Malmaison",value:"Malmaison"},{label:"Mandarin Oriental",value:"Mandarin Oriental"},{label:"Mantra Group",value:"Mantra Group"},{label:"Marco Polo Hotels",value:"Marco Polo Hotels"},{label:"Maritim Hotels",value:"Maritim Hotels"},{label:"Maritime Inns and Resorts",value:"Maritime Inns and Resorts"},{label:"Marriott Hotels",value:"Marriott Hotels"},{label:"Menzies",value:"Menzies"},{label:"Mercure",value:"Mercure"},{label:"Mg Hotels",value:"Mg Hotels"},{label:"Mgm/mirage",value:"Mgm/mirage"},{label:"Microtel Inn & Suites",value:"Microtel Inn & Suites"},{label:"Minotel",value:"Minotel"},{label:"Mint Hotels",value:"Mint Hotels"},{label:"Moevenpick Hotels",value:"Moevenpick Hotels"},{label:"Montcalm Hotel Group",value:"Montcalm Hotel Group"},{label:"Moran Group",value:"Moran Group"},{label:"Morgans Hotel Group",value:"Morgans Hotel Group"},{label:"Motel 6",value:"Motel 6"},{label:"Myfidelio",value:"Myfidelio"},{label:"Myhotel",value:"Myhotel"},{label:"New Otani Hotels",value:"New Otani Hotels"},{label:"NH Hotels",value:"NH Hotels"},{label:"Nikko Hotels",value:"Nikko Hotels"},{label:"Nobles House Hotel",value:"Nobles House Hotel"},{label:"Non Branded Hotel",value:"Non Branded Hotel"},{label:"Novotel",value:"Novotel"},{label:"Oberoi Group Of Hotels",value:"Oberoi Group Of Hotels"},{label:"O'Callaghan Hotels",value:"O'Callaghan Hotels"},{label:"Occidental Hotels",value:"Occidental Hotels"},{label:"Omni Hotels",value:"Omni Hotels"},{label:"Orbis Hotels",value:"Orbis Hotels"},{label:"Orient Express Hotels",value:"Orient Express Hotels"},{label:"Outrigger Hotels",value:"Outrigger Hotels"},{label:"Oxford Hotel & Inns Managment Ltd",value:"Oxford Hotel & Inns Managment Ltd"},{label:"Pan Pacific Hotels",value:"Pan Pacific Hotels"},{label:"Park Inn International",value:"Park Inn International"},{label:"Park Plaza Hotels",value:"Park Plaza Hotels"},{label:"Park Plaza International",value:"Park Plaza International"},{label:"Parkhotel",value:"Parkhotel"},{label:"Peabody Hotels",value:"Peabody Hotels"},{label:"Pedersen Group",value:"Pedersen Group"},{label:"Peel Hotels",value:"Peel Hotels"},{label:"Peninsula Hotels",value:"Peninsula Hotels"},{label:"Preferred Hotels & Resorts Worldwide",value:"Preferred Hotels & Resorts Worldwide"},{label:"Prem Group",value:"Prem Group"},{label:"Premier Inn",value:"Premier Inn"},{label:"Prima Hotels",value:"Prima Hotels"},{label:"Prince Resorts",value:"Prince Resorts"},{label:"Principal Hayley Hotels & Conference Venues",value:"Principal Hayley Hotels & Conference Venues"},{label:"Protea Hotels",value:"Protea Hotels"},{label:"Pullman",value:"Pullman"},{label:"Punch Retail",value:"Punch Retail"},{label:"Purple Hotels",value:"Purple Hotels"},{label:"Q Hotels",value:"Q Hotels"},{label:"Quality Inns & Suites",value:"Quality Inns & Suites"},{label:"Radisson Blu Hotels",value:"Radisson Blu Hotels"},{label:"Radisson Edwardian Hotels",value:"Radisson Edwardian Hotels"},{label:"Radisson",value:"Radisson"},{label:"Raffles International",value:"Raffles International"},{label:"Ramada",value:"Ramada"},{label:"Reconline",value:"Reconline"},{label:"Red Carnation Hotels",value:"Red Carnation Hotels"},{label:"Red Roof Inns",value:"Red Roof Inns"},{label:"Regent International",value:"Regent International"},{label:"Relais & Chateaux",value:"Relais & Chateaux"},{label:"Relaxinnz",value:"Relaxinnz"},{label:"Rema Hotels",value:"Rema Hotels"},{label:"Renaissance Hotels",value:"Renaissance Hotels"},{label:"Reservhotel Intl",value:"Reservhotel Intl"},{label:"Residence Inns",value:"Residence Inns"},{label:"ResortQuest",value:"ResortQuest"},{label:"Rihga Royal Hotels",value:"Rihga Royal Hotels"},{label:"Ringhotels",value:"Ringhotels"},{label:"Ritz Carlton",value:"Ritz Carlton"},{label:"Roadchef",value:"Roadchef"},{label:"Rocco Forte Hotels",value:"Rocco Forte Hotels"},{label:"Rock Resorts",value:"Rock Resorts"},{label:"Rodeway Inns",value:"Rodeway Inns"},{label:"Rosewood Hotels",value:"Rosewood Hotels"},{label:"Rotana",value:"Rotana"},{label:"Rydges Hotel Group",value:"Rydges Hotel Group"},{label:"Saco Serviced Apartments",value:"Saco Serviced Apartments"},{label:"Sandman Hotels",value:"Sandman Hotels"},{label:"Sarova",value:"Sarova"},{label:"Savoy Group",value:"Savoy Group"},{label:"Scandic",value:"Scandic"},{label:"Select Hotels",value:"Select Hotels"},{label:"Self Catering Accommodation",value:"Self Catering Accommodation"},{label:"Sercotel",value:"Sercotel"},{label:"Seymour Hotels",value:"Seymour Hotels"},{label:"Shangri-La Hotels & Resorts",value:"Shangri-La Hotels & Resorts"},{label:"Sheraton Hotels",value:"Sheraton Hotels"},{label:"Shilo Inns",value:"Shilo Inns"},{label:"Shire Hotels Limited",value:"Shire Hotels Limited"},{label:"Sierra Suites",value:"Sierra Suites"},{label:"Sleep Inns",value:"Sleep Inns"},{label:"Sleepy Dragon Hotels",value:"Sleepy Dragon Hotels"},{label:"Small Luxury Hotels Of World",value:"Small Luxury Hotels Of World"},{label:"Sofitel",value:"Sofitel"},{label:"Sol / Melia Hotels",value:"Sol / Melia Hotels"},{label:"Sonesta Hotels",value:"Sonesta Hotels"},{label:"Sorat Hotels",value:"Sorat Hotels"},{label:"Southern Sun Hotels",value:"Southern Sun Hotels"},{label:"Spirit Hotels",value:"Spirit Hotels"},{label:"Springhill Suites",value:"Springhill Suites"},{label:"Starhotels",value:"Starhotels"},{label:"Staybridge Suites",value:"Staybridge Suites"},{label:"Stop Inn",value:"Stop Inn"},{label:"Studio 6",value:"Studio 6"},{label:"Suitehotel",value:"Suitehotel"},{label:"Summerfield Suites",value:"Summerfield Suites"},{label:"Summit Hotels",value:"Summit Hotels"},{label:"Super 8",value:"Super 8"},{label:"Supranational Hotels",value:"Supranational Hotels"},{label:"Surejogi Group",value:"Surejogi Group"},{label:"Swallow Hotels",value:"Swallow Hotels"},{label:"Swissotel",value:"Swissotel"},{label:"Synxis Corp",value:"Synxis Corp"},{label:"Taj Hotels & Resorts",value:"Taj Hotels & Resorts"},{label:"Thelsa Group",value:"Thelsa Group"},{label:"Thistle Hotels",value:"Thistle Hotels"},{label:"Tomahawk Hotels",value:"Tomahawk Hotels"},{label:"Top International Hotels",value:"Top International Hotels"},{label:"Tower Hotels Group",value:"Tower Hotels Group"},{label:"Towneplace Suites",value:"Towneplace Suites"},{label:"Travelclick",value:"Travelclick"},{label:"Travelodge International",value:"Travelodge International"},{label:"Travelodge UK & Ireland",value:"Travelodge UK & Ireland"},{label:"Trident Hotels",value:"Trident Hotels"},{label:"Una Hotels",value:"Una Hotels"},{label:"Unirez",value:"Unirez"},{label:"Universal Orlando",value:"Universal Orlando"},{label:"Utell",value:"Utell"},{label:"Vagabond Inns",value:"Vagabond Inns"},{label:"Van Der Valk Hotels",value:"Van Der Valk Hotels"},{label:"Village Hotels",value:"Village Hotels"},{label:"Von Essen Hotels",value:"Von Essen Hotels"},{label:"W Hotels",value:"W Hotels"},{label:"Warwick Hotels",value:"Warwick Hotels"},{label:"Westin Hotels",value:"Westin Hotels"},{label:"Westmark Hotels",value:"Westmark Hotels"},{label:"Wingate Hotels",value:"Wingate Hotels"},{label:"Woodfin Suites",value:"Woodfin Suites"},{label:"Worldhotels",value:"Worldhotels"},{label:"Worldres",value:"Worldres"},{label:"Wyndham",value:"Wyndham"},{label:"Youngs & Co's Brewery",value:"Youngs & Co's Brewery"}],e.HotelEnterpriseSearch=Dt,e.HotelFilters=Tt,e.IRLEnterpriseSearch=Vt,e.InternalBasket=gi,e.LimitedCache=Ye,e.LoginError=fi,e.LoungesEnterpriseSearch=Pt,e.ManagementInfoAndIsValid=Ce,e.Memorise=Ke,e.ModalTypes=d,e.PREFERENCE_VALUES=He,e.ParkingEnterpriseSearch=Rt,e.PassengerAgeType=We,e.PersonTitles=[{title:"Dr",gender:null},{title:"Prof",gender:null},{title:"Mr",gender:"Male"},{title:"Mrs",gender:"Female"},{title:"Ms",gender:"Female"},{title:"Miss",gender:"Female"}],e.PhoneNumberImpl=Zt,e.RailCompanies=[{label:"Avanti West Coast",value:"Avanti West Coast"},{label:"East Coast",value:"East Coast"},{label:"IRL-Eurostar",value:"IRL-Eurostar"},{label:"IRL-Renfe Card",value:"IRL-Renfe Card"},{label:"IRL-SNCF - Carta Grand Voyageur",value:"IRL-SNCF - Carta Grand Voyageur"},{label:"IRL-Thalys",value:"IRL-Thalys"}],e.RailEnterpriseSearch=Ut,e.RegExps=pi,e.SupplementaryBookingInfoImpl=$t,e.Suppliers=ht,e.TravellerObject=Gt,e.USER_SIGNEDIN="USER_SIGNEDIN",e.USER_SIGNEDOUT=Di,e.UserFavorurite=dt,e.UserInfoImpl=zt,e.ValidatorChecker=ce,e.defaultValidations=_t,e.excludedExpression=Me,e.filtersKeys={chain:"chain",preferred:"preferred",amenitytype:"amenitytype",distanceRange:"distanceRange",extra:"extra",hotelName:"hotelName",priceRange:"priceRange",breakfastType:"breakfastType",accessibleRoomType:"accessibleRoomType"},e.includedAccessibilityExpression=Le,e.includedExpression=Ne,e.makeManagamentInfo=Fe,e.maxTravellerWellbeing=4,e.ɵ0=ot,e.ɵi=rr,e.ɵj=er,e.ɵk=xi,e.ɵl=ji,Object.defineProperty(e,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function f(e,t,r,i){var a,n=arguments.length,o=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o}function v(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function y(e,t,r,i){return new(r||(r=Promise))((function(a,n){function o(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))}function b(e,t){var r,i,a,n,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(6===n[0]&&o.label<a[1]){o.label=a[1],a=n;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(n);break}a[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],i=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}}Object.create;function g(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,a,n=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function C(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(S(arguments[t]));return e}Object.create;var A,T,D,P,F,k,_,R,I,O,E,B,N,M,L,w,j,U,H,x,G,V,W,Q,J,Y,K,q,X,Z,z,$,ee,te,re,ie,ae,ne,oe,se,le,ue,ce=function(){};!function(e){e.BeforeSearch="BEFORE_SEARCH",e.AfterSearch="AFTER_SEARCH"}(A||(A={})),function(e){e.CheckIn="CheckIn",e.HandCarry="HandCarry"}(T||(T={})),function(e){e.Open="OPEN",e.Booked="BOOKED",e.Cancelled="CANCELLED",e.BookingFailed="BOOKING_FAILED"}(D||(D={})),function(e){e.Open="OPEN",e.Booked="BOOKED",e.AwaitingApproval="AWAITING_APPROVAL",e.Approved="APPROVED",e.Disapproved="DISAPPROVED",e.PartiallyBooked="PARTIALLY_BOOKED",e.BookingFailed="BOOKING_FAILED"}(P||(P={})),function(e){e.Name="NAME",e.Email="EMAIL"}(F||(F={})),function(e){e.Root="ROOT",e.Tmc="TMC",e.Company="COMPANY",e.Office="OFFICE",e.CompanyGroup="COMPANY_GROUP",e.SelfBook="SELF_BOOK",e.Booker="BOOKER",e.Traveller="TRAVELLER",e.BookerWithSelf="BOOKER_WITH_SELF"}(k||(k={})),function(e){e.Any="Any",e.DdaCar="DDACar",e.CoachLarge="CoachLarge",e.CoachSmall="CoachSmall",e.Economy="Economy",e.EconomyCoach="EconomyCoach",e.EconomyMpvSmall="EconomyMPVSmall",e.EconomyMpvLarge="EconomyMPVLarge",e.EconomySuv="EconomySUV",e.ExecutiveCar="ExecutiveCar",e.ExecutiveSuv="ExecutiveSUV",e.GreenCar="GreenCar",e.GreenExecutive="GreenExecutive",e.GreenSuv="GreenSUV",e.SmallMpv="SmallMPV",e.MediumMpv="MediumMPV",e.LargeMpv="LargeMPV",e.StandardCar="StandardCar",e.Suv="SUV",e.BlackCab="BlackCab",e.HackneyCarriage="HackneyCarriage",e.TaxiSuv="TaxiSUV"}(_||(_={})),function(e){e.Mini="Mini",e.MiniElite="MiniElite",e.Economy="Economy",e.EconomyElite="EconomyElite",e.Compact="Compact",e.CompactElite="CompactElite",e.Intermediate="Intermediate",e.IntermediateElite="IntermediateElite",e.Standard="Standard",e.StandardElite="StandardElite",e.Fullsize="Fullsize",e.FullsizeElite="FullsizeElite",e.Premium="Premium",e.PremiumElite="PremiumElite",e.Luxury="Luxury",e.LuxuryElite="LuxuryElite",e.Oversize="Oversize",e.Special="Special"}(R||(R={})),function(e){e.Manual="Manual",e.Auto="Auto"}(I||(I={})),function(e){e.TwoToThreeDoor="TwoToThreeDoor",e.TwoOrFourDoor="TwoOrFourDoor",e.FourToFiveDoor="FourToFiveDoor",e.WagonOrEstate="WagonOrEstate",e.PassengerVan="PassengerVan",e.Limousine="Limousine",e.Sport="Sport",e.Convertible="Convertible",e.Suv="SUV",e.OpenAirAllTerrain="OpenAirAllTerrain",e.Special="Special",e.PickUpRegularCab="PickUpRegularCab",e.PickUpExtendedCab="PickUpExtendedCab",e.SpecialOfferCar="SpecialOfferCar",e.Coupe="Coupe",e.MonospaceEuropeanUse="MonospaceEuropeanUse",e.MotorHome="MotorHome",e.TwoWheelVehicle="TwoWheelVehicle",e.Roadster="Roadster",e.CommercialVanOrTruck="CommercialVanOrTruck"}(O||(O={})),function(e){e.Company="COMPANY",e.Office="OFFICE",e.User="USER"}(E||(E={})),function(e){e.Marine="MARINE",e.OilGas="OIL_GAS",e.CruiseLine="CRUISE_LINE",e.Wind="WIND",e.Mining="MINING"}(B||(B={})),function(e){e.Aed="AED",e.Afn="AFN",e.All="ALL",e.Amd="AMD",e.Ang="ANG",e.Aoa="AOA",e.Ars="ARS",e.Aud="AUD",e.Awg="AWG",e.Azn="AZN",e.Bam="BAM",e.Bbd="BBD",e.Bdt="BDT",e.Bgn="BGN",e.Bhd="BHD",e.Bif="BIF",e.Bmd="BMD",e.Bnd="BND",e.Bob="BOB",e.Bov="BOV",e.Brl="BRL",e.Bsd="BSD",e.Btn="BTN",e.Bwp="BWP",e.Byn="BYN",e.Bzd="BZD",e.Cad="CAD",e.Cdf="CDF",e.Che="CHE",e.Chf="CHF",e.Chw="CHW",e.Clf="CLF",e.Clp="CLP",e.Cny="CNY",e.Cop="COP",e.Cou="COU",e.Crc="CRC",e.Cuc="CUC",e.Cup="CUP",e.Cve="CVE",e.Czk="CZK",e.Djf="DJF",e.Dkk="DKK",e.Dop="DOP",e.Dzd="DZD",e.Egp="EGP",e.Ern="ERN",e.Etb="ETB",e.Eur="EUR",e.Fjd="FJD",e.Fkp="FKP",e.Gbp="GBP",e.Gel="GEL",e.Ghs="GHS",e.Gip="GIP",e.Gmd="GMD",e.Gnf="GNF",e.Gtq="GTQ",e.Gyd="GYD",e.Hkd="HKD",e.Hnl="HNL",e.Hrk="HRK",e.Htg="HTG",e.Huf="HUF",e.Idr="IDR",e.Ils="ILS",e.Inr="INR",e.Iqd="IQD",e.Irr="IRR",e.Isk="ISK",e.Jmd="JMD",e.Jod="JOD",e.Jpy="JPY",e.Kes="KES",e.Kgs="KGS",e.Khr="KHR",e.Kmf="KMF",e.Kpw="KPW",e.Krw="KRW",e.Kwd="KWD",e.Kyd="KYD",e.Kzt="KZT",e.Lak="LAK",e.Lbp="LBP",e.Lkr="LKR",e.Lrd="LRD",e.Lsl="LSL",e.Lyd="LYD",e.Mad="MAD",e.Mdl="MDL",e.Mga="MGA",e.Mkd="MKD",e.Mmk="MMK",e.Mnt="MNT",e.Mop="MOP",e.Mru="MRU",e.Mur="MUR",e.Mvr="MVR",e.Mwk="MWK",e.Mxn="MXN",e.Mxv="MXV",e.Myr="MYR",e.Mzn="MZN",e.Nad="NAD",e.Ngn="NGN",e.Nio="NIO",e.Nok="NOK",e.Npr="NPR",e.Nzd="NZD",e.Omr="OMR",e.Pab="PAB",e.Pen="PEN",e.Pgk="PGK",e.Php="PHP",e.Pkr="PKR",e.Pln="PLN",e.Pyg="PYG",e.Qar="QAR",e.Ron="RON",e.Rsd="RSD",e.Rub="RUB",e.Rwf="RWF",e.Sar="SAR",e.Sbd="SBD",e.Scr="SCR",e.Sdg="SDG",e.Sek="SEK",e.Sgd="SGD",e.Shp="SHP",e.Sll="SLL",e.Sos="SOS",e.Srd="SRD",e.Ssp="SSP",e.Stn="STN",e.Svc="SVC",e.Syp="SYP",e.Szl="SZL",e.Thb="THB",e.Tjs="TJS",e.Tmt="TMT",e.Tnd="TND",e.Top="TOP",e.Try="TRY",e.Ttd="TTD",e.Twd="TWD",e.Tzs="TZS",e.Uah="UAH",e.Ugx="UGX",e.Usd="USD",e.Usn="USN",e.Uyi="UYI",e.Uyu="UYU",e.Uzs="UZS",e.Vef="VEF",e.Vnd="VND",e.Vuv="VUV",e.Wst="WST",e.Xaf="XAF",e.Xag="XAG",e.Xau="XAU",e.Xba="XBA",e.Xbb="XBB",e.Xbc="XBC",e.Xbd="XBD",e.Xcd="XCD",e.Xdr="XDR",e.Xof="XOF",e.Xpd="XPD",e.Xpf="XPF",e.Xpt="XPT",e.Xsu="XSU",e.Xts="XTS",e.Xua="XUA",e.Xxx="XXX",e.Yer="YER",e.Zar="ZAR",e.Zmw="ZMW",e.Zwl="ZWL"}(N||(N={})),(M=e.ɵb||(e.ɵb={})).K="K",M.M="M",(L=e.ɵc||(e.ɵc={})).M="M",L.F="F",(w=e.ɵd||(e.ɵd={})).Passport="PASSPORT",w.Visa="VISA",w.IdCard="ID_CARD",function(e){e.Cancellation="Cancellation",e.Change="Change",e.NoShow="NoShow",e.Upgrade="Upgrade",e.Other="Other"}(j||(j={})),function(e){e.Flexible="Flexible",e.Lowest="Lowest",e.Negotiated="Negotiated",e.NonNegotiated="NonNegotiated",e.Leisure="Leisure",e.RequestFareRules="RequestFareRules",e.SelectAndPro="SelectAndPro"}(U||(U={})),function(e){e.Any="Any",e.LiteEconomy="LiteEconomy",e.Economy="Economy",e.EconomyRestricted="EconomyRestricted",e.EconomyNoBags="EconomyNoBags",e.EconomyFlexi="EconomyFlexi",e.PremiumEconomy="PremiumEconomy",e.Business="Business",e.PremiumBusiness="PremiumBusiness",e.First="First",e.PremiumFirst="PremiumFirst"}(H||(H={})),function(e){e.Adult="ADULT",e.Child="CHILD",e.Infant="INFANT"}(x||(x={})),function(e){e.All="All",e.First="First",e.Standard="Standard"}(G||(G={})),function(e){e.ReturnJourney="ReturnJourney",e.SingleJourney="SingleJourney"}(V||(V={})),function(e){e.Renfe="Renfe",e.BeNe="BeNe",e.Ntv="Ntv"}(W||(W={})),function(e){e.Placeholder="placeholder",e.Complete="complete"}(Q||(Q={})),function(e){e.BookerOnly="BOOKER_ONLY",e.BookerTravellers="BOOKER_TRAVELLERS",e.NoEmail="NO_EMAIL"}(J||(J={})),function(e){e.User="USER",e.Guest="GUEST"}(Y||(Y={})),function(e){e.Error="ERROR",e.Warn="WARN",e.Info="INFO",e.Http="HTTP",e.Verbose="VERBOSE",e.Debug="DEBUG",e.Silly="SILLY"}(K||(K={})),function(e){e.Login="LOGIN",e.SearchForm="SEARCH_FORM",e.Results="RESULTS",e.MiForm="MI_FORM",e.BasketBeforeConfirm="BASKET_BEFORE_CONFIRM",e.Dashboard="DASHBOARD"}(q||(q={})),(X=e.ɵf||(e.ɵf={})).Adult="ADULT",X.Child="CHILD",X.Infant="INFANT",function(e){e.Mobile="MOBILE",e.Landline="LANDLINE",e.Fax="FAX",e.Other="OTHER"}(Z||(Z={})),(z=e.ɵg||(e.ɵg={})).MealRequest="MEAL_REQUEST",z.SeatingPreference="SEATING_PREFERENCE",z.SpecialNeed="SPECIAL_NEED",z.SeatLocation="SEAT_LOCATION",z.SeatPosition="SEAT_POSITION",z.SeatDirection="SEAT_DIRECTION",function(e){e.Inherited="INHERITED",e.Editable="EDITABLE",e.Visible="VISIBLE",e.Hidden="HIDDEN"}($||($={})),function(e){e.All="All",e.First="First",e.Standard="Standard"}(ee||(ee={})),function(e){e.SingleJourney="SingleJourney",e.ReturnJourney="ReturnJourney",e.OpenReturnJourney="OpenReturnJourney"}(te||(te={})),function(e){e.Origin="Origin",e.Intermediate="Intermediate",e.Destination="Destination",e.Unknown="Unknown"}(re||(re={})),function(e){e.RequestStop="RequestStop",e.PickUpOnly="PickUpOnly",e.SetDownOnly="SetDownOnly",e.Normal="Normal",e.Passing="Passing",e.Unknown="Unknown"}(ie||(ie={})),function(e){e.Low="Low",e.Moderate="Moderate",e.Medium="Medium",e.High="High",e.Extreme="Extreme"}(ae||(ae={})),function(e){e.Flight="FLIGHT",e.Eurostar="EUROSTAR",e.InternationalRail="INTERNATIONAL_RAIL",e.Ferry="FERRY",e.Rail="RAIL",e.Hotel="HOTEL",e.Car="CAR",e.Lounge="LOUNGE",e.FastTrack="FAST_TRACK",e.Parking="PARKING",e.Cab="CAB",e.Coach="COACH"}(ne||(ne={})),function(e){e.None="None",e.Fixed="Fixed",e.Flexible="Flexible"}(oe||(oe={})),function(e){e.ExactTime="ExactTime",e.DepartAfter="DepartAfter",e.ArriveBefore="ArriveBefore"}(se||(se={})),function(e){e.All="ALL",e.Mock="MOCK",e.Lightning="LIGHTNING",e.App="APP"}(le||(le={})),function(e){e.FreeText="FREE_TEXT",e.AutoSuggest="AUTO_SUGGEST",e.Dropdown="DROPDOWN",e.Hidden="HIDDEN"}(ue||(ue={}));var de,he,pe,me,fe,ve,ye,be,ge,Se,Ce=function(e){function r(r){var i=e.call(this)||this;return i.isLoading=new t.BehaviorSubject(!1),i.search=function(e){return t.of([])},Object.assign(i,r),i}return m(r,e),Object.defineProperty(r.prototype,"selectedValues",{get:function(){return this._selectedValues},set:function(e){Object.is(this._selectedValues,e)||(this._selectedValues=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},set:function(e){this.setValue(e)},enumerable:!1,configurable:!0}),r.prototype.isValid=function(){return!this.mandatory||0!==this.selectedValues.length},r.prototype.hasErrors=function(e){var t=this;return new Promise((function(r,i){r(!t.mandatory||e&&0!==e.length?null:{hasErrors:!0})}))},r}(ce),Ae=function(e){function t(t,r){var i,a=this;return(a=e.call(this,t)||this).basketService=r,a.tempValue=a.selectedValues&&(null===(i=a.selectedValues[0])||void 0===i?void 0:i.freeValue)||"",a.defaultValue&&!a.selectedValues.length&&(a.value=a.defaultValue.value,a.setValue(a.defaultValue.value)),a}return m(t,e),t.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].freeValue:""},t.prototype.setValue=function(e){this.tempValue!==e&&(this.tempValue=e,this.selectedValues=[{freeValue:e,basketLevelValue:this.perBooking,userLevelValue:this.perPassenger}])},t.prototype.save=function(e,t,r){this.basketService.setMiFreeValue(e,this,this.selectedValues[0]?this.selectedValues[0].freeValue:"",t,r)},t.prototype.hasErrors=function(t){var r=Object.create(null,{hasErrors:{get:function(){return e.prototype.hasErrors}}});return y(this,void 0,void 0,(function(){var e=this;return b(this,(function(i){return[2,new Promise((function(i,a){if(t&&0!==t.length||i(e.mandatory?{hasErrors:!0}:null),e.valueMask&&t)return e.basketService.validateFreeValeMi(e,t).then((function(e){i(e?null:{hasErrors:!0})}));e.values.length>0?i(e.values.find((function(e){return e.value===t}))?null:{hasErrors:!0}):i(r.hasErrors.call(e,t))}))]}))}))},t}(Ce),Te=function(e){function i(i,a){var n,o=this;return(o=e.call(this,i)||this).basketService=a,o.search=function(e){return e.pipe(r.debounceTime(300),r.distinctUntilChanged(),r.switchMap((function(e){return e.length>2?o.basketService.getMiAutoSugestions(o.id,e,o.isLoading):t.of(o.avaliableItems)})),r.tap((function(e){o.avaliableItems=e})))},(null===(n=o.values)||void 0===n?void 0:n.length)>0?o.avaliableItems=o.values:o.basketService.getMiAutoSugestions(o.id,"",o.isLoading).subscribe((function(e){o.avaliableItems=e,o.defaultValue&&!o.selectedValues.length&&(o.value=o.defaultValue.value,o.setValue(o.defaultValue.valueId))}),(function(){console.error("No values for AutoSugest field")})),o}return m(i,e),i.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},i.prototype.hasErrors=function(e){return y(this,void 0,void 0,(function(){return b(this,(function(t){return e&&0!==e.length?e&&e.id&&this.avaliableItems?[2,this.avaliableItems.find((function(t){return t.id===e.id}))?null:{hasErrors:!0}]:[2,{hasErrors:!0}]:[2,this.mandatory?{hasErrors:!0}:null]}))}))},i.prototype.setValue=function(e){try{var t=this.avaliableItems.find((function(t){return t.id===e}));this.selectedValues=t?[{value:{id:t.id,label:t.label,value:t.value,default:t.default,fixed:t.fixed,agentOnly:t.agentOnly},basketLevelValue:this.perBooking,userLevelValue:this.perPassenger}]:[]}catch(e){this.selectedValues=[]}},i.prototype.save=function(e,t,r){var i,a;this.basketService.setMiSelectedValue(e,this,this.selectedValues[0]?null===(a=null===(i=this.selectedValues[0])||void 0===i?void 0:i.value)||void 0===a?void 0:a.id:"",t,r)},i}(Ce),De=function(e){function t(t){return e.call(this,t)||this}return m(t,e),t.prototype.getValue=function(){return""},t.prototype.setValue=function(e){},t.prototype.save=function(e,t){},t}(Ce),Pe=function(e){function t(t,r){var i,a=this;return(a=e.call(this,t)||this).basketService=r,(null===(i=a.values)||void 0===i?void 0:i.length)>0?a.avaliableItems=a.values:(a.basketService.showErrorModal(),console.error("No values for Dropdown MI field ")),a.defaultValue&&!a.selectedValues.length&&(a.value=a.defaultValue.valueId,a.setValue(a.defaultValue.valueId)),a}return m(t,e),t.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},t.prototype.hasErrors=function(e){return y(this,void 0,void 0,(function(){return b(this,(function(t){try{return[2,!this.avaliableItems.find((function(t){return t.id===e}))&&this.mandatory?{hasErrors:!0}:null]}catch(e){return[2,null]}return[2]}))}))},t.prototype.setValue=function(e){var t=this.avaliableItems.find((function(t){return t.id===e}));this.selectedValues=t?[{value:{id:t.id,label:t.label,value:t.value,default:t.default,fixed:t.fixed,agentOnly:t.agentOnly},basketLevelValue:this.perBooking,userLevelValue:this.perPassenger}]:[]},t.prototype.save=function(e,t,r){this.selectedValues.length&&this.basketService.setMiSelectedValue(e,this,this.selectedValues[0].value.id||"",t,r)},t}(Ce),Fe=function(e,t){switch(e.uiPresentation){case ue.FreeText:return new Ae(e,t);case ue.AutoSuggest:return new Te(e,t);case ue.Hidden:return new De(e);case ue.Dropdown:return new Pe(e,t);default:var r=e.uiPresentation;console.log(r)}return null},ke=function(e,t,r){var i=this;this.basketService=t,this.helpers=r,this.isValidObservers=[],this.basketItem=e;var a=e.managementInfo.reduce((function(t,r){if(r.reason&&!e.requiresReason)return t;var a=Fe(r,i.basketService);return i.isValidObservers.push(a),r.perBooking?t.perItem.push(a):t.perUser.push(a),t}),{perItem:[],perUser:[]}),n=a.perItem,o=a.perUser;this.miPerItem=n,this.miPerUser=e.users.reduce((function(e,t){return e[t.id]={managementInfo:i.helpers.clone(o).map((function(e){var t=Fe(e,i.basketService);return i.isValidObservers.push(t),t}))},e}),{}),this.miPerGuest=e.guests.reduce((function(e,t){return e[t.id]={managementInfo:i.helpers.clone(o).map((function(e){var t=Fe(e,i.basketService);return i.isValidObservers.push(t),t}))},e}),{}),this.users=Object.keys(this.miPerUser),this.guests=Object.keys(this.miPerGuest)};(de=e.LogoutEnum||(e.LogoutEnum={}))[de.LOGOUT=0]="LOGOUT",de[de.STAYIN=1]="STAYIN",(he=e.LocationTypes||(e.LocationTypes={})).City="City",he.Office="Office",he.Airport="Airport",he.TrainStation="Train Station",he.Postcode="Postcode",he.Shortlist="Shortlist",(pe=e.BreatfastTypes||(e.BreatfastTypes={})).BreakfastIncluded="BreakfastIncluded",pe.BreakfastNotIncluded="BreakfastNotIncluded",(me=e.HotelPolicyEnum||(e.HotelPolicyEnum={})).cancellation="cancellation",me.deposit="deposit",me.disabledAccess="disabledAccess",me.general="general",me.guarantee="guarantee",me.refundAvailable="refundAvailable",(fe=e.BookingStatus||(e.BookingStatus={}))[fe.Loading=0]="Loading",fe[fe.AddingItems=1]="AddingItems",fe[fe.AddingTravellers=2]="AddingTravellers",fe[fe.AddingLeadPassenger=3]="AddingLeadPassenger",fe[fe.Failed=4]="Failed",fe[fe.Revalidate=5]="Revalidate",fe[fe.RevalidatingError=6]="RevalidatingError",fe[fe.ChooseMIGroup=7]="ChooseMIGroup",fe[fe.ProvideMi=8]="ProvideMi",fe[fe.SendForApproval=9]="SendForApproval",fe[fe.AwaitingApproval=10]="AwaitingApproval",fe[fe.ApprovedPaymentOption=11]="ApprovedPaymentOption",fe[fe.ApprovedSupplemtal=12]="ApprovedSupplemtal",fe[fe.ApprovedBook=13]="ApprovedBook",fe[fe.PartiallyBooked=14]="PartiallyBooked",fe[fe.Complete=15]="Complete",fe[fe.Expired=16]="Expired",(ve=e.SchemaFormat||(e.SchemaFormat={})).array="array",ve.datetime="date-time",ve.date="date",ve.integer="integer",ve.object="object",ve.select="select",ve.selectQueue="select-queue",ve.string="string",ve.boolean="boolean",ve.countryCode="countryCode",ve.additionalSeatPreference="t_additionalSeatPreference",ve.seatPrefGroups="a_seatPrefGroups",ve.railSeating="railSeating",ve.passport="passport",ve.specialRequests="specialRequests",ve.apis="apis",ve.mandatoryIfEticket="mandatory-if-eticket",ve.mandatoryIfTod="mandatory-if-tod",ve.countryIsoCode="countryIsoCode",ve.address="address",ve.dob="dob",(e.Widgets||(e.Widgets={})).COUNTRY_CODE="COUNTRY_CODE",(ye=e.PreferredFlags||(e.PreferredFlags={}))[ye.none=0]="none",ye[ye.officePreferred=1]="officePreferred",ye[ye.companyPreferred=2]="companyPreferred",ye[ye.tmcPreferred=4]="tmcPreferred",ye[ye.all=7]="all",(be=e.FlightDirectionEnum||(e.FlightDirectionEnum={}))[be.Outbound=1]="Outbound",be[be.Inbound=0]="Inbound",be[be.DualSingleOutbound=2]="DualSingleOutbound",be[be.DualSingleInbound=3]="DualSingleInbound",(ge=e.OBTFlightCabinClass||(e.OBTFlightCabinClass={})).Business="Business",ge.BusinessBranded="BrandedBusiness",ge.EconomyFlexi="EconomyFlexi",ge.EconomyFlexiBranded="BrandedEconomyFlexi",ge.EconomyNoBags="EconomyNoBags",ge.EconomyNoBagsBranded="BrandedEconomyNoBags",ge.EconomyRestricted="EconomyRestricted",ge.EconomyRestrictedBranded="BrandedEconomyRestricted",ge.First="First",ge.FirstBranded="BrandedFirst",ge.PremiumEconomy="PremiumEconomy",ge.PremiumEconomyBranded="BrandedPremiumEconomy",(Se=e.EurostarClassEnum||(e.EurostarClassEnum={})).ANY="Any",Se.BUSINESS_PREMIER="BusinessPremier",Se.STANDARD_PREMIER="StandardPremier",Se.STANDARD="Standard";var _e,Re,Ie,Oe="("+["breakfast not included","breakfast is not included","Breakfast isn't included","Does not include breakfast","EXCL","exel Breakfast","Breakfast Costs","no breakfast"].join(")|(")+")",Ee="("+["BREAKFAST INCLUDED","breakfast","BB","B&B","Bead and breakfast","Bed and breakfast","Bed&Break","INCLUDES BREAK","INCL BED AND BRE","BRKFST","BED AND BRKFST"].join(")|(")+")",Be="("+["Accessibility","Accessible and Disabled","Disabled","Mobility Access"].join(")|(")+")",Ne=new RegExp(Ee,"i"),Me=new RegExp(Oe,"i"),Le=new RegExp(Be,"i");(_e=e.SearchHandler||(e.SearchHandler={})).AVAILABILITY="Availability",_e.FEMALE_FRIENDLY="SOLO Female Friendly",_e.CTM_GREEN_CHOICE="CTM Greener Choice",_e.BREAKFAST_INCLUDED="BreakfastIncluded",_e.BREAKFAST_NOT_INCLUDED="BreakfastNotIncluded",_e.CLIENT="Client",_e.AGENCY="Agency",_e.ANY="Any",(Re=e.MenuSlideEnum||(e.MenuSlideEnum={})).IN="in",Re.OUT="out",Re.FLAT="flat",(Ie=e.RiskLevelRanking||(e.RiskLevelRanking={})).Low="1",Ie.Moderate="2",Ie.Medium="3",Ie.High="4",Ie.Extreme="5";var we;(we=e.ServiceProvider||(e.ServiceProvider={})).Confirma="Conferma",we.Evolvi="Evolvi",we.SabreCarHire="Sabre Car Hire",we.Lounges="Holiday Extras Lounges",we.FastTrack="Holiday Extras Fast Track",we.Parking="Holiday Extras Parking",we.CMAC="CMAC",we.FarelogixLFGNDC="Farelogix LFG NDC",we.BaNdc="BA NDC",we.EurostarSabre="Eurostar (Sabre)",we.Trainline="Trainline",(e.WellbeingEnum||(e.WellbeingEnum={})).WELLBEING="/results/wellbeing";var je,Ue,He=[{label:"Bland",type:e.ɵg.MealRequest},{label:"Child",type:e.ɵg.MealRequest},{label:"Diabetic",type:e.ɵg.MealRequest},{label:"Fruit Plate",type:e.ɵg.MealRequest},{label:"Gluten Free",type:e.ɵg.MealRequest},{label:"Hindu",type:e.ɵg.MealRequest},{label:"Kosher",type:e.ɵg.MealRequest},{label:"Low Fat/Cholesterol",type:e.ɵg.MealRequest},{label:"Low Sodium",type:e.ɵg.MealRequest},{label:"Muslim",type:e.ɵg.MealRequest},{label:"Non-Lactose",type:e.ɵg.MealRequest},{label:"Raw Vegeterian",type:e.ɵg.MealRequest},{label:"Seafood",type:e.ɵg.MealRequest},{label:"Vegan Vegeterian",type:e.ɵg.MealRequest},{label:"Vegeterian Lacto-Ovo",type:e.ɵg.MealRequest},{label:"Aisle",type:e.ɵg.SeatingPreference},{label:"Window",type:e.ɵg.SeatingPreference},{label:"Bassinet",type:e.ɵg.SpecialNeed},{label:"Bicycle",type:e.ɵg.SpecialNeed},{label:"Blind passenger",type:e.ɵg.SpecialNeed},{label:"Deaf passenger",type:e.ɵg.SpecialNeed},{label:"Meet and assist",type:e.ɵg.SpecialNeed},{label:"Wheelchair, can ascend steps",type:e.ɵg.SpecialNeed},{label:"Wheelchair, can walk to seat",type:e.ɵg.SpecialNeed},{label:"Wheelchair, manual",type:e.ɵg.SpecialNeed},{label:"Wheelchair, must be carried",type:e.ɵg.SpecialNeed},{label:"Wheelchair, with dry battery",type:e.ɵg.SpecialNeed},{label:"Wheelchair, with wet battery",type:e.ɵg.SpecialNeed},{label:"Quiet",type:e.ɵg.SeatLocation},{label:"Business",type:e.ɵg.SeatLocation},{label:"Family",type:e.ɵg.SeatLocation},{label:"Aisle",type:e.ɵg.SeatPosition},{label:"Middle",type:e.ɵg.SeatPosition},{label:"Window",type:e.ɵg.SeatPosition},{label:"Individual",type:e.ɵg.SeatPosition},{label:"Front Facing",type:e.ɵg.SeatDirection},{label:"Back Facing",type:e.ɵg.SeatDirection},{label:"Airline Seat",type:e.ɵg.SeatDirection}],xe=[{label:"Passport",type:e.ɵd.Passport},{label:"Visa",type:e.ɵd.Visa},{label:"IdCard",type:e.ɵd.IdCard}],Ge=[{label:"F",type:e.ɵc.F},{label:"M",type:e.ɵc.M}],Ve=[{label:"K",type:e.ɵb.K},{label:"M",type:e.ɵb.M}];(je=e.DifferentInvokdedUserReasons||(e.DifferentInvokdedUserReasons={}))[je.continue=0]="continue",je[je.newBasket=1]="newBasket",je[je.cancel=2]="cancel",je[je.research=3]="research",(Ue=e.DifferentTraveller||(e.DifferentTraveller={}))[Ue.continue=0]="continue",Ue[Ue.newBasket=1]="newBasket",Ue[Ue.cancel=2]="cancel";var We=[e.ɵf.Adult,e.ɵf.Child,e.ɵf.Infant],Qe=function(){function r(r,i){this.basketService=r,this.helpers=i,this.status=new t.BehaviorSubject(e.BookingStatus.Loading),this.basket=new t.BehaviorSubject({}),this.needsToViewMi=!0,this.isUpdating=new t.BehaviorSubject(!1),this.id=null}return r.prototype.loadBasket=function(r){this.id=r,this.basket=new t.BehaviorSubject({}),this.status.next(e.BookingStatus.Loading),this.isUpdating.next(!0),this._loadBasket(r)},r.prototype._loadBasket=function(t){var r=this;this.basketService.loadBasket(t),this.basketService.subsribeToBasket(t,{next:function(t){r.basket.next(t),r.expiredItemInTheBasket()?r.status.next(e.BookingStatus.Expired):r.updateBasket(t)},error:function(e){r.basket.error(e),console.error(e)},complete:function(){r.basket.complete(),console.log("Basket completed")}})},r.prototype.expiredItemInTheBasket=function(){var e;return this.isUpdating.next(!1),this.basket.subscribe((function(t){e=t.basketItems.some((function(e){return e.expired}))})),e},r.prototype.updateBasket=function(t){switch(this.isUpdating.next(!1),t.status){case P.Open:this.workoutOpenState(t);break;case P.AwaitingApproval:this.status.next(this.workoutState(t,e.BookingStatus.AwaitingApproval));break;case P.Approved:this.status.next(this.workoutApprovedState(t));break;case P.Booked:this.status.next(this.workoutState(t,e.BookingStatus.Complete));break;case P.BookingFailed:this.status.next(this.workoutState(t,e.BookingStatus.Failed));break;case P.Disapproved:case P.PartiallyBooked:this.status.next(e.BookingStatus.Failed);break;default:var r=t.status;console.log(r)}},r.prototype.sendBasketForApproval=function(){return this.basketService.sendBasketForApproval(this.id)},r.prototype.workoutApprovedState=function(t){var r=e.BookingStatus.ApprovedBook;return t.basketItems.find((function(e){var t;return(null===(t=e.availablePaymentMethods)||void 0===t?void 0:t.length)>0&&!e.selectedPaymentMethod}))?this.workoutState(t,e.BookingStatus.ApprovedPaymentOption):(t.suppInfo.find((function(e){return e.hasDetails}))&&(r=e.BookingStatus.ApprovedSupplemtal),this.workoutState(t,r))},r.prototype.workoutState=function(t,r){return t.validated?r:(this._hasInvalidPrice(t),e.BookingStatus.Revalidate)},r.prototype.workoutOpenState=function(t){if(0!==t.basketItems.length)if(this._needsCorrectTravellers(t))this.status.next(e.BookingStatus.AddingTravellers);else{if(!this._needLeadPassengers(t))return t.validated?void(this._needsMiGroups(t)?this.status.next(e.BookingStatus.ChooseMIGroup):this.helpers.needsMi(t,this.needsToViewMi)?this.status.next(e.BookingStatus.ProvideMi):this.status.next(e.BookingStatus.SendForApproval)):(this._hasInvalidPrice(t),void this.status.next(e.BookingStatus.Revalidate));this.status.next(e.BookingStatus.AddingLeadPassenger)}else this.status.next(e.BookingStatus.AddingItems)},r.prototype.revalidate=function(){this.basketService.revalidate(this.id)},r.prototype.addTravellers=function(e,t,r,i){void 0===i&&(i=0),this.isUpdating.next(!0),this.basketService.addTravellers(e.id,t,r,i)},r.prototype.setLeadPassenger=function(e,t,r,i){void 0===i&&(i=0),this.isUpdating.next(!0),this.basketService.setLeadPassenger(e.id,t,r,i,r.guest?Y.Guest:Y.User)},r.prototype.setBasketItemMiGroup=function(e,t){this.isUpdating.next(!0),this.basketService.setBasketItemMiGroup(e,t.basketItem.id,t.value)},r.prototype.saveMiGroup=function(e){var t=this;this.isUpdating.next(!0),e.forEach((function(e){t.setBasketItemMiGroup(t.id,e)}))},r.prototype.saveMi=function(e){this.needsToViewMi=!1,this.isUpdating.next(!0),e&&this.basketService.saveMiData(this.id,e)},r.prototype.removeExpiredItems=function(){this.isUpdating.next(!0),this.basketService.removeExpiredItems(this.id)},r.prototype.setBasketItemPaymentOption=function(e,t){return this.isUpdating.next(!0),this.basketService.setBasketItemPaymentOption(this.basket.value,e,t)},r.prototype.bookBasket=function(e,t){if(this.isUpdating.next(!0),e)return this.basketService.bookBasket(this.id,e,t)},r.prototype._needsMiGroups=function(e){return!!e.basketItems.find((function(e){return e.miGroupsAvailable.length>0&&!e.miGroupSelected}))},r.prototype._needsCorrectTravellers=function(e){var t=this;return!!e.basketItems.find((function(e){var r=t._splitTravellers(e);return e.service.type===ne.Parking?!(1===e.adults&&r.adults.length):!(r.adults.length===e.adults&&r.children.length===e.children&&r.infants.length===e.infants)}))},r.prototype._hasInvalidPrice=function(e){return!!e.basketItems.find((function(e){return!e.latestValidationPriceDifference||e.expired}))},r.prototype._needLeadPassengers=function(e){return!!e.basketItems.find((function(e){return!e.leadPassenger}))},r.prototype._splitTravellers=function(t){var r=this;return(t.userPassengerTypes.concat(t.guestPassengerTypes)||[]).reduce((function(i,a,n){var o=r._findUser(t.users,Number(a.id)),s=r._findGuest(t.guests,Number(a.id));switch(a.passengerType){case e.ɵf.Adult:i.adults.push(o||s);break;case e.ɵf.Child:i.children.push(o||s);break;case e.ɵf.Infant:i.infants.push(o||s)}return i}),{adults:[],children:[],infants:[]})},r.prototype._findUser=function(e,t){return e.find((function(e){return Number(e.id)===t}))},r.prototype._findGuest=function(e,t){return e.find((function(e){return Number(e.id)===t}))},r.prototype.getId=function(){return this.id},r}(),Je=function(e,t){this.key=e,this.value=t,this.next=null,this.pre=null},Ye=function(){function e(e){void 0===e&&(e=10),this.size=e,this.cache={},this.count=0,this.head=new Je("",null);var t=new Je("",null);this.head.next=t,t.pre=this.head}return e.prototype.get=function(e){return this.cache[e]?this.cache[e].value:null},e.prototype.set=function(e,t){var r=this.cache[e];r?(r.value=t,this.deleteItem(r),this.addToHead(r)):(this.cache[e]=new Je(e,t),this.addToHead(this.cache[e]))},e.prototype.hasKey=function(e){return this.cache.hasOwnProperty(e)},e.prototype.deleteItem=function(e){e.pre.next=e.next,e.next.pre=e.pre},e.prototype.addToHead=function(e){e.next=this.head.next,e.next.pre=e,e.pre=this.head,this.head.next=e},e}();function Ke(){return function(e,t,r){var i=new Ye,a=r.value;r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=JSON.stringify(e);return i.hasKey(r)||i.set(r,a.apply(this,e)),i.get(r)}}}var qe,Xe,Ze,ze=["GS","AIG","GRP","GU3","GU4","GUC","MPG","2TR","SGU","GSU"],$e=function(){function t(){}return t.prototype.isGroupTicket=function(e){return ze.includes(e.toUpperCase().trim())},t.prototype.minToHour=function(e){return Math.floor(e/60)+"h "+e%60+"m"},t.prototype.makeColonTime=function(e){return e.substring(0,2)+":"+e.substring(2,4)},t.prototype.nonNullMin=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return r&&r[e]&&t.min>Number(r[e])?{item:r,min:Number(r[e])}:t}),{min:Number.MAX_SAFE_INTEGER,item:null}).item},t.prototype.joinByComma=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return s.default.isEmpty(t)&&(e+=t+","),e}),"").slice(0,-1)},t.prototype.mutuallyInclude=function(e,t){try{return e.includes(t)||t.includes(e)}catch(e){return console.warn("Trying to mutually compare undefined variable."),!1}},t.prototype.findByKey=function(e,t,r){return e.filter((function(e){return e[t]===r})).pop()},t.prototype.dateToNgDate=function(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},t.prototype.convertToYYMMDD=function(e){return e.length>6?this.formatDate(this.yyyymmddTimeToMoment(e)):e},t.prototype.formatDateToMMDDYYY=function(e){return l.default(e).format(t.MMDDYY_DATE)},t.prototype.formatDate=function(e){return(e=l.default(e)).format(t.DATE_FORMAT)},t.prototype.formatTime=function(e){try{return e.format(t.TIME_FORMAT)}catch(e){console.error(e)}},t.prototype.formatTimeColon=function(e){return(e=l.default(e)).format(t.TIME_FORMAT_COLON)},t.prototype.formatIsoDate=function(e){return(e=l.default(e)).format(t.ISO_DATA_FORMAT)},t.prototype.formatIsoDateTime=function(e){return(e=l.default(e)).format(t.ISO_DATA_FORMAT_TIME)},t.prototype.formatGraphQLDateTime=function(e){return(e=l.default(e)).format(t.GRAPHQL_DATA_FORMAT_TIME)},t.prototype.formatIsoDateNoHyphans=function(e){return(e=l.default(e)).format(t.ISO_DATA_FORMAT_NO_HYPHANS)},t.prototype.generateTimesList=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=24),void 0===r&&(r=15);for(var i=[],a=0;a<t-e;a++)for(var n=0;n<60;n+=r)i.push(l.default({hour:a,minute:n}).format("HH:mm"));return i},t.prototype.momentToNgDate=function(e){return e=l.default(e),this.dateToNgDate(e.toDate())},t.prototype.ngDateToDate=function(e){return new Date(e.year,e.month-1,e.day)},t.prototype.ngDateToMoment=function(e,t){var r=l.default(this.ngDateToDate(e));if(t){var i=t.split(":");2===i.length?r.set("hours",Number(i[0])).set("minutes",Number(i[1])):r.set("hours",Number(t.substr(0,2))).set("minutes",Number(t.substr(2,2)))}return r},t.prototype.todayToNgbDateStruct=function(){var e=l.default();return{year:e.year(),month:e.month()+1,day:e.date()}},t.prototype.objectToArray=function(e){return Object.keys(e).map((function(t){return e[t]}))},t.prototype.yyyymmddToDate=function(e){return new Date(Number(e.substring(0,4)),Number(e.substring(4,6))-1,Number(e.substring(6,8)))},t.prototype.yyyymmddToMoment=function(e){return l.default(this.yyyymmddToDate(e))},t.prototype.yymmddToMoment=function(e){return l.default(e,"YYMMDD")},t.prototype.yymmddToNgbDate=function(e){return this.momentToNgDate(this.yymmddToMoment(e))},t.prototype.yymmdd_hhmmToMoment=function(e,t){return l.default(e+" "+t,"YYMMDD HHmm")},t.prototype.yyyymmdd_hhmmToMoment=function(e,t){return l.default(e+" "+t,"YYYYMMDD HHmm")},t.prototype.yyyymmddToNgDate=function(e){return this.dateToNgDate(this.yyyymmddToDate(e))},t.prototype.yyyymmddTimeToNgDate=function(e,t){var r=this.yyyymmddToMoment(e).add(Number(t.substring(0,2)),"hours").add(Number(t.substring(2,4)),"minutes");return this.momentToNgDate(r)},t.prototype.yyyymmddTimeToMoment=function(e){return 6===e.length?l.default(""+e,"YYMMDD"):l.default(""+e,"YYYYMMDD")},t.prototype.hhmmToTime=function(e){return e.substring(0,2)+":"+e.substring(2,4)},t.prototype.dateStringToyyyymmdd=function(e){if("string"!=typeof e)return null;var t=/(\d{4})[-\/]?(\d{2})[-\/]?(\d{2})/.exec(e);return t?""+t[1]+t[2]+t[3]:null},t.prototype.timeStringTohh_mm=function(e){if("string"!=typeof e)return null;var t=/(\d{2})[:-]?(\d{2})/.exec(e);return t?t[1]+":"+t[2]:null},t.prototype.stringToBool=function(e){return e&&"false"!==e&&"0"!==e&&"no"!==e&&"n"!==e},t.prototype.clone=function(e){return s.default.cloneDeep(e)},t.prototype.replaceKeysInText=function(e,t){return Object.keys(t).reduce((function(e,r){return e.replace("%"+r,t[r])}),e)},t.prototype.getNextMinuets=function(e,t){return void 0===e&&(e=l.default()),void 0===t&&(t=15),e.minute(Math.ceil(e.minute()/t)*t),e.format("HH:mm")},t.prototype.getNumberOnceValue=function(e){var t=this.guid();return t+"_"+hex_hmac_md5(e,t)},t.prototype.guid=function(){for(var e="",t=0;t<32;t++)e+=this.s4();return e},t.prototype.s4=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},t.prototype.capitaliseFirstLetter=function(e){return e.length>0?e[0].toUpperCase()+e.slice(1).toLowerCase():""},t.prototype.fromObject=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=e.shift(),i=0;r&&i<e.length;i+=1)r=r[e[i]];return r},t.prototype.momentRoundMinutes=function(e,t){var r=(e=l.default(e).startOf("minutes")).minutes()%t;return 0!==r&&(r=t-r),e.add(r,"minute")},t.prototype.round=function(e,t){return l.default(Math.ceil(+e/+t)*+t)},t.prototype.icsFold=function(e){return e.split(/\r\n/g).map((function(e){var t="";for(e=e.trim();e.length>72;)t+=e.slice(0,72)+"\r\n",e=" "+e.slice(72).trim();return e.trim()&&(t+=e),t})).join("\r\n")},t.prototype.splitAddressLine=function(e,t){var r={line:e.replace(/\s+/g," ").trim(),residue:""};if(r.line.length>t){var i=r.line.slice(0,t).lastIndexOf(",");i>0?(r.residue=r.line.slice(i+1).trim(),r.line=r.line.slice(0,i).trim()):(i=r.line.slice(0,t).lastIndexOf(" "))>0?(r.residue=r.line.slice(i+1).trim(),r.line=r.line.slice(0,i)):(r.residue=r.line.slice(t),r.line=r.line.slice(0,t))}return r},t.prototype.daysBetween=function(e,t){return t.diff(e,"days")},t.prototype.mapPromise=function(e,t,r){for(var i=e[Symbol.iterator](),a=[],n=[],o=0,s=function(){var e=i.next();if(!e.done){var r=o++;return Promise.resolve(t(e.value,r)).then((function(e){return a[r]=e,s()}))}};!r||n.length<=r;){var l=s();if(!l)break;n.push(l)}return Promise.all(n).then((function(){return a}))},t.prototype.mapSeriesPromise=function(e,t){return this.mapPromise(e,t,1)},t.prototype.obj2queryString=function(e){return s.default.reduce(e,(function(e,t,r){return""!==e&&(e+="&"),""+e+encodeURIComponent(r)+"="+encodeURIComponent(t)}),"")},t.prototype.stripPunctuation=function(e){return e.replace(/[^a-zA-Z0-9\s]/g,"")},t.prototype.replaceAll=function(e,t,r){return e?e.replace(new RegExp(t,"g"),r):null},t.prototype.dateTime=function(e,t){var r=e.match(/.{1,2}/g),i=t.match(/.{1,2}/g);return"20"+r[0]+"-"+r[1]+"-"+r[2]+"T"+i[0]+":"+i[1]+":00"},t.prototype.alternateJSONStringify=function(e){var t=JSON.stringify(e);return t=t.replace(/"/g,"`")},t.prototype.ConvertObjectToArray=function(e){var t=s.default.values(e);return t=s.default.flatten(t)},t.prototype.addDay=function(e){var t=new Date(e.year,e.month-1,e.day+1);return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}},t.prototype.hashCode=function(e){for(var t=0,r=0;r<e.length;r+=1){t=(t<<5)-t+e.charCodeAt(r),t&=t}return t.toString()},t.prototype.MMddyyToNgb=function(e){return this.momentToNgDate(l.default(e,t.MMDDYY_DATE))},t.prototype.selectedChildrenTravellers=function(e,t){switch(t){case ne.Hotel:case ne.Cab:return[]}return e.filter((function(e){return e.isChild}))},t.prototype.selectedTravellers=function(e,t){switch(t){case ne.Hotel:case ne.Cab:return{adults:e,children:[],infants:[]};default:return e.reduce((function(e,t){return t.isChild?t.isInfant?e.infants.push(t):e.children.push(t):e.adults.push(t),e}),{adults:[],children:[],infants:[]})}},t.prototype.selectedAdultTravellers=function(e,t){switch(t){case ne.Hotel:case ne.Cab:return e}return e.filter((function(e){return!e.isChild&&!e.isInfant}))},t.prototype._isChild=function(e,r){return e instanceof Date?l.default().add(-r,"years").isBefore(l.default(e,t.ISO_DATA_FORMAT),"day"):e.isChild},t.prototype.isChildFlight=function(e){return this._isChild(e,16)},t.prototype.isChildRail=function(e){return this._isChild(e,12)},t.prototype.isChildEurostar=function(e){return this._isChild(e,12)},t.prototype.uniqBy=function(e,t){return s.default.uniqBy(e,t)},t.prototype.isChild=function(e,t){switch(t){case ne.Flight:return this._isChild(e,16);case ne.Rail:return this._isChild(e,12);case ne.Coach:return this._isChild(e,15);case ne.Lounge:return this._isChild(e,12);case ne.Hotel:case ne.Cab:default:return!1}},t.prototype.isInfant=function(e,t){switch(t){case ne.Flight:case ne.Rail:case ne.Coach:case ne.Lounge:return this._isChild(e,0);case ne.Hotel:case ne.Cab:default:return!1}},t.prototype.getAgeType=function(e,t){return this.isChild(e,t)?"C":"A"},t.prototype.getMaxChildAge=function(e){switch(e){case ne.Flight:return l.default().add(-15,"years").format(t.MMDDYY_DATE);case ne.Rail:return l.default().add(-11,"years").format(t.MMDDYY_DATE);case ne.Coach:return l.default().add(-14,"years").format(t.MMDDYY_DATE);case ne.Lounge:return l.default().add(-11,"years").format(t.MMDDYY_DATE)}},t.prototype.getDefaultAdultAge=function(e){switch(e){case ne.Flight:return l.default().add(-26,"years").format(t.MMDDYY_DATE);case ne.Rail:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case ne.Coach:return l.default().add(-25,"years").format(t.MMDDYY_DATE);case ne.Lounge:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case ne.Hotel:case ne.Cab:return l.default().add(-18,"years").format(t.MMDDYY_DATE)}return l.default().add(-18,"years").format(t.MMDDYY_DATE)},t.prototype.transform=function(e,t,r){return s.default.transform(e,t,r)},t.prototype.arrayToObject=function(e,t){return e.filter((function(e){return!!e})).reduce((function(e,r){return r&&r[t]&&(e[r[t]]=r),e}),{})},t.prototype.setFieldInObject=function(e,t,r){if(0===t.length)throw new Error("Invalid field");if(e||(e={}),1===t.length)e[t[0]]=e[t[0]]||[],e[t[0]].push(r);else{var i=t[0];e[i]=this.setFieldInObject(e[i],t.slice(1),r)}return e},t.prototype.arrayToObjectArray=function(e,t){var r=this;return e.filter((function(e){return!!e})).reduce((function(e,i){var a=t.reduce((function(e,t){var a=Array.isArray(t)?t.map((function(e){return r.fieldFromObject(i,e)})).join("_"):r.fieldFromObject(i,t);return e&&a?(e.push(a),e):null}),[]);if(i&&a)return r.setFieldInObject(e,a,i)}),{})},t.prototype.getTerminals=function(e){return e.terminals},t.prototype.fieldFromObject=function(e,t){return(Array.isArray(t)?t:(t||"").split(".")).reduce((function(e,t){return e&&e[t]?e[t]:null}),e)},t.prototype.mapFieldFromObject=function(e){return function(t){return t[e]}},t.prototype.removeNulls=function(e){var t=this;return e?l.default.isMoment(e)?e:Array.isArray(e)?e.map((function(e){return t.removeNulls(e)})).filter((function(e){return!!e}))||null:"object"==typeof e?Object.keys(e).reduce((function(r,i){if("_"!==i[0]){var a=e[i],n=t.removeNulls(a);(null!=n&&"null"!==n||Array.isArray(n)&&n.length>0)&&(r[i]=n)}return r}),{}):e:e},t.prototype.getTravellersId=function(e){if(e)return e.reduce((function(e,t,r){return 0===r?[t.id]:C(e,[t.id])}),[])},t.prototype.sanitizeMomentDates=function(e,t){var r,i;void 0===t&&(t=!1);var a=Object.assign({},e);try{for(var n=g(Object.entries(a)),o=n.next();!o.done;o=n.next()){var s=S(o.value,2),u=s[0],c=s[1];l.default.isMoment(c)&&(a[u]=a[u].toISOString())}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return t&&(console.log("-- sanitizeMomentDates() called --"),console.log("original query: ",e),console.log("sanitized query: ",a)),a},t.prototype.toStrings=function(e,t){var r=this;return Object.entries(t.properties||{}).reduce((function(i,a){var n=S(a,2),o=n[0],s=n[1],l=r._formatValue(e[o],s,(t.required||[]).includes(o));return null!==l&&(i[o]=l),i}),{})},t.prototype._formatValue=function(e,t,r){switch(t.type){case"integer":var i=Number.parseInt(e,10);return Number.isNaN(i)?r?0:null:i;case"string":if(("date-time"===t.format||"date"===t.format)&&e.year)return this.formatIsoDate(this.ngDateToMoment(e));var a=e?e.toString():null;return a&&a.length>0?a:r?"":null;case"object":return e?this.toStrings(e,t):r?{}:null;case"array":return e;case"date":case"date-time":if(e.year)return this.formatIsoDate(this.ngDateToMoment(e));break;case"passport":return e?this.toStrings(e,t):r?{}:null;default:return console.warn("+++ unknown schema type "+t.type+" | returning value as is +++"),e}},t.prototype.makeTimeWindow=function(e,t,r){var i=e.clone().add(t,"hour"),a=e.clone().add(r,"hour");return this.formatTime(i)+"-"+this.formatTime(a)},t.prototype.inRange=function(e,t){return e>=t.min&&e<=t.max},t.prototype.makeUsers=function(t){return t.map((function(t){return{id:t.id,passengerType:t.isChild?e.ɵf.Child:t.isInfant?e.ɵf.Infant:e.ɵf.Adult}}))},t.prototype.makeMomentDayTime=function(e,t,r){var i=l.default();return void 0!==e&&i.add(e,"day"),void 0!==t&&i.set("hours",t),void 0!==r&&i.set("minutes",r),i},t.prototype.sanatizeReturns=function(e,t,r){var i=Object.assign({},e,t);return(r||[]).reduce((function(e,t){var r=e[t];return e[t]=r?"string"==typeof r?l.default(r):r:l.default(),e}),i)},t.prototype.miIsValid=function(e){return 0===e.length||!!e.find((function(e){return e.isValid()}))},t.prototype.isMiValid=function(e,t,r){var i=this,a=Object.values(t||{}),n=Object.values(r||{});return this.miIsValid(e)&&(0===a.length||!!a.find((function(e){return i.miIsValid(e.managementInfo)})))&&(0===n.length||!!n.find((function(e){return i.miIsValid(e.managementInfo)})))},t.prototype.needsMi=function(e,t){var r=this;return e.basketInfoMiDetails.length>0&&(t||!e.basketInfoMiDetails.find((function(e){return r.isMiValid(e.miPerItem,e.miPerUser,e.miPerGuest)})))},t.prototype.findService=function(e,t){return Object.values(e).reduce((function(e,r){return e||r.find((function(e){return e.id===t}))}),null)},t.prototype.allTrue=function(e,t){return e.filter(t).length===e.length},t.prototype.joinFromAttribute=function(e,t,r){return r.map((function(e){return e[t]})).join(e)},t.prototype.splitUpArray=function(e,t,r){void 0===r&&(r=!0);var i=s.default.cloneDeep(e),a=[];if(i.length>t){for(;i.length>=t;)a.push(i.splice(0,t));i.length&&r&&a.push(i)}else a=i;return a},t.prototype.getTimeDifference=function(e,t){return l.default(e).diff(l.default(t),"minutes")},t.prototype.dayDifference=function(e,t){var r=l.default(t).startOf("day").diff(l.default(e).startOf("day"),"day");return r>0?r.toString():""},t.prototype.makeFareRules=function(t,r){var i=r===e.FlightDirectionEnum.Outbound?t.outboundFlights:t.inboundFlights;return{rules:i.reduce((function(e,t){var r,i,a,n,o;return e.cancellation=e.cancellation.concat((null===(r=t.fareConditions)||void 0===r?void 0:r.cancellation)||[]),e.change=e.change.concat((null===(i=t.fareConditions)||void 0===i?void 0:i.change)||[]),e.noShow=e.noShow.concat((null===(a=t.fareConditions)||void 0===a?void 0:a.noShow)||[]),e.upgrade=e.upgrade.concat((null===(n=t.fareConditions)||void 0===n?void 0:n.upgrade)||[]),e.other=e.other.concat((null===(o=t.fareConditions)||void 0===o?void 0:o.other)||[]),e}),{cancellation:[],change:[],noShow:[],upgrade:[],other:[]}),flights:i}},t.prototype.generateIcsFileContents=function(e){return["BEGIN:VCALENDAR\r\n","PRODID:-//Micros Travel//SABS Corporate - MMXIII//EN\r\n","VERSION:2.0\r\n","METHOD:REQUEST\r\n",this.generateIcsFileBodyContent(e),"END:VCALENDAR\r\n"].join("")},t.prototype.generateIcsFileBodyContent=function(e){var t=[];return e.map((function(e,r){var i={dStart:"",dEnd:"",locationFrom:"",locationTo:"",basketId:"",description:"",serviceType:"",summary:""},a="DD MMMM YYYY HH:mm",n=e.service.type,o=e.adults,s=e.children,u=e.bookingThirdPartyReference,c=e.detail,d=e.service;switch(n){case ne.Lounge:i.basketId=e.id,i.dStart=null==c?void 0:c.arrivalDatetime,i.dEnd="",i.summary="Airport Lounge - "+c.name,i.serviceType=d.type.toLowerCase(),i.description=["Lounge: "+c.name+"\r\n","Starts: "+l.default(c.arrivalDatetime).format(a)+"\r\n","Adults: "+o+"\r\n","Children: "+s+"\r\n","Booking Ref: "+u].join("");break;case ne.Cab:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.departs,i.dEnd="",i.summary="Taxi booking - from "+c.fromLocation.address+" to "+c.toLocation.address,i.description=["Pickup Point: "+c.fromLocation.address+"\r\n","Time: "+l.default(c.departs).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.Car:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.pickUpDatetime,i.dEnd=null==c?void 0:c.dropOffDatetime,i.summary="Car booking - from "+c.pickUpLocation.address+" to "+c.dropOffLocation.address,i.description=["Pickup Point: "+c.pickUpLocation.address+"\r\n","Time: "+l.default(c.pickUpDatetime).format(a)+"\r\n","Arrival Point: "+c.dropOffLocation.address+"\r\n","Booking Ref: "+u].join(""),i.locationFrom=c.pickUpLocation.address,i.locationTo=c.dropOffLocation.address;break;case ne.Coach:case ne.FastTrack:case ne.Flight:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.outboundFlights[0].dateTimeDeparting,i.dEnd=null==c?void 0:c.outboundFlights[0].dateTimeArriving,i.summary="Flight Booking - From "+c.outboundFlights[0].originAirport+" to "+c.outboundFlights[0].destinationAirport,i.description=["From: "+c.outboundFlights[0].originAirport+"\r\n","Depart: "+l.default(c.outboundFlights[0].dateTimeDeparting).format(a)+"\r\n","To: "+c.outboundFlights[0].destinationAirport+"\r\n","Arrive: "+l.default(c.outboundFlights[0].dateTimeArriving).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.Hotel:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.checkIn,i.dEnd=null==c?void 0:c.checkOut,i.summary="Hotel booking - "+c.hotelName,i.description=["Hotel: "+c.hotelName+"\r\n","Arrival: "+l.default(c.checkIn).format(a)+"\r\n","Departure: "+l.default(c.checkOut).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.InternationalRail:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.outwardDetail.departureDateTime,i.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,i.locationFrom=c.outwardDetail.departureStationName,i.locationTo=c.outwardDetail.arrivalDateTime,i.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,i.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(a)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(a)+"\r\n","Booking Ref: "+u].join("");break;case ne.Parking:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.arrivalDatetime,i.dEnd=null==c?void 0:c.departDatetime,i.summary="Airport parking - "+c.name,i.description=["Airport Parking: "+c.name+"\r\n","Booking Ref: "+u].join("");break;case ne.Rail:i.basketId=e.id,i.serviceType=d.type.toLowerCase(),i.dStart=null==c?void 0:c.outwardDetail.departureDateTime,i.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,i.locationFrom=c.outwardDetail.departureStationName,i.locationTo=c.outwardDetail.arrivalDateTime,i.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,i.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(a)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(a)+"\r\n","Booking Ref: "+u].join("")}t.push(["BEGIN:VEVENT\r\n",i.dStart?"DTSTART:"+l.default(i.dStart).format("YYYYMMDDTHHmmss")+"\r\n":"",i.dEnd?"DTEND:"+l.default(i.dEnd).format("YYYYMMDDTHHmmss")+"\r\n":"",'ORGANIZER;CN="Do not reply to this email":mailto:do_not_reply@sabscorp.com\r\n',i.locationTo&&i.locationFrom?"LOCATION: "+i.locationTo+" to "+i.locationFrom+" \r\n":"","TRANSP:OPAQUE\r\n","SEQUENCE:0\r\n","UID:"+i.serviceType+"_"+r+"_"+i.basketId+"@sabscorp.com\r\n","DTSTAMP:"+l.default().format("YYYYMMDDTHHmmss")+"\r\n","DESCRIPTION:"+i.description+"\r\n","SUMMARY:"+i.summary+"\r\n","END:VEVENT\r\n"].join(""))})),t.join("")},t.prototype.downloadIcs=function(e,t){var r=document.createElement("a");r.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),r.setAttribute("download",e),r.setAttribute("target","_blank"),r.style.display="none",r.click()},t.prototype.splitStringOnCapitals=function(e,t){void 0===t&&(t=!1);var r=e.split(/(?=[A-Z])/);return t?r.join(" "):r},t.prototype.createFlightFilters=function(e,t){return e.reduce((function(e,t){var r=t.outboundFlights.length-1;e.stops[r]=e.stops[r]||{display:0===r?"Direct":r+" stop"+(1!==r?"s":""),selected:!1,value:r+1};var i=t.inboundFlights?t.inboundFlights.length-1:0,a=i>r?i:r;e.totalStops[a]=e.totalStops[a]||{display:0===a?"Direct":a+" stop"+(1!==a?"s":""),selected:!1,value:a+1};var n=function(t){e.classes[t.cabinClass]=e.classes[t.cabinClass]||{display:t.cabinClass,selected:!1,value:t.cabinClass},e.airlines[t.marketingCarrier]=e.airlines[t.marketingCarrier]||{display:t.marketingCarrierName,selected:!1,value:t.marketingCarrier}};t.outboundFlights.forEach(n);var o=t.baggageAllowance.map((function(e){return e.qty})),s=o.length?Math.min.apply(Math,C(o)):0;e.baggage[s]=e.baggage[s]||{selected:!1,display:s+" bag"+(s>1?"s":""),value:s};var u=function(t,r,i,a,n){var o=t&&t[n]?t[n][i]:void 0;void 0!==o&&(e[r][o]=e[r][o]||{value:t[n][i],display:t[n][a],selected:!1})};u(t.outboundFlights,"depatureAirport","originAirport","originAirportName",0),u(t.outboundFlights,"arrivalAirport","destinationAirport","destinationAirportName",t.outboundFlights.length-1),e.price.min=e.price.min<t.total.price?e.price.min:t.total.price,e.price.max=e.price.max>t.total.price?e.price.max:t.total.price,e.duration.min=e.duration.min<t.outboundTotalDuration?e.duration.min:t.outboundTotalDuration,e.duration.max=e.duration.max>t.outboundTotalDuration?e.duration.max:t.outboundTotalDuration;var c=l.default(t.outboundFlights[0].dateTimeDeparting).get("hour");e.departureTime.min=e.departureTime.min<c?e.departureTime.min:c,e.departureTime.max=e.departureTime.max>c?e.departureTime.max:c;var d=l.default(t.outboundFlights[t.outboundFlights.length-1].dateTimeArriving).get("hour");if(e.arrivalTime.min=e.arrivalTime.min<d?e.arrivalTime.min:d,e.arrivalTime.max=e.arrivalTime.max>d?e.arrivalTime.max:d,t.inboundFlights&&t.inboundFlights.length>0){e.returnDuration.min=e.returnDuration.min<t.inboundTotalDuration?e.returnDuration.min:t.inboundTotalDuration,e.returnDuration.max=e.returnDuration.max>t.inboundTotalDuration?e.returnDuration.max:t.inboundTotalDuration;var h=t&&t.inboundFlights&&t.inboundFlights[0]?l.default(t.inboundFlights[0].dateTimeDeparting).get("hour"):-1;e.returnDepartureTime.min=e.returnDepartureTime.min<h?e.returnDepartureTime.min:h,e.returnDepartureTime.max=e.returnDepartureTime.max>h?e.returnDepartureTime.max:h;var p=l.default(t.outboundFlights[t.outboundFlights.length-1].dateTimeArriving).get("hour");e.returnArrivalTime.min=e.returnArrivalTime.min<p?e.returnArrivalTime.min:p,e.returnArrivalTime.max=e.returnArrivalTime.max>p?e.returnArrivalTime.max:p,(t.inboundFlights||[]).forEach(n),u(t.inboundFlights,"depatureReturnAirport","originAirport","originAirportName",0),u(t.inboundFlights,"arrivalReturnAirport","destinationAirport","destinationAirportName",t.inboundFlights.length-1)}return e}),this.clone(t))},t.prototype.mapOverObject=function(e,t){return Object.entries(e).reduce((function(e,r){return e[r[0]]=t(r[1],r[0]),e}),{})},t.prototype.normaliseMinuteToBase10=function(e){return Math.round(100*e/60)},t.prototype.OBTFlightCabinClassToFlightCabinClass=function(t){var r;return((r={})[e.OBTFlightCabinClass.Business]=H.Business,r[e.OBTFlightCabinClass.BusinessBranded]=H.Business,r[e.OBTFlightCabinClass.EconomyFlexi]=H.EconomyFlexi,r[e.OBTFlightCabinClass.EconomyFlexiBranded]=H.EconomyFlexi,r[e.OBTFlightCabinClass.EconomyNoBags]=H.EconomyNoBags,r[e.OBTFlightCabinClass.EconomyNoBagsBranded]=H.EconomyNoBags,r[e.OBTFlightCabinClass.EconomyRestricted]=H.EconomyRestricted,r[e.OBTFlightCabinClass.EconomyRestrictedBranded]=H.EconomyRestricted,r[e.OBTFlightCabinClass.First]=H.First,r[e.OBTFlightCabinClass.FirstBranded]=H.First,r[e.OBTFlightCabinClass.PremiumEconomy]=H.PremiumEconomy,r[e.OBTFlightCabinClass.PremiumEconomyBranded]=H.PremiumEconomy,r)[t]},t.prototype.FlightCabinClassToBrandedOBTFlightCabinClass=function(t,r){var i,a;return(r?((i={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,i[H.PremiumBusiness]=e.OBTFlightCabinClass.BusinessBranded,i[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,i[H.Economy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,i[H.PremiumFirst]=e.OBTFlightCabinClass.FirstBranded,i[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestrictedBranded,i[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,i[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexiBranded,i[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBagsBranded,i[H.Business]=e.OBTFlightCabinClass.BusinessBranded,i[H.First]=e.OBTFlightCabinClass.FirstBranded,i):((a={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,a[H.PremiumBusiness]=e.OBTFlightCabinClass.Business,a[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestricted,a[H.Economy]=e.OBTFlightCabinClass.EconomyRestricted,a[H.PremiumFirst]=e.OBTFlightCabinClass.First,a[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestricted,a[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,a[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexi,a[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBags,a[H.Business]=e.OBTFlightCabinClass.Business,a[H.First]=e.OBTFlightCabinClass.First,a))[t]},t.prototype.convertMetresToMiles=function(e,t){void 0===t&&(t=-1);var r=e/1609;return t>=0?Number(r.toFixed(t)):r},t.prototype.convertSecondsToHours=function(e,t){void 0===t&&(t=-1);var r=e/60/60;return t>=0?Number(r.toFixed(t)):r},t.prototype.convertSecondsToMins=function(e,t){void 0===t&&(t=-1);var r=e/60;return t>=0?Number(r.toFixed(t)):r},t.prototype.addRailActionRules=function(e,t){return t.reduce((function(e,t){return et(null==t?void 0:t.unavailable)&&(e.unavailable=t.unavailable,e.unavailableMessage=t.unavailableMessage),et(null==t?void 0:t.requiresReason)&&(e.requiresReason=t.requiresReason,e.requiresReasonMessage=t.requiresReasonMessage),e}),e)},t.prototype.map=function(e,t){return Object.assign.apply(Object,C([{}],Object.entries(e).map((function(e){var r,i=S(e,2),a=i[0],n=i[1];return(r={})[a]=t(n),r}))))},t.prototype.mergeObjects=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return s.default.merge(e,t)}),{})},t.prototype.interceptMethodCalls=function(e,t){return new Proxy(e,{get:function(e,r){return"function"==typeof e[r]?new Proxy(e[r],{apply:function(e,i,a){return t(r,a),Reflect.apply(e,i,a)}}):Reflect.get(e,r)}})},t.prototype.getRoundedDownQuarterHour=function(e){var t=e.minutes();return t<=15?e.set("minutes",0):t<=30?e.set("minutes",15):t<=45?e.set("minutes",30):e.set("minutes",45),e},t.prototype.getRoundedUpQuarterHour=function(e){var t=e.minutes();return t<=15?e.set("minutes",15):t<=30?e.set("minutes",30):t<=45?e.set("minutes",45):(e.set("minutes",0),e.add(1,"hour")),e},t}();function et(e){return null!=e}$e.READ_DATE_FORMAT="dd, D MMM YYYY",$e.READ_TIME_FORMAT="HH:mm",$e.DATE_FORMAT="YYMMDD",$e.GRAPHQL_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm:ss",$e.ISO_DATA_FORMAT="YYYY-MM-DD",$e.ISO_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm",$e.ISO_DATA_FORMAT_NO_HYPHANS="YYYYMMDD",$e.TIME_FORMAT="HHmm",$e.TIME_FORMAT_COLON="HH:mm",$e.MMDDYY_DATE="DDMMYYYY",f([Ke(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",Number)],$e.prototype,"getTimeDifference",null),f([Ke(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",String)],$e.prototype,"dayDifference",null),f([Ke(),v("design:type",Function),v("design:paramtypes",[Object,Number]),v("design:returntype",void 0)],$e.prototype,"makeFareRules",null),(qe=e.TaxiFormMode||(e.TaxiFormMode={})).ADDRESS="location",qe.STATION="station",(Xe=e.AirportSearchMode||(e.AirportSearchMode={})).PICKUP="Airport Pick Up",Xe.DROPOFF="Airport drop off",(Ze=e.ActionType||(e.ActionType={})).GET="get",Ze.SAVE="save",Ze.DELETE="delete";var tt,rt=function(r){function i(a,n,o,s,u,c){var d=r.call(this,o,n,s,c)||this;d.cabfetcher=a,d.basketService=u,d.type=ne.Cab,d.travellers=[],d.airportChange=new t.Subject,d.transTypes=[{key:_.Any,value:"Any (1-8 Passengers)",id:8},{key:_.StandardCar,value:"Saloon Car (1-4 Passengers)",id:4},{key:_.BlackCab,value:"Hackney Carriage (1-4 Passengers)",id:4},{key:_.DdaCar,value:"Dda - wheelchair accessible (1-4 Passengers)",id:4},{key:_.MediumMpv,value:"People Carrier (1-7 Passengers)",id:7},{key:_.ExecutiveCar,value:"Executive (1-4 Passengers)",id:4}],d.attributes=[{enabled:!1,key:"wheelchair",value:"Wheelchair (On Request)"},{enabled:!1,key:"call_on_arrival",value:"Call On Arrival"},{enabled:!1,key:"meet_and_greet",value:"Meet And Greet (Charge Applies)"},{enabled:!1,key:"wait_and_return",value:"Wait And Return"}],d.searchTypes=["One-way","Return"],d.airportSearchTypes=["Airport drop off","Airport Pick Up"],d.criteria=["Pick Up Time"],d.mode=e.TaxiFormMode.ADDRESS,d.minSelectDate=l.default(),d.minReturnSelectDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},d._date=null,d.selectedPlaces=[],d._vias=[null,null,null,null],d._searchType=d.searchTypes[0],d._airportSearchType=e.AirportSearchMode.DROPOFF,d._searchCriteria=d.criteria[0],d._outboundDateTime=d.helpers.round(l.default(),l.default.duration(15,"minutes")),d._returnDateTime=d.helpers.round(l.default(),l.default.duration(15,"minutes")),d._flightNumber="",d._returnFlightNumber="",d._terminal=null,d._time=null,d.resultsSessionName=i.STORAGE_SESSION_RESULTS,d.multiResultsSessionName=i.MULTI_STORAGE_SESSION_RESULTS,d.getPassengers=function(){var e=d.adults,t=d.children,r=e+" Adult";return 1!==Number(e)&&(r+="s"),1===Number(t)&&(r+=", "+t+" Child"),Number(t)>1&&(r+=", "+t+" Children"),r};var h=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};d.updateTempParams(s.makeCabHireQuery(h.tempParams));try{var p=o.getSessionItem(i.SECONDARY_STORAGE_SESSION_PARAMS);p&&(d.returnDateTime=l.default(p.tempParams.departs),d.searchType=d.searchTypes[1])}catch(e){console.error("+++ Error recovering return data: ",e," +++")}h.tempParams.fromAddress&&(d.fromAddress=h.tempParams.fromAddress),h.tempParams.toAddress&&(d.toAddress=h.tempParams.toAddress),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){d.travellers=e;var t=d.helpers.selectedTravellers(e,ne.Cab);d.tempParams.adults=t.adults.length,d.tempParams.children=t.children.length,d._isValid()}));var m=o.getSessionItemAsList(d.resultsSessionName)||[];d.fullResults=m,d._cheapestResultPrice=d.updateLowestPrice(m),d.results.next(m||[]);var f=o.getSessionItemAsList(d.multiResultsSessionName)||[];return d.fullMultiResults=f,d.multiResults.next(f),d._isValid(),d.outboundVisibility=new t.BehaviorSubject(!1),d.inboundVisibility=new t.BehaviorSubject(!1),d}return m(i,r),Object.defineProperty(i.prototype,"fromLocation",{get:function(){return this._fromLocation},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toLocation",{get:function(){return this._toLocation},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"searchType",{get:function(){return this._searchType},set:function(e){this._searchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"airportSearchType",{get:function(){return this._airportSearchType},set:function(e){this._airportSearchType=e,(this.fromAddress||this.toAddress)&&this.switchFromAndToLocation()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fromLocationType",{get:function(){return this.tempParams.fromLocationType},set:function(e){this.tempParams.fromLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toLocationType",{get:function(){return this.tempParams.toLocationType},set:function(e){this.tempParams.toLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"searchCriteria",{get:function(){return this._searchCriteria},set:function(e){this._searchCriteria=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outboundDateTime",{get:function(){return this._outboundDateTime},set:function(e){this._outboundDateTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnDateTime",{get:function(){return this._returnDateTime},set:function(e){this._returnDateTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnFlightNumber",{get:function(){return this._returnFlightNumber},set:function(e){this._returnFlightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"airport",{get:function(){return this.tempParams.airport},set:function(e){this.tempParams.airport=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this._terminal},set:function(e){this._terminal=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"departs",{get:function(){return this.tempParams.departs},set:function(e){this.tempParams.departs=e.isValid?e:null,e&&e.isValid()&&(this._date=this.helpers.momentToNgDate(e),this._time=this.helpers.formatTimeColon(e)),this.minReturnSelectDate={day:l.default(e).date(),month:l.default(e).month()+1,year:l.default(e).year()},e.isAfter(this.returnDateTime)&&this.returnDateTime.set("date",e.date()),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"countryCode",{get:function(){return this.tempParams.countryCode},set:function(e){this.tempParams.countryCode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"vias",{get:function(){return this._vias},set:function(e){this._vias=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viasFrom",{get:function(){return this.tempParams.viasFrom},set:function(e){this.tempParams.viasFrom=e,this._vias[0]=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viasTo",{get:function(){return this.tempParams.viasTo},set:function(e){this.tempParams.viasTo=e,this._vias[1]=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"vehicleType",{get:function(){return this.tempParams.vehicleType},set:function(e){this.tempParams.vehicleType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fromAddress",{get:function(){return this.tempParams.fromAddress},set:function(e){this.tempParams.fromAddress=e,this._fromLocation=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fromStation",{get:function(){return this.tempParams.fromStation},set:function(e){this.tempParams.fromStation=e,this._fromLocation=e?{address:e.destination,postcode:e.postcode}:null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toAddress",{get:function(){return this.tempParams.toAddress},set:function(e){this.tempParams.toAddress=e,this._toLocation=e?this.createCabHireLocation(e):null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"toStation",{get:function(){return this.tempParams.toStation},set:function(e){this.tempParams.toStation=e,this._toLocation=e?{address:e.destination,postcode:e.postcode}:null,this._isValid()},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCabHireQuery());try{this.storageService.removeSessionItem(i.SECONDARY_STORAGE_SESSION_PARAMS)}catch(e){}this._searchType=this.searchTypes[0],this._isValid()},i.prototype.resetParams=function(){this.reset(),this.resetQuery(),this.results.next([]),this.multiResults.next([])},i.prototype._isValid=function(){var e=this;this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams}),this.validationMessages=[],this.tempParams.fromAddress||this.validationMessages.push("From - Enter a location or postcode."),this.tempParams.toAddress||this.validationMessages.push("To - Enter a location or postcode."),this.tempParams.departs.unix()<l.default().unix()&&this.validationMessages.push("Taxi journey cannot be in the past."),this.tempParams.adults+this.tempParams.children<1&&this.validationMessages.push("There must be at least 1 traveller"),this.searchType===this.searchTypes[1]&&this.returnDateTime.isSameOrBefore(this.departs)&&this.validationMessages.push("Return Date/Time must be after outbound date/time"),this.travellers.length>4&&this.transTypes.find((function(t){return t.key===e.tempParams.vehicleType})).id<this.travellers.length&&this.validationMessages.push("The number of passengers exceeds the available vehicle capacity for the "+this.tempParams.vehicleType+" taxi"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype._updateDateTime=function(){this._date&&this._time&&(this.departs=this.helpers.ngDateToMoment(this._date,this._time))},i.prototype.startSearch=function(){if(this.results.next([]),this.multiResults.next([]),this.isValid.value){if(this.searchType===this.searchTypes[1]){var e=this.getSearchQuery(),t=this.getReturnSearchQuery();return console.log("+++ Search Query: ",e," +++"),console.log("+++ Search Return Query: ",t," +++"),this.storageService.setSessionItem(i.SECONDARY_STORAGE_SESSION_PARAMS,{tempParams:t}),this._startMultiSearch([this.cabfetcher.fetchList(this.helpers.removeNulls(e)),this.cabfetcher.fetchList(this.helpers.removeNulls(t))])}e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(this.getSearchQuery())),this._startSearch(this.cabfetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Cab,searchArgs:t,travelDate:this.departs.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(e){var t=e;return t.fromAddress=this.tempParams.fromAddress,t.toAddress=this.tempParams.toAddress,t.fromStation=this.tempParams.fromStation,t.toStation=this.tempParams.toStation,t.viasFrom=this.viasFrom,t.viasTo=this.viasTo,t},i.prototype.startRecentSearch=function(e){this.departs=l.default(e.searchArgs.departs),this.vehicleType=e.searchArgs.vehicleType,this.fromAddress=e.searchArgs.fromAddress,this.toAddress=e.searchArgs.toAddress,this.fromStation=e.searchArgs.fromStation,this.toStation=e.searchArgs.toStation,this._fromLocation=this.createCabHireLocation(this.fromAddress),this._toLocation=this.createCabHireLocation(this.toAddress),this.viasFrom=e.searchArgs.viasFrom,this.viasTo=e.searchArgs.viasTo,this.searchService.startSearches()},i.prototype.getSearchQuery=function(e){void 0===e&&(e=!0);var t={adults:this.tempParams.adults,children:this.tempParams.children,departs:this.tempParams.departs,fromLocation:e?this.createCabHireLocation(this.tempParams.fromAddress):this.tempParams.fromAddress,toLocation:e?this.createCabHireLocation(this.tempParams.toAddress):this.tempParams.toAddress,infants:0,vehicleType:this.vehicleType,vias:this._vias};return this.helpers.removeNulls(t)},i.prototype.getReturnSearchQuery=function(){var e={adults:this.tempParams.adults,children:this.tempParams.children,departs:this._returnDateTime,fromLocation:this.createCabHireLocation(this.tempParams.toAddress),toLocation:this.createCabHireLocation(this.tempParams.fromAddress),infants:0,vehicleType:this.vehicleType,vias:this._vias};return this.helpers.removeNulls(e)},i.prototype.updateOutboundAddress=function(e,t){this.tempParams.fromAddress=this.getAddressFormat(e,t)},i.prototype.updateInboundAddress=function(e,t){this.tempParams.toAddress=this.getAddressFormat(e,t)},i.prototype.createCabHireLocation=function(e){return{address:[null==e?void 0:e.Terminal,null==e?void 0:e.House,null==e?void 0:e.Street,null==e?void 0:e.Town,null==e?void 0:e.Country].filter((function(e){return!!e})).join(","),postcode:null==e?void 0:e.PostCode}},i.prototype.matchAddresses=function(){this._toLocation=this.createCabHireLocation(this.tempParams.toAddress),this._fromLocation=this.createCabHireLocation(this.tempParams.fromAddress),this._isValid()},i.prototype.sortBy=function(e,t){if(t>=0){console.log("here");var r=this.helpers.clone(this.fullMultiResults[t]);r=e?r.sort((function(e,t){return t.price-e.price})):r.sort((function(e,t){return e.price-t.price})),this.fullMultiResults[t]=r,this.multiResults.next(this.fullMultiResults)}else{r=this.helpers.clone(this.fullResults);r=e?r.sort((function(e,t){return t.price-e.price})):null==r?void 0:r.sort((function(e,t){return e.price-t.price})),this.results.next(r)}},i.prototype.getAddressFormat=function(e,t){return{House:this.getAddressFromPlaceDetails(e,["floor","street_number","premise"]),Street:this.getAddressFromPlaceDetails(e,["route","street_name","establishment"]),Town:this.getAddressFromPlaceDetails(e,["postal_town","administrative_area_level_2","locality"]),PostCode:this.getAddressFromPlaceDetails(e,["postcode"]),Country:this.getAddressFromPlaceDetails(e,["country"]),placeDescription:t}},i.prototype.getAddressFromPlaceDetails=function(e,t){var r,i,a=null;if(e&&Array.isArray(e)){var n=function(t){var r=e.filter((function(e){return Array.isArray(e.types)&&e.types.includes(t)}))[0];if(r)return a=r.long_name,"break"};try{for(var o=g(t),s=o.next();!s.done;s=o.next()){if("break"===n(s.value))break}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}return a},i.prototype.getAddressFromAirportDetails=function(e,t){console.log(e);var r=null;return e&&(r={Country:e.country,Street:e.road,PostCode:e.postcode,Town:e.city,placeDescription:t,House:t}),r},i.prototype.setLocationFromAirport=function(t,r){var i=this.getAddressFromAirportDetails(t,r);this.mode===e.TaxiFormMode.STATION&&(this.airportSearchType===e.AirportSearchMode.PICKUP?this.fromAddress=i:this.toAddress=i)},i.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},i.prototype.setOutboundFormVisibility=function(e){this.outboundVisibility.next(e)},i.prototype.setInboundFormVisibility=function(e){this.inboundVisibility.next(e)},i.prototype.getOutboundFormVisibility=function(){return this.outboundVisibility},i.prototype.getInboundFormVisibility=function(){return this.inboundVisibility},i.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n,o,s,l,u=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,c=null===(r=e[ne.Rail])||void 0===r?void 0:r.searchQuery,d=null===(i=e[ne.InternationalRail])||void 0===i?void 0:i.searchQuery,h=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,p=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery,m=null===(o=e[ne.Lounge])||void 0===o?void 0:o.searchQuery,f=null===(s=e[ne.Parking])||void 0===s?void 0:s.searchQuery,v=null===(l=e[ne.Eurostar])||void 0===l?void 0:l.searchQuery;if(u)try{if(e.FLIGHT.inboundDate){var y=e.FLIGHT.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.FLIGHT.outboundDate){y=e.FLIGHT.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from flight item")}else if(c)try{if(e.RAIL.inboundDate){y=e.RAIL.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.RAIL.outboundDate){y=e.RAIL.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from rail item")}else if(d)try{if(e.INTERNATIONAL_RAIL.inboundDate){y=e.INTERNATIONAL_RAIL.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.INTERNATIONAL_RAIL.outboundDate){y=e.INTERNATIONAL_RAIL.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from international rail item")}else if(h)try{if(e.HOTEL.inboundDate){y=e.HOTEL.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.HOTEL.outboundDate){y=e.HOTEL.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from hotel item")}else if(p)try{if(e.CAR.inboundDate){y=e.CAR.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.CAR.outboundDate){y=e.CAR.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from car item")}else if(m)try{if(e.LOUNGE.inboundDate){y=e.LOUNGE.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.LOUNGE.outboundDate){y=e.LOUNGE.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from lounge item")}else if(f)try{if(e.PARKING.inboundDate){y=e.PARKING.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.PARKING.outboundDate){y=e.PARKING.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from parking item")}else if(v)try{if(e.EUROSTAR.inboundDate){y=e.EUROSTAR.inboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}else if(e.EUROSTAR.outboundDate){y=e.EUROSTAR.outboundDate.split("-");this.date=this.helpers.yyyymmddTimeToNgDate(""+y[0]+y[1]+y[2].substring(0,2),"")}}catch(e){console.error("Error trying to prepopulate cabhire from eurostar item")}},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t,r,i,a,n=this,o=e.searchQuery;if(o&&(this.departs=l.default(o.departs),this.vehicleType=o.vehicleType,this.fromAddress=this.convertAddressLocation(o.fromLocation.address,o.fromLocation.postcode),this.toAddress=this.convertAddressLocation(o.toLocation.address,o.toLocation.postcode),o.vias)){var s=o.vias;s[0]&&(this.viasFrom=this.convertAddressLocation(null===(t=s[0])||void 0===t?void 0:t.address,null===(r=s[0])||void 0===r?void 0:r.postcode));var u=o.vias;u[1]&&(this.viasTo=this.convertAddressLocation(null===(i=u[1])||void 0===i?void 0:i.address,null===(a=u[1])||void 0===a?void 0:a.postcode))}e.users&&e.users.forEach((function(e){n.searchService.addTraveller(e)}))},i.prototype.convertAddressLocation=function(e,t){for(var r=e.split(","),i="",a=r[r.length-2],n=1;n<r.length-2;n++)i+=r[n]+" ";return{Country:e.slice(-2),House:r[0],PostCode:t,Street:i,Town:a}},i.prototype.getTransType=function(){var e,t=this.tempParams.vehicleType;return(null===(e=this.transTypes.find((function(e){return e.key===t})))||void 0===e?void 0:e.value)||""},i.prototype.addCabHireToBasket=function(t,r){var i,a,n,o,s,l;return y(this,void 0,void 0,(function(){var u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return u=p.sent(),c=null==u?void 0:u.subject.value,d=this.getTermsAndCond(t),c?[4,this.basketService.addToBasket({adults:r.adults,basket:c.id,service:t.sourceId.toString(),detail:{id:t.id,departs:t.departs,supplierName:t.supplierName,estimatedCO2:t.estimatedCO2,fromLocation:{address:r.fromLocation.address,postcode:r.fromLocation.postcode,latitude:t.fromLocation.latitude,longitude:t.fromLocation.longitude},toLocation:{address:r.toLocation.address,postcode:r.toLocation.postcode,latitude:t.toLocation.latitude,longitude:t.toLocation.longitude},vehicleType:t.vehicleType,tripDistanceMetres:t.tripDistanceMetres,tripDurationSeconds:t.tripDurationSeconds,termsAndCond:d},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,co2PerItem:t.co2PerItem,co2PerPassenger:t.co2PerPassenger,outboundDate:r.departs.format(),lowestPrice:(null===(i=this.cheapestPrice)||void 0===i?void 0:i.amount)!=t.price||(null===(a=this.cheapestPrice)||void 0===a?void 0:a.currencyCode)!=t.currency?null===(n=this.cheapestPrice)||void 0===n?void 0:n.amount:null,lowestPriceCurrency:(null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount)!=t.price||(null===(s=this.cheapestPrice)||void 0===s?void 0:s.currencyCode)!=t.currency?null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode:null},u,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(h=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.switchFromAndToLocation=function(){var e=Object.assign({},this.toAddress),t=Object.assign({},this.fromAddress);this.fromAddress=e,this.toAddress=t},i.prototype.updateLowestPrice=function(e){if(!(null==e?void 0:e.length))return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.getTermsAndCond=function(e){var t=l.default(e.departs).format($e.ISO_DATA_FORMAT_TIME);return[{name:"Lowest Price",value:e.price.toString()+" "+e.currency},{name:"Pickup Time",value:t},{name:"Terms and Conditions",value:'<a target="_blank" href="https://www.cmacgroup.com/">www.cmacgroup.com</a>'}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Cab,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r=this;return b(this,(function(i){return t.fromLocation.Street&&t.toLocation.Street?this.mode=e.TaxiFormMode.ADDRESS:(this.mode=e.TaxiFormMode.STATION,this.airportSearchType=t.fromLocation.Street?e.AirportSearchMode.DROPOFF:e.AirportSearchMode.PICKUP,this.searchService.getAirportsList(t.fromLocation.Street?t.toLocation.House:t.fromLocation.House).subscribe((function(e){r.airport=e[0]}))),this.adults=t.adults,this.children=t.children,this.infants=t.infants,this.fromAddress=t.fromLocation,this.toAddress=t.toLocation,this.vehicleType=t.vehicleType,[2]}))}))},i}(c);rt.STORAGE_SESSION_PARAMS="search_cab",rt.SECONDARY_STORAGE_SESSION_PARAMS="secondary_search_cab",rt.STORAGE_SESSION_RESULTS="results_cab",rt.MULTI_STORAGE_SESSION_RESULTS="multi_results_cab",(tt=e.SortTypesCar||(e.SortTypesCar={})).price="price",tt.brand="brand",tt.size="size",tt.preferred="preferred",tt.expensive="expensive";var it=function(i){function a(t,r,n,o,s,u,c){var d=i.call(this,s,n,u,c)||this;d.carhirefetcher=t,d.carHireAvailabilityDetailFetcher=r,d.basketService=o,d._carTypeCodes=[["B","2-3 Door",O.TwoToThreeDoor],["C","2/4 Door",O.TwoOrFourDoor],["D","4-5 Door",O.FourToFiveDoor],["W","Wagon / Estate",O.WagonOrEstate],["V","Passenger Van",O.PassengerVan],["L","Limousine",O.Limousine],["S","Sport",O.Sport],["T","Convertible",O.Convertible],["F","SUV",O.Suv],["J","Open Air All Terrain",O.OpenAirAllTerrain],["X","Special",O.Special],["P","Pickup Regular Cab",O.PickUpRegularCab],["Q","Pickup Extended Cab",O.PickUpExtendedCab],["Z","Special Offer Car",O.SpecialOfferCar],["E","Coupe",O.Coupe],["M","Monospace (Europe)",O.MonospaceEuropeanUse],["R","Recreational Vehicle",O.Suv],["H","Motor Home",O.MotorHome],["Y","2-Wheel Vehicle",O.TwoWheelVehicle],["N","Roadster",O.Roadster],["G","Crossover",O.Suv],["K","Commercial Van Or Truck",O.CommercialVanOrTruck]],d._carAirConditionTypes=[["Any","Any",null],["Y","Yes",!0],["N","No",!1]],d._withinDistance=[{name:"1 mile",value:"1"},{name:"2 miles",value:"2"},{name:"5 miles",value:"5"},{name:"10 miles",value:"10"},{name:"20 miles",value:"20"}],d._carTransmissionCodes=[["M","Manual",I.Manual],["N","Manual 4-Wheel Drive",I.Manual],["C","Manual All-Wheel Drive",I.Manual],["A","Automatic",I.Auto],["B","Automatic 4-Wheel Drive",I.Auto],["D","Automatic All- Wheel Drive",I.Auto]],d._vendors=[{code:"-",name:"Any"},{code:"AC",name:"Ace Rent A Car"},{code:"AD",name:"Advantage Rent A Car"},{code:"AL",name:"Alamo"},{code:"ZI",name:"Avis"},{code:"AT",name:"Atesa"},{code:"ZD",name:"Budget Rent A Car"},{code:"CI",name:"Citer Rent A Car"},{code:"ZR",name:"Dollar Rent A Car"},{code:"DF",name:"Driving Force"},{code:"EY",name:"Economy Rent A Car"},{code:"ET",name:"Enterprise"},{code:"EP",name:"Europcar"},{code:"IM",name:"Europcar Southafrica"},{code:"EZ",name:"Ez Rent A Car"},{code:"FF",name:"Firefly"},{code:"FX",name:"Fox Rent A Car"},{code:"GN",name:"Guerin Car Rental"},{code:"ZE",name:"Hertz"},{code:"LM",name:"L & M Car Rental"},{code:"LL",name:"Localiza"},{code:"MW",name:"Midway Car Rental"},{code:"ZL",name:"National Car Rental System"},{code:"NC",name:"Nextcar"},{code:"NU",name:"Nu Car Rentals"},{code:"ZA",name:"Payless Car Rental"},{code:"PR",name:"Priceless"},{code:"RW",name:"Rent A Wreck"},{code:"SX",name:"Sixt"},{code:"TE",name:"Tempest"},{code:"XF",name:"Test-S Cross Galileo"},{code:"XG",name:"Test-S Cross Trng"},{code:"ZT",name:"Thrifty Car Rental"},{code:"PM",name:"Travelport Test Code"},{code:"SV",name:"U-Save Auto Rental"},{code:"WF",name:"Woodford"}],d._car_classes=[{code:"M",name:"Mini",key:R.Mini,value:"10"},{code:"N",name:"Mini Elite",key:R.MiniElite,value:"20"},{code:"E",name:"Economy",key:R.Economy,value:"30"},{code:"H",name:"Economy Elite",key:R.EconomyElite,value:"40"},{code:"C",name:"Compact",key:R.Compact,value:"50"},{code:"D",name:"Compact Elite",key:R.CompactElite,value:"60"},{code:"I",name:"Intermediate",key:R.Intermediate,value:"70"},{code:"J",name:"Intermediate Elite",key:R.IntermediateElite,value:"80"},{code:"S",name:"Standard",key:R.Standard,value:"90"},{code:"R",name:"Standard Elite",key:R.StandardElite,value:"100"},{code:"F",name:"Full Size",key:R.Fullsize,value:"110"},{code:"G",name:"Full Size Elite",key:R.FullsizeElite,value:"120"},{code:"P",name:"Premium",key:R.Premium,value:"130"},{code:"U",name:"Premium Elite",key:R.PremiumElite,value:"140"},{code:"L",name:"Luxury",key:R.Luxury,value:"150"},{code:"W",name:"Luxury Elite",key:R.LuxuryElite,value:"160"},{code:"O",name:"Oversize",key:R.Oversize,value:"170"},{code:"X",name:"Special",key:R.Special,value:"180"}],d._location_types=[e.LocationTypes.City,e.LocationTypes.Airport,e.LocationTypes.Postcode],d.carClassMap={mini:0,"mini elite":1,economy:2,"economy elite":3,compact:4,"compact special":5,"compact elite":6,intermediate:7,"intermediate elite":8,standard:9,"standard elite":10,"full size":11,"full size elite":12,premium:13,"premium elite":14,luxury:15,"luxury elite":16,oversize:17,special:18},d.type=ne.Car,d._sorting_options=[{value:0,display:"Cheapest First"},{value:1,display:"Most Expensive First"},{value:2,display:"Preferred First"}],d._minDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},d._minInDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},d._pickup_date=null,d._pickup_time=null,d._dropoff_date=null,d._dropoff_time=null,d.resultsSessionName=a.STORAGE_SESSION_RESULTS,d.multiResultsSessionName=a.STORAGE_SESSION_RESULTS;var h=s.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};d.updateTempParams(u.makeCarHireQuery(h.tempParams)),c.fullUserDetails.userConfigs.subscribe((function(e){var t;console.log(e),e&&(null==e?void 0:e.carhire_defaults)&&d.updateTempParams(u.makeCarHireQuery(null===(t=null==e?void 0:e.carhire_defaults)||void 0===t?void 0:t.config))})),u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(e){d.adults=1,d.children=0,d.travellers=(null==e?void 0:e.slice(0,1))||[],d._isValid()}));var p=s.getSessionItemAsList(d.resultsSessionName)||[];return d.fullResults=n.clone(p||[]),d._cheapestResultPrice=d.updateLowestPrice(p),d.results.next(p),d}return m(a,i),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"estimatedMileage",{get:function(){return this.tempParams.estimatedMileage},set:function(e){this.tempParams.estimatedMileage=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickupTime",{get:function(){return this._pickupTime},set:function(e){this._pickupTime=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoffTime",{get:function(){return this._dropoffTime},set:function(e){this._dropoffTime=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodePickupRaw",{get:function(){return this.tempParams.postcodePickupRaw},set:function(e){this.tempParams.postcodePickupRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodeDropoffRaw",{get:function(){return this.tempParams.postcodeDropoffRaw},set:function(e){this.tempParams.postcodeDropoffRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityPickupDepot",{get:function(){return this.tempParams.cityPickupDepot},set:function(e){this.tempParams.cityPickupDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityDropoffDepot",{get:function(){return this.tempParams.cityDropoffDepot},set:function(e){this.tempParams.cityDropoffDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodePickup",{get:function(){return this.tempParams.postcodePickup},set:function(t){this.tempParams.postcodePickup=t,this.tempParams.postcodePickup&&(this.tempParams.locationType=e.LocationTypes.Postcode),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcodeDropoff",{get:function(){return this.tempParams.postcodeDropoff},set:function(e){this.tempParams.postcodeDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityPickup",{get:function(){return this.tempParams.cityPickup},set:function(t){this.tempParams.cityPickup=t,this.tempParams.cityPickup&&(this.tempParams.locationType=e.LocationTypes.City,console.log(this.tempParams.locationType)),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cityDropoff",{get:function(){return this.tempParams.cityDropoff},set:function(e){this.tempParams.cityDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minDate",{get:function(){return this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minInDate",{get:function(){return this._minInDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_country",{get:function(){return this.tempParams.pickup_country},set:function(e){this.tempParams.pickup_country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_country",{get:function(){return this.tempParams.dropoff_country},set:function(e){this.tempParams.dropoff_country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_location",{get:function(){return this.tempParams.pickup_location},set:function(t){this.tempParams.pickup_location=t,this.tempParams.pickup_location&&(this.tempParams.locationType=e.LocationTypes.Airport),this.return_to_pickup&&(this.dropoff_location=t),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_location",{get:function(){return this.tempParams.dropoff_location},set:function(e){this.tempParams.dropoff_location=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"ngbPickupDate",{get:function(){return this._ngbPickupDate},set:function(e){this._ngbPickupDate=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"ngbDropoffDate",{get:function(){return this._ngbDropoffDate},set:function(e){this._ngbDropoffDate=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_datetime",{get:function(){return this.tempParams.pickup_datetime},set:function(e){this.tempParams.pickup_datetime=e;try{e&&e.isValid()&&(this._ngbPickupDate=this.helpers.momentToNgDate(e),this._pickupTime=l.default(e).format("HH:mm")?l.default(e).format("HH:mm"):"07:30"),this._minInDate={day:e.date(),month:e.month()+1,year:e.year()},e.isSameOrAfter(this.tempParams.dropoff_datetime)&&(this.dropoff_datetime=this.dropoff_datetime.set("date",e.date()).set("month",e.month()).set("year",e.year()))}catch(e){}this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_datetime",{get:function(){return this.tempParams.dropoff_datetime},set:function(e){this.tempParams.dropoff_datetime=e,e&&e.isValid()&&(this._ngbDropoffDate=this.helpers.momentToNgDate(e),this._dropoffTime=l.default(e).format("HH:mm")?l.default(e).format("HH:mm"):"08:30"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_date",{get:function(){return this._pickup_date},set:function(e){this._pickup_date=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pickup_time",{get:function(){return this._pickup_time},set:function(e){this._pickup_time=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_date",{get:function(){return this._dropoff_date},set:function(e){this._dropoff_date=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropoff_time",{get:function(){return this._dropoff_time},set:function(e){this._dropoff_time=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"return_to_pickup",{get:function(){return this.tempParams.return_to_pickup},set:function(e){this.tempParams.return_to_pickup=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenVendor",{get:function(){return this.tempParams.chosenVendor},set:function(e){this.tempParams.chosenVendor=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenDistance",{get:function(){return this.tempParams.chosenDistance},set:function(e){this.tempParams.chosenDistance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carClass",{get:function(){return this.tempParams.carClass},set:function(e){this.tempParams.carClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carType",{get:function(){return this.tempParams.carType},set:function(e){this.tempParams.carType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"transmission",{get:function(){return this.tempParams.transmission},set:function(e){this.tempParams.transmission=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"airCon",{get:function(){return this.tempParams.airCon},set:function(e){this.tempParams.airCon=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"locationType",{get:function(){return this.tempParams.locationType},set:function(e){this.tempParams.locationType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(96).fill(0).map((function(e,t){return{value:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0"),display:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carAirConditionTypes",{get:function(){return this._carAirConditionTypes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"withinDistance",{get:function(){return this._withinDistance},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carTransmissionCodes",{get:function(){return this._carTransmissionCodes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carTypeCodes",{get:function(){return this._carTypeCodes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"vendors",{get:function(){return this._vendors},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortingOptions",{get:function(){return this._sorting_options},enumerable:!1,configurable:!0}),a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCarHireQuery()),this.estimatedMileage=null,this._isValid()},a.prototype._isValid=function(){var t,r,i;if(this.doChecks){switch(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams}),this.validationMessages=[],this.locationType){case e.LocationTypes.Airport:this.pickup_location&&this.pickup_location.destination||this.validationMessages.push("Please supply a pickup location"),this.dropoff_location&&this.dropoff_location.destination||this.validationMessages.push("Please supply a dropoff location");break;case e.LocationTypes.City:this.cityPickup||this.validationMessages.push("Please supply a pickup city"),this.cityDropoff||this.validationMessages.push("Please supply a dropoff city");break;case e.LocationTypes.Postcode:this.postcodePickup||this.validationMessages.push("Please supply a pickup depot"),this.postcodeDropoff||this.validationMessages.push("Please supply a dropoff depot")}this.estimatedMileage&&this.estimatedMileage<=0&&this.validationMessages.push("Estimated Milage must be a positive number.");try{this.pickup_datetime||this.validationMessages.push("Please supply a pickup time and date"),this.dropoff_datetime||this.validationMessages.push("Please supply a drop off time and date"),(null===(t=this.dropoff_datetime)||void 0===t?void 0:t.isSameOrBefore(this.pickup_datetime,"minute"))&&this.validationMessages.push("Dropoff date/time cannot be before or the same as pickup date/time"),(null===(r=this.pickup_datetime)||void 0===r?void 0:r.isBefore(l.default()))&&this.validationMessages.push("Pickup date/time must be after present date/time"),(null===(i=this.dropoff_datetime)||void 0===i?void 0:i.isBefore(l.default()))&&this.validationMessages.push("Dropoff date/time must be after present date/time")}catch(e){}this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)}},a.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(this.getSearchQuery())),this._startSearch(this.carhirefetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Car,searchArgs:t,travelDate:this.pickup_datetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(t){var r=t;switch(this.locationType){case e.LocationTypes.City:r.city={pickupName:this.cityPickup.name,pickupCountryCode:this.cityPickup.countryCode,pickupCity:this.cityPickup.id.toString(),pickupLatitude:this.cityPickup.latitude,pickupLongitude:this.cityPickup.longitude,dropOffName:this.cityDropoff.name,dropoffCountryCode:this.cityDropoff.countryCode,dropoffCity:this.cityDropoff.id.toString(),dropOffLatitude:this.cityDropoff.latitude,dropOffLongitude:this.cityDropoff.longitude,pickupAddressLines:this.cityPickupDepot.addressLines[0],pickupCityName:this.cityPickupDepot.cityName,pickupExtendedLocationCode:this.cityPickupDepot.extendedLocationCode,pickupLocationCode:this.cityPickupDepot.locationCode,pickupVendor:this.cityPickupDepot.vendor,pickupVendorCode:this.cityPickupDepot.vendorCode,chosenDistance:this.chosenDistance,dropOffAddressLines:this.cityDropoffDepot.addressLines[0],dropOffCityName:this.cityDropoffDepot.cityName,dropOffExtendedLocationCode:this.cityDropoffDepot.extendedLocationCode,dropOffLocationCode:this.cityDropoffDepot.locationCode,dropOffVendor:this.cityDropoffDepot.vendor,dropOffVendorCode:this.cityDropoffDepot.vendorCode};break;case e.LocationTypes.Postcode:r.depot={vendorCode:this.postcodePickup.vendorCode,pickupLocationCode:this.postcodePickup.locationCode,pickupExtendedLocationCode:this.postcodePickup.extendedLocationCode,pickupAddressLines:this.postcodePickup.addressLines[0],pickupCityName:this.postcodePickup.cityName,pickupVendor:this.postcodePickup.vendor,dropOffLocationCode:this.postcodeDropoff.locationCode,dropOffExtendedLocationCode:this.postcodeDropoff.extendedLocationCode,dropoffAddressLines:this.postcodeDropoff.addressLines[0],dropoffCityName:this.postcodeDropoff.cityName,dropoffVendor:this.postcodeDropoff.vendor,chosenDistance:this.chosenDistance,pickupPostCode:this.postcodePickupRaw.name,pickupLatitude:this.postcodePickupRaw.latitude,pickupLongitude:this.postcodePickupRaw.longitude,dropoffPostCode:this.postcodeDropoffRaw.name,dropoffLatitude:this.postcodeDropoffRaw.latitude,dropoffLongitude:this.postcodeDropoffRaw.longitude}}return r},a.prototype.startRecentSearch=function(e){this.chosenVendor=e.searchArgs.vendor,this.carClass=e.searchArgs.class,this.carType=e.searchArgs.type,this.transmission=e.searchArgs.transmission,this.airCon=e.searchArgs.aircon,this.estimatedMileage=e.searchArgs.estimatedDailyDistance,this.dropoff_datetime=l.default(e.searchArgs.dropoffDateTime),this.pickup_datetime=l.default(e.searchArgs.pickupDateTime),e.searchArgs.city?this.getParamsForCarbyCity(e.searchArgs.city):e.searchArgs.airport?this.getParamsForCarbyAirport(e.searchArgs.airport):e.searchArgs.depot&&this.getParamsForCarbyPostCode(e.searchArgs.depot)},a.prototype.getParamsForCarbyAirport=function(r){var i=this;this.locationType=e.LocationTypes.Airport,t.combineLatest([this.searchService.getAirportByCode(r.pickupCode),this.searchService.getAirportByCode(r.dropoffCode)]).subscribe((function(e){var t,r,a,n,o,s,l,u,c,d,h,p,m=S(e,2),f=m[0],v=m[1];f&&v&&(i.dropoff_location={destination:f.iataMatch.name,gateway:f.iataMatch.iata,terminals:i.searchService.processTerminals(v.iataMatch.terminals),country:null===(r=null===(t=f.iataMatch)||void 0===t?void 0:t.locationDetails)||void 0===r?void 0:r.country,postcode:null===(n=null===(a=f.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.postcode,countryCode:null===(s=null===(o=f.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.countryCode},i.pickup_location={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:i.searchService.processTerminals(v.iataMatch.terminals),country:null===(u=null===(l=v.iataMatch)||void 0===l?void 0:l.locationDetails)||void 0===u?void 0:u.country,postcode:null===(d=null===(c=v.iataMatch)||void 0===c?void 0:c.locationDetails)||void 0===d?void 0:d.postcode,countryCode:null===(p=null===(h=v.iataMatch)||void 0===h?void 0:h.locationDetails)||void 0===p?void 0:p.countryCode},i.dropoff_country=i.dropoff_location.countryCode,i.pickup_country=i.pickup_location.countryCode,i.searchService.startSearches())}))},a.prototype.getParamsForCarbyCity=function(t){this.locationType=e.LocationTypes.City,this.chosenDistance=t.chosenDistance,this.cityPickup={countryCode:t.pickupCountryCode,id:t.pickupCity,name:t.pickupName,type:e.LocationTypes.City,latitude:t.pickupLatitude,longitude:t.pickupLongitude},this.cityDropoff={countryCode:t.dropoffCountryCode,id:t.dropoffCity,name:t.dropOffName,type:e.LocationTypes.City,latitude:t.dropOffLatitude,longitude:t.dropOffLongitude},this.cityDropoffDepot={addressLines:[t.dropOffAddressLines],cityName:t.dropOffCityName,extendedLocationCode:t.dropOffExtendedLocationCode,locationCode:t.dropOffLocationCode,vendor:t.dropOffVendor,vendorCode:t.dropOffVendorCode},this.cityPickupDepot={addressLines:[t.pickupAddressLines],cityName:t.pickupCityName,extendedLocationCode:t.pickupExtendedLocationCode,locationCode:t.pickupLocationCode,vendor:t.pickupVendor,vendorCode:t.pickupVendorCode},this.searchService.startSearches()},a.prototype.getParamsForCarbyPostCode=function(t){this.locationType=e.LocationTypes.Postcode,this.chosenDistance=t.chosenDistance,this.postcodeDropoff={addressLines:[t.dropoffAddressLines],vendorCode:t.vendorCode,locationCode:t.dropOffLocationCode,extendedLocationCode:t.dropOffExtendedLocationCode,cityName:t.dropoffCityName,vendor:t.dropoffVendor},this.postcodeDropoffRaw={name:t.dropoffPostCode,type:e.LocationTypes.Postcode,latitude:t.dropoffLatitude,longitude:t.dropoffLongitude},this.postcodePickup={addressLines:[t.pickupAddressLines],vendorCode:t.vendorCode,locationCode:t.pickupLocationCode,extendedLocationCode:t.pickupExtendedLocationCode,cityName:t.pickupCityName,vendor:t.pickupVendor},this.postcodePickupRaw={name:t.pickupPostCode,type:e.LocationTypes.Postcode,latitude:t.pickupLatitude,longitude:t.pickupLongitude},this.searchService.startSearches()},a.prototype.getSearchQuery=function(){var t={};switch(this.locationType){case e.LocationTypes.Airport:t.airport={pickupCode:"",dropoffCode:""},t.airport.pickupCode=this.pickup_location.gateway,t.airport.dropoffCode=this.return_to_pickup?this.pickup_location.gateway:this.dropoff_location.gateway;break;case e.LocationTypes.City:t.depot={vendorCode:this.cityPickupDepot.vendorCode,pickupLocationCode:this.cityPickupDepot.locationCode,pickupExtendedLocationCode:this.cityPickupDepot.extendedLocationCode,dropOffLocationCode:this.cityDropoffDepot.locationCode,dropOffExtendedLocationCode:this.cityDropoffDepot.extendedLocationCode};break;case e.LocationTypes.Postcode:t.depot={vendorCode:this.postcodePickup.vendorCode,pickupLocationCode:this.postcodePickup.locationCode,pickupExtendedLocationCode:this.postcodePickup.extendedLocationCode,dropOffLocationCode:this.postcodeDropoff.locationCode,dropOffExtendedLocationCode:this.postcodeDropoff.extendedLocationCode}}return t.dropoffDateTime=this.helpers.formatGraphQLDateTime(this.dropoff_datetime),t.pickupDateTime=this.helpers.formatGraphQLDateTime(this.pickup_datetime),t.aircon=this.airCon,this.locationType===e.LocationTypes.Airport&&(t.vendor="-"===this.chosenVendor?null:this.chosenVendor),t.transmission=this.transmission||null,t.class=this.carClass||null,t.type=this.carType||null,t.estimatedDailyDistance=this.estimatedMileage||null,t.estimatedDailyDistanceUnits=this.estimatedMileage?e.ɵb.M:null,this.helpers.removeNulls(t)},a.prototype.getCarClasses=function(){return t.of(this._car_classes)},a.prototype.getLocationTypes=function(){return t.of(this._location_types)},a.prototype.filterResults=function(e,t){var r=this,i=this.helpers.clone(this.fullResults);i=i.filter((function(t){var i=r.getPrice(t);return i>=e.minPrice&&i<=e.maxPrice})),i=this.filterByTransmissionType(e.transmissions,i),i=this.filterByAirconType(e.airConditioning,i),i=this.filterByCarType(e.types,i),i=this.filterByCompany(e.companies,i),i=this.sortResults(t,i),this.results.next(i)},a.prototype.filterByCompany=function(e,t){var r=e.filter((function(e){return e.selected}));return r.length&&(t=t.filter((function(e){return r.find((function(t){return t.value.toString().toLowerCase()===e.identifiers.vendor.toLowerCase()}))}))),t},a.prototype.filterByCarType=function(e,t){var r=e.filter((function(e){return e.selected}));return r.length&&(t=t.filter((function(e){return r.find((function(t){return t.value.toString().toLowerCase()===e.displayRecord.vehicle.class.toLowerCase()}))}))),t},a.prototype.filterByTransmissionType=function(e,t){var r=e.find((function(e){return e.selected}));if(r&&"Y"!==r.value)try{t=t.filter((function(e){return e.identifiers.vehType[2].toLowerCase()===r.value.toString().toLowerCase()}))}catch(e){console.error("+++ Error filtering transmissions: "+e+" +++")}return t},a.prototype.filterByAirconType=function(e,t){var r=e.find((function(e){return e.selected}));if(r&&"A"!==r.value)try{t=t.filter((function(e){return e.identifiers.vehType[3].toLowerCase()===r.value.toString().toLowerCase()}))}catch(e){console.error("+++ Error filtering aircons: "+e+" +++")}return t},a.prototype.sortResults=function(e,t){var r=this,i=this.helpers.clone(t||this.results.value);switch(e){case 0:i=i.sort((function(e,t){return r.getPrice(e)-r.getPrice(t)}));break;case 1:i=i.sort((function(e,t){return r.getPrice(t)-r.getPrice(e)}));break;case 2:i=this.sortByPreferred(i);break;case 3:i=this.sortByBrand(i);break;case 4:i=this.sortBySize(i)}return this.results.next(i),i},a.prototype.sortExpensive=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){return t.getPrice(r)-t.getPrice(e)}));return this.results.next(r),r},a.prototype.sortCheapest=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){return t.getPrice(e)-t.getPrice(r)}));return this.results.next(r),r},a.prototype.sortBySize=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){var i,a;return i=t.carClassMap[e.displayRecord.vehicle.class.toLowerCase()],a=t.carClassMap[r.displayRecord.vehicle.class.toLowerCase()],i>=0&&a>=0?i-a:-1}));return this.results.next(r),r},a.prototype.sortByBrand=function(e){var t=this.helpers.clone(e||this.results.value).sort((function(e,t){var r=e.identifiers.vendor,i=t.identifiers.vendor;switch(r){case"ZE":r="HE";break;case"ZI":r="AV"}switch(i){case"ZE":i="HE";break;case"ZI":i="AV"}return r<i?-1:r>i?1:0}));return this.results.next(t),t},a.prototype.sortByPreferred=function(e){var t=this.helpers.clone(e||this.results.value).sort((function(e,t){var r=e.tmcPreferred||e.companyPreferred||e.officePreferred?1:0,i=t.tmcPreferred||t.companyPreferred||t.officePreferred?1:0;return r>i?-1:r<i?1:0}));return this.results.next(t),t},a.prototype.getPrice=function(e){try{return Number(e.displayRecord.charges[0].amount)}catch(e){}return 0},a.prototype.getMinPrice=function(e){var t=this;return e.reduce((function(e,r){var i=t.getPrice(r);return i<e&&(e=i),e}),Number.MAX_SAFE_INTEGER)},a.prototype.getMaxPrice=function(e){var t=this;return e.reduce((function(e,r){var i=t.getPrice(r);return i>e&&(e=i),e}),Number.MIN_SAFE_INTEGER)},a.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;r&&(this.chosenVendor=r.vendor,this.carClass=r.class,this.carType=r.type,this.transmission=r.transmission,this.airCon=r.aircon,this.estimatedMileage=r.estimatedDailyDistance,this.dropoff_datetime=l.default(r.dropoffDateTime),this.pickup_datetime=l.default(r.pickupDateTime),r.city?this.getParamsForCarbyCity(r.city):r.airport?this.getParamsForCarbyAirport(r.airport):r.depot&&this.updateSearchForCarbyPostCode(r,e.detail)),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},a.prototype.updateSearchForCarbyPostCode=function(t,r){this.locationType=e.LocationTypes.Postcode,this.chosenDistance=t.chosenDistance,this.postcodeDropoffRaw={name:r.dropOffLocation.postcode,type:e.LocationTypes.Postcode},this.postcodePickupRaw={name:r.pickUpLocation.postcode,type:e.LocationTypes.Postcode}},a.prototype.updateFromPreviousSearches=function(t){var r,i,a,n;console.log("PREPOPULATING CARHIRE FORM");var o=null===(r=t[ne.Flight])||void 0===r?void 0:r.searchQuery,s=null===(i=t[ne.Rail])||void 0===i?void 0:i.searchQuery,l=null===(a=t[ne.Rail])||void 0===a?void 0:a.searchQuery,u=null===(n=t[ne.InternationalRail])||void 0===n?void 0:n.searchQuery;if(o)try{var c=this.searchService.searches[ne.Flight].outBoundDate.toDate(),d=this.searchService.searches[ne.Flight].inboundDate.toDate();this.locationType=e.LocationTypes.Airport,this.pickup_datetime=this.searchService.searches[ne.Flight].outBoundDate,this.dropoff_datetime=this.searchService.searches[ne.Flight].inboundDate,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()},this.pickup_location=this.searchService.searches[ne.Flight].arriveLocation,this.dropoff_location=this.searchService.searches[ne.Flight].arriveLocation,this.pickup_country=this.searchService.searches[ne.Flight].arriveLocation.countryCode,this.dropoff_country=this.searchService.searches[ne.Flight].arriveLocation.countryCode}catch(e){console.error("Error trying to prepopulate carhire from flight item")}else if(s)try{c=this.searchService.searches[ne.Rail].outBoundDateTime.toDate(),d=this.searchService.searches[ne.Rail].inBoundDateTime.toDate();this.pickup_datetime=this.searchService.searches[ne.Rail].outBoundDateTime,this.dropoff_datetime=this.searchService.searches[ne.Rail].inBoundDateTime,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate carhire from rail item")}else if(u)try{c=this.searchService.searches[ne.InternationalRail].outBoundDateTime.toDate(),d=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime.toDate();this.pickup_datetime=this.searchService.searches[ne.InternationalRail].outBoundDateTime,this.dropoff_datetime=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate carhire from international rail item")}else if(l)try{c=this.searchService.searches[ne.Hotel].checkin_date.toDate(),d=this.searchService.searches[ne.Hotel].checkout_date.toDate();this.pickup_datetime=this.searchService.searches[ne.Hotel].checkin_date,this.dropoff_datetime=this.searchService.searches[ne.Hotel].checkout_date,this.pickup_date={day:c.getUTCDate(),month:c.getUTCMonth()+1,year:c.getUTCFullYear()},this.dropoff_date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate carhire from hotel item")}},a.prototype._updatePickupDateTime=function(){if(this._pickup_date&&this._pickup_time){var e=this.helpers.ngDateToMoment(this._pickup_date,this._pickup_time);this.pickup_datetime=e.isValid()?e:null,this._isValid()}},a.prototype._updateDropoffDateTime=function(){if(this._dropoff_date&&this._dropoff_time){var e=this.helpers.ngDateToMoment(this._dropoff_date,this._dropoff_time);this.dropoff_datetime=e.isValid()?e:null,this._isValid()}},a.prototype._updateNgbPickupDateTime=function(){if(this._ngbPickupDate&&this._pickupTime){var e=this.helpers.ngDateToMoment(this._ngbPickupDate,this._pickupTime);this.pickup_datetime=e.isValid()?e:null,this._isValid()}},a.prototype._updateNgbDropoffDateTime=function(){if(this._ngbDropoffDate&&this._dropoffTime){var e=this.helpers.ngDateToMoment(this._ngbDropoffDate,this._dropoffTime);this.dropoff_datetime=e.isValid()?e:null,this._isValid()}},a.prototype.isOverNight=function(){var e=this.pickup_datetime.date();return this.dropoff_datetime.date()-e>=1},a.prototype.updateLowestPrice=function(e){return e.length?{amount:this.getMinPrice(e),currencyCode:e[0].displayRecord.charges[0].currencyCode}:null},a.prototype.getCarHireAvailabilityDetail=function(e,t){return t.value||t.next(!0),this.carHireAvailabilityDetailFetcher.fetchList({locationDetails:e}).pipe(r.take(1),r.map((function(e){return t.value&&t.next(!1),e})))},a.prototype.addCarHireToBasket=function(t,r){var i,a,n,o,s,l,u,c,d,h;return y(this,void 0,void 0,(function(){var p,m,f,v,y,g,S,C,A,T;return b(this,(function(b){switch(b.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return p=b.sent(),(m=null==p?void 0:p.subject.value)?(f=t.co2PerItem,v=t.co2PerPassenger,y=t.displayRecord,g=t.identifiers,S=t.sourceId,C=parseFloat(null!==(a=null===(i=null==y?void 0:y.charges[0])||void 0===i?void 0:i.amount)&&void 0!==a?a:"0"),A=this.getTermsAndCond(t,r),[4,this.basketService.addToBasket({adults:this.adults,basket:m.id,service:S.toString(),detail:{pickUpDatetime:y.pickup,dropOffDatetime:y.dropoff,pickUpLocation:{iata:this.locationType===e.LocationTypes.Airport?g.pickUpLocationCode:"",name:y.pickupLocation.name,address:y.pickupLocation.topLine+", "+y.pickupLocation.city,postcode:y.pickupLocation.postCode},dropOffLocation:{iata:this.locationType===e.LocationTypes.Airport?g.dropOffLocationCode:"",name:y.returnLocation.name,address:y.returnLocation.topLine+", "+y.returnLocation.city,postcode:y.returnLocation.postCode},car:{type:y.vehicle.type,manualTransmission:y.vehicle.transmission.includes(I.Manual)},fareInfo:{title:null===(n=null==t?void 0:t.fareInfo)||void 0===n?void 0:n.title,type:null===(o=null==t?void 0:t.fareInfo)||void 0===o?void 0:o.type,code:null===(s=null==t?void 0:t.fareInfo)||void 0===s?void 0:s.code,supplierCode:null===(l=null==t?void 0:t.fareInfo)||void 0===l?void 0:l.supplierCode},vendorName:y.vendor.name,identifiers:{pickUpLocation:g.pickUpLocation?g.pickUpLocation:"",pickUpLocationCode:g.pickUpLocationCode?g.pickUpLocationCode:"",pickUpExtendedLocationCode:g.pickUpExtendedLocationCode?g.pickUpExtendedLocationCode:"",pickUpLocationName:g.pickUpLocationName?g.pickUpLocationName:"",dropOffLocation:g.dropOffLocation?g.dropOffLocation:"",dropOffLocationCode:g.dropOffLocationCode?g.dropOffLocationCode:"",dropOffExtendedLocationCode:g.dropOffExtendedLocationCode?g.dropOffExtendedLocationCode:"",dropOffLocationName:g.dropOffLocationName?g.dropOffLocationName:"",vehType:g.vehType,vendor:g.vendor},termsAndCond:A},price:C,requiresReason:t.requiresReason,currency:y.charges[0].currencyCode,searchQuery:r,co2PerItem:f,co2PerPassenger:v,outboundDate:new Date(y.pickup).toISOString(),lowestPrice:(null===(u=this.cheapestPrice)||void 0===u?void 0:u.amount)!=C?null===(c=this.cheapestPrice)||void 0===c?void 0:c.amount:null,lowestPriceCurrency:(null===(d=this.cheapestPrice)||void 0===d?void 0:d.amount)!=C?null===(h=this.cheapestPrice)||void 0===h?void 0:h.currencyCode:null},p,this.searchService,this.travellers,t.requiresReason)]):[3,3];case 2:return(T=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,T];case 3:return[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},a.prototype.getTermsAndCond=function(e,t){return[{name:"Additional Driver",value:""},{name:"Age Requirements",value:""},{name:"Cross Border Policy",value:""},{name:"Damage Waiver",value:""},{name:"Debit Card Policy",value:""},{name:"One Way Drop Policy",value:""},{name:"Extended Protection",value:""},{name:"Excess Protection",value:""},{name:"Inclusive Policy",value:""},{name:"Mileage Policy",value:""},{name:"Miscellaneous Policy",value:""},{name:"Forms of Payment",value:""},{name:"Roadside Protection",value:""},{name:"Renter Requirements",value:""},{name:"Third Party Liability",value:""}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Car,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.airCon=e.aircon,this.carClass=e.class,this.transmission=e.transmission,this.chosenVendor=e.vendor,this.carType=e.type,this.return_to_pickup=e.airport.pickupCode==e.airport.dropoffCode,this.searchService.getAirportsList(e.airport.pickupCode).subscribe((function(r){t.pickup_location=r.find((function(t){return t.gateway==e.airport.pickupCode}))})),this.return_to_pickup||this.searchService.getAirportsList(e.airport.dropoffCode).subscribe((function(r){t.dropoff_location=r.find((function(t){return t.gateway==e.airport.dropoffCode}))})),[2]}))}))},a.prototype.checkForPreferred=function(){return!!this.results.value.find((function(e){return e.officePreferred||e.tmcPreferred||e.companyPreferred}))},a}(c);it.STORAGE_SESSION_PARAMS="carhire_params",it.STORAGE_SESSION_RESULTS="carhire_results";var at,nt=function(){this.numberHotelToPreload=Number.MAX_SAFE_INTEGER,this.numberOfHotelsToFetch=5,this.autoFetchHotelTimeout=50,this.autoLogoutTime=60,this.hotelAvalibilityTimeout=2e3,this.maxBasketNumber=5,this.searchTimeout=3e4,this.groupMax=0,this.ADMIN_USER_PANEL_STAGING="https://admin-staging.ctmlightning.co.uk/user",this.ADMIN_USER_PANEL="https://admin.ctmlightning.co.uk/user"},ot=function(e){},st={next:ot},lt=function(){function e(){this.events={}}return e.prototype.getEmmitter=function(e){return this.events[e]=this.events[e]||new t.Subject,this.events[e]},e.prototype.emit=function(e,t){(this.events[e]||st).next(t)},e}();(at=e.FlightDisplayTypes||(e.FlightDisplayTypes={}))[at.returns=1]="returns",at[at.dualSingles=2]="dualSingles";var ut,ct=Object.freeze({stops:{},totalStops:{},mustInclude:{},classes:{},airlines:{},travelPolicy:{},depatureAirport:{},depatureReturnAirport:{},arrivalAirport:{},arrivalReturnAirport:{},baggage:{},fareTypes:{},price:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},duration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},returnDuration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},departureTime:{min:0,max:24},arrivalTime:{min:0,max:24},returnDepartureTime:{min:0,max:24},returnArrivalTime:{min:0,max:24},flightNumber:""});(ut=e.FlightSearchType||(e.FlightSearchType={})).return="return",ut.oneWay="oneWay",ut.multiCity="multiCity";var dt=function(e){this.value=e};dt.MaxFlightClass=new dt("MaxFlightClass"),dt.SSO_no_password=new dt("SSO_no_password"),dt.HideFlightCabinClasses=new dt("hideFlightCabinClasses"),dt.AlternativeRailItineraryEnabled=new dt("alternativeRailItineraryEnabled"),dt.riskMinimumLevel=new dt("riskMinimumLevel"),dt.ENABLE_CHATBOT=new dt("enableChatbot"),dt.LocalCurrency=new dt("local_currency"),dt.HideRailClasses=new dt("hideRailClasses"),dt.AllowOneTravellerPerBasket=new dt("allowOneTravellerPerBasket"),dt.AllowSameTravellesrPerBasket=new dt("allowSameTravellersPerBasket"),dt.FlightDirectDefault=new dt("flightDirectDefault");var ht=function(e){this.value=e};ht.non=new ht("non"),ht.EVI=new ht("evi");var pt,mt=function(){function e(e){this.returnCounts=(e.journeys||[]).reduce((function(e,t){var r;return t.co2PerPassenger&&(e.outboundCounts.count+=1,e.outboundCounts.accum+=t.co2PerPassenger,e.outboundCounts.avg=e.outboundCounts.accum/e.outboundCounts.count,(null===(r=t.inboundFlights)||void 0===r?void 0:r.length)>0&&(e.inboundCounts.count+=1,e.inboundCounts.accum+=t.co2PerPassenger,e.inboundCounts.avg=e.inboundCounts.accum/e.inboundCounts.count)),e}),{outboundCounts:{count:0,accum:0,avg:0},inboundCounts:{count:0,accum:0,avg:0}}),this.multi=(e.multi||[]).map((function(e){return e.results.reduce((function(e,t){return t.co2PerPassenger&&(e.count=e.count+1,e.accum=e.accum+t.co2PerPassenger,e.avg=e.accum/e.count),e}),{count:0,accum:0,avg:0})}))}return e.prototype.makeReturnOutbound=function(e){return this._makeGreenerChoice(this.returnCounts.outboundCounts,e.co2PerPassenger)},e.prototype.makeReturnInbound=function(e){return this._makeGreenerChoice(this.returnCounts.outboundCounts,e.co2PerPassenger)},e.prototype.makeMulti=function(e,t){return this._makeGreenerChoice(this.multi[e],t)},e.prototype._makeGreenerChoice=function(e,t){return{greenerChoice:t&&t<e.avg,greenerChoicePercentage:t&&t<e.avg?t/e.avg:0}},e.prototype._convertToKilograms=function(e){return"KG"!==e.unit?e.amount/2.2:e.amount},e}(),ft={BRU:"ZYR",CRL:"ZYR",ZYR:"ZYR",DLP:"XED",XED:"XED",PAR:"XPG",CDG:"XPG",XPG:"XPG",ORY:"XPG",XEX:"XPG",BVA:"XPG",XGB:"XPG",JDP:"XPG",SPU:"XPG",LBG:"XPG",LIL:"XDB",XDB:"XDB",XFA:"XDB",QDH:"QDH",XQE:"XQE",LON:"QQS",STN:"QQS",LCY:"QQS",LGW:"QQS",LHR:"QQS",LTN:"QQS",SEN:"QQS",BQH:"QQS",QQS:"QQS",QQW:"QQS",RTM:"QRH",QRH:"QRH"},vt={ABZ:"ABD",BHX:"BHM",BLK:"BPM",BOH:"BHM",BRS:"BRI",CWL:"CDF",ORK:"COK",CVT:"COV",DSA:"DON",EMA:"BHM",EDI:"EDB",EXT:"EXC",GLA:"GLC",HUY:"HUL",INV:"INV",LBA:"LDS",LPL:"LIV",LON:"EUS",LCY:"EUS",KIR:"DUB",LDY:"DUB",LGW:"EUS",LHR:"EUS",LTN:"EUS",STN:"SVG",MAN:"MAN",NCL:"NCL",NQY:"NQY",NWI:"NRW",PLH:"PLY",PIK:"GLC",SOU:"SOU",SEN:"SOC",MME:"MBR"};(pt=e.ErmTravellerType||(e.ErmTravellerType={})).Joiner="JOINER",pt.Leaver="LEAVER",pt.None="none";var yt,bt;(yt=e.TimeWindow||(e.TimeWindow={})).Anytime="Anytime",yt.Depart="Depart By",yt.Arrive="Arrive By",(bt=e.FlightSortTypes||(e.FlightSortTypes={})).Cheapest="Cheapest",bt.MostExpensive="Most Expensive",bt.Fastest="Fastest",bt.Preferred="Preferred",bt.LowestEmissions="Lowest Emissions",bt.DepartureTime="Departure Time",bt.ArrivalTime="Arrival Time",bt.Quickest="Quickest",bt.MostDirect="Most Direct",bt.GreenerChoice="Greener Choice";var gt,St=function(i){function a(r,n,o,s,u,c,d,h){var p,m,f=i.call(this,u,n,c,o)||this;f.flightfetcher=r,f.basketService=s,f.applyFlightRules=d,f.modalService=h,f.type=ne.Flight,f.avaliableClasses=new t.BehaviorSubject([]),f.timeCriteriaOptions=new t.BehaviorSubject([]),f.flightOperators=new t.BehaviorSubject([]),f.directDefaultValue=!1,f._negotiated=!1,f._sortArray=[{display:"Cheapest First",value:e.FlightSortTypes.Cheapest},{display:"Most Expensive First",value:e.FlightSortTypes.MostExpensive},{display:"Fastest First",value:e.FlightSortTypes.Fastest},{display:"Preferred Fares First",value:e.FlightSortTypes.Preferred},{display:"Lowest Co2 Emissions First",value:e.FlightSortTypes.LowestEmissions}],f._sortItinaryRoutines=((p={})[e.FlightSortTypes.Cheapest]=function(e,t){return e.total.price-t.total.price},p[e.FlightSortTypes.MostExpensive]=function(e,t){return t.total.price-e.total.price},p[e.FlightSortTypes.Fastest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},p[e.FlightSortTypes.Preferred]=function(e,t){return e.preferred-t.preferred},p[e.FlightSortTypes.LowestEmissions]=function(e,t){return e.co2PerItem-t.co2PerItem},p[e.FlightSortTypes.DepartureTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeDeparting),i=l.default(t.outboundFlights[0].dateTimeDeparting);return r.isBefore(i)?-1:r.isSame(i)?0:1},p[e.FlightSortTypes.ArrivalTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeArriving),i=l.default(t.outboundFlights[0].dateTimeArriving);return r.isBefore(i)?-1:r.isSame(i)?0:1},p[e.FlightSortTypes.Quickest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},p[e.FlightSortTypes.MostDirect]=function(e,t){return e.outboundFlights.length+(e.outboundFlights?e.outboundFlights.length:0)-(t.outboundFlights.length+(t.outboundFlights?t.outboundFlights.length:0))},p[e.FlightSortTypes.GreenerChoice]=function(e,t){return e.greenerChoice!==t.greenerChoice?e.greenerChoice?-1:1:e.greenerChoice?e.greenerChoicePercentage-t.greenerChoicePercentage:0},p),f._sortGroupedRoutines=((m={})[e.FlightSortTypes.Cheapest]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:e.minPrice-t.minPrice},m[e.FlightSortTypes.MostExpensive]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:t.minPrice-e.maxPrice},m[e.FlightSortTypes.Fastest]=function(t,r){return t.direction!==r.direction?t.direction-r.direction:t.direction===e.FlightDirectionEnum.Outbound?t.outboundTotalDuration-r.outboundTotalDuration:t.inboundTotalDuration-r.inboundTotalDuration},m[e.FlightSortTypes.Preferred]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:(t.preferred?1:0)-(e.preferred?1:0)},m[e.FlightSortTypes.GreenerChoice]=function(){return 0},m[e.FlightSortTypes.LowestEmissions]=function(e,t){return e.direction!==t.direction?e.direction-t.direction:e.co2PerItem-t.co2PerItem},m[e.FlightSortTypes.DepartureTime]=function(e,t){if(e.direction!==t.direction)return e.direction-t.direction;var r=l.default(e.departDateTime),i=l.default(t.departDateTime);return r.isBefore(i)?-1:r.isSame(i)?0:1},m[e.FlightSortTypes.ArrivalTime]=function(e,t){if(e.direction!==t.direction)return e.direction-t.direction;var r=l.default(e.arrivalDateTime),i=l.default(t.arrivalDateTime);return r.isBefore(i)?-1:r.isSame(i)?0:1},m[e.FlightSortTypes.Quickest]=function(t,r){return t.direction!==r.direction?t.direction-r.direction:t.direction===e.FlightDirectionEnum.Outbound?t.outboundTotalDuration-r.outboundTotalDuration:(t.inboundTotalDuration?t.inboundTotalDuration:0)-(r.inboundTotalDuration?r.inboundTotalDuration:0)},m[e.FlightSortTypes.MostDirect]=function(t,r){return t.direction!==r.direction?t.direction-r.direction:t.direction===e.FlightDirectionEnum.Outbound?t.outlegs.length-r.outlegs.length:(t.inlegs||[]).length-(r.inlegs||[]).length},m),f._fareTypeArray=[{value:U.Flexible,display:"Flexible"},{value:U.Leisure,display:"Leisure"},{value:U.Lowest,display:"Lowest"},{value:U.Negotiated,display:"Negotiated"},{value:U.NonNegotiated,display:"Non-Negotiated"},{value:U.RequestFareRules,display:"Request Fare Rules"},{value:U.SelectAndPro,display:"Select & Pro"}],f.minimumOutBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},f.minimumInBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},f._grouped=null,f.travellers=null,f.resultsSessionName=a.STORAGE_SESSION_RESULTS,f.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,f._showHotelForm=!1,f._fetchingRules=!1,f._hotelSearchRequested=!1,f.filters=new t.BehaviorSubject(ct),f.duralSingleFilter=new t.BehaviorSubject(ct),f.choosenDisplayType=new t.BehaviorSubject(e.FlightDisplayTypes.returns),f.eurostarFromFlightSearchPerformed=!1,f.railFromFlightSearchPerformed=!1,f._cheapestPriceObject={dualOutbound:{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"},dualInbound:{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"},returns:{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"}},f._multiDestination=[];var v=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};f.userService.fullUserDetails.userConfigs.subscribe((function(e){var t;console.log(e),e&&(f.directDefaultValue=null===(t=f.userService.getUserFavoriteObject(dt.FlightDirectDefault))||void 0===t?void 0:t.value)}));var y=c.makeFlightQuery(v.tempParams);return f.updateTempParams(y),f._originalUserSearch=v.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){f.travellers=e;var t=f.helpers.selectedTravellers(e,ne.Flight);f.tempParams.adults=t.adults.length,f.tempParams.children=t.children.length,f.updateTravellers(),f._isValid()})),o.changeUser.subscribe((function(t){f.timeCriteriaOptions.next([e.TimeWindow.Anytime,e.TimeWindow.Arrive,e.TimeWindow.Depart]),f.flightOperators.next([{code:"BA",name:"British Airways"}]),f.updateAvaliableClasses()})),f.updateTravellers(),f.negotiated=f.tempParams.fareType===U.Negotiated,f}return m(a,i),Object.defineProperty(a.prototype,"fetchingRules",{get:function(){return this._fetchingRules},set:function(e){this._fetchingRules=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cheapestPriceObject",{get:function(){return this._cheapestPriceObject},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(96).fill(0).map((function(e,t){return{value:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0"),display:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"preferredCarriers",{get:function(){return this.tempParams.preferredCarriers},set:function(e){this.tempParams.preferredCarriers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator1",{get:function(){return this.tempParams.preferredCarriers[0]},set:function(e){this.tempParams.preferredCarriers[0]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator2",{get:function(){return this.tempParams.preferredCarriers[1]},set:function(e){this.tempParams.preferredCarriers[1]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator3",{get:function(){return this.tempParams.preferredCarriers[2]},set:function(e){this.tempParams.preferredCarriers[2]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator4",{get:function(){return this.tempParams.preferredCarriers[3]},set:function(e){this.tempParams.preferredCarriers[3]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minDate",{get:function(){return this._minDate=this._minDate||this.helpers.momentToNgDate(l.default()),this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departLocation",{get:function(){return this.tempParams.departLocation},set:function(e){this.tempParams.departLocation=e,"string"==typeof e?this._originAirport="":e&&e.gateway?this._originAirport=e.gateway:this._originAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryOriginAiport",{get:function(){return this._originAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryDestinationAiport",{get:function(){return this._destinationAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departDate",{get:function(){return this._outDate},set:function(e){this._outDate=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departTime",{get:function(){return this._outTime},set:function(e){this._outTime=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outBoundDate",{get:function(){return this.tempParams.outBoundDate},set:function(e){this.tempParams.outBoundDate=e.isValid()?e:null,this.minimumInBoundDate={year:e.year(),month:e.month()+1,day:e.date()},this.tempParams.outBoundDate&&this.tempParams.inboundDate&&this.tempParams.outBoundDate.isAfter(this.tempParams.inboundDate)&&(this.inboundDate=l.default(this.tempParams.outBoundDate).add(1,"day")),this._outDate=this.helpers.momentToNgDate(e),this._outTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnDate",{get:function(){return this._inDate},set:function(e){this._inDate=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveTime",{get:function(){return this._inTime},set:function(e){this._inTime=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inboundDate",{get:function(){return this.tempParams.inboundDate},set:function(e){this.tempParams.inboundDate=e.isValid()?e:null,this._inDate=this.helpers.momentToNgDate(e),this._inTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveLocation",{get:function(){return this.tempParams.arriveLocation},set:function(e){this.tempParams.arriveLocation=e,"string"==typeof e?this._destinationAirport="":e&&e.gateway?this._destinationAirport=e.gateway:this._destinationAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cabinClass",{get:function(){return this.tempParams.cabinClass},set:function(e){this.tempParams.cabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnCabinClass",{get:function(){return this.tempParams.returnCabinClass},set:function(e){this.tempParams.returnCabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isReturn",{get:function(){return this.tempParams.chosenSearchType===e.FlightSearchType.return},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outTimeCriteria",{get:function(){return this.tempParams.outTimeCriteria},set:function(e){this.tempParams.outTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inTimeCriteria",{get:function(){return this.tempParams.inTimeCriteria},set:function(e){this.tempParams.inTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxConnections",{get:function(){return this.tempParams.maxConnections},set:function(e){this.tempParams.maxConnections=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"multiDestination",{get:function(){return this.tempParams.multiDestination},set:function(e){this.tempParams.multiDestination=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"showHotelForm",{get:function(){return this._showHotelForm},set:function(e){this._showHotelForm=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hotelSearchRequested",{get:function(){return this._hotelSearchRequested},set:function(e){this._hotelSearchRequested=e},enumerable:!1,configurable:!0}),a.prototype.setMultiDestinationQuery=function(e){var t=this;return this.helpers.clone(e).reduce((function(e,r){var i={};return i.orig=r.orig.gateway,i.dest=r.dest.gateway,i.date=t.helpers.formatIsoDate(r.date),e.push(i),e}),[])},Object.defineProperty(a.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareTypesValues",{get:function(){return this._fareTypeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareType",{get:function(){return this.tempParams.fareType},set:function(e){this.tempParams.fareType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"negotiated",{get:function(){return this._negotiated},set:function(e){this._negotiated=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"includeNearbyAirports",{get:function(){return this.tempParams.includeNearbyAirports},set:function(e){this.tempParams.includeNearbyAirports=e},enumerable:!1,configurable:!0}),a.prototype.processResults=function(t){var r=this;if(!t)return this._grouped=[],this.multi=[],this.resultQuery=null,[];this.greenerChoice=new mt(t),this._grouped=t.grouped||[],this._ruleActionSummary=Object.assign({},{journeyWhenSelected:{},dualSingleWhenSelected:{},whenSelectedAlone:{}},t.ruleActionSummary||{}),this.resultQuery=this.getSearchQuery(),this.multi=t.multi,this.setFlightDisplayType(e.FlightDisplayTypes.returns),this.currentFilters=this.helpers.createFlightFilters(t.journeys,ct),this.filters.next(this.currentFilters);var i=t.multi.reduce((function(e,t){return e[0===t.order?"outbound":"inbound"]=t.results.reduce((function(e,i){return e[i.uid]=Object.assign({selected:!1,canSelect:!0},r.greenerChoice.makeMulti(t.order,i.co2PerPassenger),i),e}),e[0===t.order?"outbound":"inbound"]),e}),{outbound:{},inbound:{}}),a=this.helpers.createFlightFilters(Object.values(i.inbound),ct);if(this.duralSingleFilter.next(this.helpers.createFlightFilters(Object.values(i.outbound),Object.assign(Object.assign({},ct),{price:a.price,arrivalReturnAirport:a.arrivalAirport,depatureReturnAirport:a.depatureAirport,returnArrivalTime:a.arrivalTime,returnDuration:a.duration,returnDepartureTime:a.departureTime}))),t&&this.searchService.isFlightsGrouped()){var n=(t.journeys||[]).reduce((function(e,t){return e[t.uid]=Object.assign({selected:!1,canSelect:!0},t),e}),{}),o=(t.grouped||[]).reduce(this.makeGroupedObjects(n),[]),s=(t.grouped||[]).reduce(this.makeGroupedObjects(i.outbound),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleOutbound,t})),l=(t.grouped||[]).reduce(this.makeGroupedObjects(i.inbound,!0),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleInbound,t}));this._cheapestPriceObject.returns=o.reduce((function(e,t){var r=t.minPrice;return e.amount>r&&(e.amount=r,Object.values(t.classes).filter((function(e){return null!==e})).length&&(e.currencyCode=Object.values(t.classes).filter((function(e){return null!==e}))[0].currency)),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"}),this._cheapestPriceObject.dualOutbound=s.reduce((function(e,t){var r=t.minPrice;return e.amount>r&&(e.amount=r,Object.values(t.classes).filter((function(e){return null!==e})).length&&(e.currencyCode=Object.values(t.classes).filter((function(e){return null!==e}))[0].currency)),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"}),this._cheapestPriceObject.dualInbound=l.reduce((function(e,t){var r=t.minPrice;return e.amount>r&&(e.amount=r,Object.values(t.classes).filter((function(e){return null!==e})).length&&(e.currencyCode=Object.values(t.classes).filter((function(e){return null!==e}))[0].currency)),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:"GBP"});var u=C(o,s,l);return console.log("Processed Grouped data",u),u}return t?[t]:[]},a.prototype.makeGroupedObjects=function(t,r){var i=this;return void 0===r&&(r=!1),function(a,n){var o,s=n.boundIndicator===e.FlightDirectionEnum.Outbound,l={type:"FlightGroupedQuoteResult",direction:n.boundIndicator,classes:(o={},o[e.OBTFlightCabinClass.Business]=null,o[e.OBTFlightCabinClass.BusinessBranded]=null,o[e.OBTFlightCabinClass.EconomyFlexi]=null,o[e.OBTFlightCabinClass.EconomyFlexiBranded]=null,o[e.OBTFlightCabinClass.EconomyNoBags]=null,o[e.OBTFlightCabinClass.EconomyNoBagsBranded]=null,o[e.OBTFlightCabinClass.EconomyRestricted]=null,o[e.OBTFlightCabinClass.EconomyRestrictedBranded]=null,o[e.OBTFlightCabinClass.First]=null,o[e.OBTFlightCabinClass.FirstBranded]=null,o[e.OBTFlightCabinClass.PremiumEconomy]=null,o[e.OBTFlightCabinClass.PremiumEconomyBranded]=null,o),originAirport:"",originAirportName:"",destinationAirport:"",destinationAirportName:"",departDateTime:"",arrivalDateTime:"",outboundTotalDuration:0,inboundTotalDuration:0,outlegs:null,inlegs:null,outlegsCount:0,inlegsCount:0,dataSource:"",preferred:!1,companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",outboundFlightNumber:"",operator:"",operatorFull:"",inboundFlightNumber:"",isReturn:!1,minPrice:Number.MAX_SAFE_INTEGER,maxPrice:0,co2PerItem:0,co2PerPassenger:0,gid:n.referenceID,greenerChoice:!1,greenerChoicePercentage:0},u=n.flights;return Object.keys(u).filter((function(e){return"_"!==e[0]})).forEach((function(e){u[e].length&&u[e].forEach((function(a){var n,o,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k=t[a];if(k){s||r?(i.createGroupedItem(l,k.source,k.outboundFlights,k.outboundTotalDuration,k.inboundFlights,k.inboundTotalDuration,k.co2PerItem,k.co2PerPassenger),Object.assign(l,i.greenerChoice.makeReturnOutbound(k))):(i.createGroupedItem(l,k.source,k.inboundFlights,k.inboundTotalDuration,k.outboundFlights,k.outboundTotalDuration,k.co2PerItem,k.co2PerPassenger),Object.assign(l,i.greenerChoice.makeReturnInbound(k)));var _=i.helpers.FlightCabinClassToBrandedOBTFlightCabinClass(e,!!k.baseFareId&&k.baseFareId!==k.uid),R=Math.floor(k.total.price),I=Math.ceil(k.total.price);l.minPrice=l.minPrice<R?l.minPrice:R,l.maxPrice=l.maxPrice>I?l.maxPrice:I,l.companyPreferred=(null===(n=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===n?void 0:n.companyPreferred)||(null===(o=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===o?void 0:o.companyPreferred)||!1,l.companyPreferredMessage=(null===(u=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===u?void 0:u.companyPreferredMessage)||(null===(c=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===c?void 0:c.companyPreferredMessage)||"",l.officePreferred=(null===(d=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===d?void 0:d.officePreferred)||(null===(h=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===h?void 0:h.officePreferred)||!1,l.officePreferredMessage=(null===(p=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===p?void 0:p.officePreferredMessage)||(null===(m=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===m?void 0:m.officePreferredMessage)||"",l.tmcPreferred=(null===(f=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===f?void 0:f.tmcPreferred)||(null===(v=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===v?void 0:v.tmcPreferred)||!1,l.tmcPreferredMessage=(null===(y=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===y?void 0:y.tmcPreferredMessage)||(null===(b=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===b?void 0:b.tmcPreferredMessage)||"",l.preferred=(null===(g=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===g?void 0:g.companyPreferred)||(null===(S=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===S?void 0:S.companyPreferred)||(null===(C=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===C?void 0:C.officePreferred)||(null===(A=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===A?void 0:A.officePreferred)||(null===(T=i._ruleActionSummary.journeyWhenSelected[k.journeyHash])||void 0===T?void 0:T.tmcPreferred)||(null===(D=i._ruleActionSummary.whenSelectedAlone[k.journeyHash])||void 0===D?void 0:D.tmcPreferred),(null===(F=null===(P=l.classes[_])||void 0===P?void 0:P.flights)||void 0===F?void 0:F.length)?(l.classes[_].flights.push(k),l.classes[_].minprice=Math.min(l.classes[_].minprice,R),l.classes[_].maxprice=Math.max(l.classes[_].maxprice,I)):l.classes[_]={flights:[k],minprice:R,maxprice:I,currency:k.total.currency}}}))})),l&&Object.values(l.classes).find((function(e){var t;return(null===(t=null==e?void 0:e.flights)||void 0===t?void 0:t.length)>0}))&&a.push(l),a.filter((function(e){return!!e}))}},a.prototype.createGroupedItem=function(e,t,r,i,a,n,o,s){if((null==r?void 0:r.length)&&!e.departDateTime){var l=r[0],u=r[r.length-1];e.originAirport=l.originAirport,e.originAirportName=l.originAirportName,e.destinationAirport=u.destinationAirport,e.destinationAirportName=u.destinationAirportName,e.departDateTime=l.dateTimeDeparting,e.arrivalDateTime=u.dateTimeArriving,e.outboundTotalDuration=i,e.dataSource=t,e.operator=l.marketingCarrier,e.operatorFull=l.marketingCarrierName,e.outlegsCount=r.length,e.outlegs=r,e.outboundFlightNumber=this.helpers.joinFromAttribute("-","marketingFlightNumber",r),e.isReturn=!1,e.co2PerItem=o,e.co2PerPassenger=s}(null==a?void 0:a.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=a.length,e.inlegs=a,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",a),e.isReturn=!0)},a.prototype.makeSessionResults=function(e){return{results:e,grouped:this._grouped,query:this.resultQuery}},a.prototype.getMaxFlightPriceForBrand=function(e){var t=0;return e.forEach((function(e){var r;t<(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.getMinFlightPriceForBrand=function(e){var t=Number.MAX_SAFE_INTEGER;return e.forEach((function(e){var r;t>(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.resetQuery=function(e){void 0===e&&(e=!0),this.updateTempParams(this.searchService.makeFlightQuery()),e&&this._isValid()},a.prototype.resetParams=function(){this.reset(),this.resetQuery()},a.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[],this.tempParams.chosenSearchType===e.FlightSearchType.multiCity?this.multiCityValidation():(this._originAirport||this.validationMessages.push("Please add in a departure location"),this._destinationAirport||this.validationMessages.push("Please add in an arrival destination"),this.tempParams.outBoundDate.isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),this._originAirport&&this._destinationAirport&&this._destinationAirport===this._originAirport&&this.validationMessages.push("Origin and destination airport cannot be the same"),this.isReturn&&this.tempParams.outBoundDate.isSameOrAfter(this.tempParams.inTimeCriteria)&&this.validationMessages.push("Return date must be after the departure date")),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},a.prototype.multiCityValidation=function(){var e=!1,t=!1,r=!1;this.tempParams.multiDestination.map((function(i,a){i.orig||(e=!0,a<2&&(t=!0)),i.orig===i.dest&&(r=!0)})),l.default(this.tempParams.multiDestination[0].date).isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),t&&this.validationMessages.push("Please select landing airport(s)"),e&&this.validationMessages.push("Please select take off airport(s)"),r&&this.validationMessages.push("Take off and landing location(s) cannot be the same")},a.prototype.startSearch=function(){if(this.results.next([]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.flightfetcher.fetchList(e))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.Flight,searchArgs:e,travelDate:this.outBoundDate.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.startRecentSearch=function(r){var i,a,n=this,o=r.searchArgs;if(o.outboundDate){var s=o.outboundDepartureTimeWindow?o.outboundDepartureTimeWindow:o.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(o.outboundDate,s)}if(o.returnDate){var u=o.returnDepartureTimeWindow?o.returnDepartureTimeWindow:o.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(o.returnDate,u)}this.fareType=o.fareType,this.maxConnections=o.maxConnections,o.outboundCabinClass&&(this.cabinClass=o.outboundCabinClass[0]),o.returnCabinClass&&(this.returnCabinClass=o.returnCabinClass[0]),this.includeNearbyAirports=!!o.includeNearbyAirports,this.chosenSearchType=(null===(i=null==o?void 0:o.multiDestination)||void 0===i?void 0:i.length)?e.FlightSearchType.multiCity:o.returnTrip?e.FlightSearchType.return:e.FlightSearchType.oneWay,r.searchArgs.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:r.searchArgs.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,r.searchArgs.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:r.searchArgs.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,(null===(a=null==o?void 0:o.multiDestination)||void 0===a?void 0:a.length)?(this.outBoundDate=l.default(o.multiDestination[0].date),this.updateMultiDestination(o),this.departLocation=this.multiDestination[0].orig,this.arriveLocation=this.multiDestination[0].dest,this.searchService.simultaneousSearchesCheck(!0).then((function(e){n.searchService.startSearches()}))):t.combineLatest([this.searchService.getAirportByCode(r.searchArgs.originAirport),this.searchService.getAirportByCode(r.searchArgs.destinationAirport)]).subscribe((function(e){var t,i,a,o,s,l,u,c,d,h,p,m,f=S(e,2),v=f[0],y=f[1];if(v&&y){if(n.departLocation={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:n.searchService.processTerminals(v.iataMatch.terminals),country:null===(i=null===(t=v.iataMatch)||void 0===t?void 0:t.locationDetails)||void 0===i?void 0:i.country,postcode:null===(o=null===(a=v.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===o?void 0:o.postcode,countryCode:null===(l=null===(s=v.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.countryCode},n.arriveLocation={destination:y.iataMatch.name,gateway:y.iataMatch.iata,terminals:n.searchService.processTerminals(y.iataMatch.terminals),country:null===(c=null===(u=y.iataMatch)||void 0===u?void 0:u.locationDetails)||void 0===c?void 0:c.country,postcode:null===(h=null===(d=y.iataMatch)||void 0===d?void 0:d.locationDetails)||void 0===h?void 0:h.postcode,countryCode:null===(m=null===(p=y.iataMatch)||void 0===p?void 0:p.locationDetails)||void 0===m?void 0:m.countryCode},r.searchArgs.preferredCarriers){var b=[];r.searchArgs.preferredCarriers.map((function(e){n.searchService.getAirlinesList(e).subscribe((function(t){t.map((function(t){t.code===e&&b.push(t)})),n.preferredCarriers=b,n.searchService.startSearches()}))}))}n.searchService.simultaneousSearchesCheck(!0).then((function(e){n.searchService.startSearches()}))}})),this.searchService.startSearches()},a.prototype.updateMultiDestination=function(e){return y(this,void 0,void 0,(function(){var t,r=this;return b(this,(function(i){switch(i.label){case 0:return[4,Promise.all(e.multiDestination.map((function(e){return y(r,void 0,void 0,(function(){var t,r,i;return b(this,(function(a){switch(a.label){case 0:return r=t={date:void 0,dest:void 0,orig:void 0},[4,this.searchService.getAirportsList(e.orig).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.orig}))}))];case 1:return r.orig=a.sent(),i=t,[4,this.searchService.getAirportsList(e.dest).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.dest}))}))];case 2:return i.dest=a.sent(),e.date&&(t.date=l.default(e.date)),[2,t]}}))}))})))];case 1:return t=i.sent(),this.multiDestination=t,[2]}}))}))},a.prototype.makeDepartureTimeWindow=function(t,r,i){return r===e.TimeWindow.Depart?i?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4):null},a.prototype.makeArrivalTimeWindow=function(t,r,i){return r!==e.TimeWindow.Arrive?null:i?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4)},a.prototype.convertRecentSearchDateTime=function(e,t){if(t){var r=t.split("-");return l.default(e).add(l.default.duration(this.helpers.hhmmToTime(r[0]))).clone().add(2,"hour")}return l.default(e)},a.prototype.getSearchQuery=function(){var t=this.tempParams.chosenSearchType===e.FlightSearchType.multiCity;this._multiDestination=t?this.setMultiDestinationQuery(this.tempParams.multiDestination):null,this._multiDestination=this.tempParams.chosenSearchType===e.FlightSearchType.multiCity?this.setMultiDestinationQuery(this.tempParams.multiDestination):[];var r=this.searchService.isFlightsGrouped();return this.helpers.removeNulls(Object.assign({},t?{multiDestination:this._multiDestination}:{originAirport:this._originAirport,destinationAirport:this._destinationAirport,joinerOrLeaver:this.isErmTraveller(),outboundDate:this.helpers.formatIsoDate(this.tempParams.outBoundDate),outboundDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria,r),outboundArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria,r)},{passengers:this._passengers,returnTrip:this.isReturn,outboundCabinClass:this.tempParams.cabinClass?[this.tempParams.cabinClass]:null,requireFreeBag:null,maxConnections:this.tempParams.maxConnections,includeNearbyAirports:this.tempParams.includeNearbyAirports,preferredCarriers:this.tempParams.preferredCarriers.map((function(e){return(null==e?void 0:e.code)?e.code:null})),fareType:this.tempParams.fareType},this.isReturn?{returnDate:this.helpers.formatIsoDate(this.tempParams.inboundDate),returnDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria,r),returnArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria,r),returnCabinClass:this.tempParams.returnCabinClass?[this.tempParams.returnCabinClass]:null}:{}))},a.prototype.isErmTraveller=function(){if(this.searchService.ermTravellerType&&this.searchService.ermTravellerType!==e.ErmTravellerType.None)return this.searchService.ermTravellerType},a.prototype.updateTravellers=function(){for(var e=[],t=0;t<this.tempParams.adults;t+=1)e.push({type:x.Adult});for(t=0;t<this.tempParams.children;t+=1)e.push({type:x.Child});this._passengers=e,this._isValid()},a.prototype.updateAvaliableClasses=function(){var e=this.userService.getUserFavoriteObject(dt.HideFlightCabinClasses)||{any:!1,business:!1,economy:!1,first:!1,premiumEconomy:!1},t=[];e.any||t.push({name:"Any",type:H.Any}),e.economy||t.push({name:"Economy",type:H.Economy}),e.premiumEconomy||t.push({name:"Premium",type:H.PremiumEconomy}),e.business||t.push({name:"Business",type:H.Business}),e.first||t.push({name:"First",type:H.First}),this.cabinClass=this.getUpdatedCabinClass(this.cabinClass,e,t),this.returnCabinClass=this.getUpdatedCabinClass(this.returnCabinClass,e,t),this.avaliableClasses.next(t)},a.prototype.getUpdatedCabinClass=function(e,t,r){switch(e){case H.Any:return t.any?r[0].type:e;case H.Business:return t.business?r[0].type:e;case H.Economy:return t.economy?r[0].type:e;case H.First:return t.first?r[0].type:e;case H.PremiumEconomy:return t.premiumEconomy?r[0].type:e}return e},a.prototype.updateFromPreviousSearches=function(e){},a.prototype.updateSearchFromExpiredBasketItem=function(r){var i=this,a=r.searchQuery;if(a.outboundDate){var n=a.outboundDepartureTimeWindow?a.outboundDepartureTimeWindow:a.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(a.outboundDate,n)}if(a.returnDate){var o=a.returnDepartureTimeWindow?a.returnDepartureTimeWindow:a.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(a.returnDate,o)}this.fareType=a.fareType,this.maxConnections=a.maxConnections,a.outboundCabinClass&&(this.cabinClass=a.outboundCabinClass[0]),a.returnCabinClass&&(this.returnCabinClass=a.returnCabinClass[0]),this.includeNearbyAirports=!!a.includeNearbyAirports,this.chosenSearchType=a.returnTrip?e.FlightSearchType.return:e.FlightSearchType.oneWay,a.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:a.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,a.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:a.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,t.combineLatest([this.searchService.getAirportByCode(a.originAirport),this.searchService.getAirportByCode(a.destinationAirport)]).subscribe((function(e){var t,r,n,o,s,l,u,c,d,h,p,m,f=S(e,2),v=f[0],y=f[1];if(v&&y&&(i.departLocation={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:i.searchService.processTerminals(v.iataMatch.terminals),country:null===(r=null===(t=v.iataMatch)||void 0===t?void 0:t.locationDetails)||void 0===r?void 0:r.country,postcode:null===(o=null===(n=v.iataMatch)||void 0===n?void 0:n.locationDetails)||void 0===o?void 0:o.postcode,countryCode:null===(l=null===(s=v.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.countryCode},i.arriveLocation={destination:y.iataMatch.name,gateway:y.iataMatch.iata,terminals:i.searchService.processTerminals(y.iataMatch.terminals),country:null===(c=null===(u=y.iataMatch)||void 0===u?void 0:u.locationDetails)||void 0===c?void 0:c.country,postcode:null===(h=null===(d=y.iataMatch)||void 0===d?void 0:d.locationDetails)||void 0===h?void 0:h.postcode,countryCode:null===(m=null===(p=y.iataMatch)||void 0===p?void 0:p.locationDetails)||void 0===m?void 0:m.countryCode},a.preferredCarriers)){var b=a.preferredCarriers,g=[];b.map((function(e){i.searchService.getAirlinesList(e).subscribe((function(t){t.map((function(t){t.code===e&&g.push(t)})),i.preferredCarriers=g}))}))}})),r.users&&r.users.forEach((function(e){i.searchService.addTraveller(e)}))},a.prototype.getTotalBaggage=function(e){var t=0,r=JSON.parse(e.additional);return r&&r.outboundFlights?r.outboundFlights.forEach((function(e){e.baggage.forEach((function(e){e.allowance&&e.allowance>t&&(t=e.allowance)}))})):r&&r.baggageAllowance&&r.baggageAllowance.forEach((function(e){e.baggage.qty&&Number(e.baggage.qty)>t&&(t=Number(e.baggage.qty))})),t},a.prototype.isGroupedFlights=function(e){var t;return"FlightGroupedQuoteResult"===(null===(t=e[0])||void 0===t?void 0:t.type)},a.prototype.applyFilters=function(t,r){var i,a,n,o=this;this.currentFilters=t,this.currentSort=r,0===this.fullResults.length&&this.results.next([]);var s=this.selectedGroupFlight?(null===(i=this.selectedGroupFlight.inboundFlights)||void 0===i||i.length,function(t,r){return function(i){return r===e.FlightDirectionEnum.DualSingleInbound||t.includes(i.uid)}}):function(e){return function(e){return!0}},u=function(e,t){var r=Object.values(e).filter((function(e){return e.selected}));return r.length?function(e){return!!r.find((function(r){return t(e,r.value)}))}:function(e){return!0}},c=function(e,t){return e.replace("OUTBOUND_DEPARTURE","outboundFlights.0").replace("OUTBOUND_ARRIVAL","outboundFlights."+(t.outboundFlights.length-1)).replace("INBOUND_DEPARTURE","inboundFlights.0").replace("INBOUND_ARRIVAL","inboundFlights."+((t.inboundFlights||[]).length-1))},d=function(e,t){return function(r){var i,a=(i=o.helpers).fromObject.apply(i,C([r],c(t,r).split(".")));return a>=e.min&&a<=e.max}},h=function(e,t){return function(r){var i,a,n=l.default((i=o.helpers).fromObject.apply(i,C([r],c(t,r).split(".")))).get("hour"),s=l.default((a=o.helpers).fromObject.apply(a,C([r],c(t,r).split(".")))).get("minute"),u=Number(n+"."+o.helpers.normaliseMinuteToBase10(s));return u>=e.min&&u<=e.max}},p=function(e){return function(t,r){return t[e]===r}},m=[],f=[],v=[];m.push(h(t.arrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),m.push(h(t.departureTime,"OUTBOUND_DEPARTURE.dateTimeDeparting")),v.push(d(t.returnDuration,"outboundTotalDuration")),m.push(d(t.duration,"outboundTotalDuration")),m.push(d(t.price,"total.price")),m.push(u(t.stops,(function(e,t){return e.outboundFlights.length===t}))),f.push(u(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),v.push(u(t.totalStops,(function(e,t){return e.outboundFlights.length===t}))),m.push(u(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,C(r)):0)===t}))),m.push(u(t.depatureAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),m.push(u(t.arrivalAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[e.outboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),f.push(d(t.duration,"outboundTotalDuration")),f.push(d(t.price,"total.price")),v.push(d(t.price,"total.price")),f.push(h(t.returnArrivalTime,"INBOUND_ARRIVAL.dateTimeArriving")),v.push(h(t.returnArrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),f.push(h(t.returnDepartureTime,"INBOUND_DEPARTURE.dateTimeDeparting")),f.push(d(t.returnDuration,"inboundTotalDuration")),v.push(d(t.returnDuration,"outboundTotalDuration")),f.push(u(t.stops,(function(e,t){return e.inboundFlights.length===t}))),v.push(u(t.stops,(function(e,t){return e.outboundFlights.length===t}))),f.push(u(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),f.push(u(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,C(r)):0)===t}))),v.push(u(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,C(r)):0)===t}))),f.push(u(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),v.push(u(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),f.push(u(t.arrivalReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[e.inboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),v.push(u(t.arrivalReturnAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[e.outboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t})));var y=[];y.push(u(t.classes,p("cabinClass"))),y.push(u(t.airlines,p("marketingCarrier")));var b=[];b.push(u(t.classes,p("cabinClass"))),b.push(u(t.airlines,p("marketingCarrier")));var g=function(e){return m.reduce((function(t,r){return t=t&&r(e)}),!0)&&(!e.outboundFlights||!!(e.outboundFlights||[]).find((function(e){return!!y.reduce((function(t,r){return t&&r(e)}),!0)})))},A=function(e){var t;return f.reduce((function(t,r){return t&&r(e)}),!0)&&(!(null===(t=e.inboundFlights)||void 0===t?void 0:t.length)||!!(e.inboundFlights||[]).find((function(e){return!!b.reduce((function(t,r){return t&&r(e)}),!0)})))},T=function(e){var t;return v.reduce((function(t,r){return t&&r(e)}),!0)&&(!(null===(t=e.outboundFlights)||void 0===t?void 0:t.length)||!!(e.outboundFlights||[]).find((function(e){return!!b.reduce((function(t,r){return t&&r(e)}),!0)})))},D=(null===(a=this._ruleActionSummary)||void 0===a?void 0:a.dualSingleWhenSelected)&&this._ruleActionSummary.dualSingleWhenSelected[null===(n=this.selectedGroupFlight)||void 0===n?void 0:n.journeyHash]||{},P=function(e,t,r){return o.helpers.fieldFromObject(o._ruleActionSummary,["journeyWhenSelected",e.journeyHash,t])||o.helpers.fieldFromObject(o._ruleActionSummary,["whenSelectedAlone",e.journeyHash,t])||o.helpers.fieldFromObject(D,[e.journeyHash,t])||r},F=function(e){var t;return e.selected=e.uid===(null===(t=o.selectedGroupFlight)||void 0===t?void 0:t.uid),e.unavailable=P(e,"unavailable",!1),e.unavailableMessage=P(e,"unavailableMessage",""),e.requiresReason=P(e,"requiresReason",!1),e.requiresReasonMessage=P(e,"requiresReasonMessage",""),e};if(this.isGroupedFlights(this.fullResults)){var k=this._grouped.find((function(e){return e.referenceID===o.selectedGroupId})),_=Object.values((null==k?void 0:k.flights)||{}).reduce((function(e,t){return Array.isArray(t)?e.concat(t):e}),[]);this.results.next(this.helpers.clone(this.fullResults).filter((function(e){return!!e})).map((function(t){var r=t.direction===e.FlightDirectionEnum.Outbound||t.direction===e.FlightDirectionEnum.DualSingleOutbound?g:t.direction===e.FlightDirectionEnum.DualSingleInbound?T:A;return t.classes=Object.entries(t.classes).reduce((function(e,i){var a=S(i,2),n=a[0],o=a[1];if(o&&o.flights){var l=o.flights.filter((function(e){return!!e})).filter(s(_,t.direction)).filter(r).map(F);l.length>0&&(e[n]=Object.assign(Object.assign({},o),{flights:l}))}return e}),{}),t})).filter((function(e){return e&&Object.keys(e.classes).length>0})).sort(this._sortGroupedRoutines[r]))}else this.results.next(Object.freeze(this.helpers.clone(this.fullResults).map((function(e){var i=o.helpers.clone(e.journeys);if(t.flightNumber&&(i=i.filter((function(e){var r=e.outboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber})),i=e.inboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber}));if(r||i)return e}))),i=i.filter(g),o.isReturn){var a=o.helpers.clone(e.journeys);a=a.filter(A),i=o.mergeOutInBound(i,a)}return i.sort(o._sortItinaryRoutines[r]),{type:"FlightAllQuoteResult",journeys:i}}))))},a.prototype.mergeOutInBound=function(e,t){return Object.values(C(e,t).reduce((function(e,t){var r=t.uid,i=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(r[i[a]]=e[i[a]])}return r}(t,["uid"]);return e[r]||(e[r]=Object.assign(Object.assign(Object.assign({},e[r]||{}),{uid:r}),i)),e}),[]))},a.prototype.updateLowestPrice=function(e){if(e.length&&!this.searchService.isFlightsGrouped()){var t=e[0].journeys;if(t.length){var r=t[0].total.currency;return t.reduce((function(e,t){var r=t.total.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:r})}}},a.prototype.selectGroupedFlight=function(t,r,i){return y(this,void 0,void 0,(function(){var a,n,o=this;return b(this,(function(s){switch(s.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return a=s.sent(),(n=null==a?void 0:a.subject.value)&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.oneWay&&r===e.FlightDirectionEnum.Outbound?(this.bookSingleFlight(a,t),[2]):(!n||this.originalUserSearch.chosenSearchType!==e.FlightSearchType.return||r!==e.FlightDirectionEnum.Outbound&&r!==e.FlightDirectionEnum.DualSingleOutbound||(t.selected?(this.selectedGroupFlight=null,this.selectedGroupId=-1,this.applyFilters(this.currentFilters,this.currentSort)):(this.selectedGroupFlight=t,this.selectedGroupId=i,this.applyFilters(this.currentFilters,this.currentSort),this._updateTravelPolicies()),t.selected=!t.selected),n&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.return&&r===e.FlightDirectionEnum.Inbound&&this.selectedGroupFlight?(this.doBooking(a,t,{outboundFlights:C(t.outboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:C(t.inboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"inbound",0,t)}))),journeyType:"roundtrip",taxes:(t.taxes?t.taxes:[]).map((function(e){return{description:e.description,currency:e.currency,amount:e.amount}})),fareConditions:t.fareConditions},t.outboundFlights[0].dateTimeDepartingUTC,t.inboundFlights[0].dateTimeDepartingUTC),this.selectedGroupFlight.selected=!1,this.selectedGroupFlight=null,this.applyFilters(this.currentFilters,this.currentSort),[2]):(n&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.return&&r===e.FlightDirectionEnum.DualSingleInbound&&this.selectedGroupFlight&&(this.bookSingleFlight(a,this.selectedGroupFlight),this.bookSingleFlight(a,t),this.selectedGroupFlight.selected=!1,this.selectedGroupFlight=null,this.applyFilters(this.currentFilters,this.currentSort)),[2]))}}))}))},a.prototype._updateTravelPolicies=function(){var e=this;if(!(!this.selectedGroupFlight||this._ruleActionSummary.dualSingleWhenSelected&&this._ruleActionSummary.dualSingleWhenSelected[this.selectedGroupFlight.journeyHash])&&this.multi&&0!==this.multi.length){var t=(this.multi||[]).reduce((function(e,t){return 1===t.order&&t.results&&t.results.length>0&&(e=e.concat(t.results)),e}),[]);t.length>0&&(this.rawResults||(this.rawResults=this.storageService.getSessionItem(this.resultsSessionName+"_raw")),this.fetchingRules=!0,console.log(this.rawResults),this.applyFlightRules.fetchOne({selectedOutboundFlight:this.selectedGroupFlight,availableInboundFlights:t,searchId:this.rawResults.searchId}).pipe(r.take(1)).subscribe((function(t){t&&(e._ruleActionSummary=e.helpers.mergeObjects(e._ruleActionSummary,t),e._applyFilter())}),(function(){}),(function(){e.fetchingRules=!1})))}},a.prototype.bookSingleFlight=function(e,t){var r=this;this.doBooking(e,t,{outboundFlights:t.outboundFlights.map((function(e,t){return r.makeSchemaFlights(e,"outbound",0,t)})),inboundFlights:[],journeyType:"single",taxes:t.taxes.map((function(e){return{description:e.description,currency:e.currency,amount:e.amount}})),fareConditions:t.fareConditions},t.outboundFlights[0].dateTimeDeparting)},a.prototype.doBooking=function(t,r,i,a,n){return y(this,void 0,void 0,(function(){var o,s,l,u,c,d;return b(this,(function(h){switch(h.label){case 0:return o=r.sourceId,s=r.co2PerItem,l=r.co2PerPassenger,u=r.total,c={adults:this.adults,basket:t.id,children:this.children,co2PerItem:s,co2PerPassenger:l,currency:u.currency,detail:i,price:u.price,searchQuery:this.resultQuery,service:o.toString(),outboundDate:a,lowestPrice:this.absoluteCheapestPrice.amount!=Math.floor(u.price)||this.absoluteCheapestPrice.currencyCode!=u.currency?this.absoluteCheapestPrice.amount:null,lowestPriceCurrency:this.absoluteCheapestPrice.amount!=Math.floor(u.price)||this.absoluteCheapestPrice.currencyCode!=u.currency?this.absoluteCheapestPrice.currencyCode:null},n&&(c.inboundDate=n),[4,this.basketService.addToBasket(c,t,this.searchService,this.travellers,r.requiresReason)];case 1:return(d=h.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,d]}}))}))},Object.defineProperty(a.prototype,"absoluteCheapestPrice",{get:function(){if(this.cheapestPrice)return this.cheapestPrice;var e={amount:null,currencyCode:null};return this.cheapestPriceObject.dualInbound.amount+this.cheapestPriceObject.dualOutbound.amount<this.cheapestPriceObject.returns.amount&&this.cheapestPriceObject.dualInbound.currencyCode==this.cheapestPriceObject.dualOutbound.currencyCode?(e.amount=this.cheapestPriceObject.dualInbound.amount+this.cheapestPriceObject.dualOutbound.amount,e.currencyCode=this.cheapestPriceObject.dualInbound.currencyCode):e=this.cheapestPriceObject.returns,e},enumerable:!1,configurable:!0}),a.prototype.makeSchemaFlights=function(e,t,r,i){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:i}})},a.prototype.addFlightJourneysToBasket=function(t){return y(this,void 0,void 0,(function(){var r,i,a,n,o,s,u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return r=p.sent(),(null==r?void 0:r.subject.value)?(i=t.sourceId,a=t.co2PerItem,n=t.co2PerPassenger,o=t.total,s=l.default(t.outboundFlights[0].dateTimeDeparting),u=t.inboundFlights.length?l.default(t.inboundFlights[0].dateTimeDeparting):null,c=this.getTermsAndCond(),d={outboundFlights:C(t.outboundFlights.map((function(e,t){return Object.assign({},e)}))),inboundFlights:C(t.inboundFlights.map((function(e,t){return Object.assign({},e)}))),termsAndCond:c,journeyType:"single",taxes:t.taxes.map((function(e){return{description:e.description,currency:e.currency,amount:e.amount}})),fareConditions:t.fareConditions},h={adults:this.adults,basket:r.id,children:this.children,co2PerItem:a,co2PerPassenger:n,currency:o.currency,detail:d,price:o.price,searchQuery:this.resultQuery,service:i.toString(),outboundDate:s.format()},u&&(h.inboundDate=u.format(),d.journeyType="roundtrip"),[2,this.basketService.addToBasket(h,r,this.searchService,this.travellers,t.requiresReason)]):[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},a.prototype.setFlightDisplayType=function(e){this.selectedGroupFlight=null,this.choosenDisplayType.next(e)},a.prototype._applyFilter=function(){this.applyFilters(this.currentFilters,this.currentSort)},a.prototype.openFlightFareRules=function(e,t,r,i){var a=this;(void 0===r&&(r=null),void 0===i&&(i=null),Object.values(e).find((function(e){return e.length})))?this.modalService.open(d.ModalFlightFareComponent,r,{rules:e,from:t[0].originAirport,to:t[t.length-1].destinationAirport,flight:i}):this.searchService.getFlightFareRules(t[0]).subscribe((function(e){a.modalService.open(d.ModalFlightFareComponent,r,{rules:e.results[0],from:t[0].originAirport,to:t[t.length-1].destinationAirport,flight:i})}),(function(e){console.log(e)}))},a.prototype.getTermsAndCond=function(){return[{name:"Penalties",value:""},{name:"Eligibility",value:""},,{name:"Day/time",value:""},{name:"Seasonality",value:""},{name:"Flight Application",value:""},{name:"Advance Reservations/ticketing",value:""},{name:"Maximum Stay",value:""},{name:"Minimum Stay",value:""},{name:"Stopovers",value:""},{name:"Transfers",value:""},{name:"Combinations",value:""},{name:"Blackout Dates",value:""},{name:"Surcharges",value:""},{name:"Accompanied Travel",value:""},{name:"Travel Restrictions",value:""},{name:"Sales Restrictions",value:""},{name:"Hip/mileage Exceptions",value:""},{name:"Ticket Endorsements",value:""},{name:"Children Discounts",value:""},{name:"Tour Conductor Discounts",value:""},{name:"Agent Discounts",value:""},{name:"All Other Discounts",value:""},{name:"Miscellaneous Provisions",value:""},{name:"Fare By Rule",value:""},{name:"Groups",value:""},{name:"Tours",value:""},{name:"Visit Another Country",value:""},{name:"Deposits",value:""},{name:"Voluntary Changes",value:""},{name:"Voluntary Refunds",value:""},{name:"Negotiated Fares",value:""},{name:"Rule Application And Other Conditions",value:""}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Flight,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r,i=this;return b(this,(function(a){switch(a.label){case 0:return this.chosenSearchType=t.multiDestination?e.FlightSearchType.multiCity:t.returnTrip?e.FlightSearchType.return:e.FlightSearchType.oneWay,this.chosenSearchType!=e.FlightSearchType.multiCity?[3,2]:[4,Promise.all(t.multiDestination.map((function(e){return y(i,void 0,void 0,(function(){var t,r,i;return b(this,(function(a){switch(a.label){case 0:return r=t={date:void 0,dest:void 0,orig:void 0},[4,this.searchService.getAirportsList(e.orig).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.orig}))}))];case 1:return r.orig=a.sent(),i=t,[4,this.searchService.getAirportsList(e.dest).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.dest}))}))];case 2:return i.dest=a.sent(),[2,t]}}))}))})))];case 1:return r=a.sent(),this.multiDestination=r,[3,3];case 2:this.searchService.getAirportsList(t.originAirport).subscribe((function(e){i.departLocation=e.find((function(e){return e.gateway==t.originAirport}))})),this.searchService.getAirportsList(t.destinationAirport).subscribe((function(e){i.arriveLocation=e.find((function(e){return e.gateway==t.destinationAirport}))})),a.label=3;case 3:return this.cabinClass=t.outboundCabinClass[0],this.returnCabinClass=this.chosenSearchType!=e.FlightSearchType.return?null:t.returnCabinClass[0],this.includeNearbyAirports=t.includeNearbyAirports,this.adults=t.passengers.filter((function(e){return"ADULT"==e.type})).length,this.children=t.passengers.filter((function(e){return"CHILD"==e.type})).length,[2]}}))}))},a.prototype.updateSerchQuery=function(t){var r=t;switch(this.chosenSearchType){case e.FlightSearchType.multiCity:r.multiDestinationDetail=this.multiDestination;break;case e.FlightSearchType.return:case e.FlightSearchType.oneWay:r.departLocationDetail=this.departLocation,r.arriveLocationDetail=this.arriveLocation}return r},a.prototype.canBeEuroSearched=function(e,t){return void 0===e&&(e=this.departLocation.gateway),void 0===t&&(t=this.arriveLocation.gateway),!(!ft[e]||!ft[t])},a.prototype.canBeRailSearched=function(){return!(!vt[this.departLocation.gateway]||!vt[this.arriveLocation.gateway])},a.prototype.getFareRules=function(e){return{whenSelectedAlone:this._ruleActionSummary.whenSelectedAlone[e],journeyWhenSelected:this._ruleActionSummary.journeyWhenSelected[e]}},a}(c);St.STORAGE_SESSION_PARAMS="search_flight",St.STORAGE_SESSION_RESULTS="results_flight",(gt=e.URLS||(e.URLS={})).AccessToken="accessToken",gt.LOGOUT_URL="logout",gt.Refresh="refreshToken",gt.CONFERMA_THUMBNAIL_URL="https://ssl.conferma.com/Images/PropertyThumbnails/",gt.CONFIRMA_PHOTO_URL="/confermainfo/Info.aspx?mode=media&key=MICROSSABS&id=",gt.CONFIRMA_INFO_URL="/confermainfo/Info.aspx?mode=hotel&key=MICROSSABS&id=",gt.RECOVER_PASSWORD_URL="password/getResetToken",gt.RESET_PASSWORD="password/resetByToken",gt.BECOME_USER="startUserSupport",gt.END_BECOME_USER="endUserSupport",gt.ADMIN_USER_PANEL="https://admin-staging.ctmlightning.co.uk/user";var Ct,At,Tt=function(){this.priceRange={min:0,max:0},this.distanceRange={min:0,max:0},this.chain=[],this.amenitytype=[],this.preferred=[],this.extra=[],this.hotelName="",this.breakfastType=[],this.accessibleRoomType=[]};(Ct=e.HotelView||(e.HotelView={})).LIST="list",Ct.MAP="map",(At=e.SortTypesHotel||(e.SortTypesHotel={})).distance="distance",At.name="name",At.price="price";var Dt=function(i){function a(r,n,o,s,u,c,d,h,p,m,f,v){var y=i.call(this,d,n,h,o)||this;y.hotelFetcher=r,y.environment=s,y.avaliabilityService=u,y.basketService=c,y.httpCallService=p,y.quickListFetcher=m,y.getRailStationFetcher=f,y.applyHotelRulesFetcher=v,y.type=ne.Hotel,y.location_types=new t.BehaviorSubject([]),y.offices=new t.BehaviorSubject([]),y.lastActivePage=new t.BehaviorSubject(null),y.jitRulesReceived=new t.BehaviorSubject(!1),y.reapplySorting=new t.BehaviorSubject(!1),y.galleries={},y.occupied=0,y.results_details={chains:new Set,amenities:[],maxDistance:0},y._bookedTravellers=[],y.filterChange=new t.Subject,y.selectItemMapView=new t.Subject,y.display={minprice:Number.NEGATIVE_INFINITY,maxprice:Number.POSITIVE_INFINITY,filters:{breakfastType:[]}},y.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},y.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},y.localFilters=new Tt,y.currentView=e.HotelView.LIST,y._max_no_of_rooms=4,y._max_rooms_array=new Array(y._max_no_of_rooms).fill(0),y._max_no_of_occupants=8,y._max_occupant_array=new Array(y._max_no_of_occupants).fill(0),y._distance_list=[1,2,5,10,20,25],y._default_currency=null,y.resultsSessionName=a.STORAGE_SESSION_RESULTS,y.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,y.query={},y.filterResults=function(){y.resultsFilterMethod=function(e){return e.filter((function(e){return y.inPriceRange(e)&&y.inDistanceRange(e)&&y.containsHotelname(e)&&y.hasChain(e)&&y.breakfastTypeFilter(e)}))},console.log("nortmal sort results"),y.results.next(y.resultsFilterMethod(y.fullResults))},y.filterLighteningResults=function(){y.resultsFilterMethod=function(e){return e.filter((function(e){return y.containsHotelname(e)&&y.hasChain(e)&&y.hasPreferred(e)&&y.breakfastTypeFilter(e)&&y.getExtraFilter(e)&&y.getAmenitiesFilter(e)&&y.accessibleRoomTypeFilter(e)}))},console.log("lightning sort results");var e=y.resultsFilterMethod(y.fullResults);y.results.next(e),y.reapplySorting.next(!0)},y.results_details.chains=new Set;var b=d.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};y.default_currency=y.tempParams.currency?y.tempParams.currency:y._default_currency,y.updateTempParams(h.makeHotelQuery(b.tempParams)),o.fullUserDetails.userConfigs.subscribe((function(e){var t;console.log(e),e&&(null==e?void 0:e.hotel_defaults)&&y.updateTempParams(h.makeHotelQuery(null===(t=null==e?void 0:e.hotel_defaults)||void 0===t?void 0:t.config))})),h.shouldAddTravellerSubscription()&&h.travellerInformation.subscribe((function(e){y.travellers=e;var t=y.helpers.selectedTravellers(e,ne.Hotel);y.tempParams.no_of_occupants=t.adults.length,y.travellers=e,y._isValid()}));var g=d.getSessionItemAsList(y.resultsSessionName)||[];return g.slice(0,y.environment.numberHotelToPreload).forEach((function(e){y.searchService.canBook(ne.Hotel)&&y.avaliabilityService.getAvailabilityForId(y.makeHotelAvalilityObject(e),e)})),g.forEach((function(e){y.results_details.chains.add(e.group)})),y.fullResults=g,y._cheapestResultPrice=y.updateLowestPrice(g),y.jitRulesReceived.next(!1),y.results.next(g),y._isValid(),y.userService.changeUser.subscribe((function(t){y.location_types.next([e.LocationTypes.Airport,e.LocationTypes.City,e.LocationTypes.Office,e.LocationTypes.Shortlist,e.LocationTypes.TrainStation]),h.shouldFetchAllOffices()&&y.offices.next([])})),y.localFilters=new Tt,y.avaliabilityService.fetching.subscribe((function(e){var t=y.avaliabilityService.maxPriceForCurrency("GBP");t>0&&(y.filters.priceRange.max=t,y.localFilters.priceRange.max=t),y._cheapestResultPrice=y.updateLowestPrice(g),y.searchService.canBook(ne.Hotel)&&(y._applyTravelRules(),y.reapplySorting.next(!0))})),y}return m(a,i),Object.defineProperty(a.prototype,"chains",{get:function(){return C(this.results_details.chains)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"amenities",{get:function(){return C(this.results_details.amenities)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxDistance",{get:function(){return this.filters.distanceRange.max=Math.ceil(Math.max.apply(Math,this.results.value.map((function(e){return e.location.distance})))),this.results_details.maxDistance=this.filters.distanceRange.max,this.results_details.maxDistance},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxPrice",{get:function(){return Math.ceil(this.filters.priceRange.max)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkin_date_ngb",{get:function(){return this._checkin_date_ngb},set:function(e){this._checkin_date_ngb=e,this.tempParams.checkin_date=this.helpers.ngDateToMoment(e),this.checkin_date=this.helpers.ngDateToMoment(e)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkout_date_ngb",{get:function(){return this._checkout_date_ngb},set:function(e){this._checkout_date_ngb=e,this.tempParams.checkout_date=this.helpers.ngDateToMoment(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkin_date",{get:function(){return this.tempParams.checkin_date},set:function(e){e&&e.isValid()&&(this.tempParams.checkin_date=l.default(e),this._checkin_date_ngb=this.helpers.momentToNgDate(e),e.isSameOrBefore(this.tempParams.checkout_date)&&(this.checkout_date=l.default(e).add(1,"day")),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkout_date",{get:function(){return this.tempParams.checkout_date},set:function(e){e&&e.isValid()&&(this.tempParams.checkout_date=e,this.checkout_date_ngb=this.helpers.momentToNgDate(e),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"no_of_rooms",{get:function(){return this.tempParams.no_of_rooms},set:function(e){e>4||e<1||(this.tempParams.no_of_rooms=e,this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"no_of_occupants",{get:function(){return this.tempParams.no_of_occupants},set:function(e){e<1||(this.tempParams.no_of_occupants=e,this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"default_currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"location",{get:function(){return this.tempParams.location},set:function(e){this.tempParams.location=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"formatted_location",{get:function(){return this.tempParams.location?this.tempParams.location.destination:"No Location Set"},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"distance",{get:function(){return this.tempParams.distance},set:function(e){this.tempParams.distance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"prefered_hotels_only",{get:function(){return this.tempParams.prefered_hotels_only},set:function(e){this.tempParams.prefered_hotels_only=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"country",{get:function(){return this.tempParams.country},set:function(e){this.tempParams.country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"postcode",{get:function(){return this.tempParams.postcode},set:function(e){this.tempParams.postcode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"trainsStation",{get:function(){return this.tempParams.trainsStation},set:function(e){this.tempParams.trainsStation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"office",{get:function(){return this.tempParams.office},set:function(e){this.tempParams.office=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hotel_name",{get:function(){return this.tempParams.hotel_name},set:function(e){this.tempParams.hotel_name=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hotel_chain",{get:function(){return this.tempParams.hotel_chain},set:function(e){this.tempParams.hotel_chain=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"max_rooms_array",{get:function(){return this._max_rooms_array},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"max_occupant_array",{get:function(){return this._max_occupant_array},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"max_no_of_rooms",{get:function(){return this._max_no_of_rooms},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"distance_list",{get:function(){return this._distance_list},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"location_type_select",{get:function(){return this.tempParams.location_type_select},set:function(e){this.tempParams.location_type_select=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"filters",{get:function(){return this.localFilters},enumerable:!1,configurable:!0}),a.prototype.processResults=function(e){var t=this;return this.results_details.maxDistance=0,this.results_details.chains=new Set,e.map((function(e,r){t.results_details.maxDistance=Math.max(t.results_details.maxDistance,e.location.distance),t.filters.distanceRange.max=t.results_details.maxDistance,t.results_details.chains.add(e.group),r<t.environment.numberHotelToPreload&&t.avaliabilityService.getAvailabilityForId(t.makeHotelAvalilityObject(e),e);var i=e.transports.find((function(e){return"Airport"==e.type})),a=e.transports.find((function(e){return"TrainStation"==e.type})),n=e.transports.find((function(e){return"MetroStation"==e.type}));return Object.assign({sortedTags:t.sortTags(e.tags),Details:{distance_airport:i?i.distance:0,distance_metro:a?a.distance:0,distance_rail:n?n.distance:0,airport_details:i,metro_details:a,rail_details:n}},e)}))},a.prototype._applyTravelRules=function(){var e=this,t=this.helpers.clone(this.fullResults||[]).map((function(t){return e.avaliabilityService.updateHotel(t)})).filter((function(e){return Object.keys(e.availableRates||{}).length>0&&!e.receivedJitRules}));0!==t.length&&this.applyHotelRulesFetcher.fetchKeyedObject("id",{data:t}).pipe(r.take(1)).subscribe((function(t){e.fullResults=e.fullResults.map((function(r){return t[r.id]?e.avaliabilityService.setHotelAvalability(t[r.id]):r})),e.fullResults.forEach((function(e){e.availableRates?e.jitRemoveResultRule=!1:e.jitRemoveResultRule=!0}));var r=e.resultsFilterMethod?e.resultsFilterMethod(e.fullResults):e.fullResults;e._cheapestResultPrice=e.updateLowestPrice(r),e.jitRulesReceived.next(!0),e.results.next(r),e.reapplySorting.next(!0)}))},a.prototype.makeLocations=function(e){return this.helpers.arrayToObjectArray(e,["distanceType"])},a.prototype.sortTags=function(e){var t=this;return e?C(e).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(e){return Object.assign(Object.assign({},e),{icon:t.environment.tagMap[e.name]||e.icon})})):[]},a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeHotelQuery()),this.localFilters=new Tt,this.results_details={chains:new Set,amenities:[],maxDistance:0},this._isValid()},a.prototype._isValid=function(){var t,r,i,n,o,s;if(this.doChecks){switch(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams}),this.min_return_date=this.helpers.momentToNgDate(this.tempParams.checkin_date),this.tempParams.checkin_date.isSameOrAfter(this.tempParams.checkout_date)&&(this.checkout_date=l.default(this.tempParams.checkin_date).add(1,"day")),this.validationMessages=[],this.tempParams.location_type_select){case e.LocationTypes.City:this.country||this.validationMessages.push("Please select country"),this.location||this.postcode||this.validationMessages.push("Please select a hotel location or enter a postcode.");break;case e.LocationTypes.Office:"Office"===(null===(t=this.tempParams.location)||void 0===t?void 0:t.type)||this.office||this.validationMessages.push("Please select an office.");break;case e.LocationTypes.Airport:if(null===(r=this.tempParams)||void 0===r?void 0:r.location){(null===(i=this.tempParams.location.airport)||void 0===i?void 0:i.gateway)||this.validationMessages.push("Please select a airport.");break}this.validationMessages.push("Please select a airport.");break;case e.LocationTypes.TrainStation:(null===(o=null===(n=this.tempParams.location)||void 0===n?void 0:n.railstation)||void 0===o?void 0:o.stationCode)||(null===(s=this.trainsStation)||void 0===s?void 0:s.stationCode)||this.validationMessages.push("Please select a train station.");break;case e.LocationTypes.Shortlist:this.country||this.validationMessages.push("Please select country")}this.checkout_date&&this.checkout_date.isSameOrBefore(this.checkin_date)&&this.validationMessages.push("Checkout date must be after checkin date"),this.checkout_date&&this.checkout_date.isBefore(l.default())&&this.validationMessages.push("Checkout date must not be in the past"),this.checkin_date&&this.checkin_date.isBefore(l.default())&&this.validationMessages.push("Checkin date must not be in the past"),this.checkout_date&&this.checkin_date&&this.checkin_date.isAfter(this.checkout_date)&&this.validationMessages.push("Checkout data must be after the checkin date");var u=this.no_of_occupants/this.no_of_rooms;1!==u&&2!==u&&this.validationMessages.push("Occupants per room must be 1 or 2; if you have an odd number of travellers (greater than one); the no of rooms must be equal"),console.log(this.validationMessages),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)}},a.prototype.startSearch=function(){if(this._cheapestResultPrice=null,this.results.next([]),this.jitRulesReceived.next(!1),this.avaliabilityService.reset(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.buildQuery();var t=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(this.getSearchQuery())),this._startSearch(this.tempParams.location_type_select===e.LocationTypes.Shortlist?this.quickListFetcher.fetchList({countryCode:this.country.cCode}):this.hotelFetcher.fetchList(t))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Hotel,searchArgs:t,travelDate:this.checkin_date.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(t){var r,i=t;switch(i.location_type_select=this.location_type_select,(null===(r=this.location)||void 0===r?void 0:r.name)&&(i.cityName=this.location.name),i.location_type_select){case e.LocationTypes.Office:i.officeName=this.office.name;break;case e.LocationTypes.TrainStation:i.trainsStationDetail=this.trainsStation;break;case e.LocationTypes.Airport:i.airportDetail=this.location.airport}return i},a.prototype.startRecentSearch=function(t){var i=this;switch(this.location_type_select=t.searchArgs.location_type_select,this.currency=t.searchArgs.currency,this.distance=t.searchArgs.distance,this.no_of_rooms=t.searchArgs.rooms,this.checkin_date=l.default(t.searchArgs.startDate),this.checkout_date=l.default(t.searchArgs.endDate),this.hotel_name=t.searchArgs.hotelName,t.searchArgs.groupName&&(this.hotel_chain={name:t.searchArgs.groupName}),this.location_type_select){case e.LocationTypes.Airport:this.searchService.getAirportByCode(t.searchArgs.iata).subscribe((function(e){var t={airport:{gateway:e.iataMatch.iata}};i.location=Object.assign(Object.assign({},t),e.iataMatch),i.searchService.startSearches()}));break;case e.LocationTypes.City:this.country={cCode:t.searchArgs.countryCode,cName:""},t.searchArgs.latitude&&t.searchArgs.longitude?this.location={name:t.searchArgs.cityName,latitude:t.searchArgs.latitude,longitude:t.searchArgs.longitude}:t.searchArgs.postOrZipCode&&(this.postcode={name:t.searchArgs.postOrZipCode,type:e.LocationTypes.Postcode}),this.searchService.startSearches();break;case e.LocationTypes.Office:this.searchService.getOffice(t.searchArgs.officeId).pipe(r.take(1)).subscribe((function(e){i.office={id:e.id,name:e.name},i.searchService.startSearches()}));break;case e.LocationTypes.TrainStation:this.getRailStationByCode(t.searchArgs.trainStationCode).subscribe((function(t){i.trainsStation=Object.assign(Object.assign({},t),{type:e.LocationTypes.TrainStation}),i.searchService.startSearches()}));break;case e.LocationTypes.Shortlist:this.country={cCode:t.searchArgs.countryCode,cName:""},this.searchService.startSearches()}},a.prototype.getRailStationByCode=function(e){return e?this.getRailStationFetcher.fetchList({id:null,code:e}).pipe(r.take(1)):t.of()},a.prototype.getSearchQuery=function(e){return void 0===e&&(e=!1),this.buildQuery(e),this.helpers.removeNulls(this.query)},a.prototype.buildQuery=function(t){var r,i,a,n,o,s,l;void 0===t&&(t=!1);var u=t?this.originalUserSearch:this.tempParams;this.userCurrency||(this.userCurrency=null===(r=this.userService.getUserFavoriteObject(dt.LocalCurrency))||void 0===r?void 0:r.currency);var c={startDate:u.checkin_date.format("YYYY-MM-DD"),endDate:u.checkout_date.format("YYYY-MM-DD"),rooms:u.no_of_rooms,adults:u.no_of_occupants,currency:this.userCurrency||u.currency||null,distance:u.distance,distanceType:e.ɵb.M,maxResults:100};switch(this.getRoomNumber(),u.location_type_select){case e.LocationTypes.Airport:c.iata=u.location.airport.gateway;break;case e.LocationTypes.City:c.countryCode=u.country.cCode,this.location?(c.latitude=u.location.latitude,c.longitude=u.location.longitude):u.postcode&&(c.postOrZipCode=u.postcode.name);break;case e.LocationTypes.TrainStation:(null===(a=null===(i=u.location)||void 0===i?void 0:i.railstation)||void 0===a?void 0:a.stationCode)?c.trainStationCode=u.location.railstation.stationCode:(null===(n=u.trainsStation)||void 0===n?void 0:n.stationCode)&&(c.trainStationCode=u.trainsStation.stationCode);break;case e.LocationTypes.Office:(null===(o=u.location)||void 0===o?void 0:o.id)?c.officeId=+u.location.id:(null===(s=u.office)||void 0===s?void 0:s.id)&&(c.officeId=+u.office.id);break;case e.LocationTypes.Shortlist:c.countryCode=u.country.cCode;break;case e.LocationTypes.Postcode:c.countryCode=u.country.cCode,c.postOrZipCode=u.location.name}u.hotel_name&&(c.hotelName=u.hotel_name),u.hotel_chain&&(c.groupName=null===(l=u.hotel_chain)||void 0===l?void 0:l.name),this.query=c},a.prototype.makeHotelAvalilityObject=function(e){var t;return this.userCurrency||(this.userCurrency=null===(t=this.userService.getUserFavoriteObject(dt.LocalCurrency))||void 0===t?void 0:t.currency),{hotel:e.id,startDate:this.helpers.formatIsoDate(this.checkin_date),endDate:this.helpers.formatIsoDate(this.checkout_date),rooms:this.no_of_rooms,occupants:this.no_of_occupants,currency:this.userCurrency||"GBP"}},a.prototype.resultsHaveTag=function(e){var t=this,r=this.fullResults.filter((function(r){var i=r.tags.filter((function(r){if(r.name)return!!t.convertToOneString(r.name).toLowerCase().includes(t.convertToOneString(e).toLowerCase())}));return!!(i&&i.length>0)}));return!!(r&&r.length>0)},a.prototype.inPriceRange=function(e){var t,r,i=this.avaliabilityService.getAvailabilityValue(e);if(i){var a=(null===(r=null===(t=null==i?void 0:i.rooms[0])||void 0===t?void 0:t.currencyConversion)||void 0===r?void 0:r.rate)||1;return this.helpers.inRange(i.maxprice*a,this.filters.priceRange)&&this.helpers.inRange(i.minprice*a,this.filters.priceRange)}return!1},a.prototype.inDistanceRange=function(e){return 0===this.filters.distanceRange.max||this.helpers.inRange(e.location.distance,this.filters.distanceRange)},a.prototype.containsHotelname=function(e){var t=this.filters.hotelName.toLowerCase();return!(t&&t.length>0)||e.name.toLowerCase().includes(t)},a.prototype.inLighteningPriceRange=function(e){var t,r,i=this.avaliabilityService.getAvailabilityValue(e);if(i&&0!==Object.keys(i).length){var a,n=(null===(r=null===(t=null==i?void 0:i.rooms[0])||void 0===t?void 0:t.currencyConversion)||void 0===r?void 0:r.rate)||1,o=0,s=this.helpers.inRange(i.prpn*n,this.filters.priceRange);return o=(null==i?void 0:i.maxprice)?i.maxprice*n:null==i?void 0:i.rooms.reduce((function(e,t){return e>t.total?e:t.total}),0),a=this.helpers.inRange(o,this.filters.priceRange),s&&a}return!0},a.prototype.hasChain=function(e){var t=(this.filters.chain||[]).map((function(e){return e.toLowerCase()}));return!t||!t.length||!!t.find((function(t){return e.group.toLowerCase().includes(t)}))},a.prototype.breakfastTypeFilter=function(t){if(!this.filters.breakfastType.length)return!0;var r=this.getHotelObjectValue(t);if(!r||!(null==r?void 0:r.rooms))return!1;var i=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_INCLUDED),a=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_NOT_INCLUDED);return!!r.rooms.filter((function(e){return i&&a?e:i?e.rateDescription.match(Ne)&&!e.rateDescription.match(Me):a?!e.rateDescription.match(Ne)||e.rateDescription.match(Me):void 0})).length},a.prototype.accessibleRoomTypeFilter=function(e){if(!this.filters.accessibleRoomType.length)return!0;var t=this.getHotelObjectValue(e);return!(!t||!(null==t?void 0:t.rooms))&&!!t.rooms.filter((function(e){return e.rateDescription.match(Le)||e.roomDescription.match(Le)||e.roomType.match(Le)})).length},a.prototype.getHotelObjectValue=function(e){var t=this.avaliabilityService.getAvailabilityForId(this.makeHotelAvalilityObject(e),e);return t||t.value?t.value:null},a.prototype.byMostExpensive=function(){this.sortByPrice(!1)},a.prototype.sortByPrice=function(e,t){var r=this;void 0===e&&(e=!0),void 0===t&&(t=!1);var i=this.fullResults,a=[],n=[];i.map((function(e){var t;(null===(t=r.avaliabilityService.getAvailabilityValue(e))||void 0===t?void 0:t.prpn)?a.push(e):n.push(e)})),a.sort((function(t,i){var a,n,o=null===(a=r.avaliabilityService.getAvailabilityValue(t))||void 0===a?void 0:a.prpn,s=null===(n=r.avaliabilityService.getAvailabilityValue(i))||void 0===n?void 0:n.prpn;return e?o>s?1:s>o?-1:0:o<s?1:s<o?-1:0}));var o=C(a,n);this.results.next(o),t&&(console.log("++ sortByPrice() called ++"),console.log("++ hotel ++",i),console.log("++ hotelsWithPrices ++",a),console.log("++ hotelsWithoutPrices ++",n),console.log("++ sortedHotels ++",o))},a.prototype.sortByName=function(){this.results.next(this.helpers.clone(this.results.value).sort((function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())})))},a.prototype.sortByDistance=function(){var e=this.helpers.clone(this.results.value);try{e=e.sort((function(e,t){return Number(e.location.distance)-Number(t.location.distance)}))}catch(e){console.error("+++ Error sorting by preferred: ",e," +++")}this.results.next(e)},a.prototype.byPreferred=function(){var e=this,t=this.helpers.clone(this.results.value);try{t=t.sort((function(t,r){var i,a,n,o;if(e.preferredToInt(r)-e.preferredToInt(t)!=0)return e.preferredToInt(r)-e.preferredToInt(t);var s=(null===(i=e.avaliabilityService.getAvailabilityValue(t))||void 0===i?void 0:i.prpn)?null===(a=e.avaliabilityService.getAvailabilityValue(t))||void 0===a?void 0:a.prpn:Number.MAX_SAFE_INTEGER,l=(null===(n=e.avaliabilityService.getAvailabilityValue(r))||void 0===n?void 0:n.prpn)?null===(o=e.avaliabilityService.getAvailabilityValue(r))||void 0===o?void 0:o.prpn:Number.MAX_SAFE_INTEGER;return s>l?1:l>s?-1:0}))}catch(e){console.error("+++ Error sorting by preferred: ",e," +++")}this.results.next(t)},a.prototype.preferredToInt=function(e){return(e.preferred.client?2:0)+(e.preferred.consumer?1:0)},a.prototype.intToPreferred=function(e){return{client:2==(2&e),consumer:1==(1&e)}},a.prototype.addFilter=function(e,t){this.localFilters[t].push(e)},a.prototype.removeFilter=function(e,t){var r=this.localFilters;Array.isArray(r[t])&&(r[t]=r[t].filter((function(t){return e!==t})))},a.prototype.resetFilters=function(){this.localFilters.chain=[],this.localFilters.amenitytype=[],this.localFilters.preferred=[],this.localFilters.extra=[],this.localFilters.hotelName="",this.localFilters.breakfastType=[]},a.prototype.updateSearchFromExpiredBasketItem=function(t){var i,a,n,o,s=this,u=t.searchQuery;this.currency=u.currency,this.distance=u.distance,this.no_of_rooms=u.rooms,this.checkin_date=l.default(u.startDate),this.checkout_date=l.default(u.endDate),this.hotel_name=u.hotelName,u.groupName&&(this.hotel_chain={name:u.groupName}),u.iata?(this.location_type_select=e.LocationTypes.Airport,this.searchService.getAirportByCode(u.iata).subscribe((function(e){var t={airport:{gateway:e.iataMatch.iata}};s.location=Object.assign(Object.assign({},t),e.iataMatch)}))):u.latitude&&u.longitude?(this.location_type_select=e.LocationTypes.City,this.location={name:(null===(a=null===(i=t.detail)||void 0===i?void 0:i.hotelAaddress)||void 0===a?void 0:a.town)?null===(o=null===(n=t.detail)||void 0===n?void 0:n.hotelAaddress)||void 0===o?void 0:o.town:"",latitude:u.latitude,longitude:u.longitude}):u.postOrZipCode?(this.location_type_select=e.LocationTypes.Postcode,this.postcode={name:u.postOrZipCode,type:e.LocationTypes.Postcode}):u.officeId?(this.location_type_select=e.LocationTypes.Office,this.searchService.getOffice(u.officeId).pipe(r.take(1)).subscribe((function(e){s.office={id:e.id,name:e.name}}))):u.trainStationCode?(this.location_type_select=e.LocationTypes.TrainStation,this.getRailStationByCode(u.trainStationCode).subscribe((function(t){s.trainsStation=Object.assign(Object.assign({},t),{type:e.LocationTypes.TrainStation})}))):u.countryCode&&(this.location_type_select=e.LocationTypes.Shortlist,this.country={cCode:u.countryCode,cName:""}),t.users&&t.users.forEach((function(e){s.searchService.addTraveller(e)}))},a.prototype.updateFromPreviousSearches=function(t){var r,i,a;console.log("PREPOPULATING HOTEL FORM");var n=null===(r=t[ne.Flight])||void 0===r?void 0:r.searchQuery,o=null===(i=t[ne.Rail])||void 0===i?void 0:i.searchQuery,s=null===(a=t[ne.InternationalRail])||void 0===a?void 0:a.searchQuery;if(n)try{this.location_type_select=e.LocationTypes.Airport,this.checkin_date=this.searchService.searches[ne.Flight].outBoundDate,this.checkout_date=this.searchService.searches[ne.Flight].inboundDate,this.searchService.searches[ne.Flight].arriveLocation.postcode?this.location={name:this.searchService.searches[ne.Flight].arriveLocation.destination,type:"Airport",airport:this.searchService.searches[ne.Flight].arriveLocation}:this.location=null}catch(e){console.error("Error trying to prepopulate hotel from flight item")}else if(o)try{this.location_type_select=e.LocationTypes.TrainStation,this.checkin_date=this.searchService.searches[ne.Rail].outBoundDateTime,this.checkout_date=this.searchService.searches[ne.Rail].inBoundDateTime,this.trainsStation=this.searchService.searches[ne.Rail].travellingTo,this.location=this.searchService.searches[ne.Rail].travellingTo}catch(e){console.error("Error trying to prepopulate hotel from rail item")}else if(s)try{this.location_type_select=e.LocationTypes.TrainStation,this.checkin_date=this.searchService.searches[ne.InternationalRail].outBoundDateTime,this.checkout_date=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime,this.trainsStation=this.searchService.searches[ne.InternationalRail].travellingTo,this.location=this.searchService.searches[ne.InternationalRail].travellingTo}catch(e){console.error("Error trying to prepopulate hotel from international rail item")}},a.prototype.hasPreferred=function(t){var r=this.filters.preferred;return!(r.length&&!r.includes(e.SearchHandler.ANY))||(r.includes(e.SearchHandler.AGENCY)&&r.includes(e.SearchHandler.CLIENT)?!0===t.preferred.consumer&&!0===t.preferred.client:r.includes(e.SearchHandler.AGENCY)?!0===t.preferred.consumer:r.includes(e.SearchHandler.CLIENT)?!0===t.preferred.client:void 0)},a.prototype.atLeastOnePreferredAgentHotel=function(){for(var e=0;e<this.results.value.length;e++)if(this.results.value[e].preferred.consumer)return!0;return!1},a.prototype.atLeastOnePreferredClientHotel=function(){for(var e=0;e<this.results.value.length;e++)if(this.results.value[e].preferred.client)return!0;return!1},a.prototype.getmaxPriceForCurrency=function(e){return this.avaliabilityService.maxPriceForCurrency(e)},a.prototype.getExtraFilter=function(t){var r=this;return this.filters.extra.includes(e.SearchHandler.AVAILABILITY)?!!t.availableRates:!this.filters.extra.includes(e.SearchHandler.FEMALE_FRIENDLY)||t.tags.filter((function(t){return!t.name||r.convertToOneString(t.name).toLowerCase().includes(r.convertToOneString(e.SearchHandler.FEMALE_FRIENDLY).toLowerCase())})).length>0},a.prototype.getAmenitiesFilter=function(e){var t=this,r=!0;return this.filters.amenitytype.forEach((function(i){var a=e.tags.filter((function(e){if(e.name)return!!t.convertToOneString(e.name).toLowerCase().includes(t.convertToOneString(i).toLowerCase())}));return r=!!(a&&a.length>0)})),r},a.prototype.convertToOneString=function(e){return e.replace(/[^a-zA-Z]/g,"")},a.prototype.getImages=function(i){var a=this,n=this.environment.hostBaseUrl+e.URLS.CONFIRMA_PHOTO_URL+i.split(",")[0];return this.galleries[i]?t.of(this.galleries[i]):this.httpCallService.get(n,{responseType:"text"}).pipe(r.map((function(e){if(!e)throw Error("Gallery for "+i+" can not be loaded.");var t=document.createElement("div");t.innerHTML=e;var r=Array.from(t.getElementsByTagName("img")).reduce((function(e,t){return t.src.includes("https://www.vfmii.com/")&&e.push(t.src),e}),[]);if(!r.length)throw Error("There is no media content provided for this hotel "+i);return a.galleries[i]=r})))},a.prototype.addPaginationPage=function(e){var t="PaginationPageCount";return this.storageService.setSessionItem(t,e),this.storageService.getSessionItem(t)},a.prototype.toggleView=function(){this.currentView===e.HotelView.LIST?this.currentView=e.HotelView.MAP:this.currentView=e.HotelView.LIST},a.prototype.calcDayDiff=function(){var e=l.default(this.checkout_date),t=l.default(this.checkin_date);return e.startOf("day").diff(t.startOf("day"),"days")},a.prototype.updateLowestPrice=function(e){var t=Object.keys(this.avaliabilityService.currencies);if(!e.length&&!t.length||!t.length)return null;var r=t[0];return{amount:this.avaliabilityService.currencies[r].minprice,currencyCode:r}},a.prototype.getRoomNumber=function(){for(var e=[],t=0;t<Number(this.tempParams.no_of_rooms);t++){var r={Adults:this.calcRoomOccupancy(this.tempParams.no_of_rooms,this.tempParams.no_of_occupants),Children:0,Infants:0};e.push(r)}for(var i=[],a=0;a<e.length;a++)for(var n=0;n<e[a].Adults;n++)i.push(a+1)},a.prototype.calcRoomOccupancy=function(e,t){console.log("No of Travellers: "+t+"| No of rooms: "+e+" | Assigned: "+this.occupied);var r=Math.ceil(t/e);return t-this.occupied<r&&(console.log("We have run out of occupiers!"),r=t-this.occupied),r<=0&&(r=1),this.occupied+=r,r},a.prototype.addHotelRoomToBasket=function(t,r,i,a){return y(this,void 0,void 0,(function(){var a,n,o,l,u,c,d,h,p,m,f=this;return b(this,(function(v){switch(v.label){case 0:return console.log(t),console.log(r),console.log(i),t.unavailable?[2,e.DifferentInvokdedUserReasons.cancel]:(i.startDate=new Date(i.startDate).toISOString(),i.endDate=new Date(i.endDate).toISOString(),delete(a=Object.assign({},i)).adults,(n=[]).push({rateDescription:r.rateDescription,roomDescription:r.roomDescription,roomId:r.roomId,roomType:r.roomType,rateCode:r.rateCode,checkIn:i.startDate,checkOut:i.endDate}),[4,this.basketService.getDefaultBasket()]);case 1:return o=v.sent(),(l=null==o?void 0:o.subject.value)?(u=this.tempParams.no_of_occupants,c=new Array(this.tempParams.no_of_rooms).fill("TEST"),d=this.tempParams.no_of_rooms===u?1:2,h=s.default.chunk(this.travellers,d),p=t.address,m=this.getTermsAndCond(r,i),[2,c.reduce((function(s,u,c){return y(f,void 0,void 0,(function(){var u,f,v,y,g,S,C,A,T,D;return b(this,(function(b){switch(b.label){case 0:return[4,s];case 1:switch(b.sent()){case e.DifferentInvokdedUserReasons.cancel:return[2,e.DifferentInvokdedUserReasons.cancel];case e.DifferentInvokdedUserReasons.research:return[2,e.DifferentInvokdedUserReasons.research];case e.DifferentInvokdedUserReasons.continue:case e.DifferentInvokdedUserReasons.newBasket:}return[4,this.basketService.addToBasket({adults:d,basket:l.id,service:t.sourceId.toString(),detail:{hotelAddress:{streetName:p.addressLine1,town:p.addressLine2,county:p.addressLine3,postcode:p.postOrZipCode,countryCode:p.countryCode},hotelDescription:t.group,hotelFaxNumber:p.facsimile,hotelPhoneNumber:p.telephone,hotelId:t.id,hotelName:t.name,numberOfRooms:1,rooms:n,termsAndCond:m,hotelPreferred:t.preferred,hotelDistance:{search:t.location.distance.toFixed(2),airport:null===(u=t.transports.find((function(e){return"Airport"==e.type})))||void 0===u?void 0:u.distance.toFixed(2),train:null===(f=t.transports.find((function(e){return"TrainStation"==e.type})))||void 0===f?void 0:f.distance.toFixed(2),metro:null===(v=t.transports.find((function(e){return"MetroStation"==e.type})))||void 0===v?void 0:v.distance.toFixed(2)},location:{longitude:t.location.longitude,latitude:t.location.latitude}},price:r.total,currency:r.currencyCode,searchQuery:a,outboundDate:i.startDate,lowestPrice:(null===(y=this.cheapestPrice)||void 0===y?void 0:y.amount)!=r.total||(null===(g=this.cheapestPrice)||void 0===g?void 0:g.currencyCode)!=r.currencyCode?null===(S=this.cheapestPrice)||void 0===S?void 0:S.amount:null,lowestPriceCurrency:(null===(C=this.cheapestPrice)||void 0===C?void 0:C.amount)!=r.total||(null===(A=this.cheapestPrice)||void 0===A?void 0:A.currencyCode)!=r.currencyCode?null===(T=this.cheapestPrice)||void 0===T?void 0:T.currencyCode:null},o,this.searchService,h[c]||[],r.requiresReason)];case 2:return(D=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,D]}}))}))}),e.DifferentInvokdedUserReasons.continue)]):[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.getTermsAndCond=function(e,t){return[{name:"Rate Information",value:e.rateDescription},{name:"Cancellation Policy",value:e.policies.cancellation},{name:"Rate Code",value:e.rateCode},{name:"Room Information",value:e.roomDescription},{name:"Deposit Amount",value:(e.total*t.rooms).toString()+t.currency}]},a.prototype.saveSearch=function(e){if(void 0===e&&(e=null),this.isValid.value){var t=this.getSearchQuery(),r=this.updateSerchQuery(t);e&&(r.hotelName=e);var i={name:""+l.default(),serviceType:ne.Hotel,searchArgs:r};return this.searchService.saveFavouriteSearch(i)}},a.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r;return b(this,(function(i){return this.no_of_occupants=t.adults,this.no_of_rooms=t.rooms,this.distance=t.distance,this.currency=t.currency,r={latitude:t.latitude,longitude:t.longitude,countryCode:t.countryCode,name:t.cityName},t.trainStationCode?r.type=e.LocationTypes.TrainStation:t.officeId?r.type=e.LocationTypes.Office:t.iata?r.type=e.LocationTypes.Airport:t.postOrZipCode?r.type=e.LocationTypes.Postcode:r.type=e.LocationTypes.City,this.location=r,this.hotel_name=t.hotelName,t.groupName?this.hotel_chain={name:t.groupName}:this.hotel_chain=null,[2]}))}))},a}(c);Dt.STORAGE_SESSION_PARAMS="search_hotel",Dt.STORAGE_SESSION_RESULTS="results_hotel";var Pt=function(r){function i(e,a,n,o,s,u){var c=r.call(this,o,a,s,u)||this;c.loungefetcher=e,c.basketService=n,c.type=ne.Lounge,c.terminals=new t.BehaviorSubject([]),c._flightNumber=null,c._selectedTerminal="",c.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c._date=null,c._time=null,c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS;var d=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(s.makeLoungesQuery(d.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){var t=c.helpers.selectedTravellers(e,ne.Lounge);c.tempParams.adults=t.adults.length,c.tempParams.children=t.children.length,c.travellers=e,c._isValid()}));var h=o.getSessionItemAsList(c.resultsSessionName)||[];return c._cheapestResultPrice=c.updateLowestPrice(h),c.results.next(h||[]),c}return m(i,r),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){var t;this.tempParams.locationCode=e;var r=null===(t=this.terminals)||void 0===t?void 0:t.value;"string"==typeof e?(this._locationCode="",this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this.terminal=null,this.terminals.next(e.terminals),1===r.length&&(this.selectedTerminal=r[0].key),this._isValid()):(this._locationCode=null,this.terminal=null,this.selectedTerminal=null,this.terminals.next([]),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this.tempParams.terminal?this.tempParams.terminal.toString():null},set:function(e){this.tempParams.terminal=e;var t=this.terminals.value.find((function(t,r){if(t.value===e)return!0}));t?this.selectedTerminal=t.key:this.terminals.value&&this.terminals.value.length>0?this.selectedTerminal=this.terminals.value[0].key:this.selectedTerminal="Any Terminal",this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalDatetime",{get:function(){return this.tempParams.arrivalDatetime},set:function(e){e.isValid()?(this.tempParams.arrivalDatetime=e,this._date=this.helpers.momentToNgDate(e),this._time=this.helpers.formatTimeColon(e)):this.tempParams.arrivalDatetime=null,this._isValid()},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeLoungesQuery()),this._isValid()},i.prototype.getSearchQuery=function(){var e={adults:this.tempParams.adults,children:this.tempParams.children,infants:this.tempParams.infants,locationCode:this._locationCode,terminal:"Any"===this.tempParams.terminal?null:this.tempParams.terminal,arrivalDatetime:this.tempParams.arrivalDatetime};return this.helpers.removeNulls(e)},i.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,travellers:this.travellers}),this.validationMessages=[],this._locationCode&&""!==this._locationCode||this.validationMessages.push("You must select airport first."),this.tempParams.arrivalDatetime.unix()<l.default().unix()&&this.validationMessages.push("Outward journey cannot be in the past."),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype._updateDateTime=function(){if(this._date&&this._time){var e=this.helpers.ngDateToMoment(this._date,this._time);this.tempParams.arrivalDatetime=e.isValid()?e:null,this._isValid()}},i.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.loungefetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.Lounge,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.terminal=e.searchArgs.terminal,this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(r){var i,a,n,o,s,l;r&&(t.locationCode={country:null===(a=null===(i=r.iataMatch)||void 0===i?void 0:i.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(o=null===(n=r.iataMatch)||void 0===n?void 0:n.locationDetails)||void 0===o?void 0:o.countryCode,destination:r.iataMatch.name,gateway:r.iataMatch.iata,postcode:null===(l=null===(s=r.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.postcode,terminals:t.searchService.processTerminals(r.iataMatch.terminals)},t.terminal=e.searchArgs.terminal,t.searchService.startSearches())})),this.searchService.startSearches()},i.prototype.sortByPrice=function(e,t){void 0===t&&(t=[]);var r=C(this.fullResults);r.length||(r=t),r=this.sortResultsPrice(r,e),this.results.next(r)},i.prototype.sortResultsPrice=function(e,t){var r=C(e);return r=t?r.sort((function(e,t){return t.price-e.price})):r.sort((function(e,t){return e.price-t.price}))},i.prototype.sortByTerminal=function(e){void 0===e&&(e=[]);var t=C(this.fullResults);t.length||(t=e);this.results.next(t.sort((function(e,t){return-1})))},i.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n;console.log("PREPOPULATING LOUNGE FORM");var o=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,s=null===(r=e[ne.InternationalRail])||void 0===r?void 0:r.searchQuery,l=null===(i=e[ne.Rail])||void 0===i?void 0:i.searchQuery,u=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,c=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery;if(o)try{var d=this.searchService.searches[ne.Flight].outBoundDate.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate lounge from flight item")}else if(l)try{d=this.searchService.searches[ne.Rail].outBoundDateTime.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate lounge from rail item")}else if(s)try{d=this.searchService.searches[ne.InternationalRail].outBoundDateTime.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate lounge from international rail item")}else if(u)try{d=this.searchService.searches[ne.Hotel].checkin_date.toDate();this.date={day:d.getUTCDate(),month:d.getUTCMonth()+1,year:d.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate lounge from hotel item")}else if(c)try{d=this.searchService.searches[ne.Car].pickup_date;this.date=d}catch(e){console.error("Error trying to prepopulate lounge from car item")}},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;r&&(this.arrivalDatetime=l.default(r.arrivalDatetime),this.terminal=r.terminal,this.searchService.getAirportByCode(r.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)})}))),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},i.prototype.addLoungeToBasket=function(t,r){var i,a,n,o,s,l,u;return y(this,void 0,void 0,(function(){var c,d,h,p;return b(this,(function(m){switch(m.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return c=m.sent(),d=null==c?void 0:c.subject.value,h=this.getTermsAndCond(t),d?[4,this.basketService.addToBasket({adults:r.adults,children:r.children,infants:r.infants,basket:d.id,service:t.sourceId.toString(),detail:{arrivalDatetime:r.arrivalDatetime.format(),locationCode:t.code,name:t.name,airportIata:null==r?void 0:r.locationCode,logo:t.lounge.logo,introduction:t.lounge.introduction,covidCopy:t.lounge.misc.covidCopy,cancellationInfo:t.lounge.cancellationInfo,admendmentsInfo:t.lounge.amendmentsInfo,checkInInfo:t.lounge.checkInInfo,dressCode:t.lounge.dressCode,foodAndBeverage:t.lounge.foodAndBeverage,whatsIncludedFood:t.lounge.whatsIncludedFood,whatsIncludedDrinks:t.lounge.whatsIncludedDrinks,whatsIncludedExtras:t.lounge.whatsIncludedExtras,groupInfo:t.lounge.groupInfo,terminal:null===(i=t.lounge.terminal)||void 0===i?void 0:i.toString(),termsAndCond:h},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format(),lowestPrice:(null===(a=this.cheapestPrice)||void 0===a?void 0:a.amount)!=t.price||(null===(n=this.cheapestPrice)||void 0===n?void 0:n.currencyCode)!=t.currency?null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount:null,lowestPriceCurrency:(null===(s=this.cheapestPrice)||void 0===s?void 0:s.amount)!=t.price||(null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode)!=t.currency?null===(u=this.cheapestPrice)||void 0===u?void 0:u.currencyCode:null},c,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(p=m.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,p];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.lounge.name},{name:"Telephone",value:e.lounge.telephone},{name:"Important Information",value:e.lounge.misc.importantInformation},{name:"Introduction",value:e.lounge.introduction},{name:"Dress Code",value:e.lounge.dressCode},{name:"Business Facilities",value:e.lounge.misc.businessfacilities},{name:"Entertainment Facilities",value:e.lounge.misc.entertainmentFacilities},{name:"Disabled Facilities",value:e.lounge.misc.facilitiesdisabled},{name:"Facilities",value:e.lounge.facilities.toString()},{name:"Times",value:"Opens "+e.lounge.openTime+"; Closes "+e.lounge.closeTime},{name:"Directions",value:e.lounge.directions},{name:"Groups",value:e.lounge.groupInfo},{name:"Check-In Time",value:e.lounge.checkInInfo},{name:"Amend Info",value:e.lounge.amendmentsInfo},{name:"Cancel Info",value:e.lounge.cancellationInfo}]},i.prototype.updateLowestPrice=function(e){if(!e.length)return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ne.Lounge,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},i.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.searchService.getAirportsList(e.locationCode).subscribe((function(r){t.locationCode=r.find((function(t){return t.gateway==e.locationCode})),t.terminal=e.terminal})),this.adults=e.adults,this.children=e.children,this.infants=e.infants,[2]}))}))},i}(c);Pt.STORAGE_SESSION_PARAMS="search_lounge",Pt.STORAGE_SESSION_RESULTS="results_lounge";var Ft,kt,_t={AirportFirst:"You must select airport first.",InvardJourney:"Inward journey cannot be in the past.",OutwardJourney:"Outward journey cannot be in the past.",DateOverlapped:"Inward Journey can not be before outward journey"},Rt=function(r){function i(e,a,n,o,s,u){var c=r.call(this,o,a,s,u)||this;c.parkingfetcher=e,c.basketService=n,c.type=ne.Parking,c.terminals=new t.BehaviorSubject([]),c.listViewToggle=new t.BehaviorSubject(null),c.parkingFiltersText={onAirport:"On Airport",meetAndGreet:"Meet and greet",parkAndRide:"Park and ride",parkAndStroll:"Park and stroll",carParkedForYou:"Car parked for you"},c._selectedTerminal="",c.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,c._outdate=null,c._outtime=null,c._indate=null,c._intime=null;var d=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(s.makeParkingQuery(d.tempParams));var h=o.getSessionItemAsList(c.resultsSessionName)||[];return c.results.next(h),c._cheapestResultPrice=c.updateLowestPrice(h),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){c.travellers=(null==e?void 0:e.slice(0,1))||[],c._isValid()})),c}return m(i,r),Object.defineProperty(i.prototype,"outdate",{get:function(){return this._outdate},set:function(e){this._outdate=e,this._outdate&&this._outdate&&(this.arrivalDatetime=this.helpers.ngDateToMoment(this._outdate,this._outtime))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outtime",{get:function(){return this._outtime},set:function(e){this._outtime=e,this._outdate&&this._outtime&&(this.arrivalDatetime=this.helpers.ngDateToMoment(this._outdate,this._outtime))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"departDatetime",{get:function(){return this.tempParams.departDatetime},set:function(e){this.tempParams.departDatetime=e.isValid()?e:null,e&&e.isValid()&&(this._indate=this.helpers.momentToNgDate(e),this._intime=this.helpers.formatTimeColon(e)),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"indate",{get:function(){return this._indate},set:function(e){this._indate=e,this._indate&&this._intime&&(this.departDatetime=this.helpers.ngDateToMoment(this._indate,this._intime))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"intime",{get:function(){return this._intime},set:function(e){this._intime=e,this.departDatetime=this.helpers.ngDateToMoment(this._indate,this._intime)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalDatetime",{get:function(){var e;return null===(e=this.tempParams)||void 0===e?void 0:e.arrivalDatetime},set:function(e){if(this.tempParams.arrivalDatetime=e.isValid?e:null,e&&e.isValid()&&(this._outdate=this.helpers.momentToNgDate(e),this._outtime=this.helpers.formatTimeColon(e),this.departDatetime&&this.departDatetime.isSameOrBefore(this.arrivalDatetime))){var t=this.arrivalDatetime.clone();this.departDatetime=t}this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outFlightNumber",{get:function(){var e;return null===(e=this.tempParams)||void 0===e?void 0:e.outFlightNumber},set:function(e){this.tempParams.outFlightNumber=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recommended",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.recommended)},set:function(e){this.tempParams.recommended=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onAirport",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.onAirport)},set:function(e){this.tempParams.onAirport=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"meetAndGreet",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.meetAndGreet)},set:function(e){this.tempParams.meetAndGreet=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parkAndRide",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.parkAndRide)},set:function(e){this.tempParams.parkAndRide=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parkAndStroll",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.parkAndStroll)},set:function(e){this.tempParams.parkAndStroll=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carParkedForYou",{get:function(){var e;return!!(null===(e=this.tempParams)||void 0===e?void 0:e.carParkedForYou)},set:function(e){this.tempParams.carParkedForYou=e||null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this.tempParams.terminal?this.tempParams.terminal.toString():null},set:function(e){this.tempParams.terminal=e;var t=this.terminals.value.find((function(t,r){if(t.value===e)return!0}));t?this.selectedTerminal=t.key:this.terminals.value&&this.terminals.value.length>0?this.selectedTerminal=this.terminals.value[0].key:this.selectedTerminal="Any Terminal",this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){this.tempParams.locationCode=e,"string"==typeof e?(this._locationCode=null,this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this.terminal=null,this.terminals.next(e.terminals),1===e.terminals.length&&(this.selectedTerminal=e.terminals[0].key),this._isValid()):(this._locationCode=null,this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeParkingQuery()),this._isValid()},i.prototype._isValid=function(){var e,t,r;this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{location:this._locationCode,travellers:this.travellers,tempParams:this.tempParams}),this.validationMessages=[],this._locationCode&&""!==this._locationCode||this.validationMessages.push(_t.AirportFirst),(null===(e=this.tempParams)||void 0===e?void 0:e.arrivalDatetime.unix())<l.default().unix()&&this.validationMessages.push(_t.InvardJourney),(null===(t=this.tempParams)||void 0===t?void 0:t.departDatetime.unix())<l.default().unix()&&this.validationMessages.push(_t.OutwardJourney),(null===(r=this.tempParams.departDatetime)||void 0===r?void 0:r.isBefore(this.tempParams.arrivalDatetime))&&this.validationMessages.push(_t.DateOverlapped),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.parkingfetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.Parking,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.departDatetime=l.default(e.searchArgs.departDatetime),this.outFlightNumber=e.searchArgs.outFlightNumber,this.terminal=e.searchArgs.terminal,this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)},t.searchService.startSearches())})),this.searchService.startSearches()},i.prototype.getSearchQuery=function(){var e={arrivalDatetime:this.tempParams.arrivalDatetime,departDatetime:this.tempParams.departDatetime,locationCode:this._locationCode,outFlightNumber:this.tempParams.outFlightNumber,recommended:this.tempParams.recommended,onAirport:this.tempParams.onAirport,meetAndGreet:this.tempParams.meetAndGreet,parkAndRide:this.tempParams.parkAndRide,parkAndStroll:this.tempParams.parkAndStroll,carParkedForYou:this.tempParams.carParkedForYou,terminal:"Any"===this.tempParams.terminal?null:this.tempParams.terminal};return this.helpers.removeNulls(e)},i.prototype.sortByPrice=function(e){var t=this.helpers.clone(this.results.value)||[];t=e?t.sort((function(e,t){return t.price-e.price})):t.sort((function(e,t){return e.price-t.price})),this.results.next(t)},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.arrivalDatetime=l.default(r.arrivalDatetime),this.departDatetime=l.default(r.departDatetime),this.outFlightNumber=r.outFlightNumber,this.terminal=r.terminal,this.searchService.getAirportByCode(r.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)})})),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},i.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n,o;console.log("PREPOPULATING PARKING FORM");var s=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,l=null===(r=e[ne.Rail])||void 0===r?void 0:r.searchQuery,u=null===(i=e[ne.InternationalRail])||void 0===i?void 0:i.searchQuery,c=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,d=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery,h=null===(o=e[ne.Lounge])||void 0===o?void 0:o.searchQuery;if(s)try{var p=this.searchService.searches[ne.Flight].outBoundDate.toDate(),m=this.searchService.searches[ne.Flight].inboundDate.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from flight item")}else if(l)try{p=this.searchService.searches[ne.Rail].outBoundDateTime.toDate(),m=this.searchService.searches[ne.Rail].inBoundDateTime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate parking from rail item")}else if(u)try{p=this.searchService.searches[ne.InternationalRail].outBoundDateTime.toDate(),m=this.searchService.searches[ne.InternationalRail].returnDepartureDateTime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate parking from international rail item")}else if(c)try{p=this.searchService.searches[ne.Hotel].checkin_date.toDate(),m=this.searchService.searches[ne.Hotel].checkout_date.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()}}catch(e){console.error("Error trying to prepopulate parking from hotel item")}else if(d)try{p=this.searchService.searches[ne.Car].pickup_datetime.toDate(),m=this.searchService.searches[ne.Car].dropoff_datetime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.indate={day:m.getUTCDate(),month:m.getUTCMonth()+1,year:m.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Car].pickup_location}catch(e){console.error("Error trying to prepopulate parking from car item")}else if(h)try{p=this.searchService.searches[ne.Lounge].arrivalDatetime.toDate();this.outdate={day:p.getUTCDate(),month:p.getUTCMonth()+1,year:p.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Lounge].locationCode}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},i.prototype.addParkingToBasket=function(t,r){var i,a,n,o,s,l;return y(this,void 0,void 0,(function(){var u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return u=p.sent(),c=null==u?void 0:u.subject.value,d=this.getTermsAndCond(t),c?[4,this.basketService.addToBasket({adults:1,basket:c.id,service:t.sourceId.toString(),detail:{arrivalDatetime:r.arrivalDatetime.format(),departDatetime:r.departDatetime.format(),locationCode:t.carPark.code,name:t.carPark.name,requiredInfo:t.requiredInfo,airportIata:r.locationCode,termsAndCond:d},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format(),inboundDate:r.departDatetime.format(),lowestPrice:(null===(i=this.cheapestPrice)||void 0===i?void 0:i.amount)!=t.price||(null===(a=this.cheapestPrice)||void 0===a?void 0:a.currencyCode)!=t.currency?null===(n=this.cheapestPrice)||void 0===n?void 0:n.amount:null,lowestPriceCurrency:(null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount)!=t.price||(null===(s=this.cheapestPrice)||void 0===s?void 0:s.currencyCode)!=t.currency?null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode:null},u,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(h=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.carPark.name},{name:"Telephone",value:e.carPark.telephone},{name:"Important Information",value:e.carPark.misc.importantInformation},{name:"Geo-Position",value:"Latitude "+e.carPark.latitude+"; Longitude "+e.carPark.latitude},{name:"Introduction",value:e.carPark.introduction},{name:"Arrival Procedures",value:e.carPark.arrivalProcedure},{name:"Departure Procedure",value:e.carPark.departureProcedure},{name:"Information",value:e.carPark.information},{name:"Maximum Car Size",value:e.carPark.maximumCarSize},{name:"Directions",value:e.carPark.directions}]},i.prototype.updateLowestPrice=function(e){if(!e.length)return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ne.Parking,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},i.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.searchService.getAirportsList(e.locationCode).subscribe((function(r){t.locationCode=r.find((function(t){return t.gateway==e.locationCode})),t.terminal=e.terminal})),[2]}))}))},i}(c);Rt.STORAGE_SESSION_PARAMS="search_parking",Rt.STORAGE_SESSION_RESULTS="results_parking",(Ft=e.RailDirection||(e.RailDirection={})).Outbound="outbound",Ft.Inbound="inbound",(kt=e.EurostarSearchType||(e.EurostarSearchType={})).return="return",kt.oneWay="oneWay";var It,Ot,Et=Object.freeze({stops:{},totalStops:{},mustInclude:{},classes:{},airlines:{},travelPolicy:{},depatureAirport:{},depatureReturnAirport:{},arrivalAirport:{},arrivalReturnAirport:{},baggage:{},fareTypes:{},price:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},duration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},returnDuration:{min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER},departureTime:{min:0,max:2359},arrivalTime:{min:0,max:2359},returnDepartureTime:{min:0,max:2359},returnArrivalTime:{min:0,max:2359},flightNumber:""});(It=e.SortTypesEurostar||(e.SortTypesEurostar={})).CheapestFirst="C",It.EarliestFirst="E",It.LatestFirst="L",It.ExpensiveFirst="M",It.FastestFirst="F",It.Co2First="O",(Ot=e.SortMethod||(e.SortMethod={})).sortByPrice="sortByPrice",Ot.sortByHighestPrice="sortByHighestPrice",Ot.sortByDate="sortByDate",Ot.sortByFastest="sortByFastest",Ot.SortByCarbon="SortByCarbon";var Bt=function(i){function a(r,n,o,s,u,c,d,h){var p=i.call(this,u,n,c,o)||this;p.eurostarFetcher=r,p.basketService=s,p.modalService=d,p.applyFlightRules=h,p.type=ne.Eurostar,p.avaliableClasses=new t.BehaviorSubject([]),p.timeCriteriaOptions=new t.BehaviorSubject([]),p.flightOperators=new t.BehaviorSubject([]),p._negotiated=!1,p._nearby_airports=!1,p._sortArray=[{title:"Price",method:e.SortMethod.sortByPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.CheapestFirst},{title:"Time",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.EarliestFirst},{title:"Time (Descending)",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.LatestFirst}],p._sortArrayLu=[{title:"Price",method:e.SortMethod.sortByPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.CheapestFirst},{title:"Time",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.EarliestFirst}],p._sortArrayGo2=[{title:"Cheapest",method:e.SortMethod.sortByPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.CheapestFirst},{title:"Most Expensive",method:e.SortMethod.sortByHighestPrice,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.ExpensiveFirst},{title:"Time",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.EarliestFirst},{title:"Time (Descending)",method:e.SortMethod.sortByDate,icon:"ico-calendar",dir:!0,code:e.SortTypesEurostar.LatestFirst},{title:"Fastest",method:e.SortMethod.sortByFastest,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.FastestFirst},{title:"Lowest CO2",method:e.SortMethod.SortByCarbon,icon:"ico-dollar",dir:!0,code:e.SortTypesEurostar.Co2First}],p._fareTypeArray=[{value:U.Flexible,display:"Flexible"},{value:U.Leisure,display:"Leisure"},{value:U.Lowest,display:"Lowest"},{value:U.Negotiated,display:"Negotiated"},{value:U.NonNegotiated,display:"Non-Negotiated"},{value:U.RequestFareRules,display:"Request Fare Rules"},{value:U.SelectAndPro,display:"Select & Pro"}],p.minimumOutBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.minimumInBoundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.searchTypes=[{value:e.EurostarSearchType.return,display:"Return"},{value:e.EurostarSearchType.oneWay,display:"One-way"}],p.flightsToGroup={},p.grouped=null,p.travellers=null,p.resultsSessionName=a.STORAGE_SESSION_RESULTS,p.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,p._displayAddHotel=!1,p.filters=new t.BehaviorSubject(Et),p.selectedGroupEurostar={item:null,direction:null},p._selectedEurostarFare={item:null,direction:null},p._multiDestination=[],p.minToHour=function(e){return Math.floor(e/60)+"h "+e%60+"m"};var m=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}},f=c.makeEurostarQuery(m.tempParams);p.updateTempParams(f),p._originalUserSearch=m.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){p.travellers=e;var t=p.helpers.selectedTravellers(e,ne.Eurostar);p.tempParams.adults=t.adults.length,p.tempParams.children=t.children.length,p.updateTravellers(),p._isValid()})),o.changeUser.subscribe((function(t){p.timeCriteriaOptions.next([e.TimeWindow.Anytime,e.TimeWindow.Arrive,e.TimeWindow.Depart]),p.updateAvaliableClasses()})),p.updateTravellers();var v=u.getSessionItem(p.resultsSessionName)||{results:[],groupData:{},grouped:[],query:{}};p.fullResults=p.helpers.clone(v.results),p.flightsToGroup=v.groupData||{},p.resultQuery=v.query;p.searchService.isFlightsGrouped();p.results.next(v.results||[]);var y=p.helpers.clone(v.results);return y.length&&p.filters.next(p.helpers.createFlightFilters(y[0].journeys,Et)),p._isValid(),p.negotiated=p.tempParams.fareType===U.Negotiated,p}return m(a,i),Object.defineProperty(a.prototype,"displayAddHotel",{get:function(){return this._displayAddHotel},set:function(e){this._displayAddHotel=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedEurostarFare",{get:function(){return this._selectedEurostarFare.item},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedFareClass",{get:function(){var e,t;return null===(t=null===(e=this._selectedEurostarFare)||void 0===e?void 0:e.item)||void 0===t?void 0:t.class},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(96).fill(0).map((function(e,t){return{value:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0"),display:Math.floor(t/4).toString().padStart(2,"0")+":"+(t%4*15).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"preferredCarriers",{get:function(){return this.tempParams.preferredCarriers},set:function(e){this.tempParams.preferredCarriers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator1",{get:function(){return this.tempParams.preferredCarriers[0]},set:function(e){this.tempParams.preferredCarriers[0]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator2",{get:function(){return this.tempParams.preferredCarriers[1]},set:function(e){this.tempParams.preferredCarriers[1]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator3",{get:function(){return this.tempParams.preferredCarriers[2]},set:function(e){this.tempParams.preferredCarriers[2]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"operator4",{get:function(){return this.tempParams.preferredCarriers[3]},set:function(e){this.tempParams.preferredCarriers[3]=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"minDate",{get:function(){return this._minDate=this._minDate||this.helpers.momentToNgDate(l.default()),this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departLocation",{get:function(){return this.tempParams.departLocation},set:function(e){this.tempParams.departLocation=e,"string"==typeof e?this._originAirport="":e&&e.gateway?this._originAirport=e.gateway:this._originAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryOriginAiport",{get:function(){return this._originAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"queryDestinationAiport",{get:function(){return this._destinationAirport},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departDate",{get:function(){return this._outDate},set:function(e){this._outDate=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"departTime",{get:function(){return this._outTime},set:function(e){this._outTime=e,this.outBoundDate=this.helpers.ngDateToMoment(this._outDate,this._outTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outBoundDate",{get:function(){return this.tempParams.outBoundDate},set:function(e){e=l.default(e),this.tempParams.outBoundDate=e.isValid()?e:null,this.minimumInBoundDate={year:e.year(),month:e.month()+1,day:e.date()},this.tempParams.outBoundDate&&this.tempParams.inboundDate&&this.tempParams.outBoundDate.isAfter(this.tempParams.inboundDate)&&(this.inboundDate=l.default(this.tempParams.outBoundDate).add(1,"day")),this._outDate=this.helpers.momentToNgDate(e),this._outTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnDate",{get:function(){return this._inDate},set:function(e){this._inDate=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveTime",{get:function(){return this._inTime},set:function(e){this._inTime=e,this.inboundDate=this.helpers.ngDateToMoment(this._inDate,this._inTime)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inboundDate",{get:function(){return this.tempParams.inboundDate},set:function(e){e=l.default(e),this.tempParams.inboundDate=e.isValid()?e:null,this._inDate=this.helpers.momentToNgDate(e),this._inTime=this.helpers.formatTimeColon(e),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arriveLocation",{get:function(){return this.tempParams.arriveLocation},set:function(e){this.tempParams.arriveLocation=e,"string"==typeof e?this._destinationAirport="":e&&e.gateway?this._destinationAirport=e.gateway:this._destinationAirport=null,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cabinClass",{get:function(){return this.tempParams.cabinClass},set:function(e){this.tempParams.cabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnCabinClass",{get:function(){return this.tempParams.returnCabinClass},set:function(e){this.tempParams.returnCabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isReturn",{get:function(){return this.tempParams.chosenSearchType===e.EurostarSearchType.return},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outTimeCriteria",{get:function(){return this.tempParams.outTimeCriteria},set:function(e){this.tempParams.outTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inTimeCriteria",{get:function(){return this.tempParams.inTimeCriteria},set:function(e){this.tempParams.inTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"maxConnections",{get:function(){return this.tempParams.maxConnections},set:function(e){this.tempParams.maxConnections=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"multiDestination",{get:function(){return this.tempParams.multiDestination},set:function(e){this.tempParams.multiDestination=e,this._isValid()},enumerable:!1,configurable:!0}),a.prototype.setMultiDestinationQuery=function(e){var t=this;return this.helpers.clone(e).reduce((function(e,r){var i={};return i.orig=r.orig.gateway,i.dest=r.dest.gateway,i.date=t.helpers.formatIsoDate(r.date),e.push(i),e}),[])},Object.defineProperty(a.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortDropdownValuesLu",{get:function(){return this._sortArrayLu},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortDropdownValuesGo2",{get:function(){return this._sortArrayGo2},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareTypesValues",{get:function(){return this._fareTypeArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fareType",{get:function(){return this.tempParams.fareType},set:function(e){this.tempParams.fareType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"negotiated",{get:function(){return this._negotiated},set:function(e){this._negotiated=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"includeNearbyAirports",{get:function(){return this.tempParams.includeNearbyAirports},set:function(e){this.tempParams.includeNearbyAirports=e},enumerable:!1,configurable:!0}),a.prototype.processResults=function(e){var t=this;if(this.resultQuery=this.getSearchQuery(),this.multi=e.multi,this.filters.next(this.helpers.createFlightFilters(e.journeys,Et)),e&&this.searchService.isFlightsGrouped()){this._ruleActionSummary=Object.assign({},{journeyWhenSelected:{},dualSingleWhenSelected:{},whenSelectedAlone:{}},e.ruleActionSummary||{});var r=(e.journeys||[]).reduce((function(e,r,i){if(r.outboundFlights.length){var a=t.formatEurostarResults(r.outboundFlights,r.total,r.journeyHash,i);a.co2PerPassenger=r.co2PerPassenger,a.co2PerItem=r.co2PerItem,a.sourceId=r.sourceId,a.total=r.total,a.duration=t.minToHour(r.outboundTotalDuration),e.outbound.find((function(e){return e.dateDeparture===a.dateDeparture&&e.cabinClass===a.cabinClass}))||e.outbound.push(a)}if(r.inboundFlights.length){var n=t.formatEurostarResults(r.inboundFlights,r.total,r.journeyHash,i);n.co2PerPassenger=r.co2PerPassenger,n.co2PerItem=r.co2PerItem,n.sourceId=r.sourceId,n.total=r.total,n.duration=t.minToHour(r.inboundTotalDuration),e.inbound.find((function(e){return e.dateDeparture===n.dateDeparture&&e.cabinClass===n.cabinClass}))||e.inbound.push(n)}return e}),{outbound:[],inbound:[]});return r.outbound=r.outbound.reduce(this.matchFares.bind(this),[]),r.inbound=r.inbound.reduce(this.matchFares.bind(this),[]),[r]}return this._ruleActionSummary=Object.assign({},{journeyWhenSelected:{},dualSingleWhenSelected:{},whenSelectedAlone:{}},e.ruleActionSummary||{}),e?[e]:[]},a.prototype.matchFares=function(e,t){var r=e.find((function(e){return e.dateDeparture===t.dateDeparture}));if(r)switch(t.cabinClass){case H.Economy:case H.EconomyNoBags:case H.EconomyRestricted:r.standardFare=t.standardFare;break;case"Premium":r.standardPremierFare=t.standardPremierFare;break;case H.Business:r.businessPremierFare=t.businessPremierFare;break;default:console.log("how did I get here",t.cabinClass)}else e.push(t);return e},a.prototype.formatEurostarResults=function(e,t,r,i){var a=this,n={dateArrival:null,dateDeparture:null,duration:null,timeArrival:null,timeDeparture:null,co2PerItem:0,co2PerPassenger:0,sourceId:null,total:null,uid:null,cabinClass:null,businessPremierFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1,requiresReason:!1,preferred:!1,preferredMessages:"",companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",unavailable:!1,unavailableMessage:"",requiresReasonMessage:"",canSelect:!1,journeyHash:""},standardFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1,requiresReason:!1,preferred:!1,preferredMessages:"",companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",unavailable:!1,unavailableMessage:"",requiresReasonMessage:"",canSelect:!1,journeyHash:""},standardPremierFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1,requiresReason:!1,preferred:!1,preferredMessages:"",companyPreferred:!1,companyPreferredMessage:"",officePreferred:!1,officePreferredMessage:"",tmcPreferred:!1,tmcPreferredMessage:"",unavailable:!1,unavailableMessage:"",requiresReasonMessage:"",canSelect:!1,journeyHash:""}};return e.forEach((function(e){switch(n.dateArrival=e.dateTimeArriving,n.dateDeparture=e.dateTimeDeparting,n.duration=a.minToHour(e.totalDuration),n.timeArrival=l.default(e.dateTimeArriving).format("HH:mm"),n.timeDeparture=l.default(e.dateTimeDeparting).format("HH:mm"),n.cabinClass=e.cabinClass,n.uid=i,e.cabinClass){case H.EconomyFlexi:case H.EconomyNoBags:case H.EconomyRestricted:case H.Economy:n.standardFare.isDisabled=!1,n.standardFare.fare=e,n.standardFare.price=t.price,n.standardFare.currency=t.currency,n.standardFare.class=e.cabinClass,n.standardFare.selected=!1,n.standardFare.journeyHash=r,n=a.updateRules(n,r,"standardFare");break;case"Premium":n.standardPremierFare.isDisabled=!1,n.standardPremierFare.fare=e,n.standardPremierFare.price=t.price,n.standardPremierFare.currency=t.currency,n.standardPremierFare.class=e.cabinClass,n.standardPremierFare.selected=!1,n.standardPremierFare.journeyHash=r,n=a.updateRules(n,r,"standardPremierFare");break;case H.Business:n.businessPremierFare.isDisabled=!1,n.businessPremierFare.fare=e,n.businessPremierFare.price=t.price,n.businessPremierFare.currency=t.currency,n.businessPremierFare.class=e.cabinClass,n.businessPremierFare.selected=!1,n.businessPremierFare.journeyHash=r,n=a.updateRules(n,r,"businessPremierFare");break;default:console.warn("new class to be implemented: ",e.cabinClass)}})),n},a.prototype.updateRules=function(e,t,r){var i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k,_,R,I,O,E,B,N,M,L,w,j,U,H,x,G,V,W,Q,J,Y,K,q,X,Z,z,$,ee,te,re,ie,ae,ne,oe,se=this,le=this._ruleActionSummary.dualSingleWhenSelected[null===(i=this.selectedGroupFlight)||void 0===i?void 0:i.journeyHash]||{},ue=function(e,t,r){return se.helpers.fieldFromObject(se._ruleActionSummary,["journeyWhenSelected",e,t])||se.helpers.fieldFromObject(se._ruleActionSummary,["whenSelectedAlone",e,t])||se.helpers.fieldFromObject(le,[e,t])||r};switch(r){case"standardFare":e.standardFare.companyPreferred=(null===(a=this._ruleActionSummary.journeyWhenSelected[t])||void 0===a?void 0:a.companyPreferred)||(null===(n=this._ruleActionSummary.whenSelectedAlone[t])||void 0===n?void 0:n.companyPreferred)||!1,e.standardFare.companyPreferredMessage=(null===(o=this._ruleActionSummary.journeyWhenSelected[t])||void 0===o?void 0:o.companyPreferredMessage)||(null===(s=this._ruleActionSummary.whenSelectedAlone[t])||void 0===s?void 0:s.companyPreferredMessage)||"",e.standardFare.officePreferred=(null===(l=this._ruleActionSummary.journeyWhenSelected[t])||void 0===l?void 0:l.officePreferred)||(null===(u=this._ruleActionSummary.whenSelectedAlone[t])||void 0===u?void 0:u.officePreferred)||!1,e.standardFare.officePreferredMessage=(null===(c=this._ruleActionSummary.journeyWhenSelected[t])||void 0===c?void 0:c.officePreferredMessage)||(null===(d=this._ruleActionSummary.whenSelectedAlone[t])||void 0===d?void 0:d.officePreferredMessage)||"",e.standardFare.tmcPreferred=(null===(h=this._ruleActionSummary.journeyWhenSelected[t])||void 0===h?void 0:h.tmcPreferred)||(null===(p=this._ruleActionSummary.whenSelectedAlone[t])||void 0===p?void 0:p.tmcPreferred)||!1,e.standardFare.tmcPreferredMessage=(null===(m=this._ruleActionSummary.journeyWhenSelected[t])||void 0===m?void 0:m.tmcPreferredMessage)||(null===(f=this._ruleActionSummary.whenSelectedAlone[t])||void 0===f?void 0:f.tmcPreferredMessage)||"",e.standardFare.preferred=(null===(v=this._ruleActionSummary.journeyWhenSelected[t])||void 0===v?void 0:v.companyPreferred)||(null===(y=this._ruleActionSummary.whenSelectedAlone[t])||void 0===y?void 0:y.companyPreferred)||(null===(b=this._ruleActionSummary.journeyWhenSelected[t])||void 0===b?void 0:b.officePreferred)||(null===(g=this._ruleActionSummary.whenSelectedAlone[t])||void 0===g?void 0:g.officePreferred)||(null===(S=this._ruleActionSummary.journeyWhenSelected[t])||void 0===S?void 0:S.tmcPreferred)||(null===(C=this._ruleActionSummary.whenSelectedAlone[t])||void 0===C?void 0:C.tmcPreferred),e.standardFare.selected=e.uid===(null===(A=this.selectedGroupFlight)||void 0===A?void 0:A.uid),e.standardFare.unavailable=ue(t,"unavailable",!1),e.standardFare.unavailableMessage=ue(t,"unavailableMessage",""),e.standardFare.requiresReason=ue(t,"requiresReason",!1),e.standardFare.requiresReasonMessage=ue(t,"requiresReasonMessage","");case"standardPremierFare":e.standardPremierFare.companyPreferred=(null===(T=this._ruleActionSummary.journeyWhenSelected[t])||void 0===T?void 0:T.companyPreferred)||(null===(D=this._ruleActionSummary.whenSelectedAlone[t])||void 0===D?void 0:D.companyPreferred)||!1,e.standardPremierFare.companyPreferredMessage=(null===(P=this._ruleActionSummary.journeyWhenSelected[t])||void 0===P?void 0:P.companyPreferredMessage)||(null===(F=this._ruleActionSummary.whenSelectedAlone[t])||void 0===F?void 0:F.companyPreferredMessage)||"",e.standardPremierFare.officePreferred=(null===(k=this._ruleActionSummary.journeyWhenSelected[t])||void 0===k?void 0:k.officePreferred)||(null===(_=this._ruleActionSummary.whenSelectedAlone[t])||void 0===_?void 0:_.officePreferred)||!1,e.standardPremierFare.officePreferredMessage=(null===(R=this._ruleActionSummary.journeyWhenSelected[t])||void 0===R?void 0:R.officePreferredMessage)||(null===(I=this._ruleActionSummary.whenSelectedAlone[t])||void 0===I?void 0:I.officePreferredMessage)||"",e.standardPremierFare.tmcPreferred=(null===(O=this._ruleActionSummary.journeyWhenSelected[t])||void 0===O?void 0:O.tmcPreferred)||(null===(E=this._ruleActionSummary.whenSelectedAlone[t])||void 0===E?void 0:E.tmcPreferred)||!1,e.standardPremierFare.tmcPreferredMessage=(null===(B=this._ruleActionSummary.journeyWhenSelected[t])||void 0===B?void 0:B.tmcPreferredMessage)||(null===(N=this._ruleActionSummary.whenSelectedAlone[t])||void 0===N?void 0:N.tmcPreferredMessage)||"",e.standardPremierFare.preferred=(null===(M=this._ruleActionSummary.journeyWhenSelected[t])||void 0===M?void 0:M.companyPreferred)||(null===(L=this._ruleActionSummary.whenSelectedAlone[t])||void 0===L?void 0:L.companyPreferred)||(null===(w=this._ruleActionSummary.journeyWhenSelected[t])||void 0===w?void 0:w.officePreferred)||(null===(j=this._ruleActionSummary.whenSelectedAlone[t])||void 0===j?void 0:j.officePreferred)||(null===(U=this._ruleActionSummary.journeyWhenSelected[t])||void 0===U?void 0:U.tmcPreferred)||(null===(H=this._ruleActionSummary.whenSelectedAlone[t])||void 0===H?void 0:H.tmcPreferred),e.standardPremierFare.selected=e.uid===(null===(x=this.selectedGroupFlight)||void 0===x?void 0:x.uid),e.standardPremierFare.unavailable=ue(t,"unavailable",!1),e.standardPremierFare.unavailableMessage=ue(t,"unavailableMessage",""),e.standardPremierFare.requiresReason=ue(t,"requiresReason",!1),e.standardPremierFare.requiresReasonMessage=ue(t,"requiresReasonMessage","");case"businessPremierFare":e.businessPremierFare.companyPreferred=(null===(G=this._ruleActionSummary.journeyWhenSelected[t])||void 0===G?void 0:G.companyPreferred)||(null===(V=this._ruleActionSummary.whenSelectedAlone[t])||void 0===V?void 0:V.companyPreferred)||!1,e.businessPremierFare.companyPreferredMessage=(null===(W=this._ruleActionSummary.journeyWhenSelected[t])||void 0===W?void 0:W.companyPreferredMessage)||(null===(Q=this._ruleActionSummary.whenSelectedAlone[t])||void 0===Q?void 0:Q.companyPreferredMessage)||"",e.businessPremierFare.officePreferred=(null===(J=this._ruleActionSummary.journeyWhenSelected[t])||void 0===J?void 0:J.officePreferred)||(null===(Y=this._ruleActionSummary.whenSelectedAlone[t])||void 0===Y?void 0:Y.officePreferred)||!1,e.businessPremierFare.officePreferredMessage=(null===(K=this._ruleActionSummary.journeyWhenSelected[t])||void 0===K?void 0:K.officePreferredMessage)||(null===(q=this._ruleActionSummary.whenSelectedAlone[t])||void 0===q?void 0:q.officePreferredMessage)||"",e.businessPremierFare.tmcPreferred=(null===(X=this._ruleActionSummary.journeyWhenSelected[t])||void 0===X?void 0:X.tmcPreferred)||(null===(Z=this._ruleActionSummary.whenSelectedAlone[t])||void 0===Z?void 0:Z.tmcPreferred)||!1,e.businessPremierFare.tmcPreferredMessage=(null===(z=this._ruleActionSummary.journeyWhenSelected[t])||void 0===z?void 0:z.tmcPreferredMessage)||(null===($=this._ruleActionSummary.whenSelectedAlone[t])||void 0===$?void 0:$.tmcPreferredMessage)||"",e.businessPremierFare.preferred=(null===(ee=this._ruleActionSummary.journeyWhenSelected[t])||void 0===ee?void 0:ee.companyPreferred)||(null===(te=this._ruleActionSummary.whenSelectedAlone[t])||void 0===te?void 0:te.companyPreferred)||(null===(re=this._ruleActionSummary.journeyWhenSelected[t])||void 0===re?void 0:re.officePreferred)||(null===(ie=this._ruleActionSummary.whenSelectedAlone[t])||void 0===ie?void 0:ie.officePreferred)||(null===(ae=this._ruleActionSummary.journeyWhenSelected[t])||void 0===ae?void 0:ae.tmcPreferred)||(null===(ne=this._ruleActionSummary.whenSelectedAlone[t])||void 0===ne?void 0:ne.tmcPreferred),e.businessPremierFare.selected=e.uid===(null===(oe=this.selectedGroupFlight)||void 0===oe?void 0:oe.uid),e.businessPremierFare.unavailable=ue(t,"unavailable",!1),e.businessPremierFare.unavailableMessage=ue(t,"unavailableMessage",""),e.businessPremierFare.requiresReason=ue(t,"requiresReason",!1),e.businessPremierFare.requiresReasonMessage=ue(t,"requiresReasonMessage","")}return e},a.prototype.resetQuery=function(e){void 0===e&&(e=!0),this.updateTempParams(this.searchService.makeEurostarQuery()),e&&this._isValid()},a.prototype.resetParams=function(){this.reset(),this.resetQuery()},a.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[],this._originAirport||this.validationMessages.push("Please add in a departure location"),this._destinationAirport||this.validationMessages.push("Please add in a arrival destination"),this.tempParams.outBoundDate.isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),this._originAirport&&this._destinationAirport&&this._destinationAirport===this._originAirport&&this.validationMessages.push("Origin and destination station cannot be the same"),this.isReturn&&(this.tempParams.outBoundDate.isSameOrAfter(this.tempParams.inTimeCriteria)&&this.validationMessages.push("Return date must be after the departure date"),this.checkCabinMatchisValid()||this.validationMessages.push("The types of cabin classes selected are not compatible. Examples of compatible cabin classes; Any - Any; Standard - Standard; Business - Business")),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},a.prototype.checkCabinMatchisValid=function(){switch(this.tempParams.cabinClass){case H.Any:return this.tempParams.returnCabinClass===H.Any;case H.Economy:case H.PremiumEconomy:return this.tempParams.returnCabinClass!==H.Business&&this.tempParams.returnCabinClass!==H.Any;case H.Business:return!(this.tempParams.returnCabinClass===H.Economy||this.tempParams.returnCabinClass===H.PremiumEconomy||this.tempParams.returnCabinClass===H.Any);default:return!0}},a.prototype.startSearch=function(){if(this.results.next([]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.eurostarFetcher.fetchList(this.getSearchQuery()))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Eurostar,searchArgs:t,travelDate:this.outBoundDate.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(e){var t=e;return this.departLocation&&(t.departLocation=this.departLocation),this.arriveLocation&&(t.arriveLocation=this.arriveLocation),t.outboundCabinClassName=this.turnCabinTypeToName(this.tempParams.cabinClass),this.isReturn&&(t.returnCabinClassName=this.tempParams.cabinClass===this.tempParams.returnCabinClass?t.outboundCabinClassName:this.turnCabinTypeToName(this.tempParams.returnCabinClass)),t},a.prototype.turnCabinTypeToName=function(e){return[this.avaliableClasses.value.find((function(t){return t.type===e})).name]},a.prototype.startRecentSearch=function(t){if(t.searchArgs.outboundDate){var r=t.searchArgs.outboundDepartureTimeWindow?t.searchArgs.outboundDepartureTimeWindow:t.searchArgs.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(t.searchArgs.outboundDate,r)}if(t.searchArgs.returnDate){var i=t.searchArgs.returnDepartureTimeWindow?t.searchArgs.returnDepartureTimeWindow:t.searchArgs.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(t.searchArgs.returnDate,i)}this.fareType=t.searchArgs.fareType,this.maxConnections=t.searchArgs.maxConnections,t.searchArgs.outboundCabinClass&&(this.cabinClass=t.searchArgs.outboundCabinClass[0]),t.searchArgs.returnCabinClass&&(this.returnCabinClass=t.searchArgs.returnCabinClass[0]),this.includeNearbyAirports=t.searchArgs.includeNearbyAirports,this.chosenSearchType=t.searchArgs.returnTrip?e.EurostarSearchType.return:e.EurostarSearchType.oneWay,t.searchArgs.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:t.searchArgs.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,t.searchArgs.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:t.searchArgs.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,this._originAirport=t.searchArgs.originAirport,this._destinationAirport=t.searchArgs.destinationAirport,this.arriveLocation=t.searchArgs.arriveLocation,this.departLocation=t.searchArgs.departLocation,this.searchService.startSearches()},a.prototype.makeDepartureTimeWindow=function(t,r){return r===e.TimeWindow.Depart?this.helpers.makeTimeWindow(t,-2,2):null},a.prototype.makeArrivalTimeWindow=function(t,r){return r!==e.TimeWindow.Arrive?null:this.helpers.makeTimeWindow(t,-2,2)},a.prototype.convertRecentSearchDateTime=function(e,t){if(t){var r=t.split("-");return l.default(e).add(l.default.duration(this.helpers.hhmmToTime(r[0]))).clone().add(2,"hour")}return l.default(e)},a.prototype.getSearchQuery=function(){return this.helpers.removeNulls(Object.assign({},{originAirport:this._originAirport,destinationAirport:this._destinationAirport,outboundDate:this.helpers.formatIsoDate(this.tempParams.outBoundDate),outboundDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria),outboundArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.outBoundDate,this.tempParams.outTimeCriteria)},{passengers:this._passengers,returnTrip:this.isReturn,outboundCabinClass:this.tempParams.cabinClass?[this.tempParams.cabinClass]:null,requireFreeBag:null,maxConnections:this.tempParams.maxConnections,includeNearbyAirports:this.tempParams.includeNearbyAirports,preferredCarriers:this.tempParams.preferredCarriers.map((function(e){return(null==e?void 0:e.code)?e.code:null})),fareType:this.tempParams.fareType,withGrouped:null},this.isReturn?{returnDate:this.helpers.formatIsoDate(this.tempParams.inboundDate),returnDepartureTimeWindow:this.makeDepartureTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria),returnArrivalTimeWindow:this.makeArrivalTimeWindow(this.tempParams.inboundDate,this.tempParams.inTimeCriteria),returnCabinClass:this.tempParams.returnCabinClass?[this.tempParams.returnCabinClass]:null}:{}))},a.prototype.updateTravellers=function(){for(var e=[],t=0;t<this.tempParams.adults;t+=1)e.push({type:x.Adult});for(t=0;t<this.tempParams.children;t+=1)e.push({type:x.Child});this._passengers=e,this._isValid()},a.prototype.updateAvaliableClasses=function(){this.avaliableClasses.next([{name:"Any",type:H.Any},{name:"Standard (semi flexible)",type:H.Economy},{name:"Standard premier (semi flexible)",type:H.PremiumEconomy},{name:"Business premier (fully flexible)",type:H.Business}])},a.prototype.sortResults=function(t,r,i){var a=this.helpers.clone(i||this.fullResults);switch(t){case e.SortTypesEurostar.CheapestFirst:a=this.sortByPrice(a,r);break;case e.SortTypesEurostar.EarliestFirst:a=this.sortByDate(a,r);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}this.results.next(a)},a.prototype.sortResultsFlightJourneys=function(t,r,i){void 0===r&&(r=!1);var a=this.helpers.clone(i);switch(t){case e.SortTypesEurostar.CheapestFirst:a=this.sortByPriceFlight(a);break;case e.SortTypesEurostar.EarliestFirst:a=this.sortByDateFlight(a,r);break;case e.SortTypesEurostar.LatestFirst:a=this.sortByDateFlightDecending(a,r);break;case e.SortTypesEurostar.ExpensiveFirst:a=this.sortByExpensiveFlight(a);break;case e.SortTypesEurostar.FastestFirst:a=this.sortByFastestFlight(a);break;case e.SortTypesEurostar.Co2First:a=this.sortByCarbonFlight(a);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}return a},a.prototype.sortByPriceFlight=function(e){return e.sort((function(e,t){return Number(e.total.price)-Number(t.total.price)}))},a.prototype.sortByExpensiveFlight=function(e){return e.sort((function(e,t){return Number(t.total.price)-Number(e.total.price)}))},a.prototype.sortByFastestFlight=function(e){return e.sort((function(e,t){return e.outboundTotalDuration!==t.outboundTotalDuration?e.outboundTotalDuration-t.outboundTotalDuration:e.inboundTotalDuration-t.inboundTotalDuration}))},a.prototype.sortByCarbonFlight=function(e){return e.sort((function(e,t){return Number(e.co2PerPassenger)-Number(t.co2PerPassenger)}))},a.prototype.sortByDateFlight=function(e,t){return e.sort((function(e,r){return t?l.default(e.inboundFlights[0].dateTimeDeparting).unix()-l.default(r.inboundFlights[0].dateTimeDeparting).unix():l.default(e.outboundFlights[0].dateTimeDeparting).unix()-l.default(r.outboundFlights[0].dateTimeDeparting).unix()}))},a.prototype.sortByDateFlightDecending=function(e,t){return e.sort((function(e,r){return t?l.default(r.inboundFlights[0].dateTimeDeparting).unix()-l.default(e.inboundFlights[0].dateTimeDeparting).unix():l.default(r.outboundFlights[0].dateTimeDeparting).unix()-l.default(e.outboundFlights[0].dateTimeDeparting).unix()}))},a.prototype.sortByDate=function(e,t){var r=function(e,r){return t?l.default(e.dateDeparture).unix()-l.default(r.dateDeparture).unix():l.default(r.dateDeparture).unix()-l.default(e.dateDeparture).unix()};return[{outbound:e[0].outbound.sort(r),inbound:e[0].inbound.sort(r)}]},a.prototype.sortByPrice=function(e,t){var r=function(e,r){var i=+e.standardFare.price||+e.standardPremierFare.price||+e.businessPremierFare.price,a=+r.standardFare.price||+r.standardPremierFare.price||+r.businessPremierFare.price;return t?i-a:a-i};return[{outbound:e[0].outbound.sort(r),inbound:e[0].inbound.sort(r)}]},a.prototype.updateSearchFromExpiredBasketItem=function(t){var r=this,i=t.searchQuery;if(i.outboundDate){var a=i.outboundDepartureTimeWindow?i.outboundDepartureTimeWindow:i.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(i.outboundDate,a)}if(i.returnDate){var n=i.returnDepartureTimeWindow?i.returnDepartureTimeWindow:i.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(i.returnDate,n)}this.fareType=i.fareType,this.maxConnections=i.maxConnections,i.outboundCabinClass&&(this.cabinClass=i.outboundCabinClass[0]),i.returnCabinClass&&(this.returnCabinClass=i.returnCabinClass[0]),this.includeNearbyAirports=i.includeNearbyAirports,this.chosenSearchType=i.returnTrip?e.EurostarSearchType.return:e.EurostarSearchType.oneWay,i.outboundDepartureTimeWindow?this.outTimeCriteria=e.TimeWindow.Depart:i.outboundArrivalTimeWindow?this.outTimeCriteria=e.TimeWindow.Arrive:this.outTimeCriteria=e.TimeWindow.Anytime,i.returnDepartureTimeWindow?this.inTimeCriteria=e.TimeWindow.Depart:i.returnArrivalTimeWindow?this.inTimeCriteria=e.TimeWindow.Arrive:this.inTimeCriteria=e.TimeWindow.Anytime,i.originAirport&&this.searchService.lookupEurostarStations(i.originAirport).subscribe((function(e){r.departLocation=e[0]})),i.destinationAirport&&this.searchService.lookupEurostarStations(i.destinationAirport).subscribe((function(e){r.arriveLocation=e[0]})),t.users&&t.users.forEach((function(e){r.searchService.addTraveller(e)}))},a.prototype.updateFromPreviousSearches=function(e){var t,r,i,a,n,o,s,u=null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery,c=null===(r=e[ne.Rail])||void 0===r?void 0:r.searchQuery,d=null===(i=e[ne.InternationalRail])||void 0===i?void 0:i.searchQuery,h=null===(a=e[ne.Rail])||void 0===a?void 0:a.searchQuery,p=null===(n=e[ne.Car])||void 0===n?void 0:n.searchQuery,m=null===(o=e[ne.Lounge])||void 0===o?void 0:o.searchQuery,f=null===(s=e[ne.Parking])||void 0===s?void 0:s.searchQuery;if(u)try{this.outBoundDate=l.default(e.FLIGHT.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.FLIGHT.inboundDate&&(this.inboundDate=l.default(e.FLIGHT.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from flight item")}else if(c)try{this.outBoundDate=l.default(e.RAIL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.RAIL.inboundDate&&(this.inboundDate=l.default(e.RAIL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from rail item")}else if(d)try{this.outBoundDate=l.default(e.INTERNATIONAL_RAIL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.INTERNATIONAL_RAIL.inboundDate&&(this.inboundDate=l.default(e.INTERNATIONAL_RAIL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from international rail item")}else if(h)try{this.outBoundDate=l.default(e.HOTEL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.HOTEL.inboundDate&&(this.inboundDate=l.default(e.HOTEL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from hotel item")}else if(p)try{this.outBoundDate=l.default(e.CAR.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.CAR.inboundDate&&(this.inboundDate=l.default(e.CAR.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from car item")}else if(m)try{this.outBoundDate=l.default(e.LOUNGE.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.LOUNGE.inboundDate&&(this.inboundDate=l.default(e.LOUNGE.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from lounge item")}else if(f)try{this.outBoundDate=l.default(e.PARKING.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDate.minutes()%30&&(this.outBoundDate=this.outBoundDate.subtract(this.outBoundDate.minutes()%30,"minutes")),e.PARKING.inboundDate&&(this.inboundDate=l.default(e.PARKING.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inboundDate.minutes()%30&&(this.inboundDate=this.inboundDate.subtract(this.inboundDate.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate eurostar from parking item")}},a.prototype.getTotalBaggage=function(e){var t=0,r=JSON.parse(e.additional);return r&&r.outboundFlights?r.outboundFlights.forEach((function(e){e.baggage.forEach((function(e){e.allowance&&e.allowance>t&&(t=e.allowance)}))})):r&&r.baggageAllowance&&r.baggageAllowance.forEach((function(e){e.baggage.qty&&Number(e.baggage.qty)>t&&(t=Number(e.baggage.qty))})),t},a.prototype.transformMin=function(e){var t=60*Number(e)/100;return(t=t%1<.5?Math.floor(t):Math.ceil(t)).toString().padStart(2,"0")},a.prototype.applyFilters=function(e){var t=this;0===this.fullResults.length&&this.results.next([]);var r,i,a=function(e,t){var r=Object.values(e).filter((function(e){return e.selected}));return r.length?function(e){return!!r.find((function(r){return t(e,r.value)}))}:function(e){return!0}},n=function(e,r){return function(i){var a,n,s=l.default((a=t.helpers).fromObject.apply(a,C([i],o(r,i).split(".")))).get("hour"),u=l.default((n=t.helpers).fromObject.apply(n,C([i],o(r,i).split(".")))).get("minute"),c=Number(""+s.toString().padStart(2,"0")+u.toString().padStart(2,"0"));return c>=e.min&&c<=e.max}},o=function(e,t){return e.replace("OUTBOUND_DEPARTURE","outboundFlights.0").replace("OUTBOUND_ARRIVAL","outboundFlights."+(t.outboundFlights.length-1)).replace("INBOUND_DEPARTURE","inboundFlights.0").replace("INBOUND_ARRIVAL","inboundFlights."+((t.inboundFlights||[]).length-1))},s=function(e){return function(t,r){return t[e]===r}},u=[],c=[];u.push(n(e.arrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),u.push(n(e.departureTime,"OUTBOUND_DEPARTURE.dateTimeDeparting")),u.push((r=e.price,i="total.price",function(e){var a,n=(a=t.helpers).fromObject.apply(a,C([e],o(i,e).split(".")));return n>=r.min&&n<=r.max})),c.push(n(e.returnArrivalTime,"INBOUND_ARRIVAL.dateTimeArriving")),c.push(n(e.returnDepartureTime,"INBOUND_DEPARTURE.dateTimeDeparting"));var d=[];d.push(a(e.classes,s("cabinClass")));var h=[];h.push(a(e.classes,s("cabinClass")));for(var p=function(e,t){return u.reduce((function(t,r){return t=t&&r(e)}),!0)&&(!e.outboundFlights||!!(e.outboundFlights||[]).find((function(e){return!!d.reduce((function(t,r){return t&&r(e)}),!0)})))},m=function(e,t){var r;return c.reduce((function(t,r){return t&&r(e)}),!0)&&(!(null===(r=e.inboundFlights)||void 0===r?void 0:r.length)||!!(e.inboundFlights||[]).find((function(e){return!!h.reduce((function(t,r){return t&&r(e)}),!0)})))},f=this.helpers.clone(this.fullResults),v=0;v<f.length;v++){var y=f[v];y.journeys=y.journeys.filter(p),this.isReturn&&(y.journeys=y.journeys.filter(m)),y.journeys=y.journeys}this.results.next(f)},a.prototype.selectGroupedEurostar=function(t,r,i){var a,n,o,s;return y(this,void 0,void 0,(function(){var l,u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return l=p.sent(),(u=null==l?void 0:l.subject.value)&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.oneWay&&i===e.FlightDirectionEnum.Outbound?(this.doBooking(l,t,{outboundFlights:[this.makeSchemaFlights(r.fare,"outbound",0)],inboundFlights:[],journeyType:"single"},t.dateDeparture,null,r.price,r.requiresReason),[2]):(u&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.return&&(i===e.FlightDirectionEnum.Outbound?(null===(a=this.selectedGroupEurostar)||void 0===a?void 0:a.direction)===e.FlightDirectionEnum.Inbound?(d=this._selectedEurostarFare.item.price>r.price?this._selectedEurostarFare.item.price:r.price,this.doBooking(l,t,{inboundFlights:[this.makeSchemaFlights(this._selectedEurostarFare.item.fare,"inbound",0)],outboundFlights:[this.makeSchemaFlights(r.fare,"outbound",0)],journeyType:"roundtrip"},t.dateDeparture,this.selectedGroupEurostar.item.dateArrival,d,r.requiresReason),this.resetSelectedFares(),this.basketService.toggleMenu(),this.results.next(this.fullResults.map(this.removeSelectedFlags))):(null===(n=this.selectedGroupEurostar)||void 0===n?void 0:n.direction)===e.FlightDirectionEnum.Outbound?(this.resetSelectedFares(),this.results.next(this.fullResults)):(this.selectedGroupEurostar={item:t,direction:i},this._selectedEurostarFare={item:r,direction:i},c=t.uid,this.results.next(this.fullResults.map((function(e){var t=e.outbound.filter((function(e){return c===e.uid}));return{inbound:e.inbound,outbound:t}})))):i===e.FlightDirectionEnum.Inbound&&((null===(o=this.selectedGroupEurostar)||void 0===o?void 0:o.direction)===e.FlightDirectionEnum.Outbound?(d=this._selectedEurostarFare.item.price>r.price?this._selectedEurostarFare.item.price:r.price,this.doBooking(l,t,{outboundFlights:[this.makeSchemaFlights(this._selectedEurostarFare.item.fare,"outbound",0)],inboundFlights:[this.makeSchemaFlights(r.fare,"inbound",0)],journeyType:"roundtrip"},t.dateDeparture,this.selectedGroupEurostar.item.dateArrival,d,r.requiresReason),this.resetSelectedFares(),this.basketService.toggleMenu(),this.results.next(this.fullResults.map(this.removeSelectedFlags))):(null===(s=this.selectedGroupEurostar)||void 0===s?void 0:s.direction)===e.FlightDirectionEnum.Inbound?(this.resetSelectedFares(),this.results.next(this.fullResults)):(this.selectedGroupEurostar={item:t,direction:i},this._selectedEurostarFare={item:r,direction:i},h=t.uid,this.results.next(this.fullResults.map((function(e){return{inbound:e.inbound.filter((function(e){return h===e.uid})),outbound:e.outbound}}))),this._updateTravelPolicies()))),[2])}}))}))},a.prototype._updateTravelPolicies=function(){var e=this;if(this.selectedGroupEurostar&&!this._ruleActionSummary.dualSingleWhenSelected[this._selectedEurostarFare.item.journeyHash]&&this.multi&&0!==this.multi.length){var t=(this.multi||[]).reduce((function(e,t){return 1===t.order&&t.results&&t.results.length>0&&(e=e.concat(t.results)),e}),[]);t.length>0&&(this.rawResults||(this.rawResults=this.storageService.getSessionItem(this.resultsSessionName+"_raw")),console.log(this.rawResults),this.applyFlightRules.fetchOne({selectedOutboundFlight:this.selectedGroupFlight,availableInboundFlights:t,searchId:this.rawResults.searchId}).pipe(r.take(1)).subscribe((function(t){t&&(e._ruleActionSummary=e.helpers.mergeObjects(e._ruleActionSummary,t))})))}},a.prototype.resetSelectedFares=function(){this.selectedGroupEurostar={direction:null,item:null},this._selectedEurostarFare={direction:null,item:null}},a.prototype.removeSelectedFlags=function(e){return{inbound:e.inbound.map((function(e){return e.standardPremierFare.selected=!1,e.standardFare.selected=!1,e.businessPremierFare.selected=!1,e})),outbound:e.outbound.map((function(e){return e.standardPremierFare.selected=!1,e.standardFare.selected=!1,e.businessPremierFare.selected=!1,e}))}},a.prototype.updateLowestPrice=function(e){if(e.length&&!this.searchService.isFlightsGrouped()){var t=e[0].journeys;if(t.length){var r=t[0].total.currency;return t.reduce((function(e,t){var r=t.total.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:r})}}},a.prototype.doBooking=function(t,r,i,a,n,o,s){var l,u;return y(this,void 0,void 0,(function(){var c,d,h,p,m,f;return b(this,(function(v){switch(v.label){case 0:return c=r.sourceId,d=r.co2PerItem,h=r.co2PerPassenger,p=r.total,m={adults:this.adults,basket:t.id,children:this.children,co2PerItem:d,co2PerPassenger:h,currency:p.currency,detail:i,price:o,searchQuery:this.resultQuery,service:c.toString(),outboundDate:a,lowestPrice:null===(l=this.lowestPrice)||void 0===l?void 0:l.amount,lowestPriceCurrency:null===(u=this.lowestPrice)||void 0===u?void 0:u.currencyCode},n&&(m.inboundDate=n),[4,this.basketService.addToBasket(m,t,this.searchService,this.travellers,s)];case 1:return(f=v.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,f]}}))}))},Object.defineProperty(a.prototype,"lowestPrice",{get:function(){if(this.cheapestPrice)return this.cheapestPrice;var e,t=this.fullResults[0].outbound,r=t[0].standardFare.currency;return t.forEach((function(t){(!e||t.standardFare.price<e)&&(e=t.standardFare.price),t.standardPremierFare.price<e&&(e=t.standardPremierFare.price),t.businessPremierFare.price<e&&(e=t.businessPremierFare.price)})),{amount:e,currencyCode:r}},enumerable:!1,configurable:!0}),a.prototype.makeSchemaFlights=function(e,t,r,i){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:i}})},a.prototype.createGroupedItem=function(e,t,r,i,a,n){if((null==r?void 0:r.length)&&!e.departDateTime){var o=r[0],s=r[r.length-1];e.originAirport=o.originAirport,e.originAirportName=o.originAirportName,e.destinationAirport=s.destinationAirport,e.destinationAirportName=s.destinationAirportName,e.departDateTime=o.dateTimeDeparting,e.arrivalDateTime=s.dateTimeArriving,e.outboundTotalDuration=i,e.dataSource=t,e.operator=o.operatingCarrier,e.operatorFull=o.operatingCarrierName,e.outlegsCount=r.length,e.outlegs=r,e.outboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",r),e.isReturn=!1}(null==a?void 0:a.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=a.length,e.inlegs=a,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",a),e.isReturn=!0)},a.prototype.makeSessionResults=function(e){return{results:[],groupData:[],grouped:[],query:this.resultQuery}},a.prototype.getMinFlightPriceForBrand=function(e){var t=Number.MAX_SAFE_INTEGER;return e.forEach((function(e){var r;t>(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.getMaxFlightPriceForBrand=function(e){var t=0;return e.forEach((function(e){var r;t<(null===(r=null==e?void 0:e.total)||void 0===r?void 0:r.price)&&(t=e.total.price)})),t},a.prototype.isOverNight=function(){var e=this.outBoundDate.date();return this.inboundDate.date()-e>=1},a.prototype.addEurostarJourneysToBasket=function(t){return y(this,void 0,void 0,(function(){var r,i,a,n,o,s,u,c,d,h,p,m=this;return b(this,(function(f){switch(f.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return r=f.sent(),(null==r?void 0:r.subject.value)?(i=t.sourceId,a=t.co2PerItem,n=t.co2PerPassenger,o=t.total,s=l.default(t.outboundFlights[0].dateTimeDeparting),u=t.inboundFlights.length?l.default(t.inboundFlights[0].dateTimeDeparting):null,c=this.getTermsAndCond(t),d={outboundFlights:C(t.outboundFlights.map((function(e,t){return m.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:C(t.inboundFlights.map((function(e,t){return m.makeSchemaFlights(e,"inbound",0,t)}))),termsAndCond:c,journeyType:"single"},h={adults:this.adults,basket:r.id,children:this.children,co2PerItem:a,co2PerPassenger:n,currency:o.currency,detail:d,price:o.price,searchQuery:this.resultQuery,service:i.toString(),outboundDate:s.format()},u&&(h.inboundDate=u.format(),d.journeyType="roundtrip"),[4,this.basketService.addToBasket(h,r,this.searchService,this.travellers,t.requiresReason)]):[3,3];case 2:return(p=f.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,p];case 3:return[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},a.prototype.getTermsAndCond=function(e){return[{name:"Penalties",value:""},{name:"Eligibility",value:""},,{name:"Day/time",value:""},{name:"Seasonality",value:""},{name:"Flight Application",value:""},{name:"Advance Reservations/ticketing",value:""},{name:"Maximum Stay",value:""},{name:"Minimum Stay",value:""},{name:"Stopovers",value:""},{name:"Transfers",value:""},{name:"Combinations",value:""},{name:"Blackout Dates",value:""},{name:"Surcharges",value:""},{name:"Accompanied Travel",value:""},{name:"Travel Restrictions",value:""},{name:"Sales Restrictions",value:""},{name:"Hip/mileage Exceptions",value:""},{name:"Ticket Endorsements",value:""},{name:"Children Discounts",value:""},{name:"Tour Conductor Discounts",value:""},{name:"Agent Discounts",value:""},{name:"All Other Discounts",value:""},{name:"Miscellaneous Provisions",value:""},{name:"Fare By Rule",value:""},{name:"Groups",value:""},{name:"Tours",value:""},{name:"Visit Another Country",value:""},{name:"Deposits",value:""},{name:"Voluntary Changes",value:""},{name:"Voluntary Refunds",value:""},{name:"Negotiated Fares",value:""},{name:"Rule Application And Other Conditions",value:""}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Eurostar,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return y(this,void 0,void 0,(function(){var r=this;return b(this,(function(i){return this.fareType=t.fareType,this.includeNearbyAirports=t.includeNearbyAirports,this.chosenSearchType=t.returnTrip?e.EurostarSearchType.return:e.EurostarSearchType.oneWay,this.searchService.getAirportsList(t.originAirport).subscribe((function(e){r.departLocation=e.find((function(e){return e.gateway==t.originAirport}))})),this.searchService.getAirportsList(t.destinationAirport).subscribe((function(e){r.arriveLocation=e.find((function(e){return e.gateway==t.destinationAirport}))})),this._passengers=t.passengers,this.adults=t.passengers.filter((function(e){return"ADULT"==e.type})).length,this.children=t.passengers.filter((function(e){return"CHILD"==e.type})).length,[2]}))}))},a.prototype.openEurostarFareRules=function(e){var t=this,r=C(e.detail.outboundFlights);r[0].fareInfo=r[0].journeyInfo,delete r[0].journeyInfo,this.searchService.getFlightFareRules(r[0]).subscribe((function(e){t.modalService.open(d.ModalFlightFareComponent,null,{rules:e.results[0],from:r[0].originAirport,to:r[r.length-1].destinationAirport})}),(function(e){console.log(e)}))},a.prototype.generateQueryFromFlightQuery=function(t,r,i){return y(this,void 0,void 0,(function(){var a=this;return b(this,(function(n){switch(n.label){case 0:return this.departDate=this.helpers.momentToNgDate(l.default(t.outboundDate,"YYYY-MM-DD")),this.returnDate=this.helpers.momentToNgDate(l.default(t.returnDate,"YYYY-MM-DD")),this._originAirport=this.getEuroLocation(r),this._destinationAirport=this.getEuroLocation(i),[4,this.searchService.lookupEurostarStations(this._originAirport).toPromise().then((function(e){console.log(e),a.departLocation=e[0]}))];case 1:return n.sent(),[4,this.searchService.lookupEurostarStations(this._destinationAirport).toPromise().then((function(e){console.log(e),a.arriveLocation=e[0]}))];case 2:return n.sent(),t.returnTrip?this.chosenSearchType=e.EurostarSearchType.return:this.chosenSearchType=e.EurostarSearchType.oneWay,[2]}}))}))},a.prototype.getEuroLocation=function(e){return ft[e.toUpperCase()]||""},a.prototype.getFareRules=function(e){var t,r;return{whenSelectedAlone:null===(t=this._ruleActionSummary)||void 0===t?void 0:t.whenSelectedAlone[e],journeyWhenSelected:null===(r=this._ruleActionSummary)||void 0===r?void 0:r.journeyWhenSelected[e]}},a}(c);Bt.STORAGE_SESSION_PARAMS="search_eurostar",Bt.STORAGE_SESSION_RESULTS="results_eurostar";var Nt,Mt,Lt,wt=function(){function e(){this.data={},this.current={}}return e.prototype.nextJourney=function(){this.data=Object.entries(this.current).reduce((function(e,t){var r=S(t,2),i=r[0],a=r[1];return e[i]=e[i]||{total:0,types:{}},e[i].types=Object.entries(a.types).reduce((function(e,t){var r=S(t,2),i=r[0],a=r[1];return e[i]=Math.max(e[i]||0,a),e}),e[i].types),e[i].total=Object.values(e[i].types).reduce((function(e,t){return e+t}),0),e}),this.data),this.current={}},e.prototype.addFares=function(e,t,r){this.current[e]=this.current[e]||{total:0,types:{}},this.current[e].total+=r.length,this.current[e].types[t]=r.length},e.prototype.getTicketTypes=function(){return Object.entries(this.data).reduce((function(e,t){var r=S(t,2),i=r[0],a=r[1];return e[i]=a.total,e}),{})},e.prototype.workoutIndexes=function(e){return Object.entries(this.data[e].types).sort((function(e,t){var r=S(e,2),i=r[0],a=(r[1],S(t,2)),n=a[0];a[1];return Number(i.split("_")[1])-Number(n.split("_")[1])})).reduce((function(t,r){for(var i=S(r,2),a=i[0],n=i[1],o=0;o<n;o++)t.push([e,a,o.toString()]);return t}),[])},e}();(Nt=e.RailSearchCriteria||(e.RailSearchCriteria={})).Depart="Depart After",Nt.Arrive="Arrive Before",(Mt=e.RailJourneyFareType||(e.RailJourneyFareType={})).Return="Return",Mt.Single="Single",(Lt=e.RailFareTypes||(e.RailFareTypes={})).dualSingleJourneyFares="dualSingleJourneyFares",Lt.returnJourneyFares="returnJourneyFares",Lt.singleJourneyFares="singleJourneyFares",Lt.openReturnJourneyFares="openReturnJourneyFares",Lt.splitFares="splitFares";var jt,Ut=function(i){function a(r,n,o,s,u,c,d,h){var p=i.call(this,u,o,c,d)||this;p.Railfetcher=r,p.getRailStationFetcher=n,p.basketService=s,p.modalService=h,p._ticketTypes=[e.RailFareTypes.dualSingleJourneyFares,e.RailFareTypes.returnJourneyFares,e.RailFareTypes.singleJourneyFares,e.RailFareTypes.openReturnJourneyFares,e.RailFareTypes.splitFares],p.resultsSessionName=a.STORAGE_SESSION_RESULTS,p.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,p.searchTypes=[{display:"Return",value:te.ReturnJourney},{display:"One-Way",value:te.SingleJourney}],p.classTypes=new t.BehaviorSubject([]),p.airportExpressStations=[{code:"HP1-3",name:"Heathrow T1-3 - Paddington"},{code:"HP4",name:"Heathrow T4 - Paddington"},{code:"HP5",name:"Heathrow T5 - Paddington"},{code:"PH1-3",name:"Paddington - Heathrow T1-3"},{code:"PH4",name:"Paddington - Heathrow T4"},{code:"PH5",name:"Paddington - Heathrow T5"},{code:"GV",name:"Gatwick - Victoria"},{code:"VG",name:"Victoria - Gatwick"},{code:"SL",name:"Stansted - Liverpool Street"},{code:"LS",name:"Liverpool Street - Stansted"}],p.airportExpressStationsCodes={"HP1-3":{dep:"HXX",arr:"PAD"},"PH1-3":{dep:"PAD",arr:"HXX"},HP4:{dep:"HAF",arr:"PAD"},PH4:{dep:"PAD",arr:"HAF"},HP5:{dep:"HWV",arr:"PAD"},PH5:{dep:"PAD",arr:"HWV"},GV:{dep:"GTW",arr:"VIC"},VG:{dep:"VIC",arr:"GTW"},SL:{dep:"SSD",arr:"LST"},LS:{dep:"LST",arr:"SSD"}},p.railCriteria=[e.RailSearchCriteria.Depart,e.RailSearchCriteria.Arrive],p.travelCards=[{display:"Young persons railcard",value:"YNG"},{display:"Disability railcard",value:"DIS"},{display:"Family railcard",value:"FAM"},{display:"Forces railcard",value:"HMF"},{display:"Travel agency discount",value:"TAD"}],p.removePassingPointsFromResults=!0,p.type=ne.Rail,p._bookRailFromLive=!1,p.cheapest=new t.BehaviorSubject({outboundCheapest:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},inboundCheapest:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},cheapestClassTicket:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}},cheapestClassTicketReturn:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}},cheapestClassTicketDual:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}}}),p.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},p.maxDate={year:l.default().add("month",6).year(),month:l.default().add("month",6).month(),day:l.default().add("month",6).date()},p.summary={},p._outbound_date=null,p._outbound_time=null,p._return_date=null,p._return_time=null;var m=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};return p.updateTempParams(p.searchService.makeRailQuery(m.tempParams)),m.originalUserSearch.transactionIdentifier=null,p._originalUserSearch=m.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){p.travellers=e;var t=p.helpers.selectedTravellers(e,ne.Rail);p.tempParams.noOfAdults=t.adults.length,p.tempParams.noOfChildren=t.children.length,p.travellers=e,p._isValid()})),d.changeUser.subscribe((function(e){p.updateAvaliableClasses()})),p._isValid(),p}return m(a,i),Object.defineProperty(a.prototype,"ticketTypes",{get:function(){return this._ticketTypes},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedSection",{get:function(){return this._selectedSection},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedTicket",{get:function(){return this._selectedTicket},set:function(e){this._selectedTicket=e,this._selectedTicket?this._selectedSummary=this._findSummary(this._selectedTicket.journey,this.summary.outbound||[]):this._selectedSummary=null},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectedInboundTicket",{get:function(){return this._selectedInboundTicket},set:function(e){var t=this;this._selectedInboundTicket=e,this._selectedInboundTicket?this._selectedInboundSummary=this.summary.return.find((function(e){return e.journeyHash===t._selectedTicket.journey.journeyHash})):this._selectedSummary=null},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"transactionIdentifier",{get:function(){return this.tempParams.transactionIdentifier},set:function(e){this.tempParams.transactionIdentifier=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"bookRailFromLive",{get:function(){return this._bookRailFromLive},set:function(e){this._bookRailFromLive=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"openReturn",{get:function(){return this.tempParams.chosenSearchType===te.OpenReturnJourney},set:function(e){this.tempParams.chosenSearchType=e?te.OpenReturnJourney:te.ReturnJourney,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfAdults",{get:function(){return this.tempParams.noOfAdults},set:function(e){this.tempParams.noOfAdults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfChildren",{get:function(){return this.tempParams.noOfChildren},set:function(e){this.tempParams.noOfChildren=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingTo",{get:function(){return this.tempParams.travellingTo},set:function(e){var t;this.tempParams.travellingTo=e,this._travellingTo="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?this._travellingTo=e.railstation.id:(null==e?void 0:e.id)&&(this._travellingTo=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingFrom",{get:function(){return this.tempParams.travellingFrom},set:function(e){var t;this.tempParams.travellingFrom=e,this._travellingFrom="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?this._travellingFrom=e.railstation.id:(null==e?void 0:e.id)&&(this._travellingFrom=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenRailClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"extraTime",{get:function(){return this.tempParams.extraTime},set:function(e){this.tempParams.extraTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"via",{get:function(){return this.tempParams.via},set:function(e){this.tempParams.via=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"viaLocation",{get:function(){return this.tempParams.viaLocation},set:function(e){var t;this.tempParams.viaLocation=e,this._viaLocation="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)&&(this._viaLocation=e.railstation.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outBoundDateTime",{get:function(){return this.tempParams.outBoundDateTime},set:function(e){this.tempParams.outBoundDateTime=e,e&&e.isValid()&&(this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this.minInboundDate={year:e.year(),month:e.month()+1,day:e.date()},this.outBoundDateTime&&this.inBoundDateTime&&this.outBoundDateTime.isAfter(this.inBoundDateTime)&&(this.inBoundDateTime=this.inBoundDateTime.set("date",e.date()).set("month",e.month()).set("year",e.year())),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outboundCriteria",{get:function(){return this.tempParams.outboundCriteria},set:function(e){this.tempParams.outboundCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"inBoundDateTime",{get:function(){return this.tempParams.inBoundDateTime},set:function(e){this.tempParams.inBoundDateTime=e,e&&e.isValid()&&(this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outbound_date",{get:function(){return this._outbound_date},set:function(e){this._outbound_date=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outbound_time",{get:function(){return this._outbound_time},set:function(e){this._outbound_time=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"return_date",{get:function(){return this._return_date},set:function(e){this._return_date=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"return_time",{get:function(){return this._return_time},set:function(e){this._return_time=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnCriteria",{get:function(){return this.tempParams.returnCriteria},set:function(e){this.tempParams.returnCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"carnetTicket",{get:function(){return this.tempParams.carnetTicket},set:function(e){this.tempParams.carnetTicket=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"disableAutoDiscounts",{get:function(){return this.tempParams.disableAutoDiscounts},set:function(e){this.tempParams.disableAutoDiscounts=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"prioritiseByPrice",{get:function(){return this.tempParams.prioritiseByPrice},set:function(e){this.tempParams.prioritiseByPrice=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"applyRailcards",{get:function(){return this.tempParams.applyRailcards},set:function(e){e||(this.railCards=[]),this.tempParams.applyRailcards=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"railCards",{get:function(){return this.tempParams.railCards},set:function(e){this.tempParams.railCards=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(48).fill(0).map((function(e,t){return{value:Math.floor(t/2).toString().padStart(2,"0")+(t%2*30).toString().padStart(2,"0"),display:Math.floor(t/2).toString().padStart(2,"0")+":"+(t%2*30).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),a.prototype.getAirportExpressStations=function(){return this.airportExpressStations},Object.defineProperty(a.prototype,"airportExpressStation",{get:function(){return this.tempParams.airportExpressStation},set:function(e){this.tempParams.airportExpressStation=e,this._setAirportExpressStations(),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isAirportExpress",{get:function(){return this.tempParams.isAirportExpress},set:function(e){this.tempParams.isAirportExpress=e,this._isValid()},enumerable:!1,configurable:!0}),a.prototype.setAirportExpressStationIds=function(e){var t=e.departureLocationId,r=e.arrivalLocationId;t&&r&&(this._travellingFrom=t,this._travellingTo=r,this._isValid())},a.prototype._findSummary=function(e,t){return t.find((function(t){return t.journeyHash===e.journeyHash}))},a.prototype.updateLowestPrice=function(e){return this.findCheapestTicket()},a.prototype.processResults=function(e){var t=this;this.updateAvaliableClasses(),this.transactionIdentifier=null;var r=function(e){var t;return Object.assign(Object.assign({},e),{type:null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.toLowerCase(),selected:!1,selectable:!0})},i=function(e){var t;return Object.assign(Object.assign({},e),{type:null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.toLowerCase(),selected:!1,selectable:!0})},a=function(e){return t.helpers.clone(e).sort((function(e,t){var r=l.default(e.departDateTime),i=l.default(t.departDateTime);return r.isBefore(i)?-1:r.isAfter(i)?1:0})).map((function(e){var a=function(e,t){return e.price-t.price},n=(e.dualSingleJourneyFares||[]).sort(a).map(r),o=(e.openReturnJourneyFares||[]).sort(a).map(r),s=(e.returnJourneyFares||[]).sort(a).map(r),l=(e.singleJourneyFares||[]).sort(a).map(r),u=(e.splitFares||[]).sort((function(e,t){return e.price-t.price})).map(i),c=n.map(r),d=o.map(r),h=s.map(r),p=l.map(r),m=u.map(i);return Object.assign(Object.assign({},e),{dualSingleJourneyFares:t.helpers.arrayToObjectArray(c,["type",["terms.ticketTypeCode","price"]]),openReturnJourneyFares:t.helpers.arrayToObjectArray(d,["type",["terms.ticketTypeCode","price"]]),returnJourneyFares:t.helpers.arrayToObjectArray(h,["type",["terms.ticketTypeCode","price"]]),singleJourneyFares:t.helpers.arrayToObjectArray(p,["type",["terms.ticketTypeCode","price"]]),splitFares:t.helpers.arrayToObjectArray(m,["type",["terms.ticketTypeCode","price"]])})}))};return e.map((function(e){t.summary=e.summary;var r=a(e.outbound||[]),i=a(e.return||[]),n=t.makeFareNames([r||[],i||[]]),o=function(e,r){var i=n[r],a=i.getTicketTypes();return Object.entries(a).reduce((function(r,a){var n=S(a,2),o=n[0];n[1];return r[o]=i.workoutIndexes(o).map((function(r){return t.helpers.fieldFromObject(e,r)})),r}),{})},s=function(e){return Object.assign(Object.assign({},e),{returnJourneyFares:o(e.returnJourneyFares,"returnJourneyFares"),openReturnJourneyFares:o(e.openReturnJourneyFares,"openReturnJourneyFares"),dualSingleJourneyFares:o(e.dualSingleJourneyFares,"dualSingleJourneyFares"),singleJourneyFares:o(e.singleJourneyFares,"singleJourneyFares"),splitFares:o(e.splitFares,"splitFares")})},l=r.map(s),u=i.map(s),c=t.updatePrices(l,{cheapestTickets:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},cheapestClassTicket:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}},outboundClassTicket:{standardClassFare:{price:0,journey:null,fare:null},firstClassFare:{price:0,journey:null,fare:null},inboundStandardClassFare:{price:0,journey:null,fare:null},inboundFirstClassFare:{price:0,journey:null,fare:null}}},!1),d=t.updatePrices(u,{cheapestTickets:{dualSingleJourneyFares:{price:0,journey:null,fare:null},openReturnJourneyFares:{price:0,journey:null,fare:null},returnJourneyFares:{price:0,journey:null,fare:null},singleJourneyFares:{price:0,journey:null,fare:null},splitFares:{price:0,journey:null,fare:null}},cheapestClassTicket:c.cheapestClassTicket,outboundClassTicket:c.cheapestClassTicket},!0);return t.cheapest.next({outboundCheapest:c.cheapestTickets,inboundCheapest:d.cheapestTickets,cheapestClassTicket:d.cheapestClassTicket,cheapestClassTicketReturn:c.outboundClassTicket,cheapestClassTicketDual:d.outboundClassTicket}),Object.assign(Object.assign({},e),{outbound:l,return:u})}))},a.prototype.makeFareNames=function(e){var t=this;return["returnJourneyFares","openReturnJourneyFares","dualSingleJourneyFares","singleJourneyFares","splitFares"].reduce((function(r,i){return r[i]=t._makeFareNames(e,i),r}),{returnJourneyFares:new wt,openReturnJourneyFares:new wt,dualSingleJourneyFares:new wt,singleJourneyFares:new wt,splitFares:new wt})},a.prototype._makeFareNames=function(e,t){return s.default.flatten(e||[]).reduce((function(e,r){return r?(Object.entries(r[t]||{}).forEach((function(t){var r=S(t,2),i=r[0],a=r[1];Object.entries(a).forEach((function(t){var r=S(t,2),a=r[0],n=r[1];e.addFares(i,a,n)}))})),e.nextJourney(),e):e}),new wt)},a.prototype.updatePrices=function(t,r,i){var a=function(e,t,r){if(!t||0===t.length)return e;var i=t[0].price;return e.price>0&&e.price<i?e:{price:i,journey:r,fare:t[0]}};return t.reduce((function(t,r){var n,o,l,u,c=function(e,t){return e.price-t.price},d=s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),h=s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return e&&e.class===ee.First})),p=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),m=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===ee.First})),f=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),v=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===ee.First})),y=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===ee.Standard})),b=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===ee.First})),g=C(p,f,y),S=C(d,g).sort(c),A=C(m,v,b),T=C(h,A).sort(c);if(i||(g.sort(c),T.sort(c)),t.cheapestTickets.dualSingleJourneyFares=a(t.cheapestTickets.dualSingleJourneyFares,s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.openReturnJourneyFares=a(t.cheapestTickets.openReturnJourneyFares,s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.returnJourneyFares=a(t.cheapestTickets.returnJourneyFares,s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return!!e})),r),i){if(t.cheapestClassTicket.inboundStandardClassFare=a(t.cheapestClassTicket.inboundStandardClassFare,S,r),t.cheapestClassTicket.inboundFirstClassFare=a(t.cheapestClassTicket.inboundFirstClassFare,T,r),t.outboundClassTicket.inboundStandardClassFare=a(t.outboundClassTicket.inboundStandardClassFare,g,r),t.outboundClassTicket.inboundFirstClassFare=a(t.outboundClassTicket.inboundFirstClassFare,A,r),(null===(o=null===(n=t.cheapestClassTicket.standardClassFare)||void 0===n?void 0:n.fare)||void 0===o?void 0:o.singleOrReturn)===e.RailJourneyFareType.Single){var D=a(t.cheapestClassTicket.inboundStandardClassFare,d,r);t.cheapestClassTicket.standardClassFare.price>t.outboundClassTicket.standardClassFare.price?t.cheapestClassTicket.standardClassFare=t.outboundClassTicket.standardClassFare:D.price>t.cheapestClassTicket.inboundStandardClassFare.price&&(t.cheapestClassTicket.inboundStandardClassFare=D)}if((null===(u=null===(l=t.cheapestClassTicket.firstClassFare)||void 0===l?void 0:l.fare)||void 0===u?void 0:u.singleOrReturn)===e.RailJourneyFareType.Single){D=a(t.cheapestClassTicket.inboundFirstClassFare,h,r);t.cheapestClassTicket.firstClassFare.price>t.outboundClassTicket.firstClassFare.price?t.cheapestClassTicket.firstClassFare=t.outboundClassTicket.firstClassFare:D.price>t.cheapestClassTicket.inboundFirstClassFare.price&&(t.cheapestClassTicket.inboundFirstClassFare=D)}}else t.cheapestClassTicket.standardClassFare=a(t.cheapestClassTicket.standardClassFare,S,r),t.cheapestClassTicket.firstClassFare=a(t.cheapestClassTicket.firstClassFare,T,r),t.outboundClassTicket.standardClassFare=a(t.outboundClassTicket.standardClassFare,g,r),t.outboundClassTicket.firstClassFare=a(t.outboundClassTicket.firstClassFare,A,r);return t}),r)},a.prototype.selectTicket=function(t,r,i,a,n,o){var s,u,c,h,p,m,f,v;return void 0===o&&(o=!1),y(this,void 0,void 0,(function(){var y,g,S,C,A,T,D,P,F;return b(this,(function(b){switch(b.label){case 0:return i.selectable?this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===i.fareHash?(this.selectedTicket=null,this._applyFilter(),[2]):(y=this.selectedTicket,this.alternativeWellbeing=this.userService.getUserFavoriteObject(dt.AlternativeRailItineraryEnabled),y&&!o&&this.alternativeWellbeing?(g=y.journey,S=r,C=l.default(g.arriveDateTime).diff(l.default(g.departDateTime),"hours",!0),A=l.default(S.arriveDateTime).diff(l.default(S.departDateTime),"hours",!0),T=l.default(S.departDateTime).diff(l.default(g.departDateTime),"day"),[4,this.checkAlternativeHours(C+A,T)]):[3,2]):[2];case 1:return b.sent()&&this.selectTicket(t,r,i,a,n,!0),[3,31];case 2:switch(D=this.originalUserSearch,n){case"singleJourneyFares":return[3,3];case"returnJourneyFares":return[3,7];case"dualSingleJourneyFares":return[3,13];case"openReturnJourneyFares":return[3,19];case"splitFares":return[3,23]}return[3,29];case 3:return(null===(s=null==r?void 0:r.ticketExtras)||void 0===s?void 0:s.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:r})]:[3,5];case 4:P=b.sent(),r.ticketExtras=P||[],b.label=5;case 5:return[4,this.addSingleJourneyToBasket(a,D,r,i)];case 6:return b.sent(),this.selectedTicket=null,[3,30];case 7:return t!==e.RailDirection.Outbound?[3,8]:(this.selectedTicket={journey:r,fare:i},[3,12]);case 8:return this.selectedTicket?(null===(c=null===(u=this.selectedTicket.journey)||void 0===u?void 0:u.ticketExtras)||void 0===c?void 0:c.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,10]:[3,12];case 9:P=b.sent(),y.journey.ticketExtras=P||[],b.label=10;case 10:return[4,this.addReturnJourneyToBasket(a,D,this.selectedTicket.journey,r,this.selectedTicket.fare,i)];case 11:b.sent(),this.selectedTicket=null,b.label=12;case 12:return[3,30];case 13:return t!==e.RailDirection.Outbound?[3,14]:(this.selectedTicket={journey:r,fare:i},[3,18]);case 14:return this.selectedTicket?(null===(p=null===(h=this.selectedTicket.journey)||void 0===h?void 0:h.ticketExtras)||void 0===p?void 0:p.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,16]:[3,18];case 15:P=b.sent(),console.log(P),y.journey.ticketExtras=P||[],b.label=16;case 16:return[4,this.addDualSingleToBasket(a,D,this.selectedTicket.journey,r,this.selectedTicket.fare,i)];case 17:b.sent(),this.selectedTicket=null,b.label=18;case 18:return[3,30];case 19:return(null===(m=null==r?void 0:r.ticketExtras)||void 0===m?void 0:m.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:r})]:[3,21];case 20:P=b.sent(),console.log(P),r.ticketExtras=P||[],b.label=21;case 21:return[4,this.addOpenReturnToBasket(a,D,r,i)];case 22:return b.sent(),this.selectedTicket=null,[3,30];case 23:return t!==e.RailDirection.Outbound?[3,24]:(this.selectedTicket={journey:r,fare:i},[3,28]);case 24:return this.selectedTicket?(null===(v=null===(f=this.selectedTicket.journey)||void 0===f?void 0:f.ticketExtras)||void 0===v?void 0:v.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,26]:[3,28];case 25:P=b.sent(),console.log(P),y.journey.ticketExtras=P||[],b.label=26;case 26:return F=(Math.random()+1).toString(36).substring(3),[4,this.addSplitJourneyToBasket(a,D,this.selectedTicket.journey,r,this.selectedTicket.fare,i,F)];case 27:b.sent(),this.selectedTicket=null,b.label=28;case 28:return[3,30];case 29:n,b.label=30;case 30:this._applyFilter(),b.label=31;case 31:return[2]}}))}))},a.prototype.checkAlternativeHours=function(e,t){return y(this,void 0,void 0,(function(){var r;return b(this,(function(i){switch(i.label){case 0:return r=this.searchService.searches[ne.Rail],this.alternativeWellbeing.enable&&Number(this.alternativeWellbeing.hours)>0&&r.chosenSearchType===te.ReturnJourney&&e>=Number(this.alternativeWellbeing.hours)&&0===t&&this.noOfAdults+this.noOfChildren<=4?[4,this.modalService.open(d.AlternativeRailModalComponent)]:[3,2];case 1:return i.sent()?(this.selectedTicket=null,this._applyFilter(),this.performAlternativeRailAndHotelSearch(),[2,!1]):[2,!0];case 2:return[2,!0];case 3:return[2]}}))}))},a.prototype.performAlternativeRailAndHotelSearch=function(){console.log("+++ Creating the Alternative Search Params +++");var t=this.searchService.search_objects[ne.Hotel],r=this.searchService.search_objects[ne.Rail];t.chosen=!0,r.chosen=!0,t.priority=r.priority;var i=this.searchService.searches[ne.Hotel],a=this.searchService.searches[ne.Rail];a.inBoundDateTime=this.searchService.searches[ne.Rail].inBoundDateTime.add(1,"day"),i.location_type_select=e.LocationTypes.TrainStation,i.location=a.travellingTo,i.trainsStation=a.travellingTo.railstation,i.checkin_date=a.outBoundDateTime,i.checkout_date=a.inBoundDateTime,i.no_of_occupants=a.noOfAdults+a.noOfChildren,i.no_of_rooms=1,i.distance=10,this.searchService.startSearches(e.WellbeingEnum.WELLBEING)},a.prototype.selectTicketNoAdd=function(t,r,i,a,n){var o;return y(this,void 0,void 0,(function(){var a,s;return b(this,(function(l){if(!i.selectable)return console.warn("+++ Rail fare is not selectable +++"),[2];if(a=this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===i.fareHash,s=t===e.RailDirection.Inbound&&(this.selectedInboundTicket&&this.selectedInboundTicket.journey.journeyHash===r.journeyHash&&this.selectedInboundTicket.fare.fareHash===i.fareHash),a||t===e.RailDirection.Inbound&&s)return console.warn("+++ Journey and fare are already selected - breaking out +++"),this._selectedInboundTicket=null,a&&(this.selectedTicket=null,this.applyFilter()),[2];switch((this._selectedSection&&this._selectedSection!==n||"returnJourneyFares"===this._selectedSection&&(null===(o=this.selectedTicket)||void 0===o?void 0:o.fare.identifiers.fareIdentifier)!==i.identifiers.fareIdentifier)&&(this.selectedTicket=null,this._selectedInboundTicket=null),this._selectedSection=n,this.originalUserSearch,n){case"singleJourneyFares":this.selectedTicket={journey:r,fare:i};break;case"returnJourneyFares":case"dualSingleJourneyFares":t===e.RailDirection.Outbound?this.selectedTicket={journey:r,fare:i}:this.selectedTicket&&(this.selectedInboundTicket={journey:r,fare:i});break;case"openReturnJourneyFares":this.selectedTicket={journey:r,fare:i};break;default:n}return this.applyFilter(),[2]}))}))},a.prototype.addToBasket=function(t,r,i,a,n,o){return y(this,void 0,void 0,(function(){return b(this,(function(s){switch(s.label){case 0:return r.chosenSearchType!==te.SingleJourney?[3,2]:[4,this.addSingleJourneyToBasket(t,r,i,a)];case 1:return s.sent(),[3,7];case 2:return"openReturnJourneyFares"!==this.selectedSection?[3,4]:[4,this.addOpenReturnToBasket(t,r,i,a)];case 3:return s.sent(),[3,7];case 4:return"Return"!==a.singleOrReturn?[3,5]:[2,this.addReturnJourneyToBasket(t,r,i,o,a,n)];case 5:return[4,this.addDualSingleToBasket(t,r,i,o,a,n)];case 6:s.sent(),s.label=7;case 7:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.addOpenReturnToBasket=function(e,t,r,i){return y(this,void 0,void 0,(function(){return b(this,(function(a){return[2,this.addSingleJourneyToBasket(e,t,r,i)]}))}))},a.prototype.addDualSingleToBasket=function(t,r,i,a,n,o){var s,l;return y(this,void 0,void 0,(function(){var u,c,d,h,p,m,f,v,y,g,S;return b(this,(function(b){switch(b.label){case 0:return u=this.getSearchQuery(r),(null===(s=null==a?void 0:a.ticketExtras)||void 0===s?void 0:s.length)&&(c=this.createTicketExtrasObject(a.ticketExtras[0])),(null===(l=null==i?void 0:i.ticketExtras)||void 0===l?void 0:l.length)&&(d=this.createTicketExtrasObject(i.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return h=b.sent(),p=null==h?void 0:h.subject.value,m=this.getTermsAndCond(n,i,a),p?(f=this.getLegsFromRailJourneyOption(i),v=this.getLegsFromRailJourneyOption(a),(y=this.findCheapestTicket()).amount=+y.amount.toFixed(2),g={basket:p.id,service:t,detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,price:n.price,legs:f}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:o.providerName,ticketDescription:o.type,legs:v}]},transactionIdentifier:n.identifiers.transactionIdentifier,outbound:{fareIdentifiers:[n.identifiers.fareIdentifier],journeyIdentifier:n.identifiers.journeyIdentifier,isDualSingleReturn:!0,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs),eTicket:!!n.eTicketAvailable},return:{fareIdentifiers:[o.identifiers.fareIdentifier],journeyIdentifier:o.identifiers.journeyIdentifier,isDualSingleReturn:!0,journeyLegs:this.removedScheduledPlatformFromCallingPoints(a.journeyLegs),eTicket:!!o.eTicketAvailable},termsAndCond:m},adults:u.adults,children:u.children,price:Number(Number(n.price+o.price).toFixed(2)),currency:n.currency,searchQuery:u,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:i.arriveDateTime,inboundDate:a.arriveDateTime,lowestPrice:y.amount!=Number(n.price+o.price)||y.currencyCode!=n.currency?y.amount:null,lowestPriceCurrency:y.amount!=Number(n.price+o.price)||y.currencyCode!=n.currency?y.currencyCode:null},c&&(g.detail.return.ticketExtras=c),d&&(g.detail.outbound.ticketExtras=d),[4,this.basketService.addToBasket(g,h,this.searchService,this.travellers,n.requiresReason||o.requiresReason)]):[3,3];case 2:return(S=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,S];case 3:return[2,e.DifferentInvokdedUserReasons.continue]}}))}))},a.prototype.findCheapestTicket=function(){var e;if(!this.fullResults.length)return{amount:0,currencyCode:"GBP"};try{var t,r,i,a;if(this.chosenSearchType==te.SingleJourney)return this.fullResults[0].outbound.forEach((function(e){Object.keys(e.singleJourneyFares).forEach((function(r){var i=e.singleJourneyFares[r].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];i&&(!t||t.price>i.price)&&(t=i)}))})),{amount:t.price,currencyCode:t.currency};if(this.fullResults[0].outbound.forEach((function(e){Object.keys(e.dualSingleJourneyFares).forEach((function(t){var i=e.dualSingleJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];i&&(!r||r.price>i.price)&&(r=i)})),Object.keys(e.returnJourneyFares).forEach((function(t){var r=e.returnJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];r&&(!i||i.price>r.price)&&(i=r)}))})),(null===(e=this.fullResults[0].return)||void 0===e?void 0:e.length)&&this.fullResults[0].return.forEach((function(e){Object.keys(e.dualSingleJourneyFares).forEach((function(t){var r=e.dualSingleJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];r&&(!a||a.price>r.price)&&(a=r)})),Object.keys(e.returnJourneyFares).forEach((function(t){var r=e.returnJourneyFares[t].filter((function(e){return null!=e})).sort((function(e){return e.price}))[0];r&&(!i||i.price>r.price)&&(i=r)}))})),i){if(a){if(r.price+a.price<i.price&&r.currency==a.currency)return{amount:r.price+a.price,currencyCode:r.currency}}else if((null==r?void 0:r.price)<i.price)return{amount:r.price,currencyCode:r.currency};return{amount:i.price,currencyCode:i.currency}}return a?{amount:r.price+a.price,currencyCode:r.currency}:{amount:r.price,currencyCode:r.currency}}catch(e){return console.error(e),{amount:0,currencyCode:"GBP"}}},a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeRailQuery()),this._isValid()},a.prototype._setAirportExpressStations=function(){var e=this.airportExpressStationsCodes[this.airportExpressStation];console.log("--- Parsed Station is :",e),e&&(this._travellingFrom=e.dep,this._travellingTo=e.arr)},a.prototype._isValid=function(){var e,t;if(this.doChecks){this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var r=l.default();this._travellingFrom||this.validationMessages.push("Please Enter a From Location."),this._travellingTo||this.validationMessages.push("Please Enter a To Location."),(null===(e=this.outBoundDateTime)||void 0===e?void 0:e.isBefore(r))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),this.chosenSearchType===te.ReturnJourney&&(null===(t=this.inBoundDateTime)||void 0===t?void 0:t.isSameOrBefore(this.outBoundDateTime))&&this.validationMessages.push("Return Date/Time must be after Departure Date/Time"),this.via&&(this.tempParams.viaLocation||this.validationMessages.push("Please enter a via location.")),this.tempParams.noOfAdults+this.tempParams.noOfChildren<1&&this.validationMessages.push("There must be at least 1 traveller"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)}},a.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery(this.tempParams);return this.tempParams.transactionIdentifier=null,this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.Railfetcher.fetchList(e))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.Rail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(e){var t,r,i,a,n=e;return this.isAirportExpress&&(n.isAirportExpress=this.isAirportExpress),this.airportExpressStation&&(n.airportExpressStation=this.airportExpressStation),this.travellingFrom&&(n.travellingFrom=this.travellingFrom),this.travellingTo&&(n.travellingTo=this.travellingTo),this.viaLocation&&(n.viaLocation=this.viaLocation),n.outboundStationCode=null===(r=null===(t=this.travellingFrom)||void 0===t?void 0:t.railstation)||void 0===r?void 0:r.stationCode,n.inboundStationCode=null===(a=null===(i=this.travellingTo)||void 0===i?void 0:i.railstation)||void 0===a?void 0:a.stationCode,n},a.prototype.startRecentSearch=function(e){var t,r;if(this.chosenSearchType=e.searchArgs.journeyType,this.chosenSearchClass=e.searchArgs.class,this.extraTime=e.searchArgs.extraTimeToChange,this.isAirportExpress=e.searchArgs.isAirportExpress,this.airportExpressStation=e.searchArgs.airportExpressStation,this.outBoundDateTime=e.searchArgs.outboundDepartureDateTime?l.default(e.searchArgs.outboundDepartureDateTime):l.default(e.searchArgs.outboundArrivalDateTime),this.outboundCriteria=this.getCriteria(e.searchArgs.outboundDepartureDateTime,e.searchArgs.outboundArrivalDateTime),e.searchArgs.journeyType===te.ReturnJourney&&(this.inBoundDateTime=e.searchArgs.returnDepartureDateTime?l.default(e.searchArgs.returnDepartureDateTime):l.default(e.searchArgs.returnArrivalDateTime),this.returnCriteria=this.getCriteria(e.searchArgs.returnDepartureDateTime,e.searchArgs.returnArrivalDateTime)),this.applyRailcards=!!(null===(r=null===(t=e.searchArgs)||void 0===t?void 0:t.railCardQualifiers)||void 0===r?void 0:r.length),this.applyRailcards&&(this.railCards=e.searchArgs.railCardQualifiers),this.travellingTo=e.searchArgs.travellingTo,this.travellingFrom=e.searchArgs.travellingFrom,e.searchArgs.viaLocation&&(this.via=!0,this.viaLocation=e.searchArgs.viaLocation),e.searchArgs.isAirportExpress){var i={departureLocationId:e.searchArgs.departureLocationId,arrivalLocationId:e.searchArgs.arrivalLocationId};this.setAirportExpressStationIds(i)}e.searchArgs.journeyType===te.OpenReturnJourney&&(this.openReturn=!0),this.searchService.startSearches()},a.prototype._updateOutboundDateTime=function(){if(this._outbound_date&&this._outbound_time){var e=this.helpers.ngDateToMoment(this._outbound_date,this._outbound_time);this.outBoundDateTime=e.isValid()?e:null,this._isValid()}},a.prototype._updateReturnDateTime=function(){if(this._return_date&&this._return_time){var e=this.helpers.ngDateToMoment(this._return_date,this._return_time);this.inBoundDateTime=e.isValid()?e:null,this._isValid()}},a.prototype.getSearchQuery=function(t){var r,i,a,n,o,s,l;this.isAirportExpress&&this.openReturn&&(this.openReturn=!1);var u={countryCode:"GB",journeyType:t.chosenSearchType,adults:t.noOfAdults,arrivalLocationId:null===(i=null===(r=t.travellingTo)||void 0===r?void 0:r.railstation)||void 0===i?void 0:i.id,departureLocationId:null===(n=null===(a=t.travellingFrom)||void 0===a?void 0:a.railstation)||void 0===n?void 0:n.id,children:t.noOfChildren,class:t.chosenSearchClass,extraTimeToChange:t.extraTime,outboundArrivalDateTime:this.helpers.formatGraphQLDateTime(t.outBoundDateTime),outboundDepartureDateTime:this.helpers.formatGraphQLDateTime(t.outBoundDateTime),returnArrivalDateTime:this.helpers.formatGraphQLDateTime(t.inBoundDateTime),returnDepartureDateTime:this.helpers.formatGraphQLDateTime(t.inBoundDateTime),viaLocationId:null===(s=null===(o=t.viaLocation)||void 0===o?void 0:o.railstation)||void 0===s?void 0:s.id,railCardQualifiers:null===(l=t.railCards)||void 0===l?void 0:l.map((function(e){return(null==e?void 0:e.code)||""})),transactionIdentifier:t.transactionIdentifier};switch(0===t.noOfChildren&&(u.children=null),""===this._viaLocation&&(u.viaLocationId=null),t.outboundCriteria){case e.RailSearchCriteria.Depart:u.outboundArrivalDateTime=null;break;case e.RailSearchCriteria.Arrive:u.outboundDepartureDateTime=null;break;default:console.warn("+++ Unknown Criteria: "+this.tempParams.outboundCriteria+" +++")}switch(t.returnCriteria){case e.RailSearchCriteria.Depart:u.returnArrivalDateTime=null;break;case e.RailSearchCriteria.Arrive:u.returnDepartureDateTime=null;break;default:console.warn("+++ Unknown Criteria: "+this.tempParams.returnCriteria+" +++")}switch(t.chosenSearchType){case te.SingleJourney:case te.OpenReturnJourney:u.returnDepartureDateTime=null,u.returnArrivalDateTime=null}return t.isAirportExpress&&(u.arrivalLocationId=this._travellingTo,u.departureLocationId=this._travellingFrom),this.helpers.removeNulls(u)},a.prototype.getCriteria=function(t,r){return t?e.RailSearchCriteria.Depart:r?e.RailSearchCriteria.Arrive:null},a.prototype.updateFromPreviousSearches=function(e){},a.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.chosenSearchType=r.journeyType,this.chosenSearchClass=r.class,this.extraTime=r.extraTimeToChange,this.outBoundDateTime=r.outboundDepartureDateTime?l.default(r.outboundDepartureDateTime):l.default(r.outboundArrivalDateTime),this.outboundCriteria=this.getCriteria(r.outboundDepartureDateTime,r.outboundArrivalDateTime),r.journeyType===te.ReturnJourney&&(this.inBoundDateTime=r.returnDepartureDateTime?l.default(r.returnDepartureDateTime):l.default(r.returnArrivalDateTime),this.returnCriteria=this.getCriteria(r.returnDepartureDateTime,r.returnArrivalDateTime)),r.journeyType===te.OpenReturnJourney&&(this.openReturn=!0),r.departureLocationId&&this.searchService.getRailStationById(r.departureLocationId).subscribe((function(e){t.travellingFrom={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),r.arrivalLocationId&&this.searchService.getRailStationById(r.arrivalLocationId).subscribe((function(e){t.travellingTo={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),r.viaLocationId?(this.via=!0,this.searchService.getRailStationById(r.viaLocationId).subscribe((function(e){t.viaLocation={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}}))):this.viaLocation=null,e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},a.prototype.getRailStation=function(e,i){return 3===e.length?(null==i||i.next(!0),this.getRailStationFetcher.fetchList({code:e}).pipe(r.tap((function(){return null==i?void 0:i.next(!1)})),r.take(1))):t.of()},a.prototype.getSelectedRailJourneyFare=function(){return null},a.prototype.getLegsFromRailJourneyOption=function(e){var t=[];return(null==e?void 0:e.journeyLegs.length)&&(t=e.journeyLegs.map((function(e){return{operator:e.operator,departureDateTime:e.departDateTime,departureStationName:e.depart,arrivalDateTime:e.arriveDateTime,arrivalStationName:e.arrive}}))),t},a.prototype.getLegsFromRailJourneyOptionSplit=function(e,t,r,i){var a=[];return(null==e?void 0:e.journeyLegs.length)&&(a=e.journeyLegs.map((function(e){var a={operator:e.operator,departureDateTime:e.departDateTime,departureStationName:e.depart,arrivalDateTime:e.arriveDateTime,arrivalStationName:e.arrive},n=e.callingPoints.find((function(e){return e.stationCode===t}));return n?0===i?r?(a.arrivalDateTime=n.arrivalDateTime,a.arrivalStationName=n.stationName):(a.departureDateTime=n.departureDateTime,a.departureStationName=n.stationName):r?(a.departureDateTime=n.departureDateTime,a.departureStationName=n.stationName):(a.arrivalDateTime=n.arrivalDateTime,a.arrivalStationName=n.stationName):(a.arrivalDateTime=e.callingPoints[e.callingPoints.length-1].arrivalDateTime,a.arrivalStationName=e.callingPoints[e.callingPoints.length-1].stationName,a.departureDateTime=e.callingPoints[0].departureDateTime,a.departureStationName=e.callingPoints[0].stationName),a}))),a},a.prototype.addSingleJourneyToBasket=function(t,r,i,a){var n;return y(this,void 0,void 0,(function(){var o,s,l,u,c,d,h,p,m;return b(this,(function(f){switch(f.label){case 0:return o=this.getSearchQuery(r),(null===(n=null==i?void 0:i.ticketExtras)||void 0===n?void 0:n.length)&&(s=this.createTicketExtrasObject(i.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return l=f.sent(),u=null==l?void 0:l.subject.value,c=this.getTermsAndCond(a,i),u?(d=this.getLegsFromRailJourneyOption(i),(h=this.findCheapestTicket()).amount=+h.amount.toFixed(2),p={basket:u.id,service:t.toString(),detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.from,supplierTickets:[{supplierName:a.providerName,ticketDescription:a.type,price:a.price,legs:d}]},transactionIdentifier:a.identifiers.transactionIdentifier,outbound:{eTicket:!!a.eTicketAvailable,fareIdentifiers:[a.identifiers.fareIdentifier],journeyIdentifier:a.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs)},termsAndCond:c},adults:o.adults,children:o.children,price:a.price,currency:a.currency,searchQuery:o,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:i.departDateTime,lowestPrice:h.amount!=Number(a.price)||h.currencyCode!=a.currency?h.amount:null,lowestPriceCurrency:h.amount!=Number(a.price)||h.currencyCode!=a.currency?h.currencyCode:null},s&&(p.detail.outbound.ticketExtras=s),[4,this.basketService.addToBasket(p,l,this.searchService,this.travellers,a.requiresReason)]):[3,3];case 2:return(m=f.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,m];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.addReturnJourneyToBasket=function(t,r,i,a,n,o){var s;return y(this,void 0,void 0,(function(){var l,u,c,d,h,p,m,f,v,y;return b(this,(function(b){switch(b.label){case 0:return l=this.getSearchQuery(r),(null===(s=null==i?void 0:i.ticketExtras)||void 0===s?void 0:s.length)&&(u=this.createTicketExtrasObject(i.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return c=b.sent(),d=null==c?void 0:c.subject.value,h=this.getTermsAndCond(n,i,a),d?(p=this.getLegsFromRailJourneyOption(i),m=this.getLegsFromRailJourneyOption(a),(f=this.findCheapestTicket()).amount=+f.amount.toFixed(2),v={basket:d.id,service:t,detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,price:n.price,legs:p}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:o.providerName,ticketDescription:o.type,legs:m}]},transactionIdentifier:n.identifiers.transactionIdentifier,outbound:{eTicket:!!n.eTicketAvailable,fareIdentifiers:[n.identifiers.fareIdentifier],journeyIdentifier:n.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs)},return:{eTicket:!!o.eTicketAvailable,fareIdentifiers:[o.identifiers.fareIdentifier],journeyIdentifier:o.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(a.journeyLegs)},termsAndCond:h},adults:l.adults,children:l.children,price:n.price,currency:n.currency,searchQuery:l,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:i.arriveDateTime,inboundDate:a.arriveDateTime,lowestPrice:f.amount!=Number(n.price)||f.currencyCode!=n.currency?f.amount:null,lowestPriceCurrency:f.amount!=Number(n.price)||f.currencyCode!=n.currency?f.currencyCode:null},u&&(v.detail.outbound.ticketExtras=u),[4,this.basketService.addToBasket(v,c,this.searchService,this.travellers,n.requiresReason||o.requiresReason)]):[3,3];case 2:return(y=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,y];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.addSplitJourneyToBasket=function(t,r,i,a,n,o,s){return y(this,void 0,void 0,(function(){var l,u,c,d,h,p,m,f,v,C,A,T,D,P,F=this;return b(this,(function(k){switch(k.label){case 0:return l=this.getSearchQuery(r),[4,this.basketService.getDefaultBasket()];case 1:if(u=k.sent(),c=null==u?void 0:u.subject.value,d=this.getTermsAndCond(n,i,a),h=function(r,h){return y(F,void 0,void 0,(function(){var p,m,f,v,y,g,S,C;return b(this,(function(b){switch(b.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return u=b.sent(),p=r.outboundSplit,m=r.inboundSplit,f=p.split,v=this.getLegsFromRailJourneyOptionSplit(i,f,!0,h),y=this.getLegsFromRailJourneyOptionSplit(a,f,!1,h),(g=this.findCheapestTicket()).amount=+g.amount.toFixed(2),S={basket:c.id,service:t,detail:{ticketQueueList:(i.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(i.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:v[y.length-1].arrivalDateTime,arrivalStationName:v[y.length-1].arrivalStationName,departureDateTime:v[0].departureDateTime,departureStationName:v[0].departureStationName,splitID:s,supplierTickets:[{supplierName:p.providerName,ticketDescription:p.type,price:p.price,legs:v}]},inwardDetail:{arrivalDateTime:y[y.length-1].arrivalDateTime,arrivalStationName:y[y.length-1].arrivalStationName,departureDateTime:y[0].departureDateTime,departureStationName:y[0].departureStationName,splitID:s,supplierTickets:[{supplierName:m.providerName,ticketDescription:m.type,legs:y}]},transactionIdentifier:p.identifiers.transactionIdentifier,outbound:{eTicket:!!p.eTicketAvailable,fareIdentifiers:[p.identifiers.fareIdentifier],journeyIdentifier:p.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPointsAndSplits(i.journeyLegs,v,f,h,!0)},return:{eTicket:!!m.eTicketAvailable,fareIdentifiers:[m.identifiers.fareIdentifier],journeyIdentifier:m.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPointsAndSplits(a.journeyLegs,y,f,h,!1)},termsAndCond:d},adults:l.adults,children:l.children,price:+p.price.toFixed(2),currency:p.currency,searchQuery:l,co2PerItem:i.co2PerItem,co2PerPassenger:i.co2PerPassenger,outboundDate:v[0].arrivalDateTime,inboundDate:y[0].arriveDateTime,lowestPrice:g.amount!=Number(p.price)||g.currencyCode!=p.currency?+g.amount.toFixed(2):null,lowestPriceCurrency:g.amount!=Number(p.price)||g.currencyCode!=p.currency?g.currencyCode:null},[4,this.basketService.addToBasket(S,u,this.searchService,this.travellers,n.requiresReason||o.requiresReason,!!h)];case 2:return(C=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,C]}}))}))},!c)return[3,10];p=[{outboundSplit:n.journey0,inboundSplit:o.journey0},{outboundSplit:n.journey1,inboundSplit:o.journey1}],k.label=2;case 2:k.trys.push([2,7,8,9]),m=g(p.entries()),f=m.next(),k.label=3;case 3:return f.done?[3,6]:(v=S(f.value,2),C=v[0],A=v[1],[4,h(A,C)]);case 4:k.sent(),k.label=5;case 5:return f=m.next(),[3,3];case 6:return[3,9];case 7:return T=k.sent(),D={error:T},[3,9];case 8:try{f&&!f.done&&(P=m.return)&&P.call(m)}finally{if(D)throw D.error}return[7];case 9:return[2,e.DifferentInvokdedUserReasons.cancel];case 10:return[2]}}))}))},a.prototype.removedScheduledPlatformFromCallingPoints=function(e){for(var t=0;t<e.length;t++)for(var r=e[t],i=0;i<r.callingPoints.length;i++){delete r.callingPoints[i].scheduledPlatform}return e},a.prototype.removedScheduledPlatformFromCallingPointsAndSplits=function(e,t,r,i,a){for(var n=JSON.parse(JSON.stringify(e)),o=function(e){var o=t[e],s=n[e];s.arriveDateTime=o.arrivalDateTime,s.departDateTime=o.departureDateTime,s.arrive=o.arrivalStationName,s.depart=o.departureStationName;for(var l=s.callingPoints.findIndex((function(e){return e.stationCode===r})),u=0;u<s.callingPoints.length;u++){delete s.callingPoints[u].scheduledPlatform}s.callingPoints=i?a?s.callingPoints.filter((function(e,t){return t>=l})):s.callingPoints.filter((function(e,t){return t<=l})):a?s.callingPoints.filter((function(e,t){return t<=l})):s.callingPoints.filter((function(e,t){return t>=l}))},s=0;s<n.length;s++)o(s);return n},a.prototype.createTicketExtrasObject=function(e){var t=this.noOfChildren*(null==e?void 0:e.childAmount)+this.noOfAdults*e.adultAmount;return[{type:e.identifiers.type,location:e.identifiers.location,date:e.identifiers.date,price:t}]},a.prototype.calculateTimeDifferenceInMins=function(e){return this.helpers.getTimeDifference(e.arriveDateTime,e.departDateTime).toString()},a.prototype.ticketIsAnETicket=function(){return null},a.prototype.applyFilter=function(){this._applyFilter()},a.prototype._applyFilter=function(){var t=this,r=function(e,r){var i=t._findSummary(r,t.summary.return);return t._selectedSummary?function(r){return r.map((function(r){var a,n,o,s;if(!r)return null;var l=t._selectedSummary[e];return Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),[null===(a=null==l?void 0:l[t.selectedTicket.fare.fareHash])||void 0===a?void 0:a.ruleDataWhenSelectedWith[r.fareHash],i?null===(n=i[e][r.fareHash])||void 0===n?void 0:n.ruleDataWhenSelectedAlone:null])),{selected:r.fareHash===t.selectedTicket.fare.fareHash,selectable:!!t._selectedSummary[e]&&!!(null===(s=null===(o=t._selectedSummary[e][t.selectedTicket.fare.fareHash])||void 0===o?void 0:o.allowedWith)||void 0===s?void 0:s.includes(r.fareHash))})}))}:function(r){return r.map((function(r){return r?Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),i?[i[e][r.fareHash].ruleDataWhenSelectedAlone]:[])),{selected:!1,selectable:!0}):null}))}},i=function(e,r,i){return function(a){var n=t._findSummary(r,t.summary[i]);return a.map((function(r){return r?t.helpers.addRailActionRules(Object.assign(Object.assign({},r),{selected:t.selectedTicket&&r.fareHash===t.selectedTicket.fare.fareHash}),n?[n[e][r.fareHash].ruleDataWhenSelectedAlone]:[]):null}))}};this.results.next(this.helpers.clone(this.fullResults).reduce((function(a,n){var o=Object.assign(Object.assign({},n),{outbound:(n.outbound||[]).map((function(r){return Object.assign(Object.assign({},r),{dualSingleJourneyFares:t.helpers.map(r.dualSingleJourneyFares||{},i("dualSingleJourneyFares",r,e.RailDirection.Outbound)),singleJourneyFares:t.helpers.map(r.singleJourneyFares||{},i("singleJourneyFares",r,e.RailDirection.Outbound)),returnJourneyFares:t.helpers.map(r.returnJourneyFares||{},i("returnJourneyFares",r,e.RailDirection.Outbound)),openReturnJourneyFares:t.helpers.map(r.openReturnJourneyFares||{},i("openReturnJourneyFares",r,e.RailDirection.Outbound)),splitFares:t.helpers.map(r.splitFares||{},i("splitFares",r,e.RailDirection.Outbound))})})),return:(n.return||[]).map((function(e){return Object.assign(Object.assign({},e),{returnJourneyFares:t.helpers.map(e.returnJourneyFares||{},r("returnJourneyFares",e)),dualSingleJourneyFares:t.helpers.map(e.dualSingleJourneyFares||{},r("dualSingleJourneyFares",e)),singleJourneyFares:t.helpers.map(e.singleJourneyFares||{},i("singleJourneyFares",e,"return")),openReturnJourneyFares:t.helpers.map(e.openReturnJourneyFares||{},i("openReturnJourneyFares",e,"return")),splitFares:t.helpers.map(e.splitFares||{},r("splitFares",e))})}))});return a.push(o),a}),[]))},a.prototype.getTermsAndCond=function(e,t,r){return[{name:"Ticket Type Class",value:e.terms.ticketTypeClass},{name:"Ticket Type Conditions Description",value:e.terms.ticketTypeConditionsDescription},{name:"Valid Return Rule",value:e.terms.validReturnRule},{name:"Ticket Type Name",value:e.terms.ticketTypeName},{name:"Change Rule",value:e.terms.changeRule},{name:"Pre Booking Requirement",value:e.terms.preBookingRequirement},{name:"Railcard Discount",value:e.terms.railcardDiscount},{name:"Ticket Type Code",value:e.terms.ticketTypeCode},{name:"Child Discount",value:e.terms.childDiscount},{name:"Valid Out Rule",value:e.terms.validOutRule},{name:"Start Date",value:t.departDateTime},{name:"End Date",value:t.arriveDateTime},{name:"Journey Break Rule",value:e.terms.journeyBreakRule},{name:"Refund Cancellation Rule",value:e.terms.refundCancellationRule},{name:"Journey Type",value:e.terms.journeyType},{name:"Tod Available",value:e.terms.todAvailable},{name:"Return Start Date",value:null==r?void 0:r.departDateTime},{name:"Return End Date",value:null==r?void 0:r.arriveDateTime}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(this.tempParams),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.Rail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){switch(this.noOfAdults=e.adults,this.noOfChildren=e.children,this.chosenSearchType=e.journeyType,e.class){case"First":this.chosenRailClass=ee.First;break;case"Any":this.chosenRailClass=ee.All;break;case"Standard":this.chosenRailClass=ee.Standard}return this.getRailStationFetcher.fetchList({id:e.departureLocationId}).subscribe((function(e){t.travellingFrom=e})),this.getRailStationFetcher.fetchList({id:e.arrivalLocationId}).subscribe((function(e){t.travellingTo=e})),e.viaLocationId?(this.getRailStationFetcher.fetchList({id:e.viaLocationId}).subscribe((function(e){t.viaLocation=e})),this.via=!0):(this.viaLocation=null,this.via=!1),[2]}))}))},a.prototype.updateAvaliableClasses=function(){var e=this.userService.getUserFavoriteObject(dt.HideRailClasses)||{any:!1,standard:!1,first:!1},t=[];e.any||t.push({display:"Any",value:ee.All}),e.standard||t.push({display:"Standard",value:ee.Standard}),e.first||t.push({display:"First",value:ee.First}),this.chosenSearchClass=this.getUpdatedCabinClass(this.chosenRailClass,e,t),this.classTypes.next(t)},a.prototype.getUpdatedCabinClass=function(e,t,r){switch(e){case ee.All:return t.any?r[0].value:e;case ee.Standard:return t.standard?r[0].value:e;case ee.First:return t.first?r[0].value:e}},a.prototype.generateQueryFromFlightQuery=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){switch(r.label){case 0:return this.outbound_date=this.helpers.momentToNgDate(l.default(e.outboundDate)),this.return_date=this.helpers.momentToNgDate(l.default(e.returnDate)),[4,this.searchService.getStationLocations(this.getRailLocation(e.destinationAirport)).toPromise().then((function(e){console.log(e),t.travellingTo=e[0]}))];case 1:return r.sent(),[4,this.searchService.getStationLocations(this.getRailLocation(e.originAirport)).toPromise().then((function(e){console.log(e),t.travellingFrom=e[0]}))];case 2:return r.sent(),e.returnTrip?this.chosenSearchType=te.ReturnJourney:this.chosenSearchType=te.SingleJourney,[2]}}))}))},a.prototype.getRailLocation=function(e){return vt[e]||""},a}(c);Ut.STORAGE_SESSION_PARAMS="search_rail",Ut.STORAGE_SESSION_RESULTS="rail_results",Ut.PASSING_POINT="Passing",(jt=e.ages||(e.ages={})).Child="Child",jt.Youth="Youth",jt.Adult="Adult",jt.Senior="Senior";var Ht,xt,Gt=function(){function e(){}return e.hasItem=function(e){return!!e},e.fullname=function(e){return[e.title,e.forename,e.surname].filter(this.hasItem).join(" ")},e.makeTravellerObjectFromUserData=function(e){return{id:e.user_id.toString(),forename:e.forename,surname:e.surname,email:e.username,title:e.title,isChild:!1,isInfant:!1,childDOB:null,guest:!1,name:e.surname+" "+e.forename,dob:e.dob}},e.makeTravellerObjectFromUser=function(e){return{id:e.id.toString(),forename:e.forename,surname:e.surname,email:e.email,username:e.username,title:e.title,isChild:!1,isInfant:!1,childDOB:null,guest:!1,name:e.surname+" "+e.forename,dob:e.dob}},e.equals=function(e,t){return e.id===t.id||e.forename+e.surname===t.forename+t.surname},e.compare=function(t,r){var i=e.fullname(t),a=e.fullname(r);return i===a?0:i<a?-1:1},e}();(Ht=e.SortTypesIrl||(e.SortTypesIrl={})).CheapestFirst="C",Ht.EarliestFirst="E",Ht.LatestFirst="L",Ht.ExpensiveFirst="M",(xt=e.ClassType||(e.ClassType={})).Class_1="1",xt.Class_2="2",xt.Second_Class="2nd Class",xt.First_Class="1st Class";var Vt=function(t){function i(r,a,n,o,s,u,c,d){var h=t.call(this,s,n,u,d)||this;h.Irlfetcher=r,h.irlDiscountCardsFetcher=a,h.basketService=o,h.getIrlSupplierStationFetcher=c,h.resultsSessionName=i.STORAGE_SESSION_RESULTS,h.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,h._sortArray=[{title:"Price",methodRef:e.SortMethod.sortByPrice,icon:"ico-dollar"},{title:"Price (Highest)",methodRef:e.SortMethod.sortByHighestPrice,icon:"ico-calendar"},{title:"Time",methodRef:e.SortMethod.sortByDate,icon:"ico-calendar"}],h.searchTypes=[{display:"Return",value:V.ReturnJourney},{display:"One-Way",value:V.SingleJourney}],h.classTypes=[{display:"Any",value:G.All},{display:"Standard",value:G.Standard},{display:"First",value:G.First}],h.ageRanges=[{key:e.ages.Child,value:"Child (0-3)"},{key:e.ages.Child,value:"Child (4-5)"},{key:e.ages.Child,value:"Child (6-11)"},{key:e.ages.Youth,value:"Youth (12-14)"},{key:e.ages.Youth,value:"Youth (15-25)"},{key:e.ages.Adult,value:"Adult (26-59)"},{key:e.ages.Youth,value:"Senior (60+)"}],h.travelCards=[{display:"Young persons railcard",value:"YNG"},{display:"Disability railcard",value:"DIS"},{display:"Family railcard",value:"FAM"},{display:"Forces railcard",value:"HMF"},{display:"Travel agency discount",value:"TAD"}],h.type=ne.InternationalRail,h.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},h.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},h._supplier=null,h._countryCode=null,h._class=G.All,h._outboundDepartureDateTime=null,h._departureLocationId=null,h._arrivalLocationId=null,h._children=0,h._cheapestStandard=null,h._cheapestFirst=null,h._returnDepartureDateTime=null,h._ageRange=null,h._priceDir=!0,h._dateDir=!0,h._discountCard=[],h._irlDiscountCardsArray=[],h._outbound_date=null,h._outbound_time=null,h._return_date=null,h._return_time=null,h._irlClass=G.All,h._journeytype=V.SingleJourney,h._trainNumber=null,h._additionalInstructions=null;var p=s.getSessionItem(i.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};h.updateTempParams(h.searchService.makeIrlQuery(p.tempParams)),h._originalUserSearch=p.originalUserSearch,u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(t){h.travellers=t,h.travellers[0]&&!h.travellers[0].ageType&&(h.travellers[0].ageType=e.ages.Adult);var r=h.helpers.selectedTravellers(t,ne.InternationalRail);h.tempParams.adults=r.adults.length,h.tempParams.children=r.children.length,h.travellers=t,h._isValid()})),h._isValid();var m=s.getSessionItemAsList(h.resultsSessionName)||[];return h._cheapestResultPrice=h.updateLowestPrice(m),h.fullResults=m,h.results.next(m||[]),h}return m(i,t),Object.defineProperty(i.prototype,"outboundJourneyOptions",{get:function(){return this._outboundJourneyOptions},set:function(e){this._outboundJourneyOptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outboundTicket",{get:function(){return this._outboundTicket},set:function(e){this._outboundTicket=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfAdults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfChildren",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"travellingTo",{get:function(){return this.tempParams.travellingTo},set:function(e){var t;this.tempParams.travellingTo=e,this._travellingTo="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?this._travellingTo=e.railstation.id:(null==e?void 0:e.id)&&(this._travellingTo=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"travellingFrom",{get:function(){return this.tempParams.travellingFrom},set:function(e){var t,r=this;this.tempParams.travellingFrom=e,this._travellingFrom="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)?(this._travellingFrom=e.railstation.id,this.supplier=e.railstation.supplier,this.getIrlDiscountCards().subscribe((function(e){r.irlDiscountCardsArray=e}))):(null==e?void 0:e.id)&&(this._travellingFrom=e.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplier",{get:function(){return this._supplier},set:function(e){this._supplier=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"countryCode",{get:function(){return this._countryCode},set:function(e){this._countryCode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"class",{get:function(){return this._class},set:function(e){this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outboundDepartureDateTime",{get:function(){return this._outboundDepartureDateTime},set:function(e){this.tempParams.outboundDepartureDateTime=e,e&&e.isValid()&&(this._outboundDepartureDateTime=e,this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"departureLocationId",{get:function(){return this._departureLocationId},set:function(e){this.travellingFrom=e,this._departureLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalLocationId",{get:function(){return this._arrivalLocationId},set:function(e){this.travellingTo=e,this._arrivalLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this._children},set:function(e){this._children=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestStandard",{get:function(){return this._cheapestStandard},set:function(e){this._cheapestStandard=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestFirst",{get:function(){return this._cheapestFirst},set:function(e){this._cheapestFirst=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestFirstReturn",{get:function(){return this._cheapestFirstReturn},set:function(e){this._cheapestFirstReturn=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cheapestStandardReturn",{get:function(){return this._cheapestStandardReturn},set:function(e){this._cheapestStandardReturn=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnDepartureDateTime",{get:function(){return this._returnDepartureDateTime},set:function(e){this.tempParams.returnDepartureDateTime=e,e&&e.isValid()&&(this._returnDepartureDateTime=e,this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ageRange",{get:function(){return this._ageRange},set:function(e){this._ageRange=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"priceDir",{get:function(){return this._priceDir},set:function(e){this._priceDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dateDir",{get:function(){return this._dateDir},set:function(e){this._dateDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchClass",{get:function(){return this.tempParams.class},set:function(e){this.tempParams.class=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"discountCard",{get:function(){return this._discountCard},set:function(e){this._discountCard=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"discountCardsList",{get:function(){var e;return(null===(e=this._discountCard)||void 0===e?void 0:e.length)?this._discountCard.map((function(e){return e.id})).join(","):null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"irlDiscountCardsArray",{get:function(){return this._irlDiscountCardsArray},set:function(e){this._irlDiscountCardsArray=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outBoundDateTime",{get:function(){return this.tempParams.outboundDepartureDateTime},set:function(e){this.tempParams.outboundDepartureDateTime=l.default(e),this.minInboundDate={year:e.year(),month:e.month()+1,day:e.date()},e&&e.isValid()&&(this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this.outBoundDateTime&&this.inBoundDateTime&&this.outBoundDateTime.isAfter(this.inBoundDateTime)&&(this.inBoundDateTime=this.outBoundDateTime.clone().add(1,"day")),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"inBoundDateTime",{get:function(){return this.tempParams.returnDepartureDateTime},set:function(e){this.tempParams.returnDepartureDateTime=e,e&&e.isValid()&&(this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outbound_date",{get:function(){return this._outbound_date},set:function(e){this._outbound_date=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outbound_time",{get:function(){return this._outbound_time},set:function(e){this._outbound_time=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"return_date",{get:function(){return this._return_date},set:function(e){this._return_date=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"return_time",{get:function(){return this._return_time},set:function(e){this._return_time=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(48).fill(0).map((function(e,t){return{value:Math.floor(t/2).toString().padStart(2,"0")+(t%2*30).toString().padStart(2,"0"),display:Math.floor(t/2).toString().padStart(2,"0")+":"+(t%2*30).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"offlineRequest",{get:function(){return this.tempParams.offlineRequest},set:function(e){this.tempParams.offlineRequest=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"irlClass",{get:function(){return this._irlClass},set:function(e){this._irlClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"journeyType",{get:function(){return this._journeytype},set:function(e){this._journeytype=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"trainNumber",{get:function(){return this._trainNumber},set:function(e){this._trainNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"additionalInstructions",{get:function(){return this._additionalInstructions},set:function(e){this._additionalInstructions=e},enumerable:!1,configurable:!0}),i.prototype.processResults=function(e){var t;return null===(t=e[0])||void 0===t||t.outbound.forEach((function(e){e.providers[0].ticketOptions.map((function(e,t){return e.selected=!1,e.ShowDetail=!1,e.uid=e.identifiers.journeyIdentifier+"_"+(t+1),e}))})),Object.freeze(e),e},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeIrlQuery()),this.resetIrlForm(),this._isValid()},i.prototype.resetIrlForm=function(){var e=this.helpers.momentRoundMinutes(l.default(),30);this.additionalInstructions="",this.trainNumber="",this.travellingTo="",this.travellingFrom="",this.discountCard=[],this.class=G.All,this.outboundDepartureDateTime=e,this.journeyType=V.SingleJourney,this.offlineRequest=!1},i.prototype._isValid=function(){var e,t;this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var r=l.default();if(this._travellingFrom||this.validationMessages.push("Please Enter a From Location."),this._travellingTo||this.validationMessages.push("Please Enter a To Location."),(null===(e=this.outBoundDateTime)||void 0===e?void 0:e.isBefore(r))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),(null===(t=this.travellers)||void 0===t?void 0:t.length)&&this.tempParams.adults+this.tempParams.children<1){var a=this.helpers.selectedTravellers(this.travellers,ne.InternationalRail);this.tempParams.adults=a.adults.length,this.tempParams.children=a.children.length}this.tempParams.adults+this.tempParams.children<1&&this.validationMessages.push("There must be at least 1 traveller"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)},i.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery();return this._originalUserSearch=Object.freeze(Object.assign({},this.tempParams)),this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.Irlfetcher.fetchList(e).pipe(r.map((function(e){return e}))))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ne.InternationalRail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(e){var t=e;return this.travellingFrom&&(t.travellingFrom=this.travellingFrom),this.travellingTo&&(t.travellingTo=this.travellingTo),t},i.prototype.startRecentSearch=function(e){this.journeyType=e.searchArgs.journeyType,this.irlClass=e.searchArgs.class,this.travellingTo=e.searchArgs.travellingTo,this.travellingFrom=e.searchArgs.travellingFrom,this.outBoundDateTime=l.default(e.searchArgs.outboundDepartureDateTime),e.searchArgs.journeyType===V.ReturnJourney&&(this.inBoundDateTime=l.default(e.searchArgs.returnDepartureDateTime)),this.searchService.startSearches()},i.prototype._updateOutboundDateTime=function(){if(this._outbound_date&&this._outbound_time){var e=this.helpers.ngDateToMoment(this._outbound_date,this._outbound_time);this.outBoundDateTime=e.isValid()?e:null,this._isValid()}},i.prototype._updateReturnDateTime=function(){if(this._return_date&&this._return_time){var e=this.helpers.ngDateToMoment(this._return_date,this._return_time);this.inBoundDateTime=e.isValid()?e:null,this._isValid()}},i.prototype.getSearchQuery=function(){var t=this;this.travellers?(this.noOfAdults=this.travellers.filter((function(t){return t.ageType===e.ages.Adult||t.ageType===e.ages.Youth||t.ageType===e.ages.Senior})).length,this.noOfChildren=this.travellers.filter((function(t){return t.ageType===e.ages.Child})).length):(this.noOfAdults=this.adults,this.noOfChildren=this.children),!this.supplier&&this.travellingFrom.name&&(this.supplier=this.travellingFrom.railstation.supplier,this.getIrlDiscountCards().subscribe((function(e){t.irlDiscountCardsArray=e})));var r={supplier:this.supplier,countryCode:"GB",irlDiscountCards:this.discountCardsList,class:this.class,outboundDepartureDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.outboundDepartureDateTime),departureLocationId:this._travellingFrom,arrivalLocationId:this._travellingTo,adults:this.tempParams.adults,children:this.tempParams.children,returnDepartureDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.returnDepartureDateTime),journeyType:this.journeyType,offlineRequest:this.tempParams.offlineRequest};switch(0===this.tempParams.children&&(r.children=null),this.tempParams.journeyType){case V.SingleJourney:r.returnDepartureDateTime=null}return this.helpers.removeNulls(r)},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.journeyType=r.journeyType,this.irlClass=r.class,this.outBoundDateTime=l.default(r.outboundDepartureDateTime),r.journeyType===V.ReturnJourney&&(this.inBoundDateTime=l.default(r.returnDepartureDateTime)),r.departureLocationId&&this.searchService.getRailStationById(r.departureLocationId).subscribe((function(e){t.travellingFrom={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),r.arrivalLocationId&&this.searchService.getRailStationById(r.arrivalLocationId).subscribe((function(e){t.travellingTo={name:e.name,railstation:{id:e.id,name:e.name,nlcCode:e.nlcCode,stationCode:e.stationCode,trainlineCode:e.trainlineCode,trainlineUniqueCode:e.trainlineUniqueCode}}})),e.users&&e.users.forEach((function(e){t.searchService.addTraveller(e)}))},i.prototype.updateFromPreviousSearches=function(e){if(console.log(e),e.FLIGHT)try{this.outBoundDateTime=l.default(e.FLIGHT.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDateTime.minutes()%30&&(this.outBoundDateTime=this.outBoundDateTime.subtract(this.outBoundDateTime.minutes()%30,"minutes")),e.FLIGHT.inboundDate&&(this.inBoundDateTime=l.default(e.FLIGHT.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inBoundDateTime.minutes()%30&&(this.inBoundDateTime=this.inBoundDateTime.subtract(this.inBoundDateTime.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate international rail from flight item")}else if(e.RAIL)try{this.outBoundDateTime=l.default(e.RAIL.outboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.outBoundDateTime.minutes()%30&&(this.outBoundDateTime=this.outBoundDateTime.subtract(this.outBoundDateTime.minutes()%30,"minutes")),e.RAIL.inboundDate&&(this.inBoundDateTime=l.default(e.RAIL.inboundDate.replace("T","").split(".")[0],"YYYY-MM-DDhh:mm:ss"),this.inBoundDateTime.minutes()%30&&(this.inBoundDateTime=this.inBoundDateTime.subtract(this.inBoundDateTime.minutes()%30,"minutes")))}catch(e){console.error("Error trying to prepopulate international rail from rail item")}},i.prototype.updateCanCombine=function(e){var t=this;(e.identifiers.allowedWith||[]).forEach((function(r){t._canCombine[e.type][r.journeyIdentifier]?t._canCombine[e.type][r.journeyIdentifier].push(r.fareIdentifier):t._canCombine[e.type][r.journeyIdentifier]=[r.fareIdentifier]}))},i.prototype.getLegsFromIrlJourneyOption=function(e){var t=[];return(null==e?void 0:e.segments.length)&&(t=e.segments.map((function(t){return{operator:t.operator||e.providers[0].providerId,departureDateTime:t.departDateTime,departureStationName:t.depart,arrivalDateTime:t.arriveDateTime,arrivalStationName:t.arrive}}))),t},i.prototype.getSelectedIrlTicketOption=function(e,t,r){return e.providers[r].ticketOptions.find((function(e){return e.type===t.type&&(e.price===t.price||e.identifiers.fareIdentifier===t.identifiers.fareIdentifier)}))},i.prototype.addSingleJourneyToBasket=function(t,r,i,a){return y(this,void 0,void 0,(function(){var n,o,s,l,u,c,d,h;return b(this,(function(p){switch(p.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return n=p.sent(),(o=null==n?void 0:n.subject.value)?(s=this.getSelectedIrlTicketOption(a,i,0),l=this.getLegsFromIrlJourneyOption(a),u=this.getTermsAndCond(a),c=this.findCheapestTotal(this.fullResults),d={basket:o.id,service:t,detail:{outwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,arrivalStationCode:a.toCode,departureDateTime:a.departDateTime,departureStationName:a.from,departureStationCode:a.fromCode,supplierTickets:[{supplierName:a.providers[0].name,ticketDescription:s.type,price:s.price,legs:l}]},transactionIdentifier:a.identifiers.transactionIdentifier,signature:a.identifiers.signature?a.identifiers.signature:"",outbound:{fareInfo:s.fareInfo,fareIdentifiers:[s.identifiers.fareIdentifier],journeyIdentifier:s.identifiers.journeyIdentifier},supplier:a.providers[0].providerId,termsAndCond:u,railcardsDetail:r.irlDiscountCards?r.irlDiscountCards.split(","):[]},adults:r.adults,price:s.price,currency:s.currency,searchQuery:r,outboundDate:a.departDateTime,lowestPrice:c.amount!=s.price?c.amount:null,lowestPriceCurrency:c.amount!=s.price?c.currencyCode:null},[4,this.basketService.addToBasket(d,n,this.searchService,this.travellers,!1)]):[3,3];case 2:return(h=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.addReturnJourneyToBasket=function(t,r,i,a,n,o){return y(this,void 0,void 0,(function(){var s,l,u,c,d,h,p,m,f,v,y,g,S;return b(this,(function(b){switch(b.label){case 0:return s=n||this.outboundTicket,l=o||this.outboundJourneyOptions,[4,this.basketService.getDefaultBasket()];case 1:return u=b.sent(),(c=null==u?void 0:u.subject.value)?(d=this.getSelectedIrlTicketOption(l,s,0),h=this.getSelectedIrlTicketOption(a,i,0),p=this.getLegsFromIrlJourneyOption(l),m=this.getLegsFromIrlJourneyOption(a),f=this.getTermsAndCond(l),v=this.findCheapestTotal(this.fullResults),y=Number((Number(d.price)+Number(i.price)).toFixed(2)),g={basket:c.id,service:t,detail:{outwardDetail:{arrivalDateTime:l.arriveDateTime,arrivalStationName:l.to,arrivalStationCode:l.toCode,departureStationCode:l.fromCode,departureDateTime:l.departDateTime,departureStationName:l.from,supplierTickets:[{supplierName:l.providers[0].name,ticketDescription:d.type,price:d.price,legs:p}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,arrivalStationCode:a.toCode,departureStationCode:a.fromCode,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:a.providers[0].name,ticketDescription:i.type,legs:m}]},signature:s.identifiers.signature?s.identifiers.signature:"",transactionIdentifier:s.identifiers.transactionIdentifier,outbound:{fareInfo:d.fareInfo,fareIdentifiers:[d.identifiers.fareIdentifier],journeyIdentifier:d.identifiers.journeyIdentifier},return:{fareInfo:h.fareInfo,fareIdentifiers:[h.identifiers.fareIdentifier],journeyIdentifier:h.identifiers.journeyIdentifier},supplier:l.providers[0].providerId,termsAndCond:f,railcardsDetail:r.irlDiscountCards?r.irlDiscountCards.split(","):[]},adults:r.adults,price:y,currency:d.currency,searchQuery:r,outboundDate:l.departDateTime,lowestPrice:v.amount!=y?v.amount:null,lowestPriceCurrency:v.amount!=y?v.currencyCode:null},this.filterSelected(),[4,this.basketService.addToBasket(g,u,this.searchService,this.travellers,!1)]):[3,3];case 2:return(S=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,S];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.updateLowestPrice=function(e){var t,r,i,a;if(!e.length)return null;var n=null===(a=null===(i=null===(r=null===(t=e[0])||void 0===t?void 0:t.outbound[0])||void 0===r?void 0:r.providers[0])||void 0===i?void 0:i.cheapestTicket)||void 0===a?void 0:a.currency;return{amount:this.findCheapestTicket(e),currencyCode:n}},i.prototype.findCheapestTotal=function(e){var t,r,i,a,n,o=this;this.cheapestFirst=null,this.cheapestStandard=null,this.cheapestFirstReturn=null,this.cheapestStandardReturn=null;var s=this.findCheapestTicket(e),l=[];return e.map((function(e){e.return.map((function(e){e.providers.map((function(e){var t=e.cheapestTicket.price;e.ticketOptions.map((function(e){var r,i,a=e.price,n=e.class;"1"===n&&((null===(r=o.cheapestFirstReturn)||void 0===r?void 0:r.price)>a||!o.cheapestFirstReturn)?o.cheapestFirstReturn=e:"2"===n&&((null===(i=o.cheapestStandardReturn)||void 0===i?void 0:i.price)>a||!o.cheapestStandardReturn)&&(o.cheapestStandardReturn=e),a===t&&l.push(t)}))}))}))})),{amount:s+((null===(t=this.cheapestFirstReturn)||void 0===t?void 0:t.price)&&(null===(r=this.cheapestStandardReturn)||void 0===r?void 0:r.price)?Math.min(this.cheapestFirstReturn.price,this.cheapestStandardReturn.price):(null===(i=this.cheapestFirstReturn)||void 0===i?void 0:i.price)?null===(a=this.cheapestFirstReturn)||void 0===a?void 0:a.price:(null===(n=this.cheapestStandardReturn)||void 0===n?void 0:n.price)||0),currencyCode:e[0].outbound[0].providers[0].ticketOptions[0].currency}},i.prototype.findCheapestTicket=function(e){var t=this;if(!e.length)return null;var r=[];return e.map((function(e){e.outbound.map((function(e){e.providers.map((function(e){var i=e.cheapestTicket.price;e.ticketOptions.map((function(e){var a,n,o=e.price,s=e.class;"1"===s&&((null===(a=t.cheapestFirst)||void 0===a?void 0:a.price)>o||!t.cheapestFirst)?t.cheapestFirst=e:"2"===s&&((null===(n=t.cheapestStandard)||void 0===n?void 0:n.price)>o||!t.cheapestStandard)&&(t.cheapestStandard=e),o===i&&r.push(i)}))}))}))})),Math.min(this.cheapestFirst.price,this.cheapestStandard.price)},i.prototype.sortByPrice=function(e){var t=this;void 0===e&&(e=!1),e||(this.priceDir=!this.priceDir);var r=this.filterSelected(this._isFiltered),i=function(e,r){var i,a;return e.providers.forEach((function(e){e.ticketOptions.forEach((function(e){(!i||e.price<i)&&(i=e.price)}))})),r.providers.forEach((function(e){e.ticketOptions.forEach((function(e){(!a||e.price<i)&&(a=e.price)}))})),t.priceDir?i-a:a-i};try{r[0].outbound=r[0].outbound.sort(i),r[0].return=r[0].return.sort(i)}catch(e){console.error("+++ Error sorting by price: "+e+" - returning original results +++")}this.results.next(r)},i.prototype.sortByHighestPrice=function(e){var t=this;void 0===e&&(e=!1),e||(this.priceDir=!this.priceDir);var r=this.filterSelected(this._isFiltered),i=function(e,r){return t.priceDir?r.providers[0].cheapestTicket.price-e.providers[0].cheapestTicket.price:e.providers[0].cheapestTicket.price-r.providers[0].cheapestTicket.price};r[0].outbound=r[0].outbound.sort(i),r[0].return=r[0].return.sort(i),this.results.next(r)},i.prototype.sortByDate=function(e){var t=this;void 0===e&&(e=!1),e||(this.dateDir=!this.dateDir);var r=this.filterSelected(this._isFiltered),i=function(e,r){return t.dateDir?l.default(e.departDateTime).unix()-l.default(r.departDateTime).unix():l.default(r.departDateTime).unix()-l.default(e.departDateTime).unix()};r[0].outbound=r[0].outbound.sort(i),r[0].return=r[0].return.sort(i),this.results.next(r)},i.prototype.addOutboundAndFilter=function(e,t){this.outboundJourneyOptions=t,this.outboundTicket=e,this.filterSelected(!0)},i.prototype.filterSelected=function(e){var t=this;void 0===e&&(e=!1);var r=this.helpers.clone(this.fullResults);try{e?(this._isFiltered=!0,r[0].outbound=[r[0].outbound.find((function(e){return e.departDateTime===t._outboundJourneyOptions.departDateTime&&e.arriveDateTime===t._outboundJourneyOptions.arriveDateTime}))],r[0].outbound[0].providers[0].ticketOptions=r[0].outbound[0].providers[0].ticketOptions.reduce((function(e,r){return r.uid===t._outboundTicket.uid&&(r.selected=!0,e.push(r)),e}),[])):(this._isFiltered=!1,this.outboundJourneyOptions=null,this.outboundTicket=null,r[0].outbound.forEach((function(e){e.providers[0].ticketOptions.map((function(e){return e.selected=!1,e.ShowDetail=!1,e}))})))}catch(e){console.error("+++ Error filtering results: "+e+" - returning original results +++")}return this.results.next(r),r},i.prototype.getIrlDiscountCards=function(){var e=this.supplier;return this.irlDiscountCardsFetcher.fetchList({supplier:e})},i.prototype.getTermsAndCond=function(e){var t,r;return[{name:"Fare Rules",value:null===(r=null===(t=null==e?void 0:e.providers[0])||void 0===t?void 0:t.ticketOptions[0])||void 0===r?void 0:r.fareRules}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ne.InternationalRail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.generateFilters=function(t){if(null==t?void 0:t.length){var r=null,i=null,a=null,n=null,o=null,s=null,u={},c={};t.forEach((function(t){t.providers[0].ticketOptions.forEach((function(e){(!r||r<e.price)&&(r=Math.ceil(e.price)),(!i||e.price<i)&&(i=Math.floor(e.price))})),a&&!l.default(t.departDateTime).isBefore(l.default(a))||(a=Number(l.default(t.departDateTime).format("HHmm"))),n&&!l.default(t.departDateTime).isAfter(l.default(n))||(n=Number(l.default(t.departDateTime).format("HHmm"))),o&&!l.default(t.arriveDateTime).isBefore(l.default(o))||(o=Number(l.default(t.arriveDateTime).format("HHmm"))),s&&!l.default(t.arriveDateTime).isAfter(l.default(s))||(s=Number(l.default(t.arriveDateTime).format("HHmm"))),c[t.segments.length-1]={key:t.segments.length-1,title:t.segments.length-1+" changes",selected:!1},t.providers[0].ticketOptions.forEach((function(t){"1"===t.class?u.First={key:e.ClassType.Class_1,title:"First",selected:!1}:"2"===t.class&&(u.Second={key:e.ClassType.Class_2,title:"Second",selected:!1})}))}));var d={priceMax:r,priceMin:i,dateArrMax:s,dateArrMin:o,dateDepMax:n,dateDepMin:a,classes:Object.values(u),changes:Object.values(c)};return console.log(d),d}},i.prototype.applyFilters=function(e,t){void 0===t&&(t="O");var r,i=this.helpers.clone(this.fullResults);switch(t){case"O":r=i[0].outbound;break;case"I":r=i[0].return}r=(r=(r=r.filter((function(t){var r=t.providers[0].ticketOptions.filter((function(t){return t.price>=e.priceMin&&t.price<=e.priceMax}));return t.providers[0].ticketOptions=r,r.length}))).filter((function(t){var r=Number(l.default(t.departDateTime).format("HHmm"));return r>=e.dateDepMin&&r<=e.dateDepMax}))).filter((function(t){var r=Number(l.default(t.arriveDateTime).format("HHmm"));return r>=e.dateArrMin&&r<=e.dateArrMax}));var a=e.classes.filter((function(e){return e.selected}));(null==a?void 0:a.length)&&(r=r.filter((function(e){var t=[];return console.log("og tickets:",e.providers[0].ticketOptions),e.providers[0].ticketOptions.forEach((function(e){a.forEach((function(r){e.class===r.key&&t.push(e)}))})),console.log(t),e.providers[0].ticketOptions=t,t.length>0}))),console.log(r);var n=e.changes.filter((function(e){return e.selected}));switch(n.length&&(r=r.filter((function(e){for(var t=0;t<n.length;t++)if(e.segments.length-1===n[t].key)return e}))),t){case"O":i[0].outbound=r;break;case"I":i[0].return=r}this.results.next(i)},i.prototype.applyFavourite=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return this.getIrlSupplierStationFetcher.fetchList({id:e.departureLocationId}).subscribe((function(e){t.travellingFrom=e})),this.getIrlSupplierStationFetcher.fetchList({id:e.arrivalLocationId}).subscribe((function(e){t.travellingTo=e})),this.adults=e.adults,this.children=e.children,this.class=e.class,this.countryCode=e.countryCode,this.journeyType="ReturnJourney"===e.journeyType?V.ReturnJourney:V.SingleJourney,this.supplier=e.supplier,[2]}))}))},i}(c);Vt.STORAGE_SESSION_PARAMS="search_irl",Vt.STORAGE_SESSION_RESULTS="irl_results",Vt.PASSING_POINT="Passing";var Wt,Qt,Jt,Yt={type:"string"},Kt={type:"object",properties:{countryCode:Yt,areaCode:Yt,number:Yt,extension:Yt},required:["countryCode","areaCode","number","extension"]},qt={type:"object",properties:{numberOrName:Yt,street:Yt,town:Yt,county:Yt,postcode:Yt,countryCode:Yt},required:["numberOrName","street","town","county","postcode","countryCode"]},Xt=function(){function e(e){this.helpers=e,this.details={numberOrName:"",street:"",town:"",county:"",postcode:"",countryCode:"GB"},this.bookingAddress=new t.BehaviorSubject([])}return e.prototype.updateDetails=function(e){var t=this;this.bookingAddress.next(e.map((function(e){return t.helpers.sanatizeReturns(t.details,e)})))},e}(),Zt=function(){function e(e){this.helpers=e,this.details={countryCode:"",areaCode:"",number:"",extension:""},this.bookingPhoneNumber=new t.BehaviorSubject([])}return e.prototype.updateDetails=function(e){var t=this;this.bookingPhoneNumber.next(e.map((function(e){return t.helpers.sanatizeReturns(t.details,e)})))},e}(),zt=function(){function e(e,t,r,i,a,n){this.user=e,this.getUserFetcher=t,this.helpers=r,this.perPassengerPhoneNumber=i,this.perPassengerAddress=a,this.perPassengerSupplementaryBookingInfoSchema=n,this.userDetails=null,this.userInfo={id:e.id,address:null,phoneNumber:null,supplementaryInfo:null}}return Object.defineProperty(e.prototype,"id",{get:function(){return this.user.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAddress",{get:function(){return null===this.userInfo.address&&this.setUpUserInfo(),this.userInfo.address},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userPhoneNumber",{get:function(){var e;return null===(null===(e=this.userInfo)||void 0===e?void 0:e.phoneNumber)&&this.setUpUserInfo(),this.userInfo.phoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userSupplementaryInfo",{get:function(){return null===this.userInfo.supplementaryInfo&&this.setUpUserInfo(),this.userInfo.supplementaryInfo},enumerable:!1,configurable:!0}),e.prototype.setUpUserInfo=function(){var e=this;this.userInfo.address=new Xt(this.helpers),this.userInfo.phoneNumber=new Zt(this.helpers),this.userInfo.supplementaryInfo=this.perPassengerSupplementaryBookingInfoSchema,this.user.id&&"User"===this.user.__typename&&this.getUserFetcher.fetchOne({id:this.user.id}).pipe(r.take(1)).subscribe((function(t){t&&(e.userDetails=t,e.userInfo.address.updateDetails(null==t?void 0:t.addresses),e.userInfo.phoneNumber.updateDetails(null==t?void 0:t.phoneNumbers))}))},e}(),$t=function(){function t(t,r,i){var a=this;this.basketItem=t,this.helpers=r,this.hasDetails=!1,this.noCovertSelectSchemas=[e.SchemaFormat.railSeating,e.SchemaFormat.passport,e.SchemaFormat.selectQueue],this.basketItem.perPassengerSupplementaryBookingInfoSchema=t.perPassengerSupplementaryBookingInfoSchema?this.processSchema(this.basketItem.perPassengerSupplementaryBookingInfoSchema):null,this.userInfo=this.basketItem.users.map((function(e){return new zt(e,i,r,a.basketItem.perPassengerPhoneNumber,a.basketItem.perPassengerAddress,a.basketItem.perPassengerSupplementaryBookingInfoSchema)})),this.guestInfo=this.basketItem.guests.map((function(e){return new zt(e,i,r,a.basketItem.perPassengerPhoneNumber,a.basketItem.perPassengerAddress,a.basketItem.perPassengerSupplementaryBookingInfoSchema)})),this.address=new Xt(this.helpers),this.phoneNumber=new Zt(this.helpers),this.basketItem.perItemSupplementaryBookingInfoSchema=this.basketItem.perItemSupplementaryBookingInfoSchema?this.processSchema(this.basketItem.perItemSupplementaryBookingInfoSchema||{}):null}return Object.defineProperty(t.prototype,"perItemAddress",{get:function(){return!!this.basketItem.perItemAddress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perItemPhoneNumber",{get:function(){return!!this.basketItem.perItemPhoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perItemSupplementarySchema",{get:function(){return this.basketItem.perItemSupplementaryBookingInfoSchema},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perPassengerAddress",{get:function(){return!!this.basketItem.perPassengerAddress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perPassengerPhoneNumber",{get:function(){return!!this.basketItem.perPassengerPhoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perPassengerSupplementaryBookingInfoSchema",{get:function(){return this.basketItem.perPassengerSupplementaryBookingInfoSchema},enumerable:!1,configurable:!0}),t.prototype.processSchema=function(t){var r=this;return console.warn("processing: ",t),t=this.helpers.clone(t),this.hasDetails=this.perItemAddress||this.perItemPhoneNumber||this.perPassengerAddress||this.perPassengerPhoneNumber,Object.keys(t.properties||{}).forEach((function(i){console.log("here: ",i),r.hasDetails=!0;var a=t.properties[i];"object"===a.type&&(a.format=r.addRailFormat(i)||e.SchemaFormat.object,t.properties[i]=Object.assign(Object.assign({},r.processSchema(a)),{format:r.addRailFormat(i)||e.SchemaFormat.object})),a.format=a.format||r.schemaWidgetToFormat(a.widget)||r.schemaKeyToFormat(i)||r.schemaTypeToFormat(a.type),a.oneOf&&a.oneOf.length>0&&!r.noCovertSelectSchemas.includes(a.format)&&(a.format=e.SchemaFormat.select)})),console.log("+++ has Details: "+this.hasDetails+" +++"),t},t.prototype.schemaKeyToFormat=function(t){switch(t){case e.SchemaFormat.dob:return e.SchemaFormat.datetime}},t.prototype.schemaWidgetToFormat=function(t){switch(t){case e.Widgets.COUNTRY_CODE:return e.SchemaFormat.countryCode;default:return null}},t.prototype.addRailFormat=function(t){switch(t){case e.SchemaFormat.additionalSeatPreference:return e.SchemaFormat.additionalSeatPreference;case e.SchemaFormat.seatPrefGroups:return e.SchemaFormat.seatPrefGroups;case e.SchemaFormat.address:return e.SchemaFormat.address;default:return null}},t.prototype.schemaTypeToFormat=function(t){switch(t){case"string":return e.SchemaFormat.string;case"integer":return e.SchemaFormat.integer;case"object":return e.SchemaFormat.object;case"array":return e.SchemaFormat.array;case"boolean":return e.SchemaFormat.boolean;default:return e.SchemaFormat.string}},t.prototype.createSupplemtalBookingInformation=function(e){var t=this,r={basketItem:this.basketItem.id,userInfo:[],supplementaryInfo:{},paymentMethodDetails:{},guestInfo:[]};return void 0!==e.perItemAddress&&(r.address=this.helpers.toStrings(e.perItemAddress,qt)),void 0!==e.perItemPhoneNumber&&(r.phoneNumber=this.helpers.toStrings(e.perItemPhoneNumber,Kt)),void 0!==e.perItemSupplementarySchema&&(r.supplementaryInfo=this.helpers.toStrings(e.perItemSupplementarySchema,this.perItemSupplementarySchema)),r.userInfo=this.userInfo.map((function(r,i){var a,n,o={id:r.id,supplementaryInfo:{}},s=e["user_"+i]||{};return void 0!==s.perPassengerAddress&&(o.address=t.helpers.toStrings(s.perPassengerAddress,qt)),void 0!==s.perPassengerPhoneNumber&&(o.phoneNumber=t.helpers.toStrings(s.perPassengerPhoneNumber,Kt)),void 0!==s.perPassengerSupplementaryBookingInfoSchema&&(o.supplementaryInfo=t.helpers.toStrings(s.perPassengerSupplementaryBookingInfoSchema,t.perPassengerSupplementaryBookingInfoSchema)),o.supplementaryInfo.dob&&(o.supplementaryInfo.dob=t.helpers.ngDateToMoment(o.supplementaryInfo.dob).isValid()?t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.dob)):t.helpers.formatIsoDate(o.supplementaryInfo.dob)),o.supplementaryInfo.passport&&((null===(a=o.supplementaryInfo.passport.dateOfExpiry)||void 0===a?void 0:a.year)&&(o.supplementaryInfo.passport.dateOfExpiry=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfExpiry))),(null===(n=o.supplementaryInfo.passport.dateOfIssue)||void 0===n?void 0:n.year)&&(o.supplementaryInfo.passport.dateOfIssue=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfIssue))),o.supplementaryInfo.passport.documentId||o.supplementaryInfo.passport.number&&o.supplementaryInfo.passport.dateOfExpiry&&o.supplementaryInfo.passport.dateOfIssue&&o.supplementaryInfo.passport.codeOfIssuingState&&o.supplementaryInfo.passport.gender&&o.supplementaryInfo.passport.nationality||delete o.supplementaryInfo.passport),o})),r.guestInfo=this.guestInfo.map((function(r,i){var a,n,o={id:r.id,supplementaryInfo:{}},s=e["guest_"+i]||{};return void 0!==s.perPassengerAddress&&(o.address=t.helpers.toStrings(s.perPassengerAddress,qt)),void 0!==s.perPassengerPhoneNumber&&(o.phoneNumber=t.helpers.toStrings(s.perPassengerPhoneNumber,Kt)),void 0!==s.perPassengerSupplementaryBookingInfoSchema&&(o.supplementaryInfo=t.helpers.toStrings(s.perPassengerSupplementaryBookingInfoSchema,t.perPassengerSupplementaryBookingInfoSchema)),o.supplementaryInfo.passport&&((null===(a=o.supplementaryInfo.passport.dateOfExpiry)||void 0===a?void 0:a.year)&&(o.supplementaryInfo.passport.dateOfExpiry=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfExpiry))),(null===(n=o.supplementaryInfo.passport.dateOfIssue)||void 0===n?void 0:n.year)&&(o.supplementaryInfo.passport.dateOfIssue=t.helpers.formatIsoDate(t.helpers.ngDateToMoment(o.supplementaryInfo.passport.dateOfIssue))),o.supplementaryInfo.passport.documentId||o.supplementaryInfo.passport.number&&o.supplementaryInfo.passport.dateOfExpiry&&o.supplementaryInfo.passport.dateOfIssue&&o.supplementaryInfo.passport.codeOfIssuingState&&o.supplementaryInfo.passport.gender&&o.supplementaryInfo.passport.nationality||delete o.supplementaryInfo.passport),o})),r},t}();(Wt=e.IncludedType||(e.IncludedType={})).Leg="leg",Wt.Photo="photo",Wt.PhotoAttachment="photo_attachment",Wt.Upa="upa",(Qt=e.IrlDirection||(e.IrlDirection={})).Outbound="out",Qt.Inbound="in",(Jt=e.ErmCompanyType||(e.ErmCompanyType={})).Marine="Marine",Jt.OilAndGas="Oil & Gas",Jt.CruiseLine="Cruise Line",Jt.WindEnergy="Wind Energy";var er=function(e){function t(t,r,i){var a=e.call(this,r)||this;return a.query=t,a.helpers=i,a}return m(t,e),t.prototype.fetchOne=function(e){return this.processCall(this.query.fetch(this.helpers.removeNulls(e)))},t}(h),tr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.applyJITFlightRules},t}(er),rr=function(e){function t(t,r,i){var a=e.call(this,i)||this;return a.query=t,a.helpers=r,a}return m(t,e),t.prototype.fetchList=function(e){return this.processCall(this.query.fetch(this.helpers.removeNulls(e)))},t.prototype.fetchKeyedObject=function(e,t){var i=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?i.helpers.arrayToObject(t,e):null})))},t.prototype.fetchKeyedObjectArray=function(e,t){var i=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?i.helpers.arrayToObjectArray(t,[e]):null})))},t}(h),ir=function(e){function i(t,r,i){return e.call(this,t,r,i)||this}return m(i,e),i.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.applyJITHotelRules.result},i.prototype.processCall=function(e){var i=this;return e.pipe(r.take(1),r.map((function(e){return i.checkError(e.errors),i.getDataFromResult(e)})),r.catchError((function(e){return i.checkError(e),t.of({})})))},i}(rr),ar=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getUserBasket},t}(er),nr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchCabHire)||void 0===r?void 0:r.results},t}(rr),or=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.carHireAvailabilityDetailRequest},t}(rr),sr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchCarHire)||void 0===r?void 0:r.results},t}(rr),lr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getConfermaOfficeNames},t}(rr),ur=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getConfermaOffice},t}(er),cr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=e.data)||void 0===t?void 0:t.getConfermaQuicklist)||void 0===r?void 0:r.results},t}(rr),dr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r,i,a,n,o;return Object.assign(Object.assign({},null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchEurostar)||void 0===r?void 0:r.results),{ruleActionSummary:null===(a=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.searchEurostar)||void 0===a?void 0:a.ruleActionSummary,searchId:null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.searchEurostar)||void 0===o?void 0:o.searchId})},t}(rr),hr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getFlightFareRules},t}(rr),pr=function(e){function t(t,r,i,a){var n=e.call(this,t,r,i)||this;return n.environment=a,n}return m(t,e),t.prototype.fetchList=function(t){var r,i;return(null===(r=this.environment)||void 0===r?void 0:r.groupMax)>0&&(t.groupMax=null===(i=this.environment)||void 0===i?void 0:i.groupMax),e.prototype.fetchList.call(this,t)},t.prototype.getDataFromResult=function(e){var t,r,i,a,n,o;return Object.assign(Object.assign({},null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchFlightsV2)||void 0===r?void 0:r.results),{ruleActionSummary:null===(a=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.searchFlightsV2)||void 0===a?void 0:a.ruleActionSummary,searchId:null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.searchFlightsV2)||void 0===o?void 0:o.searchId})},t}(rr),mr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getCOVIDMicrositeToken},t}(rr),fr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRailcards},t}(rr),vr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRailLiveDepartures},t}(rr),yr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRailStation},t}(rr),br=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getIRLSupplierStation},t}(rr),gr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRiskAlerts},t}(rr),Sr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getUserCompanyOffices},t}(rr),Cr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserCurrentCarbonAllowance},t}(rr),Ar=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserRecentSearches},t}(rr),Tr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserBaskets},t}(rr),Dr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserMIAutoSuggestValues},t}(rr),Pr=function(e){function i(t,r,i){return e.call(this,t,r,i)||this}return m(i,e),i.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getMultipleHotelsAvailability.results},i.prototype.processCall=function(e){var i=this;return e.pipe(r.take(1),r.map((function(e){return i.checkError(e.errors),i.getDataFromResult(e)})),r.catchError((function(e){return i.checkError(e),t.of({})})))},i}(rr),Fr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchHotels)||void 0===r?void 0:r.results},t}(rr),kr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getIRLDiscountCards},t}(rr),_r=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchIRL)||void 0===r?void 0:r.results},t}(rr),Rr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchLounges)||void 0===r?void 0:r.results},t}(rr),Ir=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchParking)||void 0===r?void 0:r.results},t}(rr),Or=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchRail)||void 0===r?void 0:r.results},t}(rr),Er=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirlines},t}(er),Br=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirports},t}(er),Nr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchCities},t}(rr),Mr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchConfermaCities},t}(er),Lr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getCarHireDepots},t}(rr),wr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchHotelChains},t}(rr),jr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchIRLSupplierStations},t}(rr),Ur=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return[null===(t=e.data)||void 0===t?void 0:t.getPostcodeDetails]},t}(rr),Hr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchRailStations},t}(rr),xr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.searchUserCanBookFor},t}(rr),Gr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserAddresses},t}(rr),Vr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUser},t}(er),Wr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserMessages},t}(rr),Qr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserServices},t}(rr),Jr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getUserUIConfigs.all},t}(rr),Yr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getFlightSeatMap},t}(rr),Kr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserFavouriteSearches},t}(rr),qr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getConfermaRoomImages},t}(rr),Xr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getCompanies},t}(rr),Zr=function(e){function t(t,r,i){return e.call(this,t,i,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getCompany},t}(er),zr=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.emailBasket},t}(rr),$r=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchFastTrack)||void 0===r?void 0:r.results},t}(rr),ei=function(e){function t(t,r,i){return e.call(this,t,i,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.sendOfflineNotification},t}(er),ti=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getHotelChains},t}(rr),ri=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getRailProviders},t}(rr),ii=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getAllAirlines},t}(rr),ai=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getCarHireProviders},t}(rr),ni=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.generateBasketPDF},t}(rr),oi=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.getCancellationInfo},t}(er),si=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getUserGuests},t}(rr),li=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=e.data)||void 0===t?void 0:t.getOffice},t}(rr),ui=function(e){function t(t,r,i){return e.call(this,t,i,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserDefaultMIValue},t}(er),ci=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.emailFerryBookingReq},t}(rr),di=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getRedirectApprover},t}(rr),hi=function(e){function t(t,r,i){return e.call(this,t,r,i)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchCompanyApprovers},t}(rr),pi=function(){};pi.WHITE_CHARS=/[\r\n\t\s]/gm,pi.CAPS=/([A-Z])/g,pi.EMAIL_VALIDATOR=/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,pi.UK_POSTCODE=/^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))\s?[0-9][A-Za-z]{2})$/,pi.EMAIL_REGEX="^(([^<>()\\[\\]\\.,;:\\s@']+(\\.[^<>()\\[\\]\\.,;:\\s@']+)*)|('.+'))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}))$";var mi,fi=function(e){function t(t,r,i,a,n){void 0===n&&(n="Invalid username or password. Please try again");var o=e.call(this,n)||this;return o.reason=t,o.data=r,o.statusText=i,o.error=a,o.name="LoginError",o}return m(t,e),t}(Error);(mi=e.LoginErrorReason||(e.LoginErrorReason={}))[mi.PASSWORD_EXPIRED=0]="PASSWORD_EXPIRED",mi[mi.PASSWORD_CHANGE=1]="PASSWORD_CHANGE",mi[mi.LOGED_IN=2]="LOGED_IN",mi[mi.AUTH_ERROR=3]="AUTH_ERROR",mi[mi.SSO=4]="SSO";var vi,yi=function(){function e(e,t,r){this.username=e,this.password=t,this.overwrite="",r&&(this.overwrite="1")}return e.prototype.getAgent=function(){return"Agent="+encodeURIComponent(this.username.toLowerCase())},e.prototype.getPasswd=function(){return"Passwd="+encodeURIComponent(this.password)},e.prototype.getToken=function(){return"token="+encodeURIComponent(this.token)},e.prototype.getTokenStr=function(){try{return this.getAgent()+"&"+this.getPasswd()+"&overwrite="+this.overwrite+"&"+this.getToken()}catch(e){console.error("Sorry there is no enough information to get token string.")}},e.prototype.getChangePassTokenStr=function(){try{return("\n "+this.getAgent()+"&\n oldpasswd="+encodeURIComponent(this.oldPassword)+"&\n newpasswd="+encodeURIComponent(this.password)+"&\n cnfpasswd="+encodeURIComponent(this.confirmPassword)+"&\n "+this.getToken()).replace(pi.WHITE_CHARS,"")}catch(e){console.error("Sorry there is no enough information to get token string.",e)}},e.prototype.getResetPassTokenStr=function(){try{return("\n newpasswd="+encodeURIComponent(this.password)+"&\n cnfpasswd="+encodeURIComponent(this.confirmPassword)+"&\n "+this.getToken()).replace(pi.WHITE_CHARS,"")}catch(e){console.error("Sorry there is no enough information to get token string.",e)}},e}(),bi=function(){function e(e,r){this.modalService=e,this.basketService=r,this.reasonChecked=new t.BehaviorSubject(null)}return e.prototype.addBasketItem=function(e){return y(this,void 0,void 0,(function(){var t,r,i=this;return b(this,(function(a){switch(a.label){case 0:return e.id!==this.currentBasketid||this.workingOn?[2]:(t=e.basketItems.filter((function(e){return e.requiresReason&&0!==e.managementInfo.filter((function(e){return e.reason&&0===e.selectedValues.length})).length}))).length>0?(this.workingOn={basket:e,required:t.reduce((function(e,t){return e[t.id]=t.managementInfo.filter((function(e){return e.reason&&0===e.selectedValues.length})),e}),{})},[4,this.modalService.open(d.RequiresReasonDialogComponent,{backdrop:"static"},this.workingOn)]):[3,6];case 1:return(r=a.sent())?[4,Promise.all(this.workingOn.basket.basketItems.map((function(e){return Promise.all((e.managementInfo||[]).map((function(e){return r[e.id]?(i.reasonChecked.next({basketId:i.currentBasketid,reason:r[e.id]}),i.basketService.setMiSelectedValue(i.workingOn.basket.id,e,r[e.id],null)):Promise.resolve()})))})))]:[3,3];case 2:return a.sent(),this.workingOn=null,[3,5];case 3:return[4,Promise.all(Object.entries(this.workingOn.required).map((function(e){var t=S(e,2),r=t[0];t[1];return i.basketService.removeBasketItem(i.workingOn.basket.id,i.workingOn.basket.basketItems.find((function(e){return e.id===r})))})))];case 4:a.sent(),this.workingOn=null,this.reasonChecked.next({basketId:this.currentBasketid,reason:"notneeded"}),a.label=5;case 5:return[3,7];case 6:this.reasonChecked.next({basketId:this.currentBasketid,reason:"notneeded"}),a.label=7;case 7:return[2]}}))}))},e}(),gi=function(){function e(e,i,a,n,o){var s=this;this.helpers=i,this.basketService=a,this.getUserFetcher=n,this.requiresService=o,Object.assign(this,{subject:new t.BehaviorSubject(Object.assign(Object.assign({},e),{prices:{},mixedCurrency:!1,count:0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]})),_basketSubject:new t.BehaviorSubject(Object.assign(Object.assign({},e),{prices:{},mixedCurrency:!1,count:0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]})),tempid:e.id,id:e.id,title:e.title,prices:{},mixedCurrency:!1,count:0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]}),this._basketSubject.pipe(r.debounceTime(500)).subscribe((function(e){s.subject.next(e)}),(function(e){s.subject.error(e)}),(function(){s.subject.complete()})),this.next(e)}return e.prototype.destructor=function(){this.subject.complete()},e.prototype.next=function(e){var t,r=this;if((e=this.helpers.clone(e)).status!==P.Approved||void 0!==e.basketItems[0].perItemPhoneNumber){this.id=e.id,this.title=e.title;var i=Object.assign(Object.assign({},e),(e.basketItems||[]).reduce((function(e,t){var i,a,n;return e.prices[t.currency]||(e.prices[t.currency]=0),e.prices[t.currency]+=t.price,e.suppInfo.push(new $t(t,r.helpers,r.getUserFetcher)),t.miGroupsAvailable&&t.miGroupsAvailable.length>0&&e.miGroups.push({type:t.service.type,options:t.miGroupsAvailable,basketItem:t,value:t.miGroupSelected||""}),(null===(i=t.managementInfo)||void 0===i?void 0:i.length)>0&&((null===(a=t.users)||void 0===a?void 0:a.length)>0||(null===(n=t.guests)||void 0===n?void 0:n.length))&&e.basketInfoMiDetails.push(new ke(t,r.basketService,r.helpers)),e}),{prices:{},mixedCurrency:!1,count:(null===(t=e.basketItems)||void 0===t?void 0:t.length)||0,miGroups:[],basketInfoMiDetails:[],suppInfo:[]}));i.mixedCurrency=Object.keys(i.prices).length>1,this._basketSubject.next(i),e.basketItems.every((function(e){var t,r;return null===(r=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.outwardDetail)||void 0===r?void 0:r.splitID}))&&e.basketItems.length%2||this.requiresService.addBasketItem(e)}else this.basketService.getBasket({convertCurrencyTo:"GBP",id:e.id,withSupplemental:!0}).subscribe((function(e){r.next(e)}))},e}(),Si=function(){function i(r,i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k,_){var R=this;this.acceptNewPriceUpdater=r,this.addItemToBasketUpdater=i,this.addUserToBasketItem=a,this.basketCreator=n,this.basketFetcher=o,this.bookBasketUpdater=s,this.deleteBasketUpdater=l,this.getMiAutoSugestionFetcher=u,this.getUserDefaultMIValueFetcher=c,this.helpers=d,this.removeItemFromBasketUpdater=h,this.revalidateBasketUpdater=p,this.setBasketItemMiGroupUpdater=m,this.setBasketItemMiValueUpdater=f,this.validateMiFreeValue=v,this.sendBasketForApprovalUpdater=y,this.getUserFetcher=b,this.getUserBasketsFetcher=g,this.SetBasketItemLeadPassenger=S,this.moveItemToADifferentBasket=C,this.updateBasketNotesUpdater=A,this.updateBasketTitleUpdater=T,this.setPaymentMethodUpdater=D,this.getCancellationInfoFetcher=P,this.userService=F,this.modalService=k,this.addGuestToBasketItem=_,this.currentBaskets=[],this.highlightBasketItemsEmitter=new t.Subject,this.basketChangeEmitter=new t.BehaviorSubject(""),this.selectedBasketId="",this.baskets=new t.BehaviorSubject([]),this.basketList=[{type:ne.Flight,text:"FLIGHTS",price:0,co2:0},{type:ne.Rail,text:"RAIL",price:0,co2:0},{type:ne.Hotel,text:"HOTELS",price:0,co2:0},{type:ne.Cab,text:"TAXIS",price:0,co2:0},{type:ne.Car,text:"CARS",price:0,co2:0},{type:ne.Eurostar,text:"EUROSTAR",price:0,co2:0},{type:ne.InternationalRail,text:"INTERNATIONAL RAIL",price:0,co2:0},{type:ne.Parking,text:"PARKING",price:0,co2:0},{type:ne.Lounge,text:"LOUNGES",price:0,co2:0},{type:ne.Coach,text:"COACH",price:0,co2:0},{type:ne.FastTrack,text:"FAST_TRACK",price:0,co2:0}],this.basketPrices=new t.BehaviorSubject({total:null,totalCo2:null,list:this.basketList}),this.menuState=e.MenuSlideEnum.OUT,this.requiresService=new bi(k,this),this.userService.changeUser.subscribe({next:function(){R.reset()}})}return Object.defineProperty(i.prototype,"currentBasketID",{get:function(){return this.basketChangeEmitter.value},set:function(e){e!==this.currentBasketID&&this.basketChangeEmitter.next(e)},enumerable:!1,configurable:!0}),i.prototype.getRequiresReasonService=function(){return this.requiresService},i.prototype.reset=function(){var e=this;this.userService.getfullUserDetails(!1).userData.value?this.getUserBasketsFetcher.fetchList({basketStatus:P.Open,user:this.userService.getfullUserDetails(!0).userData.value.user_id.toString()}).pipe(r.take(1)).subscribe((function(t){var r=t.map((function(t){if(t){var r=e.findBasket(t.id);return r||(r=new gi(t,e.helpers,e,e.getUserFetcher,e.requiresService),e.currentBaskets.push(r)),r}})),i=e.helpers.clone(r);if(!e.userService.bobo)return(i=i.filter((function(e){return!e.subject.value.invokedUser}))).length>0?e.currentBasketID=i[0].id:e.currentBasketID=null,void e.baskets.next(r);e.baskets.next(r),r.length>0?e.currentBasketID=r[0].id:e.currentBasketID=null}),(function(e){console.error(e)})):(this.currentBaskets.forEach((function(e){return e.subject.unsubscribe()})),this.currentBaskets=[],this.currentBasketID=null,this.baskets.next(this.currentBaskets))},i.prototype.getAllOpenBaskets=function(e){return y(this,void 0,void 0,(function(){var t=this;return b(this,(function(i){return[2,this.getUserBasketsFetcher.fetchList({basketStatus:P.Open,user:e}).pipe(r.take(1),r.map((function(e){return e.length&&e.forEach((function(e){if(!t.findBasket(e.id)){var r=new gi(e,t.helpers,t,t.getUserFetcher,t.requiresService);t.currentBaskets.push(r)}})),e}))).toPromise()]}))}))},i.prototype.addToBasket=function(t,i,a,n,o,s){return void 0===n&&(n=[]),y(this,void 0,void 0,(function(){var l,u,c=this;return b(this,(function(d){switch(d.label){case 0:return s?(i=this.findBasket(this.currentBasketID),[3,8]):[3,1];case 1:return[4,this.checkBasketForInvoked(i,this.userService.bobo)];case 2:switch(d.sent()){case e.DifferentInvokdedUserReasons.continue:return[3,3];case e.DifferentInvokdedUserReasons.cancel:return[3,4];case e.DifferentInvokdedUserReasons.newBasket:return[3,5];case e.DifferentInvokdedUserReasons.research:return[3,7]}return[3,8];case 3:return[3,8];case 4:return[2,e.DifferentInvokdedUserReasons.cancel];case 5:return[4,this.createBasket()];case 6:return i=d.sent(),this.currentBasketID=i.id,[3,8];case 7:return this.userService.setBobo(Gt.makeTravellerObjectFromUser(i.subject.value.invokedUser)),[2,e.DifferentInvokdedUserReasons.research];case 8:return(null==(l=this.userService.getUserFavoriteObject(dt.AllowSameTravellesrPerBasket))?void 0:l.value)&&n&&n.length>0?[4,this.isSameTravellesrPerBasket(i,n)]:[3,14];case 9:switch(d.sent()){case e.DifferentTraveller.continue:return[3,10];case e.DifferentTraveller.cancel:return[3,11];case e.DifferentTraveller.newBasket:return[3,12]}return[3,14];case 10:return[3,14];case 11:return[2,e.DifferentInvokdedUserReasons.cancel];case 12:return[4,this.createBasket()];case 13:return i=d.sent(),this.currentBasketID=i.id,[3,14];case 14:return t.basket=i.id,t.convertCurrencyTo="GBP",(null==n?void 0:n.length)>0&&(t.users=this.helpers.makeUsers(n.filter((function(e){return!e.guest}))),t.guests=this.helpers.makeUsers(n.filter((function(e){return e.guest}))),t.leadPassenger=n[0].id,t.leadPassengerType=n[0].guest?Y.Guest:Y.User),t.outboundDate=t.outboundDate?new Date(this.helpers.formatIsoDateTime(t.outboundDate)):t.outboundDate,t.inboundDate=t.inboundDate?new Date(this.helpers.formatIsoDateTime(t.inboundDate)):t.inboundDate,t.requiresReason=o,t=this.checkDetails(t),u=this.userService.findService(t.service).type,this.removeBookedBasket(),t&&i&&this.addItemToBasketUpdater.updateOne(t).pipe(r.take(1)).subscribe((function(e){i.next(Object.assign(Object.assign({},i.subject.value),e)),a.search_objects[u].booking_chosen=!0,a.search_objects[u].chosen=!1;var t=e.basketItems;c.highlightBasketItemsEmitter.next(t),c.basketChangeEmitter.next(e.id)}),(function(e){console.error(e),i.next(i.subject.value)})),[2,e.DifferentInvokdedUserReasons.continue]}}))}))},i.prototype.checkBasketForInvoked=function(t,r){var i;return(null===(i=t.subject.value.invokedUser)||void 0===i?void 0:i.id)!==(null==r?void 0:r.id)?this.modalService.open(d.DifferentInvokdedUserComponent,{},{basketBobo:t.subject.value.invokedUser,currentBobo:r}):Promise.resolve(e.DifferentInvokdedUserReasons.continue)},i.prototype.isSameTravellesrPerBasket=function(t,r){var i,a,n,o=!1;try{o=(null===(a=null===(i=t.subject.value.basketItems[0])||void 0===i?void 0:i.users)||void 0===a?void 0:a.length)===(null==r?void 0:r.length)&&(null===(n=t.subject.value.basketItems[0])||void 0===n?void 0:n.users.every((function(e){return r.some((function(t){return t.id===e.id}))})))}catch(e){console.error("+++ Error determening same travellers: "+e+" +++")}return t.subject.value.basketItems.length>0&&!o?this.modalService.open(d.DifferentTravellerPerBasketComponent,{},{userInBasket:t.subject.value.basketItems[0].users,travellers:r}):Promise.resolve(e.DifferentTraveller.continue)},i.prototype.loadBasket=function(e){var t=this.findBasket(e);t||(t=new gi({id:e,basketItems:[]},this.helpers,this,this.getUserFetcher,this.requiresService),this.currentBaskets.push(t)),this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:e}).subscribe((function(e){t.next(e)}))},i.prototype.subsribeToBasket=function(e,t){var r=this.findBasket(e);r&&r.subject.subscribe(t)},i.prototype.removeExpiredItems=function(e){var t=this;this.findBasket(e).subject.value.basketItems.filter((function(e){return 0!==e.latestValidationPriceDifference||e.expired})).forEach((function(r){t.removeBasketItem(e,r)}))},i.prototype.removeBasketItem=function(e,t){return y(this,void 0,void 0,(function(){var r,i,a=this;return b(this,(function(n){switch(n.label){case 0:return r=this.findBasket(e),t.service.type!==ne.Hotel?[3,4]:(i=r.subject.value.basketItems.filter((function(e){return t.detail.hotelId===e.detail.hotelId&&t.detail.rooms[0].id===e.detail.rooms[0].id&&t.detail.rooms[0].checkIn===e.detail.rooms[0].checkIn&&t.detail.rooms[0].checkOut===e.detail.rooms[0].checkOut}))).length>1?[4,this.modalService.open(d.WarningRemoveModalComponent)]:[3,2];case 1:return n.sent(),i.forEach((function(t){a.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),a.basketChangeEmitter.next(e)}))})),[3,3];case 2:this.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),a.basketChangeEmitter.next(e)})),n.label=3;case 3:return[3,5];case 4:this.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),a.basketChangeEmitter.next(e)})),n.label=5;case 5:return[2]}}))}))},i.prototype.getDefaultBasket=function(e){return void 0===e&&(e=!1),y(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,this.findOrCreateBasket(this.currentBasketID,e).then((function(e){return e}))];case 1:return[2,t.sent()]}}))}))},i.prototype.findBasket=function(e){return this.currentBaskets.find((function(t){return t.id===e||t.tempid===e}))},i.prototype.findOrCreateBasket=function(e,t){return void 0===t&&(t=!1),y(this,void 0,void 0,(function(){var r,i;return b(this,(function(a){switch(a.label){case 0:return r=null,e?[3,7]:[4,this.getAllOpenBaskets(this.userService.getfullUserDetails(!0).userData.value.user_id.toString())];case 1:return i=a.sent(),this.userService.bobo||(i=i.filter((function(e){return!e.invokedUser}))),(null==i?void 0:i.length)?[3,3]:[4,this.createBasket()];case 2:return r=a.sent(),[3,6];case 3:return"BOOKED"!==(r=this.findBasket(i[0].id)).subject.value.status||t?[3,5]:(console.warn("+++ Retrieved basket is in booked status - creating a new one +++"),[4,this.createBasket()]);case 4:r=a.sent(),this.currentBaskets.push(r),a.label=5;case 5:this.baskets.next(this.currentBaskets),a.label=6;case 6:return[3,8];case 7:r=this.findBasket(e),a.label=8;case 8:return[2,r]}}))}))},i.prototype.createBasket=function(){return y(this,void 0,void 0,(function(){var e,t,r;return b(this,(function(i){switch(i.label){case 0:return e={id:"TEMPID_"+l.default().unix().toString(),owner:null,reference:null,title:null,notes:null,createdAt:null,updatedAt:null,basketItems:[],status:null,validated:!1},t=new gi(e,this.helpers,this,this.getUserFetcher,this.requiresService),[4,this.createBasketOnDB(t)];case 1:return r=i.sent(),this.currentBaskets.push(r),this.baskets.next(this.currentBaskets),this.basketChangeEmitter.next(r.id),[2,r]}}))}))},i.prototype.createBasketOnDB=function(e){var t,i,a=this,n=(null===(t=this.userService.bobo)||void 0===t?void 0:t.id)?{invokedUser:null===(i=this.userService.bobo)||void 0===i?void 0:i.id}:{};return new Promise((function(t,i){a.basketCreator.updateOne(n).pipe(r.take(1)).subscribe((function(r){e.id=r.id,e.next(r),t(e)}),(function(e){i(e)}),(function(){}))}))},i.prototype.toggleMenu=function(){this.menuState===e.MenuSlideEnum.IN||this.menuState===e.MenuSlideEnum.FLAT?this.menuState=e.MenuSlideEnum.OUT:this.menuState=e.MenuSlideEnum.IN},i.prototype.closeMenu=function(){this.menuState=e.MenuSlideEnum.IN},i.prototype.getLatestBasketItemForTypes=function(e){return(e||[]).reduce((function(e,t){return e[t.service.type]=t,e}),{})},i.prototype.checkDetails=function(e){var t=this.userService.findService(e.service);if(!t)return console.error("Unable to find service for basket item : "+e.service),null;var r=new u.default;r.addFormat("js-date-time",(function(e){return"object"==typeof e&&e.hasOwnProperty("toISOString")&&(e=e.toISOString()),!isNaN(Date.parse(e))})),r.addFormat("railSeating",(function(){return!0})),r.addFormat("passport",(function(){return!0})),r.addFormat("specialRequest",(function(){return!0}));var i=r.compile(t.detailSchema),a=r.compile(t.searchQuerySchema);if(e.searchQuery=this.helpers.sanitizeMomentDates(e.searchQuery),e.detail=this.helpers.removeNulls(e.detail),!a(e.searchQuery)){var n="Item searchQuery is not valid for "+t.name+" search schema.";return console.warn("searchSchema",t.searchQuerySchema),console.warn("item.searchQuery",e.searchQuery),console.warn("Search Query Validation errors",a.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}if(!i(e.detail)){n="Item detail is not valid for "+t.name+" detail schema.";return console.warn("detailSchema",t.detailSchema),console.warn("item.detail",e.detail),console.warn("Detail errors",i.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}return e.lowestPrice&&(e.lowestPrice=+e.lowestPrice.toFixed(2)),e},i.prototype.getNumberItemsForBasket=function(e){return void 0===e&&(e=null),(null==(e=e||this.findBasket(this.currentBasketID))?void 0:e.subject.value.basketItems.length)||0},i.prototype.removeBasket=function(e){var i=this;if(e)return this.deleteBasketUpdater.updateOne({id:e}).pipe(r.take(1),r.switchMap((function(r){var a,n;return null===(a=i.findBasket(e))||void 0===a||a.destructor(),i.currentBaskets=i.currentBaskets.filter((function(t){return t.id!==e})),i.baskets.next(i.currentBaskets),e===i.currentBasketID&&(i.currentBasketID=(null===(n=i.currentBaskets[0])||void 0===n?void 0:n.id)||null),t.of(r)})))},i.prototype.continueSearchAndBook=function(e,t,r){var i=this.getLatestBasketItemForTypes(e),a=r.getHighestSearchPriorityObject(i);return a?(r.searches[a.type].updateFromPreviousSearches(i),[a.searchUrl]):t},i.prototype.addTravellers=function(t,r,i,a){var n=this;void 0===a&&(a=0);var o=this.findBasket(t);if(a<i.length){var s=i[a],l=s.isChild?e.ɵf.Child:s.isInfant?e.ɵf.Infant:e.ɵf.Adult;s.guest?this.addGuestToBasketItem.updateOne({convertCurrencyTo:"GBP",basketItem:r.id,guests:[{id:s.id,passengerType:l}]}).subscribe((function(){n.addTravellers(o.id,r,i,a+1)})):this.addUserToBasketItem.updateOne({convertCurrencyTo:"GBP",basketItem:r.id,users:[{id:s.id,passengerType:l}],withSupplemental:!1}).subscribe((function(){n.addTravellers(o.id,r,i,a+1)}))}else this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:o.id}).subscribe((function(e){o.subject.next(Object.assign(Object.assign({},o.subject.value),e))}),(function(e){}),(function(){o.next(o.subject.value)}))},i.prototype.setLeadPassenger=function(e,t,r,i,a){var n=this;void 0===i&&(i=0),void 0===a&&(a=Y.User);var o=this.findBasket(e);i<1?this.SetBasketItemLeadPassenger.updateOne({convertCurrencyTo:"GBP",id:t.id,userOrGuest:r.id,withSupplemental:!1,leadPassengerType:a}).subscribe((function(){}),(function(){}),(function(){n.setLeadPassenger(o.id,t,r,i+1)})):this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:o.id}).subscribe((function(e){o.subject.next(Object.assign(Object.assign({},o.subject.value),e))}),(function(e){}),(function(){o.next(o.subject.value)}))},i.prototype.updateBasket=function(e,t){var i=this;return new Promise((function(a,n){t.pipe(r.take(1)).subscribe((function(t){i.findBasket(e).next(t),a()}),(function(t){console.error(t);var r=i.findBasket(e);r.next(r.subject.value),n(t)}),(function(){}))}))},i.prototype.revalidate=function(e){this.updateBasket(e,this.revalidateBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e}))},i.prototype.setBasketItemMiGroup=function(e,t,r){this.updateBasket(e,this.setBasketItemMiGroupUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t,group:r}))},i.prototype.acceptNewPrice=function(e,t){this.updateBasket(e,this.acceptNewPriceUpdater.updateOne({convertCurrencyTo:"GBP",id:t.id}))},i.prototype.validateFreeValeMi=function(e,t){var r=this;return new Promise((function(i,a){r.validateMiFreeValue.test({mi:e.id,freeValue:t}).subscribe(i,a)}))},i.prototype.setMiFreeValue=function(e,t,i,a,n){var o=this;void 0===a&&(a=null);var s=this.findBasket(e),l={convertCurrencyTo:"GBP",mi:t.id,miFreeValue:i};return a&&(n?l.guest=a:l.user=a),new Promise((function(e,t){o.setBasketItemMiValueUpdater.updateOne(l).pipe(r.take(1)).subscribe((function(e){s.next(e)}),(function(e){t(e)}),(function(){e()}))}))},i.prototype.setMiSelectedValue=function(e,t,r,i,a){void 0===i&&(i=null);var n={convertCurrencyTo:"GBP",mi:t.id,miValue:r};return i&&(a?n.guest=i:n.user=i),this.updateBasket(e,this.setBasketItemMiValueUpdater.updateOne(n))},i.prototype.getMiAutoSugestions=function(e,i,a){null==a||a.next(!0);var n=this.getMiAutoSugestionFetcher.fetchList({mi:e,partialValue:i}),o=this.getMiAutoSugestionFetcher.fetchList({mi:e,partialLabel:i});return t.forkJoin([n,o]).pipe(r.map((function(e){var t=S(e,2),r=C(t[0],t[1]);return r=r.filter((function(e,t){return r.findIndex((function(t){return t.id==e.id}))===t})),console.log(r),null==a||a.next(!1),r})))},i.prototype.getUserDefaultMIValue=function(e,t,i){return null==i||i.next(!0),this.getUserDefaultMIValueFetcher.fetchOne({mi:e,user:t}).pipe(r.take(1))},i.prototype.saveMiData=function(e,t){t.forEach((function(t){t.miPerItem.forEach((function(t){t.save(e,null)})),t.users.forEach((function(r){t.miPerUser[r].managementInfo.forEach((function(t){t.save(e,r)}))})),t.guests.forEach((function(r){t.miPerGuest[r].managementInfo.forEach((function(t){t.save(e,r,!0)}))}))}))},i.prototype.sendBasketForApproval=function(e){return this.updateBasket(e,this.sendBasketForApprovalUpdater.updateOne({convertCurrencyTo:"GBP",basket:e}).pipe(r.take(1)))},i.prototype.setBasketItemPaymentOption=function(e,t,r){return this.updateBasket(e.id,this.setPaymentMethodUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,paymentMethod:r}))},i.prototype.bookBasket=function(e,t,r){return this.updateBasket(e,this.bookBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e,supplementaryInfo:t,additionalEmail:r}))},i.prototype.moveBasketItem=function(e,t,r){var i=this;this.moveItemToADifferentBasket.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,newBasket:r}).subscribe((function(){i.loadBasket(e),i.loadBasket(r)}))},i.prototype.updateBasketNotes=function(e,t){this.updateBasket(e,this.updateBasketNotesUpdater.updateOne({convertCurrencyTo:"GBP",id:e,notes:t}))},i.prototype.updateBasketTitle=function(e,t){this.updateBasket(e,this.updateBasketTitleUpdater.updateOne({convertCurrencyTo:"GBP",id:e,newTitle:t}))},i.prototype.getBasket=function(e){return this.basketFetcher.fetchOne(e)},i.prototype.atLeastOneSearchChosen=function(){return!!this.currentBaskets.filter((function(e){return e.subject.value.basketItems.length})).length},i.prototype.getBasketStats=function(e){var t,r,i,a=this,n=(null===(i=null===(r=null===(t=this.baskets.value[e])||void 0===t?void 0:t.subject)||void 0===r?void 0:r.value)||void 0===i?void 0:i.prices)||{},o=Object.keys(n)[0];return o?(this.basketPrices.value.currency=o,this.basketPrices.value.total=this.baskets.value[e].subject.value.prices[o]):this.basketPrices.value.total=0,this.basketPrices.value.list.forEach((function(t){var r,i,n,o,s,l;t.price=null===(n=null===(i=null===(r=a.baskets.value[e])||void 0===r?void 0:r.subject)||void 0===i?void 0:i.value)||void 0===n?void 0:n.basketItems.filter((function(e){return e.service.type===t.type})).reduce((function(e,t){return e+t.price}),0),t.co2=null===(l=null===(s=null===(o=a.baskets.value[e])||void 0===o?void 0:o.subject)||void 0===s?void 0:s.value)||void 0===l?void 0:l.basketItems.filter((function(e){return e.service.type===t.type})).reduce((function(e,t){return e+t.co2PerItem}),0)})),this.basketPrices.value.totalCo2=this.basketPrices.value.list.reduce((function(e,t){return e+t.co2}),0),this.basketPrices},i.prototype.canCancel=function(e){return this.getCancellationInfoFetcher.fetchOne({basketItem:e.id})},i.prototype.removeBookedBasket=function(){this.currentBaskets=this.currentBaskets.reduce((function(e,t){return t.subject.value.status!==P.Booked&&e.push(t),e}),[]),this.baskets.next(this.currentBaskets)},i.prototype.showErrorModal=function(){var e,t,r,i,a=this.userService.fullUserDetails.allDetails.value.office,n=(null==a?void 0:a.supportEmail)||"",o=(null===(e=null==a?void 0:a.supportPhoneNumber)||void 0===e?void 0:e.countryCode)?"+"+(null===(t=null==a?void 0:a.supportPhoneNumber)||void 0===t?void 0:t.countryCode):"",s=(null===(r=null==a?void 0:a.supportPhoneNumber)||void 0===r?void 0:r.number)?null===(i=null==a?void 0:a.supportPhoneNumber)||void 0===i?void 0:i.number:"";this.modalService.open(d.ModalErrorComponent,{},{error:"There are missing values in the Management Information section within your configuration.",miError:!0,email:n,number:o+" "+s})},i}(),Ci="results_hotel_avallibility",Ai=function(){function e(e,r,i,a){this.avalibilityFethcer=e,this.sessionStorage=r,this.helpers=i,this.environment=a,this.data=null,this.behaviours={},this.toFetch=[],this.fetching=new t.BehaviorSubject(!1),this.currencies={}}return e.prototype.readFromSession=function(){var e=this,r=this.sessionStorage.getSessionItem(Ci)||{};return Object.values(r).forEach((function(r){e.behaviours[r.hotelId]=new t.BehaviorSubject(r)})),r},e.prototype.reset=function(){var e=this;this.data={},this.currencies={},this.toFetch=[],this.fetching.next(!1),this.sessionStorage.removeSessionItem(Ci),Object.values(this.data).forEach((function(t){e.behaviours[t.hotelId].complete(),delete e.behaviours[t.hotelId]})),this.behaviours={}},e.prototype.getAvailabilityForId=function(e,r){var i;if(null===(i=null==r?void 0:r.availableRates)||void 0===i?void 0:i.rooms){if(this.behaviours[e.hotel])return this.behaviours[e.hotel];this.behaviours[e.hotel]=new t.BehaviorSubject(null);var a=r.availableRates;return a.minprice=r.availableRates.rooms[0]?r.availableRates.rooms[0].total:0,a.maxprice=a.minprice?r.availableRates.rooms[r.availableRates.rooms.length-1].total:0,this.behaviours[e.hotel].next(a),this.behaviours[e.hotel]}return this.data=this.data||this.readFromSession(),this.behaviours[e.hotel]||this._getAvailabilityForId(e)},e.prototype.getAvailabilityValue=function(e){var t;return this.data=this.data||this.readFromSession(),(null===(t=this.behaviours[e.id])||void 0===t?void 0:t.value)||{}},e.prototype.updateHotel=function(e){return e.availableRates||(e.availableRates=this.getAvailabilityValue(e)),e},e.prototype.setHotelAvalability=function(e){var t;return e.receivedJitRules=!0,e.availableRates&&(null==e?void 0:e.availableRates.hotelId)&&this.behaviours[null===(t=null==e?void 0:e.availableRates)||void 0===t?void 0:t.hotelId]&&(this.data[e.availableRates.hotelId]=e.availableRates,this.behaviours[e.availableRates.hotelId].next(e.availableRates)),e},e.prototype._getAvailabilityForId=function(e){return this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0),this.fetching.value||(this.timeout=window.setTimeout(this.fetchAvalilbility.bind(this),this.environment.autoFetchHotelTimeout)),this.toFetch.push(e),!this.fetching.value&&this.toFetch.length>=this.environment.numberOfHotelsToFetch&&this.fetchAvalilbility(),this.behaviours[e.hotel]=new t.BehaviorSubject(null),this.behaviours[e.hotel]},e.prototype.fetchAvalilbility=function(){var e,t,i,a,n,o=this;this.fetching.next(!0),this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0);var s=this.toFetch.slice(0,this.environment.numberOfHotelsToFetch);this.toFetch=this.toFetch.slice(this.environment.numberOfHotelsToFetch),console.log("Hotels still to fetch",this.toFetch.length);var l={hotel:s.map((function(e){return e.hotel})),currency:null===(e=s[0])||void 0===e?void 0:e.currency,endDate:null===(t=s[0])||void 0===t?void 0:t.endDate,startDate:null===(i=s[0])||void 0===i?void 0:i.startDate,occupants:null===(a=s[0])||void 0===a?void 0:a.occupants,rooms:null===(n=s[0])||void 0===n?void 0:n.rooms};this.avalibilityFethcer.fetchList(l).pipe(r.take(1)).subscribe((function(e){e.forEach((function(e){(e=o.helpers.clone(e)).rooms=(e.rooms||[]).filter((function(e){return e.total>0})).map((function(e){return(e=o.helpers.clone(e)).LocalPrice=e.currencyConversion?e.currencyConversion.localTotal:e.total,e.LocalCurrency=e.currencyConversion?e.currencyConversion.localCode:e.currencyCode,e})),e.currencies=e.rooms.reduce((function(e,t){return t.currencyConversion&&(e[t.currencyConversion.convertedCode]=e[t.currencyConversion.convertedCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},e[t.currencyConversion.convertedCode].maxprice=Math.max(e[t.currencyConversion.convertedCode].maxprice,t.currencyConversion.convertedTotal),e[t.currencyConversion.convertedCode].minprice=Math.min(e[t.currencyConversion.convertedCode].minprice,t.currencyConversion.convertedTotal),o.currencies[t.currencyConversion.localCode]=o.currencies[t.currencyConversion.localCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},o.currencies[t.currencyConversion.localCode].minprice=Math.ceil(Math.min(o.currencies[t.currencyConversion.localCode].minprice,t.currencyConversion.localTotal)),o.currencies[t.currencyConversion.localCode].maxprice=Math.ceil(Math.max(o.currencies[t.currencyConversion.localCode].maxprice,t.currencyConversion.localTotal))),e}),{});var t=e.rooms.map(o.helpers.mapFieldFromObject("total"));t.length||t.push(0),e.minprice=Math.min.apply(Math,C(t)),e.maxprice=Math.max.apply(Math,C(t)),e.rooms=e.rooms,(null==e?void 0:e.hotelId)&&o.behaviours[e.hotelId]&&(o.data[e.hotelId]=e,o.behaviours[e.hotelId].next(e))})),o.sessionStorage.setSessionItem(Ci,e),o.toFetch.length>0?setTimeout((function(){o.fetchAvalilbility()}),o.environment.hotelAvalibilityTimeout):o.fetching.next(!1)}),(function(e){return console.error("+++ Error recovering hotel availabilty: "+e+" - reseting availabilty +++"),o.fetching.next(!1),null}))},e.prototype.maxPriceForCurrency=function(e){return(this.currencies[e]||{maxprice:Number.MAX_VALUE,minprice:Number.MIN_VALUE}).maxprice},e.prototype.numberOfHotelsWithPrice=function(){var e,t,r=0;if(this.data)try{for(var i=g(Object.entries(this.data)),a=i.next();!a.done;a=i.next()){var n=S(a.value,2),o=(n[0],n[1]);(null==o?void 0:o.prpn)&&r++}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e}(),Ti=function(){function e(){}return e.prototype.serialize=function(e){return Object.keys(e).reduce((function(t,r){return(t.length?t+"&":"")+r+"="+encodeURIComponent("object"==typeof e[r]?JSON.stringify(e[r]):e[r])}),"")},e}(),Di="USER_SIGNEDOUT",Pi=function(){function e(e,r,i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g){this.getUserFetcher=e,this.userUiConfigsFetcher=r,this.userProductsFetcher=i,this.userMessagesFetcher=a,this.baseConfirmMessagesUpdater=n,this.getCompaniesFetcher=o,this.getCompanyFetcher=s,this.setUserLanguageUpdater=l,this.editUserUpdater=u,this.createGuestUpdater=c,this.getUserGuestsFetcher=d,this.getOfficeFetcher=h,this.getRedirectApproverFetcher=p,this.addRedirectApproverUpdater=m,this.removeRedirectApproverUpdater=f,this.storageService=v,this.helpers=y,this.webTokenService=b,this.searchCompanyApproversFetcher=g,this.fullUserDetails={bookingAllowedFor:"",messages:new t.BehaviorSubject(null),travllerObject:new t.BehaviorSubject(null),userConfigs:new t.BehaviorSubject(null),userData:new t.BehaviorSubject(null),userServices:new t.BehaviorSubject(null),allDetails:new t.BehaviorSubject(null)},this.changeUser=new t.BehaviorSubject(null),this._bobo=null,this.invokedUserUpdater=b.getInvokedUserObservable()}return e.prototype.setBobo=function(e){var t;return y(this,void 0,void 0,(function(){return b(this,(function(r){return!e||e.id?e===this._bobo||(null==e?void 0:e.id)&&(null==e?void 0:e.id)===(null===(t=this._bobo)||void 0===t?void 0:t.id)?[2,!0]:(this._bobo=e,this.invokedUserUpdater.next(e||null),[2,this.updateServices()]):[2,!1]}))}))},Object.defineProperty(e.prototype,"bobo",{get:function(){return this._bobo},enumerable:!1,configurable:!0}),e.prototype.updateServices=function(){var e=this;return new Promise((function(t,r){e.userProductsFetcher.fetchKeyedObjectArray("type").subscribe((function(t){e.fullUserDetails.userServices.next(t),e.checkEmitUser()}),(function(e){t(!1)}),(function(){return t(!0)}))}))},e.prototype.setUser=function(e){var t=this,i=this.fullUserDetails.userData.value;i&&i.username===e.username||((null==e?void 0:e.user_id)&&this.getUserFetcher.fetchOne({id:e.user_id.toString()}).pipe(r.take(1)).subscribe((function(e){t.fullUserDetails.allDetails.next(e),t.checkEmitUser()})),this.userUiConfigsFetcher.fetchKeyedObject("key").subscribe((function(e){t.fullUserDetails.userConfigs.next(e),t.checkEmitUser()}),(function(e){console.error(e)})),this.userProductsFetcher.fetchKeyedObjectArray("type").subscribe((function(e){t.fullUserDetails.userServices.next(e),t.checkEmitUser()})),this.userMessagesFetcher.fetchList().subscribe((function(e){t.fullUserDetails.messages.next(e),t.checkEmitUser()}),(function(e){console.error(e)})),this.fullUserDetails.travllerObject.next(Gt.makeTravellerObjectFromUserData(e))),(null==e?void 0:e.user_id)&&this.getUserFetcher.fetchOne({id:null==e?void 0:e.user_id.toString()}).pipe(r.take(1)).subscribe((function(e){t.fullUserDetails.allDetails.next(e),t.checkEmitUser()})),this.fullUserDetails.userData.next(e),this.storageService.setSessionItem("lightning_user_data",e)},e.prototype.canBookGuest=function(){return this.fullUserDetails.allDetails.value.canBookGuest},e.prototype.checkEmitUser=function(){this.fullUserDetails.userConfigs.value&&this.fullUserDetails.userData.value&&this.fullUserDetails.userServices.value&&this.fullUserDetails.messages.value&&this.changeUser.next(this.fullUserDetails)},e.prototype.getfullUserDetails=function(e){return void 0===e&&(e=!1),this._getFullUserDetails()},e.prototype._getFullUserDetails=function(){return this.fullUserDetails||this.storageService.getSessionItem("lightning_user_data")},e.prototype.getUserDropdownInfo=function(){var e={name:"Unable to retrieve name.",email:"Unable to rerieve email",account_type:"Unknown",title:""},t=this.getUsersFullname(),r=this.getUserEmail(),i=this.getUserBookingType(),a=this.getUserTitle();return t&&(e.name=t),r&&(e.email=r),i&&(e.account_type=i),a&&(e.title=a),e},e.prototype.getUserTitle=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.title:""},e.prototype.getUserForename=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.forename:""},e.prototype.getUserSurname=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.surname:""},e.prototype.getFullPhoneNumber=function(){return""},e.prototype.getUserEmail=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.username:""},e.prototype.getUserBookingType=function(){var e=this.getfullUserDetails();return e&&e.userData?e.userData.value.booker_type:null},e.prototype.getUsersFullname=function(){var e=this.getfullUserDetails();return!(!e||!e.userData)&&e.userData.value.forename+" "+e.userData.value.surname},e.prototype.getUsersTitleAndFullName=function(){var e=this.getfullUserDetails();return!(!e||!e.userData)&&e.userData.value.title+" "+e.userData.value.forename+" "+e.userData.value.surname},e.prototype.getUserFavoriteValue=function(e,t){void 0===t&&(t=ht.non);var r=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(r,e.value,"config",e.value)},e.prototype.getUserFavoriteObject=function(e){var t=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(t,e.value,"config")},e.prototype.getUserFavoriteNumber=function(e){var t=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(t,e.value,"config","value")},e.prototype.isUserFavoriteSet=function(e,t){void 0===t&&(t=ht.non);var r=this.fullUserDetails.userConfigs.value;return this.helpers.fromObject(r,e.value,"config","value")},e.prototype.createSelfTraveller=function(){return this.fullUserDetails.travllerObject.value},e.prototype.travellerIsUser=function(e){return!1},e.prototype.emptyUserData=function(){this.fullUserDetails.userData.next(null),this.fullUserDetails.userConfigs.next(null),this.fullUserDetails.userServices.next(null),this.fullUserDetails.messages.next(null),this.changeUser.next(this.fullUserDetails)},e.prototype.createGuestUser=function(e,t,r,i,a,n,o,s,l,u,c){return{isChild:l,isInfant:u,childDOB:c,guest:!0,id:"",forename:t,surname:r,email:i,title:e,name:[e,t,r].join(" ")}},e.prototype.userIsClient=function(){return!0},e.prototype.hasIgnorePolicy=function(){return!1},e.prototype.useAgentCanBookFor=function(){return!0},e.prototype.canBook=function(e){var t=this.fullUserDetails.userServices.value;return t&&!!t[e]},e.prototype.isTraveller=function(){return this.fullUserDetails.userData.value.booker_type===k.Traveller},e.prototype.userIsAgent=function(){return this.fullUserDetails.userData.value.agentBooker},e.prototype.userIsAdmin=function(){return this.fullUserDetails.userData.value.admin},e.prototype.userIsCompanyAdmin=function(){return this.fullUserDetails.userData.value.company_admin},e.prototype.userIsTmcAdmin=function(){return this.fullUserDetails.userData.value.tmc_admin},e.prototype.userTmcId=function(){return this.fullUserDetails.userData.value.tmc_id},e.prototype.isSelfBook=function(){return this.fullUserDetails.userData.value.booker_type===k.SelfBook},e.prototype.isBooker=function(){return this.fullUserDetails.userData.value.booker_type===k.Booker},e.prototype.getUserId=function(){return this.fullUserDetails.userData.value.user_id},e.prototype.userHasServiceProvider=function(e,t){return!!this.fullUserDetails.userServices.value&&!!(this.fullUserDetails.userServices.value[e]||[]).find((function(e){return e.name===t}))},e.prototype.findService=function(e){return this.fullUserDetails.userServices.value?this.helpers.findService(this.fullUserDetails.userServices.value,e):null},e.prototype.getUserMessages=function(){return this.userMessagesFetcher.fetchList()},e.prototype.confirmMessages=function(e){return this.baseConfirmMessagesUpdater.updateOne({messages:e})},e.prototype.userIsRoot=function(){return this.fullUserDetails.userData.value.booker_type===k.Root},e.prototype.userIsSupportAgent=function(){return!!this.fullUserDetails.userData.value.support_agent},e.prototype.getUserCompanies=function(e){return void 0===e&&(e=null),e?this.getCompaniesFetcher.fetchList({query:e}).pipe(r.take(1)):this.getCompaniesFetcher.fetchList().pipe(r.take(1))},e.prototype.getCompanyById=function(e,t){return void 0===t&&(t=!1),this.getCompanyFetcher.fetchOne({id:e}).pipe(r.take(1))},e.prototype.getUserCompany=function(){return this.getCompanyById(this.fullUserDetails.userData.value.company_id.toString())},e.prototype.getUser=function(e){var t=this.getfullUserDetails();return this.getUserFetcher.fetchOne({id:e||t.userData.value.user_id.toString()})},e.prototype.setUserLanguage=function(e){return this.setUserLanguageUpdater.updateOne({language:e})},e.prototype.getDocuments=function(e,t){return this.getUser(t).pipe(r.map((function(e){return e.documents||[]})),r.map((function(t){return e?t.filter((function(t){return t.docType===e})):t})))},e.prototype.editUser=function(e){var t=this;return this.editUserUpdater.updateOne(e).pipe(r.tap((function(e){return t.fullUserDetails.allDetails.next(e)})))},e.prototype.createGuest=function(e){return this.createGuestUpdater.updateOne(e).pipe(r.take(1))},e.prototype.getUserGuests=function(){return this.getUserGuestsFetcher.fetchList()},e.prototype.canInvokeUser=function(){return this.fullUserDetails.allDetails.value.canInvokeUser},e.prototype.getOffice=function(){return this.getOfficeFetcher.fetchList()},e.prototype.getRedirectApprover=function(){return this.getRedirectApproverFetcher.fetchList()},e.prototype.addRedirectApprover=function(e){return this.addRedirectApproverUpdater.updateOne(e).pipe(r.take(1))},e.prototype.removeRedirectApprover=function(e){return this.removeRedirectApproverUpdater.updateOne({id:e})},e.prototype.getUseMiDefaultValues=function(){return this.fullUserDetails.allDetails.value.userMiDefaultValues},e.prototype.isLoggedIn=function(){return!!this.fullUserDetails.allDetails.value},e.prototype.ermCompanyType=function(){return this.fullUserDetails.userData.value.company_type},e.prototype.getSearchCompanyApprovers=function(e){return this.searchCompanyApproversFetcher.fetchList({email:e})},e}(),Fi=function(){function i(e,t,r,i,a,n,o,s){this.userService=e,this.modalService=t,this.http=r,this.router=i,this.eventMessenager=a,this.storageService=n,this.environment=o,this.searchService=s,this.loading=!1,this.isLoggedIn=!1,this.redirectUrl="",this.refreshPromise=null,this.becomingUser=!1,this.unBecomingUser=!1}return i.prototype.checkLogin=function(){return this.refreshToken()},i.prototype.refreshToken=function(){var t=this;return this.refreshPromise=this.refreshPromise||new Promise((function(i,a){t.clearRefresh(),t.http.formEncodedPostNoErrorHandling(e.URLS.Refresh,{}).pipe(r.take(1),r.map((function(e){return t.handleResponse(e)}))).subscribe((function(e){"string"==typeof e?(i(!1),t.autoLogout(i)):(i(!0),t.setRefresh())}),(function(e){t.autoLogout(i)}))})).then((function(e){return t.refreshPromise=null,e})).catch((function(e){throw t.refreshPromise=null,e})),this.refreshPromise},i.prototype.autoLogout=function(e){this.userService.isLoggedIn()||("/logon"!==this.router.url&&"/"!==this.router.url&&this.logout(),e(!1)),"/logon"!==this.router.url&&"/"!==this.router.url?(this.logout(),this.modalService.open(d.AutoLogout,{},{title:"Auto Logout",body:"You have been logged out of the system as your session has timed out. Please log on again to continue",isLoading:!1,options:{buttonCancel:!1,buttonOk:!0,buttonOkText:"Continue"}}).then((function(){e(!1)}))):e(!1)},i.prototype.clearRefresh=function(){this.timeoutSubscription&&(clearTimeout(this.timeoutSubscription),this.timeoutSubscription=null)},i.prototype.setRefresh=function(){this.timeoutSubscription=window.setTimeout(this.refreshToken.bind(this),1e3*this.environment.authRefreshTimeout)},i.prototype.becomeUser=function(t){var i=this;return this.becomingUser=!0,new Promise((function(a,n){i.clearRefresh(),i.storageService.clearSessionData(),i.http.post(e.URLS.BECOME_USER,{username:t}).pipe(r.take(1)).subscribe((function(e){i.becomingUser=!1,console.log(e),i.userService.setUser(e.jwtObject),i.searchService.reset(),i.router.navigate(["main"]),a(!0)}),(function(e){i.becomingUser=!1,n(e)}))}))},i.prototype.endBecomeUserSession=function(){var t=this;return this.unBecomingUser=!0,new Promise((function(i,a){t.clearRefresh(),t.storageService.clearSessionData(),t.searchService.reset(),t.http.post(e.URLS.END_BECOME_USER,{}).pipe(r.take(1)).subscribe((function(e){t.unBecomingUser=!1,console.log(e),t.userService.setUser(e.jwtObject),i(!0)}),(function(e){t.unBecomingUser=!1,a(e)}))}))},i.prototype.login=function(t,i,a){var n=this;return this.userService.emptyUserData(),this.storageService.clearSessionData(),this.clearRefresh(),this.userService.setBobo(null),this.http.formEncodedPostNoErrorHandling(e.URLS.AccessToken,{username:t,password:i}).pipe(r.take(1),r.map((function(e,t){return n.setRefresh(),n.handleResponse(e)})))},i.prototype.handleResponse=function(e){return"object"==typeof e&&e.jwt&&(this.userService.setUser(e.jwtObject),this.isLoggedIn=!0,delete e.jwt,delete e.jwtObject),e},i.prototype.cookieLogin=function(e){return t.of(null)},i.prototype.logout=function(){var t=this;if(this.isLoggedIn){this.userService.isUserFavoriteSet(dt.SSO_no_password);this.clearRefresh(),this.isLoggedIn=!1,this.userService.setBobo(null),this.searchService.removeAllTravellers(),this.userService.emptyUserData(),this.storageService.clearSessionData(),this.http.post(e.URLS.LOGOUT_URL).subscribe((function(e){e.LogoutSuccess||console.warn("You're not logged in, cannot log out.")}),(function(){t.eventMessenager.emit(Di,{}),t.userService.isUserFavoriteSet(dt.SSO_no_password)?t.router.navigate(["logOutDigitsUser"]):t.router.navigate(["logon"])}))}else this.router.navigate(["logon"])},i.prototype.changePassword=function(e){return t.of(null)},i.prototype.resetPassword=function(t,r){return this.http.formEncodedPost(e.URLS.RESET_PASSWORD,{passwordResetToken:t,newPassword:r})},i.prototype.recoverPassword=function(t){return this.http.formEncodedPost(e.URLS.RECOVER_PASSWORD_URL,{username:""+t},"text")},i.prototype.handleError=function(e){var t={error:e};this.modalService.open(d.ModalErrorComponent,{},t)},i}(),ki=function(){function e(){this.openModalEvent=new t.Subject}return e.prototype.open=function(e,t,r){var i=this;return void 0===t&&(t=null),void 0===r&&(r=null),"BaseModalComponent"===e.value?new Promise((function(e,t){})):new Promise((function(a,n){i.openModalEvent.next({type:e,data:r||{},options:t||{},results:a})}))},e.prototype.subscribe=function(e){return this.openModalEvent.subscribe(e)},e}(),_i=function(){function e(e,r,i){var a,n;this.getUserBasketsFetcher=e,this.searchUserCanBookFor=r,this.cancelBookingUpdater=i,this.baskets=new t.BehaviorSubject([]),this._allApprovals=!1,this._basketStatusIconClasses=((a={})[P.Approved]="ico-tick",a[P.AwaitingApproval]="ico-clock",a[P.BookingFailed]="ico-deny",a[P.Disapproved]="ico-deny",a[P.Open]="ico-calendar",a[P.PartiallyBooked]="ico-deny",a[P.Booked]="ico-deny",a),this._serviceTypeIconClasses=((n={})[ne.Cab]="ico-m-taxi",n[ne.Car]="ico-car",n[ne.Coach]="ico-bus",n[ne.Flight]="ico-flight",n[ne.Hotel]="ico-bed",n[ne.FastTrack]="ico-material ico-fast-track",n[ne.InternationalRail]="ico-rail",n[ne.Lounge]="ico-material ico-lounge",n[ne.Parking]="ico-material ico-parking",n[ne.Rail]="ico-rail",n[ne.Eurostar]="ico-material ico-euro",n[ne.Ferry]="ico-rail",n)}return Object.defineProperty(e.prototype,"allApprovals",{get:function(){return this._allApprovals},set:function(e){this._allApprovals=e},enumerable:!1,configurable:!0}),e.prototype.getUserBaskets=function(e,t){var i=this;t.next(!0),this.allApprovals&&(e.user="",e.traveller=""),this.getUserBasketsFetcher.fetchList(e).pipe(r.take(1)).subscribe((function(e){i.baskets.next(e),t.next(!1)}),(function(e){console.error(e),t.next(!1)}))},e.prototype.getSearchUserCanBookFor=function(e,i){return e.length>2?(i.next(!0),this.searchUserCanBookFor.fetchList({email:e}).pipe(r.take(1),r.map((function(e){return i.next(!1),e})))):t.of([])},e.prototype.getServiceTypeFilters=function(e){var t,r,i=[];try{for(var a=g(Object.entries(e.search_objects)),n=a.next();!n.done;n=a.next()){var o=S(n.value,1)[0];i.push(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},e.prototype.getBasketStatusFilters=function(){var e=[];return Object.values(P).forEach((function(t){return e.push(t)})),e},e.prototype.getServiceTypeFilterVanityName=function(e){switch(e){case ne.Cab:return"Taxi";case ne.InternationalRail:return"European Rail";default:return e}},e.prototype.getBasketStatusIconClass=function(e){return this._basketStatusIconClasses[e]||"ico-exclamation"},e.prototype.getServiceTypeIconClass=function(e){return this._serviceTypeIconClasses[e.service.type]||"ico-exclamation"},e.prototype.getTotalPriceForBasketItems=function(e){return e.reduce((function(e,t){return e+t.price}),0)},e.prototype.getTravellerNamesFromBasketItems=function(e){var t=[];return e.map((function(e){e.users.map((function(e){return t.push(e.forename+" "+e.surname)})),e.guests.map((function(e){return t.push(e.forename+" "+e.surname)}))})),t=C(new Set(t))},e.prototype.allBasketItemsMatchStatus=function(e,t){return e.every((function(e){return e.status===t}))},e.prototype.getHotelAddress=function(e){var t=e.county,r=e.postcode,i=e.streetName,a=e.town,n=[];return i&&n.push(i),a&&n.push(a),t&&n.push(t),r&&n.push(r),n.join(", ")},e.prototype.getHotelLocation=function(e){var t=e.county,r=e.town,i=[];return r&&i.push(r),t&&i.push(t),i.join(", ")},e.prototype.cancelBooking=function(e){return this.cancelBookingUpdater.updateOne({basketItem:e})},e}(),Ri=[{cName:"Afghanistan",dCode:"93",cCode:"AF",tCode:"AFG"},{cName:"Aland Islands",dCode:"358",cCode:"AX",tCode:"ALA"},{cName:"Albania",dCode:"355",cCode:"AL",tCode:"ALB"},{cName:"Algeria",dCode:"213",cCode:"DZ",tCode:"DZA"},{cName:"AmericanSamoa",dCode:"1684",cCode:"AS",tCode:"ASM"},{cName:"Andorra",dCode:"376",cCode:"AD",tCode:"AND"},{cName:"Angola",dCode:"244",cCode:"AO",tCode:"AGO"},{cName:"Anguilla",dCode:"1264",cCode:"AI",tCode:"AIA"},{cName:"Antarctica",dCode:"672",cCode:"AQ",tCode:"ATA"},{cName:"Antigua and Barbuda",dCode:"1268",cCode:"AG",tCode:"ATG"},{cName:"Argentina",dCode:"54",cCode:"AR",tCode:"ARG"},{cName:"Armenia",dCode:"374",cCode:"AM",tCode:"ARM"},{cName:"Aruba",dCode:"297",cCode:"AW",tCode:"ABW"},{cName:"Australia",dCode:"61",cCode:"AU",tCode:"AUS"},{cName:"Austria",dCode:"43",cCode:"AT",tCode:"AUT"},{cName:"Azerbaijan",dCode:"994",cCode:"AZ",tCode:"AZE"},{cName:"Bahamas",dCode:"1242",cCode:"BS",tCode:"BHS"},{cName:"Bahrain",dCode:"973",cCode:"BH",tCode:"BHR"},{cName:"Bangladesh",dCode:"880",cCode:"BD",tCode:"BGD"},{cName:"Barbados",dCode:"1246",cCode:"BB",tCode:"BRB"},{cName:"Belarus",dCode:"375",cCode:"BY",tCode:"BLR"},{cName:"Belgium",dCode:"32",cCode:"BE",tCode:"BEL"},{cName:"Belize",dCode:"501",cCode:"BZ",tCode:"BLZ"},{cName:"Benin",dCode:"229",cCode:"BJ",tCode:"BEN"},{cName:"Bermuda",dCode:"1441",cCode:"BM",tCode:"BMU"},{cName:"Bhutan",dCode:"975",cCode:"BT",tCode:"BTN"},{cName:"Bolivia, Plurinational State of",dCode:"591",cCode:"BO",tCode:"BOL"},{cName:"Bosnia and Herzegovina",dCode:"387",cCode:"BA",tCode:"BIH"},{cName:"Botswana",dCode:"267",cCode:"BW",tCode:"BWA"},{cName:"Brazil",dCode:"55",cCode:"BR",tCode:"BRA"},{cName:"British Indian Ocean Territory",dCode:"246",cCode:"IO",tCode:"IOT"},{cName:"Brunei Darussalam",dCode:"673",cCode:"BN",tCode:"BRN"},{cName:"Bulgaria",dCode:"359",cCode:"BG",tCode:"BGR"},{cName:"Burkina Faso",dCode:"226",cCode:"BF",tCode:"BFA"},{cName:"Burundi",dCode:"257",cCode:"BI",tCode:"BDI"},{cName:"Cambodia",dCode:"855",cCode:"KH",tCode:"KHM"},{cName:"Cameroon",dCode:"237",cCode:"CM",tCode:"CMR"},{cName:"Canada",dCode:"1",cCode:"CA",tCode:"CAN"},{cName:"Cape Verde",dCode:"238",cCode:"CV",tCode:"CPV"},{cName:"Cayman Islands",dCode:" 345",cCode:"KY",tCode:"CYM"},{cName:"Central African Republic",dCode:"236",cCode:"CF",tCode:"CAF"},{cName:"Chad",dCode:"235",cCode:"TD",tCode:"TCD"},{cName:"Chile",dCode:"56",cCode:"CL",tCode:"CHL"},{cName:"China",dCode:"86",cCode:"CN",tCode:"CHN"},{cName:"Christmas Island",dCode:"61",cCode:"CX",tCode:"CXR"},{cName:"Cocos (Keeling) Islands",dCode:"61",cCode:"CC",tCode:"CCK"},{cName:"Colombia",dCode:"57",cCode:"CO",tCode:"COL"},{cName:"Comoros",dCode:"269",cCode:"KM",tCode:"COM"},{cName:"Congo",dCode:"242",cCode:"CG",tCode:"COG"},{cName:"Congo, The Democratic Republic of the Congo",dCode:"243",cCode:"CD",tCode:"COD"},{cName:"Cook Islands",dCode:"682",cCode:"CK",tCode:"COK"},{cName:"Costa Rica",dCode:"506",cCode:"CR",tCode:"CRI"},{cName:"Cote d'Ivoire",dCode:"225",cCode:"CI",tCode:"CIV"},{cName:"Croatia",dCode:"385",cCode:"HR",tCode:"HRV"},{cName:"Cuba",dCode:"53",cCode:"CU",tCode:"CUB"},{cName:"Cyprus",dCode:"357",cCode:"CY",tCode:"CYP"},{cName:"Czech Republic",dCode:"420",cCode:"CZ",tCode:"CZE"},{cName:"Denmark",dCode:"45",cCode:"DK",tCode:"DNK"},{cName:"Djibouti",dCode:"253",cCode:"DJ",tCode:"DJI"},{cName:"Dominica",dCode:"1767",cCode:"DM",tCode:"DMA"},{cName:"Dominican Republic",dCode:"1849",cCode:"DO",tCode:"DOM"},{cName:"Ecuador",dCode:"593",cCode:"EC",tCode:"ECU"},{cName:"Egypt",dCode:"20",cCode:"EG",tCode:"EGY"},{cName:"El Salvador",dCode:"503",cCode:"SV",tCode:"SLV"},{cName:"Equatorial Guinea",dCode:"240",cCode:"GQ",tCode:"GNQ"},{cName:"Eritrea",dCode:"291",cCode:"ER",tCode:"ERI"},{cName:"Estonia",dCode:"372",cCode:"EE",tCode:"EST"},{cName:"Ethiopia",dCode:"251",cCode:"ET",tCode:"ETH"},{cName:"Falkland Islands (Malvinas)",dCode:"500",cCode:"FK",tCode:"FLK"},{cName:"Faroe Islands",dCode:"298",cCode:"FO",tCode:"FRO"},{cName:"Fiji",dCode:"679",cCode:"FJ",tCode:"FJI"},{cName:"Finland",dCode:"358",cCode:"FI",tCode:"FIN"},{cName:"France",dCode:"33",cCode:"FR",tCode:"FRA"},{cName:"French Guiana",dCode:"594",cCode:"GF",tCode:"GUF"},{cName:"French Polynesia",dCode:"689",cCode:"PF",tCode:"PYF"},{cName:"Gabon",dCode:"241",cCode:"GA",tCode:"GAB"},{cName:"Gambia",dCode:"220",cCode:"GM",tCode:"GMB"},{cName:"Georgia",dCode:"995",cCode:"GE",tCode:"GEO"},{cName:"Germany",dCode:"49",cCode:"DE",tCode:"DEU"},{cName:"Ghana",dCode:"233",cCode:"GH",tCode:"GHA"},{cName:"Gibraltar",dCode:"350",cCode:"GI",tCode:"GIB"},{cName:"Greece",dCode:"30",cCode:"GR",tCode:"GRC"},{cName:"Greenland",dCode:"299",cCode:"GL",tCode:"GRL"},{cName:"Grenada",dCode:"1473",cCode:"GD",tCode:"GRD"},{cName:"Guadeloupe",dCode:"590",cCode:"GP",tCode:"GLP"},{cName:"Guam",dCode:"1671",cCode:"GU",tCode:"GUM"},{cName:"Guatemala",dCode:"502",cCode:"GT",tCode:"GTM"},{cName:"Guernsey",dCode:"44",cCode:"GG",tCode:"GGY"},{cName:"Guinea",dCode:"224",cCode:"GN",tCode:"GIN"},{cName:"Guinea-Bissau",dCode:"245",cCode:"GW",tCode:"GNB"},{cName:"Guyana",dCode:"595",cCode:"GY",tCode:"GUY"},{cName:"Haiti",dCode:"509",cCode:"HT",tCode:"HTI"},{cName:"Holy See (Vatican City State)",dCode:"379",cCode:"VA",tCode:"VAT"},{cName:"Honduras",dCode:"504",cCode:"HN",tCode:"HND"},{cName:"Hong Kong",dCode:"852",cCode:"HK",tCode:"HKG"},{cName:"Hungary",dCode:"36",cCode:"HU",tCode:"HUN"},{cName:"Iceland",dCode:"354",cCode:"IS",tCode:"ISL"},{cName:"India",dCode:"91",cCode:"IN",tCode:"IND"},{cName:"Indonesia",dCode:"62",cCode:"ID",tCode:"IDN"},{cName:"Iran, Islamic Republic of Persian Gulf",dCode:"98",cCode:"IR",tCode:"IRN"},{cName:"Iraq",dCode:"964",cCode:"IQ",tCode:"IRQ"},{cName:"Ireland",dCode:"353",cCode:"IE",tCode:"IRL"},{cName:"Isle of Man",dCode:"44",cCode:"IM",tCode:"IMN"},{cName:"Israel",dCode:"972",cCode:"IL",tCode:"ISR"},{cName:"Italy",dCode:"39",cCode:"IT",tCode:"ITA"},{cName:"Jamaica",dCode:"1876",cCode:"JM",tCode:"JAM"},{cName:"Japan",dCode:"81",cCode:"JP",tCode:"JPN"},{cName:"Jersey",dCode:"44",cCode:"JE",tCode:"JEY"},{cName:"Jordan",dCode:"962",cCode:"JO",tCode:"JOR"},{cName:"Kazakhstan",dCode:"77",cCode:"KZ",tCode:"KAZ"},{cName:"Kenya",dCode:"254",cCode:"KE",tCode:"KEN"},{cName:"Kiribati",dCode:"686",cCode:"KI",tCode:"KIR"},{cName:"Korea, Democratic People's Republic of Korea",dCode:"850",cCode:"KP",tCode:"PRK"},{cName:"Korea, Republic of South Korea",dCode:"82",cCode:"KR",tCode:"KOR"},{cName:"Kuwait",dCode:"965",cCode:"KW",tCode:"KWT"},{cName:"Kyrgyzstan",dCode:"996",cCode:"KG",tCode:"KGZ"},{cName:"Laos",dCode:"856",cCode:"LA",tCode:"LAO"},{cName:"Latvia",dCode:"371",cCode:"LV",tCode:"LVA"},{cName:"Lebanon",dCode:"961",cCode:"LB",tCode:"LBN"},{cName:"Lesotho",dCode:"266",cCode:"LS",tCode:"LSO"},{cName:"Liberia",dCode:"231",cCode:"LR",tCode:"LBR"},{cName:"Libyan Arab Jamahiriya",dCode:"218",cCode:"LY",tCode:"LBY"},{cName:"Liechtenstein",dCode:"423",cCode:"LI",tCode:"LIE"},{cName:"Lithuania",dCode:"370",cCode:"LT",tCode:"LTU"},{cName:"Luxembourg",dCode:"352",cCode:"LU",tCode:"LUX"},{cName:"Macao",dCode:"853",cCode:"MO",tCode:"MAC"},{cName:"Macedonia",dCode:"389",cCode:"MK",tCode:"MKD"},{cName:"Madagascar",dCode:"261",cCode:"MG",tCode:"MDG"},{cName:"Malawi",dCode:"265",cCode:"MW",tCode:"MWI"},{cName:"Malaysia",dCode:"60",cCode:"MY",tCode:"MYS"},{cName:"Maldives",dCode:"960",cCode:"MV",tCode:"MDV"},{cName:"Mali",dCode:"223",cCode:"ML",tCode:"MLI"},{cName:"Malta",dCode:"356",cCode:"MT",tCode:"MLT"},{cName:"Marshall Islands",dCode:"692",cCode:"MH",tCode:"MHL"},{cName:"Martinique",dCode:"596",cCode:"MQ",tCode:"MTQ"},{cName:"Mauritania",dCode:"222",cCode:"MR",tCode:"MRT"},{cName:"Mauritius",dCode:"230",cCode:"MU",tCode:"MUS"},{cName:"Mayotte",dCode:"262",cCode:"YT",tCode:"MYT"},{cName:"Mexico",dCode:"52",cCode:"MX",tCode:"MEX"},{cName:"Micronesia, Federated States of Micronesia",dCode:"691",cCode:"FM",tCode:"FSM"},{cName:"Moldova",dCode:"373",cCode:"MD",tCode:"MDA"},{cName:"Monaco",dCode:"377",cCode:"MC",tCode:"MCO"},{cName:"Mongolia",dCode:"976",cCode:"MN",tCode:"MNG"},{cName:"Montenegro",dCode:"382",cCode:"ME",tCode:"MNE"},{cName:"Montserrat",dCode:"1664",cCode:"MS",tCode:"MSR"},{cName:"Morocco",dCode:"212",cCode:"MA",tCode:"MAR"},{cName:"Mozambique",dCode:"258",cCode:"MZ",tCode:"MOZ"},{cName:"Myanmar",dCode:"95",cCode:"MM",tCode:"MMR"},{cName:"Namibia",dCode:"264",cCode:"NA",tCode:"NAM"},{cName:"Nauru",dCode:"674",cCode:"NR",tCode:"NRU"},{cName:"Nepal",dCode:"977",cCode:"NP",tCode:"NPL"},{cName:"Netherlands",dCode:"31",cCode:"NL",tCode:"NLD"},{cName:"Netherlands Antilles",dCode:"599",cCode:"AN",tCode:"ANT"},{cName:"New Caledonia",dCode:"687",cCode:"NC",tCode:"NCL"},{cName:"New Zealand",dCode:"64",cCode:"NZ",tCode:"NZL"},{cName:"Nicaragua",dCode:"505",cCode:"NI",tCode:"NIC"},{cName:"Niger",dCode:"227",cCode:"NE",tCode:"NER"},{cName:"Nigeria",dCode:"234",cCode:"NG",tCode:"NGA"},{cName:"Niue",dCode:"683",cCode:"NU",tCode:"NIU"},{cName:"Norfolk Island",dCode:"672",cCode:"NF",tCode:"NFK"},{cName:"Northern Mariana Islands",dCode:"1670",cCode:"MP",tCode:"MNP"},{cName:"Norway",dCode:"47",cCode:"NO",tCode:"NOR"},{cName:"Oman",dCode:"968",cCode:"OM",tCode:"OMN"},{cName:"Pakistan",dCode:"92",cCode:"PK",tCode:"PAK"},{cName:"Palau",dCode:"680",cCode:"PW",tCode:"PLW"},{cName:"Palestinian Territory, Occupied",dCode:"970",cCode:"PS",tCode:"PSE"},{cName:"Panama",dCode:"507",cCode:"PA",tCode:"PAN"},{cName:"Papua New Guinea",dCode:"675",cCode:"PG",tCode:"PNG"},{cName:"Paraguay",dCode:"595",cCode:"PY",tCode:"PRY"},{cName:"Peru",dCode:"51",cCode:"PE",tCode:"PER"},{cName:"Philippines",dCode:"63",cCode:"PH",tCode:"PHL"},{cName:"Pitcairn",dCode:"872",cCode:"PN",tCode:"PCN"},{cName:"Poland",dCode:"48",cCode:"PL",tCode:"POL"},{cName:"Portugal",dCode:"351",cCode:"PT",tCode:"PRT"},{cName:"Puerto Rico",dCode:"1939",cCode:"PR",tCode:"PRI"},{cName:"Qatar",dCode:"974",cCode:"QA",tCode:"QAT"},{cName:"Romania",dCode:"40",cCode:"RO",tCode:"ROU"},{cName:"Russia",dCode:"7",cCode:"RU",tCode:"RUS"},{cName:"Rwanda",dCode:"250",cCode:"RW",tCode:"RWA"},{cName:"Reunion",dCode:"262",cCode:"RE",tCode:"REU"},{cName:"Saint Barthelemy",dCode:"590",cCode:"BL",tCode:"BLM"},{cName:"Saint Helena, Ascension and Tristan Da Cunha",dCode:"290",cCode:"SH",tCode:"SHN"},{cName:"Saint Kitts and Nevis",dCode:"1869",cCode:"KN",tCode:"KNA"},{cName:"Saint Lucia",dCode:"1758",cCode:"LC",tCode:"LCA"},{cName:"Saint Martin",dCode:"590",cCode:"MF",tCode:"MAF"},{cName:"Saint Pierre and Miquelon",dCode:"508",cCode:"PM",tCode:"SPM"},{cName:"Saint Vincent and the Grenadines",dCode:"1784",cCode:"VC",tCode:"VCT"},{cName:"Samoa",dCode:"685",cCode:"WS",tCode:"WSM"},{cName:"San Marino",dCode:"378",cCode:"SM",tCode:"SMR"},{cName:"Sao Tome and Principe",dCode:"239",cCode:"ST",tCode:"STP"},{cName:"Saudi Arabia",dCode:"966",cCode:"SA",tCode:"SAU"},{cName:"Senegal",dCode:"221",cCode:"SN",tCode:"SEN"},{cName:"Serbia",dCode:"381",cCode:"RS",tCode:"SRB"},{cName:"Seychelles",dCode:"248",cCode:"SC",tCode:"SYC"},{cName:"Sierra Leone",dCode:"232",cCode:"SL",tCode:"SLE"},{cName:"Singapore",dCode:"65",cCode:"SG",tCode:"SGP"},{cName:"Slovakia",dCode:"421",cCode:"SK",tCode:"SVK"},{cName:"Slovenia",dCode:"386",cCode:"SI",tCode:"SVN"},{cName:"Solomon Islands",dCode:"677",cCode:"SB",tCode:"SLB"},{cName:"Somalia",dCode:"252",cCode:"SO",tCode:"SOM"},{cName:"South Africa",dCode:"27",cCode:"ZA",tCode:"ZAF"},{cName:"South Sudan",dCode:"211",cCode:"SS",tCode:"SSD"},{cName:"South Georgia and the South Sandwich Islands",dCode:"500",cCode:"GS",tCode:"SGS"},{cName:"Spain",dCode:"34",cCode:"ES",tCode:"ESP"},{cName:"Sri Lanka",dCode:"94",cCode:"LK",tCode:"LKA"},{cName:"Sudan",dCode:"249",cCode:"SD",tCode:"SSD"},{cName:"SuricName",dCode:"597",cCode:"SR",tCode:"SUR"},{cName:"Svalbard and Jan Mayen",dCode:"47",cCode:"SJ",tCode:"SJM"},{cName:"Swaziland",dCode:"268",cCode:"SZ",tCode:"SWZ"},{cName:"Sweden",dCode:"46",cCode:"SE",tCode:"SWE"},{cName:"Switzerland",dCode:"41",cCode:"CH",tCode:"CHE"},{cName:"Syrian Arab Republic",dCode:"963",cCode:"SY",tCode:"SYR"},{cName:"Taiwan",dCode:"886",cCode:"TW",tCode:"TWN"},{cName:"Tajikistan",dCode:"992",cCode:"TJ",tCode:"TJK"},{cName:"Tanzania, United Republic of Tanzania",dCode:"255",cCode:"TZ",tCode:"TZA"},{cName:"Thailand",dCode:"66",cCode:"TH",tCode:"THA"},{cName:"Timor-Leste",dCode:"670",cCode:"TL",tCode:"TLS"},{cName:"Togo",dCode:"228",cCode:"TG",tCode:"TGO"},{cName:"Tokelau",dCode:"690",cCode:"TK",tCode:"TKL"},{cName:"Tonga",dCode:"676",cCode:"TO",tCode:"TON"},{cName:"Trinidad and Tobago",dCode:"1868",cCode:"TT",tCode:"TTO"},{cName:"Tunisia",dCode:"216",cCode:"TN",tCode:"TUN"},{cName:"Turkey",dCode:"90",cCode:"TR",tCode:"TUR"},{cName:"Turkmenistan",dCode:"993",cCode:"TM",tCode:"TKM"},{cName:"Turks and Caicos Islands",dCode:"1649",cCode:"TC",tCode:"TCA"},{cName:"Tuvalu",dCode:"688",cCode:"TV",tCode:"TUV"},{cName:"Uganda",dCode:"256",cCode:"UG",tCode:"UGA"},{cName:"Ukraine",dCode:"380",cCode:"UA",tCode:"UKR"},{cName:"United Arab Emirates",dCode:"971",cCode:"AE",tCode:"ARE"},{cName:"United Kingdom",dCode:"44",cCode:"GB",tCode:"GBR"},{cName:"United States",dCode:"1",cCode:"US",tCode:"USA"},{cName:"Uruguay",dCode:"598",cCode:"UY",tCode:"URY"},{cName:"Uzbekistan",dCode:"998",cCode:"UZ",tCode:"UZB"},{cName:"Vanuatu",dCode:"678",cCode:"VU",tCode:"VUT"},{cName:"Venezuela, Bolivarian Republic of Venezuela",dCode:"58",cCode:"VE",tCode:"VEN"},{cName:"Vietnam",dCode:"84",cCode:"VN",tCode:"VNM"},{cName:"Virgin Islands, British",dCode:"1284",cCode:"VG",tCode:"VGB"},{cName:"Virgin Islands, U.S.",dCode:"1340",cCode:"VI",tCode:"VIR"},{cName:"Wallis and Futuna",dCode:"681",cCode:"WF",tCode:"WLF"},{cName:"Yemen",dCode:"967",cCode:"YE",tCode:"YEM"},{cName:"Zambia",dCode:"260",cCode:"ZM",tCode:"ZMB"},{cName:"Zimbabwe",dCode:"263",cCode:"ZW",tCode:"ZWE"}],Ii=[{gateway:"ZYA",destination:"Amsterdam (ZYA)"},{gateway:"QDH",destination:"Ashford International (Kent) (QDH)"},{gateway:"ZYR",destination:"Brussels Midi (ZYR)"},{gateway:"XQE",destination:"Ebbsfleet International (Kent) (XQE)"},{gateway:"XDB",destination:"Lille Europe (XDB)"},{gateway:"QQS",destination:"London St Pancras International (QQS)"},{gateway:"XED",destination:"Marne La Vallee (Disneyland) (XED)"},{gateway:"XPG",destination:"Paris Gare du Nord (XPG)"},{gateway:"QRH",destination:"Rotterdam (QRH)"}],Oi=function(r){function i(e,a,n,o,s,u){var c=r.call(this,o,a,s,u)||this;c.fasttrackFetcher=e,c.basketService=n,c.type=ne.FastTrack,c.terminals=new t.BehaviorSubject([]),c._minDate=c.helpers.momentToNgDate(l.default()),c._date=null,c._time=null,c._selectedTerminal="",c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS;var d=o.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};c._originalUserSearch=d.originalUserSearch,c.updateTempParams(s.makeFastTrackQuery(d.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){var t=c.helpers.selectedTravellers(e,ne.FastTrack);c.tempParams.adults=t.adults.length,c.tempParams.children=t.children.length,c.travellers=e,c._isValid()}));var h=o.getSessionItemAsList(c.resultsSessionName)||[];return c._cheapestResultPrice=c.updateLowestPrice(h),c.results.next(h||[]),c}return m(i,r),Object.defineProperty(i.prototype,"minDate",{get:function(){return this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"arrivalDatetime",{get:function(){return this.tempParams.arrivalDatetime},set:function(e){e.isValid()?(this.tempParams.arrivalDatetime=e,this._date=this.helpers.momentToNgDate(e),this._time=this.helpers.formatTimeColon(e)):this.tempParams.arrivalDatetime=null,this._isValid()},enumerable:!1,configurable:!0}),i.prototype._updateDateTime=function(){if(this._date&&this._time){var e=this.helpers.ngDateToMoment(this._date,this._time);this.tempParams.arrivalDatetime=e.isValid()?e:null,this._isValid()}},Object.defineProperty(i.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){var t;this.tempParams.locationCode=e;var r=null===(t=this.terminals)||void 0===t?void 0:t.value;"string"==typeof e?(this._locationCode="",this.terminal=null,this.terminals.next([]),this.selectedTerminal=null,this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this.terminal=null,this.terminals.next(e.terminals),1===r.length&&(this.selectedTerminal=r[0].key),this._isValid()):(this._locationCode=null,this.terminal=null,this.selectedTerminal=null,this.terminals.next([]),this._isValid())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"terminal",{get:function(){return this.tempParams.terminal?this.tempParams.terminal.toString():null},set:function(e){this.tempParams.terminal=e;var t=this.terminals.value.find((function(t,r){if(t.value===e)return!0}));t?this.selectedTerminal=t.key:this.terminals.value&&this.terminals.value.length>0?this.selectedTerminal=this.terminals.value[0].key:this.selectedTerminal="Any Terminal",this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e,this._isValid()},enumerable:!1,configurable:!0}),i.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[],this.locationCode||this.validationMessages.push("Please add in a airport location"),this.tempParams.arrivalDatetime.isAfter(l.default())||this.validationMessages.push("Departure date can not be in the past"),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeFastTrackQuery()),this._isValid()},i.prototype.startSearch=function(){if(this.results.next([]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(i.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.fasttrackFetcher.fetchList(e))}return Promise.resolve(!1)},i.prototype.getSearchQuery=function(){var e={adults:this.tempParams.adults,children:this.tempParams.children?this.tempParams.children:null,locationCode:this._locationCode,arrivalDatetime:this.tempParams.arrivalDatetime};return this.helpers.removeNulls(e)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:ne.FastTrack,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.terminal=e.searchArgs.terminal,this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(r){var i,a,n,o,s,l;r&&(t.locationCode={country:null===(a=null===(i=r.iataMatch)||void 0===i?void 0:i.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(o=null===(n=r.iataMatch)||void 0===n?void 0:n.locationDetails)||void 0===o?void 0:o.countryCode,destination:r.iataMatch.name,gateway:r.iataMatch.iata,postcode:null===(l=null===(s=r.iataMatch)||void 0===s?void 0:s.locationDetails)||void 0===l?void 0:l.postcode,terminals:t.searchService.processTerminals(r.iataMatch.terminals)},t.terminal=e.searchArgs.terminal,t.searchService.startSearches())})),this.searchService.startSearches()},i.prototype.updateSearchFromExpiredBasketItem=function(e){var t=this,r=e.searchQuery;this.arrivalDatetime=l.default(r.arrivalDatetime),this.searchService.getAirportByCode(r.locationCode).subscribe((function(e){var r,i,a,n,o,s;e&&(t.locationCode={country:null===(i=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===i?void 0:i.country,countryCode:null===(n=null===(a=e.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===n?void 0:n.countryCode,destination:e.iataMatch.name,gateway:e.iataMatch.iata,postcode:null===(s=null===(o=e.iataMatch)||void 0===o?void 0:o.locationDetails)||void 0===s?void 0:s.postcode,terminals:t.searchService.processTerminals(e.iataMatch.terminals)})}))},i.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING LOUNGE FORM"),null===(t=e[ne.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[ne.Flight].outBoundDate.toDate();this.date={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.locationCode=this.searchService.searches[ne.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},i.prototype.updateLowestPrice=function(e){if(!e.length)return null;var t=e[0].currency;return e.reduce((function(e,t){var r=t.price;return e.amount>r&&(e.amount=r),e}),{amount:Number.MAX_SAFE_INTEGER,currencyCode:t})},i.prototype.addFastTrackToBasket=function(t,r){var i,a,n,o,s,l,u;return y(this,void 0,void 0,(function(){var c,d,h,p;return b(this,(function(m){switch(m.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return c=m.sent(),d=null==c?void 0:c.subject.value,h=this.getTermsAndCond(t),d?[4,this.basketService.addToBasket({adults:r.adults,children:r.children,basket:d.id,service:t.sourceId.toString(),detail:{arrivalDatetime:r.arrivalDatetime.format(),locationCode:t.code,name:t.name,airportIata:null==r?void 0:r.locationCode,terminal:null===(i=t.terminal)||void 0===i?void 0:i.toString(),termsAndCond:h},requiresReason:t.requiresReason,price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format(),lowestPrice:(null===(a=this.cheapestPrice)||void 0===a?void 0:a.amount)!=t.price||(null===(n=this.cheapestPrice)||void 0===n?void 0:n.currencyCode)!=t.currency?null===(o=this.cheapestPrice)||void 0===o?void 0:o.amount:null,lowestPriceCurrency:(null===(s=this.cheapestPrice)||void 0===s?void 0:s.amount)!=t.price||(null===(l=this.cheapestPrice)||void 0===l?void 0:l.currencyCode)!=t.currency?null===(u=this.cheapestPrice)||void 0===u?void 0:u.currencyCode:null},c,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(p=m.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,p];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.name},{name:"Important Information",value:e.importantInfo},{name:"Extra Information",value:e.extraInfo}]},i.prototype.applyFilters=function(e,t){var r=this.helpers.clone(this.fullResults);r=r.filter((function(t){return t.price>=e.minPrice&&t.price<=e.maxPrice})),r=this.sortResults(t,r),this.results.next(r)},i.prototype.sortResults=function(e,t){var r=this.helpers.clone(t||this.results.value);switch(e){case 0:r=r.sort((function(e,t){return e.price-t.price}));break;case 1:r=r.sort((function(e,t){return t.price-e.price}))}return this.results.next(r),r},i.prototype.getMinPrice=function(e){return e.reduce((function(e,t){return t.price<e&&(e=t.price),e}),Number.MAX_SAFE_INTEGER)},i.prototype.getMaxPrice=function(e){return e.reduce((function(e,t){return t.price>e&&(e=t.price),e}),Number.MIN_SAFE_INTEGER)},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ne.FastTrack,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},i}(c);Oi.STORAGE_SESSION_PARAMS="search_fasttrack",Oi.STORAGE_SESSION_RESULTS="results_fasttrack",function(e){e.None="NONE",e.Fixed="FIXED",e.Flexible="FLEXIBLE"}(vi||(vi={}));var Ei,Bi=function(t){function r(i,a,n,o,s,u){var c=t.call(this,o,a,s,u)||this;c.emailFerryFetcher=i,c.basketService=n,c.type=ne.Ferry,c._ticketTypes=[vi.None,vi.Fixed,vi.Flexible],c.allowOpenReturn=!0,c.searchTypes=[{display:"Return",value:V.ReturnJourney},{display:"One-Way",value:V.SingleJourney}],c._journeytype=V.ReturnJourney,c._ferryTimeCritia=[se.ExactTime,se.DepartAfter,se.ArriveBefore],c.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},c._outbound_date=null,c._outbound_time=null,c._return_date=null,c._return_time=null,c.resultsSessionName=r.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=r.STORAGE_SESSION_RESULTS;var d=o.getSessionItem(r.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};return c._originalUserSearch=d.originalUserSearch,c.updateTempParams(s.makeFerryQuery(d.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(t){c.travellers=t,c.travellers[0]&&!c.travellers[0].ageType&&(c.travellers[0].ageType=e.ages.Adult),c.travellers=t,c._isValid()})),c}return m(r,t),Object.defineProperty(r.prototype,"ticketTypes",{get:function(){return this._ticketTypes},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"journeyType",{get:function(){return this._journeytype},set:function(e){this._journeytype=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ferryTimeCritia",{get:function(){return this._ferryTimeCritia},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fromLocation",{get:function(){return this.tempParams.fromLocation},set:function(e){this.tempParams.fromLocation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"toLocation",{get:function(){return this.tempParams.toLocation},set:function(e){this.tempParams.toLocation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBehalfOfEmail",{get:function(){return this.tempParams.onBehalfOfEmail},set:function(e){this.tempParams.onBehalfOfEmail=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"passengers",{get:function(){return this.tempParams.passengers},set:function(e){this.tempParams.passengers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"departTimeType",{get:function(){return this.tempParams.departTimeType},set:function(e){this.tempParams.departTimeType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"returnTimeType",{get:function(){return this.tempParams.returnTimeType},set:function(e){this.tempParams.returnTimeType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"preferredTicketType",{get:function(){return this.tempParams.preferredTicketType},set:function(e){this.tempParams.preferredTicketType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"carDetails",{get:function(){return this.tempParams.carDetails},set:function(e){this.tempParams.carDetails=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"additionalInfo",{get:function(){return this.tempParams.additionalInfo},set:function(e){this.tempParams.additionalInfo=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"departDateTime",{get:function(){return this.tempParams.departDateTime},set:function(e){this.tempParams.departDateTime=e,e&&e.isValid()&&(this._outbound_date=this.helpers.momentToNgDate(e),this._outbound_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"0700"),this.minInboundDate={year:e.year(),month:e.month()+1,day:e.date()},this.departDateTime&&this.returnDateTime&&this.departDateTime.isAfter(this.returnDateTime)&&(this.returnDateTime=this.returnDateTime.set("date",e.date()).set("month",e.month()).set("year",e.year())),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"returnDateTime",{get:function(){return this.tempParams.returnDateTime},set:function(e){this.tempParams.returnDateTime=e,e&&e.isValid()&&(this._return_date=this.helpers.momentToNgDate(e),this._return_time=l.default(e).format("HHmm")?l.default(e).format("HHmm"):"1600"),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeArray",{get:function(){return this._timeArray=this._timeArray||Array(48).fill(0).map((function(e,t){return{value:Math.floor(t/2).toString().padStart(2,"0")+(t%2*30).toString().padStart(2,"0"),display:Math.floor(t/2).toString().padStart(2,"0")+":"+(t%2*30).toString().padStart(2,"0")}})),this._timeArray},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"outbound_date",{get:function(){return this._outbound_date},set:function(e){this._outbound_date=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"outbound_time",{get:function(){return this._outbound_time},set:function(e){this._outbound_time=e,this._updateOutboundDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"return_date",{get:function(){return this._return_date},set:function(e){this._return_date=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"return_time",{get:function(){return this._return_time},set:function(e){this._return_time=e,this._updateReturnDateTime()},enumerable:!1,configurable:!0}),r.prototype._isValid=function(){var e,t,i,a,n;this.storageService.setSessionItem(r.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var o=l.default();this.fromLocation||this.validationMessages.push("Please Enter a From Location."),this.toLocation||this.validationMessages.push("Please Enter a To Location."),(null===(e=this.carDetails)||void 0===e?void 0:e.make)&&(null===(t=this.carDetails)||void 0===t?void 0:t.model)&&(null===(i=this.carDetails)||void 0===i?void 0:i.reg)||this.validationMessages.push("Please supply all car details."),(null===(a=this.travellers)||void 0===a?void 0:a.length)||this.validationMessages.push("There must be at least 1 traveller"),(null===(n=this.departDateTime)||void 0===n?void 0:n.isBefore(o))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages)},r.prototype.processResults=function(e){return[e]},r.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeFerryQuery()),this._isValid()},r.prototype.startSearch=function(){if(this.results.next([!1]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(r.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch});var e=this.getSearchQuery();return this._startSearch(this.emailFerryFetcher.fetchList(e))}return Promise.resolve(!1)},r.prototype.getSearchQuery=function(){this.travellers&&(this.passengers=this.travellers.map((function(e){var t;if(e.dob){var r=Math.abs((new Date).getTime()-new Date(e.dob).getTime());t=Math.floor(r/864e5/365)}return{name:e.name,age:(null==t?void 0:t.toString())||"Not specified"}})));var e={fromLocation:this.tempParams.fromLocation,toLocation:this.tempParams.toLocation,departDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.departDateTime),returnDateTime:this.helpers.formatGraphQLDateTime(this.tempParams.returnDateTime),onBehalfOfEmail:this.travellers[0].email,passengers:this.passengers,departTimeType:this.tempParams.departTimeType,preferredTicketType:this.tempParams.preferredTicketType,carDetails:this.tempParams.carDetails,additionalInfo:this.tempParams.additionalInfo};return this.helpers.removeNulls(e)},r.prototype.startRecentSearch=function(){},r.prototype.updateLowestPrice=function(){},r.prototype.updateFromPreviousSearches=function(){},r.prototype.updateSearchFromExpiredBasketItem=function(){},r.prototype._updateOutboundDateTime=function(){if(this._outbound_date&&this._outbound_time){var e=this.helpers.ngDateToMoment(this._outbound_date,this._outbound_time);this.departDateTime=e.isValid()?e:null,this._isValid()}},r.prototype._updateReturnDateTime=function(){if(this._return_date&&this._return_time){var e=this.helpers.ngDateToMoment(this._return_date,this._return_time);this.returnDateTime=e.isValid()?e:null,this._isValid()}},r}(c);Bi.STORAGE_SESSION_PARAMS="search_ferry",Bi.STORAGE_SESSION_RESULTS="results_ferry",e.MAX_TRAVELLERS=8,(Ei=e.TravellerSearchTypes||(e.TravellerSearchTypes={})).email="email",Ei.name="name",Ei.employeeNumber="employeeNumber";var Ni=function(){function i(r,a,n,o,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P,F,k,_,R,I,O,E,B,N,M,L,w,j,U,H,x,G,V,W,Q,J,Y,K,q,X,Z,z,$,ee,te,re,ie,ae,oe,se,le,ue,ce,de,he,pe,me,fe,ve){var ye,be=this;this.searchAirportsFetcher=r,this.searchAirlinesFetcher=a,this.storageService=n,this.userService=o,this.modalService=l,this.router=u,this.helpers=c,this.hotelAvalibilityService=d,this.citiesFetcher=h,this.confermaCitiesFetcher=p,this.postcodeFetcher=m,this.railStationFetcher=f,this.saveUserAddressUpdater=v,this.userAddressesFetcher=y,this.basketService=b,this.getUserCompanyOfficesFetcher=g,this.searchHotelChainsFetcher=S,this.getConfermaRoomImagesFetcher=C,this.baseValidateIsPostcodeValidTester=A,this.depotFetcher=T,this.confermaOfficeNamesFetcher=D,this.confermaOfficeFetcher=P,this.baseDeleteUserAddressUpdater=F,this.baseDeleteRecentSearchUpdater=k,this.baseSaveRecentSearchUpdater=_,this.getUserCurrentCarbonAllowanceFetcher=R,this.baseSaveFavouriteSearchUpdater=I,this.getRailStationFetcher=G,this.getIrlSupplierStationFetcher=V,this.webTokenService=W,this.riskAlertsFetcher=Q,this.getUserRecentSearchesFetcher=Y,this.getRailCardsFetcher=K,this.getCovidMicrositeTokenFetcher=q,this.searchUsersCanBookForFetcher=Z,this.searchIrlStationsFetcher=z,this.irlDiscountCardsFetcher=$,this.getFlightFareRulesFetcher=ee,this.getFlightSeatMapFetcher=te,this.getRailLiveDeparturesFetcher=re,this.getUserFavouriteSearchesFetcher=oe,this.deleteFavouriteSearchUpdater=se,this.emailBasketFetcher=le,this.sendOfflineNotificationFetcher=ce,this.getHotelChainsFetcher=de,this.getRailProvidersFetcher=he,this.getAllAirlinesFetcher=pe,this.getCarHireProvidersFetcher=me,this.baseGenerateBasketPdfFetcher=fe,this.emailFerryFetcher=ve,this.traveller_error=!1,this.travellerInformation=new t.BehaviorSubject([]),this.errors=new t.BehaviorSubject([]),this.searchLoadingDone=new t.BehaviorSubject(!1),this.searchTimedOut=new t.BehaviorSubject(!1),this.newSearchStarted=new t.BehaviorSubject(!1),this.firstLoad=!0,this.highest_search_priority=8,this.show_errors=!1,this.travellerValidationMessages=[],this.search_loading=!1,this.search_airport_loading=!1,this.allSubscription=new t.Subscription,this.searchesSubscription=new t.Subscription,this.selectedTravellers=[],this.selectedPlaces=[],this.countries=Ri,this.eurostations=s.default.toArray(Ii),this._ermTravellerType=e.ErmTravellerType.None,console.log("Enterpise search service being inited"),console.log("Newly created search objects: ",this.searches),this.search_objects={},this.searches=((ye={})[ne.Cab]=null,ye[ne.Car]=null,ye[ne.Coach]=null,ye[ne.Eurostar]=null,ye[ne.FastTrack]=null,ye[ne.Ferry]=null,ye[ne.Flight]=null,ye[ne.Hotel]=null,ye[ne.InternationalRail]=null,ye[ne.Lounge]=null,ye[ne.Parking]=null,ye[ne.Rail]=null,ye),this.selectedTravellers=this.storageService.getSessionItemAsList(i.SESSION_TRAVELLER),this.travellerInformation.next(this.selectedTravellers),o.fullUserDetails.userServices.subscribe((function(e){e&&(be.createSearchObjects(E,c,b,n,o,B,M,ae,l,L,O,d,N,J,G,ie,w,j,U,x,$,V,ue,ve,H,X),be.search_objects=be._searchObjectsDefault=Object.keys(be.search_objects).reduce((function(t,r){return t[r].enabled=!!e&&!!e[r],e&&e[r]||(t[r].chosen=!1,t[r].originalChosen=!1),t}),be.search_objects)),be.determineHighestSearchPriority()})),Array.isArray(this.countries)&&(this.countries=this.countries.sort((function(e,t){return e.cName<t.cName?-1:e.cName>t.cName?1:0}))),W.autoLogoutConfig=this.getAutoLogoutConfig()}return Object.defineProperty(i.prototype,"ermTravellerType",{get:function(){return this._ermTravellerType},set:function(t){this._ermTravellerType=t,this.ermTravellerType===e.ErmTravellerType.Joiner||this.ermTravellerType===e.ErmTravellerType.Leaver?this.storageService.setSessionItem("search_ERM_traveller_type",this.ermTravellerType):this.storageService.removeSessionItem("search_ERM_traveller_type")},enumerable:!1,configurable:!0}),i.prototype.createSearchObjects=function(e,t,r,i,a,n,o,s,l,u,c,d,h,p,m,f,v,y,b,g,S,C,A,T,D,P){var F;this.search_objects&&0!==Object.values(this.search_objects).length||(this.search_objects=this.helpers.clone(this.init_search_objects()),this.searches=((F={})[ne.Lounge]=new Pt(e,t,r,i,this,a),F[ne.Parking]=new Rt(n,t,r,i,this,a),F[ne.Flight]=new St(o,t,a,r,i,this,s,l),F[ne.Hotel]=new Dt(u,t,a,c,d,r,i,this,h,p,m,f),F[ne.Car]=new it(v,y,t,r,i,this,a),F[ne.Cab]=new rt(b,t,i,this,r,a),F[ne.InternationalRail]=new Vt(g,S,t,r,i,this,C,a),F[ne.FastTrack]=new Oi(A,t,r,i,this,a),F[ne.Coach]=null,F[ne.Ferry]=new Bi(T,t,r,i,this,a),F[ne.Rail]=new Ut(D,m,t,r,i,this,a,l),F[ne.Eurostar]=new Bt(P,t,a,r,i,this,l,s),F))},i.prototype.ngOnDestroy=function(){this.allSubscription&&this.allSubscription.unsubscribe()},i.prototype.reset=function(){this.resetAllSearchItems(),this.basketService.reset()},i.prototype.resetAllSearchItems=function(){Object.values(this.searches).forEach((function(e){null==e||e.reset()})),this.removeAllTravellers(),this.resetTravellerType(),this.resetSearchObjects()},i.prototype.resetTravellerType=function(){this.storageService.removeSessionItem("search_ERM_traveller_type"),this.ermTravellerType=e.ErmTravellerType.None},i.prototype.getUserCurrentCarbonAllowance=function(e,t){t&&t.next(!0);var i={user:e};return this.getUserCurrentCarbonAllowanceFetcher.fetchList(i).pipe(r.take(1),r.map((function(e){return e})))},i.prototype.getRiskAlerts=function(e,t,i,a){a&&a.next(!0);var n={minLevel:e,maxLevel:t,countryIsoCode:i};return this.riskAlertsFetcher.fetchList(n).pipe(r.take(1),r.map((function(e){return a&&a.next(!1),e})))},i.prototype.getAirportsList=function(e,i,a,n,o,s,l){var u=this;if(e.length>2){a&&a.next(!0);var c={query:e};return i&&(c.countryCode=i),"boolean"==typeof n&&(c.hasLounge=n),"boolean"==typeof o&&(c.hasParking=o),"boolean"==typeof s&&(c.hasFastTrack=s),this.searchAirportsFetcher.fetchOne(c).pipe(r.take(1),r.map((function(e){if(a&&a.next(!1),e&&e.generalMatches){var t=u.helpers.clone(e.generalMatches);return l&&(t=t.filter((function(e){return e.icao}))),t.map((function(e){var t,r,i;return{destination:e.name,gateway:e.iata,terminals:u.processTerminals(e.terminals),country:null===(t=null==e?void 0:e.locationDetails)||void 0===t?void 0:t.country,postcode:null===(r=null==e?void 0:e.locationDetails)||void 0===r?void 0:r.postcode,countryCode:null===(i=null==e?void 0:e.locationDetails)||void 0===i?void 0:i.countryCode}}))}})))}return t.of([])},i.prototype.getAirlinesList=function(e,i){var a=this;if(e.length>=2){i&&i.next(!0);var n={query:e};return this.searchAirlinesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(e){if(i&&i.next(!1),e&&e.generalMatches)return a.helpers.clone(e.generalMatches).map((function(e){return{code:e.iata,name:e.name}}))})))}return t.of([])},i.prototype.getAirportLocations=function(t,i,a,n,o,s,l){return this.getAirportsList(t,i,a,n,o,s,l).pipe(r.map((function(t){return t.map((function(t){return{name:t.destination,type:e.LocationTypes.Airport,airport:t}}))})))},i.prototype.getCityLocations=function(e,t,r,i){if(!(e.length<=2))return i?this.getConfermaCityLocations(e,t,r):this._getCityLocations(e,t,r)},i.prototype._getCityLocations=function(t,i,a){null==a||a.next(!0);var n={query:t};i&&(n.countryCode=i);return this.citiesFetcher.fetchList(n).pipe(r.take(1),r.map((function(t){var r=t.map((function(t){return{name:t.name,longitude:t.coordinates.longitude,latitude:t.coordinates.latitude,type:e.LocationTypes.City,countryCode:t.countryCode,id:t.id}}));return null==a||a.next(!1),r})))},i.prototype.getConfermaCityLocations=function(t,i,a){null==a||a.next(!0);var n={cityName:t};i&&(n.countryCode=i);return this.confermaCitiesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(t){return null==a||a.next(!1),(null==t?void 0:t.suggestions)?t.suggestions.map((function(t){return{name:t.name,longitude:t.longitude,latitude:t.latitude,type:e.LocationTypes.City,countryCode:i||("false"!=t.countryCode&&"true"!=t.countryCode?t.countryCode:null)}})):[]})))},i.prototype.getCarHireDepots=function(e,t,r,i){null==i||i.next(!0);var a={latitude:e,longitude:t};return r&&(a.radius=r),this.depotFetcher.fetchList(a)},i.prototype.getPostcodeList=function(i){return pi.UK_POSTCODE.test(i)?this.postcodeFetcher.fetchList({postcode:i}).pipe(r.map((function(t){return t.map((function(t){return{name:t.postcode,type:e.LocationTypes.Postcode,latitude:t.latitude,longitude:t.longitude}}))}))):t.of([])},i.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},i.prototype.getSelectedPlaceById=function(e){return this.selectedPlaces.find((function(t){return t.place_id===e}))},i.prototype.getConfirmaOffices=function(i){if((null==i?void 0:i.length)>2){return this.confermaOfficeNamesFetcher.fetchList().pipe(r.take(1),r.map((function(t){return(null==t?void 0:t.results)?t.results.map((function(t){return{name:t.name,type:e.LocationTypes.Office,id:t.id}})):[]})))}return t.of([])},i.prototype.getOfficeLocations=function(i){if(i.length>2){return this.getUserCompanyOfficesFetcher.fetchList().pipe(r.take(1),r.map((function(t){return t.map((function(t){return{name:t.name,office:t.addresses[0],type:e.LocationTypes.Office}}))})))}return t.of([])},i.prototype.getStationLocations=function(i,a,n){return void 0===n&&(n=!1),i.length>2?(null==a||a.next(!0),this.railStationFetcher.fetchList({query:i,hasTod:n}).pipe(r.take(1),r.map((function(t){return a&&a.next(!1),t?t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name,railstation:t}})):[]})))):t.of([])},i.prototype.getRailStationById=function(e){return e?this.getRailStationFetcher.fetchList({id:e}).pipe(r.take(1)):t.of()},i.prototype.searchIrlStationsLocations=function(i,a){return i.length>2?(null==a||a.next(!0),this.searchIrlStationsFetcher.fetchList({query:i}).pipe(r.take(1),r.map((function(t){return a&&a.next(!1),t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name+" ("+t.supplier+")",railstation:t}}))})))):t.of([])},i.prototype.getHotelLocationsList=function(i,a,n){return i.length>2?pi.UK_POSTCODE.test(i)?this.getPostcodeList(i):((null==n?void 0:n.value)||n.next(!0),t.forkJoin([this.getAirportLocations(i,a,n),this.getCityLocations(i,a,n,this.userService.userHasServiceProvider(ne.Hotel,e.ServiceProvider.Confirma)),this.getStationLocations(i,n),this.getConfirmaOffices(i)]).pipe(r.map((function(e){return(null==n?void 0:n.value)&&n.next(!1),e.reduce((function(e,t){return e.push.apply(e,C(t)),e}),[])})))):t.of([])},i.prototype.getStationsAndAirportsList=function(e,i,a){return e.length>2?((null==a?void 0:a.value)||a.next(!0),t.forkJoin([this.getAirportLocations(e,i,a),this.getStationLocations(e,a)]).pipe(r.map((function(e){return(null==a?void 0:a.value)&&a.next(!1),e.reduce((function(e,t){return e.push.apply(e,C(t)),e}),[])})))):t.of([])},i.prototype.removeTraveller=function(e){this._removeTraveller(e),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},i.prototype._removeTraveller=function(e){this.userService.bobo&&this.userService.bobo.id===e.id||(this.selectedTravellers=this.selectedTravellers.filter((function(t){return!Gt.equals(t,e)})))},i.prototype.removeAllTravellers=function(){var e=this;console.log("remove all travellers called!"),console.log(this.selectedTravellers),this.selectedTravellers||(this.selectedTravellers=[]),this.selectedTravellers.forEach((function(t){e._removeTraveller(t)})),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},i.prototype.addTraveller=function(e){this.travellerAlreadyAdded(e)||this.currentNoOfTravellersGreaterOrEqualToMax()||(this.selectedTravellers.push(e),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation())},i.prototype.currentNoOfTravellersGreaterOrEqualToMax=function(){return this.selectedTravellers.length>=this.maxTravellers()},i.prototype.maxTravellers=function(){var t=this.userService.getUserFavoriteObject(dt.AllowSameTravellesrPerBasket);return(null==t?void 0:t.value)&&(e.MAX_TRAVELLERS=+t.value),this.canUseTravellerProfile()?1:e.MAX_TRAVELLERS},i.prototype.travellerAlreadyAdded=function(e){return!!this.selectedTravellers.find((function(t){return Gt.equals(t,e)}))},i.prototype.canUseTravellerProfile=function(){return!1},i.prototype.getCurrentNoOfTravellers=function(){return this.selectedTravellers.length},i.prototype.updateTravellerInformation=function(){this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.selectedTravellers),this.travellerInformation.next(C(this.selectedTravellers)),this.searches[ne.Rail]&&(this.searches[ne.Rail].railCards=new Array(this.selectedTravellers.length).fill({name:"",code:""},0,this.selectedTravellers.length))},i.prototype.determineHighestSearchPriority=function(){return this.highest_search_priority=this._getHighestSearchPriorityObject().highest},i.prototype.getHighestSearchPriorityObject=function(e){return this._getHighestSearchPriorityObject(e).currentItem},i.prototype._getHighestSearchPriorityObject=function(e){return void 0===e&&(e={}),Object.values(this.search_objects).reduce((function(t,r){var i=t.highest,a=t.currentItem;if(r.chosen&&r.priority<i){if(!e[r.type])return{highest:r.priority,currentItem:r};r.chosen=!1}return{highest:i,currentItem:a}}),{highest:Number.MAX_SAFE_INTEGER,currentItem:null})},i.prototype.getSelectedOptions=function(){var e=this;return Object.keys(this.search_objects).reduce((function(t,r){var i;return(null===(i=e.search_objects[r])||void 0===i?void 0:i.chosen)&&t.push(r),t}),[])},i.prototype.hasSimpleGuests=function(){return!1},i.prototype.setGetMeThereSearchObjects=function(){console.log("+++ Setting GetMeThere Search Objects +++"),this.search_objects=this.helpers.clone(this.getMeThereSearchObjects())},i.prototype.resetSearchParams=function(){console.log("Reseting Search Params!"),this.search_objects=this.helpers.clone(this.init_search_objects()),this.storageService.setSessionItem(i.SESSION_TRAVELLER,this.search_objects),Object.values(this.searches).forEach((function(e){null==e||e.reset()}))},i.prototype.canSearch=function(e){var t,r;return this.determineHighestSearchPriority(),!!(this.search_objects[e]&&(console.log("can search here"),(null===(t=this.search_objects[e])||void 0===t?void 0:t.chosen)&&this.hasHighestSearchPriority(null===(r=this.search_objects[e])||void 0===r?void 0:r.priority)))&&(console.log(e+" can be searched"),!0)},i.prototype.hasHighestSearchPriority=function(e){return this.determineHighestSearchPriority(),e<=this.highest_search_priority},i.prototype.getAllErrorMessages=function(){var e=this,t=Object.entries(this.search_objects).reduce((function(t,r){var i=S(r,2),a=i[0],n=i[1];return(null==n?void 0:n.chosen)&&e.canSearch(a)&&t.push.apply(t,C(e.searches[a].validationMessages)),t}),this.travellerValidationMessages);return this.errors.next(t),t},i.prototype.travellersContainUser=function(){var e=this;return!!this.selectedTravellers.find((function(t){return t.id===e.userService.getUserId().toString()}))},i.prototype.validateTravellers=function(){switch(this.travellerValidationMessages=[],this.userService.fullUserDetails.userData.value.booker_type){case k.SelfBook:1===this.selectedTravellers.length&&this.travellersContainUser()||this.travellerValidationMessages.push("Current user must be a traveller");break;case k.BookerWithSelf:(this.selectedTravellers.length<1||!this.travellersContainUser())&&(this.travellerValidationMessages.push("Please add your self."),this.traveller_error=!0);break;case k.Booker:case k.Company:case k.CompanyGroup:case k.Office:case k.Tmc:case k.Root:this.selectedTravellers.length>=1||(this.travellerValidationMessages.push("Please select at least one traveller"),this.traveller_error=!0);break;default:return this.travellerValidationMessages.push("Unrecognised user type! - Please contact support."),!1}return 0===this.travellerValidationMessages.length},i.prototype.findPaxInTravellers=function(e){return this.selectedTravellers.find((function(t){return e===t.email}))},i.prototype.validateForms=function(){var e=this._findSearchObtect();return this.getAllErrorMessages(),!!e&&(this.errors.next(this.searches[e.type].messages.value),this.validateTravellers()&&this.searches[e.type].isValid.value)},i.prototype._findSearchObtect=function(){var e=this;return Object.values(this.search_objects).find((function(t){return!!t&&t.priority===e.highest_search_priority&&t.chosen}))},i.prototype.startSearches=function(e){var t,r=this;this.newSearchStarted.next(!0),this.search_loading=!0,(t=this._findSearchObtect())&&(t.chosen=!0),this.storageService.getSessionItem("search_ERM_traveller_type")&&(this.ermTravellerType=this.storageService.getSessionItem("search_ERM_traveller_type")),t&&!this.router.url.includes(t.resultUrl)&&this.router.navigate([t.resultUrl]);try{Promise.all(Object.values(this.searches).map((function(e){var t,i,a;return e&&r.search_objects[e.type]&&((null===(t=r.search_objects[e.type])||void 0===t?void 0:t.chosen)||e.type===ne.Rail&&(null===(i=r.searches[ne.Flight])||void 0===i?void 0:i.railFromFlightSearchPerformed)||e.type===ne.Eurostar&&(null===(a=r.searches[ne.Flight])||void 0===a?void 0:a.eurostarFromFlightSearchPerformed))?e.startSearch():Promise.resolve(!1)}))).finally((function(){var i;r.search_loading=!1,r.searchLoadingDone.next(!0),e?(r.router.navigate([e]),r.searches.INTERNATIONAL_RAIL&&r.submitIrlForm()):(null===(i=r.search_objects[ne.Ferry])||void 0===i?void 0:i.chosen)&&(r.router.navigate([t.searchUrl]),r.searches[ne.Ferry].reset(),r.modalService.open(d.OfflineRequestDialogComponent,{centered:!0,size:"md"}))}))}catch(e){console.error(e),this.search_loading=!1,this.searchLoadingDone.next(!0)}},i.prototype.getTaxiStationLocations=function(e,r){return e.length<3?t.of([]):t.of([{destination:"Manchester Airpot",isairport:!0,supplier_code:"MAN",address:"Manchester Airport",postcode:"M90 1QX"},{destination:"Manchester Piccadilly",isairport:!1,supplier_code:"MMAN",address:"Manchester Piccadilly",postcode:"M1 2PZ"},{destination:"London Heathrow",isairport:!0,supplier_code:"LHR",address:"London Heathrow Airport",postcode:"TW6 1EW"}])},i.prototype.getAddresses=function(e){return t.of([{House:"Cecil Court",Street:"28-36 Cecil Road",Town:"Hale",PostCode:"WA15 9PB",Country:"UK"}])},i.prototype.getUserAddresses=function(e){return this.userAddressesFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{ID:e.id,House:e.numberOrName,Street:e.street,Town:e.town,PostCode:e.postcode,Country:e.countryCode}}))})))},i.prototype.deleteUserAddressByID=function(e){return this.baseDeleteUserAddressUpdater.updateOne({id:e})},i.prototype.getHotelChain=function(e,i){if(e.length>2){null==i||i.next(!0);return this.searchHotelChainsFetcher.fetchList({query:e}).pipe(r.take(1),r.map((function(e){var t=e.map((function(e){return{name:e}}));return null==i||i.next(!1),t})))}return t.of([])},i.prototype.getOfficeNames=function(e){return this.confermaOfficeNamesFetcher.fetchList().pipe(r.take(1),r.map((function(e){var t;if(e)return null===(t=null==e?void 0:e.results)||void 0===t?void 0:t.map((function(e){return{id:e.id,name:e.name}}))})))},i.prototype.getOffice=function(e){return e?this.confermaOfficeFetcher.fetchOne({officeId:e}).pipe(r.take(1),r.map((function(e){if(e)return e.results}))):t.of()},i.prototype.getAllHotelChains=function(){return this.getHotelChainsFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},i.prototype.getAllRailProviders=function(){return this.getRailProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},i.prototype.getCarHireProivders=function(){return this.getCarHireProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},i.prototype.getAllAirlines=function(){return this.getAllAirlinesFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return e}))})))},i.prototype.getRailCards=function(){return this.getRailCardsFetcher.fetchList().pipe(r.take(1),r.map((function(e){if(e)return e.map((function(e){return{name:e.name,code:e.code}})).sort((function(e,t){return e.name.localeCompare(t.name)}))})))},i.prototype.getAirportByCode=function(e){return e?this.searchAirportsFetcher.fetchOne({query:e}).pipe(r.take(1),r.map((function(e){return e}))):t.of()},i.prototype.init_search_objects=function(){return{}},i.prototype.getMeThereSearchObjects=function(){return{}},i.prototype.getSelectedtravellers=function(){return this.selectedTravellers},i.prototype.resetSearchObjects=function(){this.search_objects=this._searchObjectsDefault},i.prototype.processTerminals=function(e){var t=[];return e.includes("1")||e.includes("2")||e.includes("3")||e.includes("4")||e.includes("5")?(t.push({key:"Any Terminal",value:"Any"}),e.forEach((function(e){t.push({key:"Terminal "+e,value:""+e})}))):1===e.length?t.push({key:e[0]+" Terminal",value:"Any"}):(t.push({key:"Any Terminal",value:"Any"}),e.forEach((function(e){t.push({key:e+" Terminal",value:""+e})}))),t},i.prototype.saveUserAddress=function(e){return y(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return e?[4,this.saveUserAddressUpdater.updateOne(e).toPromise()]:[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},i.prototype.canBook=function(e){return!!this.userService.canBook(e)},i.prototype.isPostcodeVaild=function(e){return this.baseValidateIsPostcodeValidTester.test({postcode:e})},i.prototype.makeCabHireQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i={adults:0,airport:null,children:0,countryCode:null,departs:this.helpers.makeMomentDayTime(),fromAddress:null,fromStation:null,fromLocationType:e.TaxiFormMode.ADDRESS,infants:0,toAddress:null,toStation:null,toLocationType:e.TaxiFormMode.ADDRESS,vehicleType:_.Any,viasFrom:null,viasTo:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],t)),["departs"])},i.prototype.makeCarHireQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={adults:0,airCon:null,carClass:null,carType:null,children:0,chosenVendor:null,chosenDistance:"5",cityDropoff:null,cityDropoffDepot:null,cityPickup:null,cityPickupDepot:null,dropoff_country:"GB",dropoff_datetime:null,dropoff_location:null,estimatedMileage:null,locationType:null,pickup_country:null,pickup_datetime:null,pickup_location:null,postcodeDropoff:null,postcodeDropoffRaw:null,postcodePickup:null,postcodePickupRaw:null,return_to_pickup:!0,transmission:null};return this.helpers.sanatizeReturns(r,Object.assign.apply(Object,C([{}],e)),["pickup_datetime","dropoff_datetime"])},i.prototype.makeFlightQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.helpers.makeMomentDayTime(),a=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(i,30),o=this.helpers.momentRoundMinutes(a,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:null,departLocation:null,fareType:U.Flexible,inboundDate:n,inTimeCriteria:e.TimeWindow.Depart,maxConnections:null,includeNearbyAirports:!1,multiDestination:[],outBoundDate:o,outTimeCriteria:e.TimeWindow.Depart,preferredCarriers:[null,null,null,null],returnCabinClass:H.Any};return this.helpers.sanatizeReturns(s,Object.assign.apply(Object,C([{}],t)),["outBoundDate","inboundDate"])},i.prototype.makeHotelQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i={checkin_date:l.default().set("hour",23).set("minute",59),checkout_date:l.default().add(1,"day").set("hour",23).set("minute",59),country:{cCode:"GB",cName:"United Kingdom"},currency:"GBP",distance:5,hotel_availability:null,hotel_chain:null,hotel_name:null,location_type_select:e.LocationTypes.Airport,location:null,no_of_occupants:1,no_of_rooms:1,office:null,postcode:null,prefered_hotels_only:!1,trainsStation:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],t)),["checkin_date","checkout_date"])},i.prototype.makeLoungesQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={adults:0,arrivalDatetime:l.default(),children:0,infants:0,locationCode:null,terminal:null};return this.helpers.sanatizeReturns(r,Object.assign.apply(Object,C([{}],e)),["arrivalDatetime"])},i.prototype.makeParkingQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.makeMomentDayTime(),i=this.helpers.makeMomentDayTime(1),a=this.helpers.momentRoundMinutes(r,30),n=this.helpers.momentRoundMinutes(i,30),o={arrivalDatetime:a,carParkedForYou:null,departDatetime:n,locationCode:null,meetAndGreet:null,onAirport:null,outFlightNumber:null,parkAndRide:null,parkAndStroll:null,recommended:null,terminal:null};return this.helpers.sanatizeReturns(o,Object.assign.apply(Object,C([{}],e)),["arrivalDatetime","departDatetime"])},i.prototype.makeRailQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.helpers.momentRoundMinutes(l.default(),30),a={airportExpressStation:null,applyRailcards:!1,carnetTicket:!1,chosenSearchClass:ee.All,chosenSearchType:te.ReturnJourney,disableAutoDiscounts:!1,extraTime:!1,inBoundDateTime:i,isAirportExpress:!1,noOfAdults:0,noOfChildren:0,outboundCriteria:e.RailSearchCriteria.Depart,outBoundDateTime:i,prioritiseByPrice:!1,returnCriteria:e.RailSearchCriteria.Depart,travellingFrom:null,travellingTo:null,via:!1,viaLocation:null,railCards:[],transactionIdentifier:null};return this.helpers.sanatizeReturns(a,Object.assign.apply(Object,C([{}],t)),["inBoundDateTime","outBoundDateTime"])},i.prototype.makeIrlQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.momentRoundMinutes(l.default(),30),i={supplier:null,countryCode:"",journeyType:V.ReturnJourney,class:null,outboundDepartureDateTime:r,travellingFrom:null,travellingTo:null,adults:0,children:0,returnDepartureDateTime:r,irlDiscountCards:null,offlineRequest:!1};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],e)),["returnDepartureDateTime","outboundDepartureDateTime"])},i.prototype.makeEurostarQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.helpers.makeMomentDayTime(),a=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(i,30),o=this.helpers.momentRoundMinutes(a,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:e.EurostarSearchType.return,departLocation:null,fareType:U.Flexible,inboundDate:n,inTimeCriteria:e.TimeWindow.Depart,maxConnections:null,includeNearbyAirports:!1,multiDestination:[],outBoundDate:o,outTimeCriteria:e.TimeWindow.Depart,preferredCarriers:[null,null,null,null],returnCabinClass:H.Any};return this.helpers.sanatizeReturns(s,Object.assign.apply(Object,C([{}],t)),["outBoundDate","inboundDate"])},i.prototype.makeFastTrackQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={adults:0,arrivalDatetime:l.default(),children:0,locationCode:null};return this.helpers.sanatizeReturns(r,Object.assign.apply(Object,C([{}],e)),["arrivalDatetime"])},i.prototype.makeFerryQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.momentRoundMinutes(l.default(),30),i={fromLocation:null,toLocation:"",departDateTime:r,onBehalfOfEmail:null,departTimeType:se.DepartAfter,returnTimeType:se.DepartAfter,passengers:[],carDetails:{make:"",model:"",reg:""},preferredTicketType:oe.Fixed,returnDateTime:r,additionalInfo:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,C([{}],e)),["departDateTime","returnDateTime"])},i.prototype.shouldAddTravellerSubscription=function(){return!1},i.prototype.getAutoLogoutConfig=function(){return{}},i.prototype.shouldFetchAllOffices=function(){return!1},i.prototype.isFlightsGrouped=function(){return!1},i.prototype.getCountryFullNameFromCountryCode=function(e){for(var t=0;t<this.countries.length;t++){var r=this.countries[t];if(r.cCode===e)return r.cName}return"Unknown"},i.prototype.getUserRecentSearches=function(e,t){null==t||t.next(!0);var i={serviceType:e};return this.getUserRecentSearchesFetcher.fetchList(i).pipe(r.take(1),r.map((function(e){var r=e.map((function(e){return{id:e.id,name:e.name,serviceType:e.serviceType,searchArgs:e.searchArgs,createdAt:e.createdAt,updatedAt:e.updatedAt,travelDate:e.travelDate,travellers:e.travellers}}));return null==t||t.next(!1),r})))},i.prototype.getUserFavouriteSearches=function(e,t){null==t||t.next(!0);var i={serviceType:e};return this.getUserFavouriteSearchesFetcher.fetchList(i).pipe(r.take(1),r.tap((function(e){null==t||t.next(!1)})))},i.prototype.deleteRecentSearchByID=function(e){return this.baseDeleteRecentSearchUpdater.updateOne({id:e})},i.prototype.deleteFavouriteSearchByID=function(e){return this.deleteFavouriteSearchUpdater.updateOne({id:e})},i.prototype.saveRecentSearch=function(e){e&&!this.selectedTravellers.find((function(e){return e.guest}))&&this.baseSaveRecentSearchUpdater.updateOne(e).pipe(r.take(1)).subscribe()},i.prototype.getCovidMicrositeToken=function(){return this.getCovidMicrositeTokenFetcher.fetchList()},i.prototype.lookupEurostarStations=function(e){return console.log("term| ",e),""===e?t.of(this.eurostations):t.of(this.eurostations.filter((function(t){return t.destination.toLowerCase().indexOf(e.toLowerCase())>-1})))},i.prototype.searchTravellers=function(t,i){var a=this,n=this.userService.getUserBookingType();if(this.traveller_error=!1,n&&n!==k.SelfBook&&n!==k.Traveller&&t.length>=1){var o=t.toLowerCase().match(/([\w])+/g),s={};switch(i){case e.TravellerSearchTypes.name:s.userName=o.length>1?o[0]:t;break;case e.TravellerSearchTypes.email:s.email=t;break;case e.TravellerSearchTypes.employeeNumber:s.employeeId=t}return this.searchUsersCanBookForFetcher.fetchList(s).pipe(r.map((function(e){return e?a.helpers.clone(e).sort((function(e,t){return e.surname<t.surname?-1:e.surname>t.surname?1:0})):[]})))}},i.prototype.getFlightFareRules=function(e){return this.getFlightFareRulesFetcher.fetchList({flight:e})},i.prototype.getRailLiveDepartures=function(e,t){return this.getRailLiveDeparturesFetcher.fetchList({stationCode:e,departDateTime:t})},i.prototype.getFlightSeatMap=function(e){return this.getFlightSeatMapFetcher.fetchList({flight:e}).pipe(r.map((function(e){if(e)return e.results})))},i.prototype.saveFavouriteSearch=function(e){return this.baseSaveFavouriteSearchUpdater.updateOne(e)},i.prototype.getConfermaRoomImages=function(e){if(e)return this.getConfermaRoomImagesFetcher.fetchList({hotelId:e}).pipe(r.take(1))},i.prototype.emailBasket=function(e){return this.emailBasketFetcher.fetchList({id:e})},i.prototype.generateBasketPdf=function(e){return this.baseGenerateBasketPdfFetcher.fetchList({id:e})},i.prototype.submitIrlForm=function(){var e,t=this,r=this.userService.getUserEmail(),i=this.searches[ne.InternationalRail],a=[];if(this.allSubscription.add(this.travellerInformation.subscribe((function(t){a=t.map((function(e,t){var r;if(e.dob){var a=Math.abs((new Date).getTime()-new Date(e.dob).getTime());r=Math.floor(a/864e5/365)}return{name:e.name,age:(null==r?void 0:r.toString())||e.ageType||"Not specified",discountCard:i.discountCard[t]?i.discountCard[t].name:"None",loyaltyCard:"None"}})),e=t[0].email?t[0].email:r}))),this.allSubscription.add(i.results.subscribe((function(e){var r,i;(null===(r=e[0])||void 0===r?void 0:r.jrfreference)&&(t.jrfReference=null===(i=e[0])||void 0===i?void 0:i.jrfreference)}))),this.jrfReference&&a){a=a.map((function(e,t){return Object.assign(Object.assign({},e),{discountCard:i.discountCard[t]?i.discountCard[t].name:"None",loyaltyCard:"None"})}));var n={trainNumber:i.trainNumber||"Any",departureStation:i.travellingFrom.name,destinationStation:i.travellingTo.name,outboundDate:i.outBoundDateTime,inboundDate:i.inBoundDateTime,additionalInfo:i.additionalInstructions||"No additional instructions",serviceClass:i.irlClass||"Any",offlineReference:this.jrfReference,onBehalfOf:e,passengers:a};console.log(n),this.sendOfflineNotification(n).subscribe((function(e){e.success?t.modalService.open(d.OfflineRequestDialogComponent,{centered:!0,size:"md"},{jrfReference:t.jrfReference}):t.modalService.open(d.ModalErrorComponent,{centered:!0},{error:"Unable to send offline notification"})})),this.searches[ne.InternationalRail].reset(),this.search_objects[ne.InternationalRail].chosen=!1}},i.prototype.sendOfflineNotification=function(e){return this.sendOfflineNotificationFetcher.fetchOne(e)},i.prototype.getCountries=function(){return this.countries},i.prototype.simultaneousSearchesCheck=function(e){return void 0===e&&(e=!1),y(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return t=this.helpers.clone(this.init_search_objects()),this.userService.canBook(ne.Flight)&&(this.searches[ne.Flight].eurostarFromFlightSearchPerformed=!1,this.searches[ne.Flight].railFromFlightSearchPerformed=!1),this.search_objects[ne.Eurostar]&&(this.search_objects[ne.Eurostar].priority=t[ne.Eurostar].priority,this.search_objects[ne.Eurostar].resultUrl=t[ne.Eurostar].resultUrl),this.search_objects[ne.Rail]&&(this.search_objects[ne.Rail].priority=t[ne.Rail].priority,this.search_objects[ne.Rail].resultUrl=t[ne.Rail].resultUrl),!this.search_objects[ne.Flight].chosen||!this.userService.canBook(ne.Rail)||this.search_objects[ne.Rail].chosen&&!e?[3,2]:this.searches[ne.Flight].canBeRailSearched()?(console.log("+++ Can be rail searched +++"),[4,this.searches[ne.Rail].generateQueryFromFlightQuery(this.searches[ne.Flight].getSearchQuery())]):[3,2];case 1:r.sent(),console.log(this.searches[ne.Rail]),this.searches[ne.Flight].railFromFlightSearchPerformed=!0,this.search_objects[ne.Rail].priority=this.search_objects.FLIGHT.priority,this.search_objects[ne.Rail].resultUrl=this.search_objects.FLIGHT.resultUrl,r.label=2;case 2:return!this.search_objects[ne.Flight].chosen||!this.userService.canBook(ne.Eurostar)||this.search_objects[ne.Eurostar].chosen&&!e?[3,4]:this.searches[ne.Flight].canBeEuroSearched()?[4,this.searches[ne.Eurostar].generateQueryFromFlightQuery(this.searches[ne.Flight].getSearchQuery(),this.searches[ne.Flight].departLocation.gateway,this.searches[ne.Flight].arriveLocation.gateway)]:[3,4];case 3:r.sent(),this.searches[ne.Flight].eurostarFromFlightSearchPerformed=!0,this.search_objects[ne.Eurostar].priority=this.search_objects.FLIGHT.priority,this.search_objects[ne.Eurostar].resultUrl=this.search_objects.FLIGHT.resultUrl,r.label=4;case 4:return[2]}}))}))},i.prototype.turnOffAllChosenProduct=function(){var e=this;Object.keys(this.search_objects).map((function(t){e.search_objects[t].chosen=!1}))},i}();Ni.SESSION_TRAVELLER="search_travellers";var Mi=function(){},Li=function(){function t(e,t,r){this.modalOpenerService=e,this.router=r,this._jwtToken=null,this.timer=null,this.timeoutDuration=3600,this.autoLogoutConfig={},this._bobo=null,this._boboFetched=!1,this.timeOutDuration=t.autoLogoutTime}return Object.defineProperty(t.prototype,"timeOutDuration",{set:function(e){this.timeoutDuration=60*e-60},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jwtToken",{get:function(){return this._jwtToken||null},set:function(e){e!==this.jwtToken&&(this._jwtToken=e)},enumerable:!1,configurable:!0}),t.prototype.getInvokedUserObservable=function(){var e=this;if(this._boboFetched)throw new Error("Only one service can access the service which should be the searchService");return this._boboFetched=!0,Object.freeze({next:function(t){e._bobo=!t||t.id?t:null}})},t.prototype._updateTimer=function(){var e=this;window.clearTimeout(this.timer),this.timer=null,console.log("Resetting auto log out"),this.timer=window.setTimeout((function(){e.checkToLogout()}),6e4)},t.prototype.checkToLogout=function(){var t,r=this;l.default().unix()-((null===(t=this.lastUpdated)||void 0===t?void 0:t.unix())||0)>this.timeoutDuration?(this.timer=null,this.lastUpdated=l.default(),"/logon"!==this.router.url&&"/"!==this.router.url&&this.modalOpenerService.open(d.AutoLogout,this.autoLogoutConfig,{}).then((function(t){t!==e.LogoutEnum.LOGOUT?r._updateTimer():r._jwtToken=null}))):this._updateTimer()},t}(),wi=function(){function e(e,t){this.httpService=e,this.helpers=t}return e.prototype.getAmenitiesForFlight=function(e){return new t.BehaviorSubject([])},e.prototype.parseAmenities=function(e){var t=e.linked,r=function(e,t){return t.find((function(t){return t.id==e}))};return e.data.map((function(e){var i=r(e.links.segments[0],t.segments);return{seat:r(i.links.seat.toString(),t.seats),wifi:r(i.links.wifi.toString(),t.wifis),power:r(i.links.power.toString(),t.entertainments),entertainment:r(i.links.entertainment.toString(),t.entertainments),fresh_food:r(i.links.fresh_food.toString(),t.fresh_foods),beverage:r(i.links.beverage.toString(),t.beverages),layout:r(i.links.layout.toString(),t.layouts),aircraft:r(i.links.aircraft.toString(),t.aircrafts)}}))},e.prototype.convertClassString=function(e){switch(e){case"ECONOMY":return"ECON";case"PREMIUM ECONOMY":return"PREMECON";case"BUSINESS":return"BUSINESS";case"FIRST":return"FIRST";default:return"ECON"}},e.prototype.getUpasForFlight=function(e){var r=this,i=new t.BehaviorSubject([]);return e.LegDetails.map((function(e){return{segments:[{dep:e.depPoint,arr:e.arrPoint,carrier:e.touropID,flt_no:e.transNo.substr(e.touropID.length),dep_date:r.helpers.formatIsoDate(r.helpers.yymmddToMoment(e.dateDep)),cabin_id:r.convertClass(e.seatClassBasic.toUpperCase())}]}})),i},e.prototype.convertClass=function(e){switch(e){case"ECONOMY":return 1;case"PREMIUM ECONOMY":return 2;case"BUSINESS":return 3;case"FIRST":return 4;default:return 1}},e.prototype.parseResponse=function(e){var t=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join("_")},r=function(e){return e.attributes},i=e.included.reduce((function(e,r){return e[t(r.type,r.id)]=r,e}),{}),a=function(e){return i[function(e){return t(e.type,e.id)}(e)]};return e.data.relationships.legs.data.map((function(e){var t=a(e).relationships.leg_fares.data.map(a).filter((function(e){return!!e.relationships.fare.data}));return{brands:t.map((function(e){return a(e.relationships.fare.data)})).map(r),upas:t.map((function(e){return e.relationships.leg_fare_segments.data.map(a)})).map((function(e){return e.map((function(e){return e.relationships.upas.data.map(a).map((function(e){return{id:e.id,details:r(e)}})).reduce((function(e,t){return e[t.id]=t.details,e}),{})}))}))}}))},e}();f([Ke(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],wi.prototype,"getAmenitiesForFlight",null),f([Ke(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],wi.prototype,"getUpasForFlight",null);var ji=function(e){function t(t,r){var i=e.call(this,r)||this;return i.query=t,i}return m(t,e),t.prototype.test=function(e){return this.processCall(this.query.fetch(e))},t}(h),Ui=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.validateUserMIFreeValue},t}(ji),Hi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.isPostcodeValid},t}(ji),xi=function(e){function t(t,r){var i=e.call(this,r)||this;return i.query=t,i}return m(t,e),t.prototype.updateOne=function(e){return this.processCall(this.query.mutate(e))},t}(h),Gi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.acceptNewPrice},t}(xi),Vi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.addItemToBasket},t}(xi),Wi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.addUserToBasketItem},t}(xi),Qi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.bookBasket},t}(xi),Ji=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.createBasket},t}(xi),Yi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.moveItemToADifferentBasket},t}(xi),Ki=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteBasket},t}(xi),qi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.removeItemFromBasket},t}(xi),Xi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteUserAddress},t}(xi),Zi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteRecentSearch},t}(xi),zi=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.revalidateBasket},t}(xi),$i=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.saveUserAddress},t}(xi),ea=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.sendBasketForApproval},t}(xi),ta=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemLeadPassenger},t}(xi),ra=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemMIGroup},t}(xi),ia=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemMIValue},t}(xi),aa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.updateBasketTitle},t}(xi),na=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.baseUpdateBasketNotes},t}(xi),oa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.saveRecentSearch},t}(xi),sa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.setBasketItemPaymentMethod},t}(xi),la=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.confirmMessages},t}(xi),ua=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.cancelBooking},t}(xi),ca=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.saveFavouriteSearch},t}(xi),da=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.deleteFavouriteSearch},t}(xi),ha=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.setUserLanguage},t}(xi),pa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.editUser},t}(xi),ma=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.createGuest},t}(xi),fa=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.addGuestToBasketItem},t}(xi),va=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.addRedirectApprover},t}(xi),ya=function(e){function t(t,r){return e.call(this,t,r)||this}return m(t,e),t.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.removeRedirectApprover},t}(xi);e.AbstractHttpCallService=Ti,e.AddressImpl=Xt,e.Airlines=[{label:"12 North",value:"12"},{label:"1time Airline",value:"1T"},{label:"3 Valleys Airlines",value:"3V"},{label:"40-mile Air",value:"Q5"},{label:"88",value:"47"},{label:"Aban Air",value:"K5"},{label:"Abelag Aviation",value:"W9"},{label:"Absa - Aerolinhas Brasileiras",value:"M3"},{label:"Abu Dhabi Amiri Flight",value:"MO"},{label:"Abx Air",value:"GB"},{label:"Access Air",value:"ZA"},{label:"Ada Air",value:"ZY"},{label:"Adam Air",value:"KI"},{label:"Adc Airlines",value:"Z7"},{label:"Adria Airways",value:"JP"},{label:"Aegean Airlines",value:"A3"},{label:"Aer Arann",value:"RE"},{label:"Aer Lingus",value:"EI"},{label:"Aereonautica Militare",value:"JY"},{label:"Aero Airlines",value:"EE"},{label:"Aero Asia International",value:"E4"},{label:"Aero Benin",value:"EM"},{label:"Aero Brazil",value:"BZ"},{label:"Aero California",value:"JR"},{label:"Aero Condor Peru",value:"Q6"},{label:"Aero Contractors",value:"AJ"},{label:"Aero Flight",value:"GV"},{label:"Aero Lanka",value:"QL"},{label:"Aero Lloyd (yp)",value:"YP"},{label:"Aero Mongolia",value:"M0"},{label:"Aero Services Executive",value:"W4"},{label:"Aero Vip",value:"2D"},{label:"Aero-charter Ukraine",value:"DW"},{label:"Aero-service",value:"BF"},{label:"Aero-tropics Air Services",value:"HC"},{label:"Aerocondor",value:"2B"},{label:"Aeroflot Russian Airlines",value:"SU"},{label:"Aeroflot-don",value:"D9"},{label:"Aerolane",value:"XL"},{label:"Aeroline Gmbh",value:"7E"},{label:"Aerolineas Argentinas",value:"AR"},{label:"Aerolineas Galapagos (aerogal)",value:"2K"},{label:"Aerolitoral",value:"5D"},{label:"Aeromar",value:"BQ"},{label:"Aeromar",value:"VW"},{label:"Aeromexpress",value:"QO"},{label:"Aeromist-kharkiv",value:"HT"},{label:"Aerom�xico",value:"AM"},{label:"Aeropelican Air Services",value:"OT"},{label:"Aeroper",value:"PL"},{label:"Aerorep",value:"P5"},{label:"Aerosur",value:"5L"},{label:"Aerosvit Airlines",value:"VV"},{label:"Aeroworld",value:"W4"},{label:"Africa West",value:"FK"},{label:"African Safari Airways",value:"QS"},{label:"Afrinat International Airlines",value:"Q9"},{label:"Afriqiyah Airways",value:"8U"},{label:"Aguilar Connect",value:"3X"},{label:"Aigle Azur",value:"ZI"},{label:"Air Afrique",value:"RK"},{label:"Air Algerie",value:"AH"},{label:"Air Alpha Greenland",value:"GD"},{label:"Air Alps Aviation",value:"A6"},{label:"Air Andaman (2y)",value:"2Y"},{label:"Air Arabia Egypt",value:"E5"},{label:"Air Arabia",value:"G9"},{label:"Air Armenia",value:"QN"},{label:"Air Astana",value:"KC"},{label:"Air Atlanta Icelandic",value:"CC"},{label:"Air Atlantique",value:"KI"},{label:"Air Austral",value:"UU"},{label:"Air Bagan",value:"W9"},{label:"Air Baltic",value:"BT"},{label:"Air Bangladesh",value:"B9"},{label:"Air Berlin",value:"AB"},{label:"Air Bosna",value:"JA"},{label:"Air Botswana",value:"BP"},{label:"Air Bourbon",value:"ZB"},{label:"Air Burkina",value:"2J"},{label:"Air Burundi",value:"8Y"},{label:"Air Busan",value:"BX"},{label:"Air Cal",value:"TY"},{label:"Air Caledonie International",value:"SB"},{label:"Air Canada Jazz",value:"QK"},{label:"Air Canada",value:"AC"},{label:"Air Cara�bes",value:"TX"},{label:"Air Cargo Carriers",value:"2Q"},{label:"Air Central",value:"NV"},{label:"Air Chathams",value:"CV"},{label:"Air China",value:"CA"},{label:"Air City",value:"4F"},{label:"Air Class Lineas Aereas",value:"QD"},{label:"Air Comores International",value:"GG"},{label:"Air Contractors",value:"AG"},{label:"Air Corridor",value:"QC"},{label:"Air Dayiti",value:"H9"},{label:"Air Dolomiti",value:"EN"},{label:"Air Europa",value:"UX"},{label:"Air Europe",value:"PE"},{label:"Air Exel",value:"XT"},{label:"Air Fiji",value:"PC"},{label:"Air Finland",value:"OF"},{label:"Air Florida",value:"QH"},{label:"Air Foyle",value:"GS"},{label:"Air France",value:"AF"},{label:"Air Gabon",value:"GN"},{label:"Air Georgia",value:"DA"},{label:"Air Georgian",value:"ZX"},{label:"Air Glaciers",value:"7T"},{label:"Air Greenland",value:"GL"},{label:"Air Guinee Express",value:"2U"},{label:"Air Guyane",value:"GG"},{label:"Air Hamburg (aho)",value:"HH"},{label:"Air Hong Kong",value:"LD"},{label:"Air Horizon",value:"8C"},{label:"Air Iceland",value:"NY"},{label:"Air India Express",value:"IX"},{label:"Air India Limited",value:"AI"},{label:"Air Indus",value:"PP"},{label:"Air Italy",value:"I9"},{label:"Air Ivoire",value:"VU"},{label:"Air Jamaica",value:"JM"},{label:"Air Japan",value:"NQ"},{label:"Air Kazakhstan",value:"9Y"},{label:"Air Kiribati",value:"4A"},{label:"Air Koryo",value:"JS"},{label:"Air Lithuania",value:"TT"},{label:"Air Lituanica",value:"LT"},{label:"Air Luxor Gb",value:"L8"},{label:"Air Luxor",value:"LK"},{label:"Air Macau",value:"NX"},{label:"Air Madagascar",value:"MD"},{label:"Air Madrid",value:"NM"},{label:"Air Malawi",value:"QM"},{label:"Air Malta",value:"KM"},{label:"Air Marshall Islands",value:"CW"},{label:"Air Mauritanie",value:"MR"},{label:"Air Mauritius",value:"MK"},{label:"Air Mediterranee",value:"DR"},{label:"Air Mekong",value:"P8"},{label:"Air Midwest",value:"ZV"},{label:"Air Mobility Command",value:"MC"},{label:"Air Moldova",value:"9U"},{label:"Air Namibia",value:"SW"},{label:"Air New Zealand",value:"NZ"},{label:"Air Nippon Network Co. Ltd.",value:"EH"},{label:"Air Nippon",value:"EL"},{label:"Air Niugini",value:"PX"},{label:"Air North Charter - Canada",value:"4N"},{label:"Air Nostrum",value:"YW"},{label:"Air One",value:"AP"},{label:"Air Pacific",value:"FJ"},{label:"Air Paradise International",value:"AD"},{label:"Air Pegasus",value:"OP"},{label:"Air Philippines",value:"2P"},{label:"Air Plus Comet",value:"A7"},{label:"Air Rarotonga",value:"GZ"},{label:"Air S",value:"KY"},{label:"Air Sahara",value:"S2"},{label:"Air Saint Pierre",value:"PJ"},{label:"Air Salone",value:"20"},{label:"Air Santo Domingo",value:"EX"},{label:"Air Senegal International",value:"V7"},{label:"Air Serbia",value:"JU"},{label:"Air Service Gabon",value:"G8"},{label:"Air Service",value:"M3"},{label:"Air Seychelles",value:"HM"},{label:"Air Sinai",value:"4D"},{label:"Air Slovakia",value:"GM"},{label:"Air Srpska",value:"RB"},{label:"Air Tahiti Nui",value:"TN"},{label:"Air Tahiti",value:"VT"},{label:"Air Tanzania",value:"TC"},{label:"Air Togo",value:"YT"},{label:"Air Transat",value:"TS"},{label:"Air Transport International",value:"8C"},{label:"Air Turks And Caicos",value:"JY"},{label:"Air Ukraine",value:"6U"},{label:"Air Urga",value:"3N"},{label:"Air Vanuatu",value:"NF"},{label:"Air Vegas",value:"6V"},{label:"Air Via",value:"VL"},{label:"Air Vistara",value:"UK"},{label:"Air Wales",value:"6G"},{label:"Air Wisconsin",value:"ZW"},{label:"Air Zimbabwe",value:"UM"},{label:"Airasia X",value:"D7"},{label:"Airasia",value:"AK"},{label:"Airblue",value:"ED"},{label:"Airborne Express",value:"GB"},{label:"Airbridge Cargo",value:"RU"},{label:"Airbus France",value:"4Y"},{label:"Airbus Industrie",value:"AP"},{label:"Aircompany Yakutia",value:"R3"},{label:"Aires",value:"4C"},{label:"Airlinair",value:"A5"},{label:"Airlines Of Tasmania",value:"FO"},{label:"Airlines Png",value:"CG"},{label:"Airlink Zambia",value:"K8"},{label:"Airnorth",value:"TL"},{label:"Airone Atlantic",value:"00"},{label:"Airone Continental",value:"00"},{label:"Airone Polska",value:"U1"},{label:"Airrussia",value:"R8"},{label:"Airstars",value:"PL"},{label:"Airtran Airways",value:"FL"},{label:"Alaska Airlines",value:"AS"},{label:"Alaska Central Express",value:"KO"},{label:"Albanian Airlines",value:"LV"},{label:"Albarka Air",value:"F4"},{label:"Alidaunia",value:"D4"},{label:"Alitalia Express",value:"XM"},{label:"Alitalia",value:"AZ"},{label:"All Africa",value:"9A"},{label:"All America Ar",value:"2R"},{label:"All America Bopy",value:"0P"},{label:"All America Br",value:"1Y"},{label:"All America Cl",value:"1R"},{label:"All America Co",value:"0Y"},{label:"All America Mx",value:"0M"},{label:"All America Us",value:"AG"},{label:"All America",value:"A2"},{label:"All Argentina Express",value:"Z0"},{label:"All Argentina",value:"L1"},{label:"All Asia",value:"L9"},{label:"All Australia",value:"88"},{label:"All Colombia",value:"7O"},{label:"All Europe",value:"N9"},{label:"All Nippon Airways",value:"NH"},{label:"All Spain",value:"N7"},{label:"Allegiant Air",value:"G4"},{label:"Allegro",value:"LL"},{label:"Alliance Air",value:"CD"},{label:"Alliance Airlines",value:"QQ"},{label:"Almasria Universal Airlines",value:"UJ"},{label:"Aloha Airlines",value:"AQ"},{label:"Alpi Eagles",value:"E8"},{label:"Alpine Air Express",value:"5A"},{label:"Alrosa Mirny Air Enterprise",value:"6R"},{label:"Amadeus Global Travel Distribution",value:"1A"},{label:"Amaszonas",value:"Z8"},{label:"Amber Air",value:"0A"},{label:"America West Airlines",value:"HP"},{label:"American Airlines",value:"AA"},{label:"American Eagle Airlines",value:"MQ"},{label:"American Falcon",value:"WK"},{label:"Amerijet International",value:"M6"},{label:"Amsterdam Airlines",value:"WD"},{label:"Ansett Australia",value:"AN"},{label:"Antinea Airlines",value:"HO"},{label:"Antrak Air",value:"04"},{label:"Aom French Airlines",value:"IW"},{label:"Apache Air",value:"ZM"},{label:"Arctic Circle Air Service",value:"5F"},{label:"Arcus-air Logistic",value:"ZE"},{label:"Ariana Afghan Airlines",value:"FG"},{label:"Arik Air",value:"W3"},{label:"Arik Niger",value:"Q9"},{label:"Arkefly",value:"OR"},{label:"Arkia Israel Airlines",value:"IZ"},{label:"Armavia",value:"U8"},{label:"Armenian International Airways",value:"MV"},{label:"Arrow Air",value:"JW"},{label:"Aserca Airlines",value:"R7"},{label:"Asia Overnight Express",value:"OE"},{label:"Asia Wings",value:"Y5"},{label:"Asian Express Airlines",value:"HJ"},{label:"Asian Spirit",value:"6K"},{label:"Asian Wings Airways",value:"AW"},{label:"Asiana Airlines",value:"OZ"},{label:"Askari Aviation",value:"4K"},{label:"Astar Air Cargo",value:"ER"},{label:"Astraeus",value:"5W"},{label:"Astrakhan Airlines",value:"OB"},{label:"Astral Aviation",value:"8V"},{label:"Atifly",value:"A1"},{label:"Atlant-soyuz Airlines",value:"3G"},{label:"Atlantic Airways",value:"RC"},{label:"Atlantic Southeast Airlines",value:"EV"},{label:"Atlantis European Airways",value:"TD"},{label:"Atlas Air",value:"5Y"},{label:"Atlas Blue",value:"8A"},{label:"Atlasjet",value:"KK"},{label:"Atran Cargo Airlines",value:"V8"},{label:"Atyrau Air Ways",value:"IP"},{label:"Augsburg Airways",value:"IQ"},{label:"Aurigny Air Services",value:"GR"},{label:"Aus-air",value:"NO"},{label:"Austral Lineas Aereas",value:"AU"},{label:"Australian Airlines",value:"AO"},{label:"Austrian Airlines",value:"OS"},{label:"Avcom",value:"J6"},{label:"Avensa",value:"VE"},{label:"Aviabus",value:"U1"},{label:"Aviaexpress",value:"RX"},{label:"Avialeasing Aviation Company",value:"EC"},{label:"Avianca - Aerovias Nacionales De Colombia",value:"AV"},{label:"Avient Aviation",value:"Z3"},{label:"Avies",value:"U3"},{label:"Avirex",value:"G2"},{label:"Avolar Aerolineas",value:"V5"},{label:"Aws Express",value:"B0"},{label:"Axis Airways",value:"6V"},{label:"Azerbaijan Airlines",value:"J2"},{label:"Azul",value:"AD"},{label:"B&h Airlines",value:"JA"},{label:"BMI",value:"BD"},{label:"Ba Cityflyer",value:"CJ"},{label:"Bach Flugbetriebsges",value:"B4"},{label:"Bahamasair",value:"UP"},{label:"Baikotovitchestrian Airlines",value:"BU"},{label:"Baker Aviation",value:"8Q"},{label:"Bal Bashkirian Airlines",value:"V9"},{label:"Baltic Air Lines",value:"B1"},{label:"Bangkok Airways",value:"PG"},{label:"Bankair",value:"B4"},{label:"Barents Airlink",value:"8N"},{label:"Bassaka Airlines",value:"5B"},{label:"Bayu Indonesia Air",value:"BM"},{label:"Bearskin Lake Air Service",value:"JV"},{label:"Belair Airlines",value:"4T"},{label:"Belavia Belarusian Airlines",value:"B2"},{label:"Bellview Airlines",value:"B3"},{label:"Bemidji Airlines",value:"CH"},{label:"Benin Golf Air",value:"A8"},{label:"Bering Air",value:"8E"},{label:"Berjaya Air",value:"J8"},{label:"Big Sky Airlines",value:"GQ"},{label:"Biman Bangladesh Airlines",value:"BG"},{label:"Binter Canarias",value:"NT"},{label:"Bismillah Airlines",value:"5Z"},{label:"Black Stallion Airways",value:"BZ"},{label:"Blue Air",value:"0B"},{label:"Blue Dart Aviation",value:"BZ"},{label:"Blue Panorama Airlines",value:"BV"},{label:"Blue Sky America",value:"BU"},{label:"Blue Wings",value:"QW"},{label:"Blue1",value:"KF"},{label:"Bluebird Cargo",value:"BF"},{label:"Bmibaby",value:"WW"},{label:"Boston-maine Airways",value:"E9"},{label:"Bouraq Indonesia Airlines",value:"BO"},{label:"Boutique Air (priv)",value:"4B"},{label:"Bra-transportes Aereos",value:"7R"},{label:"Braathens",value:"BU"},{label:"Braniff International Airways",value:"BN"},{label:"Bravo Air Congo",value:"K6"},{label:"Brazil Air",value:"GB"},{label:"Brit Air",value:"DB"},{label:"British Airways",value:"BA"},{label:"British International Helicopters",value:"BS"},{label:"British Mediterranean Airways",value:"KJ"},{label:"Brussels Airlines",value:"SN"},{label:"Budgetair",value:"1K"},{label:"Buffalo Airways",value:"J4"},{label:"Bulgaria Air",value:"FB"},{label:"Buquebus L�neas A�reas",value:"BQ"},{label:"Businessair",value:"8B"},{label:"Buzz",value:"UK"},{label:"Cal Cargo Air Lines",value:"5C"},{label:"California Western",value:"KT"},{label:"Calima Aviacion",value:"XG"},{label:"Calm Air",value:"MO"},{label:"Camai Air",value:"R9"},{label:"Cameroon Airlines",value:"UY"},{label:"Canadian Airlines",value:"CP"},{label:"Canadian National Airways",value:"CN"},{label:"Canadian North",value:"5T"},{label:"Canadian Western Airlines",value:"W2"},{label:"Canadian World",value:"10"},{label:"Canjet",value:"C6"},{label:"Canxplorer",value:"C2"},{label:"Canxpress",value:"C1"},{label:"Cape Air",value:"9K"},{label:"Capital Cargo International Airlines",value:"PT"},{label:"Cargo 360",value:"GG"},{label:"Cargo Plus Aviation",value:"8L"},{label:"Cargoitalia",value:"2G"},{label:"Cargojet Airways",value:"W8"},{label:"Cargolux",value:"CV"},{label:"Caribbean Airlines",value:"BW"},{label:"Caribbean Star Airlines",value:"8B"},{label:"Caribbean Wings",value:"XP"},{label:"Carpatair",value:"V3"},{label:"Caspian Airlines",value:"RV"},{label:"Cathay Pacific",value:"CX"},{label:"Cayman Airways",value:"KX"},{label:"Cb Airways Uk ( Interliging Flights )",value:"1F"},{label:"Ccml Airlines",value:"CB"},{label:"Cebu Pacific",value:"5J"},{label:"Centavia",value:"7N"},{label:"Centralwings",value:"C0"},{label:"Centre-avia",value:"J7"},{label:"Centurion Air Cargo",value:"WE"},{label:"Chalks Ocean Airways",value:"OP"},{label:"Champion Air",value:"MG"},{label:"Changan Airlines",value:"2Z"},{label:"Chari Aviation Services",value:"S8"},{label:"Chautauqua Airlines",value:"RP"},{label:"Chc Airways",value:"AW"},{label:"Cheapflyinginternational",value:"WL"},{label:"Chicago Express",value:"C8"},{label:"China Airlines",value:"CI"},{label:"China Cargo Airlines",value:"CK"},{label:"China Eastern Airlines",value:"MU"},{label:"China Northern Airlines",value:"CJ"},{label:"China Northwest Airlines",value:"WH"},{label:"China Postal Airlines",value:"8Y"},{label:"China Southern Airlines",value:"CZ"},{label:"China United Airlines",value:"HR"},{label:"China Xinhua Airlines",value:"XO"},{label:"Chitaavia",value:"X7"},{label:"Chongqing Airlines",value:"OQ"},{label:"Ciel Canadien",value:"YC"},{label:"Cielos Airlines",value:"A2"},{label:"Cimber Air",value:"QI"},{label:"Cirrus Airlines",value:"C9"},{label:"City Airline",value:"CF"},{label:"City Airways",value:"E8"},{label:"City Connexion Airlines",value:"G3"},{label:"Cityjet",value:"WX"},{label:"Civil Air Transport",value:"CT"},{label:"Club Air",value:"6P"},{label:"Coast Air",value:"BX"},{label:"Colgan Air",value:"9L"},{label:"Comair",value:"MN"},{label:"Comair",value:"OH"},{label:"Commutair",value:"C5"},{label:"Comores Airlines",value:"KR"},{label:"Compania Mexicargo",value:"GJ"},{label:"Compass Airlines",value:"CP"},{label:"Condor Flugdienst",value:"DE"},{label:"Consorcio Aviaxsa",value:"6A"},{label:"Contact Air",value:"C3"},{label:"Continental Airlines",value:"CO"},{label:"Continental Airways",value:"PC"},{label:"Continental Micronesia",value:"CS"},{label:"Conviasa",value:"V0"},{label:"Copa Airlines",value:"CM"},{label:"Copenhagen Express",value:"0X"},{label:"Corsairfly",value:"SS"},{label:"Corse-mediterranee",value:"XK"},{label:"Cosmic Air",value:"F5"},{label:"Croatia Airlines",value:"OU"},{label:"Crossair Europe",value:"QE"},{label:"Cubana De Aviaci�n",value:"CU"},{label:"Cyprus Airways",value:"CY"},{label:"Czech Airlines",value:"OK"},{label:"DBA",value:"DI"},{label:"Daallo Airlines",value:"D3"},{label:"Dagestan Airlines",value:"N2"},{label:"Dalavia",value:"H8"},{label:"Darwin Airline",value:"0D"},{label:"Das Air Cargo",value:"WD"},{label:"Dat Danish Air Transport",value:"DX"},{label:"Dauair",value:"D5"},{label:"Delta Air Lines",value:"DL"},{label:"Dennis Sky",value:"DH"},{label:"Dense Airways",value:"KP"},{label:"Dense Connection",value:"KZ"},{label:"Deutsche Luftverkehrsgesellschaft (dlt)",value:"DW"},{label:"Deutsche Luftverkehrsgesellschaft",value:"DW"},{label:"Deutsche Rettungsflugwacht",value:"1I"},{label:"Dhl De Guatemala",value:"L3"},{label:"Dhl International",value:"ES"},{label:"Dinar",value:"D7"},{label:"Dirgantara Air Service",value:"AW"},{label:"Discovery Airways",value:"DH"},{label:"Djibouti Airlines",value:"D8"},{label:"Dobrolet",value:"QD"},{label:"Domenican Airlines",value:"D1"},{label:"Dominicana De Aviaci",value:"DO"},{label:"Domodedovo Airlines",value:"E3"},{label:"Donbassaero",value:"5D"},{label:"Dragonair",value:"KA"},{label:"Druk Air",value:"KB"},{label:"East African Safari Air",value:"S9"},{label:"East African",value:"QU"},{label:"Eastar Jet",value:"ZE"},{label:"Eastern Airways",value:"T3"},{label:"Eastern Atlantic Virtual Airlines",value:"13"},{label:"Eastland Air",value:"DK"},{label:"Eastwind Airlines",value:"W9"},{label:"Easyjet",value:"U2"},{label:"Edelweiss Air",value:"WK"},{label:"Egyptair",value:"MS"},{label:"El Al Israel Airlines",value:"LY"},{label:"El-buraq Air Transport",value:"UZ"},{label:"Elk Airways",value:"--"},{label:"Elysian Airlines",value:"E4"},{label:"Emirates",value:"EK"},{label:"Empire Airlines",value:"EM"},{label:"Empresa Ecuatoriana De Aviacion",value:"EU"},{label:"Enkor Jsc",value:"G8"},{label:"Eos Airlines",value:"E0"},{label:"Epic Holiday",value:"FA"},{label:"Era Alaska",value:"7H"},{label:"Eritrean Airlines",value:"B8"},{label:"Estafeta Carga Aerea",value:"E7"},{label:"Estonian Air",value:"OV"},{label:"Ethiopian Airlines",value:"ET"},{label:"Etihad Airways",value:"EY"},{label:"Eujet",value:"VE"},{label:"Euro Harmony",value:"EH"},{label:"Eurocypria Airlines",value:"UI"},{label:"Eurofly Service",value:"GJ"},{label:"Euroline",value:"4L"},{label:"Eurolot",value:"K2"},{label:"Euromanx Airways",value:"3W"},{label:"Europe Jet",value:"EX"},{label:"European Air Express",value:"EA"},{label:"European Air Transport",value:"QY"},{label:"European Aviation Air Charter",value:"E7"},{label:"Europesky",value:"ES"},{label:"Eurowings",value:"EW"},{label:"Eva Air",value:"BR"},{label:"Evergreen International Airlines",value:"EZ"},{label:"Excel Airways",value:"JN"},{label:"Execair Aviation",value:"MB"},{label:"Executive Airlines",value:"OW"},{label:"Expo Aviation",value:"8D"},{label:"Express One International",value:"EO"},{label:"Expressjet",value:"XE"},{label:"Far Eastern Air Transport",value:"EF"},{label:"Faroejet",value:"F6"},{label:"Faso Airways",value:"F3"},{label:"Federal Express",value:"FX"},{label:"Felix Airways",value:"FU"},{label:"Fika Salaama Airlines",value:"N8"},{label:"Finalair Congo",value:"4S"},{label:"Finnair",value:"AY"},{label:"Finncomm Airlines",value:"FC"},{label:"Firefly",value:"FY"},{label:"First Air",value:"7F"},{label:"First Choice Airways",value:"DP"},{label:"Fischer Air",value:"8F"},{label:"Flightline",value:"B5"},{label:"Florida Coastal Airlines",value:"PA"},{label:"Florida West International Airways",value:"RF"},{label:"Fly Air",value:"F2"},{label:"Fly Brasil",value:"F1"},{label:"Fly Colombia ( Interliging Flights )",value:"3F"},{label:"Fly Dubai",value:"FZ"},{label:"Fly Europa",value:"ER"},{label:"Fly France",value:"FF"},{label:"Fly Illi",value:"IL"},{label:"Fly Me Sweden",value:"SH"},{label:"Fly One",value:"F5"},{label:"Fly Romania",value:"X5"},{label:"Fly540",value:"5H"},{label:"Flybaboo",value:"F7"},{label:"Flybe",value:"BE"},{label:"Flyglobespan",value:"B4"},{label:"Flyhigh Airlines Ireland (fh)",value:"FH"},{label:"Flylal",value:"TE"},{label:"Flynordic",value:"LF"},{label:"Flyportugal",value:"PO"},{label:"Formosa Airlines",value:"VY"},{label:"Four Star Aviation / Four Star Cargo",value:"HK"},{label:"Fox Linhas Aereas",value:"FX"},{label:"Fra Air",value:"X9"},{label:"Freedom Air",value:"FP"},{label:"Frontier Airlines",value:"F9"},{label:"Frontier Flying Service",value:"2F"},{label:"Futura International Airways",value:"FH"},{label:"Gabon Airlines",value:"GY"},{label:"Gadair European Airlines",value:"GP"},{label:"Galaxy Air",value:"7O"},{label:"Gambia International Airlines",value:"GC"},{label:"Gandalf Airlines",value:"G7"},{label:"Garuda Indonesia",value:"GA"},{label:"Gazpromavia",value:"4G"},{label:"Gb Airways",value:"GT"},{label:"Gemini Air Cargo",value:"GR"},{label:"Georgian Airways",value:"A9"},{label:"Georgian National Airlines",value:"QB"},{label:"German International Air Lines",value:"GM"},{label:"Germania",value:"ST"},{label:"Germanwings",value:"4U"},{label:"Germanxl",value:"GX"},{label:"Gestair",value:"GP"},{label:"Ghana International Airlines",value:"G0"},{label:"Global Airlines",value:"0G"},{label:"Global Freightways",value:"F5"},{label:"Globus",value:"GH"},{label:"Go Air",value:"G8"},{label:"Godutch",value:"GD"},{label:"Gojet Airlines",value:"G7"},{label:"Gol Transportes A�reos",value:"G3"},{label:"Golden Air",value:"DC"},{label:"Gorkha Airlines",value:"G1"},{label:"Grant Aviation",value:"GS"},{label:"Great Lakes Airlines",value:"ZK"},{label:"Great Wall Airlines",value:"IJ"},{label:"Greenfly",value:"XX"},{label:"Grupo Taca",value:"TA"},{label:"Guine Bissaur Airlines",value:"G6"},{label:"Guinee Airlines",value:"J9"},{label:"Gujarat Airways",value:"G8"},{label:"Gulf Air Bahrain",value:"GF"},{label:"Gulisano Airways",value:"GU"},{label:"Hageland Aviation Services",value:"H6"},{label:"Hahn Air",value:"HR"},{label:"Hainan Airlines",value:"HU"},{label:"Haiti Ambassador Airlines",value:"2T"},{label:"Hamburg International",value:"4R"},{label:"Hankook Air Us",value:"H1"},{label:"Hankook Airline",value:"HN"},{label:"Hapagfly",value:"HF"},{label:"Harbor Airlines",value:"HB"},{label:"Harmony Airways",value:"HQ"},{label:"Hawaiian Airlines",value:"HA"},{label:"Heavylift Cargo Airlines",value:"HN"},{label:"Heli France",value:"8H"},{label:"Helijet",value:"JB"},{label:"Helios Airways",value:"ZU"},{label:"Hellas Jet",value:"T4"},{label:"Hellenic Airways",value:"1H"},{label:"Hellenic Imperial Airways",value:"HT"},{label:"Hello",value:"HW"},{label:"Helvetic Airways",value:"2L"},{label:"Hemus Air",value:"DU"},{label:"Hewa Bora Airways",value:"EO"},{label:"Hexair",value:"UD"},{label:"Hi Fly",value:"5K"},{label:"Himalayan Airlines",value:"HC"},{label:"Hokkaido International Airlines",value:"HD"},{label:"Hola Airlines",value:"H5"},{label:"Homer Air",value:"MR"},{label:"Hong Kong Airlines",value:"HX"},{label:"Hong Kong Express Airways",value:"UO"},{label:"Horizon Air",value:"QX"},{label:"Horizon Airlines",value:"BN"},{label:"I-fly",value:"H5"},{label:"Ibc Airways",value:"II"},{label:"Iberia Airlines",value:"IB"},{label:"Iberia Express",value:"I2"},{label:"Iberworld",value:"TY"},{label:"Ibex Airlines",value:"FW"},{label:"Icelandair",value:"FI"},{label:"Illinois Airways",value:"IL"},{label:"Imair Airlines",value:"IK"},{label:"Inavia Internacional",value:"Z5"},{label:"Independence Air",value:"DH"},{label:"Indian Airlines",value:"IC"},{label:"Indigo Airlines",value:"6E"},{label:"Indigo",value:"I9"},{label:"Indonesia Airasia",value:"QZ"},{label:"Indonesia Sky",value:"I5"},{label:"Indonesian Airlines",value:"IO"},{label:"Indya Airline Group",value:"G1"},{label:"Intelijet Airways",value:"IJ"},{label:"Inter Islands Airlines",value:"H4"},{label:"Interair South Africa",value:"D6"},{label:"Interavia Airlines",value:"ZA"},{label:"Intercontinental De Aviaci",value:"RS"},{label:"Interlink Airlines",value:"ID"},{label:"International Business Air",value:"6I"},{label:"International Europe",value:"9I"},{label:"Intersky",value:"3L"},{label:"Interstate Airline",value:"I4"},{label:"Iran Air",value:"IR"},{label:"Iran Aseman Airlines",value:"EP"},{label:"Iraqi Airways",value:"IA"},{label:"Island Air (wp)",value:"WP"},{label:"Island Express",value:"2S"},{label:"Island Spirit",value:"IP"},{label:"Islas Airways",value:"IF"},{label:"Islena De Inversiones",value:"WC"},{label:"Israir",value:"6H"},{label:"Itali Airlines",value:"9X"},{label:"Itek Air",value:"GI"},{label:"Izair",value:"H9"},{label:"Jal Express",value:"JC"},{label:"Jalways",value:"JO"},{label:"Japan Air System",value:"JD"},{label:"Japan Airlines Domestic",value:"JL"},{label:"Japan Airlines",value:"JL"},{label:"Japan Asia Airways",value:"EG"},{label:"Japan Regio",value:"ZX"},{label:"Japan Transocean Air",value:"NU"},{label:"Jat Airways",value:"JU"},{label:"Jatayu Airlines",value:"VJ"},{label:"Jayrow",value:",,"},{label:"Jazeera Airways",value:"J9"},{label:"Jeju Air",value:"7C"},{label:"Jet Airways",value:"9W"},{label:"Jet2.com",value:"LS"},{label:"Jet4you",value:"8J"},{label:"Jetairfly",value:"JF"},{label:"Jetblue Airways",value:"B6"},{label:"Jetclub",value:"0J"},{label:"Jetsgo",value:"SG"},{label:"Jetstar Airways",value:"JQ"},{label:"Jetstar Asia Airways",value:"3K"},{label:"Jetstar Pacific",value:"BL"},{label:"Jett8 Airlines Cargo",value:"JX"},{label:"Jettor Airlines",value:"NR"},{label:"Jetx Airlines",value:"GX"},{label:"Jin Air",value:"LJ"},{label:"Jordan Aviation",value:"R5"},{label:"Joy Air",value:"JR"},{label:"Juneyao Airlines",value:"HO"},{label:"Jusur Airways",value:"JX"},{label:"KSY",value:"KY"},{label:"Kabo Air",value:"N2"},{label:"Kalitta Air",value:"K4"},{label:"Kam Air",value:"RQ"},{label:"Kampuchea Airlines",value:"E2"},{label:"Karat",value:"V2"},{label:"Kavminvodyavia",value:"KV"},{label:"Kd Avia",value:"KD"},{label:"Kenmore Air",value:"M5"},{label:"Kenya Airways",value:"KQ"},{label:"Keystone Air Services",value:"BZ"},{label:"Kharkiv Airlines",value:"KH"},{label:"Kibris T",value:"KY"},{label:"Kingfisher Airlines",value:"IT"},{label:"Kish Air",value:"Y9"},{label:"Kiwi International Air Lines",value:"KP"},{label:"Klm Cityhopper",value:"WA"},{label:"Klm Royal Dutch Airlines",value:"KL"},{label:"Kogalymavia Air Company",value:"7K"},{label:"Komiinteravia",value:"8J"},{label:"Koralblue Airlines",value:"K7"},{label:"Korean Air",value:"KE"},{label:"Korongo Airlines",value:"ZC"},{label:"Kostromskie Avialinii",value:"K1"},{label:"Krasnojarsky Airlines",value:"7B"},{label:"Krylo Airlines",value:"K9"},{label:"Kuban Airlines",value:"GW"},{label:"Kunpeng Airlines",value:"VD"},{label:"Kuwait Airways",value:"KU"},{label:"Kuzu Airlines Cargo",value:"GO"},{label:"Kyrgyz Airlines",value:"N5"},{label:"Kyrgyzstan Airlines",value:"R8"},{label:"Kyrgyzstan",value:"QH"},{label:"L",value:"MJ"},{label:"L.a.b. Flying Service",value:"JF"},{label:"Lacsa",value:"LR"},{label:"Lagun Air",value:"N6"},{label:"Lai - Linea Aerea Iaaca",value:"KG"},{label:"Lan Airlines",value:"LA"},{label:"Lan Argentina",value:"4M"},{label:"Lan Express",value:"LU"},{label:"Lan Peru",value:"LP"},{label:"Lankair",value:"IK"},{label:"Lao Airlines",value:"QV"},{label:"Laoag International Airlines",value:"L7"},{label:"Lauda Air",value:"NG"},{label:"Lcm Airlines",value:"LQ"},{label:"Lebanese Air Transport",value:"LQ"},{label:"Leeward Islands Air Transport",value:"LI"},{label:"Liberty Airways",value:"LE"},{label:"Libyan Arab Airlines",value:"LN"},{label:"Line Blue",value:"L8"},{label:"Linea Aerea De Servicio Ejecutivo Regional",value:"8Z"},{label:"Linea Aerea Sapsa",value:"L7"},{label:"Linea Turistica Aerotuy",value:"LD"},{label:"Lineas Aereas Azteca",value:"ZE"},{label:"Linhas A",value:"LM"},{label:"Lion Mentari Airlines",value:"JT"},{label:"Lionxpress",value:"C4"},{label:"Livingston",value:"LM"},{label:"Llloyd Helicopters",value:"::"},{label:"Lloyd Aereo Boliviano",value:"LB"},{label:"Locair",value:"ZQ"},{label:"Lot Polish Airlines",value:"LO"},{label:"Lsm Airlines",value:"PQ"},{label:"Lsm Airlines",value:"YZ"},{label:"Lsm International",value:"II"},{label:"Lte International Airways",value:"XO"},{label:"Ltu Austria",value:"L3"},{label:"Ltu International",value:"LT"},{label:"Luchsh Airlines",value:"L4"},{label:"Luftfahrtgesellschaft Walter",value:"HE"},{label:"Lufthansa Cargo",value:"LH"},{label:"Lufthansa Cityline",value:"CL"},{label:"Lufthansa",value:"LH"},{label:"Lufttaxi Fluggesellschaft",value:"DV"},{label:"Lufttransport",value:"L5"},{label:"Luxair",value:"LG"},{label:"Lviv Airlines",value:"5V"},{label:"Lynden Air Cargo",value:"L2"},{label:"Macair Airlines",value:"CC"},{label:"Mahan Air",value:"W5"},{label:"Mahfooz Aviation",value:"M2"},{label:"Malaysia Airlines",value:"MH"},{label:"Maldivo Airlines",value:"ML"},{label:"Malindo Air",value:"OD"},{label:"Malm� Aviation",value:"TF"},{label:"Malta Air Charter",value:"R5"},{label:"Mal�v",value:"MA"},{label:"Mandala Airlines",value:"RI"},{label:"Mandarin Airlines",value:"AE"},{label:"Mango",value:"JE"},{label:"Mars Rk",value:"6V"},{label:"Marsland Aviation",value:"M7"},{label:"Martinair",value:"MP"},{label:"Marusya Airways",value:"Y8"},{label:"Maryland Air",value:"M1"},{label:"Marysya Airlines",value:"M4"},{label:"Masair",value:"M7"},{label:"Mat Airways",value:"6F"},{label:"Mat Macedonian Airlines",value:"IN"},{label:"Mauritania Airlines International",value:"L6"},{label:"Mavial Magadan Airlines",value:"H5"},{label:"Maxair",value:"8M"},{label:"Maxjet Airways",value:"MY"},{label:"Maya Island Air",value:"MW"},{label:"Menajet",value:"IM"},{label:"Meridiana",value:"IG"},{label:"Merpati Nusantara Airlines",value:"MZ"},{label:"Mesa Airlines",value:"YV"},{label:"Mesaba Airlines",value:"XJ"},{label:"Metro Batavia",value:"7P"},{label:"Mexicana De Aviaci",value:"MX"},{label:"Mexicanalink",value:"I6"},{label:"Miami Air International",value:"GL"},{label:"Miat Mongolian Airlines",value:"OM"},{label:"Michael Airlines",value:"DF"},{label:"Middle East Airlines",value:"ME"},{label:"Midway Airlines",value:"JI"},{label:"Midwest Airlines (egypt)",value:"MY"},{label:"Midwest Airlines",value:"YX"},{label:"Mng Airlines",value:"MB"},{label:"Moldavian Airlines",value:"2M"},{label:"Monarch Airlines",value:"ZB"},{label:"Mongolian International Air Lines",value:"7M"},{label:"Montenegro Airlines",value:"YM"},{label:"Moskovia Airlines",value:"3R"},{label:"Motor Sich",value:"M9"},{label:"Mount Cook Airlines",value:"NM"},{label:"Mountain Air Company",value:"N4"},{label:"Myanma Airways",value:"UB"},{label:"Myanmar Airways International",value:"8M"},{label:"Mytravel Airways",value:"VZ"},{label:"NCCTEST",value:"NC"},{label:"Naka Nihon Airlines Service",value:"NV"},{label:"Nantucket Airlines",value:"DV"},{label:"Nas Air",value:"XY"},{label:"Nasair",value:"UE"},{label:"National Air Cargo",value:"N8"},{label:"National Airlines",value:"N4"},{label:"National Airlines",value:"N7"},{label:"National Airlines",value:"NA"},{label:"National Jet Systems",value:"NC"},{label:"Nationwide Airlines",value:"CE"},{label:"Nauru Air Corporation",value:"ON"},{label:"Neos",value:"NO"},{label:"Nepal Airlines",value:"RA"},{label:"Netjets",value:"1I"},{label:"New England Airlines",value:"EJ"},{label:"Next Brasil",value:"XB"},{label:"Nextjet",value:"2N"},{label:"Niki",value:"HG"},{label:"Nile Air",value:"NP"},{label:"Nippon Cargo Airlines",value:"KZ"},{label:"Nok Air",value:"DD"},{label:"Nordeste Linhas Aereas Regionais",value:"JH"},{label:"Nordic Global Airlines",value:"NJ"},{label:"Nordic Regional",value:"6N"},{label:"North Flying",value:"M3"},{label:"North-wright Airways",value:"HW"},{label:"Northern Air Cargo",value:"NC"},{label:"Northwest Airlines",value:"NW"},{label:"Northwest Regional Airlines",value:"FY"},{label:"Northwestern Air",value:"J3"},{label:"Norwegian Air Shuttle",value:"DY"},{label:"Norwegian Long Haul As",value:"DU"},{label:"Nouvel Air Tunisie",value:"BJ"},{label:"Nova Airline",value:"M4"},{label:"Novair",value:"1I"},{label:"Nuevo Continente",value:"N6"},{label:"Oasis Hong Kong Airlines",value:"O8"},{label:"Ocean Airlines",value:"VC"},{label:"Oceanair",value:"O6"},{label:"Oconnor Airlines",value:"UQ"},{label:"Olympic Airlines",value:"OA"},{label:"Oman Air",value:"WY"},{label:"Omni Air International",value:"OY"},{label:"Omskavia Airline",value:"N3"},{label:"Onechina",value:"1C"},{label:"Onur Air",value:"8Q"},{label:"Open Skies Consultative Commission",value:"1L"},{label:"Orbit Airlines Azerbaijan",value:"O1"},{label:"Orchid Airlines",value:"OI"},{label:"Orenburg Airlines",value:"R2"},{label:"Orient Thai Airlines",value:"OX"},{label:"Origin Pacific Airways",value:"QO"},{label:"Ostfriesische Lufttransport",value:"OL"},{label:"Our Airline",value:"ON"},{label:"Overland Airways",value:"OJ"},{label:"Ozark Air Lines",value:"OZ"},{label:"Ozjet Airlines",value:"O7"},{label:"Pace Airlines",value:"Y5"},{label:"Pacific Blue",value:"DJ"},{label:"Pacific Coastal Airline",value:"8P"},{label:"Pacific East Asia Cargo Airlines",value:"Q8"},{label:"Pacific Southwest Airlines",value:"PS"},{label:"Pacific Wings",value:"LW"},{label:"Pakistan International Airlines",value:"PK"},{label:"Palair Macedonia",value:"3D"},{label:"Palau Trans Pacific Airline",value:"GP"},{label:"Palestinian Airlines",value:"PF"},{label:"Pamir Airways",value:"NR"},{label:"Pan Air",value:"PV"},{label:"Pan American Airways",value:"PA"},{label:"Pan American World Airways",value:"PA"},{label:"Panafrican Airways",value:"PQ"},{label:"Panam World Airways",value:"WQ"},{label:"Pantanal Linhas A�reas",value:"P8"},{label:"Paramount Airways",value:"I7"},{label:"Parmiss Airlines (ipv)",value:"PA"},{label:"Pb Air",value:"9Q"},{label:"Pearl Airways",value:"HP"},{label:"Pegasus Airlines",value:"PC"},{label:"Peninsula Airways",value:"KS"},{label:"Perm Airlines",value:"P9"},{label:"Philippine Airlines",value:"PR"},{label:"Phuket Air",value:"9R"},{label:"Piedmont Airlines (1948-1989)",value:"PI"},{label:"Pinnacle Airlines",value:"9E"},{label:"Pluna",value:"PU"},{label:"Pmtair",value:"U4"},{label:"Polar Air Cargo",value:"PO"},{label:"Polynesian Airlines",value:"PH"},{label:"Polynesian Blue",value:"DJ"},{label:"Porter Airlines",value:"PD"},{label:"Portugalia",value:"NI"},{label:"Potomac Air",value:"BK"},{label:"Precision Air",value:"PW"},{label:"President Airlines",value:"TO"},{label:"Primaris Airlines",value:"FE"},{label:"Private Wings Flugcharter",value:"8W"},{label:"Qantas",value:"QF"},{label:"Qatar Airways",value:"QR"},{label:"Qatxpress",value:"C3"},{label:"Rainbow Air (rai)",value:"RN"},{label:"Rainbow Air Canada",value:"RY"},{label:"Rainbow Air Euro",value:"RU"},{label:"Rainbow Air Polynesia",value:"RX"},{label:"Rainbow Air Us",value:"RM"},{label:"Red Wings",value:"WZ"},{label:"Redhill Aviation",value:"8L"},{label:"Reem Air",value:"V4"},{label:"Regional Air Iceland",value:"9N"},{label:"Regional Express",value:"ZL"},{label:"Regional Paraguaya",value:"P7"},{label:"Regionalia Chile",value:"9J"},{label:"Regionalia M�xico",value:"N4"},{label:"Regionalia Uruguay",value:"2X"},{label:"Regionalia Venezuela",value:"9X"},{label:"Regionsair",value:"3C"},{label:"Reno Air",value:"QQ"},{label:"Republic Airlines",value:"RW"},{label:"Republic Express Airlines",value:"RH"},{label:"Rexair Virtuel",value:"RR"},{label:"Rico Linhas A",value:"C7"},{label:"Rio Grande Air",value:"E2"},{label:"Rio Sul Servi",value:"SL"},{label:"Rossiya-russian Airlines",value:"FV"},{label:"Royal Air Cambodge",value:"VJ"},{label:"Royal Air Force Of Oman",value:"RS"},{label:"Royal Air Force",value:"RR"},{label:"Royal Air Maroc",value:"AT"},{label:"Royal Airlines",value:"R0"},{label:"Royal Airways",value:"KG"},{label:"Royal Aruban Airline",value:"V5"},{label:"Royal Britain",value:"7V"},{label:"Royal Brunei Airlines",value:"BI"},{label:"Royal Falcon",value:"RL"},{label:"Royal Jordanian",value:"RJ"},{label:"Royal Khmer Airlines",value:"RK"},{label:"Royal Nepal Airlines",value:"RA"},{label:"Royal Southern Airlines.",value:"R1"},{label:"Royal Tongan Airlines",value:"WR"},{label:"Russian Sky Airlines",value:"P7"},{label:"Rwandair Express",value:"WB"},{label:"Ryan International Airlines",value:"RD"},{label:"Ryanair",value:"FR"},{label:"R�gional",value:"YS"},{label:"S7 Airlines",value:"S7"},{label:"Saeta",value:"EH"},{label:"Safair",value:"FA"},{label:"Salsa D,,haiti",value:"SO"},{label:"Sama Airlines",value:"ZS"},{label:"Samara Airlines",value:"E5"},{label:"Samurai Airlines",value:"07"},{label:"San Juan Airlines",value:"2G"},{label:"Santa Barbara Airlines",value:"S3"},{label:"Saratov Aviation Division",value:"6W"},{label:"Sat Airlines",value:"HZ"},{label:"Sata Air Acores",value:"SP"},{label:"Sata International",value:"S4"},{label:"Satena",value:"9R"},{label:"Saudi Arabian Airlines",value:"SV"},{label:"Scandinavian Airlines System",value:"SK"},{label:"Scat Air",value:"DV"},{label:"Scoot",value:"TZ"},{label:"Seaborne Airlines",value:"BB"},{label:"Seaport Airlines",value:"K5"},{label:"Senegal Airlines",value:"DN"},{label:"Serbian Airlines",value:"S1"},{label:"Servicios De Transportes A",value:"FS"},{label:"Shaheen Air International",value:"NL"},{label:"Shandong Airlines",value:"SC"},{label:"Shanghai Airlines",value:"FM"},{label:"Shanxi Airlines",value:"8C"},{label:"Sharp Airlines",value:"SH"},{label:"Shenzhen Airlines",value:"ZH"},{label:"Shovkoviy Shlyah",value:"S8"},{label:"Shuttle America",value:"S5"},{label:"Sibaviatrans",value:"5M"},{label:"Sichuan Airlines",value:"3U"},{label:"Siem Reap Airways",value:"FT"},{label:"Sierra National Airlines",value:"LJ"},{label:"Silk Way Airlines",value:"ZP"},{label:"Silkair",value:"MI"},{label:"Singapore Airlines Cargo",value:"SQ"},{label:"Singapore Airlines",value:"SQ"},{label:"Sita",value:"XS"},{label:"Skagway Air Service",value:"N5"},{label:"Sky Airline",value:"H2"},{label:"Sky Express",value:"G3"},{label:"Sky Express",value:"XW"},{label:"Sky Eyes",value:"I6"},{label:"Sky Regional",value:"RS"},{label:"Sky Trek International Airlines",value:"1I"},{label:"Sky Wing Pacific",value:"C7"},{label:"Sky Work Airlines",value:"SX"},{label:"Skybus Airlines",value:"SX"},{label:"Skyeurope",value:"NE"},{label:"Skyjet Airlines",value:"UQ"},{label:"Skyking Turks And Caicos Airways",value:"RU"},{label:"Skymark Airlines",value:"BC"},{label:"Skynet Airlines",value:"SI"},{label:"Skynet Asia Airways",value:"6J"},{label:"Skyservice Airlines",value:"5G"},{label:"Skywalk Airlines",value:"AL"},{label:"Skyways Express",value:"JZ"},{label:"Skywest",value:"OO"},{label:"Slok Air Gambia",value:"S0"},{label:"Slovak Airlines",value:"6Q"},{label:"Snowbird Airlines",value:"S8"},{label:"Sochi Air Chater",value:"Q3"},{label:"Sochi Air Express",value:"Q4"},{label:"Sochi Air",value:"CQ"},{label:"Solomon Airlines",value:"IE"},{label:"Sosoliso Airlines",value:"SO"},{label:"South African Airways",value:"SA"},{label:"South East Asian Airlines",value:"DG"},{label:"Southern Winds Airlines",value:"A4"},{label:"Southjet Cargo",value:"78"},{label:"Southjet Connect",value:"77"},{label:"Southjet",value:"76"},{label:"Southwest Airlines",value:"WN"},{label:"Spanair",value:"JK"},{label:"Spicejet",value:"SG"},{label:"Spike Airlines",value:"S0"},{label:"Spirit Airlines",value:"NK"},{label:"Spirit Of Manila Airlines",value:"SM"},{label:"Spring Airlines Japan",value:"IJ"},{label:"Spring Airlines",value:"9S"},{label:"Srilankan Airlines",value:"UL"},{label:"Sriwijaya Air",value:"SJ"},{label:"Star Flyer",value:"7G"},{label:"Star1 Airlines",value:"V9"},{label:"Starling Airlines Spain",value:"SX"},{label:"Sterling Airlines",value:"NB"},{label:"Stp Airways",value:"8F"},{label:"Sudan Airways",value:"SD"},{label:"Sun Air (fiji)",value:"PI"},{label:"Sun Air Of Scandinavia",value:"EZ"},{label:"Sun Country Airlines",value:"SY"},{label:"Sun Dor",value:"7L"},{label:"Sunexpress",value:"XQ"},{label:"Sunshine Express Airlines",value:"CQ"},{label:"Sunwing Airlines",value:"WG"},{label:"Superior Aviation",value:"SO"},{label:"Surinam Airways",value:"PY"},{label:"Svyaz Rossiya",value:"7R"},{label:"Swe Fly",value:"WV"},{label:"Swedjet Airways",value:"VD"},{label:"Swedline Express",value:"SM"},{label:"Swiss International Air Lines",value:"LX"},{label:"Swissair",value:"SR"},{label:"Syrian Arab Airlines",value:"RB"},{label:"T.j. Air",value:"TJ"},{label:"Taag Angola Airlines",value:"DT"},{label:"Tacv",value:"VR"},{label:"Tam Brazilian Airlines",value:"JJ"},{label:"Tam Mercosur",value:"PZ"},{label:"Tame",value:"EQ"},{label:"Tampa",value:"QT"},{label:"Tandem Aero",value:"TQ"},{label:"Tap Portugal",value:"TP"},{label:"Tarom",value:"RO"},{label:"Tassili Airlines",value:"SF"},{label:"Tatarstan Airlines",value:"U9"},{label:"Tavrey Airlines",value:"T6"},{label:"Teamline Air",value:"L9"},{label:"Texas Spirit",value:"XS"},{label:"Texas Wings",value:"TQ"},{label:"Thai Air Cargo",value:"T2"},{label:"Thai Airasia",value:"FD"},{label:"Thai Airways International",value:"TG"},{label:"Thai Sky Airlines",value:"9I"},{label:"Thai Star Airlines",value:"T9"},{label:"Thomas Cook Airlines",value:"FQ"},{label:"Thomas Cook Airlines",value:"MT"},{label:"Thomsonfly",value:"BY"},{label:"Three",value:"H3"},{label:"Tiara Air",value:"3P"},{label:"Tiger Airways Australia",value:"TT"},{label:"Tiger Airways",value:"TR"},{label:"Titan Airways",value:"ZT"},{label:"Tnt Airways",value:"3V"},{label:"Tobruk Air",value:"7T"},{label:"Tol-air Services",value:"TI"},{label:"Tom,,s & Co Airliners",value:"&T"},{label:"Tomp Airlines",value:"ZT"},{label:"Tower Air",value:"FF"},{label:"Tramm Airlines",value:"9F"},{label:"Trans Maldivian Airways",value:"M8"},{label:"Trans Mediterranean Airlines",value:"TL"},{label:"Trans Pas Air",value:"T6"},{label:"Trans States Airlines",value:"AX"},{label:"Trans World Airlines",value:"TW"},{label:"Transaero Airlines",value:"UN"},{label:"Transasia Airways",value:"GE"},{label:"Transavia France",value:"TO"},{label:"Transavia Holland",value:"HV"},{label:"Transaviaexport",value:"AL"},{label:"Transbrasil Airlines",value:"TH"},{label:"Transeuropean Airlines",value:"UE"},{label:"Transholding System",value:"YO"},{label:"Transholding",value:"TI"},{label:"Transmeridian Airlines",value:"T9"},{label:"Transmile Air Services",value:"TH"},{label:"Transnusa Air",value:"M8"},{label:"Transrussiaairlines",value:"1E"},{label:"Transwest Air",value:"9T"},{label:"Trasbrasil",value:"TB"},{label:"Trast Aero",value:"S5"},{label:"Travel Service",value:"QS"},{label:"Tri-mg Intra Asia Airlines",value:"GY"},{label:"Trip Linhas A",value:"8R"},{label:"Tropic Air",value:"PM"},{label:"Tropical Airways",value:"M7"},{label:"Tropical Linhas Aereas",value:"T1"},{label:"Tui Airlines Belgium",value:"TB"},{label:"Tuifly Nordic",value:"6B"},{label:"Tuifly",value:"X3"},{label:"Tulip Air",value:"TD"},{label:"Tuninter",value:"UG"},{label:"Tunisair",value:"TU"},{label:"Turan Air",value:"3T"},{label:"Turkish Airlines",value:"TK"},{label:"Turkmenistan Airlines",value:"T5"},{label:"Tway Airlines",value:"TW"},{label:"Twin Jet",value:"T7"},{label:"Tyrolean Airways",value:"VO"},{label:"Ukraine International Airlines",value:"PS"},{label:"Ukrainian Cargo Airways",value:"6Z"},{label:"Um Airlines",value:"UF"},{label:"Uni Air",value:"B7"},{label:"United Airlines",value:"UA"},{label:"United Airways",value:"4H"},{label:"United Parcel Service",value:"5X"},{label:"Ural Airlines",value:"U6"},{label:"Us Airways",value:"US"},{label:"Usa Jet Airlines",value:"U7"},{label:"Usa Sky Cargo",value:"E1"},{label:"Usa3000 Airlines",value:"U5"},{label:"Utair Aviation",value:"UT"},{label:"Uzbekistan Airways",value:"HY"},{label:"V Air",value:"ZV"},{label:"V Australia Airlines",value:"VA"},{label:"Valuair",value:"VF"},{label:"Valuejet",value:"J7"},{label:"Varig Log",value:"LC"},{label:"Vasp",value:"VP"},{label:"Via Conectia Airlines",value:"6V"},{label:"Via L�neas A�reas",value:"V1"},{label:"Viaggio Air",value:"VM"},{label:"Vickjet",value:"KT"},{label:"Vietnam Airlines",value:"VN"},{label:"Viking Hellas",value:"VQ"},{label:"Vim Airlines",value:"NN"},{label:"Virgin America",value:"VX"},{label:"Virgin Atlantic Airways",value:"VS"},{label:"Virgin Australia",value:"VA"},{label:"Virgin Blue",value:"DJ"},{label:"Virgin Express",value:"TV"},{label:"Virgin Nigeria Airways",value:"VK"},{label:"Virgin Pacific",value:"VH"},{label:"Virginwings",value:"YY"},{label:"Vision Airlines (v2)",value:"V2"},{label:"Viva Macau",value:"ZG"},{label:"Vivacolombia",value:"5Z"},{label:"Vladivostok Air",value:"XF"},{label:"Vlm Airlines",value:"VG"},{label:"Voestar",value:"8K"},{label:"Volare Airlines",value:"VE"},{label:"Volaris",value:"Y4"},{label:"Volga-dnepr Airlines",value:"VI"},{label:"Volotea Airways",value:"V7"},{label:"Volotea Costa Rica",value:"9V"},{label:"Voyageur Airways",value:"VC"},{label:"Vrg Linhas Aereas",value:"RG"},{label:"Vuela Cuba",value:"6C"},{label:"Vueling Airlines",value:"VY"},{label:"Vuola Italia",value:"4S"},{label:"Webjet Linhas A",value:"WJ"},{label:"Welcome Air",value:"2W"},{label:"West Air China",value:"PN"},{label:"West Air Sweden",value:"PT"},{label:"Western Airlines",value:"WA"},{label:"Westjet Encore",value:"WR"},{label:"Westjet",value:"WS"},{label:"Westward Airways",value:"CN"},{label:"Wider�e",value:"WF"},{label:"Wind Jet",value:"IV"},{label:"Wings Air",value:"IW"},{label:"Wings Of Alaska",value:"K5"},{label:"Wizz Air Hungary",value:"8Z"},{label:"Wizz Air Ukraine",value:"WU"},{label:"Wizz Air",value:"W6"},{label:"World Airways",value:"WO"},{label:"World Experience Airline",value:"W1"},{label:"World Scale Airlines",value:"W3"},{label:"Worldways",value:"WG"},{label:"Wright Air Service",value:"8V"},{label:"Xair Usa",value:"XA"},{label:"Xiamen Airlines",value:"MF"},{label:"Xl Airways France",value:"SE"},{label:"Xpto",value:"XP"},{label:"Xtra Airways",value:"XP"},{label:"Yamal Airlines",value:"YL"},{label:"Yangtze River Express",value:"Y8"},{label:"Yellowtail",value:"YE"},{label:"Yemenia",value:"IY"},{label:"Yunnan Airlines",value:"3Q"},{label:"ZIP",value:"3J"},{label:"Zabaikal Airlines",value:"Z6"},{label:"Zabaykalskii Airlines",value:"ZP"},{label:"Zambian Airways",value:"Q3"},{label:"Zenith International Airline",value:"ZN"},{label:"Zimex Aviation",value:"C4"},{label:"Zoom Airlines",value:"Z4"},{label:"Zuliana De Aviacion",value:"OD"}],e.AuthInfo=yi,e.BaseAcceptNewPriceUpdater=Gi,e.BaseAddGuestToBasketItemUpdater=fa,e.BaseAddItemToBasketUpdater=Vi,e.BaseAddRedirectApproverUpdater=va,e.BaseAddUserToBasketItemUpdater=Wi,e.BaseApplyJitFlightRulesFetcher=tr,e.BaseBookBasketUpdater=Qi,e.BaseCabhireQuoteFetcher=nr,e.BaseCancelBookingUpdater=ua,e.BaseCarHireAvailabilityDetailFetcher=or,e.BaseCarhireQuoteFetcher=sr,e.BaseConfermaOfficeFetcher=ur,e.BaseConfermaOfficeNamesFetcher=lr,e.BaseConfirmMessagesUpdater=la,e.BaseCreateBasketUpdater=Ji,e.BaseCreateGuestUpdater=ma,e.BaseDeleteBasketUpdater=Ki,e.BaseDeleteFavouriteSearchUpdater=da,e.BaseDeleteRecentSearchUpdater=Zi,e.BaseDeleteUserAddressUpdater=Xi,e.BaseEditUserUpdater=pa,e.BaseEmailBasketFetcher=zr,e.BaseEmailFerryBookingFetcher=ci,e.BaseEnterpriseBasketService=Si,e.BaseEnterpriseMyBookingsService=_i,e.BaseEnterpriseSearch=c,e.BaseEnterpriseSearchService=Ni,e.BaseEnvironment=nt,e.BaseEurostarQuoteFetcher=dr,e.BaseEventMessenager=lt,e.BaseFastTrackQuoteFetcher=$r,e.BaseFlightQuoteFetcher=pr,e.BaseGenerateBasketPdfFetcher=ni,e.BaseGetAllAirlinesFetcher=ii,e.BaseGetBasketFetcher=ar,e.BaseGetCancellationInfoFetcher=oi,e.BaseGetCarHireProvidersFetcher=ai,e.BaseGetCompaniesFetcher=Xr,e.BaseGetCompanyFetcher=Zr,e.BaseGetConfermaRoomImagesFetcher=qr,e.BaseGetCovidMicrositeTokenFetcher=mr,e.BaseGetFlightFareRulesFetcher=hr,e.BaseGetFlightSeatMapFetcher=Yr,e.BaseGetHotelChainsFetcher=ti,e.BaseGetIrlSupplierStationFetcher=br,e.BaseGetMiAutoSugestionFetcher=Dr,e.BaseGetOfficeFetcher=li,e.BaseGetRailLiveDeparturesFetcher=vr,e.BaseGetRailProvidersFetcher=ri,e.BaseGetRailStationFetcher=yr,e.BaseGetRailcardsFetcher=fr,e.BaseGetRiskAlertsFetcher=gr,e.BaseGetUserBasketsFetcher=Tr,e.BaseGetUserCompanyOfficesFetcher=Sr,e.BaseGetUserCurrentCarbonAllowanceFetcher=Cr,e.BaseGetUserDefaultMIValueFetcher=ui,e.BaseGetUserFavouriteSearchesFetcher=Kr,e.BaseGetUserFetcher=Vr,e.BaseGetUserGuestsFetcher=si,e.BaseGetUserRecentSearchesFetcher=Ar,e.BaseHelperRoutines=$e,e.BaseHotelAvalibilityQuoteFetcher=Pr,e.BaseHotelAvalibilityService=Ai,e.BaseHotelQuoteFetcher=Fr,e.BaseHotelRulesFetcher=ir,e.BaseIrlDiscountCardFetcher=kr,e.BaseIrlQuoteFetcher=_r,e.BaseLogonService=Fi,e.BaseLoungeQuoteFetcher=Rr,e.BaseModalOpenerService=ki,e.BaseNetworkCall=h,e.BaseParkingQuoteFetcher=Ir,e.BaseRailQuoteFetcher=Or,e.BaseRedirectApproverFetcher=di,e.BaseRemoveItemFromBasketUpdater=qi,e.BaseRemoveRedirectApproverUpdater=ya,e.BaseRequiresReasonService=bi,e.BaseRevalidateBasketUpdater=zi,e.BaseRouteHappyService=wi,e.BaseSaveFavouriteSearchUpdater=ca,e.BaseSaveRecentSearchUpdater=oa,e.BaseSaveUserAddressUpdater=$i,e.BaseSearchAirlinesFetcher=Er,e.BaseSearchAirportsFetcher=Br,e.BaseSearchCityFetcher=Nr,e.BaseSearchCompanyApproversFetcher=hi,e.BaseSearchConfermaCityFetcher=Mr,e.BaseSearchConfermaQuicklistFetcher=cr,e.BaseSearchDepotFetcher=Lr,e.BaseSearchHotelChainsFetcher=wr,e.BaseSearchIrlStationsFetcher=jr,e.BaseSearchPostcodeFetcher=Ur,e.BaseSearchRailStationsFetcher=Hr,e.BaseSearchUsersCanBookForFetcher=xr,e.BaseSendBasketForApprovalUpdater=ea,e.BaseSendOfflineNotificationFetcher=ei,e.BaseSetBasketItemLeadPassengerUpdater=ta,e.BaseSetBasketItemMiGroupUpdater=ra,e.BaseSetBasketItemMiValueUpdater=ia,e.BaseSetPaymentOptionUpdater=sa,e.BaseSetUserLanguageUpdater=ha,e.BaseStorageService=Mi,e.BaseUpdateBasketNoteUpdater=na,e.BaseUpdateBasketTitleUpdater=aa,e.BaseUserAddressesFetcher=Gr,e.BaseUserMessagesFetcher=Wr,e.BaseUserProductsFetcher=Qr,e.BaseUserService=Pi,e.BaseUserUiConfigsFetcher=Jr,e.BaseValidateIsPostcodeValidTester=Hi,e.BaseValidateMiFreeValueTester=Ui,e.BaseWebTokenService=Li,e.BasemoveBasketItemToBasket=Yi,e.BasketInfoMiDetailsImpl=ke,e.BookableBasket=Qe,e.CabHireEnterpriseSearch=rt,e.CarCompanies=[{label:"Advantage Rent A Car",value:"Advantage Rent A Car"},{label:"Alamo",value:"Alamo"},{label:"Avis",value:"Avis"},{label:"Budget Rent A Car",value:"Budget Rent A Car"},{label:"Dollar Rent A Car",value:"Dollar Rent A Car"},{label:"Enterprise",value:"Enterprise"},{label:"Euromobil",value:"Euromobil"},{label:"Europcar",value:"Europcar"},{label:"Fox Rent A Car",value:"Fox Rent A Car"},{label:"Hertz",value:"Hertz"},{label:"National Car Rental System",value:"National Car Rental System"},{label:"Payless Car Rental",value:"Payless Car Rental"},{label:"Sixt",value:"Sixt"},{label:"Southwest Car Rental",value:"Southwest Car Rental"},{label:"Thrifty Car Rental",value:"Thrifty Car Rental"}],e.CarhireEnterpriseSearch=it,e.DEFAULT_FLIGHT_FILTERS=ct,e.DistanceType=Ve,e.DocTypes=xe,e.EurostarEnterpriseSearch=Bt,e.FlightEnterpriseSearch=St,e.Genders=Ge,e.HotelChains=[{label:"Abba Hotels",value:"Abba Hotels"},{label:"Abode Hotels",value:"Abode Hotels"},{label:"AC Hotels",value:"AC Hotels"},{label:"Accor Group",value:"Accor Group"},{label:"Accor",value:"Accor"},{label:"Adam's Mark",value:"Adam's Mark"},{label:"Affinia Hotels",value:"Affinia Hotels"},{label:"Alias Hotels",value:"Alias Hotels"},{label:"Amber Hotels Germany",value:"Amber Hotels Germany"},{label:"Americas Best Value Inns",value:"Americas Best Value Inns"},{label:"Americinn",value:"Americinn"},{label:"Amerihost Inn",value:"Amerihost Inn"},{label:"Amerisuites",value:"Amerisuites"},{label:"Ana Hotels",value:"Ana Hotels"},{label:"Antoinette Hotels",value:"Antoinette Hotels"},{label:"Apex Hotels",value:"Apex Hotels"},{label:"Arora International",value:"Arora International"},{label:"Ascott Group",value:"Ascott Group"},{label:"Atel Htl Network",value:"Atel Htl Network"},{label:"Austria Trend Hotel & Resorts",value:"Austria Trend Hotel & Resorts"},{label:"Barcelo Hotels",value:"Barcelo Hotels"},{label:"Bastion Hotels",value:"Bastion Hotels"},{label:"Baymont",value:"Baymont"},{label:"Beales Hotels",value:"Beales Hotels"},{label:"Best Eastern",value:"Best Eastern"},{label:"Best Inns",value:"Best Inns"},{label:"Best Western Hotels",value:"Best Western Hotels"},{label:"Bewleys",value:"Bewleys"},{label:"Bilderberg Group",value:"Bilderberg Group"},{label:"Blue Tree Hotels",value:"Blue Tree Hotels"},{label:"Boscolo Hotels",value:"Boscolo Hotels"},{label:"Brend Hotel Group",value:"Brend Hotel Group"},{label:"Bridgestreet",value:"Bridgestreet"},{label:"Britannia",value:"Britannia"},{label:"Caesar Park Hotels",value:"Caesar Park Hotels"},{label:"Cairn Hotels",value:"Cairn Hotels"},{label:"Camino Real",value:"Camino Real"},{label:"Campanile",value:"Campanile"},{label:"Candlewood Suites",value:"Candlewood Suites"},{label:"Carlton Hotel Collection",value:"Carlton Hotel Collection"},{label:"Castle Hotel Group",value:"Castle Hotel Group"},{label:"Cedar Court Hotels",value:"Cedar Court Hotels"},{label:"Cendant",value:"Cendant"},{label:"Choice Hotels",value:"Choice Hotels"},{label:"Citadine Hotels",value:"Citadine Hotels"},{label:"Clarion Hotels",value:"Clarion Hotels"},{label:"Clifton Hotels",value:"Clifton Hotels"},{label:"Club Quarters Hotels",value:"Club Quarters Hotels"},{label:"Coast Hotels & Resorts",value:"Coast Hotels & Resorts"},{label:"Comfort",value:"Comfort"},{label:"Concorde Hotels",value:"Concorde Hotels"},{label:"Conrad Hotels",value:"Conrad Hotels"},{label:"Contemporary Hotels",value:"Contemporary Hotels"},{label:"Copthorne & Millennium Hotels",value:"Copthorne & Millennium Hotels"},{label:"Corus",value:"Corus"},{label:"Country Inn & Suites Hotels",value:"Country Inn & Suites Hotels"},{label:"Courtyard By Marriott",value:"Courtyard By Marriott"},{label:"Crerar Hotels",value:"Crerar Hotels"},{label:"Crowne Plaza",value:"Crowne Plaza"},{label:"Cumulus Hotels",value:"Cumulus Hotels"},{label:"Dakota Hotel Group",value:"Dakota Hotel Group"},{label:"Dan Hotels Corporation",value:"Dan Hotels Corporation"},{label:"Days Inn",value:"Days Inn"},{label:"De Vere Hotels",value:"De Vere Hotels"},{label:"Delta Hotels",value:"Delta Hotels"},{label:"Derag Hotels",value:"Derag Hotels"},{label:"Design Hotels",value:"Design Hotels"},{label:"Destination Hotels",value:"Destination Hotels"},{label:"Dhillon Hotels",value:"Dhillon Hotels"},{label:"Disney World Hotels",value:"Disney World Hotels"},{label:"Distinct Hotels",value:"Distinct Hotels"},{label:"Distinguished Hotels",value:"Distinguished Hotels"},{label:"Dolce Hotels",value:"Dolce Hotels"},{label:"Dorint Hotels",value:"Dorint Hotels"},{label:"Doubletree Hotels",value:"Doubletree Hotels"},{label:"Doyle Collection",value:"Doyle Collection"},{label:"Drury Inn & Suites",value:"Drury Inn & Suites"},{label:"Econo Lodge",value:"Econo Lodge"},{label:"Elizabeth Hotels",value:"Elizabeth Hotels"},{label:"Embassy Suites",value:"Embassy Suites"},{label:"English Lakes Hotels",value:"English Lakes Hotels"},{label:"English Rose Hotels",value:"English Rose Hotels"},{label:"Etap",value:"Etap"},{label:"Eton Town House Group",value:"Eton Town House Group"},{label:"Exclusive Hotels",value:"Exclusive Hotels"},{label:"Executive Hotels And Resorts",value:"Executive Hotels And Resorts"},{label:"Extended Stayamerica",value:"Extended Stayamerica"},{label:"Fairfield Inn",value:"Fairfield Inn"},{label:"Fairmont Hotels",value:"Fairmont Hotels"},{label:"Fiesta Americana",value:"Fiesta Americana"},{label:"Fine Individual Hotels",value:"Fine Individual Hotels"},{label:"Firmdale Hotels",value:"Firmdale Hotels"},{label:"First Hotels",value:"First Hotels"},{label:"FJB Hotels",value:"FJB Hotels"},{label:"Focus Hotels",value:"Focus Hotels"},{label:"Folio Hotels",value:"Folio Hotels"},{label:"Forestdale Hotels",value:"Forestdale Hotels"},{label:"Formule 1",value:"Formule 1"},{label:"Four Pillars",value:"Four Pillars"},{label:"Four Seasons",value:"Four Seasons"},{label:"Fullers Hotels & Inns",value:"Fullers Hotels & Inns"},{label:"Gaylord Entertainment",value:"Gaylord Entertainment"},{label:"Genares Resrv SVC",value:"Genares Resrv SVC"},{label:"Golden Tulip",value:"Golden Tulip"},{label:"Grand Hospitality",value:"Grand Hospitality"},{label:"Grange Hotels",value:"Grange Hotels"},{label:"Great Southern Hotel Group",value:"Great Southern Hotel Group"},{label:"Greene King Pub Company",value:"Greene King Pub Company"},{label:"Gresham Hotel Group",value:"Gresham Hotel Group"},{label:"Guesthouse International",value:"Guesthouse International"},{label:"Guoman Hotel",value:"Guoman Hotel"},{label:"Hampton Inn",value:"Hampton Inn"},{label:"Hand Picked Hotels",value:"Hand Picked Hotels"},{label:"Hanover International Hotels",value:"Hanover International Hotels"},{label:"Harrahs Casinos",value:"Harrahs Casinos"},{label:"Hastings Hotels",value:"Hastings Hotels"},{label:"Hawthorn Suites",value:"Hawthorn Suites"},{label:"Heritage Serviced Apartments",value:"Heritage Serviced Apartments"},{label:"Hesperia Hotels",value:"Hesperia Hotels"},{label:"Hilton Garden Inn",value:"Hilton Garden Inn"},{label:"Hilton Hotels",value:"Hilton Hotels"},{label:"Historic House Hotels",value:"Historic House Hotels"},{label:"Holiday Inn Express",value:"Holiday Inn Express"},{label:"Holiday Inn Garden Court",value:"Holiday Inn Garden Court"},{label:"Holiday Inns",value:"Holiday Inns"},{label:"Homestead",value:"Homestead"},{label:"Homewood Suites By Hilton",value:"Homewood Suites By Hilton"},{label:"Hotel Indigo",value:"Hotel Indigo"},{label:"Hotel Sierra",value:"Hotel Sierra"},{label:"Hotusa",value:"Hotusa"},{label:"Howard Johnson",value:"Howard Johnson"},{label:"Hyatt",value:"Hyatt"},{label:"Ibis",value:"Ibis"},{label:"Indigo Hotels",value:"Indigo Hotels"},{label:"Innkeepers Lodge",value:"Innkeepers Lodge"},{label:"Inter Hotel",value:"Inter Hotel"},{label:"Intercontinental",value:"Intercontinental"},{label:"Interstate Htls/rsrts",value:"Interstate Htls/rsrts"},{label:"Jameson Inn",value:"Jameson Inn"},{label:"Joie De Vivre Hospitality",value:"Joie De Vivre Hospitality"},{label:"Jolly Hotels",value:"Jolly Hotels"},{label:"Jumeirah Hotels",value:"Jumeirah Hotels"},{label:"Jurys Hotel Group",value:"Jurys Hotel Group"},{label:"Kempinski Hotels",value:"Kempinski Hotels"},{label:"Keytel International",value:"Keytel International"},{label:"Kimpton Group",value:"Kimpton Group"},{label:"Knights Inn",value:"Knights Inn"},{label:"KSL Resorts",value:"KSL Resorts"},{label:"Kyriad Hotels",value:"Kyriad Hotels"},{label:"La Quinta Inns",value:"La Quinta Inns"},{label:"Lakeside Hotels",value:"Lakeside Hotels"},{label:"Lakeside International",value:"Lakeside International"},{label:"Le Meridien Hotels",value:"Le Meridien Hotels"},{label:"Leading Hotels Of The World",value:"Leading Hotels Of The World"},{label:"Legacy Hotels",value:"Legacy Hotels"},{label:"Lindner Hotels",value:"Lindner Hotels"},{label:"Loews",value:"Loews"},{label:"Luxe Worldwide Hotels",value:"Luxe Worldwide Hotels"},{label:"Lynch Group ",value:"Lynch Group "},{label:"Macdonald Hotels",value:"Macdonald Hotels"},{label:"Magnolia Hotels",value:"Magnolia Hotels"},{label:"Mainstay Suites",value:"Mainstay Suites"},{label:"Maldron",value:"Maldron"},{label:"Malmaison",value:"Malmaison"},{label:"Mandarin Oriental",value:"Mandarin Oriental"},{label:"Mantra Group",value:"Mantra Group"},{label:"Marco Polo Hotels",value:"Marco Polo Hotels"},{label:"Maritim Hotels",value:"Maritim Hotels"},{label:"Maritime Inns and Resorts",value:"Maritime Inns and Resorts"},{label:"Marriott Hotels",value:"Marriott Hotels"},{label:"Menzies",value:"Menzies"},{label:"Mercure",value:"Mercure"},{label:"Mg Hotels",value:"Mg Hotels"},{label:"Mgm/mirage",value:"Mgm/mirage"},{label:"Microtel Inn & Suites",value:"Microtel Inn & Suites"},{label:"Minotel",value:"Minotel"},{label:"Mint Hotels",value:"Mint Hotels"},{label:"Moevenpick Hotels",value:"Moevenpick Hotels"},{label:"Montcalm Hotel Group",value:"Montcalm Hotel Group"},{label:"Moran Group",value:"Moran Group"},{label:"Morgans Hotel Group",value:"Morgans Hotel Group"},{label:"Motel 6",value:"Motel 6"},{label:"Myfidelio",value:"Myfidelio"},{label:"Myhotel",value:"Myhotel"},{label:"New Otani Hotels",value:"New Otani Hotels"},{label:"NH Hotels",value:"NH Hotels"},{label:"Nikko Hotels",value:"Nikko Hotels"},{label:"Nobles House Hotel",value:"Nobles House Hotel"},{label:"Non Branded Hotel",value:"Non Branded Hotel"},{label:"Novotel",value:"Novotel"},{label:"Oberoi Group Of Hotels",value:"Oberoi Group Of Hotels"},{label:"O'Callaghan Hotels",value:"O'Callaghan Hotels"},{label:"Occidental Hotels",value:"Occidental Hotels"},{label:"Omni Hotels",value:"Omni Hotels"},{label:"Orbis Hotels",value:"Orbis Hotels"},{label:"Orient Express Hotels",value:"Orient Express Hotels"},{label:"Outrigger Hotels",value:"Outrigger Hotels"},{label:"Oxford Hotel & Inns Managment Ltd",value:"Oxford Hotel & Inns Managment Ltd"},{label:"Pan Pacific Hotels",value:"Pan Pacific Hotels"},{label:"Park Inn International",value:"Park Inn International"},{label:"Park Plaza Hotels",value:"Park Plaza Hotels"},{label:"Park Plaza International",value:"Park Plaza International"},{label:"Parkhotel",value:"Parkhotel"},{label:"Peabody Hotels",value:"Peabody Hotels"},{label:"Pedersen Group",value:"Pedersen Group"},{label:"Peel Hotels",value:"Peel Hotels"},{label:"Peninsula Hotels",value:"Peninsula Hotels"},{label:"Preferred Hotels & Resorts Worldwide",value:"Preferred Hotels & Resorts Worldwide"},{label:"Prem Group",value:"Prem Group"},{label:"Premier Inn",value:"Premier Inn"},{label:"Prima Hotels",value:"Prima Hotels"},{label:"Prince Resorts",value:"Prince Resorts"},{label:"Principal Hayley Hotels & Conference Venues",value:"Principal Hayley Hotels & Conference Venues"},{label:"Protea Hotels",value:"Protea Hotels"},{label:"Pullman",value:"Pullman"},{label:"Punch Retail",value:"Punch Retail"},{label:"Purple Hotels",value:"Purple Hotels"},{label:"Q Hotels",value:"Q Hotels"},{label:"Quality Inns & Suites",value:"Quality Inns & Suites"},{label:"Radisson Blu Hotels",value:"Radisson Blu Hotels"},{label:"Radisson Edwardian Hotels",value:"Radisson Edwardian Hotels"},{label:"Radisson",value:"Radisson"},{label:"Raffles International",value:"Raffles International"},{label:"Ramada",value:"Ramada"},{label:"Reconline",value:"Reconline"},{label:"Red Carnation Hotels",value:"Red Carnation Hotels"},{label:"Red Roof Inns",value:"Red Roof Inns"},{label:"Regent International",value:"Regent International"},{label:"Relais & Chateaux",value:"Relais & Chateaux"},{label:"Relaxinnz",value:"Relaxinnz"},{label:"Rema Hotels",value:"Rema Hotels"},{label:"Renaissance Hotels",value:"Renaissance Hotels"},{label:"Reservhotel Intl",value:"Reservhotel Intl"},{label:"Residence Inns",value:"Residence Inns"},{label:"ResortQuest",value:"ResortQuest"},{label:"Rihga Royal Hotels",value:"Rihga Royal Hotels"},{label:"Ringhotels",value:"Ringhotels"},{label:"Ritz Carlton",value:"Ritz Carlton"},{label:"Roadchef",value:"Roadchef"},{label:"Rocco Forte Hotels",value:"Rocco Forte Hotels"},{label:"Rock Resorts",value:"Rock Resorts"},{label:"Rodeway Inns",value:"Rodeway Inns"},{label:"Rosewood Hotels",value:"Rosewood Hotels"},{label:"Rotana",value:"Rotana"},{label:"Rydges Hotel Group",value:"Rydges Hotel Group"},{label:"Saco Serviced Apartments",value:"Saco Serviced Apartments"},{label:"Sandman Hotels",value:"Sandman Hotels"},{label:"Sarova",value:"Sarova"},{label:"Savoy Group",value:"Savoy Group"},{label:"Scandic",value:"Scandic"},{label:"Select Hotels",value:"Select Hotels"},{label:"Self Catering Accommodation",value:"Self Catering Accommodation"},{label:"Sercotel",value:"Sercotel"},{label:"Seymour Hotels",value:"Seymour Hotels"},{label:"Shangri-La Hotels & Resorts",value:"Shangri-La Hotels & Resorts"},{label:"Sheraton Hotels",value:"Sheraton Hotels"},{label:"Shilo Inns",value:"Shilo Inns"},{label:"Shire Hotels Limited",value:"Shire Hotels Limited"},{label:"Sierra Suites",value:"Sierra Suites"},{label:"Sleep Inns",value:"Sleep Inns"},{label:"Sleepy Dragon Hotels",value:"Sleepy Dragon Hotels"},{label:"Small Luxury Hotels Of World",value:"Small Luxury Hotels Of World"},{label:"Sofitel",value:"Sofitel"},{label:"Sol / Melia Hotels",value:"Sol / Melia Hotels"},{label:"Sonesta Hotels",value:"Sonesta Hotels"},{label:"Sorat Hotels",value:"Sorat Hotels"},{label:"Southern Sun Hotels",value:"Southern Sun Hotels"},{label:"Spirit Hotels",value:"Spirit Hotels"},{label:"Springhill Suites",value:"Springhill Suites"},{label:"Starhotels",value:"Starhotels"},{label:"Staybridge Suites",value:"Staybridge Suites"},{label:"Stop Inn",value:"Stop Inn"},{label:"Studio 6",value:"Studio 6"},{label:"Suitehotel",value:"Suitehotel"},{label:"Summerfield Suites",value:"Summerfield Suites"},{label:"Summit Hotels",value:"Summit Hotels"},{label:"Super 8",value:"Super 8"},{label:"Supranational Hotels",value:"Supranational Hotels"},{label:"Surejogi Group",value:"Surejogi Group"},{label:"Swallow Hotels",value:"Swallow Hotels"},{label:"Swissotel",value:"Swissotel"},{label:"Synxis Corp",value:"Synxis Corp"},{label:"Taj Hotels & Resorts",value:"Taj Hotels & Resorts"},{label:"Thelsa Group",value:"Thelsa Group"},{label:"Thistle Hotels",value:"Thistle Hotels"},{label:"Tomahawk Hotels",value:"Tomahawk Hotels"},{label:"Top International Hotels",value:"Top International Hotels"},{label:"Tower Hotels Group",value:"Tower Hotels Group"},{label:"Towneplace Suites",value:"Towneplace Suites"},{label:"Travelclick",value:"Travelclick"},{label:"Travelodge International",value:"Travelodge International"},{label:"Travelodge UK & Ireland",value:"Travelodge UK & Ireland"},{label:"Trident Hotels",value:"Trident Hotels"},{label:"Una Hotels",value:"Una Hotels"},{label:"Unirez",value:"Unirez"},{label:"Universal Orlando",value:"Universal Orlando"},{label:"Utell",value:"Utell"},{label:"Vagabond Inns",value:"Vagabond Inns"},{label:"Van Der Valk Hotels",value:"Van Der Valk Hotels"},{label:"Village Hotels",value:"Village Hotels"},{label:"Von Essen Hotels",value:"Von Essen Hotels"},{label:"W Hotels",value:"W Hotels"},{label:"Warwick Hotels",value:"Warwick Hotels"},{label:"Westin Hotels",value:"Westin Hotels"},{label:"Westmark Hotels",value:"Westmark Hotels"},{label:"Wingate Hotels",value:"Wingate Hotels"},{label:"Woodfin Suites",value:"Woodfin Suites"},{label:"Worldhotels",value:"Worldhotels"},{label:"Worldres",value:"Worldres"},{label:"Wyndham",value:"Wyndham"},{label:"Youngs & Co's Brewery",value:"Youngs & Co's Brewery"}],e.HotelEnterpriseSearch=Dt,e.HotelFilters=Tt,e.IRLEnterpriseSearch=Vt,e.InternalBasket=gi,e.LimitedCache=Ye,e.LoginError=fi,e.LoungesEnterpriseSearch=Pt,e.ManagementInfoAndIsValid=Ce,e.Memorise=Ke,e.ModalTypes=d,e.PREFERENCE_VALUES=He,e.ParkingEnterpriseSearch=Rt,e.PassengerAgeType=We,e.PersonTitles=[{title:"Dr",gender:null},{title:"Prof",gender:null},{title:"Mr",gender:"Male"},{title:"Mrs",gender:"Female"},{title:"Ms",gender:"Female"},{title:"Miss",gender:"Female"}],e.PhoneNumberImpl=Zt,e.RailCompanies=[{label:"Avanti West Coast",value:"Avanti West Coast"},{label:"East Coast",value:"East Coast"},{label:"IRL-Eurostar",value:"IRL-Eurostar"},{label:"IRL-Renfe Card",value:"IRL-Renfe Card"},{label:"IRL-SNCF - Carta Grand Voyageur",value:"IRL-SNCF - Carta Grand Voyageur"},{label:"IRL-Thalys",value:"IRL-Thalys"}],e.RailEnterpriseSearch=Ut,e.RegExps=pi,e.SupplementaryBookingInfoImpl=$t,e.Suppliers=ht,e.TravellerObject=Gt,e.USER_SIGNEDIN="USER_SIGNEDIN",e.USER_SIGNEDOUT=Di,e.UserFavorurite=dt,e.UserInfoImpl=zt,e.ValidatorChecker=ce,e.defaultValidations=_t,e.excludedExpression=Me,e.filtersKeys={chain:"chain",preferred:"preferred",amenitytype:"amenitytype",distanceRange:"distanceRange",extra:"extra",hotelName:"hotelName",priceRange:"priceRange",breakfastType:"breakfastType",accessibleRoomType:"accessibleRoomType"},e.includedAccessibilityExpression=Le,e.includedExpression=Ne,e.makeManagamentInfo=Fe,e.maxTravellerWellbeing=4,e.ɵ0=ot,e.ɵi=rr,e.ɵj=er,e.ɵk=xi,e.ɵl=ji,Object.defineProperty(e,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=sabstravtech-obtservices-base.umd.min.js.map