@sabstravtech/obtservices 0.0.22051001 → 0.0.26051001
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.
- package/angular/components/basket-panel.d.ts +1 -0
- package/angular/fetchers.d.ts +3 -0
- package/angular/lib/vendor/fetchers/get-companies.fetcher.d.ts +7 -0
- package/angular/lib/vendor/fetchers/get-company.fetcher.d.ts +7 -0
- package/angular/lib/vendor/fetchers/get-user-guests.fetcher.d.ts +7 -0
- package/angular/lib/vendor/services/enterprise-basket.service.d.ts +2 -1
- package/angular/lib/vendor/services/logon.service.d.ts +2 -1
- package/angular/lib/vendor/services/user.service.d.ts +7 -3
- package/angular/lib/vendor/types/graphql.angular.types.d.ts +268 -85
- package/angular/lib/vendor/updaters/create-guest-updater.d.ts +6 -0
- package/angular/sabstravtech-obtservices-angular.metadata.json +1 -1
- package/angular/updaters.d.ts +1 -0
- package/base/fetchers.d.ts +3 -0
- package/base/lib/vendor/classes/base-enterprise.d.ts +5 -1
- package/base/lib/vendor/classes/basket-info-mi-details.impl.d.ts +2 -0
- package/base/lib/vendor/classes/bookable-basket.d.ts +2 -0
- package/base/lib/vendor/classes/cabhire-enterprise-search.d.ts +4 -3
- package/base/lib/vendor/classes/carhire-enterprise-search.d.ts +4 -3
- package/base/lib/vendor/classes/eurostar-enterprise-search.d.ts +4 -4
- package/base/lib/vendor/classes/fast-track-enterprise-search.d.ts +3 -3
- package/base/lib/vendor/classes/flight-enterprise-search.d.ts +5 -5
- package/base/lib/vendor/classes/helpers.d.ts +6 -1
- package/base/lib/vendor/classes/hotel-enterprise-search.d.ts +6 -3
- package/base/lib/vendor/classes/irl-enterprise-search.d.ts +4 -4
- package/base/lib/vendor/classes/lounges-enterprise-search.d.ts +3 -3
- package/base/lib/vendor/classes/management-info-and-valid.d.ts +1 -1
- package/base/lib/vendor/classes/modal-types.enum.d.ts +1 -0
- package/base/lib/vendor/classes/parking-enterprise-search.d.ts +3 -3
- package/base/lib/vendor/classes/rail-enterprise-search.d.ts +9 -7
- package/base/lib/vendor/classes/supplementary-booking-info-impl.d.ts +5 -3
- package/base/lib/vendor/fetchers/get-companies.fetcher.d.ts +21 -0
- package/base/lib/vendor/fetchers/get-company.fetcher.d.ts +20 -0
- package/base/lib/vendor/fetchers/get-user-guests.fetcher.d.ts +20 -0
- package/base/lib/vendor/interfaces/Icabhire-enterprise-search.d.ts +1 -0
- package/base/lib/vendor/interfaces/Icarhire-enterprise-search.d.ts +3 -2
- package/base/lib/vendor/interfaces/Ienterprise-basket.service.d.ts +6 -5
- package/base/lib/vendor/interfaces/Ieurostar-enterprise-search.d.ts +1 -0
- package/base/lib/vendor/interfaces/Ifast-track-enterprise-search.d.ts +7 -5
- package/base/lib/vendor/interfaces/Iflight-enterprise-search.d.ts +2 -1
- package/base/lib/vendor/interfaces/Ihotel-enterprise-search.d.ts +5 -2
- package/base/lib/vendor/interfaces/Iirl-enterprise-search.d.ts +4 -3
- package/base/lib/vendor/interfaces/Ilounges-enterprise-search.d.ts +1 -0
- package/base/lib/vendor/interfaces/Iparking-enterprise-search.d.ts +1 -0
- package/base/lib/vendor/interfaces/Irail-enterprise-search.d.ts +5 -2
- package/base/lib/vendor/interfaces/Isearch.service.d.ts +4 -2
- package/base/lib/vendor/interfaces/Isupplementary-booking-info-impl.d.ts +3 -2
- package/base/lib/vendor/interfaces/Iuser.service.d.ts +1 -0
- package/base/lib/vendor/interfaces/car-hire-search-arg.interface.d.ts +2 -3
- package/base/lib/vendor/interfaces/summary-interface.d.ts +2 -0
- package/base/lib/vendor/interfaces/user.data.d.ts +1 -0
- package/base/lib/vendor/models/traveller.object.d.ts +1 -1
- package/base/lib/vendor/services/enterprise-basket.service.d.ts +18 -7
- package/base/lib/vendor/services/logon.service.d.ts +5 -1
- package/base/lib/vendor/services/search.service.d.ts +25 -22
- package/base/lib/vendor/services/url.service.d.ts +2 -0
- package/base/lib/vendor/services/user.service.d.ts +21 -5
- package/base/lib/vendor/services/webtoken.service.d.ts +4 -0
- package/base/lib/vendor/types/graphql.types.d.ts +245 -84
- package/base/lib/vendor/types/types.d.ts +16 -2
- package/base/lib/vendor/updaters/create-guest-updater.d.ts +19 -0
- package/base/sabstravtech-obtservices-base.d.ts +1 -1
- package/base/sabstravtech-obtservices-base.metadata.json +1 -1
- package/base/updaters.d.ts +1 -0
- package/bundles/sabstravtech-obtservices-angular.umd.js +366 -176
- package/bundles/sabstravtech-obtservices-angular.umd.js.map +1 -1
- package/bundles/sabstravtech-obtservices-angular.umd.min.js +1 -1
- package/bundles/sabstravtech-obtservices-angular.umd.min.js.map +1 -1
- package/bundles/sabstravtech-obtservices-base.umd.js +2019 -956
- package/bundles/sabstravtech-obtservices-base.umd.js.map +1 -1
- package/bundles/sabstravtech-obtservices-base.umd.min.js +2 -2
- package/bundles/sabstravtech-obtservices-base.umd.min.js.map +1 -1
- package/esm2015/angular/components/basket-panel.js +16 -7
- package/esm2015/angular/fetchers.js +4 -1
- package/esm2015/angular/lib/vendor/fetchers/get-companies.fetcher.js +25 -0
- package/esm2015/angular/lib/vendor/fetchers/get-company.fetcher.js +25 -0
- package/esm2015/angular/lib/vendor/fetchers/get-user-guests.fetcher.js +25 -0
- package/esm2015/angular/lib/vendor/services/enterprise-basket.service.js +8 -5
- package/esm2015/angular/lib/vendor/services/http-call.service.js +1 -1
- package/esm2015/angular/lib/vendor/services/logon.service.js +8 -5
- package/esm2015/angular/lib/vendor/services/search.service.js +1 -1
- package/esm2015/angular/lib/vendor/services/user.service.js +21 -9
- package/esm2015/angular/lib/vendor/services/webtoken.service.js +6 -2
- package/esm2015/angular/lib/vendor/types/graphql.angular.types.js +296 -70
- package/esm2015/angular/lib/vendor/updaters/create-guest-updater.js +22 -0
- package/esm2015/angular/updaters.js +2 -1
- package/esm2015/base/fetchers.js +4 -1
- package/esm2015/base/lib/vendor/classes/base-enterprise.js +8 -2
- package/esm2015/base/lib/vendor/classes/basket-info-mi-details.impl.js +14 -1
- package/esm2015/base/lib/vendor/classes/bookable-basket.js +27 -6
- package/esm2015/base/lib/vendor/classes/cabhire-enterprise-search.js +66 -11
- package/esm2015/base/lib/vendor/classes/carhire-enterprise-search.js +108 -61
- package/esm2015/base/lib/vendor/classes/eurostar-enterprise-search.js +115 -33
- package/esm2015/base/lib/vendor/classes/fast-track-enterprise-search.js +31 -10
- package/esm2015/base/lib/vendor/classes/flight-enterprise-search.js +196 -57
- package/esm2015/base/lib/vendor/classes/helpers.js +19 -3
- package/esm2015/base/lib/vendor/classes/hotel-enterprise-search.js +145 -36
- package/esm2015/base/lib/vendor/classes/irl-enterprise-search.js +100 -30
- package/esm2015/base/lib/vendor/classes/lounges-enterprise-search.js +40 -8
- package/esm2015/base/lib/vendor/classes/management-info-and-valid.js +13 -9
- package/esm2015/base/lib/vendor/classes/modal-types.enum.js +2 -1
- package/esm2015/base/lib/vendor/classes/parking-enterprise-search.js +39 -7
- package/esm2015/base/lib/vendor/classes/rail-enterprise-search.js +131 -20
- package/esm2015/base/lib/vendor/classes/supplementary-booking-info-impl.js +42 -4
- package/esm2015/base/lib/vendor/fetchers/get-companies.fetcher.js +11 -0
- package/esm2015/base/lib/vendor/fetchers/get-company.fetcher.js +11 -0
- package/esm2015/base/lib/vendor/fetchers/get-user-guests.fetcher.js +11 -0
- package/esm2015/base/lib/vendor/interfaces/Icabhire-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Icarhire-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Ienterprise-basket.service.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Ieurostar-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Ifast-track-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Iflight-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Ihotel-enterprise-search.js +2 -1
- package/esm2015/base/lib/vendor/interfaces/Iirl-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Ilounges-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Iparking-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Irail-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Isearch.service.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Isupplementary-booking-info-impl.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Iuser.service.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/car-hire-search-arg.interface.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/summary-interface.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/user.data.js +1 -1
- package/esm2015/base/lib/vendor/models/traveller.object.js +1 -1
- package/esm2015/base/lib/vendor/services/enterprise-basket.service.js +93 -30
- package/esm2015/base/lib/vendor/services/http-call.service.js +1 -1
- package/esm2015/base/lib/vendor/services/logon.service.js +37 -3
- package/esm2015/base/lib/vendor/services/requires-reason.service.js +14 -10
- package/esm2015/base/lib/vendor/services/search.service.js +77 -102
- package/esm2015/base/lib/vendor/services/url.service.js +3 -1
- package/esm2015/base/lib/vendor/services/user.service.js +45 -11
- package/esm2015/base/lib/vendor/services/webtoken.service.js +8 -1
- package/esm2015/base/lib/vendor/types/graphql.types.js +7 -2
- package/esm2015/base/lib/vendor/types/types.js +31 -14
- package/esm2015/base/lib/vendor/updaters/create-guest-updater.js +11 -0
- package/esm2015/base/sabstravtech-obtservices-base.js +1 -1
- package/esm2015/base/updaters.js +2 -1
- package/fesm2015/sabstravtech-obtservices-angular.js +449 -141
- package/fesm2015/sabstravtech-obtservices-angular.js.map +1 -1
- package/fesm2015/sabstravtech-obtservices-base.js +1383 -410
- package/fesm2015/sabstravtech-obtservices-base.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("rxjs"),require("rxjs/operators"),require("lodash"),require("moment"),require("ajv")):"function"==typeof define&&define.amd?define("@sabstravtech/obtservices/base",["exports","rxjs","rxjs/operators","lodash","moment","ajv"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).sabstravtech=e.sabstravtech||{},e.sabstravtech.obtservices=e.sabstravtech.obtservices||{},e.sabstravtech.obtservices.base={}),e.rxjs,e.rxjs.operators,e._,e.moment,e.Ajv)}(this,(function(e,t,r,a,i,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(a),l=o(i),u=o(n),c=function(){function e(e,r){this.storageService=e,this.helpers=r,this._cheapestResultPrice={amount:null,currencyCode:null},this.isValid=new t.BehaviorSubject(!1),this.results=new t.BehaviorSubject([]),this.multiResults=new t.BehaviorSubject([]),this.messages=new t.BehaviorSubject([]),this.messagesInfo=new t.BehaviorSubject([]),this.validationMessages=[],this.infoMessages=[],this.isLoading=new t.BehaviorSubject(!1),this.tempParams={},this.doChecks=!0,this.fullResults=[],this.fullMultiResults=[]}return Object.defineProperty(e.prototype,"cheapestPrice",{get:function(){return this._cheapestResultPrice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"originalUserSearch",{get:function(){return this._originalUserSearch},enumerable:!1,configurable:!0}),e.prototype.processResults=function(e){return e},e.prototype.updateTempParams=function(e){this.doChecks=!1,Object.assign(this,e),this._cheapestResultPrice=null,this.doChecks=!0},e.prototype._startSearch=function(e){var t=this;return this.isLoading.next(!0),this.fullResults=[],new Promise((function(i,n){try{e.pipe(r.take(1)).subscribe((function(e){console.log("Got results",a.cloneDeep(e)),t.fullResults=Object.freeze(t.processResults(e)),t._cheapestResultPrice=t.updateLowestPrice(t.fullResults),t.storageService.setSessionItem(t.resultsSessionName,t.makeSessionResults(t.fullResults)),t._applyFilter()}),(function(e){t.results.next([]),i(!1),t.isLoading.next(!1)}),(function(){t.isLoading.next(!1),i(0!==t.fullResults.length)}))}catch(e){t.storageService.setSessionItem(t.resultsSessionName,[]),t.isLoading.next(!1),t.results.next([]),n(e)}}))},e.prototype._startMultiSearch=function(e){var t=this;this.isLoading.next(!0),this.fullMultiResults=[];var i=[];return e.forEach((function(e,n){i.push(new Promise((function(i,o){try{e.pipe(r.take(1)).subscribe((function(e){console.log("Got results",a.cloneDeep(e));var r=t.processResults(e);t.fullMultiResults[n]=r,i(0!==r.length)}),(function(e){t.multiResults.next([]),i(!1)}))}catch(e){t.storageService.setSessionItem(t.resultsSessionName,[]),t.multiResults.next([]),o(e)}})))})),Promise.all(i).then((function(e){return t.isLoading.next(!1),console.log("+++ Multiloading Complete +++"),console.log("+++ Multi Results: ",t.fullMultiResults," +++"),t.storageService.setSessionItem(t.multiResultsSessionName,t.fullMultiResults),t.multiResults.next(t.fullMultiResults),!0}))},e.prototype.reset=function(){this.storageService.removeSessionItem(this.resultsSessionName);try{this.storageService.removeSessionItem(this.multiResultsSessionName)}catch(e){}this.fullResults=[],this.fullMultiResults=[],this.results.next([]),this.multiResults.next([]),this.resetQuery()},e.prototype.makeSessionResults=function(e){return e},e.prototype._applyFilter=function(){this.results.next(this.helpers.clone(this.fullResults))},e}(),d=function(){function e(t){this.value=t,this._component=null,e[t]=this}return Object.defineProperty(e.prototype,"component",{get:function(){return this._component},set:function(e){this._component&&console.warn("Compnent already set for "+this.value,this._component,e),this._component=e},enumerable:!1,configurable:!0}),e}();d.ModalErrorComponent=new d("ModalErrorComponent"),d.ModalNetWorkErrorComponent=new d("ModalNetworkErrorComponent"),d.BaseModalComponent=new d("BaseModalComponent"),d.AutoLogout=new d("AutoLogout"),d.RiskAlertDetail=new d("RiskAlertDetailModalComponent"),d.AlternativeRailModalComponent=new d("AlternativeRailModalComponent"),d.WarningRemoveModalComponent=new d("WarningRemoveModalComponent"),d.RailTicketsDialogComponent=new d("RailTicketsDialogComponent"),d.ModalFlightFareComponent=new d("ModalFlightFareComponent"),d.FlightExtrasDialogComponent=new d("FlightExtrasDialogComponent"),d.OfflineRequestDialogComponent=new d("OfflineRequestDialogComponent"),d.RequiresReasonDialogComponent=new d("RequiresReasonDialogComponent");var p=function(){function e(e){this.modelService=e}return e.prototype.checkError=function(e){if(e)throw this.modelService.open(d.ModalNetWorkErrorComponent,{},{error:e}),e},e.prototype.processCall=function(e){var a=this;return e.pipe(r.take(1),r.map((function(e){return a.checkError(e.error),a.getDataFromResult(e)})),r.catchError((function(e){return a.checkError(e),t.of({})})))},e}(),h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("rxjs"),require("rxjs/operators"),require("lodash"),require("moment"),require("ajv")):"function"==typeof define&&define.amd?define("@sabstravtech/obtservices/base",["exports","rxjs","rxjs/operators","lodash","moment","ajv"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).sabstravtech=e.sabstravtech||{},e.sabstravtech.obtservices=e.sabstravtech.obtservices||{},e.sabstravtech.obtservices.base={}),e.rxjs,e.rxjs.operators,e._,e.moment,e.Ajv)}(this,(function(e,t,r,a,i,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(a),l=o(i),u=o(n),c=function(){function e(e,r,a){this.storageService=e,this.helpers=r,this.searchService=a,this._cheapestResultPrice={amount:null,currencyCode:null},this.isValid=new t.BehaviorSubject(!1),this.results=new t.BehaviorSubject([]),this.multiResults=new t.BehaviorSubject([]),this.messages=new t.BehaviorSubject([]),this.messagesInfo=new t.BehaviorSubject([]),this.validationMessages=[],this.infoMessages=[],this.isLoading=new t.BehaviorSubject(!1),this.tempParams={},this.doChecks=!0,this.fullResults=[],this.fullMultiResults=[]}return Object.defineProperty(e.prototype,"cheapestPrice",{get:function(){return this._cheapestResultPrice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"originalUserSearch",{get:function(){return this._originalUserSearch},enumerable:!1,configurable:!0}),e.prototype.performSearch=function(){this.searchService.search_objects[this.type].chosen=!0,this.searchService.determineHighestSearchPriority(),this.searchService.startSearches()},e.prototype.processResults=function(e){return e},e.prototype.updateTempParams=function(e){this.doChecks=!1,Object.assign(this,e),this._cheapestResultPrice=null,this.doChecks=!0},e.prototype._startSearch=function(e){var t=this;return this.isLoading.next(!0),this.fullResults=[],new Promise((function(i,n){try{e.pipe(r.take(1)).subscribe((function(e){console.log("Got results",a.cloneDeep(e)),t.fullResults=Object.freeze(t.processResults(e)),t._cheapestResultPrice=t.updateLowestPrice(t.fullResults),t.storageService.setSessionItem(t.resultsSessionName,t.makeSessionResults(t.fullResults)),t._applyFilter()}),(function(e){t.results.next([]),i(!1),t.isLoading.next(!1)}),(function(){t.isLoading.next(!1),i(0!==t.fullResults.length)}))}catch(e){t.storageService.setSessionItem(t.resultsSessionName,[]),t.isLoading.next(!1),t.results.next([]),n(e)}}))},e.prototype._startMultiSearch=function(e){var t=this;this.isLoading.next(!0),this.fullMultiResults=[];var i=[];return e.forEach((function(e,n){i.push(new Promise((function(i,o){try{e.pipe(r.take(1)).subscribe((function(e){console.log("Got results",a.cloneDeep(e));var r=t.processResults(e);t.fullMultiResults[n]=r,i(0!==r.length)}),(function(e){t.multiResults.next([]),i(!1)}))}catch(e){t.storageService.setSessionItem(t.resultsSessionName,[]),t.multiResults.next([]),o(e)}})))})),Promise.all(i).then((function(e){return t.isLoading.next(!1),console.log("+++ Multiloading Complete +++"),console.log("+++ Multi Results: ",t.fullMultiResults," +++"),t.storageService.setSessionItem(t.multiResultsSessionName,t.fullMultiResults),t.multiResults.next(t.fullMultiResults),!0}))},e.prototype.reset=function(){this.storageService.removeSessionItem(this.resultsSessionName);try{this.storageService.removeSessionItem(this.multiResultsSessionName)}catch(e){}this.fullResults=[],this.fullMultiResults=[],this.results.next([]),this.multiResults.next([]),this.resetQuery()},e.prototype.makeSessionResults=function(e){return e},e.prototype._applyFilter=function(){this.results.next(this.helpers.clone(this.fullResults))},e}(),d=function(){function e(t){this.value=t,this._component=null,e[t]=this}return Object.defineProperty(e.prototype,"component",{get:function(){return this._component},set:function(e){this._component&&console.warn("Compnent already set for "+this.value,this._component,e),this._component=e},enumerable:!1,configurable:!0}),e}();d.ModalErrorComponent=new d("ModalErrorComponent"),d.ModalNetWorkErrorComponent=new d("ModalNetworkErrorComponent"),d.BaseModalComponent=new d("BaseModalComponent"),d.AutoLogout=new d("AutoLogout"),d.RiskAlertDetail=new d("RiskAlertDetailModalComponent"),d.AlternativeRailModalComponent=new d("AlternativeRailModalComponent"),d.WarningRemoveModalComponent=new d("WarningRemoveModalComponent"),d.RailTicketsDialogComponent=new d("RailTicketsDialogComponent"),d.ModalFlightFareComponent=new d("ModalFlightFareComponent"),d.FlightExtrasDialogComponent=new d("FlightExtrasDialogComponent"),d.OfflineRequestDialogComponent=new d("OfflineRequestDialogComponent"),d.RequiresReasonDialogComponent=new d("RequiresReasonDialogComponent"),d.DifferentInvokdedUserComponent=new d("DifferentInvokdedUserComponent");var p=function(){function e(e){this.modelService=e}return e.prototype.checkError=function(e){if(e)throw this.modelService.open(d.ModalNetWorkErrorComponent,{},{error:e}),e},e.prototype.processCall=function(e){var a=this;return e.pipe(r.take(1),r.map((function(e){return a.checkError(e.error),a.getDataFromResult(e)})),r.catchError((function(e){return a.checkError(e),t.of({})})))},e}(),h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -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}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function f(e,t,r,a){var i,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n<3?i(o):n>3?i(t,r,o):i(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 b(e,t,r,a){return new(r||(r=Promise))((function(i,n){function o(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((a=a.apply(e,t||[])).next())}))}function y(e,t){var r,a,i,n,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,a=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){o.label=n[1];break}if(6===n[0]&&o.label<i[1]){o.label=i[1],i=n;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(n);break}i[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],a=0}finally{r=i=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],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],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 a,i,n=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(a=n.next()).done;)o.push(a.value)}catch(e){i={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return o}function A(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(S(arguments[t]));return e}Object.create;var C,T,P,D,k,F,_,R,O,I,E,N,B,M,L,w,j,H,x,U,V,G,W,J,Q,Y,K,q,X,z,Z,$,ee,te,re,ae,ie,ne=function(){};!function(e){e.BeforeSearch="BEFORE_SEARCH",e.AfterSearch="AFTER_SEARCH"}(C||(C={})),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"}(P||(P={})),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"}(D||(D={})),function(e){e.Name="NAME",e.Email="EMAIL"}(k||(k={})),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"}(F||(F={})),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.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"}(O||(O={})),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"}(I||(I={})),function(e){e.Company="COMPANY",e.Office="OFFICE",e.User="USER"}(E||(E={})),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={})),(B=e.ɵb||(e.ɵb={})).K="K",B.M="M",(M=e.ɵc||(e.ɵc={})).M="M",M.F="F",(L=e.ɵd||(e.ɵd={})).Passport="PASSPORT",L.Visa="VISA",L.IdCard="ID_CARD",function(e){e.Cancellation="Cancellation",e.Change="Change",e.NoShow="NoShow",e.Upgrade="Upgrade",e.Other="Other"}(w||(w={})),function(e){e.Flexible="Flexible",e.Lowest="Lowest",e.Negotiated="Negotiated",e.NonNegotiated="NonNegotiated",e.Leisure="Leisure",e.RequestFareRules="RequestFareRules",e.SelectAndPro="SelectAndPro"}(j||(j={})),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"}(U||(U={})),function(e){e.ReturnJourney="ReturnJourney",e.SingleJourney="SingleJourney"}(V||(V={})),function(e){e.Renfe="Renfe",e.BeNe="BeNe",e.Ntv="Ntv"}(G||(G={})),function(e){e.Placeholder="placeholder",e.Complete="complete"}(W||(W={})),function(e){e.Error="ERROR",e.Warn="WARN",e.Info="INFO",e.Http="HTTP",e.Verbose="VERBOSE",e.Debug="DEBUG",e.Silly="SILLY"}(J||(J={})),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={})),function(e){e.Adult="ADULT",e.Child="CHILD",e.Infant="INFANT"}(Y||(Y={})),function(e){e.Mobile="MOBILE",e.Landline="LANDLINE",e.Fax="FAX",e.Other="OTHER"}(K||(K={})),(q=e.ɵf||(e.ɵf={})).MealRequest="MEAL_REQUEST",q.SeatingPreference="SEATING_PREFERENCE",q.SpeacialNeed="SPEACIAL_NEED",q.SeatLocation="SEAT_LOCATION",q.SeatPosition="SEAT_POSITION",q.SeatDirection="SEAT_DIRECTION",function(e){e.Inherited="INHERITED",e.Editable="EDITABLE",e.Visible="VISIBLE",e.Hidden="HIDDEN"}(X||(X={})),function(e){e.All="All",e.First="First",e.Standard="Standard"}(z||(z={})),function(e){e.SingleJourney="SingleJourney",e.ReturnJourney="ReturnJourney",e.OpenReturnJourney="OpenReturnJourney"}(Z||(Z={})),function(e){e.Origin="Origin",e.Intermediate="Intermediate",e.Destination="Destination",e.Unknown="Unknown"}($||($={})),function(e){e.RequestStop="RequestStop",e.PickUpOnly="PickUpOnly",e.SetDownOnly="SetDownOnly",e.Normal="Normal",e.Passing="Passing",e.Unknown="Unknown"}(ee||(ee={})),function(e){e.Low="Low",e.Moderate="Moderate",e.Medium="Medium",e.High="High",e.Extreme="Extreme"}(te||(te={})),function(e){e.Flight="FLIGHT",e.Eurostar="EUROSTAR",e.InternationalRail="INTERNATIONAL_RAIL",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"}(re||(re={})),function(e){e.All="ALL",e.Mock="MOCK",e.Lightning="LIGHTNING",e.App="APP"}(ae||(ae={})),function(e){e.FreeText="FREE_TEXT",e.AutoSuggest="AUTO_SUGGEST",e.Dropdown="DROPDOWN",e.Hidden="HIDDEN"}(ie||(ie={}));var oe,se,le,ue,ce,de,pe,he,me,fe,ve=function(e){function r(r){var a=e.call(this)||this;return a.isLoading=new t.BehaviorSubject(!1),a.search=function(e){return t.of([])},Object.assign(a,r),a}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,a){r(!t.mandatory||e&&0!==e.length?null:{hasErrors:!0})}))},r}(ne),be=function(e){function t(t,r){var a,i=this;return(i=e.call(this,t)||this).basketService=r,i.tempValue=i.selectedValues&&(null===(a=i.selectedValues[0])||void 0===a?void 0:a.freeValue)||"",i}return m(t,e),t.prototype.getValue=function(){return this.tempValue},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){this.basketService.setMiFreeValue(e,this,this.selectedValues[0]?this.selectedValues[0].freeValue:"",t)},t.prototype.hasErrors=function(t){var r=this;return new Promise((function(a,i){if(!r.mandatory||t&&0!==t.length||a({hasErrors:!0}),r.valueMask&&t)return r.basketService.validateFreeValeMi(r,t).then((function(e){a(e?null:{hasErrors:!0})}));r.values.length>0?a(r.values.find((function(e){return e.value===t}))?null:{hasErrors:!0}):a(e.prototype.hasErrors.call(r,t))}))},t}(ve),ye=function(e){function a(a,i){var n,o=this;return(o=e.call(this,a)||this).basketService=i,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}return m(a,e),a.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},a.prototype.hasErrors=function(e){return b(this,void 0,void 0,(function(){return y(this,(function(t){try{return[2,this.avaliableItems.find((function(t){return t.id===e}))?null:{hasErrors:!0}]}catch(e){return[2,null]}return[2]}))}))},a.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=[]}},a.prototype.save=function(e,t){this.basketService.setMiSelectedValue(e,this,this.selectedValues[0].value.id,t)},a}(ve),ge=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}(ve),Se=function(e){function t(t,r){var a,i=this;return(i=e.call(this,t)||this).basketService=r,(null===(a=i.values)||void 0===a?void 0:a.length)>0?i.avaliableItems=i.values:console.error("No values for Dropdown MI field "),i.defaultValue&&!i.selectedValues.length&&(i.value=i.defaultValue.id,i.selectedValues[0].value=i.defaultValue),i}return m(t,e),t.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},t.prototype.hasErrors=function(e){return b(this,void 0,void 0,(function(){return y(this,(function(t){try{return[2,this.avaliableItems.find((function(t){return t.id===e}))?null:{hasErrors:!0}]}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){this.basketService.setMiSelectedValue(e,this,this.selectedValues[0].value.id,t)},t}(ve),Ae=function(e,t){switch(e.uiPresentation){case ie.FreeText:return new be(e,t);case ie.AutoSuggest:return new ye(e,t);case ie.Hidden:return new ge(e);case ie.Dropdown:return new Se(e,t);default:var r=e.uiPresentation;console.log(r)}return null},Ce=function(e,t,r){var a=this;this.basketService=t,this.helpers=r,this.isValidObservers=[],this.basketItem=e;var i=e.managementInfo.reduce((function(t,r){if(r.reason&&!e.requiresReason)return t;var i=Ae(r,a.basketService);return a.isValidObservers.push(i),r.perBooking?t.perItem.push(i):t.perUser.push(i),t}),{perItem:[],perUser:[]}),n=i.perItem,o=i.perUser;this.miPerItem=n,this.miPerUser=e.users.reduce((function(e,t){return e[t.id]={managementInfo:a.helpers.clone(o).map((function(e){var t=Ae(e,a.basketService);return a.isValidObservers.push(t),t}))},e}),{}),this.users=Object.keys(this.miPerUser)};(oe=e.LogoutEnum||(e.LogoutEnum={}))[oe.LOGOUT=0]="LOGOUT",oe[oe.STAYIN=1]="STAYIN",(se=e.LocationTypes||(e.LocationTypes={})).City="City",se.Office="Office",se.Airport="Airport",se.TrainStation="Train Station",se.Postcode="Postcode",se.Shortlist="Shortlist",(le=e.BreatfastTypes||(e.BreatfastTypes={})).BreakfastIncluded="BreakfastIncluded",le.BreakfastNotIncluded="BreakfastNotIncluded",(ue=e.HotelPolicyEnum||(e.HotelPolicyEnum={})).cancellation="cancellation",ue.deposit="deposit",ue.disabledAccess="disabledAccess",ue.general="general",ue.guarantee="guarantee",ue.refundAvailable="refundAvailable",(ce=e.BookingStatus||(e.BookingStatus={}))[ce.Loading=0]="Loading",ce[ce.AddingItems=1]="AddingItems",ce[ce.AddingTravellers=2]="AddingTravellers",ce[ce.AddingLeadPassenger=3]="AddingLeadPassenger",ce[ce.Failed=4]="Failed",ce[ce.Revalidate=5]="Revalidate",ce[ce.RevalidatingError=6]="RevalidatingError",ce[ce.ChooseMIGroup=7]="ChooseMIGroup",ce[ce.ProvideMi=8]="ProvideMi",ce[ce.SendForApproval=9]="SendForApproval",ce[ce.AwaitingApproval=10]="AwaitingApproval",ce[ce.ApprovedPaymentOption=11]="ApprovedPaymentOption",ce[ce.ApprovedSupplemtal=12]="ApprovedSupplemtal",ce[ce.ApprovedBook=13]="ApprovedBook",ce[ce.PartiallyBooked=14]="PartiallyBooked",ce[ce.Complete=15]="Complete",(de=e.SchemaFormat||(e.SchemaFormat={})).array="array",de.datetime="date-time",de.integer="integer",de.object="object",de.select="select",de.selectQueue="select-queue",de.string="string",de.boolean="boolean",de.countryCode="countryCode",de.additionalSeatPreference="t_additionalSeatPreference",de.seatPrefGroups="a_seatPrefGroups",de.railSeating="railSeating",de.passport="passport",de.specialRequests="specialRequests",de.apis="apis",de.mandatoryIfEticket="mandatory-if-eticket",de.mandatoryIfTod="mandatory-if-tod",(e.Widgets||(e.Widgets={})).COUNTRY_CODE="COUNTRY_CODE",(pe=e.PreferredFlags||(e.PreferredFlags={}))[pe.none=0]="none",pe[pe.officePreferred=1]="officePreferred",pe[pe.companyPreferred=2]="companyPreferred",pe[pe.tmcPreferred=4]="tmcPreferred",pe[pe.all=7]="all",(he=e.FlightDirectionEnum||(e.FlightDirectionEnum={}))[he.Outbound=1]="Outbound",he[he.Inbound=0]="Inbound",he[he.DualSingleOutbound=2]="DualSingleOutbound",he[he.DualSingleInbound=3]="DualSingleInbound",(me=e.OBTFlightCabinClass||(e.OBTFlightCabinClass={})).Business="Business",me.BusinessBranded="BrandedBusiness",me.EconomyFlexi="EconomyFlexi",me.EconomyFlexiBranded="BrandedEconomyFlexi",me.EconomyNoBags="EconomyNoBags",me.EconomyNoBagsBranded="BrandedEconomyNoBags",me.EconomyRestricted="EconomyRestricted",me.EconomyRestrictedBranded="BrandedEconomyRestricted",me.First="First",me.FirstBranded="BrandedFirst",me.PremiumEconomy="PremiumEconomy",me.PremiumEconomyBranded="BrandedPremiumEconomy",(fe=e.EurostarClassEnum||(e.EurostarClassEnum={})).ANY="Any",fe.BUSINESS_PREMIER="BusinessPremier",fe.STANDARD_PREMIER="StandardPremier",fe.STANDARD="Standard";var Te,Pe,De,ke="("+["breakfast not included","breakfast is not included","Breakfast isn't included","Does not include breakfast","EXCL","exel Breakfast","Breakfast Costs","no breakfast"].join(")|(")+")",Fe="("+["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(")|(")+")",_e=new RegExp(Fe,"i"),Re=new RegExp(ke,"i");(Te=e.SearchHandler||(e.SearchHandler={})).AVAILABILITY="Availability",Te.FEMALE_FRIENDLY="SOLO Female Friendly",Te.CTM_GREEN_CHOICE="CTM Greener Choice",Te.BREAKFAST_INCLUDED="BreakfastIncluded",Te.BREAKFAST_NOT_INCLUDED="BreakfastNotIncluded",Te.CLIENT="Client",Te.AGENCY="Agency",Te.ANY="Any",(Pe=e.MenuSlideEnum||(e.MenuSlideEnum={})).IN="in",Pe.OUT="out",Pe.FLAT="flat",(De=e.RiskLevelRanking||(e.RiskLevelRanking={})).Low="1",De.Moderate="2",De.Medium="3",De.High="4",De.Extreme="5";var Oe;(Oe=e.ServiceProvider||(e.ServiceProvider={})).Confirma="Conferma",Oe.Evolvi="Evolvi",Oe.SabreCarHire="Sabre Car Hire",Oe.Lounges="Holiday Extras Lounges",Oe.FastTrack="Holiday Extras Fast Track",Oe.Parking="Holiday Extras Parking",Oe.CMAC="CMAC",Oe.FarelogixLFGNDC="Farelogix LFG NDC",Oe.BaNdc="BA NDC",Oe.EurostarSabre="Eurostar (Sabre)",Oe.Trainline="Trainline",(e.WellbeingEnum||(e.WellbeingEnum={})).WELLBEING="/results/wellbeing";var Ie=[{label:"Bland",type:e.ɵf.MealRequest},{label:"Child",type:e.ɵf.MealRequest},{label:"Diabetic",type:e.ɵf.MealRequest},{label:"Fruit Plate",type:e.ɵf.MealRequest},{label:"Gluten Free",type:e.ɵf.MealRequest},{label:"Hindu",type:e.ɵf.MealRequest},{label:"Kosher",type:e.ɵf.MealRequest},{label:"Low Fat/Cholesterol",type:e.ɵf.MealRequest},{label:"Low Sodium",type:e.ɵf.MealRequest},{label:"Muslim",type:e.ɵf.MealRequest},{label:"Non-Lactose",type:e.ɵf.MealRequest},{label:"Raw Vegeterian",type:e.ɵf.MealRequest},{label:"Seafood",type:e.ɵf.MealRequest},{label:"Vegan Vegeterian",type:e.ɵf.MealRequest},{label:"Vegeterain Lacto-Ovo",type:e.ɵf.MealRequest},{label:"Aisle",type:e.ɵf.SeatingPreference},{label:"Window",type:e.ɵf.SeatingPreference},{label:"Bassinet",type:e.ɵf.SpeacialNeed},{label:"Bicycle",type:e.ɵf.SpeacialNeed},{label:"Blind passenger",type:e.ɵf.SpeacialNeed},{label:"Deaf passenger",type:e.ɵf.SpeacialNeed},{label:"Meet and assist",type:e.ɵf.SpeacialNeed},{label:"Wheelchair, can ascend steps",type:e.ɵf.SpeacialNeed},{label:"Wheelchair, can walk to seat",type:e.ɵf.SpeacialNeed},{label:"Wheelchair, manual",type:e.ɵf.SpeacialNeed},{label:"Wheelchair, must be carried",type:e.ɵf.SpeacialNeed},{label:"Wheelchair, with dry battery",type:e.ɵf.SpeacialNeed},{label:"Wheelchair, with wet battery",type:e.ɵf.SpeacialNeed},{label:"Quiet",type:e.ɵf.SeatLocation},{label:"Business",type:e.ɵf.SeatLocation},{label:"Family",type:e.ɵf.SeatLocation},{label:"Aisle",type:e.ɵf.SeatPosition},{label:"Middle",type:e.ɵf.SeatPosition},{label:"Window",type:e.ɵf.SeatPosition},{label:"Individual",type:e.ɵf.SeatPosition},{label:"Front Facing",type:e.ɵf.SeatDirection},{label:"Back Facing",type:e.ɵf.SeatDirection},{label:"Airline Seat",type:e.ɵf.SeatDirection}],Ee=[{label:"Passport",type:e.ɵd.Passport},{label:"Visa",type:e.ɵd.Visa},{label:"IdCard",type:e.ɵd.IdCard}],Ne=[{label:"F",type:e.ɵc.F},{label:"M",type:e.ɵc.M}],Be=[{label:"K",type:e.ɵb.K},{label:"M",type:e.ɵb.M}],Me=function(){function r(r,a){this.basketService=r,this.helpers=a,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(e){var t=this;this.basketService.loadBasket(e),this.basketService.subsribeToBasket(e,{next:function(e){t.basket.next(e),t.updateBasket(e)},error:function(e){t.basket.error(e),console.error(e)},complete:function(){t.basket.complete(),console.log("Basket completed")}})},r.prototype.updateBasket=function(t){switch(this.isUpdating.next(!1),t.status){case D.Open:this.workoutOpenState(t);break;case D.AwaitingApproval:this.status.next(this.workoutState(t,e.BookingStatus.AwaitingApproval));break;case D.Approved:this.status.next(this.workoutApprovedState(t));break;case D.Booked:this.status.next(this.workoutState(t,e.BookingStatus.Complete));break;case D.BookingFailed:this.status.next(this.workoutState(t,e.BookingStatus.Failed));break;case D.Disapproved:case D.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;if(t.basketItems.find((function(e){var t;return(null===(t=e.availablePaymentMethods)||void 0===t?void 0:t.length)>0&&!e.selectedPaymentMethod})))return this.workoutState(t,e.BookingStatus.ApprovedPaymentOption);console.log(t.suppInfo);var a=t.suppInfo.find((function(e){return e.hasDetails}));return console.log(a),a&&(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,a){void 0===a&&(a=0),this.isUpdating.next(!0),this.basketService.addTravellers(e.id,t,r,a)},r.prototype.setLeadPassenger=function(e,t,r,a){void 0===a&&(a=0),this.isUpdating.next(!0),this.basketService.setLeadPassenger(e.id,t,r,a)},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){if(this.isUpdating.next(!0),e)return this.basketService.bookBasket(this.id,e)},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===re.Parking?!(1===e.adults):!(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(e){var t=this;return(e.userPassengerTypes||[]).reduce((function(r,a,i){switch(a.passengerType){case Y.Adult:r.adults.push(t._findUser(e.users,Number(a.id)));break;case Y.Child:r.children.push(t._findUser(e.users,Number(a.id)));break;case Y.Infant:r.infants.push(t._findUser(e.users,Number(a.id)))}return r}),{adults:[],children:[],infants:[]})},r.prototype._findUser=function(e,t){return e.find((function(e){return Number(e.id)===t}))},r.prototype.getId=function(){return this.id},r}(),Le=function(e,t){this.key=e,this.value=t,this.next=null,this.pre=null},we=function(){function e(e){void 0===e&&(e=10),this.size=e,this.cache={},this.count=0,this.head=new Le("",null);var t=new Le("",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 Le(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 je(){return function(e,t,r){var a=new we,i=r.value;r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=JSON.stringify(e);return a.hasKey(r)||a.set(r,i.apply(this,e)),a.get(r)}}}var He,xe,Ue,Ve=function(){function t(){}return 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 a=[],i=0;i<t-e;i++)for(var n=0;n<60;n+=r)a.push(l.default({hour:i,minute:n}).format("HH:mm"));return a},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 a=t.split(":");2===a.length?r.set("hours",Number(a[0])).set("minutes",Number(a[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(),a=0;r&&a<e.length;a+=1)r=r[e[a]];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 a=r.line.slice(0,t).lastIndexOf(",");a>0?(r.residue=r.line.slice(a+1).trim(),r.line=r.line.slice(0,a).trim()):(a=r.line.slice(0,t).lastIndexOf(" "))>0?(r.residue=r.line.slice(a+1).trim(),r.line=r.line.slice(0,a)):(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 a=e[Symbol.iterator](),i=[],n=[],o=0,s=function(){var e=a.next();if(!e.done){var r=o++;return Promise.resolve(t(e.value,r)).then((function(e){return i[r]=e,s()}))}};!r||n.length<=r;){var l=s();if(!l)break;n.push(l)}return Promise.all(n).then((function(){return i}))},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),a=t.match(/.{1,2}/g);return"20"+r[0]+"-"+r[1]+"-"+r[2]+"T"+a[0]+":"+a[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 re.Hotel:case re.Cab:return[]}return e.filter((function(e){return e.isChild}))},t.prototype.selectedTravellers=function(e,t){switch(t){case re.Hotel:case re.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 re.Hotel:case re.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 re.Flight:return this._isChild(e,16);case re.Rail:return this._isChild(e,12);case re.Coach:return this._isChild(e,15);case re.Lounge:return this._isChild(e,12);case re.Hotel:case re.Cab:default:return!1}},t.prototype.isInfant=function(e,t){switch(t){case re.Flight:case re.Rail:case re.Coach:case re.Lounge:return this._isChild(e,0);case re.Hotel:case re.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 re.Flight:return l.default().add(-15,"years").format(t.MMDDYY_DATE);case re.Rail:return l.default().add(-11,"years").format(t.MMDDYY_DATE);case re.Coach:return l.default().add(-14,"years").format(t.MMDDYY_DATE);case re.Lounge:return l.default().add(-11,"years").format(t.MMDDYY_DATE)}},t.prototype.getDefaultAdultAge=function(e){switch(e){case re.Flight:return l.default().add(-26,"years").format(t.MMDDYY_DATE);case re.Rail:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case re.Coach:return l.default().add(-25,"years").format(t.MMDDYY_DATE);case re.Lounge:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case re.Hotel:case re.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 a=t[0];e[a]=this.setFieldInObject(e[a],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,a){var i=t.reduce((function(e,t){var i=Array.isArray(t)?t.map((function(e){return r.fieldFromObject(a,e)})).join("_"):r.fieldFromObject(a,t);return e&&i?(e.push(i),e):null}),[]);if(a&&i)return r.setFieldInObject(e,i,a)}),{})},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,a){if("_"!==a[0]){var i=e[a],n=t.removeNulls(i);(null!=n&&"null"!==n||Array.isArray(n)&&n.length>0)&&(r[a]=n)}return r}),{}):e:e},t.prototype.getTravellersId=function(e){if(e)return e.reduce((function(e,t,r){return 0===r?[t.id]:A(e,[t.id])}),[])},t.prototype.sanitizeMomentDates=function(e,t){var r,a;void 0===t&&(t=!1);var i=Object.assign({},e);try{for(var n=g(Object.entries(i)),o=n.next();!o.done;o=n.next()){var s=S(o.value,2),u=s[0],c=s[1];l.default.isMoment(c)&&(i[u]=i[u].toISOString())}}catch(e){r={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return t&&(console.log("-- sanitizeMomentDates() called --"),console.log("original query: ",e),console.log("sanitized query: ",i)),i},t.prototype.toStrings=function(e,t){var r=this;return Object.entries(t.properties||{}).reduce((function(a,i){var n=S(i,2),o=n[0],s=n[1],l=r._formatValue(e[o],s,(t.required||[]).includes(o));return null!==l&&(a[o]=l),a}),{})},t.prototype._formatValue=function(e,t,r){switch(t.type){case"integer":var a=Number.parseInt(e,10);return Number.isNaN(a)?r?0:null:a;case"string":var i=e?e.toString():null;return i&&i.length>0?i:r?"":null;case"object":return e?this.toStrings(e,t):r?{}:null;case"array":default:return e}},t.prototype.makeTimeWindow=function(e,t,r){var a=e.clone().add(t,"hour"),i=e.clone().add(r,"hour");return this.formatTime(a)+"-"+this.formatTime(i)},t.prototype.inRange=function(e,t){return e>=t.min&&e<=t.max},t.prototype.makeUsers=function(e){return e.map((function(e){return{id:e.id,passengerType:e.isChild?Y.Child:e.isInfant?Y.Infant:Y.Adult}}))},t.prototype.makeMomentDayTime=function(e,t,r){var a=l.default();return void 0!==e&&a.add(e,"day"),void 0!==t&&a.set("hours",t),void 0!==r&&a.set("minutes",r),a},t.prototype.sanatizeReturns=function(e,t,r){var a=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}),a)},t.prototype.miIsValid=function(e){return 0===e.length||!!e.find((function(e){return e.isValid()}))},t.prototype.isMiValid=function(e,t){var r=this,a=Object.values(t||{});return this.miIsValid(e)&&(0===a.length||!!a.find((function(e){return r.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)})))},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 a=s.default.cloneDeep(e),i=[];if(a.length>t){for(;a.length>=t;)i.push(a.splice(0,t));a.length&&r&&i.push(a)}else i=a;return i},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 a=r===e.FlightDirectionEnum.Outbound?t.outboundFlights:t.inboundFlights;return{rules:a.reduce((function(e,t){var r,a,i,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===(a=t.fareConditions)||void 0===a?void 0:a.change)||[]),e.noShow=e.noShow.concat((null===(i=t.fareConditions)||void 0===i?void 0:i.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:a}},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 a={dStart:"",dEnd:"",locationFrom:"",locationTo:"",basketId:"",description:"",serviceType:"",summary:""},i="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 re.Lounge:a.basketId=e.id,a.dStart=null==c?void 0:c.arrivalDatetime,a.dEnd="",a.summary="Airport Lounge - "+c.name,a.serviceType=d.type.toLowerCase(),a.description=["Lounge: "+c.name+"\r\n","Starts: "+l.default(c.arrivalDatetime).format(i)+"\r\n","Adults: "+o+"\r\n","Children: "+s+"\r\n","Booking Ref: "+u].join("");break;case re.Cab:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.departs,a.dEnd="",a.summary="Taxi booking - from "+c.fromLocation.address+" to "+c.toLocation.address,a.description=["Pickup Point: "+c.fromLocation.address+"\r\n","Time: "+l.default(c.departs).format(i)+"\r\n","Booking Ref: "+u].join("");break;case re.Car:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.pickUpDatetime,a.dEnd=null==c?void 0:c.dropOffDatetime,a.summary="Car booking - from "+c.pickUpLocation.address+" to "+c.dropOffLocation.address,a.description=["Pickup Point: "+c.pickUpLocation.address+"\r\n","Time: "+l.default(c.pickUpDatetime).format(i)+"\r\n","Arrival Point: "+c.dropOffLocation.address+"\r\n","Booking Ref: "+u].join(""),a.locationFrom=c.pickUpLocation.address,a.locationTo=c.dropOffLocation.address;break;case re.Coach:case re.FastTrack:case re.Flight:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.outboundFlights[0].dateTimeDeparting,a.dEnd=null==c?void 0:c.outboundFlights[0].dateTimeArriving,a.summary="Flight Booking - From "+c.outboundFlights[0].originAirport+" to "+c.outboundFlights[0].destinationAirport,a.description=["From: "+c.outboundFlights[0].originAirport+"\r\n","Depart: "+l.default(c.outboundFlights[0].dateTimeDeparting).format(i)+"\r\n","To: "+c.outboundFlights[0].destinationAirport+"\r\n","Arrive: "+l.default(c.outboundFlights[0].dateTimeArriving).format(i)+"\r\n","Booking Ref: "+u].join("");break;case re.Hotel:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.checkIn,a.dEnd=null==c?void 0:c.checkOut,a.summary="Hotel booking - "+c.hotelName,a.description=["Hotel: "+c.hotelName+"\r\n","Arrival: "+l.default(c.checkIn).format(i)+"\r\n","Departure: "+l.default(c.checkOut).format(i)+"\r\n","Booking Ref: "+u].join("");break;case re.InternationalRail:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.outwardDetail.departureDateTime,a.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,a.locationFrom=c.outwardDetail.departureStationName,a.locationTo=c.outwardDetail.arrivalDateTime,a.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,a.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(i)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(i)+"\r\n","Booking Ref: "+u].join("");break;case re.Parking:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.arrivalDatetime,a.dEnd=null==c?void 0:c.departDatetime,a.summary="Airport parking - "+c.name,a.description=["Airport Parking: "+c.name+"\r\n","Booking Ref: "+u].join("");break;case re.Rail:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.outwardDetail.departureDateTime,a.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,a.locationFrom=c.outwardDetail.departureStationName,a.locationTo=c.outwardDetail.arrivalDateTime,a.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,a.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(i)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(i)+"\r\n","Booking Ref: "+u].join("")}t.push(["BEGIN:VEVENT\r\n",a.dStart?"DTSTART:"+l.default(a.dStart).format("YYYYMMDDTHHmmss")+"\r\n":"",a.dEnd?"DTEND:"+l.default(a.dEnd).format("YYYYMMDDTHHmmss")+"\r\n":"",'ORGANIZER;CN="Do not reply to this email":mailto:do_not_reply@sabscorp.com\r\n',a.locationTo&&a.locationFrom?"LOCATION: "+a.locationTo+" to "+a.locationFrom+" \r\n":"","TRANSP:OPAQUE\r\n","SEQUENCE:0\r\n","UID:"+a.serviceType+"_"+r+"_"+a.basketId+"@sabscorp.com\r\n","DTSTAMP:"+l.default().format("YYYYMMDDTHHmmss")+"\r\n","DESCRIPTION:"+a.description+"\r\n","SUMMARY:"+a.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 a=t.inboundFlights?t.inboundFlights.length-1:0,i=a>r?a:r;e.totalStops[i]=e.totalStops[i]||{display:0===i?"Direct":i+" stop"+(1!==i?"s":""),selected:!1,value:i+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,A(o)):0;e.baggage[s]=e.baggage[s]||{selected:!1,display:s+" bag"+(s>1?"s":""),value:s};var u=function(t,r,a,i,n){var o=t&&t[n]?t[n][a]:void 0;void 0!==o&&(e[r][o]=e[r][o]||{value:t[n][a],display:t[n][i],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 p=t&&t.inboundFlights&&t.inboundFlights[0]?l.default(t.inboundFlights[0].dateTimeDeparting).get("hour"):-1;e.returnDepartureTime.min=e.returnDepartureTime.min<p?e.returnDepartureTime.min:p,e.returnDepartureTime.max=e.returnDepartureTime.max>p?e.returnDepartureTime.max:p;var h=l.default(t.outboundFlights[t.outboundFlights.length-1].dateTimeArriving).get("hour");e.returnArrivalTime.min=e.returnArrivalTime.min<h?e.returnArrivalTime.min:h,e.returnArrivalTime.max=e.returnArrivalTime.max>h?e.returnArrivalTime.max:h,(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 a,i;return(r?((a={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,a[H.PremiumBusiness]=e.OBTFlightCabinClass.BusinessBranded,a[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,a[H.Economy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,a[H.PremiumFirst]=e.OBTFlightCabinClass.FirstBranded,a[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestrictedBranded,a[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,a[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexiBranded,a[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBagsBranded,a[H.Business]=e.OBTFlightCabinClass.BusinessBranded,a[H.First]=e.OBTFlightCabinClass.FirstBranded,a):((i={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,i[H.PremiumBusiness]=e.OBTFlightCabinClass.Business,i[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestricted,i[H.Economy]=e.OBTFlightCabinClass.EconomyRestricted,i[H.PremiumFirst]=e.OBTFlightCabinClass.First,i[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestricted,i[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,i[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexi,i[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBags,i[H.Business]=e.OBTFlightCabinClass.Business,i[H.First]=e.OBTFlightCabinClass.First,i))[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 Ge(null==t?void 0:t.unavailable)&&(e.unavailable=t.unavailable,e.unavailableMessage=t.unavailableMessage),Ge(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,A([{}],Object.entries(e).map((function(e){var r,a=S(e,2),i=a[0],n=a[1];return(r={})[i]=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,a,i){return t(r,i),Reflect.apply(e,a,i)}}):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 Ge(e){return null!=e}Ve.READ_DATE_FORMAT="dd, D MMM YYYY",Ve.READ_TIME_FORMAT="HH:mm",Ve.DATE_FORMAT="YYMMDD",Ve.GRAPHQL_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm:ss",Ve.ISO_DATA_FORMAT="YYYY-MM-DD",Ve.ISO_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm",Ve.ISO_DATA_FORMAT_NO_HYPHANS="YYYYMMDD",Ve.TIME_FORMAT="HHmm",Ve.TIME_FORMAT_COLON="HH:mm",Ve.MMDDYY_DATE="DDMMYYYY",f([je(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",Number)],Ve.prototype,"getTimeDifference",null),f([je(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",String)],Ve.prototype,"dayDifference",null),f([je(),v("design:type",Function),v("design:paramtypes",[Object,Number]),v("design:returntype",void 0)],Ve.prototype,"makeFareRules",null),(He=e.TaxiFormMode||(e.TaxiFormMode={})).ADDRESS="location",He.STATION="station",(xe=e.AirportSearchMode||(e.AirportSearchMode={})).PICKUP="Airport Pick Up",xe.DROPOFF="Airport drop off",(Ue=e.ActionType||(e.ActionType={})).GET="get",Ue.SAVE="save",Ue.DELETE="delete";var We,Je=function(r){function a(i,n,o,s,u){var c=r.call(this,o,n)||this;c.cabfetcher=i,c.searchService=s,c.basketService=u,c.type=re.Cab,c.airportChange=new t.Subject,c.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}],c.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"}],c.searchTypes=["One-way","Return"],c.airportSearchTypes=["Airport drop off","Airport Pick Up"],c.criteria=["Pick Up Time"],c.mode=e.TaxiFormMode.ADDRESS,c.minSelectDate=l.default(),c.minReturnSelectDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},c._date=null,c.selectedPlaces=[],c._vias=[null,null,null,null],c._searchType=c.searchTypes[0],c._airportSearchType=e.AirportSearchMode.DROPOFF,c._searchCriteria=c.criteria[0],c._outboundDateTime=c.helpers.round(l.default(),l.default.duration(15,"minutes")),c._returnDateTime=c.helpers.round(l.default(),l.default.duration(15,"minutes")),c._flightNumber="",c._terminal=null,c._time=null,c.resultsSessionName=a.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=a.MULTI_STORAGE_SESSION_RESULTS,c.getPassengers=function(){var e=c.adults,t=c.children,r=e+" Adult";return 1!==Number(e)&&(r+="s"),1===Number(t)&&(r+=", "+t+" Child"),Number(t)>1&&(r+=", "+t+" Children"),r};var d=o.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(s.makeCabHireQuery(d.tempParams));try{var p=o.getSessionItem(a.SECONDARY_STORAGE_SESSION_PARAMS);p&&(c.returnDateTime=l.default(p.tempParams.departs),c.searchType=c.searchTypes[1])}catch(e){console.error("+++ Error recovering return data: ",e," +++")}d.tempParams.fromAddress&&(c.fromAddress=d.tempParams.fromAddress),d.tempParams.toAddress&&(c.toAddress=d.tempParams.toAddress),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){c.travellers=e;var t=c.helpers.selectedTravellers(e,re.Cab);c.tempParams.adults=t.adults.length,c.tempParams.children=t.children.length,c._isValid()}));var h=o.getSessionItemAsList(c.resultsSessionName)||[];c.fullResults=h,c._cheapestResultPrice=c.updateLowestPrice(h),c.results.next(h||[]);var m=o.getSessionItemAsList(c.multiResultsSessionName)||[];return c.fullMultiResults=m,c.multiResults.next(m),c._isValid(),c.outboundVisibility=new t.BehaviorSubject(!1),c.inboundVisibility=new t.BehaviorSubject(!1),c}return m(a,r),Object.defineProperty(a.prototype,"fromLocation",{get:function(){return this._fromLocation},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"toLocation",{get:function(){return this._toLocation},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"searchType",{get:function(){return this._searchType},set:function(e){this._searchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.prototype,"fromLocationType",{get:function(){return this.tempParams.fromLocationType},set:function(e){this.tempParams.fromLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"toLocationType",{get:function(){return this.tempParams.toLocationType},set:function(e){this.tempParams.toLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"searchCriteria",{get:function(){return this._searchCriteria},set:function(e){this._searchCriteria=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outboundDateTime",{get:function(){return this._outboundDateTime},set:function(e){this._outboundDateTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnDateTime",{get:function(){return this._returnDateTime},set:function(e){this._returnDateTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"airport",{get:function(){return this.tempParams.airport},set:function(e){this.tempParams.airport=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"terminal",{get:function(){return this._terminal},set:function(e){this._terminal=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(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,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"countryCode",{get:function(){return this.tempParams.countryCode},set:function(e){this.tempParams.countryCode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"vias",{get:function(){return this._vias},set:function(e){this._vias=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.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(a.prototype,"vehicleType",{get:function(){return this.tempParams.vehicleType},set:function(e){this.tempParams.vehicleType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.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(a.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(a.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}),a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCabHireQuery());try{this.storageService.removeSessionItem(a.SECONDARY_STORAGE_SESSION_PARAMS)}catch(e){}this._searchType=this.searchTypes[0],this._isValid()},a.prototype.resetParams=function(){this.reset(),this.resetQuery(),this.results.next([]),this.multiResults.next([])},a.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(a.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.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},a.prototype._updateDateTime=function(){this._date&&this._time&&(this.departs=this.helpers.ngDateToMoment(this._date,this._time))},a.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(a.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)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:re.Cab,searchArgs:t,travelDate:this.departs.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.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},a.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()},a.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)},a.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)},a.prototype.updateOutboundAddress=function(e,t){this.tempParams.fromAddress=this.getAddressFormat(e,t)},a.prototype.updateInboundAddress=function(e,t){this.tempParams.toAddress=this.getAddressFormat(e,t)},a.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}},a.prototype.matchAddresses=function(){this._toLocation=this.createCabHireLocation(this.tempParams.toAddress),this._fromLocation=this.createCabHireLocation(this.tempParams.fromAddress),this._isValid()},a.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})):r.sort((function(e,t){return e.price-t.price})),this.results.next(r)}},a.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,["postal_code"]),Country:this.getAddressFromPlaceDetails(e,["country"]),placeDescription:t}},a.prototype.getAddressFromPlaceDetails=function(e,t){var r,a,i=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 i=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&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}}return i},a.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},a.prototype.setLocationFromAirport=function(t,r){var a=this.getAddressFromAirportDetails(t,r);this.mode===e.TaxiFormMode.STATION&&(this.airportSearchType===e.AirportSearchMode.PICKUP?this.fromAddress=a:this.toAddress=a)},a.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},a.prototype.setOutboundFormVisibility=function(e){this.outboundVisibility.next(e)},a.prototype.setInboundFormVisibility=function(e){this.inboundVisibility.next(e)},a.prototype.getOutboundFormVisibility=function(){return this.outboundVisibility},a.prototype.getInboundFormVisibility=function(){return this.inboundVisibility},a.prototype.updateFromPreviousSearches=function(e){var t;null===(t=e[re.Flight])||void 0===t||t.searchQuery},a.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)||""},a.prototype.addCabHireToBasket=function(e,t){return b(this,void 0,void 0,(function(){var r,a,i;return y(this,(function(n){switch(n.label){case 0:return e.unavailable?[2,Promise.resolve(!1)]:[4,this.basketService.getDefaultBasket()];case 1:return r=n.sent(),a=null==r?void 0:r.subject.value,i=this.getTermsAndCond(e),a?[2,this.basketService.addToBasket({adults:t.adults,basket:a.id,service:e.sourceId.toString(),detail:{id:e.id,departs:e.departs,supplierName:e.supplierName,estimatedCO2:e.estimatedCO2,fromLocation:{address:t.fromLocation.address,postcode:t.fromLocation.postcode,latitude:e.fromLocation.latitude,longitude:e.fromLocation.longitude},toLocation:{address:t.toLocation.address,postcode:t.toLocation.postcode,latitude:e.toLocation.latitude,longitude:e.toLocation.longitude},vehicleType:t.vehicleType,tripDistanceMetres:e.tripDistanceMetres,tripDurationSeconds:e.tripDurationSeconds,termsAndCond:i},price:e.price,currency:e.currency,searchQuery:t,co2PerItem:e.co2PerItem,co2PerPassenger:e.co2PerPassenger,outboundDate:t.departs.format()},r,this.searchService,this.travellers,e.requiresReason)]:[2,Promise.resolve(!1)]}}))}))},a.prototype.switchFromAndToLocation=function(){var e=Object.assign({},this.toAddress),t=Object.assign({},this.fromAddress);this.fromAddress=e,this.toAddress=t},a.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})},a.prototype.getTermsAndCond=function(e){var t=l.default(e.departs).format(Ve.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>'}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:re.Cab,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r=this;return y(this,(function(a){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]}))}))},a}(c);Je.STORAGE_SESSION_PARAMS="search_cab",Je.SECONDARY_STORAGE_SESSION_PARAMS="secondary_search_cab",Je.STORAGE_SESSION_RESULTS="results_cab",Je.MULTI_STORAGE_SESSION_RESULTS="multi_results_cab",(We=e.SortTypesCar||(e.SortTypesCar={})).price="price",We.brand="brand",We.size="size",We.preferred="preferred",We.expensive="expensive";var Qe=function(a){function i(t,r,n,o,s,u){var c=a.call(this,s,n)||this;c.carhirefetcher=t,c.carHireAvailabilityDetailFetcher=r,c.basketService=o,c.searchService=u,c._carTypeCodes=[["B","2-3 Door",I.TwoToThreeDoor],["C","2/4 Door",I.TwoOrFourDoor],["D","4-5 Door",I.FourToFiveDoor],["W","Wagon / Estate",I.WagonOrEstate],["V","Passenger Van",I.PassengerVan],["L","Limousine",I.Limousine],["S","Sport",I.Sport],["T","Convertible",I.Convertible],["F","SUV",I.Suv],["J","Open Air All Terrain",I.OpenAirAllTerrain],["X","Special",I.Special],["P","Pickup Regular Cab",I.PickUpRegularCab],["Q","Pickup Extended Cab",I.PickUpExtendedCab],["Z","Special Offer Car",I.SpecialOfferCar],["E","Coupe",I.Coupe],["M","Monospace (Europe)",I.MonospaceEuropeanUse],["R","Recreational Vehicle",I.Suv],["H","Motor Home",I.MotorHome],["Y","2-Wheel Vehicle",I.TwoWheelVehicle],["N","Roadster",I.Roadster],["G","Crossover",I.Suv],["K","Commercial Van / Truck",I.PassengerVan]],c._carAirConditionTypes=[["Any","Any",null],["Y","Yes",!0],["N","No",!1]],c._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"}],c._carTransmissionCodes=[["M","Manual",O.Manual],["N","Manual 4-Wheel Drive",O.Manual],["C","Manual All-Wheel Drive",O.Manual],["A","Automatic",O.Auto],["B","Automatic 4-Wheel Drive",O.Auto],["D","Automatic All- Wheel Drive",O.Auto]],c._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"}],c._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"}],c._location_types=[e.LocationTypes.City,e.LocationTypes.Airport,e.LocationTypes.Postcode],c.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},c.type=re.Car,c._sorting_options=[{value:0,display:"Cheapest First"},{value:1,display:"Most Expensive First"},{value:2,display:"Preferred First"}],c._minDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},c._minInDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},c._pickup_date=null,c._pickup_time=null,c._dropoff_date=null,c._dropoff_time=null,c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS;var d=s.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(u.makeCarHireQuery(d.tempParams)),u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(e){c.adults=1,c.children=0,c.travellers=(null==e?void 0:e.slice(0,1))||[],c._isValid()}));var p=s.getSessionItemAsList(c.resultsSessionName)||[];return c.fullResults=n.clone(p||[]),c._cheapestResultPrice=c.updateLowestPrice(p),c.results.next(p),c}return m(i,a),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,"estimatedMileage",{get:function(){return this.tempParams.estimatedMileage},set:function(e){this.tempParams.estimatedMileage=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"pickupTime",{get:function(){return this._pickupTime},set:function(e){this._pickupTime=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dropoffTime",{get:function(){return this._dropoffTime},set:function(e){this._dropoffTime=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"postcodePickupRaw",{get:function(){return this.tempParams.postcodePickupRaw},set:function(e){this.tempParams.postcodePickupRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"postcodeDropoffRaw",{get:function(){return this.tempParams.postcodeDropoffRaw},set:function(e){this.tempParams.postcodeDropoffRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cityPickupDepot",{get:function(){return this.tempParams.cityPickupDepot},set:function(e){this.tempParams.cityPickupDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cityDropoffDepot",{get:function(){return this.tempParams.cityDropoffDepot},set:function(e){this.tempParams.cityDropoffDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"postcodeDropoff",{get:function(){return this.tempParams.postcodeDropoff},set:function(e){this.tempParams.postcodeDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"cityDropoff",{get:function(){return this.tempParams.cityDropoff},set:function(e){this.tempParams.cityDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minDate",{get:function(){return this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minInDate",{get:function(){return this._minInDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.prototype,"ngbPickupDate",{get:function(){return this._ngbPickupDate},set:function(e){this._ngbPickupDate=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ngbDropoffDate",{get:function(){return this._ngbDropoffDate},set:function(e){this._ngbDropoffDate=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"pickup_date",{get:function(){return this._pickup_date},set:function(e){this._pickup_date=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"pickup_time",{get:function(){return this._pickup_time},set:function(e){this._pickup_time=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dropoff_date",{get:function(){return this._dropoff_date},set:function(e){this._dropoff_date=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dropoff_time",{get:function(){return this._dropoff_time},set:function(e){this._dropoff_time=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"chosenVendor",{get:function(){return this.tempParams.chosenVendor},set:function(e){this.tempParams.chosenVendor=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenDistance",{get:function(){return this.tempParams.chosenDistance},set:function(e){this.tempParams.chosenDistance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carClass",{get:function(){return this.tempParams.carClass},set:function(e){this.tempParams.carClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carType",{get:function(){return this.tempParams.carType},set:function(e){this.tempParams.carType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"transmission",{get:function(){return this.tempParams.transmission},set:function(e){this.tempParams.transmission=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"airCon",{get:function(){return this.tempParams.airCon},set:function(e){this.tempParams.airCon=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locationType",{get:function(){return this.tempParams.locationType},set:function(e){this.tempParams.locationType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"carAirConditionTypes",{get:function(){return this._carAirConditionTypes},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"withinDistance",{get:function(){return this._withinDistance},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carTransmissionCodes",{get:function(){return this._carTransmissionCodes},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carTypeCodes",{get:function(){return this._carTypeCodes},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"vendors",{get:function(){return this._vendors},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortingOptions",{get:function(){return this._sorting_options},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCarHireQuery()),this.estimatedMileage=null,this._isValid()},i.prototype._isValid=function(){var t,r,a;if(this.doChecks){switch(this.storageService.setSessionItem(i.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===(a=this.dropoff_datetime)||void 0===a?void 0:a.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)}},i.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)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:re.Car,searchArgs:t,travelDate:this.pickup_datetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.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},i.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):e.searchArgs.airport?this.getParamsForCarbyAirport(e):e.searchArgs.depot&&this.getParamsForCarbyPostCode(e)},i.prototype.getParamsForCarbyAirport=function(r){var a=this;this.locationType=e.LocationTypes.Airport,t.combineLatest([this.searchService.getAirportByCode(r.searchArgs.airport.pickupCode),this.searchService.getAirportByCode(r.searchArgs.airport.dropoffCode)]).subscribe((function(e){var t,r,i,n,o,s,l,u,c,d,p,h,m=S(e,2),f=m[0],v=m[1];f&&v&&(a.dropoff_location={destination:f.iataMatch.name,gateway:f.iataMatch.iata,terminals:a.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===(i=f.iataMatch)||void 0===i?void 0:i.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},a.pickup_location={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:a.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===(h=null===(p=v.iataMatch)||void 0===p?void 0:p.locationDetails)||void 0===h?void 0:h.countryCode},a.dropoff_country=a.dropoff_location.countryCode,a.pickup_country=a.pickup_location.countryCode,a.searchService.startSearches())}))},i.prototype.getParamsForCarbyCity=function(t){this.locationType=e.LocationTypes.City,this.chosenDistance=t.searchArgs.city.chosenDistance,this.cityPickup={countryCode:t.searchArgs.city.pickupCountryCode,id:t.searchArgs.city.pickupCity,name:t.searchArgs.city.pickupName,type:e.LocationTypes.City,latitude:t.searchArgs.city.pickupLatitude,longitude:t.searchArgs.city.pickupLongitude},this.cityDropoff={countryCode:t.searchArgs.city.dropoffCountryCode,id:t.searchArgs.city.dropoffCity,name:t.searchArgs.city.dropOffName,type:e.LocationTypes.City,latitude:t.searchArgs.city.dropOffLatitude,longitude:t.searchArgs.city.dropOffLongitude},this.cityDropoffDepot={addressLines:[t.searchArgs.city.dropOffAddressLines],cityName:t.searchArgs.city.dropOffCityName,extendedLocationCode:t.searchArgs.city.dropOffExtendedLocationCode,locationCode:t.searchArgs.city.dropOffLocationCode,vendor:t.searchArgs.city.dropOffVendor,vendorCode:t.searchArgs.city.dropOffVendorCode},this.cityPickupDepot={addressLines:[t.searchArgs.city.pickupAddressLines],cityName:t.searchArgs.city.pickupCityName,extendedLocationCode:t.searchArgs.city.pickupExtendedLocationCode,locationCode:t.searchArgs.city.pickupLocationCode,vendor:t.searchArgs.city.pickupVendor,vendorCode:t.searchArgs.city.pickupVendorCode},this.searchService.startSearches()},i.prototype.getParamsForCarbyPostCode=function(t){this.locationType=e.LocationTypes.Postcode,this.chosenDistance=t.searchArgs.depot.chosenDistance,this.postcodeDropoff={addressLines:[t.searchArgs.depot.dropoffAddressLines],vendorCode:t.searchArgs.depot.vendorCode,locationCode:t.searchArgs.depot.dropOffLocationCode,extendedLocationCode:t.searchArgs.depot.dropOffExtendedLocationCode,cityName:t.searchArgs.depot.dropoffCityName,vendor:t.searchArgs.depot.dropoffVendor},this.postcodeDropoffRaw={name:t.searchArgs.depot.dropoffPostCode,type:e.LocationTypes.Postcode,latitude:t.searchArgs.depot.dropoffLatitude,longitude:t.searchArgs.depot.dropoffLongitude},this.postcodePickup={addressLines:[t.searchArgs.depot.pickupAddressLines],vendorCode:t.searchArgs.depot.vendorCode,locationCode:t.searchArgs.depot.pickupLocationCode,extendedLocationCode:t.searchArgs.depot.pickupExtendedLocationCode,cityName:t.searchArgs.depot.pickupCityName,vendor:t.searchArgs.depot.pickupVendor},this.postcodePickupRaw={name:t.searchArgs.depot.pickupPostCode,type:e.LocationTypes.Postcode,latitude:t.searchArgs.depot.pickupLatitude,longitude:t.searchArgs.depot.pickupLongitude},this.searchService.startSearches()},i.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)},i.prototype.getCarClasses=function(){return t.of(this._car_classes)},i.prototype.getLocationTypes=function(){return t.of(this._location_types)},i.prototype.filterResults=function(e,t){var r=this,a=this.helpers.clone(this.fullResults);a=a.filter((function(t){var a=r.getPrice(t);return a>=e.minPrice&&a<=e.maxPrice})),a=this.filterByTransmissionType(e.transmissions,a),a=this.filterByAirconType(e.airConditioning,a),a=this.filterByCarType(e.types,a),a=this.filterByCompany(e.companies,a),a=this.sortResults(t,a),this.results.next(a)},i.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},i.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},i.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},i.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},i.prototype.sortResults=function(e,t){var r=this,a=this.helpers.clone(t||this.results.value);switch(e){case 0:a=a.sort((function(e,t){return r.getPrice(e)-r.getPrice(t)}));break;case 1:a=a.sort((function(e,t){return r.getPrice(t)-r.getPrice(e)}));break;case 2:break;case 3:a=this.sortByBrand(a);break;case 4:a=this.sortBySize(a)}return this.results.next(a),a},i.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},i.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},i.prototype.sortBySize=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){var a,i;return a=t.carClassMap[e.displayRecord.vehicle.class.toLowerCase()],i=t.carClassMap[r.displayRecord.vehicle.class.toLowerCase()],a>=0&&i>=0?a-i:-1}));return this.results.next(r),r},i.prototype.sortByBrand=function(e){var t=this.helpers.clone(e||this.results.value).sort((function(e,t){var r=e.identifiers.vendor,a=t.identifiers.vendor;switch(r){case"ZE":r="HE";break;case"ZI":r="AV"}switch(a){case"ZE":a="HE";break;case"ZI":a="AV"}return r<a?-1:r>a?1:0}));return this.results.next(t),t},i.prototype.getPrice=function(e){try{return Number(e.displayRecord.charges[0].amount)}catch(e){}return 0},i.prototype.getMinPrice=function(e){var t=this;return e.reduce((function(e,r){var a=t.getPrice(r);return a<e&&(e=a),e}),Number.MAX_SAFE_INTEGER)},i.prototype.getMaxPrice=function(e){var t=this;return e.reduce((function(e,r){var a=t.getPrice(r);return a>e&&(e=a),e}),Number.MIN_SAFE_INTEGER)},i.prototype.updateFromPreviousSearches=function(t){var r;if(console.log("PREPOPULATING CARHIRE FORM"),null===(r=t[re.Flight])||void 0===r?void 0:r.searchQuery)try{var a=this.searchService.searches[re.Flight].outBoundDate.toDate(),i=this.searchService.searches[re.Flight].inboundDate.toDate();this.locationType=e.LocationTypes.Airport,this.pickup_datetime=this.searchService.searches[re.Flight].outBoundDate,this.dropoff_datetime=this.searchService.searches[re.Flight].inboundDate,this.pickup_date={day:a.getUTCDate(),month:a.getUTCMonth()+1,year:a.getUTCFullYear()},this.dropoff_date={day:i.getUTCDate(),month:i.getUTCMonth()+1,year:i.getUTCFullYear()},this.pickup_location=this.searchService.searches[re.Flight].arriveLocation,this.dropoff_location=this.searchService.searches[re.Flight].arriveLocation,this.pickup_country=this.searchService.searches[re.Flight].arriveLocation.countryCode,this.dropoff_country=this.searchService.searches[re.Flight].arriveLocation.countryCode}catch(e){console.error("Error trying to prepopulate carhire from flight item")}},i.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()}},i.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()}},i.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()}},i.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()}},i.prototype.isOverNight=function(){var e=this.pickup_datetime.date();return this.dropoff_datetime.date()-e>=1},i.prototype.updateLowestPrice=function(e){return e.length?{amount:this.getMinPrice(e),currencyCode:e[0].displayRecord.charges[0].currencyCode}:null},i.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})))},i.prototype.addCarHireToBasket=function(t,r){var a,i;return b(this,void 0,void 0,(function(){var n,o,s,l,u,c,d,p,h;return y(this,(function(m){switch(m.label){case 0:return t.unavailable?[2,Promise.resolve(!1)]:[4,this.basketService.getDefaultBasket()];case 1:return n=m.sent(),(o=null==n?void 0:n.subject.value)?(s=t.co2PerItem,l=t.co2PerPassenger,u=t.displayRecord,c=t.identifiers,d=t.sourceId,p=parseFloat(null!==(i=null===(a=null==u?void 0:u.charges[0])||void 0===a?void 0:a.amount)&&void 0!==i?i:"0"),h=this.getTermsAndCond(t,r),[2,this.basketService.addToBasket({adults:this.adults,basket:o.id,service:d.toString(),detail:{pickUpDatetime:u.pickup,dropOffDatetime:u.dropoff,pickUpLocation:{iata:this.locationType===e.LocationTypes.Airport?c.locationCode:"",name:u.pickupLocation.name,address:u.pickupLocation.topLine+", "+u.pickupLocation.city,postcode:u.pickupLocation.postCode},dropOffLocation:{iata:this.locationType===e.LocationTypes.Airport?c.dropOffLocation:"",name:u.returnLocation.name,address:u.returnLocation.topLine+", "+u.returnLocation.city,postcode:u.returnLocation.postCode},car:{type:u.vehicle.type,manualTransmission:u.vehicle.transmission.includes(O.Manual)},vendorName:u.vendor.name,identifiers:{dropOffLocation:c.dropOffLocation,locationCode:c.locationCode,locationName:c.locationName,vehType:c.vehType,vendor:c.vendor},termsAndCond:h},price:p,currency:"GBP",searchQuery:r,co2PerItem:s,co2PerPassenger:l,outboundDate:new Date(u.pickup).toISOString()},n,this.searchService,this.travellers,t.requiresReason)]):[2,Promise.resolve(!1)]}}))}))},i.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:""}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:re.Car,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},i}(c);Qe.STORAGE_SESSION_PARAMS="carhire_params",Qe.STORAGE_SESSION_RESULTS="carhire_results";var Ye,Ke=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},qe=function(e){},Xe={next:qe},ze=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]||Xe).next(t)},e}();(Ye=e.FlightDisplayTypes||(e.FlightDisplayTypes={}))[Ye.returns=1]="returns",Ye[Ye.dualSingles=2]="dualSingles";var Ze,$e=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:""});(Ze=e.FlightSearchType||(e.FlightSearchType={})).return="return",Ze.oneWay="oneWay",Ze.multiCity="multiCity";var et=function(e){this.value=e};et.MaxFlightClass=new et("MaxFlightClass"),et.SSO_no_password=new et("SSO_no_password"),et.HideFlightCabinClasses=new et("hideFlightCabinClasses"),et.AlternativeRailItineraryEnabled=new et("alternativeRailItineraryEnabled"),et.riskMinimumLevel=new et("riskMinimumLevel"),et.ENABLE_CHATBOT=new et("enableChatbot");var tt=function(e){this.value=e};tt.non=new tt("non"),tt.EVI=new tt("evi");var rt,at;(rt=e.TimeWindow||(e.TimeWindow={})).Anytime="Anytime",rt.Depart="Depart By",rt.Arrive="Arrive By",(at=e.FlightSortTypes||(e.FlightSortTypes={})).Cheapest="Cheapest",at.MostExpensive="Most Expensive",at.Fastest="Fastest",at.Preferred="Preferred",at.LowestEmissions="Lowest Emissions",at.DepartureTime="Departure Time",at.ArrivalTime="Arrival Time",at.Quickest="Quickest",at.MostDirect="Most Direct";var it,nt=function(a){function i(r,n,o,s,u,c,d,p){var h,m,f=a.call(this,u,n)||this;f.flightfetcher=r,f.userService=o,f.basketService=s,f.searchService=c,f.applyFlightRules=d,f.modalService=p,f.type=re.Flight,f.avaliableClasses=new t.BehaviorSubject([]),f.timeCriteriaOptions=new t.BehaviorSubject([]),f.flightOperators=new t.BehaviorSubject([]),f._negotiated=!1,f._nearby_airports=!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=((h={})[e.FlightSortTypes.Cheapest]=function(e,t){return e.total.price-t.total.price},h[e.FlightSortTypes.MostExpensive]=function(e,t){return t.total.price-e.total.price},h[e.FlightSortTypes.Fastest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},h[e.FlightSortTypes.Preferred]=function(e,t){return e.preferred-t.preferred},h[e.FlightSortTypes.LowestEmissions]=function(e,t){return e.co2PerItem-t.co2PerItem},h[e.FlightSortTypes.DepartureTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeDeparting),a=l.default(t.outboundFlights[0].dateTimeDeparting);return r.isBefore(a)?-1:r.isSame(a)?0:1},h[e.FlightSortTypes.ArrivalTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeArriving),a=l.default(t.outboundFlights[0].dateTimeArriving);return r.isBefore(a)?-1:r.isSame(a)?0:1},h[e.FlightSortTypes.Quickest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},h[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))},h),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:(e.preferred?1:0)-(t.preferred?1: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),a=l.default(t.departDateTime);return r.isBefore(a)?-1:r.isSame(a)?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),a=l.default(t.arrivalDateTime);return r.isBefore(a)?-1:r.isSame(a)?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:j.Flexible,display:"Flexible"},{value:j.Leisure,display:"Leisure"},{value:j.Lowest,display:"Lowest"},{value:j.Negotiated,display:"Negotiated"},{value:j.NonNegotiated,display:"Non-Negotiated"},{value:j.RequestFareRules,display:"Request Fare Rules"},{value:j.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=i.STORAGE_SESSION_RESULTS,f.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,f._showHotelForm=!1,f._hotelSearchRequested=!1,f.filters=new t.BehaviorSubject($e),f.duralSingleFilter=new t.BehaviorSubject($e),f.choosenDisplayType=new t.BehaviorSubject(e.FlightDisplayTypes.returns),f._multiDestination=[];var v=u.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}},b=c.makeFlightQuery(v.tempParams);return f.updateTempParams(b),f._originalUserSearch=v.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){f.travellers=e;var t=f.helpers.selectedTravellers(e,re.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===j.Negotiated,f}return m(i,a),Object.defineProperty(i.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(i.prototype,"preferredCarriers",{get:function(){return this.tempParams.preferredCarriers},set:function(e){this.tempParams.preferredCarriers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.prototype,"minDate",{get:function(){return this._minDate=this._minDate||this.helpers.momentToNgDate(l.default()),this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"queryOriginAiport",{get:function(){return this._originAirport},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"queryDestinationAiport",{get:function(){return this._destinationAirport},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.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(i.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(i.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(i.prototype,"cabinClass",{get:function(){return this.tempParams.cabinClass},set:function(e){this.tempParams.cabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnCabinClass",{get:function(){return this.tempParams.returnCabinClass},set:function(e){this.tempParams.returnCabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isReturn",{get:function(){return this.tempParams.chosenSearchType===e.FlightSearchType.return},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outTimeCriteria",{get:function(){return this.tempParams.outTimeCriteria},set:function(e){this.tempParams.outTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"inTimeCriteria",{get:function(){return this.tempParams.inTimeCriteria},set:function(e){this.tempParams.inTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxConnections",{get:function(){return this.tempParams.maxConnections},set:function(e){this.tempParams.maxConnections=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"multiDestination",{get:function(){return this.tempParams.multiDestination},set:function(e){this.tempParams.multiDestination=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"showHotelForm",{get:function(){return this._showHotelForm},set:function(e){this._showHotelForm=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hotelSearchRequested",{get:function(){return this._hotelSearchRequested},set:function(e){this._hotelSearchRequested=e},enumerable:!1,configurable:!0}),i.prototype.setMultiDestinationQuery=function(e){var t=this;return this.helpers.clone(e).reduce((function(e,r){var a={};return a.orig=r.orig.gateway,a.dest=r.dest.gateway,a.date=t.helpers.formatIsoDate(r.date),e.push(a),e}),[])},Object.defineProperty(i.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fareTypesValues",{get:function(){return this._fareTypeArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fareType",{get:function(){return this.tempParams.fareType},set:function(e){this.tempParams.fareType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"negotiated",{get:function(){return this._negotiated},set:function(e){this._negotiated=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"includeNearbyAirports",{get:function(){return this.tempParams.includeNearbyAirports},set:function(e){this.tempParams.includeNearbyAirports=e},enumerable:!1,configurable:!0}),i.prototype.processResults=function(t){if(!t)return this._grouped=[],this.multi=[],this.resultQuery=null,[];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,$e),this.filters.next(this.currentFilters),delete this.resultQuery.withGrouped;var r=t.multi.reduce((function(e,t){return e[0===t.order?"outbound":"inbound"]=t.results.reduce((function(e,t){return e[t.uid]=Object.assign({selected:!1,canSelect:!0},t),e}),e[0===t.order?"outbound":"inbound"]),e}),{outbound:{},inbound:{}}),a=this.helpers.createFlightFilters(Object.values(r.inbound),$e);if(this.duralSingleFilter.next(this.helpers.createFlightFilters(Object.values(r.outbound),Object.assign(Object.assign({},$e),{arrivalReturnAirport:a.arrivalAirport,depatureReturnAirport:a.depatureAirport,returnArrivalTime:a.arrivalTime,returnDuration:a.duration,returnDepartureTime:a.departureTime}))),t&&this.searchService.isFlightsGrouped()){var i=(t.journeys||[]).reduce((function(e,t){return e[t.uid]=Object.assign({selected:!1,canSelect:!0},t),e}),{}),n=A((t.grouped||[]).reduce(this.makeGroupedObjects(i),[]),(t.grouped||[]).reduce(this.makeGroupedObjects(r.outbound),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleOutbound,t})),(t.grouped||[]).reduce(this.makeGroupedObjects(r.inbound,!0),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleInbound,t})));return console.log("Processed Grouped data",n),n}return t?[t]:[]},i.prototype.makeGroupedObjects=function(t,r){var a=this;return void 0===r&&(r=!1),function(i,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,outboundFlightNumber:"",operator:"",operatorFull:"",inboundFlightNumber:"",isReturn:!1,minPrice:Number.MAX_SAFE_INTEGER,maxPrice:0,co2PerItem:0,co2PerPassenger:0,gid:n.referenceID},u=n.flights;return Object.keys(u).filter((function(e){return"_"!==e[0]})).forEach((function(e){u[e].length&&u[e].forEach((function(i){var n,o,u=t[i];if(u){s||r?a.createGroupedItem(l,u.source,u.outboundFlights,u.outboundTotalDuration,u.inboundFlights,u.inboundTotalDuration,u.co2PerItem,u.co2PerPassenger):a.createGroupedItem(l,u.source,u.inboundFlights,u.inboundTotalDuration,u.outboundFlights,u.outboundTotalDuration,u.co2PerItem,u.co2PerPassenger);var c=a.helpers.FlightCabinClassToBrandedOBTFlightCabinClass(e,!!u.baseFareId&&u.baseFareId!==u.uid),d=Math.floor(u.total.price),p=Math.ceil(u.total.price);l.minPrice=l.minPrice<d?l.minPrice:d,l.maxPrice=l.maxPrice>p?l.maxPrice:p,(null===(o=null===(n=l.classes[c])||void 0===n?void 0:n.flights)||void 0===o?void 0:o.length)?(l.classes[c].flights.push(u),l.classes[c].minprice=Math.min(l.classes[c].minprice,d),l.classes[c].maxprice=Math.max(l.classes[c].maxprice,p)):l.classes[c]={flights:[u],minprice:d,maxprice:p,currency:u.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}))&&i.push(l),i.filter((function(e){return!!e}))}},i.prototype.createGroupedItem=function(e,t,r,a,i,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=a,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==i?void 0:i.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=i.length,e.inlegs=i,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",i),e.isReturn=!0)},i.prototype.makeSessionResults=function(e){return{results:e,grouped:this._grouped,query:this.resultQuery}},i.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},i.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},i.prototype.resetQuery=function(e){void 0===e&&(e=!0),this.updateTempParams(this.searchService.makeFlightQuery()),e&&this._isValid()},i.prototype.resetParams=function(){this.reset(),this.resetQuery()},i.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(i.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)))},i.prototype.multiCityValidation=function(){var e=!1,t=!1,r=!1;this.tempParams.multiDestination.map((function(a,i){a.orig||(e=!0,i<2&&(t=!0)),a.orig===a.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")},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.flightfetcher.fetchList(e))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:re.Flight,searchArgs:e,travelDate:this.outBoundDate.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(r){var a=this;if(r.searchArgs.outboundDate){var i=r.searchArgs.outboundDepartureTimeWindow?r.searchArgs.outboundDepartureTimeWindow:r.searchArgs.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(r.searchArgs.outboundDate,i)}if(r.searchArgs.returnDate){var n=r.searchArgs.returnDepartureTimeWindow?r.searchArgs.returnDepartureTimeWindow:r.searchArgs.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(r.searchArgs.returnDate,n)}this.fareType=r.searchArgs.fareType,this.maxConnections=r.searchArgs.maxConnections,r.searchArgs.outboundCabinClass&&(this.cabinClass=r.searchArgs.outboundCabinClass[0]),r.searchArgs.returnCabinClass&&(this.returnCabinClass=r.searchArgs.returnCabinClass[0]),this.includeNearbyAirports=!!r.searchArgs.includeNearbyAirports,this.chosenSearchType=r.searchArgs.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,t.combineLatest([this.searchService.getAirportByCode(r.searchArgs.originAirport),this.searchService.getAirportByCode(r.searchArgs.destinationAirport)]).subscribe((function(e){var t,i,n,o,s,l,u,c,d,p,h,m,f=S(e,2),v=f[0],b=f[1];if(v&&b){if(a.departLocation={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:a.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===(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},a.arriveLocation={destination:b.iataMatch.name,gateway:b.iataMatch.iata,terminals:a.searchService.processTerminals(b.iataMatch.terminals),country:null===(c=null===(u=b.iataMatch)||void 0===u?void 0:u.locationDetails)||void 0===c?void 0:c.country,postcode:null===(p=null===(d=b.iataMatch)||void 0===d?void 0:d.locationDetails)||void 0===p?void 0:p.postcode,countryCode:null===(m=null===(h=b.iataMatch)||void 0===h?void 0:h.locationDetails)||void 0===m?void 0:m.countryCode},r.searchArgs.preferredCarriers){var y=[];r.searchArgs.preferredCarriers.map((function(e){a.searchService.getAirlinesList(e).subscribe((function(t){t.map((function(t){t.code===e&&y.push(t)})),a.preferredCarriers=y,a.searchService.startSearches()}))}))}a.searchService.startSearches()}})),this.searchService.startSearches()},i.prototype.makeDepartureTimeWindow=function(t,r,a){return r===e.TimeWindow.Depart?a?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4):null},i.prototype.makeArrivalTimeWindow=function(t,r,a){return r!==e.TimeWindow.Arrive?null:a?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4)},i.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)},i.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,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,withGrouped:r},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}:{}))},i.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()},i.prototype.updateAvaliableClasses=function(){var e=this.userService.getUserFavoriteObject(et.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)},i.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},i.prototype.updateFromPreviousSearches=function(e){},i.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},i.prototype.isGroupedFlights=function(e){var t;return"FlightGroupedQuoteResult"===(null===(t=e[0])||void 0===t?void 0:t.type)},i.prototype.applyFilters=function(t,r){var a,i,n=this;this.currentFilters=t,this.currentSort=r,0===this.fullResults.length&&this.results.next([]);var o=this.selectedGroupFlight?(null===(a=this.selectedGroupFlight.inboundFlights)||void 0===a||a.length,function(t,r){return function(a){return r===e.FlightDirectionEnum.DualSingleInbound||t.includes(a.uid)}}):function(e,t){return function(e){return!0}},s=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}},u=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))},c=function(e,t){return function(r){var a,i=(a=n.helpers).fromObject.apply(a,A([r],u(t,r).split(".")));return i>=e.min&&i<=e.max}},d=function(e,t){return function(r){var a,i,o=l.default((a=n.helpers).fromObject.apply(a,A([r],u(t,r).split(".")))).get("hour"),s=l.default((i=n.helpers).fromObject.apply(i,A([r],u(t,r).split(".")))).get("minute"),c=Number(o+"."+n.helpers.normaliseMinuteToBase10(s));return c>=e.min&&c<=e.max}},p=function(e){return function(t,r){return t[e]===r}},h=[],m=[],f=[];h.push(d(t.arrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),h.push(d(t.departureTime,"OUTBOUND_DEPARTURE.dateTimeDeparting")),f.push(c(t.returnDuration,"outboundTotalDuration")),h.push(c(t.duration,"outboundTotalDuration")),h.push(c(t.price,"total.price")),h.push(s(t.stops,(function(e,t){return e.outboundFlights.length===t}))),m.push(s(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),f.push(s(t.totalStops,(function(e,t){return e.outboundFlights.length===t}))),h.push(s(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,A(r)):0)===t}))),h.push(s(t.depatureAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),h.push(s(t.arrivalAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[e.outboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),m.push(c(t.duration,"outboundTotalDuration")),m.push(c(t.price,"total.price")),f.push(c(t.price,"total.price")),m.push(d(t.returnArrivalTime,"INBOUND_ARRIVAL.dateTimeArriving")),f.push(d(t.returnArrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),m.push(d(t.returnDepartureTime,"INBOUND_DEPARTURE.dateTimeDeparting")),m.push(c(t.returnDuration,"inboundTotalDuration")),f.push(c(t.returnDuration,"outboundTotalDuration")),m.push(s(t.stops,(function(e,t){return e.inboundFlights.length===t}))),f.push(s(t.stops,(function(e,t){return e.outboundFlights.length===t}))),m.push(s(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),m.push(s(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,A(r)):0)===t}))),f.push(s(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,A(r)):0)===t}))),m.push(s(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),f.push(s(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),m.push(s(t.arrivalReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[e.inboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),f.push(s(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 v=[];v.push(s(t.classes,p("cabinClass"))),v.push(s(t.airlines,p("marketingCarrier")));var b=[];b.push(s(t.classes,p("cabinClass"))),b.push(s(t.airlines,p("marketingCarrier")));var y=function(e,t){return h.reduce((function(t,r){return t=t&&r(e)}),!0)&&(!e.outboundFlights||!!(e.outboundFlights||[]).find((function(e){return!!v.reduce((function(t,r){return t&&r(e)}),!0)})))},g=function(e){var t;return m.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)})))},C=function(e){var t;return f.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)})))},T=this._ruleActionSummary.dualSingleWhenSelected[null===(i=this.selectedGroupFlight)||void 0===i?void 0:i.journeyHash]||{},P=function(e){var t,r,a,i,o,s,l,u,c,d,p;return e.selected=e.uid===(null===(t=n.selectedGroupFlight)||void 0===t?void 0:t.uid),e.unavailable=(null===(r=n._ruleActionSummary.journeyWhenSelected[e.journeyHash])||void 0===r?void 0:r.unavailable)||(null===(a=n._ruleActionSummary.whenSelectedAlone[e.journeyHash])||void 0===a?void 0:a.unavailable)||(null===(i=T[e.journeyHash])||void 0===i?void 0:i.unavailable)||!1,e.unavailableMessage=(null===(o=n._ruleActionSummary.journeyWhenSelected[e.journeyHash])||void 0===o?void 0:o.unavailableMessage)||(null===(s=n._ruleActionSummary.whenSelectedAlone[e.journeyHash])||void 0===s?void 0:s.unavailableMessage)||"",e.requiresReason=(null===(l=n._ruleActionSummary.journeyWhenSelected[e.journeyHash])||void 0===l?void 0:l.requiresReason)||(null===(u=n._ruleActionSummary.whenSelectedAlone[e.journeyHash])||void 0===u?void 0:u.requiresReason)||(null===(c=T[e.journeyHash])||void 0===c?void 0:c.requiresReason)||!1,e.requiresReasonMessage=(null===(d=n._ruleActionSummary.journeyWhenSelected[e.journeyHash])||void 0===d?void 0:d.requiresReasonMessage)||(null===(p=n._ruleActionSummary.whenSelectedAlone[e.journeyHash])||void 0===p?void 0:p.requiresReasonMessage)||"",e};if(this.isGroupedFlights(this.fullResults)){var D=this._grouped.find((function(e){return e.referenceID===n.selectedGroupId}));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?y:t.direction===e.FlightDirectionEnum.DualSingleInbound?C:g;return t.classes=Object.entries(t.classes).reduce((function(e,a){var i=S(a,2),s=i[0],l=i[1];if(l&&l.flights){var u=l.flights.filter((function(e){return!!e})).filter(o((null==D?void 0:D.flights[n.helpers.OBTFlightCabinClassToFlightCabinClass(s)])||[],t.direction)).filter(r).map(P);u.length>0&&(e[s]=Object.assign(Object.assign({},l),{flights:u}))}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 a=n.helpers.clone(e.journeys);if(t.flightNumber&&(a=a.filter((function(e){var r=e.outboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber})),a=e.inboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber}));if(r||a)return e}))),a=a.filter(y),n.isReturn){var i=n.helpers.clone(e.journeys);i=i.filter(g),a=n.mergeOutInBound(a,i)}return a.sort(n._sortItinaryRoutines[r]),{type:"FlightAllQuoteResult",journeys:a}}))))},i.prototype.mergeOutInBound=function(e,t){return Object.values(A(e,t).reduce((function(e,t){var r=t.uid,a=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]])}return r}(t,["uid"]);return e[r]||(e[r]=Object.assign(Object.assign(Object.assign({},e[r]||{}),{uid:r}),a)),e}),[]))},i.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})}}},i.prototype.selectGroupedFlight=function(t,r,a){return b(this,void 0,void 0,(function(){var i,n,o=this;return y(this,(function(s){switch(s.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return i=s.sent(),(n=null==i?void 0:i.subject.value)&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.oneWay&&r===e.FlightDirectionEnum.Outbound?(this.bookSingleFlight(i,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=a,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(i,t,{outboundFlights:A(t.outboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:A(t.inboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"inbound",0,t)}))),journeyType:"roundtrip"},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(i,this.selectedGroupFlight),this.bookSingleFlight(i,t),this.selectedGroupFlight.selected=!1,this.selectedGroupFlight=null,this.applyFilters(this.currentFilters,this.currentSort)),[2]))}}))}))},i.prototype._updateTravelPolicies=function(){var e=this;if(this.selectedGroupFlight&&!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.applyFlightRules.fetchOne({selectedOutboundFlight:this.selectedGroupFlight,availableInboundFlights:t}).pipe(r.take(1)).subscribe((function(t){t&&(e._ruleActionSummary=e.helpers.mergeObjects(e._ruleActionSummary,t),e._applyFilter())}))}},i.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"},t.outboundFlights[0].dateTimeDeparting)},i.prototype.doBooking=function(e,t,r,a,i){var n=t.sourceId,o=t.co2PerItem,s=t.co2PerPassenger,l=t.total,u={adults:this.adults,basket:e.id,children:this.children,co2PerItem:o,co2PerPassenger:s,currency:l.currency,detail:r,price:l.price,searchQuery:this.resultQuery,service:n.toString(),outboundDate:a};i&&(u.inboundDate=i),this.basketService.addToBasket(u,e,this.searchService,this.travellers,t.requiresReason)},i.prototype.makeSchemaFlights=function(e,t,r,a){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:a}})},i.prototype.addFlightJourneysToBasket=function(e){return b(this,void 0,void 0,(function(){var t,r,a,i,n,o,s,u,c,d;return y(this,(function(p){switch(p.label){case 0:return e.unavailable?[2,Promise.resolve(!1)]:[4,this.basketService.getDefaultBasket()];case 1:return t=p.sent(),(null==t?void 0:t.subject.value)?(r=e.sourceId,a=e.co2PerItem,i=e.co2PerPassenger,n=e.total,o=l.default(e.outboundFlights[0].dateTimeDeparting),s=e.inboundFlights.length?l.default(e.inboundFlights[0].dateTimeDeparting):null,u=this.getTermsAndCond(e),c={outboundFlights:A(e.outboundFlights.map((function(e,t){return Object.assign({},e)}))),inboundFlights:A(e.inboundFlights.map((function(e,t){return Object.assign({},e)}))),termsAndCond:u,journeyType:"single"},d={adults:this.adults,basket:t.id,children:this.children,co2PerItem:a,co2PerPassenger:i,currency:n.currency,detail:c,price:n.price,searchQuery:this.resultQuery,service:r.toString(),outboundDate:o.format()},s&&(d.inboundDate=s.format(),c.journeyType="roundtrip"),[2,this.basketService.addToBasket(d,t,this.searchService,this.travellers,e.requiresReason)]):[2,Promise.resolve(!1)]}}))}))},i.prototype.setFlightDisplayType=function(e){this.selectedGroupFlight=null,this.choosenDisplayType.next(e)},i.prototype._applyFilter=function(){this.applyFilters(this.currentFilters,this.currentSort)},i.prototype.openFlightFareRules=function(e,t){var r=this;Object.values(e).find((function(e){return e.length}))?this.modalService.open(d.ModalFlightFareComponent,null,{rules:e,from:t[0].originAirport,to:t[t.length-1].destinationAirport}):this.searchService.getFlightFareRules(t[0]).subscribe((function(e){r.modalService.open(d.ModalFlightFareComponent,null,{rules:e.results[0],from:t[0].originAirport,to:t[t.length-1].destinationAirport})}),(function(e){console.log(e)}))},i.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:""}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:re.Flight,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r,a=this;return y(this,(function(i){switch(i.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 b(a,void 0,void 0,(function(){var t,r,a;return y(this,(function(i){switch(i.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=i.sent(),a=t,[4,this.searchService.getAirportsList(e.dest).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.dest}))}))];case 2:return a.dest=i.sent(),[2,t]}}))}))})))];case 1:return r=i.sent(),this.multiDestination=r,[3,3];case 2:this.searchService.getAirportsList(t.originAirport).subscribe((function(e){a.departLocation=e.find((function(e){return e.gateway==t.originAirport}))})),this.searchService.getAirportsList(t.destinationAirport).subscribe((function(e){a.arriveLocation=e.find((function(e){return e.gateway==t.destinationAirport}))})),i.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]}}))}))},i.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},i}(c);nt.STORAGE_SESSION_PARAMS="search_flight",nt.STORAGE_SESSION_RESULTS="results_flight",(it=e.URLS||(e.URLS={})).AccessToken="accessToken",it.LOGOUT_URL="logout",it.Refresh="refreshToken",it.CONFERMA_THUMBNAIL_URL="https://ssl.conferma.com/Images/PropertyThumbnails/",it.CONFIRMA_PHOTO_URL="/confermainfo/Info.aspx?mode=media&key=MICROSSABS&id=",it.CONFIRMA_INFO_URL="/confermainfo/Info.aspx?mode=hotel&key=MICROSSABS&id=",it.RECOVER_PASSWORD_URL="password/getResetToken",it.RESET_PASSWORD="password/resetByToken",it.ADMIN_USER_PANEL="https://admin-staging.ctmlightning.co.uk/user";var ot,st,lt=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=[]};(ot=e.HotelView||(e.HotelView={})).LIST="list",ot.MAP="map",(st=e.SortTypesHotel||(e.SortTypesHotel={})).distance="distance",st.name="name",st.price="price";var ut=function(a){function i(r,n,o,s,u,c,d,p,h,m,f,v){var b=a.call(this,d,n)||this;b.hotelFetcher=r,b.userService=o,b.environment=s,b.avaliabilityService=u,b.basketService=c,b.searchService=p,b.httpCallService=h,b.quickListFetcher=m,b.getRailStationFetcher=f,b.applyHotelRulesFetcher=v,b.type=re.Hotel,b.location_types=new t.BehaviorSubject([]),b.offices=new t.BehaviorSubject([]),b.lastActivePage=new t.BehaviorSubject(null),b.galleries={},b.occupied=0,b.results_details={chains:new Set,amenities:[],maxDistance:0},b._bookedTravellers=[],b.filterChange=new t.Subject,b.selectItemMapView=new t.Subject,b.display={minprice:Number.NEGATIVE_INFINITY,maxprice:Number.POSITIVE_INFINITY,filters:{breakfastType:[]}},b.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},b.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},b.localFilters=new lt,b.currentView=e.HotelView.LIST,b._max_no_of_rooms=4,b._max_rooms_array=new Array(b._max_no_of_rooms).fill(0),b._max_no_of_occupants=8,b._max_occupant_array=new Array(b._max_no_of_occupants).fill(0),b._distance_list=[1,2,5,10,20,25],b._default_currency=null,b.resultsSessionName=i.STORAGE_SESSION_RESULTS,b.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,b.query={},b.filterResults=function(){b.resultsFilterMethod=function(e){return e.filter((function(e){return b.inPriceRange(e)&&b.inDistanceRange(e)&&b.containsHotelname(e)&&b.hasChain(e)&&b.breakfastTypeFilter(e)}))},b.results.next(b.resultsFilterMethod(b.fullResults))},b.filterLighteningResults=function(){b.resultsFilterMethod=function(e){return e.filter((function(e){return b.inLighteningPriceRange(e)&&b.containsHotelname(e)&&b.hasChain(e)&&b.hasPreferred(e)&&b.breakfastTypeFilter(e)&&b.getExtraFilter(e)&&b.getAmenitiesFilter(e)}))},b.results.next(b.resultsFilterMethod(b.fullResults))},b.results_details.chains=new Set;var y=d.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};b.default_currency=b.tempParams.currency?b.tempParams.currency:b._default_currency,b.updateTempParams(p.makeHotelQuery(y.tempParams)),p.shouldAddTravellerSubscription()&&p.travellerInformation.subscribe((function(e){b.travellers=e;var t=b.helpers.selectedTravellers(e,re.Hotel);b.tempParams.no_of_occupants=t.adults.length,b.travellers=e,b._isValid()}));var g=d.getSessionItemAsList(b.resultsSessionName)||[];return g.slice(0,b.environment.numberHotelToPreload).forEach((function(e){b.searchService.canBook(re.Hotel)&&b.avaliabilityService.getAvailabilityForId(b.makeHotelAvalilityObject(e),e)})),g.forEach((function(e){b.results_details.chains.add(e.group)})),b.fullResults=g,b.results.next(g),b._isValid(),b.userService.changeUser.subscribe((function(t){b.location_types.next([e.LocationTypes.Airport,e.LocationTypes.City,e.LocationTypes.Office,e.LocationTypes.Shortlist,e.LocationTypes.TrainStation]),p.shouldFetchAllOffices()&&b.offices.next([])})),b.localFilters=new lt,b.avaliabilityService.fetching.subscribe((function(e){if(!e){var t=b.avaliabilityService.maxPriceForCurrency("GBP");t>0&&(b.filters.priceRange.max=t,b.localFilters.priceRange.max=t),b._cheapestResultPrice=b.updateLowestPrice(g),b.searchService.canBook(re.Hotel)&&b._applyTravelRules()}})),b}return m(i,a),Object.defineProperty(i.prototype,"chains",{get:function(){return A(this.results_details.chains)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"amenities",{get:function(){return A(this.results_details.amenities)},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"maxPrice",{get:function(){return Math.ceil(this.filters.priceRange.max)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.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(i.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(i.prototype,"default_currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this.tempParams.location},set:function(e){this.tempParams.location=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"formatted_location",{get:function(){return this.tempParams.location?this.tempParams.location.destination:"No Location Set"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"distance",{get:function(){return this.tempParams.distance},set:function(e){this.tempParams.distance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"country",{get:function(){return this.tempParams.country},set:function(e){this.tempParams.country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"postcode",{get:function(){return this.tempParams.postcode},set:function(e){this.tempParams.postcode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"trainsStation",{get:function(){return this.tempParams.trainsStation},set:function(e){this.tempParams.trainsStation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"office",{get:function(){return this.tempParams.office},set:function(e){this.tempParams.office=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"max_rooms_array",{get:function(){return this._max_rooms_array},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_occupant_array",{get:function(){return this._max_occupant_array},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_no_of_rooms",{get:function(){return this._max_no_of_rooms},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"distance_list",{get:function(){return this._distance_list},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"filters",{get:function(){return this.localFilters},enumerable:!1,configurable:!0}),i.prototype.processResults=function(e){var t=this;return this.results_details.maxDistance=0,this.results_details.chains=new Set,e.map((function(e,r){return 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),Object.assign({sortedTags:t.sortTags(e.tags),Details:{distance_airport:0,distance_metro:0,distance_rail:0,airport_details:{name:"Not returned"},metro_details:{name:"Not returned"},rail_details:{name:"Not returned"}}},e)}))},i.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}));0!==t.length&&this.applyHotelRulesFetcher.fetchKeyedObject("id",{data:t}).pipe(r.take(1)).subscribe((function(t){var r=e.resultsFilterMethod(e.fullResults).map((function(r){return t[r.id]?e.avaliabilityService.setHotelAvalability(t[r.id]):r}));e.results.next(r)}))},i.prototype.makeLocations=function(e){return this.helpers.arrayToObjectArray(e,["distanceType"])},i.prototype.sortTags=function(e){var t=this;return e?A(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})})):[]},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeHotelQuery()),this.localFilters=new lt,this.results_details={chains:new Set,amenities:[],maxDistance:0},this._isValid()},i.prototype._isValid=function(){var t,r,a,n,o,s;if(this.doChecks){switch(this.storageService.setSessionItem(i.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===(a=this.tempParams.location.airport)||void 0===a?void 0:a.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)}},i.prototype.startSearch=function(){if(this.results.next([]),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)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:re.Hotel,searchArgs:t,travelDate:this.checkin_date.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(t){var r,a=t;switch(a.location_type_select=this.location_type_select,(null===(r=this.location)||void 0===r?void 0:r.name)&&(a.cityName=this.location.name),a.location_type_select){case e.LocationTypes.Office:a.officeName=this.office.name;break;case e.LocationTypes.TrainStation:a.trainsStationDetail=this.trainsStation;break;case e.LocationTypes.Airport:a.airportDetail=this.location.airport}return a},i.prototype.startRecentSearch=function(t){var a=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}};a.location=Object.assign(Object.assign({},t),e.iataMatch),a.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){a.office={id:e.id,name:e.name},a.searchService.startSearches()}));break;case e.LocationTypes.TrainStation:this.getRailStationByCode(t.searchArgs.trainStationCode).subscribe((function(t){a.trainsStation=Object.assign(Object.assign({},t),{type:e.LocationTypes.TrainStation}),a.searchService.startSearches()}));break;case e.LocationTypes.Shortlist:this.country={cCode:t.searchArgs.countryCode,cName:""},this.searchService.startSearches()}},i.prototype.getRailStationByCode=function(e){return e?this.getRailStationFetcher.fetchList({id:null,code:e}).pipe(r.take(1)):t.of()},i.prototype.getSearchQuery=function(e){return void 0===e&&(e=!1),this.buildQuery(e),this.helpers.removeNulls(this.query)},i.prototype.buildQuery=function(t){var r,a,i,n,o,s;void 0===t&&(t=!1);var l=t?this.originalUserSearch:this.tempParams,u={startDate:l.checkin_date.format("YYYY-MM-DD"),endDate:l.checkout_date.format("YYYY-MM-DD"),rooms:l.no_of_rooms,adults:l.no_of_occupants,currency:l.currency?l.currency:null,distance:l.distance,distanceType:e.ɵb.M,maxResults:100};switch(this.getRoomNumber(),l.location_type_select){case e.LocationTypes.Airport:u.iata=l.location.airport.gateway;break;case e.LocationTypes.City:u.countryCode=l.country.cCode,this.location?(u.latitude=l.location.latitude,u.longitude=l.location.longitude):l.postcode&&(u.postOrZipCode=l.postcode.name);break;case e.LocationTypes.TrainStation:(null===(a=null===(r=l.location)||void 0===r?void 0:r.railstation)||void 0===a?void 0:a.stationCode)?u.trainStationCode=l.location.railstation.stationCode:(null===(i=l.trainsStation)||void 0===i?void 0:i.stationCode)&&(u.trainStationCode=l.trainsStation.stationCode);break;case e.LocationTypes.Office:(null===(n=l.location)||void 0===n?void 0:n.id)?u.officeId=+l.location.id:(null===(o=l.office)||void 0===o?void 0:o.id)&&(u.officeId=+l.office.id);break;case e.LocationTypes.Shortlist:u.countryCode=l.country.cCode;break;case e.LocationTypes.Postcode:u.countryCode=l.country.cCode,u.postOrZipCode=l.location.name}l.hotel_name&&(u.hotelName=l.hotel_name),l.hotel_chain&&(u.groupName=null===(s=l.hotel_chain)||void 0===s?void 0:s.name),this.query=u},i.prototype.makeHotelAvalilityObject=function(e){return{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:"GBP"}},i.prototype.resultsHaveTag=function(e){var t=this,r=this.fullResults.filter((function(r){var a=r.tags.filter((function(r){if(r.name)return!!t.convertToOneString(r.name).toLowerCase().includes(t.convertToOneString(e).toLowerCase())}));return!!(a&&a.length>0)}));return!!(r&&r.length>0)},i.prototype.inPriceRange=function(e){var t=this.avaliabilityService.getAvailabilityValue(e);return!!t&&(this.helpers.inRange(t.maxprice,this.filters.priceRange)&&this.helpers.inRange(t.minprice,this.filters.priceRange))},i.prototype.inDistanceRange=function(e){return 0===this.filters.distanceRange.max||this.helpers.inRange(e.location.distance,this.filters.distanceRange)},i.prototype.containsHotelname=function(e){var t=this.filters.hotelName.toLowerCase();return!(t&&t.length>0)||e.name.toLowerCase().includes(t)},i.prototype.inLighteningPriceRange=function(e){var t=this.avaliabilityService.getAvailabilityValue(e);if(t&&0!==Object.keys(t).length){var r,a=0,i=this.helpers.inRange(t.prpn,this.filters.priceRange);return a=(null==t?void 0:t.maxprice)?t.maxprice:null==t?void 0:t.rooms.reduce((function(e,t){return e>t.total?e:t.total}),0),r=this.helpers.inRange(a,this.filters.priceRange),i&&r}return!0},i.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)}))},i.prototype.breakfastTypeFilter=function(t){if(!this.filters.breakfastType.length)return!0;var r=this.avaliabilityService.getAvailabilityForId(this.makeHotelAvalilityObject(t),t);if(!r&&!r.value)return!1;var a=r.value,i=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_INCLUDED),n=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_NOT_INCLUDED);return!!(null==a?void 0:a.rooms)&&!!a.rooms.filter((function(e){return i&&n?e:i?e.rateDescription.match(_e)&&!e.rateDescription.match(Re):n?!e.rateDescription.match(_e)||e.rateDescription.match(Re):void 0})).length},i.prototype.byMostExpensive=function(){this.sortByPrice(!1)},i.prototype.sortByPrice=function(e,t){var r=this;void 0===e&&(e=!0),void 0===t&&(t=!1);var a=this.fullResults,i=[],n=[];a.map((function(e){var t;(null===(t=r.avaliabilityService.getAvailabilityValue(e))||void 0===t?void 0:t.prpn)?i.push(e):n.push(e)})),i.sort((function(t,a){var i,n,o=null===(i=r.avaliabilityService.getAvailabilityValue(t))||void 0===i?void 0:i.prpn,s=null===(n=r.avaliabilityService.getAvailabilityValue(a))||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=A(i,n);this.results.next(o),t&&(console.log("++ sortByPrice() called ++"),console.log("++ hotel ++",a),console.log("++ hotelsWithPrices ++",i),console.log("++ hotelsWithoutPrices ++",n),console.log("++ sortedHotels ++",o))},i.prototype.sortByName=function(){this.results.next(this.helpers.clone(this.fullResults).sort((function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())})))},i.prototype.sortByDistance=function(){this.results.next(this.helpers.clone(this.fullResults).sort((function(e,t){return Number(e.location.distance)-Number(t.location.distance)})))},i.prototype.byPreferred=function(){var e=this,t=this.results.value||[];try{t=t.sort((function(t,r){return e.preferredToInt(r)-e.preferredToInt(t)}))}catch(e){console.error("+++ Error sorting by preferred: ",e," +++")}this.results.next(t)},i.prototype.preferredToInt=function(e){return(e.preferred.client?1:0)+(e.preferred.consumer?2:0)},i.prototype.intToPreferred=function(e){return{client:1==(1&e),consumer:2==(2&e)}},i.prototype.addFilter=function(e,t){this.localFilters[t].push(e)},i.prototype.removeFilter=function(e,t){var r=this.localFilters;Array.isArray(r[t])&&(r[t]=r[t].filter((function(t){return e!==t})))},i.prototype.resetFilters=function(){this.localFilters.chain=[],this.localFilters.amenitytype=[],this.localFilters.preferred=[],this.localFilters.extra=[],this.localFilters.hotelName="",this.localFilters.breakfastType=[]},i.prototype.updateFromPreviousSearches=function(t){var r,a;console.log("PREPOPULATING HOTEL FORM");var i=null===(r=t[re.Flight])||void 0===r?void 0:r.searchQuery,n=null===(a=t[re.Rail])||void 0===a?void 0:a.searchQuery;if(i)try{this.location_type_select=e.LocationTypes.Airport,this.checkin_date=this.searchService.searches[re.Flight].outBoundDate,this.checkout_date=this.searchService.searches[re.Flight].inboundDate,this.location={name:this.searchService.searches[re.Flight].arriveLocation.destination,type:"Airport",airport:this.searchService.searches[re.Flight].arriveLocation}}catch(e){console.error("Error trying to prepopulate hotel from flight item")}else if(n)try{this.location_type_select=e.LocationTypes.TrainStation,this.checkin_date=this.searchService.searches[re.Rail].outBoundDateTime,this.checkout_date=this.searchService.searches[re.Rail].inBoundDateTime,this.trainsStation=this.searchService.searches[re.Rail].travellingTo,this.location=this.searchService.searches[re.Rail].travellingTo}catch(e){console.error("Error trying to prepopulate hotel from rail item")}},i.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)},i.prototype.getmaxPriceForCurrency=function(e){return this.avaliabilityService.maxPriceForCurrency(e)},i.prototype.getExtraFilter=function(t){var r=this;return this.filters.extra.includes(e.SearchHandler.AVAILABILITY)?!0===t.unavailable:!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},i.prototype.getAmenitiesFilter=function(e){var t=this,r=!0;return this.filters.amenitytype.forEach((function(a){var i=e.tags.filter((function(e){if(e.name)return!!t.convertToOneString(e.name).toLowerCase().includes(t.convertToOneString(a).toLowerCase())}));return r=!!(i&&i.length>0)})),r},i.prototype.convertToOneString=function(e){return e.replace(/[^a-zA-Z]/g,"")},i.prototype.getImages=function(a){var i=this,n=this.environment.hostBaseUrl+e.URLS.CONFIRMA_PHOTO_URL+a.split(",")[0];return this.galleries[a]?t.of(this.galleries[a]):this.httpCallService.get(n,{responseType:"text"}).pipe(r.map((function(e){if(!e)throw Error("Gallery for "+a+" 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 "+a);return i.galleries[a]=r})))},i.prototype.addPaginationPage=function(e){var t="PaginationPageCount";return this.storageService.setSessionItem(t,e),this.storageService.getSessionItem(t)},i.prototype.toggleView=function(){this.currentView===e.HotelView.LIST?this.currentView=e.HotelView.MAP:this.currentView=e.HotelView.LIST},i.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")},i.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}},i.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 a=[],i=0;i<e.length;i++)for(var n=0;n<e[i].Adults;n++)a.push(i+1)},i.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},i.prototype.addHotelRoomToBasket=function(e,t,r,a){return b(this,void 0,void 0,(function(){var a,i,n,o,l,u,c,d,p,h,m=this;return y(this,(function(f){switch(f.label){case 0:return console.log(e),console.log(t),console.log(r),e.unavailable?[2,Promise.resolve(!1)]:(r.startDate=new Date(r.startDate).toISOString(),r.endDate=new Date(r.endDate).toISOString(),delete(a=Object.assign({},r)).adults,(i=[]).push({rateDescription:t.rateDescription,roomDescription:t.roomDescription,roomId:t.roomId,roomType:t.roomType,rateCode:t.rateCode,checkIn:r.startDate,checkOut:r.endDate}),[4,this.basketService.getDefaultBasket()]);case 1:return n=f.sent(),(o=null==n?void 0:n.subject.value)&&(l=this.tempParams.no_of_occupants,u=new Array(this.tempParams.no_of_rooms).fill("TEST"),c=this.tempParams.no_of_rooms===l?1:2,d=s.default.chunk(this.travellers,c),p=e.address,h=this.getTermsAndCond(t,r),u.forEach((function(s,l){if(m.basketService.addToBasket({adults:c,basket:o.id,service:e.sourceId.toString(),detail:{hotelAddress:{streetName:p.addressLine1,town:p.addressLine2,county:p.addressLine3,postcode:p.postOrZipCode,countryCode:p.countryCode},hotelDescription:e.group,hotelId:e.id,hotelName:e.name,numberOfRooms:1,rooms:i,termsAndCond:h},price:t.total,currency:t.currencyCode,searchQuery:a,outboundDate:r.startDate},n,m.searchService,d[l]||[],t.requiresReason),l===u.length-1)return Promise.resolve(!0)}))),[2,Promise.resolve(!1)]}}))}))},i.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}]},i.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 a={name:""+l.default(),serviceType:re.Hotel,searchArgs:r};return this.searchService.saveFavouriteSearch(a)}},i.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r;return y(this,(function(a){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]}))}))},i}(c);ut.STORAGE_SESSION_PARAMS="search_hotel",ut.STORAGE_SESSION_RESULTS="results_hotel";var ct=function(e){function r(a,i,n,o,s){var u=e.call(this,o,i)||this;u.loungefetcher=a,u.basketService=n,u.searchService=s,u.type=re.Lounge,u.terminals=new t.BehaviorSubject([]),u._flightNumber=null,u._selectedTerminal="",u.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},u._date=null,u._time=null,u.resultsSessionName=r.STORAGE_SESSION_RESULTS,u.multiResultsSessionName=r.STORAGE_SESSION_RESULTS;var c=o.getSessionItem(r.STORAGE_SESSION_PARAMS)||{tempParams:{}};u.updateTempParams(s.makeLoungesQuery(c.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){var t=u.helpers.selectedTravellers(e,re.Lounge);u.tempParams.adults=t.adults.length,u.tempParams.children=t.children.length,u.travellers=e,u._isValid()}));var d=o.getSessionItemAsList(u.resultsSessionName)||[];return u._cheapestResultPrice=u.updateLowestPrice(d),u.results.next(d||[]),u}return m(r,e),Object.defineProperty(r.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.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(r.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(r.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.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}),r.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeLoungesQuery()),this._isValid()},r.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)},r.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(r.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))},r.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()}},r.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)},r.prototype.getRecentSearchQuery=function(e){return{serviceType:re.Lounge,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},r.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 a,i,n,o,s,l;r&&(t.locationCode={country:null===(i=null===(a=r.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===i?void 0:i.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()},r.prototype.sortByPrice=function(e,t){void 0===t&&(t=[]);var r=A(this.fullResults);r.length||(r=t),r=this.sortResultsPrice(r,e),this.results.next(r)},r.prototype.sortResultsPrice=function(e,t){var r=A(e);return r=t?r.sort((function(e,t){return t.price-e.price})):r.sort((function(e,t){return e.price-t.price}))},r.prototype.sortByTerminal=function(e){void 0===e&&(e=[]);var t=A(this.fullResults);t.length||(t=e);this.results.next(t.sort((function(e,t){return-1})))},r.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING LOUNGE FORM"),null===(t=e[re.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[re.Flight].outBoundDate.toDate();this.date={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.locationCode=this.searchService.searches[re.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},r.prototype.addLoungeToBasket=function(e,t){var r;return b(this,void 0,void 0,(function(){var a,i,n;return y(this,(function(o){switch(o.label){case 0:return e.unavailable?[2,Promise.resolve(!1)]:[4,this.basketService.getDefaultBasket()];case 1:return a=o.sent(),i=null==a?void 0:a.subject.value,n=this.getTermsAndCond(e),i?[2,this.basketService.addToBasket({adults:t.adults,children:t.children,infants:t.infants,basket:i.id,service:e.sourceId.toString(),detail:{arrivalDatetime:t.arrivalDatetime.format(),locationCode:e.code,name:e.name,airportIata:null==t?void 0:t.locationCode,logo:e.lounge.logo,introduction:e.lounge.introduction,covidCopy:e.lounge.misc.covidCopy,cancellationInfo:e.lounge.cancellationInfo,admendmentsInfo:e.lounge.amendmentsInfo,checkInInfo:e.lounge.checkInInfo,dressCode:e.lounge.dressCode,foodAndBeverage:e.lounge.foodAndBeverage,whatsIncludedFood:e.lounge.whatsIncludedFood,whatsIncludedDrinks:e.lounge.whatsIncludedDrinks,whatsIncludedExtras:e.lounge.whatsIncludedExtras,groupInfo:e.lounge.groupInfo,terminal:null===(r=e.lounge.terminal)||void 0===r?void 0:r.toString(),termsAndCond:n},price:e.price,currency:e.currency,searchQuery:t,outboundDate:t.arrivalDatetime.format()},a,this.searchService,this.travellers,e.requiresReason)]:[2,Promise.resolve(!1)]}}))}))},r.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}]},r.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})},r.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:re.Lounge,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},r.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},r}(c);ct.STORAGE_SESSION_PARAMS="search_lounge",ct.STORAGE_SESSION_RESULTS="results_lounge";var dt,pt,ht={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"},mt=function(e){function r(a,i,n,o,s){var u=e.call(this,o,i)||this;u.parkingfetcher=a,u.basketService=n,u.searchService=s,u.type=re.Parking,u.terminals=new t.BehaviorSubject([]),u.listViewToggle=new t.BehaviorSubject(null),u.parkingFiltersText={onAirport:"On Airport",meetAndGreet:"Meet and greet",parkAndRide:"Park and ride",parkAndStroll:"Park and stroll",carParkedForYou:"Car parked for you"},u._selectedTerminal="",u.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},u.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},u.resultsSessionName=r.STORAGE_SESSION_RESULTS,u.multiResultsSessionName=r.STORAGE_SESSION_RESULTS,u._outdate=null,u._outtime=null,u._indate=null,u._intime=null;var c=o.getSessionItem(r.STORAGE_SESSION_PARAMS)||{tempParams:{}};u.updateTempParams(s.makeParkingQuery(c.tempParams));var d=o.getSessionItemAsList(u.resultsSessionName)||[];return u.results.next(d),u._cheapestResultPrice=u.updateLowestPrice(d),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){u.travellers=(null==e?void 0:e.slice(0,1))||[],u._isValid()})),u}return m(r,e),Object.defineProperty(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.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(r.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e},enumerable:!1,configurable:!0}),r.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeParkingQuery()),this._isValid()},r.prototype._isValid=function(){var e,t,a;this.doChecks&&(this.storageService.setSessionItem(r.STORAGE_SESSION_PARAMS,{location:this._locationCode,travellers:this.travellers,tempParams:this.tempParams}),this.validationMessages=[],this._locationCode&&""!==this._locationCode||this.validationMessages.push(ht.AirportFirst),(null===(e=this.tempParams)||void 0===e?void 0:e.arrivalDatetime.unix())<l.default().unix()&&this.validationMessages.push(ht.InvardJourney),(null===(t=this.tempParams)||void 0===t?void 0:t.departDatetime.unix())<l.default().unix()&&this.validationMessages.push(ht.OutwardJourney),(null===(a=this.tempParams.departDatetime)||void 0===a?void 0:a.isBefore(this.tempParams.arrivalDatetime))&&this.validationMessages.push(ht.DateOverlapped),this.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},r.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)},r.prototype.getRecentSearchQuery=function(e){return{serviceType:re.Parking,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},r.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,a,i,n,o,s;e&&(t.locationCode={country:null===(a=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(n=null===(i=e.iataMatch)||void 0===i?void 0:i.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()},r.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)},r.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)},r.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING PARKING FORM"),null===(t=e[re.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[re.Flight].outBoundDate.toDate(),a=this.searchService.searches[re.Flight].inboundDate.toDate();this.outdate={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.indate={day:a.getUTCDate(),month:a.getUTCMonth()+1,year:a.getUTCFullYear()},this.locationCode=this.searchService.searches[re.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from flight item")}},r.prototype.addParkingToBasket=function(e,t){return b(this,void 0,void 0,(function(){var r,a,i;return y(this,(function(n){switch(n.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return r=n.sent(),a=null==r?void 0:r.subject.value,i=this.getTermsAndCond(e),a?[2,this.basketService.addToBasket({adults:1,basket:a.id,service:e.sourceId.toString(),detail:{arrivalDatetime:t.arrivalDatetime.format(),departDatetime:t.departDatetime.format(),locationCode:e.carPark.code,name:e.carPark.name,requiredInfo:e.requiredInfo,airportIata:t.locationCode,termsAndCond:i},price:e.price,currency:e.currency,searchQuery:t,outboundDate:t.arrivalDatetime.format(),inboundDate:t.departDatetime.format()},r,this.searchService,this.travellers,e.requiresReason)]:[2,Promise.resolve(!1)]}}))}))},r.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}]},r.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})},r.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:re.Parking,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},r.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},r}(c);mt.STORAGE_SESSION_PARAMS="search_parking",mt.STORAGE_SESSION_RESULTS="results_parking",(dt=e.RailDirection||(e.RailDirection={})).Outbound="outbound",dt.Inbound="inbound",(pt=e.EurostarSearchType||(e.EurostarSearchType={})).return="return",pt.oneWay="oneWay";var ft,vt,bt=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:""});(ft=e.SortTypesEurostar||(e.SortTypesEurostar={})).CheapestFirst="C",ft.EarliestFirst="E",ft.LatestFirst="L",(vt=e.SortMethod||(e.SortMethod={})).sortByPrice="sortByPrice",vt.sortByDate="sortByDate";var yt=function(r){function a(i,n,o,s,u,c,d){var p=r.call(this,u,n)||this;p.eurostarFetcher=i,p.basketService=s,p.searchService=c,p.modalService=d,p.type=re.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._fareTypeArray=[{value:j.Flexible,display:"Flexible"},{value:j.Leisure,display:"Leisure"},{value:j.Lowest,display:"Lowest"},{value:j.Negotiated,display:"Negotiated"},{value:j.NonNegotiated,display:"Non-Negotiated"},{value:j.RequestFareRules,display:"Request Fare Rules"},{value:j.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(bt),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 h=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}},m=c.makeEurostarQuery(h.tempParams);p.updateTempParams(m),p._originalUserSearch=h.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){p.travellers=e;var t=p.helpers.selectedTravellers(e,re.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 f=u.getSessionItem(p.resultsSessionName)||{results:[],groupData:{},grouped:[],query:{}};p.fullResults=p.helpers.clone(f.results),p.flightsToGroup=f.groupData||{},p.resultQuery=f.query;p.searchService.isFlightsGrouped();p.results.next(f.results||[]);var v=p.helpers.clone(f.results);return v.length&&p.filters.next(p.helpers.createFlightFilters(v[0].journeys,bt)),p._isValid(),p.negotiated=p.tempParams.fareType===j.Negotiated,p}return m(a,r),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 a={};return a.orig=r.orig.gateway,a.dest=r.dest.gateway,a.date=t.helpers.formatIsoDate(r.date),e.push(a),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,"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(),delete this.resultQuery.withGrouped,this.filters.next(this.helpers.createFlightFilters(e.journeys,bt)),e&&this.searchService.isFlightsGrouped()){var r=(e.journeys||[]).reduce((function(e,r,a){if(r.outboundFlights.length){var i=t.formatEurostarResults(r.outboundFlights,r.total,a);i.co2PerPassenger=r.co2PerPassenger,i.co2PerItem=r.co2PerItem,i.sourceId=r.sourceId,i.total=r.total,i.duration=t.minToHour(r.outboundTotalDuration),e.outbound.find((function(e){return e.dateDeparture===i.dateDeparture&&e.cabinClass===i.cabinClass}))||e.outbound.push(i)}if(r.inboundFlights.length){var n=t.formatEurostarResults(r.inboundFlights,r.total,a);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 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){var a=this,i={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},standardFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1},standardPremierFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1},requiresReason:!1};return e.forEach((function(e){switch(i.dateArrival=e.dateTimeArriving,i.dateDeparture=e.dateTimeDeparting,i.duration=a.minToHour(e.totalDuration),i.timeArrival=l.default(e.dateTimeArriving).format("HH:mm"),i.timeDeparture=l.default(e.dateTimeDeparting).format("HH:mm"),i.cabinClass=e.cabinClass,i.uid=r,e.cabinClass){case H.EconomyFlexi:case H.EconomyNoBags:case H.EconomyRestricted:case H.Economy:i.standardFare.isDisabled=!1,i.standardFare.fare=e,i.standardFare.price=t.price,i.standardFare.currency=t.currency,i.standardFare.class=e.cabinClass,i.standardFare.selected=!1;break;case"Premium":i.standardPremierFare.isDisabled=!1,i.standardPremierFare.fare=e,i.standardPremierFare.price=t.price,i.standardPremierFare.currency=t.currency,i.standardPremierFare.class=e.cabinClass,i.standardPremierFare.selected=!1;break;case H.Business:i.businessPremierFare.isDisabled=!1,i.businessPremierFare.fare=e,i.businessPremierFare.price=t.price,i.businessPremierFare.currency=t.currency,i.businessPremierFare.class=e.cabinClass,i.businessPremierFare.selected=!1;break;default:console.warn("new class to be implemented: ",e.cabinClass)}})),i},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:re.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 a=t.searchArgs.returnDepartureTimeWindow?t.searchArgs.returnDepartureTimeWindow:t.searchArgs.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(t.searchArgs.returnDate,a)}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,a){var i=this.helpers.clone(a||this.fullResults);switch(t){case e.SortTypesEurostar.CheapestFirst:i=this.sortByPrice(i,r);break;case e.SortTypesEurostar.EarliestFirst:i=this.sortByDate(i,r);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}this.results.next(i)},a.prototype.sortResultsFlightJourneys=function(t,r,a){void 0===r&&(r=!1);var i=this.helpers.clone(a);switch(t){case e.SortTypesEurostar.CheapestFirst:i=this.sortByPriceFlight(i);break;case e.SortTypesEurostar.EarliestFirst:i=this.sortByDateFlight(i,r);break;case e.SortTypesEurostar.LatestFirst:i=this.sortByDateFlightDecending(i,r);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}return i},a.prototype.sortByPriceFlight=function(e){return e.sort((function(e,t){return Number(e.total.price)-Number(t.total.price)}))},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 a=+e.standardFare.price||+e.standardPremierFare.price||+e.businessPremierFare.price,i=+r.standardFare.price||+r.standardPremierFare.price||+r.businessPremierFare.price;return t?a-i:i-a};return[{outbound:e[0].outbound.sort(r),inbound:e[0].inbound.sort(r)}]},a.prototype.updateFromPreviousSearches=function(e){var t;null===(t=e[re.Flight])||void 0===t||t.searchQuery},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,a,i=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(a){var i,n,s=l.default((i=t.helpers).fromObject.apply(i,A([a],o(r,a).split(".")))).get("hour"),u=l.default((n=t.helpers).fromObject.apply(n,A([a],o(r,a).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,a="total.price",function(e){var i,n=(i=t.helpers).fromObject.apply(i,A([e],o(a,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(i(e.classes,s("cabinClass")));var p=[];p.push(i(e.classes,s("cabinClass")));for(var h=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!!p.reduce((function(t,r){return t&&r(e)}),!0)})))},f=this.helpers.clone(this.fullResults),v=0;v<f.length;v++){var b=f[v];b.journeys=b.journeys.filter(h),this.isReturn&&(b.journeys=b.journeys.filter(m)),b.journeys=b.journeys}this.results.next(f)},a.prototype.selectGroupedEurostar=function(t,r,a){var i,n,o,s;return b(this,void 0,void 0,(function(){var l,u,c,d,p;return y(this,(function(h){switch(h.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return l=h.sent(),(u=null==l?void 0:l.subject.value)&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.oneWay&&a===e.FlightDirectionEnum.Outbound?(this.doBooking(l,t,{outboundFlights:[this.makeSchemaFlights(r.fare,"outbound",0)],inboundFlights:[],journeyType:"single"},t.dateDeparture,null,r.price,t.requiresReason),[2]):(u&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.return&&(a===e.FlightDirectionEnum.Outbound?(null===(i=this.selectedGroupEurostar)||void 0===i?void 0:i.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,t.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:a},this._selectedEurostarFare={item:r,direction:a},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}})))):a===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,t.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:a},this._selectedEurostarFare={item:r,direction:a},p=t.uid,this.results.next(this.fullResults.map((function(e){return{inbound:e.inbound.filter((function(e){return p===e.uid})),outbound:e.outbound}})))))),[2])}}))}))},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(e,t,r,a,i,n,o){var s=t.sourceId,l=t.co2PerItem,u=t.co2PerPassenger,c=t.total,d={adults:this.adults,basket:e.id,children:this.children,co2PerItem:l,co2PerPassenger:u,currency:c.currency,detail:r,price:n,searchQuery:this.resultQuery,service:s.toString(),outboundDate:a};i&&(d.inboundDate=i),this.basketService.addToBasket(d,e,this.searchService,this.travellers,o)},a.prototype.makeSchemaFlights=function(e,t,r,a){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:a}})},a.prototype.createGroupedItem=function(e,t,r,a,i,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=a,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==i?void 0:i.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=i.length,e.inlegs=i,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",i),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(e){return b(this,void 0,void 0,(function(){var t,r,a,i,n,o,s,u,c,d,p=this;return y(this,(function(h){switch(h.label){case 0:return e.unavailable?[2,Promise.resolve(!1)]:[4,this.basketService.getDefaultBasket()];case 1:return t=h.sent(),(null==t?void 0:t.subject.value)?(r=e.sourceId,a=e.co2PerItem,i=e.co2PerPassenger,n=e.total,o=l.default(e.outboundFlights[0].dateTimeDeparting),s=e.inboundFlights.length?l.default(e.inboundFlights[0].dateTimeDeparting):null,u=this.getTermsAndCond(e),c={outboundFlights:A(e.outboundFlights.map((function(e,t){return p.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:A(e.inboundFlights.map((function(e,t){return p.makeSchemaFlights(e,"inbound",0,t)}))),termsAndCond:u,journeyType:"single"},d={adults:this.adults,basket:t.id,children:this.children,co2PerItem:a,co2PerPassenger:i,currency:n.currency,detail:c,price:n.price,searchQuery:this.resultQuery,service:r.toString(),outboundDate:o.format()},s&&(d.inboundDate=s.format(),c.journeyType="roundtrip"),[2,this.basketService.addToBasket(d,t,this.searchService,this.travellers,e.requiresReason)]):[2,Promise.resolve(!1)]}}))}))},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:re.Eurostar,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r=this;return y(this,(function(a){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=A(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}(c);yt.STORAGE_SESSION_PARAMS="search_eurostar",yt.STORAGE_SESSION_RESULTS="results_eurostar";var gt,St,At=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),a=r[0],i=r[1];return e[a]=e[a]||{total:0,types:{}},e[a].types=Object.entries(i.types).reduce((function(e,t){var r=S(t,2),a=r[0],i=r[1];return e[a]=Math.max(e[a]||0,i),e}),e[a].types),e[a].total=Object.values(e[a].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),a=r[0],i=r[1];return e[a]=i.total,e}),{})},e.prototype.workoutIndexes=function(e){return Object.entries(this.data[e].types).sort((function(e,t){var r=S(e,2),a=r[0],i=(r[1],S(t,2)),n=i[0];i[1];return Number(a.split("_")[1])-Number(n.split("_")[1])})).reduce((function(t,r){for(var a=S(r,2),i=a[0],n=a[1],o=0;o<n;o++)t.push([e,i,o.toString()]);return t}),[])},e}();(gt=e.RailSearchCriteria||(e.RailSearchCriteria={})).Depart="Depart After",gt.Arrive="Arrive Before",(St=e.RailJourneyFareType||(e.RailJourneyFareType={})).Return="Return",St.Single="Single";var Ct,Tt=function(a){function i(r,n,o,s,u,c,d,p){var h=a.call(this,u,o)||this;h.Railfetcher=r,h.getRailStationFetcher=n,h.basketService=s,h.searchService=c,h.userService=d,h.modalService=p,h.resultsSessionName=i.STORAGE_SESSION_RESULTS,h.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,h.searchTypes=[{display:"Return",value:Z.ReturnJourney},{display:"One-Way",value:Z.SingleJourney}],h.classTypes=[{display:"Any",value:z.All},{display:"Standard",value:z.Standard},{display:"First",value:z.First}],h.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"}],h.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"}},h.railCriteria=[e.RailSearchCriteria.Depart,e.RailSearchCriteria.Arrive],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.removePassingPointsFromResults=!0,h.type=re.Rail,h._bookRailFromLive=!1,h.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}},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}},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}}}),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.maxDate={year:l.default().add("month",6).year(),month:l.default().add("month",6).month(),day:l.default().add("month",6).date()},h.summary={},h._outbound_date=null,h._outbound_time=null,h._return_date=null,h._return_time=null;var m=u.getSessionItem(i.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};return h.updateTempParams(h.searchService.makeRailQuery(m.tempParams)),h._originalUserSearch=m.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){h.travellers=e;var t=h.helpers.selectedTravellers(e,re.Rail);h.tempParams.noOfAdults=t.adults.length,h.tempParams.noOfChildren=t.children.length,h.travellers=e,h._isValid()})),h._isValid(),h}return m(i,a),Object.defineProperty(i.prototype,"selectedSection",{get:function(){return this._selectedSection},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"bookRailFromLive",{get:function(){return this._bookRailFromLive},set:function(e){this._bookRailFromLive=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"openReturn",{get:function(){return this.tempParams.chosenSearchType===Z.OpenReturnJourney},set:function(e){this.tempParams.chosenSearchType=e?Z.OpenReturnJourney:Z.ReturnJourney,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfAdults",{get:function(){return this.tempParams.noOfAdults},set:function(e){this.tempParams.noOfAdults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfChildren",{get:function(){return this.tempParams.noOfChildren},set:function(e){this.tempParams.noOfChildren=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;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(i.prototype,"chosenRailClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"extraTime",{get:function(){return this.tempParams.extraTime},set:function(e){this.tempParams.extraTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"via",{get:function(){return this.tempParams.via},set:function(e){this.tempParams.via=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"outboundCriteria",{get:function(){return this.tempParams.outboundCriteria},set:function(e){this.tempParams.outboundCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(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,"returnCriteria",{get:function(){return this.tempParams.returnCriteria},set:function(e){this.tempParams.returnCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carnetTicket",{get:function(){return this.tempParams.carnetTicket},set:function(e){this.tempParams.carnetTicket=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"disableAutoDiscounts",{get:function(){return this.tempParams.disableAutoDiscounts},set:function(e){this.tempParams.disableAutoDiscounts=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"prioritiseByPrice",{get:function(){return this.tempParams.prioritiseByPrice},set:function(e){this.tempParams.prioritiseByPrice=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"applyRailcards",{get:function(){return this.tempParams.applyRailcards},set:function(e){this.tempParams.applyRailcards=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"railCards",{get:function(){return this.tempParams.railCards},set:function(e){this.tempParams.railCards=e},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}),i.prototype.getAirportExpressStations=function(){return this.airportExpressStations},Object.defineProperty(i.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(i.prototype,"isAirportExpress",{get:function(){return this.tempParams.isAirportExpress},set:function(e){this.tempParams.isAirportExpress=e,this._isValid()},enumerable:!1,configurable:!0}),i.prototype.setAirportExpressStationIds=function(e){var t=e.departureLocationId,r=e.arrivalLocationId;t&&r&&(this._travellingFrom=t,this._travellingTo=r,this._isValid())},i.prototype._findSummary=function(e,t){return t.find((function(t){return t.journeyHash===e.journeyHash}))},i.prototype.updateLowestPrice=function(e){return null},i.prototype.processResults=function(e){var t=this,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})},a=function(e){return t.helpers.clone(e).sort((function(e,t){var r=l.default(e.departDateTime),a=l.default(t.departDateTime);return r.isBefore(a)?-1:r.isAfter(a)?1:0})).map((function(e){var a=function(e,t){return e.price-t.price},i=(e.dualSingleJourneyFares||[]).sort(a).map(r),n=(e.openReturnJourneyFares||[]).sort(a).map(r),o=(e.returnJourneyFares||[]).sort(a).map(r),s=(e.singleJourneyFares||[]).sort(a).map(r),l=i.map(r),u=n.map(r),c=o.map(r),d=s.map(r);return Object.assign(Object.assign({},e),{dualSingleJourneyFares:t.helpers.arrayToObjectArray(l,["type",["terms.ticketTypeCode","price"]]),openReturnJourneyFares:t.helpers.arrayToObjectArray(u,["type",["terms.ticketTypeCode","price"]]),returnJourneyFares:t.helpers.arrayToObjectArray(c,["type",["terms.ticketTypeCode","price"]]),singleJourneyFares:t.helpers.arrayToObjectArray(d,["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 a=n[r],i=a.getTicketTypes();return Object.entries(i).reduce((function(r,i){var n=S(i,2),o=n[0];n[1];return r[o]=a.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")})},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}},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}},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})}))},i.prototype.makeFareNames=function(e){var t=this;return["returnJourneyFares","openReturnJourneyFares","dualSingleJourneyFares","singleJourneyFares"].reduce((function(r,a){return r[a]=t._makeFareNames(e,a),r}),{returnJourneyFares:new At,openReturnJourneyFares:new At,dualSingleJourneyFares:new At,singleJourneyFares:new At})},i.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),a=r[0],i=r[1];Object.entries(i).forEach((function(t){var r=S(t,2),i=r[0],n=r[1];e.addFares(a,i,n)}))})),e.nextJourney(),e):e}),new At)},i.prototype.updatePrices=function(t,r,a){var i=function(e,t,r){if(!t||0===t.length)return e;var a=t[0].price;return e.price>0&&e.price<a?e:{price:a,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===z.Standard})),p=s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return e&&e.class===z.First})),h=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===z.Standard})),m=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===z.First})),f=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===z.Standard})),v=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===z.First})),b=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===z.Standard})),y=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===z.First})),g=A(h,f,b),S=A(d,g).sort(c),C=A(m,v,y),T=A(p,C).sort(c);if(a||(g.sort(c),T.sort(c)),t.cheapestTickets.dualSingleJourneyFares=i(t.cheapestTickets.dualSingleJourneyFares,s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.openReturnJourneyFares=i(t.cheapestTickets.openReturnJourneyFares,s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.returnJourneyFares=i(t.cheapestTickets.returnJourneyFares,s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return!!e})),r),a){if(t.cheapestClassTicket.inboundStandardClassFare=i(t.cheapestClassTicket.inboundStandardClassFare,S,r),t.cheapestClassTicket.inboundFirstClassFare=i(t.cheapestClassTicket.inboundFirstClassFare,T,r),t.outboundClassTicket.inboundStandardClassFare=i(t.outboundClassTicket.inboundStandardClassFare,g,r),t.outboundClassTicket.inboundFirstClassFare=i(t.outboundClassTicket.inboundFirstClassFare,C,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 P=i(t.cheapestClassTicket.inboundStandardClassFare,d,r);t.cheapestClassTicket.standardClassFare.price>t.outboundClassTicket.standardClassFare.price?t.cheapestClassTicket.standardClassFare=t.outboundClassTicket.standardClassFare:P.price>t.cheapestClassTicket.inboundStandardClassFare.price&&(t.cheapestClassTicket.inboundStandardClassFare=P)}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){P=i(t.cheapestClassTicket.inboundFirstClassFare,p,r);t.cheapestClassTicket.firstClassFare.price>t.outboundClassTicket.firstClassFare.price?t.cheapestClassTicket.firstClassFare=t.outboundClassTicket.firstClassFare:P.price>t.cheapestClassTicket.inboundFirstClassFare.price&&(t.cheapestClassTicket.inboundFirstClassFare=P)}}else t.cheapestClassTicket.standardClassFare=i(t.cheapestClassTicket.standardClassFare,S,r),t.cheapestClassTicket.firstClassFare=i(t.cheapestClassTicket.firstClassFare,T,r),t.outboundClassTicket.standardClassFare=i(t.outboundClassTicket.standardClassFare,g,r),t.outboundClassTicket.firstClassFare=i(t.outboundClassTicket.firstClassFare,C,r);return t}),r)},i.prototype.selectTicket=function(t,r,a,i,n,o){var s,u,c,p,h,m;return void 0===o&&(o=!1),b(this,void 0,void 0,(function(){var f,v,b,g,S,A,C,T;return y(this,(function(y){switch(y.label){case 0:return a.selectable?this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===a.fareHash?(this.selectedTicket=null,this._applyFilter(),[2]):(f=this.selectedTicket,this.alternativeWellbeing=this.userService.getUserFavoriteObject(et.AlternativeRailItineraryEnabled),f&&!o&&this.alternativeWellbeing?(v=f.journey,b=r,g=l.default(v.arriveDateTime).diff(l.default(v.departDateTime),"hours",!0),S=l.default(b.arriveDateTime).diff(l.default(b.departDateTime),"hours",!0),A=l.default(b.departDateTime).diff(l.default(v.departDateTime),"day"),[4,this.checkAlternativeHours(g+S,A)]):[3,2]):[2];case 1:return y.sent()&&this.selectTicket(t,r,a,i,n,!0),[3,25];case 2:switch(C=this.originalUserSearch,n){case"singleJourneyFares":return[3,3];case"returnJourneyFares":return[3,7];case"dualSingleJourneyFares":return[3,13];case"openReturnJourneyFares":return[3,19]}return[3,23];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:T=y.sent(),r.ticketExtras=T||[],y.label=5;case 5:return[4,this.addSingleJourneyToBasket(i,C,r,a)];case 6:return y.sent(),this.selectedTicket=null,[3,24];case 7:return t!==e.RailDirection.Outbound?[3,8]:(this.selectedTicket={journey:r,fare:a},[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:T=y.sent(),f.journey.ticketExtras=T||[],y.label=10;case 10:return[4,this.addReturnJourneyToBasket(i,C,this.selectedTicket.journey,r,this.selectedTicket.fare,a)];case 11:y.sent(),this.selectedTicket=null,y.label=12;case 12:return[3,24];case 13:return t!==e.RailDirection.Outbound?[3,14]:(this.selectedTicket={journey:r,fare:a},[3,18]);case 14:return this.selectedTicket?(null===(h=null===(p=this.selectedTicket.journey)||void 0===p?void 0:p.ticketExtras)||void 0===h?void 0:h.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,16]:[3,18];case 15:T=y.sent(),console.log(T),f.journey.ticketExtras=T||[],y.label=16;case 16:return[4,this.addDualSingleToBasket(i,C,this.selectedTicket.journey,r,this.selectedTicket.fare,a)];case 17:y.sent(),this.selectedTicket=null,y.label=18;case 18:return[3,24];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:T=y.sent(),console.log(T),r.ticketExtras=T||[],y.label=21;case 21:return[4,this.addOpenReturnToBasket(i,C,r,a)];case 22:return y.sent(),this.selectedTicket=null,[3,24];case 23:n,y.label=24;case 24:this._applyFilter(),y.label=25;case 25:return[2]}}))}))},i.prototype.checkAlternativeHours=function(e,t){return b(this,void 0,void 0,(function(){var r;return y(this,(function(a){switch(a.label){case 0:return r=this.searchService.searches[re.Rail],this.alternativeWellbeing.enable&&Number(this.alternativeWellbeing.hours)>0&&r.chosenSearchType===Z.ReturnJourney&&e>=Number(this.alternativeWellbeing.hours)&&0===t&&this.noOfAdults+this.noOfChildren<=4?[4,this.modalService.open(d.AlternativeRailModalComponent)]:[3,2];case 1:return a.sent()?(this.selectedTicket=null,this._applyFilter(),this.performAlternativeRailAndHotelSearch(),[2,!1]):[2,!0];case 2:return[2,!0];case 3:return[2]}}))}))},i.prototype.performAlternativeRailAndHotelSearch=function(){console.log("+++ Creating the Alternative Search Params +++");var t=this.searchService.search_objects[re.Hotel],r=this.searchService.search_objects[re.Rail];t.chosen=!0,r.chosen=!0,t.priority=r.priority;var a=this.searchService.searches[re.Hotel],i=this.searchService.searches[re.Rail];i.inBoundDateTime=this.searchService.searches[re.Rail].inBoundDateTime.add(1,"day"),a.location_type_select=e.LocationTypes.TrainStation,a.location=i.travellingTo,a.trainsStation=i.travellingTo.railstation,a.checkin_date=i.outBoundDateTime,a.checkout_date=i.inBoundDateTime,a.no_of_occupants=i.noOfAdults+i.noOfChildren,a.no_of_rooms=1,a.distance=10,this.searchService.startSearches(e.WellbeingEnum.WELLBEING)},i.prototype.selectTicketNoAdd=function(t,r,a,i,n){var o;return b(this,void 0,void 0,(function(){var i,s;return y(this,(function(l){if(!a.selectable)return console.warn("+++ Rail fare is not selectable +++"),[2];if(i=this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===a.fareHash,s=t===e.RailDirection.Inbound&&(this.selectedInboundTicket&&this.selectedInboundTicket.journey.journeyHash===r.journeyHash&&this.selectedInboundTicket.fare.fareHash===a.fareHash),i||t===e.RailDirection.Inbound&&s)return console.warn("+++ Journey and fare are already selected - breaking out +++"),this._selectedInboundTicket=null,i&&(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)!==a.identifiers.fareIdentifier)&&(this.selectedTicket=null,this._selectedInboundTicket=null),this._selectedSection=n,this.originalUserSearch,n){case"singleJourneyFares":this.selectedTicket={journey:r,fare:a};break;case"returnJourneyFares":case"dualSingleJourneyFares":t===e.RailDirection.Outbound?this.selectedTicket={journey:r,fare:a}:this.selectedTicket&&(this.selectedInboundTicket={journey:r,fare:a});break;case"openReturnJourneyFares":this.selectedTicket={journey:r,fare:a};break;default:n}return this.applyFilter(),[2]}))}))},i.prototype.addToBasket=function(e,t,r,a,i,n){return b(this,void 0,void 0,(function(){return y(this,(function(o){switch(o.label){case 0:return t.chosenSearchType!==Z.SingleJourney?[3,2]:[4,this.addSingleJourneyToBasket(e,t,r,a)];case 1:return o.sent(),[3,7];case 2:return"openReturnJourneyFares"!==this.selectedSection?[3,4]:[4,this.addOpenReturnToBasket(e,t,r,a)];case 3:return o.sent(),[3,7];case 4:return"Return"!==a.singleOrReturn?[3,5]:[2,this.addReturnJourneyToBasket(e,t,r,n,a,i)];case 5:return[4,this.addDualSingleToBasket(e,t,r,n,a,i)];case 6:o.sent(),o.label=7;case 7:return[2,!1]}}))}))},i.prototype.addOpenReturnToBasket=function(e,t,r,a){return b(this,void 0,void 0,(function(){return y(this,(function(i){return[2,this.addSingleJourneyToBasket(e,t,r,a)]}))}))},i.prototype.addDualSingleToBasket=function(e,t,r,a,i,n){var o,s;return b(this,void 0,void 0,(function(){var l,u,c,d,p,h,m,f,v;return y(this,(function(b){switch(b.label){case 0:return l=this.getSearchQuery(t),(null===(o=null==a?void 0:a.ticketExtras)||void 0===o?void 0:o.length)&&(u=this.createTicketExtrasObject(a.ticketExtras[0])),(null===(s=null==r?void 0:r.ticketExtras)||void 0===s?void 0:s.length)&&(c=this.createTicketExtrasObject(r.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return d=b.sent(),p=null==d?void 0:d.subject.value,h=this.getTermsAndCond(i,r,a),p?(m=this.getLegsFromRailJourneyOption(r),f=this.getLegsFromRailJourneyOption(a),v={basket:p.id,service:e,detail:{ticketQueueList:(r.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(r.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:r.arriveDateTime,arrivalStationName:r.to,departureDateTime:r.departDateTime,departureStationName:r.from,supplierTickets:[{supplierName:i.providerName,ticketDescription:i.type,price:i.price,legs:m}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,legs:f}]},transactionIdentifier:i.identifiers.transactionIdentifier,outbound:{fareIdentifiers:[i.identifiers.fareIdentifier],journeyIdentifier:i.identifiers.journeyIdentifier,isDualSingleReturn:!0,journeyLegs:this.removedScheduledPlatformFromCallingPoints(r.journeyLegs),eTicket:!!i.eTicketAvailable},return:{fareIdentifiers:[n.identifiers.fareIdentifier],journeyIdentifier:n.identifiers.journeyIdentifier,isDualSingleReturn:!0,journeyLegs:this.removedScheduledPlatformFromCallingPoints(a.journeyLegs),eTicket:!!n.eTicketAvailable},termsAndCond:h},adults:l.adults,price:Number(Number(i.price+n.price).toFixed(2)),currency:i.currency,searchQuery:l,co2PerItem:r.co2PerItem,co2PerPassenger:r.co2PerPassenger,outboundDate:r.arriveDateTime,inboundDate:a.arriveDateTime},u&&(v.detail.return.ticketExtras=u),c&&(v.detail.outbound.ticketExtras=c),[2,this.basketService.addToBasket(v,d,this.searchService,this.travellers,i.requiresReason||n.requiresReason)]):[2,Promise.resolve()]}}))}))},i.prototype.findCheapestTicket=function(){return 0},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeRailQuery()),this._isValid()},i.prototype._setAirportExpressStations=function(){var e=this.airportExpressStationsCodes[this.airportExpressStation];console.log("--- Parsed Station is :",e),e&&(this._travellingFrom=e.dep,this._travellingTo=e.arr)},i.prototype._isValid=function(){var e,t;if(this.doChecks){this.storageService.setSessionItem(i.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===Z.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)}},i.prototype.startSearch=function(){if(this.results.next([]),this.isValid.value){var e=this.getSearchQuery(this.tempParams);return this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(i.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)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:re.Rail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(e){var t,r,a,i,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===(i=null===(a=this.travellingTo)||void 0===a?void 0:a.railstation)||void 0===i?void 0:i.stationCode,n},i.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===Z.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 a={departureLocationId:e.searchArgs.departureLocationId,arrivalLocationId:e.searchArgs.arrivalLocationId};this.setAirportExpressStationIds(a)}e.searchArgs.journeyType===Z.OpenReturnJourney&&(this.openReturn=!0),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(t){var r,a,i,n,o,s,l;this.isAirportExpress&&this.openReturn&&(this.openReturn=!1);var u={countryCode:"GB",journeyType:t.chosenSearchType,adults:t.noOfAdults,arrivalLocationId:null===(a=null===(r=t.travellingTo)||void 0===r?void 0:r.railstation)||void 0===a?void 0:a.id,departureLocationId:null===(n=null===(i=t.travellingFrom)||void 0===i?void 0:i.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 e.code}))};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 Z.SingleJourney:case Z.OpenReturnJourney:u.returnDepartureDateTime=null,u.returnArrivalDateTime=null}return t.isAirportExpress&&(u.arrivalLocationId=this._travellingTo,u.departureLocationId=this._travellingFrom),this.helpers.removeNulls(u)},i.prototype.getCriteria=function(t,r){return t?e.RailSearchCriteria.Depart:r?e.RailSearchCriteria.Arrive:null},i.prototype.updateFromPreviousSearches=function(e){},i.prototype.getRailStation=function(e,a){return 3===e.length?(null==a||a.next(!0),this.getRailStationFetcher.fetchList({code:e}).pipe(r.tap((function(){return null==a?void 0:a.next(!1)})),r.take(1))):t.of()},i.prototype.getSelectedRailJourneyFare=function(){return null},i.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},i.prototype.addSingleJourneyToBasket=function(e,t,r,a){var i;return b(this,void 0,void 0,(function(){var n,o,s,l,u,c,d;return y(this,(function(p){switch(p.label){case 0:return n=this.getSearchQuery(t),(null===(i=null==r?void 0:r.ticketExtras)||void 0===i?void 0:i.length)&&(o=this.createTicketExtrasObject(r.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return s=p.sent(),l=null==s?void 0:s.subject.value,u=this.getTermsAndCond(a,r),l?(c=this.getLegsFromRailJourneyOption(r),d={basket:l.id,service:e.toString(),detail:{ticketQueueList:(r.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(r.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:r.arriveDateTime,arrivalStationName:r.to,departureDateTime:r.departDateTime,departureStationName:r.from,supplierTickets:[{supplierName:a.providerName,ticketDescription:a.type,price:a.price,legs:c}]},transactionIdentifier:a.identifiers.transactionIdentifier,outbound:{eTicket:!!a.eTicketAvailable,fareIdentifiers:[a.identifiers.fareIdentifier],journeyIdentifier:a.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(r.journeyLegs)},termsAndCond:u},adults:n.adults,price:a.price,currency:a.currency,searchQuery:n,co2PerItem:r.co2PerItem,co2PerPassenger:r.co2PerPassenger,outboundDate:r.departDateTime},o&&(d.detail.outbound.ticketExtras=o),[2,this.basketService.addToBasket(d,s,this.searchService,this.travellers,a.requiresReason)]):[2,Promise.resolve()]}}))}))},i.prototype.addReturnJourneyToBasket=function(e,t,r,a,i,n){var o;return b(this,void 0,void 0,(function(){var s,l,u,c,d,p,h,m;return y(this,(function(f){switch(f.label){case 0:return s=this.getSearchQuery(t),(null===(o=null==r?void 0:r.ticketExtras)||void 0===o?void 0:o.length)&&(l=this.createTicketExtrasObject(r.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return u=f.sent(),c=null==u?void 0:u.subject.value,d=this.getTermsAndCond(i,r,a),c?(p=this.getLegsFromRailJourneyOption(r),h=this.getLegsFromRailJourneyOption(a),m={basket:c.id,service:e,detail:{ticketQueueList:(r.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(r.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:r.arriveDateTime,arrivalStationName:r.to,departureDateTime:r.departDateTime,departureStationName:r.from,supplierTickets:[{supplierName:i.providerName,ticketDescription:i.type,price:i.price,legs:p}]},inwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,legs:h}]},transactionIdentifier:i.identifiers.transactionIdentifier,outbound:{eTicket:!!i.eTicketAvailable,fareIdentifiers:[i.identifiers.fareIdentifier],journeyIdentifier:i.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(r.journeyLegs)},return:{eTicket:!!n.eTicketAvailable,fareIdentifiers:[n.identifiers.fareIdentifier],journeyIdentifier:n.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(a.journeyLegs)},termsAndCond:d},adults:s.adults,price:i.price,currency:i.currency,searchQuery:s,co2PerItem:r.co2PerItem,co2PerPassenger:r.co2PerPassenger,outboundDate:r.arriveDateTime,inboundDate:a.arriveDateTime},l&&(m.detail.outbound.ticketExtras=l),[2,this.basketService.addToBasket(m,u,this.searchService,this.travellers,i.requiresReason||n.requiresReason)]):[2,Promise.resolve(!1)]}}))}))},i.prototype.removedScheduledPlatformFromCallingPoints=function(e){for(var t=0;t<e.length;t++)for(var r=e[t],a=0;a<r.callingPoints.length;a++){delete r.callingPoints[a].scheduledPlatform}return e},i.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}]},i.prototype.calculateTimeDifferenceInMins=function(e){return this.helpers.getTimeDifference(e.arriveDateTime,e.departDateTime).toString()},i.prototype.ticketIsAnETicket=function(){return null},i.prototype.applyFilter=function(){this._applyFilter()},i.prototype._applyFilter=function(){var t=this,r=function(e,r){var a=t._findSummary(r,t.summary.return);return t._selectedSummary?function(r){return r.map((function(r){var i,n,o,s;return r?Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),[null===(i=t._selectedSummary[e][t.selectedTicket.fare.fareHash])||void 0===i?void 0:i.ruleDataWhenSelectedWith[r.fareHash],a?null===(n=a[e][r.fareHash])||void 0===n?void 0:n.ruleDataWhenSelectedAlone:null])),{selected:r.fareHash===t.selectedTicket.fare.fareHash,selectable:!!(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))}):null}))}:function(r){return r.map((function(r){return r?Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),a?[a[e][r.fareHash].ruleDataWhenSelectedAlone]:[])),{selected:!1,selectable:!0}):null}))}},a=function(e,r,a){return function(i){var n=t._findSummary(r,t.summary[a]);return i.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(i,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||{},a("dualSingleJourneyFares",r,e.RailDirection.Outbound)),returnJourneyFares:t.helpers.map(r.returnJourneyFares||{},a("returnJourneyFares",r,e.RailDirection.Outbound)),openReturnJourneyFares:t.helpers.map(r.openReturnJourneyFares||{},a("openReturnJourneyFares",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||{},a("singleJourneyFares",e,"return")),openReturnJourneyFares:t.helpers.map(e.openReturnJourneyFares||{},a("openReturnJourneyFares",e,"return"))})}))});return i.push(o),i}),[]))},i.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}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(this.tempParams),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:re.Rail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(this,(function(r){switch(this.noOfAdults=e.adults,this.noOfChildren=e.children,this.chosenSearchType=e.journeyType,e.class){case"First":this.chosenRailClass=z.First;break;case"Any":this.chosenRailClass=z.All;break;case"Standard":this.chosenRailClass=z.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]}))}))},i}(c);Tt.STORAGE_SESSION_PARAMS="search_rail",Tt.STORAGE_SESSION_RESULTS="rail_results",Tt.PASSING_POINT="Passing",(Ct=e.ages||(e.ages={})).Child="Child",Ct.Youth="Youth",Ct.Adult="Adult",Ct.Senior="Senior";var Pt,Dt,kt=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.makeTravellerObjectFromUser=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.equals=function(e,t){return e.email===t.email},e.compare=function(t,r){var a=e.fullname(t),i=e.fullname(r);return a===i?0:a<i?-1:1},e}();(Pt=e.SortTypesIrl||(e.SortTypesIrl={})).CheapestFirst="C",Pt.EarliestFirst="E",Pt.LatestFirst="L",(Dt=e.ClassType||(e.ClassType={})).Class_1="1",Dt.Class_2="2",Dt.Second_Class="2nd Class",Dt.First_Class="1st Class";var Ft=function(t){function a(r,i,n,o,s,u,c){var d=t.call(this,s,n)||this;d.Irlfetcher=r,d.irlDiscountCardsFetcher=i,d.basketService=o,d.searchService=u,d.getIrlSupplierStationFetcher=c,d.resultsSessionName=a.STORAGE_SESSION_RESULTS,d.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,d._sortArray=[{title:"Price",methodRef:e.SortMethod.sortByPrice,icon:"ico-dollar"},{title:"Time",methodRef:e.SortMethod.sortByDate,icon:"ico-calendar"}],d.searchTypes=[{display:"Return",value:V.ReturnJourney},{display:"One-Way",value:V.SingleJourney}],d.classTypes=[{display:"Any",value:U.All},{display:"Standard",value:U.Standard},{display:"First",value:U.First}],d.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+)"}],d.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"}],d.type=re.InternationalRail,d.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},d.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},d._supplier=null,d._countryCode=null,d._class=U.All,d._outboundDepartureDateTime=null,d._departureLocationId=null,d._arrivalLocationId=null,d._children=0,d._cheapestStandard=null,d._cheapestFirst=null,d._returnDepartureDateTime=null,d._ageRange=null,d._priceDir=!0,d._dateDir=!0,d._irlDiscountCardsArray=[],d._outbound_date=null,d._outbound_time=null,d._return_date=null,d._return_time=null,d._offline=!1,d._irlClass=U.All,d._journeytype=V.SingleJourney,d._trainNumber=null,d._additionalInstructions=null;var p=s.getSessionItem(a.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};d.updateTempParams(d.searchService.makeIrlQuery(p.tempParams)),d._originalUserSearch=p.originalUserSearch,u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(t){d.travellers=t,d.travellers[0]&&!d.travellers[0].ageType&&(d.travellers[0].ageType=e.ages.Adult);var r=d.helpers.selectedTravellers(t,re.InternationalRail);d.tempParams.adults=r.adults.length,d.tempParams.children=r.children.length,d.travellers=t,d._isValid()})),d._isValid();var h=s.getSessionItemAsList(d.resultsSessionName)||[];return d._cheapestResultPrice=d.updateLowestPrice(h),d.fullResults=h,d.results.next(h||[]),d}return m(a,t),Object.defineProperty(a.prototype,"outboundJourneyOptions",{get:function(){return this._outboundJourneyOptions},set:function(e){this._outboundJourneyOptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outboundTicket",{get:function(){return this._outboundTicket},set:function(e){this._outboundTicket=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfAdults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfChildren",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingTo",{get:function(){return this.tempParams.arrivalLocationId},set:function(e){var t;this.tempParams.arrivalLocationId=e,this._travellingTo="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)&&(this._travellingTo=e.railstation.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingFrom",{get:function(){return this.tempParams.departureLocationId},set:function(e){var t,r=this;this.tempParams.departureLocationId=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}))),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"supplier",{get:function(){return this._supplier},set:function(e){this._supplier=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"countryCode",{get:function(){return this._countryCode},set:function(e){this._countryCode=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"class",{get:function(){return this._class},set:function(e){this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.prototype,"departureLocationId",{get:function(){return this._departureLocationId},set:function(e){this._departureLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arrivalLocationId",{get:function(){return this._arrivalLocationId},set:function(e){this._arrivalLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this._children},set:function(e){this._children=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cheapestStandard",{get:function(){return this._cheapestStandard},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cheapestFirst",{get:function(){return this._cheapestFirst},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.prototype,"ageRange",{get:function(){return this._ageRange},set:function(e){this._ageRange=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"priceDir",{get:function(){return this._priceDir},set:function(e){this._priceDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dateDir",{get:function(){return this._dateDir},set:function(e){this._dateDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchClass",{get:function(){return this.tempParams.class},set:function(e){this.tempParams.class=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"discountCard",{get:function(){return this.tempParams.irlDiscountCards},set:function(e){this.tempParams.irlDiscountCards=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"irlDiscountCardsArray",{get:function(){return this._irlDiscountCardsArray},set:function(e){this._irlDiscountCardsArray=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.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(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,"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(a.prototype,"offline",{get:function(){return this._offline},set:function(e){this._offline=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"irlClass",{get:function(){return this._irlClass},set:function(e){this._irlClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"journeyType",{get:function(){return this._journeytype},set:function(e){this._journeytype=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"trainNumber",{get:function(){return this._trainNumber},set:function(e){this._trainNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"additionalInstructions",{get:function(){return this._additionalInstructions},set:function(e){this._additionalInstructions=e},enumerable:!1,configurable:!0}),a.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},a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeIrlQuery()),this._isValid()},a.prototype._isValid=function(){var e;this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var t=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(t))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),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)},a.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(a.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)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:re.InternationalRail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(e){var t=e;return this.travellingFrom&&(t.travellingFrom=this.travellingFrom),this.travellingTo&&(t.travellingTo=this.travellingTo),t},a.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()},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(){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.discountCard?this.discountCard.id:null,class:this.class,outboundDepartureDateTime:this.tempParams.outboundDepartureDateTime,departureLocationId:this._travellingFrom,arrivalLocationId:this._travellingTo,adults:this.tempParams.adults,children:this.tempParams.children,returnDepartureDateTime:this.tempParams.returnDepartureDateTime,journeyType:this.journeyType};switch(0===this.tempParams.children&&(r.children=null),this.tempParams.journeyType){case V.SingleJourney:r.returnDepartureDateTime=null}return this.helpers.removeNulls(r)},a.prototype.updateFromPreviousSearches=function(e){},a.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]}))},a.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},a.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)}))},a.prototype.addSingleJourneyToBasket=function(e,t,r,a){return b(this,void 0,void 0,(function(){var i,n,o,s,l,u;return y(this,(function(c){switch(c.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return i=c.sent(),(n=null==i?void 0:i.subject.value)?(o=this.getSelectedIrlTicketOption(a,r,0),s=this.getLegsFromIrlJourneyOption(a),l=this.getTermsAndCond(a),u={basket:n.id,service:e,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:o.type,price:o.price,legs:s}]},transactionIdentifier:a.identifiers.transactionIdentifier,outbound:{fareIdentifiers:[o.identifiers.fareIdentifier],journeyIdentifier:o.identifiers.journeyIdentifier},supplier:a.providers[0].providerId,termsAndCond:l},adults:t.adults,price:o.price,currency:o.currency,searchQuery:t,outboundDate:a.departDateTime},[2,this.basketService.addToBasket(u,i,this.searchService,this.travellers,!1)]):[2,Promise.resolve(!1)]}}))}))},a.prototype.addReturnJourneyToBasket=function(e,t,r,a,i,n){return b(this,void 0,void 0,(function(){var o,s,l,u,c,d,p,h,m;return y(this,(function(f){switch(f.label){case 0:return o=i||this.outboundTicket,s=n||this.outboundJourneyOptions,[4,this.basketService.getDefaultBasket()];case 1:return l=f.sent(),(u=null==l?void 0:l.subject.value)?(c=this.getSelectedIrlTicketOption(s,o,0),d=this.getLegsFromIrlJourneyOption(s),p=this.getLegsFromIrlJourneyOption(a),h=this.getTermsAndCond(s),m={basket:u.id,service:e,detail:{outwardDetail:{arrivalDateTime:s.arriveDateTime,arrivalStationName:s.to,arrivalStationCode:s.toCode,departureStationCode:s.fromCode,departureDateTime:s.departDateTime,departureStationName:s.from,supplierTickets:[{supplierName:s.providers[0].name,ticketDescription:c.type,price:c.price,legs:d}]},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:r.type,legs:p}]},transactionIdentifier:o.identifiers.transactionIdentifier,outbound:{fareIdentifiers:[c.identifiers.fareIdentifier],journeyIdentifier:c.identifiers.journeyIdentifier},supplier:s.providers[0].providerId,termsAndCond:h},adults:t.adults,price:Number((Number(c.price)+Number(r.price)).toFixed(2)),currency:c.currency,searchQuery:t,outboundDate:s.departDateTime},this.filterSelected(),console.log(m),[2,this.basketService.addToBasket(m,l,this.searchService,this.travellers,!1)]):[2,Promise.resolve(!1)]}}))}))},a.prototype.updateLowestPrice=function(e){var t,r,a,i;if(!e.length)return null;var n=null===(i=null===(a=null===(r=null===(t=e[0])||void 0===t?void 0:t.outbound[0])||void 0===r?void 0:r.providers[0])||void 0===a?void 0:a.cheapestTicket)||void 0===i?void 0:i.currency;return{amount:this.findCheapestTicket(e),currencyCode:n}},a.prototype.findCheapestTicket=function(e){var t=this;if(this._cheapestFirst=null,this._cheapestStandard=null,!e.length)return null;var r=[];return e.map((function(e){e.outbound.map((function(e){e.providers.map((function(e){var a=e.cheapestTicket.price;e.ticketOptions.map((function(e){var i,n,o=e.price,s=e.class;"First"===s&&((null===(i=t._cheapestFirst)||void 0===i?void 0:i.price)>o||!t._cheapestFirst)?t._cheapestFirst=e:"Standard"===s&&((null===(n=t._cheapestStandard)||void 0===n?void 0:n.price)>o||!t._cheapestStandard)&&(t._cheapestStandard=e),o===a&&r.push(a)}))}))}))})),Math.min.apply(Math,A(r))},a.prototype.sortByPrice=function(e){var t=this;void 0===e&&(e=!1),e||(this.priceDir=!this.priceDir);var r=this.filterSelected(this._isFiltered),a=function(e,r){return t.priceDir?e.providers[0].cheapestTicket.price-r.providers[0].cheapestTicket.price:r.providers[0].cheapestTicket.price-e.providers[0].cheapestTicket.price};r[0].outbound=r[0].outbound.sort(a),r[0].return=r[0].return.sort(a),this.results.next(r)},a.prototype.sortByDate=function(e){var t=this;void 0===e&&(e=!1),e||(this.dateDir=!this.dateDir);var r=this.filterSelected(this._isFiltered),a=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(a),r[0].return=r[0].return.sort(a),this.results.next(r)},a.prototype.addOutboundAndFilter=function(e,t){this.outboundJourneyOptions=t,this.outboundTicket=e,this.filterSelected(!0)},a.prototype.filterSelected=function(e){var t=this;void 0===e&&(e=!1);var r=this.helpers.clone(this.fullResults);return 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}))}))),this.results.next(r),r},a.prototype.getIrlDiscountCards=function(){var e=this.supplier;return this.irlDiscountCardsFetcher.fetchList({supplier:e})},a.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}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:re.InternationalRail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.generateFilters=function(t){if(null==t?void 0:t.length){var r=null,a=null,i=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))})),(!a||a>t.providers[0].cheapestTicket.price)&&(a=Math.floor(t.providers[0].cheapestTicket.price)),i&&!l.default(t.departDateTime).isBefore(l.default(i))||(i=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:a,dateArrMax:s,dateArrMin:o,dateDepMax:n,dateDepMin:i,classes:Object.values(u),changes:Object.values(c)};return console.log(d),d}},a.prototype.applyFilters=function(e,t){void 0===t&&(t="O");var r,a=this.helpers.clone(this.fullResults);switch(t){case"O":r=a[0].outbound;break;case"I":r=a[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 i=e.classes.filter((function(e){return e.selected}));(null==i?void 0:i.length)&&(r=r.filter((function(e){var t=[];return console.log("og tickets:",e.providers[0].ticketOptions),e.providers[0].ticketOptions.forEach((function(e){i.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":a[0].outbound=r;break;case"I":a[0].return=r}this.results.next(a)},a.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},a}(c);Ft.STORAGE_SESSION_PARAMS="search_irl",Ft.STORAGE_SESSION_RESULTS="irl_results",Ft.PASSING_POINT="Passing";var _t,Rt,Ot={type:"string"},It={type:"object",properties:{countryCode:Ot,areaCode:Ot,number:Ot,extension:Ot},required:["countryCode","areaCode","number","extension"]},Et={type:"object",properties:{numberOrName:Ot,street:Ot,town:Ot,county:Ot,postcode:Ot,countryCode:Ot},required:["numberOrName","street","town","county","postcode","countryCode"]},Nt=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}(),Bt=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}(),Mt=function(){function e(e,t,r,a,i,n){this.user=e,this.getUserFetcher=t,this.helpers=r,this.perPassengerPhoneNumber=a,this.perPassengerAddress=i,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 Nt(this.helpers),this.userInfo.phoneNumber=new Bt(this.helpers),this.userInfo.supplementaryInfo=this.perPassengerSupplementaryBookingInfoSchema,this.user.id&&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}(),Lt=function(){function t(e,t,r){var a=this;this.basketItem=e,this.helpers=t,this.hasDetails=!1,this.basketItem.perPassengerSupplementaryBookingInfoSchema=e.perPassengerSupplementaryBookingInfoSchema?this.processSchema(this.basketItem.perPassengerSupplementaryBookingInfoSchema):null,this.userInfo=this.basketItem.users.map((function(e){return new Mt(e,r,t,a.basketItem.perPassengerPhoneNumber,a.basketItem.perPassengerAddress,a.basketItem.perPassengerSupplementaryBookingInfoSchema)})),this.address=new Nt(this.helpers),this.phoneNumber=new Bt(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(a){console.log("here: ",a),r.hasDetails=!0;var i=t.properties[a];"object"===i.type&&(i.format=r.addRailFormat(a)||e.SchemaFormat.object,t.properties[a]=Object.assign(Object.assign({},r.processSchema(i)),{format:r.addRailFormat(a)||e.SchemaFormat.object})),i.format=i.format||r.schemaWidgetToFormat(i.widget)||r.schemaTypeToFormat(i.type),i.oneOf&&i.oneOf.length>0&&"railSeating"!==i.format&&i.format!==e.SchemaFormat.selectQueue&&(i.format=e.SchemaFormat.select)})),console.log("+++ has Details: "+this.hasDetails+" +++"),t},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;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:{}};return void 0!==e.perItemAddress&&(r.address=this.helpers.toStrings(e.perItemAddress,Et)),void 0!==e.perItemPhoneNumber&&(r.phoneNumber=this.helpers.toStrings(e.perItemPhoneNumber,It)),void 0!==e.perItemSupplementarySchema&&(r.supplementaryInfo=this.helpers.toStrings(e.perItemSupplementarySchema,this.perItemSupplementarySchema)),r.userInfo=this.userInfo.map((function(r,a){var i={id:r.id,supplementaryInfo:{}},n=e["user_"+a]||{};return void 0!==n.perPassengerAddress&&(i.address=t.helpers.toStrings(n.perPassengerAddress,Et)),void 0!==n.perPassengerPhoneNumber&&(i.phoneNumber=t.helpers.toStrings(n.perPassengerPhoneNumber,It)),void 0!==n.perPassengerSupplementaryBookingInfoSchema&&(i.supplementaryInfo=t.helpers.toStrings(n.perPassengerSupplementaryBookingInfoSchema,t.perPassengerSupplementaryBookingInfoSchema)),i})),r},t}();(_t=e.IncludedType||(e.IncludedType={})).Leg="leg",_t.Photo="photo",_t.PhotoAttachment="photo_attachment",_t.Upa="upa",(Rt=e.IrlDirection||(e.IrlDirection={})).Outbound="out",Rt.Inbound="in";var wt=function(e){function t(t,r,a){var i=e.call(this,r)||this;return i.query=t,i.helpers=a,i}return m(t,e),t.prototype.fetchOne=function(e){return this.processCall(this.query.fetch(this.helpers.removeNulls(e)))},t}(p),jt=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.applyJITFlightRules},t}(wt),Ht=function(e){function t(t,r,a){var i=e.call(this,a)||this;return i.query=t,i.helpers=r,i}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 a=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?a.helpers.arrayToObject(t,e):null})))},t.prototype.fetchKeyedObjectArray=function(e,t){var a=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?a.helpers.arrayToObjectArray(t,[e]):null})))},t}(p),xt=function(e){function a(t,r,a){return e.call(this,t,r,a)||this}return m(a,e),a.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.applyJITHotelRules.result},a.prototype.processCall=function(e){var a=this;return e.pipe(r.take(1),r.map((function(e){return a.checkError(e.errors),a.getDataFromResult(e)})),r.catchError((function(e){return a.checkError(e),t.of({})})))},a}(Ht),Ut=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(wt),Vt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Gt=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.carHireAvailabilityDetailRequest},t}(Ht),Wt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Jt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Qt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(wt),Yt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Kt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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.searchEurostar)||void 0===r?void 0:r.results},t}(Ht),qt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Xt=function(e){function t(t,r,a,i){var n=e.call(this,t,r,a)||this;return n.environment=i,n}return m(t,e),t.prototype.fetchList=function(t){var r,a;return(null===(r=this.environment)||void 0===r?void 0:r.groupMax)>0&&(t.groupMax=null===(a=this.environment)||void 0===a?void 0:a.groupMax),e.prototype.fetchList.call(this,t)},t.prototype.getDataFromResult=function(e){var t,r,a,i;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===(i=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.searchFlightsV2)||void 0===i?void 0:i.ruleActionSummary})},t}(Ht),zt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Zt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),$t=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),er=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),tr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),rr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),ar=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),ir=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserCurrentCarbonAllowance},t}(Ht),nr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserRecentSearches},t}(Ht),or=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserBaskets},t}(Ht),sr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserMIAutoSuggestValues},t}(Ht),lr=function(e){function a(t,r,a){return e.call(this,t,r,a)||this}return m(a,e),a.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getMultipleHotelsAvailability.results},a.prototype.processCall=function(e){var a=this;return e.pipe(r.take(1),r.map((function(e){return a.checkError(e.errors),a.getDataFromResult(e)})),r.catchError((function(e){return a.checkError(e),t.of({})})))},a}(Ht),ur=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),cr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),dr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),pr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),hr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),mr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),fr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirlines},t}(wt),vr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirports},t}(wt),br=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),yr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(wt),gr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getCarHireDepots},t}(Ht),Sr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Ar=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Cr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Tr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Pr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Dr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),kr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUser},t}(wt),Fr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),_r=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Rr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Or=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Ir=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserFavouriteSearches},t}(Ht),Er=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Nr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Br=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Mr=function(e){function t(t,r,a){return e.call(this,t,a,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}(wt),Lr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),wr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),jr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),Hr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Ht),xr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.getCancellationInfo},t}(wt),Ur=function(){};Ur.WHITE_CHARS=/[\r\n\t\s]/gm,Ur.CAPS=/([A-Z])/g,Ur.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])+)\])/,Ur.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})$/,Ur.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 Vr,Gr=function(e){function t(t,r,a,i,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=a,o.error=i,o.name="LoginError",o}return m(t,e),t}(Error);(Vr=e.LoginErrorReason||(e.LoginErrorReason={}))[Vr.PASSWORD_EXPIRED=0]="PASSWORD_EXPIRED",Vr[Vr.PASSWORD_CHANGE=1]="PASSWORD_CHANGE",Vr[Vr.LOGED_IN=2]="LOGED_IN",Vr[Vr.AUTH_ERROR=3]="AUTH_ERROR",Vr[Vr.SSO=4]="SSO";var Wr=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(Ur.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(Ur.WHITE_CHARS,"")}catch(e){console.error("Sorry there is no enough information to get token string.",e)}},e}(),Jr=function(){function e(e,t){this.modalService=e,this.basketService=t}return e.prototype.addBasketItem=function(e){return b(this,void 0,void 0,(function(){var t,r,a=this;return y(this,(function(i){switch(i.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,2];case 1:(r=i.sent())?this.workingOn.basket.basketItems.forEach((function(e){(e.managementInfo||[]).forEach((function(e){r[e.id]&&a.basketService.setMiSelectedValue(a.workingOn.basket.id,e,r[e.id],null)}))})):Object.entries(this.workingOn.required).forEach((function(e){var t=S(e,2),r=t[0];t[1];a.basketService.removeBasketItem(a.workingOn.basket.id,a.workingOn.basket.basketItems.find((function(e){return e.id===r})))})),this.workingOn=null,i.label=2;case 2:return[2]}}))}))},e}(),Qr=function(){function e(e,r,a,i,n){this.helpers=r,this.basketService=a,this.getUserFetcher=i,this.requiresService=n,Object.assign(this,{subject: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.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!==D.Approved||void 0!==e.basketItems[0].perItemPhoneNumber){this.id=e.id,this.title=e.title;var a=Object.assign(Object.assign({},e),(e.basketItems||[]).reduce((function(e,t,a){var i,n;return e.prices[t.currency]||(e.prices[t.currency]=0),e.prices[t.currency]+=t.price,e.suppInfo.push(new Lt(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===(n=t.users)||void 0===n?void 0:n.length)>0&&e.basketInfoMiDetails.push(new Ce(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:[]}));a.mixedCurrency=Object.keys(a.prices).length>1,this.subject.next(a),this.requiresService.addBasketItem(e)}else this.basketService.getBasket({convertCurrencyTo:"GBP",id:e.id,withSupplemental:!0}).subscribe((function(e){r.next(e)}))},e}(),Yr=function(){function a(r,a,i,n,o,s,l,u,c,d,p,h,m,f,v,b,y,g,S,A,C,T,P,D,k){var F=this;this.acceptNewPriceUpdater=r,this.addItemToBasketUpdater=a,this.addUserToBasketItem=i,this.basketCreator=n,this.basketFetcher=o,this.bookBasketUpdater=s,this.deleteBasketUpdater=l,this.getMiAutoSugestionFetcher=u,this.helpers=c,this.removeItemFromBasketUpdater=d,this.revalidateBasketUpdater=p,this.setBasketItemMiGroupUpdater=h,this.setBasketItemMiValueUpdater=m,this.validateMiFreeValue=f,this.sendBasketForApprovalUpdater=v,this.getUserFetcher=b,this.getUserBasketsFetcher=y,this.SetBasketItemLeadPassenger=g,this.moveItemToADifferentBasket=S,this.updateBasketNotesUpdater=A,this.updateBasketTitleUpdater=C,this.setPaymentMethodUpdater=T,this.getCancellationInfoFetcher=P,this.userService=D,this.modalService=k,this.currentBaskets=[],this.highlightBasketItemsEmitter=new t.Subject,this.basketChangeEmitter=new t.BehaviorSubject(""),this.baskets=new t.BehaviorSubject([]),this.basketList=[{type:re.Flight,text:"FLIGHTS",price:0},{type:re.Rail,text:"RAIL",price:0},{type:re.Hotel,text:"HOTELS",price:0},{type:re.Cab,text:"TAXIS",price:0},{type:re.Car,text:"CARS",price:0},{type:re.Eurostar,text:"EUROSTAR",price:0},{type:re.InternationalRail,text:"INTERNATIONAL RAIL",price:0},{type:re.Parking,text:"PARKING",price:0},{type:re.Lounge,text:"LOUNGES",price:0},{type:re.Coach,text:"COACH",price:0},{type:re.FastTrack,text:"FAST_TRACK",price:0}],this.basketPrices=new t.BehaviorSubject({total:null,list:this.basketList}),this.menuState=e.MenuSlideEnum.OUT,this.requiresService=new Jr(k,this),this.userService.changeUser.subscribe({next:function(e){F.reset()}})}return Object.defineProperty(a.prototype,"currentBasketID",{get:function(){return this.basketChangeEmitter.value},set:function(e){e!==this.currentBasketID&&this.basketChangeEmitter.next(e)},enumerable:!1,configurable:!0}),a.prototype.getRequiresReasonService=function(){return this.requiresService},a.prototype.reset=function(){var e=this;this.userService.getfullUserDetails(!1).userData.value?this.getUserBasketsFetcher.fetchList({basketStatus:D.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 Qr(t,e.helpers,e,e.getUserFetcher,e.requiresService),e.currentBaskets.push(r)),r}}));e.baskets.next(r),r.length>0?e.currentBasketID=r[0].id:e.currentBasketID=null,e.basketChangeEmitter.next(e.currentBasketID)}),(function(e){console.error(e)})):(this.currentBaskets.forEach((function(e){return e.subject.unsubscribe()})),this.currentBaskets=[],this.currentBasketID=null,this.baskets.next(this.currentBaskets),this.basketChangeEmitter.next(this.currentBasketID))},a.prototype.getAllOpenBaskets=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(this,(function(a){return[2,this.getUserBasketsFetcher.fetchList({basketStatus:D.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 Qr(e,t.helpers,t,t.getUserFetcher,t.requiresService);t.currentBaskets.push(r)}})),e}))).toPromise()]}))}))},a.prototype.addToBasket=function(e,t,a,i,n){return void 0===i&&(i=[]),b(this,void 0,void 0,(function(){var o=this;return y(this,(function(s){return e.convertCurrencyTo="GBP",(null==i?void 0:i.length)>0&&(e.users=this.helpers.makeUsers(i),e.leadPassenger=e.users[0].id),e.outboundDate=e.outboundDate?new Date(this.helpers.formatIsoDateTime(e.outboundDate)):e.outboundDate,e.inboundDate=e.inboundDate?new Date(this.helpers.formatIsoDateTime(e.inboundDate)):e.inboundDate,e.requiresReason=n,(e=this.checkDetails(e))&&t&&this.addItemToBasketUpdater.updateOne(e).pipe(r.take(1)).subscribe((function(r){t.next(Object.assign(Object.assign({},t.subject.value),r));var i=o.userService.findService(e.service).type;a.search_objects[i].booking_chosen=!0,a.search_objects[i].chosen=!1;var n=r.basketItems;o.highlightBasketItemsEmitter.next(n),o.basketChangeEmitter.next(o.currentBasketID)}),(function(e){console.error(e),t.subject.next(t.subject.value)})),[2,!1]}))}))},a.prototype.loadBasket=function(e){var t=this.findBasket(e);t||(t=new Qr({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)}))},a.prototype.subsribeToBasket=function(e,t){var r=this.findBasket(e);r&&r.subject.subscribe(t)},a.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)}))},a.prototype.removeBasketItem=function(e,t){return b(this,void 0,void 0,(function(){var r,a,i=this;return y(this,(function(n){switch(n.label){case 0:return r=this.findBasket(e),t.service.type!==re.Hotel?[3,4]:(a=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(),a.forEach((function(t){i.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),i.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)),i.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)),i.basketChangeEmitter.next(e)})),n.label=5;case 5:return[2]}}))}))},a.prototype.getDefaultBasket=function(e){return void 0===e&&(e=!1),b(this,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return null,[4,this.findOrCreateBasket(this.currentBasketID,e).then((function(e){return e}))];case 1:return[2,t.sent()]}}))}))},a.prototype.findBasket=function(e){return this.currentBaskets.find((function(t){return t.id===e||t.tempid===e}))},a.prototype.findOrCreateBasket=function(e,t){return void 0===t&&(t=!1),b(this,void 0,void 0,(function(){var r,a;return y(this,(function(i){switch(i.label){case 0:return r=null,e?[3,7]:[4,this.getAllOpenBaskets(this.userService.getfullUserDetails(!0).userData.value.user_id.toString())];case 1:return(null==(a=i.sent())?void 0:a.length)?[3,3]:[4,this.createBasket()];case 2:return r=i.sent(),[3,6];case 3:return"BOOKED"!==(r=this.findBasket(a[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=i.sent(),this.currentBaskets.push(r),i.label=5;case 5:this.baskets.next(this.currentBaskets),i.label=6;case 6:return[3,8];case 7:r=this.findBasket(e),i.label=8;case 8:return[2,r]}}))}))},a.prototype.createBasket=function(){return b(this,void 0,void 0,(function(){var e,t,r;return y(this,(function(a){switch(a.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 Qr(e,this.helpers,this,this.getUserFetcher,this.requiresService),[4,this.createBasketOnDB(t)];case 1:return r=a.sent(),this.currentBaskets.push(r),this.baskets.next(this.currentBaskets),this.basketChangeEmitter.next(r.id),[2,r]}}))}))},a.prototype.createBasketOnDB=function(e){var t=this;return new Promise((function(a,i){t.basketCreator.updateOne({}).pipe(r.take(1)).subscribe((function(t){e.id=t.id,e.next(t),a(e)}),(function(e){i(e)}),(function(){}))}))},a.prototype.toggleMenu=function(){this.menuState===e.MenuSlideEnum.IN||this.menuState===e.MenuSlideEnum.FLAT?this.menuState=e.MenuSlideEnum.OUT:this.menuState=e.MenuSlideEnum.IN},a.prototype.closeMenu=function(){this.menuState=e.MenuSlideEnum.IN},a.prototype.getLatestBasketItemForTypes=function(e){return(e||[]).reduce((function(e,t){return e[t.service.type]=t,e}),{})},a.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(e){return!0})),r.addFormat("passport",(function(e){return!0})),r.addFormat("specialRequest",(function(e){return!0}));var a=r.compile(t.detailSchema),i=r.compile(t.searchQuerySchema);if(e.searchQuery=this.helpers.sanitizeMomentDates(e.searchQuery),e.detail=this.helpers.removeNulls(e.detail),!i(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",i.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}if(!a(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",a.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}return e},a.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},a.prototype.removeBasket=function(e){var a=this;if(e)return this.deleteBasketUpdater.updateOne({id:e}).pipe(r.take(1),r.switchMap((function(r){var i,n;return null===(i=a.findBasket(e))||void 0===i||i.destructor(),a.currentBaskets=a.currentBaskets.filter((function(t){return t.id!==e})),a.baskets.next(a.currentBaskets),e===a.currentBasketID&&(a.currentBasketID=(null===(n=a.currentBaskets[0])||void 0===n?void 0:n.id)||null,a.basketChangeEmitter.next(a.currentBasketID)),t.of(r)})))},a.prototype.continueSearchAndBook=function(e,t,r){var a=this.getLatestBasketItemForTypes(e),i=r.getHighestSearchPriorityObject(a);return i?(r.searches[i.type].updateFromPreviousSearches(a),[i.searchUrl]):t},a.prototype.addTravellers=function(e,t,r,a){var i=this;void 0===a&&(a=0);var n=this.findBasket(e);if(a<r.length){var o=r[a],s=o.isChild?Y.Child:o.isInfant?Y.Infant:Y.Adult;this.addUserToBasketItem.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,users:[{id:o.id,passengerType:s}],withSupplemental:!1}).subscribe((function(){}),(function(){}),(function(){i.addTravellers(n.id,t,r,a+1)}))}else this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:n.id}).subscribe((function(e){n.subject.next(Object.assign(Object.assign({},n.subject.value),e))}),(function(e){}),(function(){n.next(n.subject.value)}))},a.prototype.setLeadPassenger=function(e,t,r,a){var i=this;void 0===a&&(a=0);var n=this.findBasket(e);a<1?this.SetBasketItemLeadPassenger.updateOne({convertCurrencyTo:"GBP",id:t.id,user:r.id,withSupplemental:!1}).subscribe((function(){}),(function(){}),(function(){i.setLeadPassenger(n.id,t,r,a+1)})):this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:n.id}).subscribe((function(e){n.subject.next(Object.assign(Object.assign({},n.subject.value),e))}),(function(e){}),(function(){n.next(n.subject.value)}))},a.prototype.updateBasket=function(e,t){var a=this;return new Promise((function(i,n){t.pipe(r.take(1)).subscribe((function(t){a.findBasket(e).next(t),i()}),(function(t){console.error(t);var r=a.findBasket(e);r.next(r.subject.value),n(t)}),(function(){}))}))},a.prototype.revalidate=function(e){this.updateBasket(e,this.revalidateBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e}))},a.prototype.setBasketItemMiGroup=function(e,t,r){this.updateBasket(e,this.setBasketItemMiGroupUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t,group:r}))},a.prototype.acceptNewPrice=function(e,t){this.updateBasket(e,this.acceptNewPriceUpdater.updateOne({convertCurrencyTo:"GBP",id:t.id}))},a.prototype.validateFreeValeMi=function(e,t){var r=this;return new Promise((function(a,i){r.validateMiFreeValue.test({mi:e.id,freeValue:t}).subscribe(a,i)}))},a.prototype.setMiFreeValue=function(e,t,a,i){void 0===i&&(i=null);var n=this.findBasket(e),o={convertCurrencyTo:"GBP",mi:t.id,miFreeValue:a};i&&(o.user=i),this.setBasketItemMiValueUpdater.updateOne(o).pipe(r.take(1)).subscribe((function(e){n.next(e)}),(function(e){}),(function(){n.next(n.subject.value)}))},a.prototype.setMiSelectedValue=function(e,t,r,a){void 0===a&&(a=null);var i={convertCurrencyTo:"GBP",mi:t.id,miValue:r};a&&(i.user=a),this.updateBasket(e,this.setBasketItemMiValueUpdater.updateOne(i))},a.prototype.getMiAutoSugestions=function(e,t,a){return null==a||a.next(!0),this.getMiAutoSugestionFetcher.fetchList({mi:e,partialLabel:t}).pipe(r.tap((function(e){null==a||a.next(!1)})))},a.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)}))}))}))},a.prototype.sendBasketForApproval=function(e){return this.updateBasket(e,this.sendBasketForApprovalUpdater.updateOne({convertCurrencyTo:"GBP",basket:e}).pipe(r.take(1)))},a.prototype.setBasketItemPaymentOption=function(e,t,r){return this.updateBasket(e.id,this.setPaymentMethodUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,paymentMethod:r}))},a.prototype.bookBasket=function(e,t){return this.updateBasket(e,this.bookBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e,supplementaryInfo:t}))},a.prototype.moveBasketItem=function(e,t,r){var a=this;this.moveItemToADifferentBasket.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,newBasket:r}).subscribe((function(){a.loadBasket(e),a.loadBasket(r)}))},a.prototype.updateBasketNotes=function(e,t){this.updateBasket(e,this.updateBasketNotesUpdater.updateOne({convertCurrencyTo:"GBP",id:e,notes:t}))},a.prototype.updateBasketTitle=function(e,t){this.updateBasket(e,this.updateBasketTitleUpdater.updateOne({convertCurrencyTo:"GBP",id:e,newTitle:t}))},a.prototype.getBasket=function(e){return this.basketFetcher.fetchOne(e)},a.prototype.atLeastOneSearchChosen=function(){return!!this.currentBaskets.filter((function(e){return e.subject.value.basketItems.length})).length},a.prototype.getBasketStats=function(e){var t,r,a,i=this,n=(null===(a=null===(r=null===(t=this.baskets.value[e])||void 0===t?void 0:t.subject)||void 0===r?void 0:r.value)||void 0===a?void 0:a.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,a,n;t.price=null===(n=null===(a=null===(r=i.baskets.value[e])||void 0===r?void 0:r.subject)||void 0===a?void 0:a.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)})),this.basketPrices},a.prototype.canCancel=function(e){return this.getCancellationInfoFetcher.fetchOne({basketItem:e.id})},a}(),Kr="results_hotel_avallibility",qr=function(){function e(e,r,a,i){this.avalibilityFethcer=e,this.sessionStorage=r,this.helpers=a,this.environment=i,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(Kr)||{};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(Kr),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 a;if(null===(a=null==r?void 0:r.availableRates)||void 0===a?void 0:a.rooms){if(this.behaviours[e.hotel])return this.behaviours[e.hotel];this.behaviours[e.hotel]=new t.BehaviorSubject(null);var i=r.availableRates;return i.minprice=r.availableRates.rooms[0]?r.availableRates.rooms[0].total:0,i.maxprice=i.minprice?r.availableRates.rooms[r.availableRates.rooms.length-1].total:0,this.behaviours[e.hotel].next(i),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){return e.availableRates&&(null==e?void 0:e.availableRates.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=this;this.fetching.next(!0),this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0);var t=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 a={hotel:t.map((function(e){return e.hotel})),currency:t[0].currency,endDate:t[0].endDate,startDate:t[0].startDate,occupants:t[0].occupants,rooms:t[0].rooms};this.avalibilityFethcer.fetchList(a).pipe(r.take(1)).subscribe((function(t){t.forEach((function(t){(t=e.helpers.clone(t)).rooms=(t.rooms||[]).filter((function(e){return e.total>0})).map((function(t){return(t=e.helpers.clone(t)).LocalPrice=t.currencyConversion?t.currencyConversion.localTotal:t.total,t.LocalCurrency=t.currencyConversion?t.currencyConversion.localCode:t.currencyCode,t})),t.currencies=t.rooms.reduce((function(t,r){return r.currencyConversion&&(t[r.currencyConversion.convertedCode]=t[r.currencyConversion.convertedCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},t[r.currencyConversion.convertedCode].maxprice=Math.max(t[r.currencyConversion.convertedCode].maxprice,r.currencyConversion.convertedTotal),t[r.currencyConversion.convertedCode].minprice=Math.min(t[r.currencyConversion.convertedCode].minprice,r.currencyConversion.convertedTotal),e.currencies[r.currencyConversion.convertedCode]=e.currencies[r.currencyConversion.convertedCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},e.currencies[r.currencyConversion.convertedCode].minprice=Math.ceil(Math.min(e.currencies[r.currencyConversion.convertedCode].minprice,r.currencyConversion.convertedTotal)),e.currencies[r.currencyConversion.convertedCode].maxprice=Math.ceil(Math.max(e.currencies[r.currencyConversion.convertedCode].maxprice,r.currencyConversion.convertedTotal))),t}),{});var r=t.rooms.map(e.helpers.mapFieldFromObject("total"));r.length||r.push(0),t.minprice=Math.min.apply(Math,A(r)),t.maxprice=Math.max.apply(Math,A(r)),t.rooms=t.rooms,(null==t?void 0:t.hotelId)&&e.behaviours[t.hotelId]&&(e.data[t.hotelId]=t,e.behaviours[t.hotelId].next(t))})),e.sessionStorage.setSessionItem(Kr,t),e.toFetch.length>0?setTimeout((function(){e.fetchAvalilbility()}),e.environment.hotelAvalibilityTimeout):e.fetching.next(!1)}),(function(t){return console.error("+++ Error recovering hotel availabilty: "+t+" - reseting availabilty +++"),e.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 a=g(Object.entries(this.data)),i=a.next();!i.done;i=a.next()){var n=S(i.value,2),o=(n[0],n[1]);(null==o?void 0:o.prpn)&&r++}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return r},e}(),Xr=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}(),zr="USER_SIGNEDOUT",Zr=function(){function e(e,r,a,i,n,o,s,l,u){this.getUserFetcher=e,this.userUiConfigsFetcher=r,this.userProductsFetcher=a,this.userMessagesFetcher=i,this.baseConfirmMessagesUpdater=n,this.setUserLanguageUpdater=o,this.editUserUpdater=s,this.storageService=l,this.helpers=u,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)}return e.prototype.setUser=function(e){var t=this,a=this.fullUserDetails.userData.value;a&&a.username===e.username||((null==a?void 0:a.user_id)&&this.getUserFetcher.fetchOne({id:a.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(kt.makeTravellerObjectFromUser(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.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(),a=this.getUserBookingType(),i=this.getUserTitle();return t&&(e.name=t),r&&(e.email=r),a&&(e.account_type=a),i&&(e.title=i),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=tt.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=tt.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,a,i,n,o,s,l,u,c){return{isChild:l,isInfant:u,childDOB:c,guest:!0,id:"",forename:t,surname:r,email:a,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===F.Traveller},e.prototype.userIsAgent=function(){return this.fullUserDetails.userData.value.booker_type===F.Company},e.prototype.userIsAdmin=function(){return this.fullUserDetails.userData.value.admin},e.prototype.userIsCompanyAdmin=function(){return this.fullUserDetails.userData.value.company_admin},e.prototype.isSelfBook=function(){return this.fullUserDetails.userData.value.booker_type===F.SelfBook},e.prototype.isBooker=function(){return this.fullUserDetails.userData.value.booker_type===F.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.getUser=function(){var e=this.getfullUserDetails();return this.getUserFetcher.fetchOne({id:e.userData.value.user_id.toString()})},e.prototype.setUserLanguage=function(e){return this.setUserLanguageUpdater.updateOne({language:e})},e.prototype.getDocuments=function(e){return this.getUser().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}(),$r=function(){function a(e,t,r,a,i,n,o){this.userService=e,this.modalService=t,this.http=r,this.router=a,this.eventMessenager=i,this.storageService=n,this.environment=o,this.loading=!1,this.isLoggedIn=!1,this.redirectUrl="",this.refreshPromise=null}return a.prototype.checkLogin=function(){return this.refreshToken()},a.prototype.refreshToken=function(){var t=this;return this.refreshPromise=this.refreshPromise||new Promise((function(a,i){t.clearRefresh(),t.http.formEncodedPostNoErrorHandling(e.URLS.Refresh,{}).pipe(r.take(1),r.map((function(e){return t.handleResponse(e)}))).subscribe((function(e){if("string"==typeof e){if(a(!1),"login"!==t.router.url)t.modalService.open(d.BaseModalComponent,{},{title:"Auto Logout",body:"",isLoading:!1,options:{buttonCancel:!1,buttonOk:!0,buttonOkText:"Continue"}}).then((function(){t.logout(),a(!1)}))}else a(!0),t.setRefresh()}),(function(e){a(!1)}))})).then((function(e){return t.refreshPromise=null,e})).catch((function(e){throw t.refreshPromise=null,e})),this.refreshPromise},a.prototype.clearRefresh=function(){this.timeoutSubscription&&(clearTimeout(this.timeoutSubscription),this.timeoutSubscription=null)},a.prototype.setRefresh=function(){this.timeoutSubscription=window.setTimeout(this.refreshToken.bind(this),1e3*this.environment.authRefreshTimeout)},a.prototype.login=function(t,a,i){var n=this;return this.userService.emptyUserData(),this.storageService.clearSessionData(),this.clearRefresh(),this.http.formEncodedPostNoErrorHandling(e.URLS.AccessToken,{username:t,password:a}).pipe(r.take(1),r.map((function(e,t){return n.setRefresh(),n.handleResponse(e)})))},a.prototype.handleResponse=function(e){return"object"==typeof e&&e.jwt&&(this.userService.setUser(e.jwtObject),delete e.jwt,delete e.jwtObject),e},a.prototype.cookieLogin=function(e){return t.of(null)},a.prototype.logout=function(){var t=this;this.userService.isUserFavoriteSet(et.SSO_no_password);this.clearRefresh(),this.isLoggedIn=!1,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(zr,{}),t.userService.isUserFavoriteSet(et.SSO_no_password)?t.router.navigate(["logOutDigitsUser"]):t.router.navigate(["logon"])}))},a.prototype.changePassword=function(e){return t.of(null)},a.prototype.resetPassword=function(t,r){return this.http.formEncodedPost(e.URLS.RESET_PASSWORD,{passwordResetToken:t,newPassword:r})},a.prototype.recoverPassword=function(t){return this.http.formEncodedPost(e.URLS.RECOVER_PASSWORD_URL,{username:""+t},"text")},a.prototype.handleError=function(e){var t={error:e};this.modalService.open(d.ModalErrorComponent,{},t)},a}(),ea=function(){function e(){this.openModalEvent=new t.Subject}return e.prototype.open=function(e,t,r){var a=this;return void 0===t&&(t=null),void 0===r&&(r=null),new Promise((function(i,n){a.openModalEvent.next({type:e,data:r||{},options:t||{},results:i})}))},e.prototype.subscribe=function(e){return this.openModalEvent.subscribe(e)},e}(),ta=function(){function e(e,r,a){var i,n;this.getUserBasketsFetcher=e,this.searchUserCanBookFor=r,this.cancelBookingUpdater=a,this.baskets=new t.BehaviorSubject([]),this._basketStatusIconClasses=((i={})[D.Approved]="ico-tick",i[D.AwaitingApproval]="ico-clock",i[D.BookingFailed]="ico-deny",i[D.Disapproved]="ico-deny",i[D.Open]="ico-calendar",i[D.PartiallyBooked]="ico-deny",i[D.Booked]="ico-deny",i),this._serviceTypeIconClasses=((n={})[re.Cab]="ico-m-taxi",n[re.Car]="ico-car",n[re.Coach]="ico-bus",n[re.Flight]="ico-flight",n[re.Hotel]="ico-bed",n[re.FastTrack]="",n[re.InternationalRail]="ico-rail",n[re.Lounge]="ico-material ico-lounge",n[re.Parking]="ico-material ico-parking",n[re.Rail]="ico-rail",n[re.Eurostar]="ico-rail",n)}return e.prototype.getUserBaskets=function(e,t){var a=this;t.next(!0),this.getUserBasketsFetcher.fetchList(e).pipe(r.take(1)).subscribe((function(e){a.baskets.next(e),t.next(!1)}),(function(e){console.error(e),t.next(!1)}))},e.prototype.getSearchUserCanBookFor=function(e,a){return e.length>2?(a.next(!0),this.searchUserCanBookFor.fetchList({email:e}).pipe(r.take(1),r.map((function(e){return a.next(!1),e})))):t.of([])},e.prototype.getServiceTypeFilters=function(e){var t,r,a=[];try{for(var i=g(Object.entries(e.search_objects)),n=i.next();!n.done;n=i.next()){var o=S(n.value,1)[0];a.push(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return a},e.prototype.getBasketStatusFilters=function(){var e=[];return Object.values(D).forEach((function(t){return e.push(t)})),e},e.prototype.getServiceTypeFilterVanityName=function(e){switch(e){case re.Cab:return"Taxi";case re.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){return e.users.map((function(e){return t.push(e.forename+" "+e.surname)}))})),t=A(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,a=e.streetName,i=e.town,n=[];return a&&n.push(a),i&&n.push(i),t&&n.push(t),r&&n.push(r),n.join(", ")},e.prototype.getHotelLocation=function(e){var t=e.county,r=e.town,a=[];return r&&a.push(r),t&&a.push(t),a.join(", ")},e.prototype.cancelBooking=function(e){return this.cancelBookingUpdater.updateOne({basketItem:e})},e}(),ra=[{cName:"Afghanistan",dCode:"93",cCode:"AF"},{cName:"Aland Islands",dCode:"358",cCode:"AX"},{cName:"Albania",dCode:"355",cCode:"AL"},{cName:"Algeria",dCode:"213",cCode:"DZ"},{cName:"AmericanSamoa",dCode:"1684",cCode:"AS"},{cName:"Andorra",dCode:"376",cCode:"AD"},{cName:"Angola",dCode:"244",cCode:"AO"},{cName:"Anguilla",dCode:"1264",cCode:"AI"},{cName:"Antarctica",dCode:"672",cCode:"AQ"},{cName:"Antigua and Barbuda",dCode:"1268",cCode:"AG"},{cName:"Argentina",dCode:"54",cCode:"AR"},{cName:"Armenia",dCode:"374",cCode:"AM"},{cName:"Aruba",dCode:"297",cCode:"AW"},{cName:"Australia",dCode:"61",cCode:"AU"},{cName:"Austria",dCode:"43",cCode:"AT"},{cName:"Azerbaijan",dCode:"994",cCode:"AZ"},{cName:"Bahamas",dCode:"1242",cCode:"BS"},{cName:"Bahrain",dCode:"973",cCode:"BH"},{cName:"Bangladesh",dCode:"880",cCode:"BD"},{cName:"Barbados",dCode:"1246",cCode:"BB"},{cName:"Belarus",dCode:"375",cCode:"BY"},{cName:"Belgium",dCode:"32",cCode:"BE"},{cName:"Belize",dCode:"501",cCode:"BZ"},{cName:"Benin",dCode:"229",cCode:"BJ"},{cName:"Bermuda",dCode:"1441",cCode:"BM"},{cName:"Bhutan",dCode:"975",cCode:"BT"},{cName:"Bolivia, Plurinational State of",dCode:"591",cCode:"BO"},{cName:"Bosnia and Herzegovina",dCode:"387",cCode:"BA"},{cName:"Botswana",dCode:"267",cCode:"BW"},{cName:"Brazil",dCode:"55",cCode:"BR"},{cName:"British Indian Ocean Territory",dCode:"246",cCode:"IO"},{cName:"Brunei Darussalam",dCode:"673",cCode:"BN"},{cName:"Bulgaria",dCode:"359",cCode:"BG"},{cName:"Burkina Faso",dCode:"226",cCode:"BF"},{cName:"Burundi",dCode:"257",cCode:"BI"},{cName:"Cambodia",dCode:"855",cCode:"KH"},{cName:"Cameroon",dCode:"237",cCode:"CM"},{cName:"Canada",dCode:"1",cCode:"CA"},{cName:"Cape Verde",dCode:"238",cCode:"CV"},{cName:"Cayman Islands",dCode:" 345",cCode:"KY"},{cName:"Central African Republic",dCode:"236",cCode:"CF"},{cName:"Chad",dCode:"235",cCode:"TD"},{cName:"Chile",dCode:"56",cCode:"CL"},{cName:"China",dCode:"86",cCode:"CN"},{cName:"Christmas Island",dCode:"61",cCode:"CX"},{cName:"Cocos (Keeling) Islands",dCode:"61",cCode:"CC"},{cName:"Colombia",dCode:"57",cCode:"CO"},{cName:"Comoros",dCode:"269",cCode:"KM"},{cName:"Congo",dCode:"242",cCode:"CG"},{cName:"Congo, The Democratic Republic of the Congo",dCode:"243",cCode:"CD"},{cName:"Cook Islands",dCode:"682",cCode:"CK"},{cName:"Costa Rica",dCode:"506",cCode:"CR"},{cName:"Cote d'Ivoire",dCode:"225",cCode:"CI"},{cName:"Croatia",dCode:"385",cCode:"HR"},{cName:"Cuba",dCode:"53",cCode:"CU"},{cName:"Cyprus",dCode:"357",cCode:"CY"},{cName:"Czech Republic",dCode:"420",cCode:"CZ"},{cName:"Denmark",dCode:"45",cCode:"DK"},{cName:"Djibouti",dCode:"253",cCode:"DJ"},{cName:"Dominica",dCode:"1767",cCode:"DM"},{cName:"Dominican Republic",dCode:"1849",cCode:"DO"},{cName:"Ecuador",dCode:"593",cCode:"EC"},{cName:"Egypt",dCode:"20",cCode:"EG"},{cName:"El Salvador",dCode:"503",cCode:"SV"},{cName:"Equatorial Guinea",dCode:"240",cCode:"GQ"},{cName:"Eritrea",dCode:"291",cCode:"ER"},{cName:"Estonia",dCode:"372",cCode:"EE"},{cName:"Ethiopia",dCode:"251",cCode:"ET"},{cName:"Falkland Islands (Malvinas)",dCode:"500",cCode:"FK"},{cName:"Faroe Islands",dCode:"298",cCode:"FO"},{cName:"Fiji",dCode:"679",cCode:"FJ"},{cName:"Finland",dCode:"358",cCode:"FI"},{cName:"France",dCode:"33",cCode:"FR"},{cName:"French Guiana",dCode:"594",cCode:"GF"},{cName:"French Polynesia",dCode:"689",cCode:"PF"},{cName:"Gabon",dCode:"241",cCode:"GA"},{cName:"Gambia",dCode:"220",cCode:"GM"},{cName:"Georgia",dCode:"995",cCode:"GE"},{cName:"Germany",dCode:"49",cCode:"DE"},{cName:"Ghana",dCode:"233",cCode:"GH"},{cName:"Gibraltar",dCode:"350",cCode:"GI"},{cName:"Greece",dCode:"30",cCode:"GR"},{cName:"Greenland",dCode:"299",cCode:"GL"},{cName:"Grenada",dCode:"1473",cCode:"GD"},{cName:"Guadeloupe",dCode:"590",cCode:"GP"},{cName:"Guam",dCode:"1671",cCode:"GU"},{cName:"Guatemala",dCode:"502",cCode:"GT"},{cName:"Guernsey",dCode:"44",cCode:"GG"},{cName:"Guinea",dCode:"224",cCode:"GN"},{cName:"Guinea-Bissau",dCode:"245",cCode:"GW"},{cName:"Guyana",dCode:"595",cCode:"GY"},{cName:"Haiti",dCode:"509",cCode:"HT"},{cName:"Holy See (Vatican City State)",dCode:"379",cCode:"VA"},{cName:"Honduras",dCode:"504",cCode:"HN"},{cName:"Hong Kong",dCode:"852",cCode:"HK"},{cName:"Hungary",dCode:"36",cCode:"HU"},{cName:"Iceland",dCode:"354",cCode:"IS"},{cName:"India",dCode:"91",cCode:"IN"},{cName:"Indonesia",dCode:"62",cCode:"ID"},{cName:"Iran, Islamic Republic of Persian Gulf",dCode:"98",cCode:"IR"},{cName:"Iraq",dCode:"964",cCode:"IQ"},{cName:"Ireland",dCode:"353",cCode:"IE"},{cName:"Isle of Man",dCode:"44",cCode:"IM"},{cName:"Israel",dCode:"972",cCode:"IL"},{cName:"Italy",dCode:"39",cCode:"IT"},{cName:"Jamaica",dCode:"1876",cCode:"JM"},{cName:"Japan",dCode:"81",cCode:"JP"},{cName:"Jersey",dCode:"44",cCode:"JE"},{cName:"Jordan",dCode:"962",cCode:"JO"},{cName:"Kazakhstan",dCode:"77",cCode:"KZ"},{cName:"Kenya",dCode:"254",cCode:"KE"},{cName:"Kiribati",dCode:"686",cCode:"KI"},{cName:"Korea, Democratic People's Republic of Korea",dCode:"850",cCode:"KP"},{cName:"Korea, Republic of South Korea",dCode:"82",cCode:"KR"},{cName:"Kuwait",dCode:"965",cCode:"KW"},{cName:"Kyrgyzstan",dCode:"996",cCode:"KG"},{cName:"Laos",dCode:"856",cCode:"LA"},{cName:"Latvia",dCode:"371",cCode:"LV"},{cName:"Lebanon",dCode:"961",cCode:"LB"},{cName:"Lesotho",dCode:"266",cCode:"LS"},{cName:"Liberia",dCode:"231",cCode:"LR"},{cName:"Libyan Arab Jamahiriya",dCode:"218",cCode:"LY"},{cName:"Liechtenstein",dCode:"423",cCode:"LI"},{cName:"Lithuania",dCode:"370",cCode:"LT"},{cName:"Luxembourg",dCode:"352",cCode:"LU"},{cName:"Macao",dCode:"853",cCode:"MO"},{cName:"Macedonia",dCode:"389",cCode:"MK"},{cName:"Madagascar",dCode:"261",cCode:"MG"},{cName:"Malawi",dCode:"265",cCode:"MW"},{cName:"Malaysia",dCode:"60",cCode:"MY"},{cName:"Maldives",dCode:"960",cCode:"MV"},{cName:"Mali",dCode:"223",cCode:"ML"},{cName:"Malta",dCode:"356",cCode:"MT"},{cName:"Marshall Islands",dCode:"692",cCode:"MH"},{cName:"Martinique",dCode:"596",cCode:"MQ"},{cName:"Mauritania",dCode:"222",cCode:"MR"},{cName:"Mauritius",dCode:"230",cCode:"MU"},{cName:"Mayotte",dCode:"262",cCode:"YT"},{cName:"Mexico",dCode:"52",cCode:"MX"},{cName:"Micronesia, Federated States of Micronesia",dCode:"691",cCode:"FM"},{cName:"Moldova",dCode:"373",cCode:"MD"},{cName:"Monaco",dCode:"377",cCode:"MC"},{cName:"Mongolia",dCode:"976",cCode:"MN"},{cName:"Montenegro",dCode:"382",cCode:"ME"},{cName:"Montserrat",dCode:"1664",cCode:"MS"},{cName:"Morocco",dCode:"212",cCode:"MA"},{cName:"Mozambique",dCode:"258",cCode:"MZ"},{cName:"Myanmar",dCode:"95",cCode:"MM"},{cName:"Namibia",dCode:"264",cCode:"NA"},{cName:"Nauru",dCode:"674",cCode:"NR"},{cName:"Nepal",dCode:"977",cCode:"NP"},{cName:"Netherlands",dCode:"31",cCode:"NL"},{cName:"Netherlands Antilles",dCode:"599",cCode:"AN"},{cName:"New Caledonia",dCode:"687",cCode:"NC"},{cName:"New Zealand",dCode:"64",cCode:"NZ"},{cName:"Nicaragua",dCode:"505",cCode:"NI"},{cName:"Niger",dCode:"227",cCode:"NE"},{cName:"Nigeria",dCode:"234",cCode:"NG"},{cName:"Niue",dCode:"683",cCode:"NU"},{cName:"Norfolk Island",dCode:"672",cCode:"NF"},{cName:"Northern Mariana Islands",dCode:"1670",cCode:"MP"},{cName:"Norway",dCode:"47",cCode:"NO"},{cName:"Oman",dCode:"968",cCode:"OM"},{cName:"Pakistan",dCode:"92",cCode:"PK"},{cName:"Palau",dCode:"680",cCode:"PW"},{cName:"Palestinian Territory, Occupied",dCode:"970",cCode:"PS"},{cName:"Panama",dCode:"507",cCode:"PA"},{cName:"Papua New Guinea",dCode:"675",cCode:"PG"},{cName:"Paraguay",dCode:"595",cCode:"PY"},{cName:"Peru",dCode:"51",cCode:"PE"},{cName:"Philippines",dCode:"63",cCode:"PH"},{cName:"Pitcairn",dCode:"872",cCode:"PN"},{cName:"Poland",dCode:"48",cCode:"PL"},{cName:"Portugal",dCode:"351",cCode:"PT"},{cName:"Puerto Rico",dCode:"1939",cCode:"PR"},{cName:"Qatar",dCode:"974",cCode:"QA"},{cName:"Romania",dCode:"40",cCode:"RO"},{cName:"Russia",dCode:"7",cCode:"RU"},{cName:"Rwanda",dCode:"250",cCode:"RW"},{cName:"Reunion",dCode:"262",cCode:"RE"},{cName:"Saint Barthelemy",dCode:"590",cCode:"BL"},{cName:"Saint Helena, Ascension and Tristan Da Cunha",dCode:"290",cCode:"SH"},{cName:"Saint Kitts and Nevis",dCode:"1869",cCode:"KN"},{cName:"Saint Lucia",dCode:"1758",cCode:"LC"},{cName:"Saint Martin",dCode:"590",cCode:"MF"},{cName:"Saint Pierre and Miquelon",dCode:"508",cCode:"PM"},{cName:"Saint Vincent and the Grenadines",dCode:"1784",cCode:"VC"},{cName:"Samoa",dCode:"685",cCode:"WS"},{cName:"San Marino",dCode:"378",cCode:"SM"},{cName:"Sao Tome and Principe",dCode:"239",cCode:"ST"},{cName:"Saudi Arabia",dCode:"966",cCode:"SA"},{cName:"Senegal",dCode:"221",cCode:"SN"},{cName:"Serbia",dCode:"381",cCode:"RS"},{cName:"Seychelles",dCode:"248",cCode:"SC"},{cName:"Sierra Leone",dCode:"232",cCode:"SL"},{cName:"Singapore",dCode:"65",cCode:"SG"},{cName:"Slovakia",dCode:"421",cCode:"SK"},{cName:"Slovenia",dCode:"386",cCode:"SI"},{cName:"Solomon Islands",dCode:"677",cCode:"SB"},{cName:"Somalia",dCode:"252",cCode:"SO"},{cName:"South Africa",dCode:"27",cCode:"ZA"},{cName:"South Sudan",dCode:"211",cCode:"SS"},{cName:"South Georgia and the South Sandwich Islands",dCode:"500",cCode:"GS"},{cName:"Spain",dCode:"34",cCode:"ES"},{cName:"Sri Lanka",dCode:"94",cCode:"LK"},{cName:"Sudan",dCode:"249",cCode:"SD"},{cName:"SuricName",dCode:"597",cCode:"SR"},{cName:"Svalbard and Jan Mayen",dCode:"47",cCode:"SJ"},{cName:"Swaziland",dCode:"268",cCode:"SZ"},{cName:"Sweden",dCode:"46",cCode:"SE"},{cName:"Switzerland",dCode:"41",cCode:"CH"},{cName:"Syrian Arab Republic",dCode:"963",cCode:"SY"},{cName:"Taiwan",dCode:"886",cCode:"TW"},{cName:"Tajikistan",dCode:"992",cCode:"TJ"},{cName:"Tanzania, United Republic of Tanzania",dCode:"255",cCode:"TZ"},{cName:"Thailand",dCode:"66",cCode:"TH"},{cName:"Timor-Leste",dCode:"670",cCode:"TL"},{cName:"Togo",dCode:"228",cCode:"TG"},{cName:"Tokelau",dCode:"690",cCode:"TK"},{cName:"Tonga",dCode:"676",cCode:"TO"},{cName:"Trinidad and Tobago",dCode:"1868",cCode:"TT"},{cName:"Tunisia",dCode:"216",cCode:"TN"},{cName:"Turkey",dCode:"90",cCode:"TR"},{cName:"Turkmenistan",dCode:"993",cCode:"TM"},{cName:"Turks and Caicos Islands",dCode:"1649",cCode:"TC"},{cName:"Tuvalu",dCode:"688",cCode:"TV"},{cName:"Uganda",dCode:"256",cCode:"UG"},{cName:"Ukraine",dCode:"380",cCode:"UA"},{cName:"United Arab Emirates",dCode:"971",cCode:"AE"},{cName:"United Kingdom",dCode:"44",cCode:"GB"},{cName:"United States",dCode:"1",cCode:"US"},{cName:"Uruguay",dCode:"598",cCode:"UY"},{cName:"Uzbekistan",dCode:"998",cCode:"UZ"},{cName:"Vanuatu",dCode:"678",cCode:"VU"},{cName:"Venezuela, Bolivarian Republic of Venezuela",dCode:"58",cCode:"VE"},{cName:"Vietnam",dCode:"84",cCode:"VN"},{cName:"Virgin Islands, British",dCode:"1284",cCode:"VG"},{cName:"Virgin Islands, U.S.",dCode:"1340",cCode:"VI"},{cName:"Wallis and Futuna",dCode:"681",cCode:"WF"},{cName:"Yemen",dCode:"967",cCode:"YE"},{cName:"Zambia",dCode:"260",cCode:"ZM"},{cName:"Zimbabwe",dCode:"263",cCode:"ZW"}],aa=[{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)"}],ia=function(e){function t(r,a,i,n,o){var s=e.call(this,n,a)||this;s.fasttrackFetcher=r,s.basketService=i,s.searchService=o,s.type=re.FastTrack,s._date=null,s._time=null,s.resultsSessionName=t.STORAGE_SESSION_RESULTS,s.multiResultsSessionName=t.STORAGE_SESSION_RESULTS;var l=n.getSessionItem(t.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};s._originalUserSearch=l.originalUserSearch,s.updateTempParams(o.makeFastTrackQuery(l.tempParams)),o.shouldAddTravellerSubscription()&&o.travellerInformation.subscribe((function(e){var t=s.helpers.selectedTravellers(e,re.FastTrack);s.tempParams.adults=t.adults.length,s.tempParams.children=t.children.length,s.travellers=e,s._isValid()}));var u=n.getSessionItemAsList(s.resultsSessionName)||[];return s._cheapestResultPrice=s.updateLowestPrice(u),s.results.next(u||[]),s}return m(t,e),Object.defineProperty(t.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(t.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}),t.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(t.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){this.tempParams.locationCode=e,"string"==typeof e?(this._locationCode="",this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this._isValid()):(this._locationCode=null,this._isValid())},enumerable:!1,configurable:!0}),t.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(t.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))},t.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeFastTrackQuery()),this._isValid()},t.prototype.startSearch=function(){if(this.results.next([]),this._isValid(),this.isValid.value){this._originalUserSearch=Object.freeze(this.helpers.clone(this.tempParams)),this.storageService.setSessionItem(t.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)},t.prototype.getSearchQuery=function(){var e={adults:this.tempParams.adults,children:this.tempParams.children,locationCode:this._locationCode,arrivalDatetime:this.tempParams.arrivalDatetime};return this.helpers.removeNulls(e)},t.prototype.getRecentSearchQuery=function(e){return{serviceType:re.FastTrack,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},t.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(e){var r,a,i,n,o,s;e&&(t.locationCode={country:null===(a=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(n=null===(i=e.iataMatch)||void 0===i?void 0:i.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()},t.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING LOUNGE FORM"),null===(t=e[re.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[re.Flight].outBoundDate.toDate();this.date={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.locationCode=this.searchService.searches[re.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},t.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})},t.prototype.addFastTrackToBasket=function(e,t){var r;return b(this,void 0,void 0,(function(){var a,i,n;return y(this,(function(o){switch(o.label){case 0:return e.unavailable?[2,Promise.resolve(!1)]:[4,this.basketService.getDefaultBasket()];case 1:return a=o.sent(),i=null==a?void 0:a.subject.value,n=this.getTermsAndCond(e),i?[2,this.basketService.addToBasket({adults:t.adults,children:t.children,basket:i.id,service:e.sourceId.toString(),detail:{arrivalDatetime:t.arrivalDatetime.format(),locationCode:e.code,name:e.name,airportIata:null==t?void 0:t.locationCode,logo:e.logo,terminal:null===(r=e.terminal)||void 0===r?void 0:r.toString(),termsAndCond:n},price:e.price,currency:e.currency,searchQuery:t,outboundDate:t.arrivalDatetime.format()},a,this.searchService,this.travellers,e.requiresReason)]:[2,Promise.resolve(!1)]}}))}))},t.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.name},{name:"Important Information",value:e.importantInfo}]},t.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)},t.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},t.prototype.getMinPrice=function(e){return e.reduce((function(e,t){return t.price<e&&(e=t.price),e}),Number.MAX_SAFE_INTEGER)},t.prototype.getMaxPrice=function(e){return e.reduce((function(e,t){return t.price>e&&(e=t.price),e}),Number.MIN_SAFE_INTEGER)},t}(c);ia.STORAGE_SESSION_PARAMS="search_fasttrack",ia.STORAGE_SESSION_RESULTS="results_fasttrack";var na;(na=e.TravellerSearchTypes||(e.TravellerSearchTypes={})).email="email",na.name="name",na.employeeNumber="employeeNumber";var oa=function(){function a(e,r,i,n,o,l,u,c,d,p,h,m,f,v,b,y,g,S,A,C,T,P,D,k,F,_,R,O,I,E,N,B,M,L,w,j,H,x,U,V,G,W,J,Q,Y,K,q,X,z,Z,$,ee,te,ae,ie,ne,oe,se,le,ue,ce,de,pe,he){var me,fe=this;this.searchAirportsFetcher=e,this.searchAirlinesFetcher=r,this.storageService=i,this.userService=n,this.modalService=o,this.router=l,this.helpers=u,this.hotelAvalibilityService=c,this.citiesFetcher=d,this.confermaCitiesFetcher=p,this.postcodeFetcher=h,this.railStationFetcher=m,this.saveUserAddressUpdater=f,this.userAddressesFetcher=v,this.basketService=b,this.getUserCompanyOfficesFetcher=y,this.searchHotelChainsFetcher=g,this.getConfermaRoomImagesFetcher=S,this.baseValidateIsPostcodeValidTester=A,this.depotFetcher=C,this.confermaOfficeNamesFetcher=T,this.confermaOfficeFetcher=P,this.baseDeleteUserAddressUpdater=D,this.baseDeleteRecentSearchUpdater=k,this.baseSaveRecentSearchUpdater=F,this.getUserCurrentCarbonAllowanceFetcher=_,this.baseSaveFavouriteSearchUpdater=R,this.getRailStationFetcher=U,this.getIrlSupplierStationFetcher=V,this.riskAlertsFetcher=W,this.getUserRecentSearchesFetcher=Q,this.getRailCardsFetcher=Y,this.getCovidMicrositeTokenFetcher=K,this.searchUsersCanBookForFetcher=X,this.searchIrlStationsFetcher=z,this.irlDiscountCardsFetcher=Z,this.getFlightFareRulesFetcher=$,this.getFlightSeatMapFetcher=ee,this.getRailLiveDeparturesFetcher=te,this.getUserFavouriteSearchesFetcher=ne,this.deleteFavouriteSearchUpdater=oe,this.emailBasketFetcher=se,this.sendOfflineNotificationFetcher=ue,this.getHotelChainsFetcher=ce,this.getRailProvidersFetcher=de,this.getAllAirlinesFetcher=pe,this.getCarHireProvidersFetcher=he,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=ra,this.eurostations=s.default.toArray(aa),console.log("Enterpise search service being inited"),this.searches=((me={})[re.Lounge]=new ct(I,u,b,i,this),me[re.Parking]=new mt(E,u,b,i,this),me[re.Flight]=new nt(B,u,n,b,i,this,ie,o),me[re.Hotel]=new ut(M,u,n,O,c,b,i,this,N,J,U,ae),me[re.Car]=new Qe(L,w,u,b,i,this),me[re.Cab]=new Je(j,u,i,this,b),me[re.InternationalRail]=new Ft(x,Z,u,b,i,this,V),me[re.FastTrack]=new ia(le,u,b,i,this),me[re.Coach]=null,me[re.Rail]=new Tt(H,U,u,b,i,this,n,o),me[re.Eurostar]=new yt(q,u,n,b,i,this,o),me),console.log("Newly created search objects: ",this.searches),this.search_objects=this.helpers.clone(this.init_search_objects()),this.selectedTravellers=this.storageService.getSessionItemAsList(a.SESSION_TRAVELLER),this.travellerInformation.next(this.selectedTravellers),n.fullUserDetails.userServices.subscribe((function(e){e&&(fe.search_objects=Object.keys(fe.search_objects).reduce((function(t,r){return t[r].enabled=!!e&&!!e[r],t}),fe.search_objects))})),Array.isArray(this.countries)&&(this.countries=this.countries.sort((function(e,t){return e.cName<t.cName?-1:e.cName>t.cName?1:0}))),G.autoLogoutConfig=this.getAutoLogoutConfig()}return a.prototype.ngOnDestroy=function(){this.allSubscription&&this.allSubscription.unsubscribe()},a.prototype.reset=function(){this.resetAllSearchItems(),this.basketService.reset()},a.prototype.resetAllSearchItems=function(){Object.values(this.searches).forEach((function(e){null==e||e.reset()})),this.removeAllTravellers(),this.resetSearchObjects()},a.prototype.getUserCurrentCarbonAllowance=function(e,t){t&&t.next(!0);var a={user:e};return this.getUserCurrentCarbonAllowanceFetcher.fetchList(a).pipe(r.take(1),r.map((function(e){return e})))},a.prototype.getRiskAlerts=function(e,t,a,i){i&&i.next(!0);var n={minLevel:e,maxLevel:t,countryIsoCode:a};return this.riskAlertsFetcher.fetchList(n).pipe(r.take(1),r.map((function(e){return i&&i.next(!1),e})))},a.prototype.getAirportsList=function(e,a,i,n,o,s){var l=this;if(e.length>2){i&&i.next(!0);var u={query:e};return a&&(u.countryCode=a),"boolean"==typeof n&&(u.hasLounge=n),"boolean"==typeof o&&(u.hasParking=o),"boolean"==typeof s&&(u.hasFastTrack=s),this.searchAirportsFetcher.fetchOne(u).pipe(r.take(1),r.map((function(e){if(i&&i.next(!1),e&&e.generalMatches)return l.helpers.clone(e.generalMatches).map((function(e){var t,r,a;return{destination:e.name,gateway:e.iata,terminals:l.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===(a=null==e?void 0:e.locationDetails)||void 0===a?void 0:a.countryCode}}))})))}return t.of([])},a.prototype.getAirlinesList=function(e,a){var i=this;if(e.length>=2){a&&a.next(!0);var n={query:e};return this.searchAirlinesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(e){if(a&&a.next(!1),e&&e.generalMatches)return i.helpers.clone(e.generalMatches).map((function(e){return{code:e.iata,name:e.name}}))})))}return t.of([])},a.prototype.getAirportLocations=function(t,a,i,n,o,s){return this.getAirportsList(t,a,i,n,o,s).pipe(r.map((function(t){return t.map((function(t){return{name:t.destination,type:e.LocationTypes.Airport,airport:t}}))})))},a.prototype.getCityLocations=function(e,t,r,a){if(!(e.length<=2))return a?this.getConfermaCityLocations(e,t,r):this._getCityLocations(e,t,r)},a.prototype._getCityLocations=function(t,a,i){null==i||i.next(!0);var n={query:t};a&&(n.countryCode=a);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==i||i.next(!1),r})))},a.prototype.getConfermaCityLocations=function(t,a,i){null==i||i.next(!0);var n={cityName:t};a&&(n.countryCode=a);return this.confermaCitiesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(t){return null==i||i.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:t.countryCode}})):[]})))},a.prototype.getCarHireDepots=function(e,t,r,a){null==a||a.next(!0);var i={latitude:e,longitude:t};return r&&(i.radius=r),this.depotFetcher.fetchList(i)},a.prototype.getPostcodeList=function(a){return Ur.UK_POSTCODE.test(a)?this.postcodeFetcher.fetchList({postcode:a}).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([])},a.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},a.prototype.getSelectedPlaceById=function(e){return this.selectedPlaces.find((function(t){return t.place_id===e}))},a.prototype.getConfirmaOffices=function(a){if((null==a?void 0:a.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([])},a.prototype.getOfficeLocations=function(a){if(a.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([])},a.prototype.getStationLocations=function(a,i,n){return void 0===n&&(n=!1),a.length>2?(null==i||i.next(!0),this.railStationFetcher.fetchList({query:a,hasTod:n}).pipe(r.take(1),r.map((function(t){return i&&i.next(!1),t?t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name,railstation:t}})):[]})))):t.of([])},a.prototype.searchIrlStationsLocations=function(a,i){return a.length>2?(null==i||i.next(!0),this.searchIrlStationsFetcher.fetchList({query:a}).pipe(r.take(1),r.map((function(t){return i&&i.next(!1),t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name+" ("+t.supplier+")",railstation:t}}))})))):t.of([])},a.prototype.getHotelLocationsList=function(a,i,n){return a.length>2?Ur.UK_POSTCODE.test(a)?this.getPostcodeList(a):((null==n?void 0:n.value)||n.next(!0),t.forkJoin([this.getAirportLocations(a,i,n),this.getCityLocations(a,i,n,this.userService.userHasServiceProvider(re.Hotel,e.ServiceProvider.Confirma)),this.getStationLocations(a,n),this.getConfirmaOffices(a)]).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,A(t)),e}),[])})))):t.of([])},a.prototype.getStationsAndAirportsList=function(e,a,i){return e.length>2?((null==i?void 0:i.value)||i.next(!0),t.forkJoin([this.getAirportLocations(e,a,i),this.getStationLocations(e,i)]).pipe(r.map((function(e){return(null==i?void 0:i.value)&&i.next(!1),e.reduce((function(e,t){return e.push.apply(e,A(t)),e}),[])})))):t.of([])},a.prototype.removeTraveller=function(e){this._removeTraveller(e),this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},a.prototype._removeTraveller=function(e){this.selectedTravellers=this.selectedTravellers.filter((function(t){return!kt.equals(t,e)}))},a.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(a.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},a.prototype.addTraveller=function(e){this.travellerAlreadyAdded(e)||this.currentNoOfTravellersGreaterOrEqualToMax()||(this.selectedTravellers.push(e),this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation())},a.prototype.currentNoOfTravellersGreaterOrEqualToMax=function(){return this.selectedTravellers.length>=this.maxTravellers()},a.prototype.maxTravellers=function(){return this.canUseTravellerProfile()?1:8},a.prototype.travellerAlreadyAdded=function(e){return!!this.selectedTravellers.find((function(t){return kt.equals(t,e)}))},a.prototype.canUseTravellerProfile=function(){return!1},a.prototype.getCurrentNoOfTravellers=function(){return this.selectedTravellers.length},a.prototype.updateTravellerInformation=function(){this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.selectedTravellers),this.travellerInformation.next(A(this.selectedTravellers))},a.prototype.determineHighestSearchPriority=function(){return this.highest_search_priority=this._getHighestSearchPriorityObject().highest},a.prototype.getHighestSearchPriorityObject=function(e){return this._getHighestSearchPriorityObject(e).currentItem},a.prototype._getHighestSearchPriorityObject=function(e){return void 0===e&&(e={}),Object.values(this.search_objects).reduce((function(t,r){var a=t.highest,i=t.currentItem;if(r.chosen&&r.priority<a){if(!e[r.type])return{highest:r.priority,currentItem:r};r.chosen=!1}return{highest:a,currentItem:i}}),{highest:Number.MAX_SAFE_INTEGER,currentItem:null})},a.prototype.getSelectedOptions=function(){var e=this;return Object.keys(this.search_objects).reduce((function(t,r){return e.search_objects[r].chosen&&t.push(r),t}),[])},a.prototype.hasSimpleGuests=function(){return!1},a.prototype.setGetMeThereSearchObjects=function(){console.log("+++ Setting GetMeThere Search Objects +++"),this.search_objects=this.helpers.clone(this.getMeThereSearchObjects())},a.prototype.resetSearchParams=function(){console.log("Reseting Search Params!"),this.search_objects=this.helpers.clone(this.init_search_objects()),this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.search_objects),Object.values(this.searches).forEach((function(e){e.reset()}))},a.prototype.canSearch=function(e){return this.determineHighestSearchPriority(),!!(this.search_objects[e]&&(console.log("can search here"),this.search_objects[e].chosen&&this.hasHighestSearchPriority(this.search_objects[e].priority)))&&(console.log(e+" can be searched"),!0)},a.prototype.hasHighestSearchPriority=function(e){return this.determineHighestSearchPriority(),e<=this.highest_search_priority},a.prototype.getAllErrorMessages=function(){var e=this.travellerValidationMessages;return this.search_objects[re.Lounge].chosen&&this.canSearch(re.Lounge)&&e.push.apply(e,A(this.searches[re.Lounge].validationMessages)),this.search_objects[re.Car].chosen&&this.canSearch(re.Car)&&e.push.apply(e,A(this.searches[re.Car].validationMessages)),this.search_objects[re.Rail].chosen&&this.canSearch(re.Rail)&&e.push.apply(e,A(this.searches[re.Rail].validationMessages)),this.search_objects[re.Parking].chosen&&this.canSearch(re.Parking)&&e.push.apply(e,A(this.searches[re.Parking].validationMessages)),this.search_objects[re.Cab].chosen&&this.canSearch(re.Cab)&&e.push.apply(e,A(this.searches[re.Cab].validationMessages)),this.search_objects[re.Hotel].chosen&&this.canSearch(re.Hotel)&&e.push.apply(e,A(this.searches[re.Hotel].validationMessages)),this.search_objects[re.FastTrack].chosen&&this.canSearch(re.FastTrack)&&e.push.apply(e,A(this.searches[re.FastTrack].validationMessages)),this.errors.next(e),e},a.prototype.travellersContainUser=function(){var e=this;return!!this.selectedTravellers.find((function(t){return t.id===e.userService.getUserId().toString()}))},a.prototype.validateTravellers=function(){switch(this.travellerValidationMessages=[],this.userService.fullUserDetails.userData.value.booker_type){case F.SelfBook:1===this.selectedTravellers.length&&this.travellersContainUser()||this.travellerValidationMessages.push("Current user must be a traveller");break;case F.BookerWithSelf:this.selectedTravellers.length<1&&this.travellersContainUser()||(this.travellerValidationMessages.push("Please add your self."),this.traveller_error=!0);break;case F.Booker:case F.Company:case F.CompanyGroup:case F.Office:case F.Tmc:case F.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},a.prototype.findPaxInTravellers=function(e){return this.selectedTravellers.find((function(t){return e===t.email}))},a.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)},a.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}))},a.prototype.startSearches=function(e){var t,r=this;this.newSearchStarted.next(!0),this.search_loading=!0,(t=this._findSearchObtect())&&(t.chosen=!0),e?(this.router.navigate([e]),this.searches.INTERNATIONAL_RAIL&&this.submitIrlForm()):t&&!this.router.url.includes(t.resultUrl)&&this.router.navigate([t.resultUrl]);try{Promise.all(Object.values(this.searches).map((function(e){return e&&r.search_objects[e.type]&&r.search_objects[e.type].chosen?e.startSearch():Promise.resolve(!1)}))).finally((function(){r.search_loading=!1,r.searchLoadingDone.next(!0)}))}catch(e){console.error(e),this.search_loading=!1,this.searchLoadingDone.next(!0)}},a.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"}])},a.prototype.getAddresses=function(e){return t.of([{House:"Cecil Court",Street:"28-36 Cecil Road",Town:"Hale",PostCode:"WA15 9PB",Country:"UK"}])},a.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}}))})))},a.prototype.deleteUserAddressByID=function(e){return this.baseDeleteUserAddressUpdater.updateOne({id:e})},a.prototype.getHotelChain=function(e,a){if(e.length>2){null==a||a.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==a||a.next(!1),t})))}return t.of([])},a.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}}))})))},a.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()},a.prototype.getAllHotelChains=function(){return this.getHotelChainsFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},a.prototype.getAllRailProviders=function(){return this.getRailProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},a.prototype.getCarHireProivders=function(){return this.getCarHireProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},a.prototype.getAllAirlines=function(){return this.getAllAirlinesFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return e}))})))},a.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)}))})))},a.prototype.getAirportByCode=function(e){return e?this.searchAirportsFetcher.fetchOne({query:e}).pipe(r.take(1),r.map((function(e){return e}))):t.of()},a.prototype.init_search_objects=function(){return{}},a.prototype.getMeThereSearchObjects=function(){return{}},a.prototype.getSelectedtravellers=function(){return this.selectedTravellers},a.prototype.resetSearchObjects=function(){this.search_objects=this.helpers.clone(this.init_search_objects())},a.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},a.prototype.saveUserAddress=function(e){return b(this,void 0,void 0,(function(){return y(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]}}))}))},a.prototype.canBook=function(e){return!!this.userService.canBook(e)},a.prototype.isPostcodeVaild=function(e){return this.baseValidateIsPostcodeValidTester.test({postcode:e})},a.prototype.makeCabHireQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a={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(a,Object.assign.apply(Object,A([{}],t)),["departs"])},a.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,A([{}],e)),["pickup_datetime","dropoff_datetime"])},a.prototype.makeFlightQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a=this.helpers.makeMomentDayTime(),i=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(a,30),o=this.helpers.momentRoundMinutes(i,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:null,departLocation:null,fareType:j.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,A([{}],t)),["outBoundDate","inboundDate"])},a.prototype.makeHotelQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a={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(a,Object.assign.apply(Object,A([{}],t)),["checkin_date","checkout_date"])},a.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,A([{}],e)),["arrivalDatetime"])},a.prototype.makeParkingQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.makeMomentDayTime(),a=this.helpers.makeMomentDayTime(1),i=this.helpers.momentRoundMinutes(r,30),n=this.helpers.momentRoundMinutes(a,30),o={arrivalDatetime:i,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,A([{}],e)),["arrivalDatetime","departDatetime"])},a.prototype.makeRailQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a=this.helpers.momentRoundMinutes(l.default(),30),i={airportExpressStation:null,applyRailcards:!1,carnetTicket:!1,chosenSearchClass:z.All,chosenSearchType:Z.ReturnJourney,disableAutoDiscounts:!1,extraTime:!1,inBoundDateTime:a,isAirportExpress:!1,noOfAdults:0,noOfChildren:0,outboundCriteria:e.RailSearchCriteria.Depart,outBoundDateTime:a,prioritiseByPrice:!1,returnCriteria:e.RailSearchCriteria.Depart,travellingFrom:null,travellingTo:null,via:!1,viaLocation:null,railCards:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,A([{}],t)),["inBoundDateTime","outBoundDateTime"])},a.prototype.makeIrlQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.momentRoundMinutes(l.default(),30),a={supplier:null,countryCode:"",journeyType:V.ReturnJourney,class:null,outboundDepartureDateTime:r,departureLocationId:null,arrivalLocationId:null,adults:0,children:0,returnDepartureDateTime:r,irlDiscountCards:null};return this.helpers.sanatizeReturns(a,Object.assign.apply(Object,A([{}],e)),["returnDepartureDateTime","outboundDepartureDateTime"])},a.prototype.makeEurostarQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a=this.helpers.makeMomentDayTime(),i=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(a,30),o=this.helpers.momentRoundMinutes(i,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:e.EurostarSearchType.return,departLocation:null,fareType:j.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,A([{}],t)),["outBoundDate","inboundDate"])},a.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,A([{}],e)),["arrivalDatetime"])},a.prototype.shouldAddTravellerSubscription=function(){return!1},a.prototype.getAutoLogoutConfig=function(){return{}},a.prototype.shouldFetchAllOffices=function(){return!1},a.prototype.isFlightsGrouped=function(){return!1},a.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"},a.prototype.getUserRecentSearches=function(e,t){null==t||t.next(!0);var a={serviceType:e};return this.getUserRecentSearchesFetcher.fetchList(a).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})))},a.prototype.getUserFavouriteSearches=function(e,t){null==t||t.next(!0);var a={serviceType:e};return this.getUserFavouriteSearchesFetcher.fetchList(a).pipe(r.take(1),r.tap((function(e){null==t||t.next(!1)})))},a.prototype.deleteRecentSearchByID=function(e){return this.baseDeleteRecentSearchUpdater.updateOne({id:e})},a.prototype.deleteFavouriteSearchByID=function(e){return this.deleteFavouriteSearchUpdater.updateOne({id:e})},a.prototype.saveRecentSearch=function(e){e&&this.baseSaveRecentSearchUpdater.updateOne(e).pipe(r.take(1)).subscribe()},a.prototype.getCovidMicrositeToken=function(){return this.getCovidMicrositeTokenFetcher.fetchList()},a.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})))},a.prototype.searchTravellers=function(t,a){var i=this,n=this.userService.getUserBookingType();if(this.traveller_error=!1,n&&n!==F.SelfBook&&n!==F.Traveller&&t.length>=1){var o=t.toLowerCase().match(/([\w])+/g),s={};switch(a){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?i.helpers.clone(e).sort((function(e,t){return e.surname<t.surname?-1:e.surname>t.surname?1:0})):[]})))}},a.prototype.getFlightFareRules=function(e){return this.getFlightFareRulesFetcher.fetchList({flight:e})},a.prototype.getRailLiveDepartures=function(e,t){return this.getRailLiveDeparturesFetcher.fetchList({stationCode:e,departDateTime:t})},a.prototype.getFlightSeatMap=function(e){return this.getFlightSeatMapFetcher.fetchList({flight:e}).pipe(r.map((function(e){if(e)return e.results})))},a.prototype.saveFavouriteSearch=function(e){return this.baseSaveFavouriteSearchUpdater.updateOne(e)},a.prototype.getConfermaRoomImages=function(e){if(e)return this.getConfermaRoomImagesFetcher.fetchList({hotelId:e}).pipe(r.take(1))},a.prototype.emailBasket=function(e){return this.emailBasketFetcher.fetchList({id:e})},a.prototype.submitIrlForm=function(){var e,t,r=this,a=this.userService.getUserEmail(),i=this.searches[re.InternationalRail];if(this.allSubscription.add(this.travellerInformation.subscribe((function(r){t=r.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())||"Not specified",discountCard:"Discount Card "+(t+1),loyaltyCard:"Loyalty Card "+(t+1)}})),e=r[0].email?r[0].email:a}))),this.allSubscription.add(i.results.subscribe((function(e){var t,a;(null===(t=e[0])||void 0===t?void 0:t.jrfreference)&&(r.jrfReference=null===(a=e[0])||void 0===a?void 0:a.jrfreference)}))),this.jrfReference&&t){var n={trainNumber:i.trainNumber||"Any",departureStation:i.travellingFrom.name,destinationStation:i.travellingTo.name,outboundDate:i.outboundDepartureDateTime,inboundDate:i.returnDepartureDateTime,additionalInfo:i.additionalInstructions||"No additional instructions",serviceClass:i.irlClass||"Any",offlineReference:this.jrfReference,notifyEmail:a,onBehalfOf:e,passengers:t};console.log(n),this.sendOfflineNotification(n).subscribe((function(e){e.success?r.modalService.open(d.OfflineRequestDialogComponent,{centered:!0,size:"md"},{jrfReference:r.jrfReference}):r.modalService.open(d.ModalErrorComponent,{centered:!0},{error:"Unable to send offline notification"})}))}},a.prototype.sendOfflineNotification=function(e){return this.sendOfflineNotificationFetcher.fetchOne(e)},a}();oa.SESSION_TRAVELLER="search_travellers";var sa=function(){},la=function(){function t(e,t){this.modalOpenerService=e,this._jwtToken=null,this.timer=null,this.timeoutDuration=3600,this.autoLogoutConfig={},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._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(),this.modalOpenerService.open(d.AutoLogout,this.autoLogoutConfig,{}).then((function(t){t!==e.LogoutEnum.LOGOUT?r._updateTimer():r._jwtToken=null}))):this._updateTimer()},t}(),ua=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 a=r(e.links.segments[0],t.segments);return{seat:r(a.links.seat.toString(),t.seats),wifi:r(a.links.wifi.toString(),t.wifis),power:r(a.links.power.toString(),t.entertainments),entertainment:r(a.links.entertainment.toString(),t.entertainments),fresh_food:r(a.links.fresh_food.toString(),t.fresh_foods),beverage:r(a.links.beverage.toString(),t.beverages),layout:r(a.links.layout.toString(),t.layouts),aircraft:r(a.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,a=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())}]}})),a},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},a=e.included.reduce((function(e,r){return e[t(r.type,r.id)]=r,e}),{}),i=function(e){return a[function(e){return t(e.type,e.id)}(e)]};return e.data.relationships.legs.data.map((function(e){var t=i(e).relationships.leg_fares.data.map(i).filter((function(e){return!!e.relationships.fare.data}));return{brands:t.map((function(e){return i(e.relationships.fare.data)})).map(r),upas:t.map((function(e){return e.relationships.leg_fare_segments.data.map(i)})).map((function(e){return e.map((function(e){return e.relationships.upas.data.map(i).map((function(e){return{id:e.id,details:r(e)}})).reduce((function(e,t){return e[t.id]=t.details,e}),{})}))}))}}))},e}();f([je(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],ua.prototype,"getAmenitiesForFlight",null),f([je(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],ua.prototype,"getUpasForFlight",null);var ca=function(e){function t(t,r){var a=e.call(this,r)||this;return a.query=t,a}return m(t,e),t.prototype.test=function(e){return this.processCall(this.query.fetch(e))},t}(p),da=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}(ca),pa=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}(ca),ha=function(e){function t(t,r){var a=e.call(this,r)||this;return a.query=t,a}return m(t,e),t.prototype.updateOne=function(e){return this.processCall(this.query.mutate(e))},t}(p),ma=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}(ha),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.addItemToBasket},t}(ha),va=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}(ha),ba=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}(ha),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.createBasket},t}(ha),ga=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}(ha),Sa=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}(ha),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.removeItemFromBasket},t}(ha),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.deleteUserAddress},t}(ha),Ta=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}(ha),Pa=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}(ha),Da=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}(ha),ka=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}(ha),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.setBasketItemLeadPassenger},t}(ha),_a=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}(ha),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.setBasketItemMIValue},t}(ha),Oa=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}(ha),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.baseUpdateBasketNotes},t}(ha),Ea=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}(ha),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.setBasketItemPaymentMethod},t}(ha),Ba=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}(ha),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.cancelBooking},t}(ha),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.saveFavouriteSearch},t}(ha),wa=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}(ha),ja=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}(ha),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.editUser},t}(ha);e.AbstractHttpCallService=Xr,e.AddressImpl=Nt,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=Wr,e.BaseAcceptNewPriceUpdater=ma,e.BaseAddItemToBasketUpdater=fa,e.BaseAddUserToBasketItemUpdater=va,e.BaseApplyJitFlightRulesFetcher=jt,e.BaseBookBasketUpdater=ba,e.BaseCabhireQuoteFetcher=Vt,e.BaseCancelBookingUpdater=Ma,e.BaseCarHireAvailabilityDetailFetcher=Gt,e.BaseCarhireQuoteFetcher=Wt,e.BaseConfermaOfficeFetcher=Qt,e.BaseConfermaOfficeNamesFetcher=Jt,e.BaseConfirmMessagesUpdater=Ba,e.BaseCreateBasketUpdater=ya,e.BaseDeleteBasketUpdater=Sa,e.BaseDeleteFavouriteSearchUpdater=wa,e.BaseDeleteRecentSearchUpdater=Ta,e.BaseDeleteUserAddressUpdater=Ca,e.BaseEditUserUpdater=Ha,e.BaseEmailBasketFetcher=Nr,e.BaseEnterpriseBasketService=Yr,e.BaseEnterpriseMyBookingsService=ta,e.BaseEnterpriseSearch=c,e.BaseEnterpriseSearchService=oa,e.BaseEnvironment=Ke,e.BaseEurostarQuoteFetcher=Kt,e.BaseEventMessenager=ze,e.BaseFastTrackQuoteFetcher=Br,e.BaseFlightQuoteFetcher=Xt,e.BaseGetAllAirlinesFetcher=jr,e.BaseGetBasketFetcher=Ut,e.BaseGetCancellationInfoFetcher=xr,e.BaseGetCarHireProvidersFetcher=Hr,e.BaseGetConfermaRoomImagesFetcher=Er,e.BaseGetCovidMicrositeTokenFetcher=zt,e.BaseGetFlightFareRulesFetcher=qt,e.BaseGetFlightSeatMapFetcher=Or,e.BaseGetHotelChainsFetcher=Lr,e.BaseGetIrlSupplierStationFetcher=tr,e.BaseGetMiAutoSugestionFetcher=sr,e.BaseGetRailLiveDeparturesFetcher=$t,e.BaseGetRailProvidersFetcher=wr,e.BaseGetRailStationFetcher=er,e.BaseGetRailcardsFetcher=Zt,e.BaseGetRiskAlertsFetcher=rr,e.BaseGetUserBasketsFetcher=or,e.BaseGetUserCompanyOfficesFetcher=ar,e.BaseGetUserCurrentCarbonAllowanceFetcher=ir,e.BaseGetUserFavouriteSearchesFetcher=Ir,e.BaseGetUserFetcher=kr,e.BaseGetUserRecentSearchesFetcher=nr,e.BaseHelperRoutines=Ve,e.BaseHotelAvalibilityQuoteFetcher=lr,e.BaseHotelAvalibilityService=qr,e.BaseHotelQuoteFetcher=ur,e.BaseHotelRulesFetcher=xt,e.BaseIrlDiscountCardFetcher=cr,e.BaseIrlQuoteFetcher=dr,e.BaseLogonService=$r,e.BaseLoungeQuoteFetcher=pr,e.BaseModalOpenerService=ea,e.BaseNetworkCall=p,e.BaseParkingQuoteFetcher=hr,e.BaseRailQuoteFetcher=mr,e.BaseRemoveItemFromBasketUpdater=Aa,e.BaseRequiresReasonService=Jr,e.BaseRevalidateBasketUpdater=Pa,e.BaseRouteHappyService=ua,e.BaseSaveFavouriteSearchUpdater=La,e.BaseSaveRecentSearchUpdater=Ea,e.BaseSaveUserAddressUpdater=Da,e.BaseSearchAirlinesFetcher=fr,e.BaseSearchAirportsFetcher=vr,e.BaseSearchCityFetcher=br,e.BaseSearchConfermaCityFetcher=yr,e.BaseSearchConfermaQuicklistFetcher=Yt,e.BaseSearchDepotFetcher=gr,e.BaseSearchHotelChainsFetcher=Sr,e.BaseSearchIrlStationsFetcher=Ar,e.BaseSearchPostcodeFetcher=Cr,e.BaseSearchRailStationsFetcher=Tr,e.BaseSearchUsersCanBookForFetcher=Pr,e.BaseSendBasketForApprovalUpdater=ka,e.BaseSendOfflineNotificationFetcher=Mr,e.BaseSetBasketItemLeadPassengerUpdater=Fa,e.BaseSetBasketItemMiGroupUpdater=_a,e.BaseSetBasketItemMiValueUpdater=Ra,e.BaseSetPaymentOptionUpdater=Na,e.BaseSetUserLanguageUpdater=ja,e.BaseStorageService=sa,e.BaseUpdateBasketNoteUpdater=Ia,e.BaseUpdateBasketTitleUpdater=Oa,e.BaseUserAddressesFetcher=Dr,e.BaseUserMessagesFetcher=Fr,e.BaseUserProductsFetcher=_r,e.BaseUserService=Zr,e.BaseUserUiConfigsFetcher=Rr,e.BaseValidateIsPostcodeValidTester=pa,e.BaseValidateMiFreeValueTester=da,e.BaseWebTokenService=la,e.BasemoveBasketItemToBasket=ga,e.BasketInfoMiDetailsImpl=Ce,e.BookableBasket=Me,e.CabHireEnterpriseSearch=Je,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=Qe,e.DEFAULT_FLIGHT_FILTERS=$e,e.DistanceType=Be,e.DocTypes=Ee,e.EurostarEnterpriseSearch=yt,e.FlightEnterpriseSearch=nt,e.Genders=Ne,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=ut,e.HotelFilters=lt,e.IRLEnterpriseSearch=Ft,e.InternalBasket=Qr,e.LimitedCache=we,e.LoginError=Gr,e.LoungesEnterpriseSearch=ct,e.MAX_TRAVELLERS=8,e.ManagementInfoAndIsValid=ve,e.Memorise=je,e.ModalTypes=d,e.PREFERENCE_VALUES=Ie,e.ParkingEnterpriseSearch=mt,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=Bt,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=Tt,e.RegExps=Ur,e.SupplementaryBookingInfoImpl=Lt,e.Suppliers=tt,e.TravellerObject=kt,e.USER_SIGNEDIN="USER_SIGNEDIN",e.USER_SIGNEDOUT=zr,e.UserFavorurite=et,e.UserInfoImpl=Mt,e.ValidatorChecker=ne,e.defaultValidations=ht,e.excludedExpression=Re,e.filtersKeys={chain:"chain",preferred:"preferred",amenitytype:"amenitytype",distanceRange:"distanceRange",extra:"extra",hotelName:"hotelName",priceRange:"priceRange",breakfastType:"breakfastType"},e.includedExpression=_e,e.makeManagamentInfo=Ae,e.maxTravellerWellbeing=4,e.ɵ0=qe,e.ɵh=Ht,e.ɵi=wt,e.ɵj=ha,e.ɵk=ca,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}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function f(e,t,r,a){var i,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n<3?i(o):n>3?i(t,r,o):i(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 b(e,t,r,a){return new(r||(r=Promise))((function(i,n){function o(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((a=a.apply(e,t||[])).next())}))}function y(e,t){var r,a,i,n,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,a=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){o.label=n[1];break}if(6===n[0]&&o.label<i[1]){o.label=i[1],i=n;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(n);break}i[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],a=0}finally{r=i=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],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],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 a,i,n=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(a=n.next()).done;)o.push(a.value)}catch(e){i={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return o}function A(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(S(arguments[t]));return e}Object.create;var C,T,D,P,k,F,_,R,I,O,E,B,N,M,L,w,j,H,x,U,V,G,W,J,Q,Y,K,q,X,z,Z,$,ee,te,re,ae,ie,ne,oe=function(){};!function(e){e.BeforeSearch="BEFORE_SEARCH",e.AfterSearch="AFTER_SEARCH"}(C||(C={})),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"}(k||(k={})),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"}(F||(F={})),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.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"}(O||(O={})),function(e){e.Company="COMPANY",e.Office="OFFICE",e.User="USER"}(E||(E={})),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"}(B||(B={})),(N=e.ɵb||(e.ɵb={})).K="K",N.M="M",(M=e.ɵc||(e.ɵc={})).M="M",M.F="F",(L=e.ɵd||(e.ɵd={})).Passport="PASSPORT",L.Visa="VISA",L.IdCard="ID_CARD",function(e){e.Cancellation="Cancellation",e.Change="Change",e.NoShow="NoShow",e.Upgrade="Upgrade",e.Other="Other"}(w||(w={})),function(e){e.Flexible="Flexible",e.Lowest="Lowest",e.Negotiated="Negotiated",e.NonNegotiated="NonNegotiated",e.Leisure="Leisure",e.RequestFareRules="RequestFareRules",e.SelectAndPro="SelectAndPro"}(j||(j={})),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"}(U||(U={})),function(e){e.ReturnJourney="ReturnJourney",e.SingleJourney="SingleJourney"}(V||(V={})),function(e){e.Renfe="Renfe",e.BeNe="BeNe",e.Ntv="Ntv"}(G||(G={})),function(e){e.Placeholder="placeholder",e.Complete="complete"}(W||(W={})),function(e){e.User="USER",e.Guest="GUEST"}(J||(J={})),function(e){e.Error="ERROR",e.Warn="WARN",e.Info="INFO",e.Http="HTTP",e.Verbose="VERBOSE",e.Debug="DEBUG",e.Silly="SILLY"}(Q||(Q={})),function(e){e.Login="LOGIN",e.SearchForm="SEARCH_FORM",e.Results="RESULTS",e.MiForm="MI_FORM",e.BasketBeforeConfirm="BASKET_BEFORE_CONFIRM",e.Dashboard="DASHBOARD"}(Y||(Y={})),function(e){e.Adult="ADULT",e.Child="CHILD",e.Infant="INFANT"}(K||(K={})),function(e){e.Mobile="MOBILE",e.Landline="LANDLINE",e.Fax="FAX",e.Other="OTHER"}(q||(q={})),(X=e.ɵf||(e.ɵf={})).MealRequest="MEAL_REQUEST",X.SeatingPreference="SEATING_PREFERENCE",X.SpecialNeed="SPECIAL_NEED",X.SeatLocation="SEAT_LOCATION",X.SeatPosition="SEAT_POSITION",X.SeatDirection="SEAT_DIRECTION",function(e){e.Inherited="INHERITED",e.Editable="EDITABLE",e.Visible="VISIBLE",e.Hidden="HIDDEN"}(z||(z={})),function(e){e.All="All",e.First="First",e.Standard="Standard"}(Z||(Z={})),function(e){e.SingleJourney="SingleJourney",e.ReturnJourney="ReturnJourney",e.OpenReturnJourney="OpenReturnJourney"}($||($={})),function(e){e.Origin="Origin",e.Intermediate="Intermediate",e.Destination="Destination",e.Unknown="Unknown"}(ee||(ee={})),function(e){e.RequestStop="RequestStop",e.PickUpOnly="PickUpOnly",e.SetDownOnly="SetDownOnly",e.Normal="Normal",e.Passing="Passing",e.Unknown="Unknown"}(te||(te={})),function(e){e.Low="Low",e.Moderate="Moderate",e.Medium="Medium",e.High="High",e.Extreme="Extreme"}(re||(re={})),function(e){e.Flight="FLIGHT",e.Eurostar="EUROSTAR",e.InternationalRail="INTERNATIONAL_RAIL",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"}(ae||(ae={})),function(e){e.All="ALL",e.Mock="MOCK",e.Lightning="LIGHTNING",e.App="APP"}(ie||(ie={})),function(e){e.FreeText="FREE_TEXT",e.AutoSuggest="AUTO_SUGGEST",e.Dropdown="DROPDOWN",e.Hidden="HIDDEN"}(ne||(ne={}));var se,le,ue,ce,de,pe,he,me,fe,ve,be=function(e){function r(r){var a=e.call(this)||this;return a.isLoading=new t.BehaviorSubject(!1),a.search=function(e){return t.of([])},Object.assign(a,r),a}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,a){r(!t.mandatory||e&&0!==e.length?null:{hasErrors:!0})}))},r}(oe),ye=function(e){function t(t,r){var a,i=this;return(i=e.call(this,t)||this).basketService=r,i.tempValue=i.selectedValues&&(null===(a=i.selectedValues[0])||void 0===a?void 0:a.freeValue)||"",i}return m(t,e),t.prototype.getValue=function(){return this.tempValue},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=this;return new Promise((function(a,i){if(!r.mandatory||t&&0!==t.length||a({hasErrors:!0}),r.valueMask&&t)return r.basketService.validateFreeValeMi(r,t).then((function(e){a(e?null:{hasErrors:!0})}));r.values.length>0?a(r.values.find((function(e){return e.value===t}))?null:{hasErrors:!0}):a(e.prototype.hasErrors.call(r,t))}))},t}(be),ge=function(e){function a(a,i){var n,o=this;return(o=e.call(this,a)||this).basketService=i,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:console.error("No values for AutoSugest field"),o}return m(a,e),a.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},a.prototype.hasErrors=function(e){return b(this,void 0,void 0,(function(){return y(this,(function(t){try{return[2,this.avaliableItems.find((function(t){return t.id===e.id}))?null:{hasErrors:!0}]}catch(e){return[2,null]}return[2]}))}))},a.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=[]}},a.prototype.save=function(e,t,r){var a,i;this.basketService.setMiSelectedValue(e,this,this.selectedValues[0]?null===(i=null===(a=this.selectedValues[0])||void 0===a?void 0:a.value)||void 0===i?void 0:i.id:"",t,r)},a}(be),Se=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}(be),Ae=function(e){function t(t,r){var a,i=this;return(i=e.call(this,t)||this).basketService=r,(null===(a=i.values)||void 0===a?void 0:a.length)>0?i.avaliableItems=i.values:console.error("No values for Dropdown MI field "),i.defaultValue&&!i.selectedValues.length&&(i.value=i.defaultValue.id,i.selectedValues[0].value=i.defaultValue),i}return m(t,e),t.prototype.getValue=function(){return this.selectedValues[0]?this.selectedValues[0].value.id:"__NONE"},t.prototype.hasErrors=function(e){return b(this,void 0,void 0,(function(){return y(this,(function(t){try{return[2,this.avaliableItems.find((function(t){return t.id===e}))?null:{hasErrors:!0}]}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.basketService.setMiSelectedValue(e,this,this.selectedValues[0].value.id||"",t,r)},t}(be),Ce=function(e,t){switch(e.uiPresentation){case ne.FreeText:return new ye(e,t);case ne.AutoSuggest:return new ge(e,t);case ne.Hidden:return new Se(e);case ne.Dropdown:return new Ae(e,t);default:var r=e.uiPresentation;console.log(r)}return null},Te=function(e,t,r){var a=this;this.basketService=t,this.helpers=r,this.isValidObservers=[],this.basketItem=e;var i=e.managementInfo.reduce((function(t,r){if(r.reason&&!e.requiresReason)return t;var i=Ce(r,a.basketService);return a.isValidObservers.push(i),r.perBooking?t.perItem.push(i):t.perUser.push(i),t}),{perItem:[],perUser:[]}),n=i.perItem,o=i.perUser;this.miPerItem=n,this.miPerUser=e.users.reduce((function(e,t){return e[t.id]={managementInfo:a.helpers.clone(o).map((function(e){var t=Ce(e,a.basketService);return a.isValidObservers.push(t),t}))},e}),{}),this.miPerGuest=e.guests.reduce((function(e,t){return e[t.id]={managementInfo:a.helpers.clone(o).map((function(e){var t=Ce(e,a.basketService);return a.isValidObservers.push(t),t}))},e}),{}),this.users=Object.keys(this.miPerUser),this.guests=Object.keys(this.miPerGuest)};(se=e.LogoutEnum||(e.LogoutEnum={}))[se.LOGOUT=0]="LOGOUT",se[se.STAYIN=1]="STAYIN",(le=e.LocationTypes||(e.LocationTypes={})).City="City",le.Office="Office",le.Airport="Airport",le.TrainStation="Train Station",le.Postcode="Postcode",le.Shortlist="Shortlist",(ue=e.BreatfastTypes||(e.BreatfastTypes={})).BreakfastIncluded="BreakfastIncluded",ue.BreakfastNotIncluded="BreakfastNotIncluded",(ce=e.HotelPolicyEnum||(e.HotelPolicyEnum={})).cancellation="cancellation",ce.deposit="deposit",ce.disabledAccess="disabledAccess",ce.general="general",ce.guarantee="guarantee",ce.refundAvailable="refundAvailable",(de=e.BookingStatus||(e.BookingStatus={}))[de.Loading=0]="Loading",de[de.AddingItems=1]="AddingItems",de[de.AddingTravellers=2]="AddingTravellers",de[de.AddingLeadPassenger=3]="AddingLeadPassenger",de[de.Failed=4]="Failed",de[de.Revalidate=5]="Revalidate",de[de.RevalidatingError=6]="RevalidatingError",de[de.ChooseMIGroup=7]="ChooseMIGroup",de[de.ProvideMi=8]="ProvideMi",de[de.SendForApproval=9]="SendForApproval",de[de.AwaitingApproval=10]="AwaitingApproval",de[de.ApprovedPaymentOption=11]="ApprovedPaymentOption",de[de.ApprovedSupplemtal=12]="ApprovedSupplemtal",de[de.ApprovedBook=13]="ApprovedBook",de[de.PartiallyBooked=14]="PartiallyBooked",de[de.Complete=15]="Complete",de[de.Expired=16]="Expired",(pe=e.SchemaFormat||(e.SchemaFormat={})).array="array",pe.datetime="date-time",pe.integer="integer",pe.object="object",pe.select="select",pe.selectQueue="select-queue",pe.string="string",pe.boolean="boolean",pe.countryCode="countryCode",pe.additionalSeatPreference="t_additionalSeatPreference",pe.seatPrefGroups="a_seatPrefGroups",pe.railSeating="railSeating",pe.passport="passport",pe.specialRequests="specialRequests",pe.apis="apis",pe.mandatoryIfEticket="mandatory-if-eticket",pe.mandatoryIfTod="mandatory-if-tod",(e.Widgets||(e.Widgets={})).COUNTRY_CODE="COUNTRY_CODE",(he=e.PreferredFlags||(e.PreferredFlags={}))[he.none=0]="none",he[he.officePreferred=1]="officePreferred",he[he.companyPreferred=2]="companyPreferred",he[he.tmcPreferred=4]="tmcPreferred",he[he.all=7]="all",(me=e.FlightDirectionEnum||(e.FlightDirectionEnum={}))[me.Outbound=1]="Outbound",me[me.Inbound=0]="Inbound",me[me.DualSingleOutbound=2]="DualSingleOutbound",me[me.DualSingleInbound=3]="DualSingleInbound",(fe=e.OBTFlightCabinClass||(e.OBTFlightCabinClass={})).Business="Business",fe.BusinessBranded="BrandedBusiness",fe.EconomyFlexi="EconomyFlexi",fe.EconomyFlexiBranded="BrandedEconomyFlexi",fe.EconomyNoBags="EconomyNoBags",fe.EconomyNoBagsBranded="BrandedEconomyNoBags",fe.EconomyRestricted="EconomyRestricted",fe.EconomyRestrictedBranded="BrandedEconomyRestricted",fe.First="First",fe.FirstBranded="BrandedFirst",fe.PremiumEconomy="PremiumEconomy",fe.PremiumEconomyBranded="BrandedPremiumEconomy",(ve=e.EurostarClassEnum||(e.EurostarClassEnum={})).ANY="Any",ve.BUSINESS_PREMIER="BusinessPremier",ve.STANDARD_PREMIER="StandardPremier",ve.STANDARD="Standard";var De,Pe,ke,Fe="("+["breakfast not included","breakfast is not included","Breakfast isn't included","Does not include breakfast","EXCL","exel Breakfast","Breakfast Costs","no breakfast"].join(")|(")+")",_e="("+["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(")|(")+")",Re="("+["Accessibility","Accessible and Disabled","Accessible","Disabled"].join(")|(")+")",Ie=new RegExp(_e,"i"),Oe=new RegExp(Fe,"i"),Ee=new RegExp(Re,"i");(De=e.SearchHandler||(e.SearchHandler={})).AVAILABILITY="Availability",De.FEMALE_FRIENDLY="SOLO Female Friendly",De.CTM_GREEN_CHOICE="CTM Greener Choice",De.BREAKFAST_INCLUDED="BreakfastIncluded",De.BREAKFAST_NOT_INCLUDED="BreakfastNotIncluded",De.CLIENT="Client",De.AGENCY="Agency",De.ANY="Any",(Pe=e.MenuSlideEnum||(e.MenuSlideEnum={})).IN="in",Pe.OUT="out",Pe.FLAT="flat",(ke=e.RiskLevelRanking||(e.RiskLevelRanking={})).Low="1",ke.Moderate="2",ke.Medium="3",ke.High="4",ke.Extreme="5";var Be;(Be=e.ServiceProvider||(e.ServiceProvider={})).Confirma="Conferma",Be.Evolvi="Evolvi",Be.SabreCarHire="Sabre Car Hire",Be.Lounges="Holiday Extras Lounges",Be.FastTrack="Holiday Extras Fast Track",Be.Parking="Holiday Extras Parking",Be.CMAC="CMAC",Be.FarelogixLFGNDC="Farelogix LFG NDC",Be.BaNdc="BA NDC",Be.EurostarSabre="Eurostar (Sabre)",Be.Trainline="Trainline",(e.WellbeingEnum||(e.WellbeingEnum={})).WELLBEING="/results/wellbeing";var Ne,Me=[{label:"Bland",type:e.ɵf.MealRequest},{label:"Child",type:e.ɵf.MealRequest},{label:"Diabetic",type:e.ɵf.MealRequest},{label:"Fruit Plate",type:e.ɵf.MealRequest},{label:"Gluten Free",type:e.ɵf.MealRequest},{label:"Hindu",type:e.ɵf.MealRequest},{label:"Kosher",type:e.ɵf.MealRequest},{label:"Low Fat/Cholesterol",type:e.ɵf.MealRequest},{label:"Low Sodium",type:e.ɵf.MealRequest},{label:"Muslim",type:e.ɵf.MealRequest},{label:"Non-Lactose",type:e.ɵf.MealRequest},{label:"Raw Vegeterian",type:e.ɵf.MealRequest},{label:"Seafood",type:e.ɵf.MealRequest},{label:"Vegan Vegeterian",type:e.ɵf.MealRequest},{label:"Vegeterian Lacto-Ovo",type:e.ɵf.MealRequest},{label:"Aisle",type:e.ɵf.SeatingPreference},{label:"Window",type:e.ɵf.SeatingPreference},{label:"Bassinet",type:e.ɵf.SpecialNeed},{label:"Bicycle",type:e.ɵf.SpecialNeed},{label:"Blind passenger",type:e.ɵf.SpecialNeed},{label:"Deaf passenger",type:e.ɵf.SpecialNeed},{label:"Meet and assist",type:e.ɵf.SpecialNeed},{label:"Wheelchair, can ascend steps",type:e.ɵf.SpecialNeed},{label:"Wheelchair, can walk to seat",type:e.ɵf.SpecialNeed},{label:"Wheelchair, manual",type:e.ɵf.SpecialNeed},{label:"Wheelchair, must be carried",type:e.ɵf.SpecialNeed},{label:"Wheelchair, with dry battery",type:e.ɵf.SpecialNeed},{label:"Wheelchair, with wet battery",type:e.ɵf.SpecialNeed},{label:"Quiet",type:e.ɵf.SeatLocation},{label:"Business",type:e.ɵf.SeatLocation},{label:"Family",type:e.ɵf.SeatLocation},{label:"Aisle",type:e.ɵf.SeatPosition},{label:"Middle",type:e.ɵf.SeatPosition},{label:"Window",type:e.ɵf.SeatPosition},{label:"Individual",type:e.ɵf.SeatPosition},{label:"Front Facing",type:e.ɵf.SeatDirection},{label:"Back Facing",type:e.ɵf.SeatDirection},{label:"Airline Seat",type:e.ɵf.SeatDirection}],Le=[{label:"Passport",type:e.ɵd.Passport},{label:"Visa",type:e.ɵd.Visa},{label:"IdCard",type:e.ɵd.IdCard}],we=[{label:"F",type:e.ɵc.F},{label:"M",type:e.ɵc.M}],je=[{label:"K",type:e.ɵb.K},{label:"M",type:e.ɵb.M}];(Ne=e.DifferentInvokdedUserReasons||(e.DifferentInvokdedUserReasons={}))[Ne.continue=0]="continue",Ne[Ne.newBasket=1]="newBasket",Ne[Ne.cancel=2]="cancel",Ne[Ne.research=3]="research";var He=function(){function r(r,a){this.basketService=r,this.helpers=a,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;if(t.basketItems.find((function(e){var t;return(null===(t=e.availablePaymentMethods)||void 0===t?void 0:t.length)>0&&!e.selectedPaymentMethod})))return this.workoutState(t,e.BookingStatus.ApprovedPaymentOption);console.log(t.suppInfo);var a=t.suppInfo.find((function(e){return e.hasDetails}));return console.log(a),a&&(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,a){void 0===a&&(a=0),this.isUpdating.next(!0),this.basketService.addTravellers(e.id,t,r,a)},r.prototype.setLeadPassenger=function(e,t,r,a){void 0===a&&(a=0),this.isUpdating.next(!0),this.basketService.setLeadPassenger(e.id,t,r,a)},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){if(this.isUpdating.next(!0),e)return this.basketService.bookBasket(this.id,e)},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===ae.Parking?!(1===e.adults):!(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(e){var t=this;return(e.userPassengerTypes.concat(e.guestPassengerTypes)||[]).reduce((function(r,a,i){var n=t._findUser(e.users,Number(a.id)),o=t._findGuest(e.guests,Number(a.id));switch(a.passengerType){case K.Adult:r.adults.push(n||o);break;case K.Child:r.children.push(n||o);break;case K.Infant:r.infants.push(n||o)}return r}),{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}(),xe=function(e,t){this.key=e,this.value=t,this.next=null,this.pre=null},Ue=function(){function e(e){void 0===e&&(e=10),this.size=e,this.cache={},this.count=0,this.head=new xe("",null);var t=new xe("",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 xe(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 Ve(){return function(e,t,r){var a=new Ue,i=r.value;r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=JSON.stringify(e);return a.hasKey(r)||a.set(r,i.apply(this,e)),a.get(r)}}}var Ge,We,Je,Qe=["GS","AIG","GRP","GU3","GU4","GUC","MPG","2TR","SGU"],Ye=function(){function t(){}return t.prototype.isGroupTicket=function(e){return Qe.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 a=[],i=0;i<t-e;i++)for(var n=0;n<60;n+=r)a.push(l.default({hour:i,minute:n}).format("HH:mm"));return a},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 a=t.split(":");2===a.length?r.set("hours",Number(a[0])).set("minutes",Number(a[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(),a=0;r&&a<e.length;a+=1)r=r[e[a]];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 a=r.line.slice(0,t).lastIndexOf(",");a>0?(r.residue=r.line.slice(a+1).trim(),r.line=r.line.slice(0,a).trim()):(a=r.line.slice(0,t).lastIndexOf(" "))>0?(r.residue=r.line.slice(a+1).trim(),r.line=r.line.slice(0,a)):(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 a=e[Symbol.iterator](),i=[],n=[],o=0,s=function(){var e=a.next();if(!e.done){var r=o++;return Promise.resolve(t(e.value,r)).then((function(e){return i[r]=e,s()}))}};!r||n.length<=r;){var l=s();if(!l)break;n.push(l)}return Promise.all(n).then((function(){return i}))},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),a=t.match(/.{1,2}/g);return"20"+r[0]+"-"+r[1]+"-"+r[2]+"T"+a[0]+":"+a[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 ae.Hotel:case ae.Cab:return[]}return e.filter((function(e){return e.isChild}))},t.prototype.selectedTravellers=function(e,t){switch(t){case ae.Hotel:case ae.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 ae.Hotel:case ae.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 ae.Flight:return this._isChild(e,16);case ae.Rail:return this._isChild(e,12);case ae.Coach:return this._isChild(e,15);case ae.Lounge:return this._isChild(e,12);case ae.Hotel:case ae.Cab:default:return!1}},t.prototype.isInfant=function(e,t){switch(t){case ae.Flight:case ae.Rail:case ae.Coach:case ae.Lounge:return this._isChild(e,0);case ae.Hotel:case ae.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 ae.Flight:return l.default().add(-15,"years").format(t.MMDDYY_DATE);case ae.Rail:return l.default().add(-11,"years").format(t.MMDDYY_DATE);case ae.Coach:return l.default().add(-14,"years").format(t.MMDDYY_DATE);case ae.Lounge:return l.default().add(-11,"years").format(t.MMDDYY_DATE)}},t.prototype.getDefaultAdultAge=function(e){switch(e){case ae.Flight:return l.default().add(-26,"years").format(t.MMDDYY_DATE);case ae.Rail:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case ae.Coach:return l.default().add(-25,"years").format(t.MMDDYY_DATE);case ae.Lounge:return l.default().add(-22,"years").format(t.MMDDYY_DATE);case ae.Hotel:case ae.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 a=t[0];e[a]=this.setFieldInObject(e[a],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,a){var i=t.reduce((function(e,t){var i=Array.isArray(t)?t.map((function(e){return r.fieldFromObject(a,e)})).join("_"):r.fieldFromObject(a,t);return e&&i?(e.push(i),e):null}),[]);if(a&&i)return r.setFieldInObject(e,i,a)}),{})},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,a){if("_"!==a[0]){var i=e[a],n=t.removeNulls(i);(null!=n&&"null"!==n||Array.isArray(n)&&n.length>0)&&(r[a]=n)}return r}),{}):e:e},t.prototype.getTravellersId=function(e){if(e)return e.reduce((function(e,t,r){return 0===r?[t.id]:A(e,[t.id])}),[])},t.prototype.sanitizeMomentDates=function(e,t){var r,a;void 0===t&&(t=!1);var i=Object.assign({},e);try{for(var n=g(Object.entries(i)),o=n.next();!o.done;o=n.next()){var s=S(o.value,2),u=s[0],c=s[1];l.default.isMoment(c)&&(i[u]=i[u].toISOString())}}catch(e){r={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return t&&(console.log("-- sanitizeMomentDates() called --"),console.log("original query: ",e),console.log("sanitized query: ",i)),i},t.prototype.toStrings=function(e,t){var r=this;return Object.entries(t.properties||{}).reduce((function(a,i){var n=S(i,2),o=n[0],s=n[1],l=r._formatValue(e[o],s,(t.required||[]).includes(o));return null!==l&&(a[o]=l),a}),{})},t.prototype._formatValue=function(e,t,r){switch(t.type){case"integer":var a=Number.parseInt(e,10);return Number.isNaN(a)?r?0:null:a;case"string":var i=e?e.toString():null;return i&&i.length>0?i:r?"":null;case"object":return e?this.toStrings(e,t):r?{}:null;case"array":return e;case"date-time":return e.year&&(e=this.formatIsoDate(this.ngDateToMoment(e))),e;default:return console.warn("+++ unknown schema type "+t.type+" | returning value as is +++"),e}},t.prototype.makeTimeWindow=function(e,t,r){var a=e.clone().add(t,"hour"),i=e.clone().add(r,"hour");return this.formatTime(a)+"-"+this.formatTime(i)},t.prototype.inRange=function(e,t){return e>=t.min&&e<=t.max},t.prototype.makeUsers=function(e){return e.map((function(e){return{id:e.id,passengerType:e.isChild?K.Child:e.isInfant?K.Infant:K.Adult}}))},t.prototype.makeMomentDayTime=function(e,t,r){var a=l.default();return void 0!==e&&a.add(e,"day"),void 0!==t&&a.set("hours",t),void 0!==r&&a.set("minutes",r),a},t.prototype.sanatizeReturns=function(e,t,r){var a=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}),a)},t.prototype.miIsValid=function(e){return 0===e.length||!!e.find((function(e){return e.isValid()}))},t.prototype.isMiValid=function(e,t,r){var a=this,i=Object.values(t||{}),n=Object.values(r||{});return this.miIsValid(e)&&(0===i.length||!!i.find((function(e){return a.miIsValid(e.managementInfo)})))&&(0===n.length||!!n.find((function(e){return a.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 a=s.default.cloneDeep(e),i=[];if(a.length>t){for(;a.length>=t;)i.push(a.splice(0,t));a.length&&r&&i.push(a)}else i=a;return i},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 a=r===e.FlightDirectionEnum.Outbound?t.outboundFlights:t.inboundFlights;return{rules:a.reduce((function(e,t){var r,a,i,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===(a=t.fareConditions)||void 0===a?void 0:a.change)||[]),e.noShow=e.noShow.concat((null===(i=t.fareConditions)||void 0===i?void 0:i.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:a}},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 a={dStart:"",dEnd:"",locationFrom:"",locationTo:"",basketId:"",description:"",serviceType:"",summary:""},i="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 ae.Lounge:a.basketId=e.id,a.dStart=null==c?void 0:c.arrivalDatetime,a.dEnd="",a.summary="Airport Lounge - "+c.name,a.serviceType=d.type.toLowerCase(),a.description=["Lounge: "+c.name+"\r\n","Starts: "+l.default(c.arrivalDatetime).format(i)+"\r\n","Adults: "+o+"\r\n","Children: "+s+"\r\n","Booking Ref: "+u].join("");break;case ae.Cab:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.departs,a.dEnd="",a.summary="Taxi booking - from "+c.fromLocation.address+" to "+c.toLocation.address,a.description=["Pickup Point: "+c.fromLocation.address+"\r\n","Time: "+l.default(c.departs).format(i)+"\r\n","Booking Ref: "+u].join("");break;case ae.Car:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.pickUpDatetime,a.dEnd=null==c?void 0:c.dropOffDatetime,a.summary="Car booking - from "+c.pickUpLocation.address+" to "+c.dropOffLocation.address,a.description=["Pickup Point: "+c.pickUpLocation.address+"\r\n","Time: "+l.default(c.pickUpDatetime).format(i)+"\r\n","Arrival Point: "+c.dropOffLocation.address+"\r\n","Booking Ref: "+u].join(""),a.locationFrom=c.pickUpLocation.address,a.locationTo=c.dropOffLocation.address;break;case ae.Coach:case ae.FastTrack:case ae.Flight:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.outboundFlights[0].dateTimeDeparting,a.dEnd=null==c?void 0:c.outboundFlights[0].dateTimeArriving,a.summary="Flight Booking - From "+c.outboundFlights[0].originAirport+" to "+c.outboundFlights[0].destinationAirport,a.description=["From: "+c.outboundFlights[0].originAirport+"\r\n","Depart: "+l.default(c.outboundFlights[0].dateTimeDeparting).format(i)+"\r\n","To: "+c.outboundFlights[0].destinationAirport+"\r\n","Arrive: "+l.default(c.outboundFlights[0].dateTimeArriving).format(i)+"\r\n","Booking Ref: "+u].join("");break;case ae.Hotel:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.checkIn,a.dEnd=null==c?void 0:c.checkOut,a.summary="Hotel booking - "+c.hotelName,a.description=["Hotel: "+c.hotelName+"\r\n","Arrival: "+l.default(c.checkIn).format(i)+"\r\n","Departure: "+l.default(c.checkOut).format(i)+"\r\n","Booking Ref: "+u].join("");break;case ae.InternationalRail:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.outwardDetail.departureDateTime,a.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,a.locationFrom=c.outwardDetail.departureStationName,a.locationTo=c.outwardDetail.arrivalDateTime,a.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,a.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(i)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(i)+"\r\n","Booking Ref: "+u].join("");break;case ae.Parking:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.arrivalDatetime,a.dEnd=null==c?void 0:c.departDatetime,a.summary="Airport parking - "+c.name,a.description=["Airport Parking: "+c.name+"\r\n","Booking Ref: "+u].join("");break;case ae.Rail:a.basketId=e.id,a.serviceType=d.type.toLowerCase(),a.dStart=null==c?void 0:c.outwardDetail.departureDateTime,a.dEnd=null==c?void 0:c.outwardDetail.arrivalDateTime,a.locationFrom=c.outwardDetail.departureStationName,a.locationTo=c.outwardDetail.arrivalDateTime,a.summary="Train Booking - From "+c.outwardDetail.departureStationName+" to "+c.outwardDetail.arrivalStationName,a.description=["From "+c.outwardDetail.departureStationName+"\r\n","To "+c.outwardDetail.arrivalStationName+"\r\n","Departure "+l.default(c.outwardDetail.departureDateTime).format(i)+"\r\n","Arrival "+l.default(c.outwardDetail.arrivalDateTime).format(i)+"\r\n","Booking Ref: "+u].join("")}t.push(["BEGIN:VEVENT\r\n",a.dStart?"DTSTART:"+l.default(a.dStart).format("YYYYMMDDTHHmmss")+"\r\n":"",a.dEnd?"DTEND:"+l.default(a.dEnd).format("YYYYMMDDTHHmmss")+"\r\n":"",'ORGANIZER;CN="Do not reply to this email":mailto:do_not_reply@sabscorp.com\r\n',a.locationTo&&a.locationFrom?"LOCATION: "+a.locationTo+" to "+a.locationFrom+" \r\n":"","TRANSP:OPAQUE\r\n","SEQUENCE:0\r\n","UID:"+a.serviceType+"_"+r+"_"+a.basketId+"@sabscorp.com\r\n","DTSTAMP:"+l.default().format("YYYYMMDDTHHmmss")+"\r\n","DESCRIPTION:"+a.description+"\r\n","SUMMARY:"+a.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 a=t.inboundFlights?t.inboundFlights.length-1:0,i=a>r?a:r;e.totalStops[i]=e.totalStops[i]||{display:0===i?"Direct":i+" stop"+(1!==i?"s":""),selected:!1,value:i+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,A(o)):0;e.baggage[s]=e.baggage[s]||{selected:!1,display:s+" bag"+(s>1?"s":""),value:s};var u=function(t,r,a,i,n){var o=t&&t[n]?t[n][a]:void 0;void 0!==o&&(e[r][o]=e[r][o]||{value:t[n][a],display:t[n][i],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 p=t&&t.inboundFlights&&t.inboundFlights[0]?l.default(t.inboundFlights[0].dateTimeDeparting).get("hour"):-1;e.returnDepartureTime.min=e.returnDepartureTime.min<p?e.returnDepartureTime.min:p,e.returnDepartureTime.max=e.returnDepartureTime.max>p?e.returnDepartureTime.max:p;var h=l.default(t.outboundFlights[t.outboundFlights.length-1].dateTimeArriving).get("hour");e.returnArrivalTime.min=e.returnArrivalTime.min<h?e.returnArrivalTime.min:h,e.returnArrivalTime.max=e.returnArrivalTime.max>h?e.returnArrivalTime.max:h,(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 a,i;return(r?((a={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,a[H.PremiumBusiness]=e.OBTFlightCabinClass.BusinessBranded,a[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,a[H.Economy]=e.OBTFlightCabinClass.EconomyRestrictedBranded,a[H.PremiumFirst]=e.OBTFlightCabinClass.FirstBranded,a[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestrictedBranded,a[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomyBranded,a[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexiBranded,a[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBagsBranded,a[H.Business]=e.OBTFlightCabinClass.BusinessBranded,a[H.First]=e.OBTFlightCabinClass.FirstBranded,a):((i={})[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,i[H.PremiumBusiness]=e.OBTFlightCabinClass.Business,i[H.LiteEconomy]=e.OBTFlightCabinClass.EconomyRestricted,i[H.Economy]=e.OBTFlightCabinClass.EconomyRestricted,i[H.PremiumFirst]=e.OBTFlightCabinClass.First,i[H.EconomyRestricted]=e.OBTFlightCabinClass.EconomyRestricted,i[H.PremiumEconomy]=e.OBTFlightCabinClass.PremiumEconomy,i[H.EconomyFlexi]=e.OBTFlightCabinClass.EconomyFlexi,i[H.EconomyNoBags]=e.OBTFlightCabinClass.EconomyNoBags,i[H.Business]=e.OBTFlightCabinClass.Business,i[H.First]=e.OBTFlightCabinClass.First,i))[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 Ke(null==t?void 0:t.unavailable)&&(e.unavailable=t.unavailable,e.unavailableMessage=t.unavailableMessage),Ke(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,A([{}],Object.entries(e).map((function(e){var r,a=S(e,2),i=a[0],n=a[1];return(r={})[i]=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,a,i){return t(r,i),Reflect.apply(e,a,i)}}):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 Ke(e){return null!=e}Ye.READ_DATE_FORMAT="dd, D MMM YYYY",Ye.READ_TIME_FORMAT="HH:mm",Ye.DATE_FORMAT="YYMMDD",Ye.GRAPHQL_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm:ss",Ye.ISO_DATA_FORMAT="YYYY-MM-DD",Ye.ISO_DATA_FORMAT_TIME="YYYY-MM-DD HH:mm",Ye.ISO_DATA_FORMAT_NO_HYPHANS="YYYYMMDD",Ye.TIME_FORMAT="HHmm",Ye.TIME_FORMAT_COLON="HH:mm",Ye.MMDDYY_DATE="DDMMYYYY",f([Ve(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",Number)],Ye.prototype,"getTimeDifference",null),f([Ve(),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",String)],Ye.prototype,"dayDifference",null),f([Ve(),v("design:type",Function),v("design:paramtypes",[Object,Number]),v("design:returntype",void 0)],Ye.prototype,"makeFareRules",null),(Ge=e.TaxiFormMode||(e.TaxiFormMode={})).ADDRESS="location",Ge.STATION="station",(We=e.AirportSearchMode||(e.AirportSearchMode={})).PICKUP="Airport Pick Up",We.DROPOFF="Airport drop off",(Je=e.ActionType||(e.ActionType={})).GET="get",Je.SAVE="save",Je.DELETE="delete";var qe,Xe=function(r){function a(i,n,o,s,u){var c=r.call(this,o,n,s)||this;c.cabfetcher=i,c.basketService=u,c.type=ae.Cab,c.airportChange=new t.Subject,c.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}],c.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"}],c.searchTypes=["One-way","Return"],c.airportSearchTypes=["Airport drop off","Airport Pick Up"],c.criteria=["Pick Up Time"],c.mode=e.TaxiFormMode.ADDRESS,c.minSelectDate=l.default(),c.minReturnSelectDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},c._date=null,c.selectedPlaces=[],c._vias=[null,null,null,null],c._searchType=c.searchTypes[0],c._airportSearchType=e.AirportSearchMode.DROPOFF,c._searchCriteria=c.criteria[0],c._outboundDateTime=c.helpers.round(l.default(),l.default.duration(15,"minutes")),c._returnDateTime=c.helpers.round(l.default(),l.default.duration(15,"minutes")),c._flightNumber="",c._terminal=null,c._time=null,c.resultsSessionName=a.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=a.MULTI_STORAGE_SESSION_RESULTS,c.getPassengers=function(){var e=c.adults,t=c.children,r=e+" Adult";return 1!==Number(e)&&(r+="s"),1===Number(t)&&(r+=", "+t+" Child"),Number(t)>1&&(r+=", "+t+" Children"),r};var d=o.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(s.makeCabHireQuery(d.tempParams));try{var p=o.getSessionItem(a.SECONDARY_STORAGE_SESSION_PARAMS);p&&(c.returnDateTime=l.default(p.tempParams.departs),c.searchType=c.searchTypes[1])}catch(e){console.error("+++ Error recovering return data: ",e," +++")}d.tempParams.fromAddress&&(c.fromAddress=d.tempParams.fromAddress),d.tempParams.toAddress&&(c.toAddress=d.tempParams.toAddress),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){c.travellers=e;var t=c.helpers.selectedTravellers(e,ae.Cab);c.tempParams.adults=t.adults.length,c.tempParams.children=t.children.length,c._isValid()}));var h=o.getSessionItemAsList(c.resultsSessionName)||[];c.fullResults=h,c._cheapestResultPrice=c.updateLowestPrice(h),c.results.next(h||[]);var m=o.getSessionItemAsList(c.multiResultsSessionName)||[];return c.fullMultiResults=m,c.multiResults.next(m),c._isValid(),c.outboundVisibility=new t.BehaviorSubject(!1),c.inboundVisibility=new t.BehaviorSubject(!1),c}return m(a,r),Object.defineProperty(a.prototype,"fromLocation",{get:function(){return this._fromLocation},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"toLocation",{get:function(){return this._toLocation},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"searchType",{get:function(){return this._searchType},set:function(e){this._searchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.prototype,"fromLocationType",{get:function(){return this.tempParams.fromLocationType},set:function(e){this.tempParams.fromLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"toLocationType",{get:function(){return this.tempParams.toLocationType},set:function(e){this.tempParams.toLocationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"searchCriteria",{get:function(){return this._searchCriteria},set:function(e){this._searchCriteria=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outboundDateTime",{get:function(){return this._outboundDateTime},set:function(e){this._outboundDateTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"returnDateTime",{get:function(){return this._returnDateTime},set:function(e){this._returnDateTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"airport",{get:function(){return this.tempParams.airport},set:function(e){this.tempParams.airport=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"terminal",{get:function(){return this._terminal},set:function(e){this._terminal=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(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,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"countryCode",{get:function(){return this.tempParams.countryCode},set:function(e){this.tempParams.countryCode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"vias",{get:function(){return this._vias},set:function(e){this._vias=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.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(a.prototype,"vehicleType",{get:function(){return this.tempParams.vehicleType},set:function(e){this.tempParams.vehicleType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.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(a.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(a.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}),a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCabHireQuery());try{this.storageService.removeSessionItem(a.SECONDARY_STORAGE_SESSION_PARAMS)}catch(e){}this._searchType=this.searchTypes[0],this._isValid()},a.prototype.resetParams=function(){this.reset(),this.resetQuery(),this.results.next([]),this.multiResults.next([])},a.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(a.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.isValid.next(0===this.validationMessages.length),this.messages.next(this.validationMessages))},a.prototype._updateDateTime=function(){this._date&&this._time&&(this.departs=this.helpers.ngDateToMoment(this._date,this._time))},a.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(a.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)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ae.Cab,searchArgs:t,travelDate:this.departs.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.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},a.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()},a.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)},a.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)},a.prototype.updateOutboundAddress=function(e,t){this.tempParams.fromAddress=this.getAddressFormat(e,t)},a.prototype.updateInboundAddress=function(e,t){this.tempParams.toAddress=this.getAddressFormat(e,t)},a.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}},a.prototype.matchAddresses=function(){this._toLocation=this.createCabHireLocation(this.tempParams.toAddress),this._fromLocation=this.createCabHireLocation(this.tempParams.fromAddress),this._isValid()},a.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})):r.sort((function(e,t){return e.price-t.price})),this.results.next(r)}},a.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}},a.prototype.getAddressFromPlaceDetails=function(e,t){var r,a,i=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 i=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&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}}return i},a.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},a.prototype.setLocationFromAirport=function(t,r){var a=this.getAddressFromAirportDetails(t,r);this.mode===e.TaxiFormMode.STATION&&(this.airportSearchType===e.AirportSearchMode.PICKUP?this.fromAddress=a:this.toAddress=a)},a.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},a.prototype.setOutboundFormVisibility=function(e){this.outboundVisibility.next(e)},a.prototype.setInboundFormVisibility=function(e){this.inboundVisibility.next(e)},a.prototype.getOutboundFormVisibility=function(){return this.outboundVisibility},a.prototype.getInboundFormVisibility=function(){return this.inboundVisibility},a.prototype.updateFromPreviousSearches=function(e){var t;null===(t=e[ae.Flight])||void 0===t||t.searchQuery},a.prototype.updateSearchFromExpiredBasketItem=function(e){var t,r,a,i,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===(a=u[1])||void 0===a?void 0:a.address,null===(i=u[1])||void 0===i?void 0:i.postcode))}e.users&&e.users.forEach((function(e){n.searchService.addTraveller(e)}))},a.prototype.convertAddressLocation=function(e,t){for(var r=e.split(","),a="",i=r[r.length-2],n=1;n<r.length-2;n++)a+=r[n]+" ";return{Country:e.slice(-2),House:r[0],PostCode:t,Street:a,Town:i}},a.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)||""},a.prototype.addCabHireToBasket=function(t,r){return b(this,void 0,void 0,(function(){var a,i,n,o;return y(this,(function(s){switch(s.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return a=s.sent(),i=null==a?void 0:a.subject.value,n=this.getTermsAndCond(t),i?[4,this.basketService.addToBasket({adults:r.adults,basket:i.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:r.vehicleType,tripDistanceMetres:t.tripDistanceMetres,tripDurationSeconds:t.tripDurationSeconds,termsAndCond:n},price:t.price,currency:t.currency,searchQuery:r,co2PerItem:t.co2PerItem,co2PerPassenger:t.co2PerPassenger,outboundDate:r.departs.format()},a,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(o=s.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,o];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.switchFromAndToLocation=function(){var e=Object.assign({},this.toAddress),t=Object.assign({},this.fromAddress);this.fromAddress=e,this.toAddress=t},a.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})},a.prototype.getTermsAndCond=function(e){var t=l.default(e.departs).format(Ye.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>'}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ae.Cab,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r=this;return y(this,(function(a){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]}))}))},a}(c);Xe.STORAGE_SESSION_PARAMS="search_cab",Xe.SECONDARY_STORAGE_SESSION_PARAMS="secondary_search_cab",Xe.STORAGE_SESSION_RESULTS="results_cab",Xe.MULTI_STORAGE_SESSION_RESULTS="multi_results_cab",(qe=e.SortTypesCar||(e.SortTypesCar={})).price="price",qe.brand="brand",qe.size="size",qe.preferred="preferred",qe.expensive="expensive";var ze=function(a){function i(t,r,n,o,s,u){var c=a.call(this,s,n,u)||this;c.carhirefetcher=t,c.carHireAvailabilityDetailFetcher=r,c.basketService=o,c._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 / Truck",O.PassengerVan]],c._carAirConditionTypes=[["Any","Any",null],["Y","Yes",!0],["N","No",!1]],c._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"}],c._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]],c._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"}],c._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"}],c._location_types=[e.LocationTypes.City,e.LocationTypes.Airport,e.LocationTypes.Postcode],c.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},c.type=ae.Car,c._sorting_options=[{value:0,display:"Cheapest First"},{value:1,display:"Most Expensive First"},{value:2,display:"Preferred First"}],c._minDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},c._minInDate={day:l.default().date(),month:l.default().month()+1,year:l.default().year()},c._pickup_date=null,c._pickup_time=null,c._dropoff_date=null,c._dropoff_time=null,c.resultsSessionName=i.STORAGE_SESSION_RESULTS,c.multiResultsSessionName=i.STORAGE_SESSION_RESULTS;var d=s.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};c.updateTempParams(u.makeCarHireQuery(d.tempParams)),u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(e){c.adults=1,c.children=0,c.travellers=(null==e?void 0:e.slice(0,1))||[],c._isValid()}));var p=s.getSessionItemAsList(c.resultsSessionName)||[];return c.fullResults=n.clone(p||[]),c._cheapestResultPrice=c.updateLowestPrice(p),c.results.next(p),c}return m(i,a),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,"estimatedMileage",{get:function(){return this.tempParams.estimatedMileage},set:function(e){this.tempParams.estimatedMileage=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"pickupTime",{get:function(){return this._pickupTime},set:function(e){this._pickupTime=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dropoffTime",{get:function(){return this._dropoffTime},set:function(e){this._dropoffTime=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"postcodePickupRaw",{get:function(){return this.tempParams.postcodePickupRaw},set:function(e){this.tempParams.postcodePickupRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"postcodeDropoffRaw",{get:function(){return this.tempParams.postcodeDropoffRaw},set:function(e){this.tempParams.postcodeDropoffRaw=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cityPickupDepot",{get:function(){return this.tempParams.cityPickupDepot},set:function(e){this.tempParams.cityPickupDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cityDropoffDepot",{get:function(){return this.tempParams.cityDropoffDepot},set:function(e){this.tempParams.cityDropoffDepot=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"postcodeDropoff",{get:function(){return this.tempParams.postcodeDropoff},set:function(e){this.tempParams.postcodeDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"cityDropoff",{get:function(){return this.tempParams.cityDropoff},set:function(e){this.tempParams.cityDropoff=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minDate",{get:function(){return this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minInDate",{get:function(){return this._minInDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.prototype,"ngbPickupDate",{get:function(){return this._ngbPickupDate},set:function(e){this._ngbPickupDate=e,this._updateNgbPickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ngbDropoffDate",{get:function(){return this._ngbDropoffDate},set:function(e){this._ngbDropoffDate=e,this._updateNgbDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"pickup_date",{get:function(){return this._pickup_date},set:function(e){this._pickup_date=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"pickup_time",{get:function(){return this._pickup_time},set:function(e){this._pickup_time=e,this._updatePickupDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dropoff_date",{get:function(){return this._dropoff_date},set:function(e){this._dropoff_date=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dropoff_time",{get:function(){return this._dropoff_time},set:function(e){this._dropoff_time=e,this._updateDropoffDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"chosenVendor",{get:function(){return this.tempParams.chosenVendor},set:function(e){this.tempParams.chosenVendor=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenDistance",{get:function(){return this.tempParams.chosenDistance},set:function(e){this.tempParams.chosenDistance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carClass",{get:function(){return this.tempParams.carClass},set:function(e){this.tempParams.carClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carType",{get:function(){return this.tempParams.carType},set:function(e){this.tempParams.carType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"transmission",{get:function(){return this.tempParams.transmission},set:function(e){this.tempParams.transmission=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"airCon",{get:function(){return this.tempParams.airCon},set:function(e){this.tempParams.airCon=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locationType",{get:function(){return this.tempParams.locationType},set:function(e){this.tempParams.locationType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"carAirConditionTypes",{get:function(){return this._carAirConditionTypes},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"withinDistance",{get:function(){return this._withinDistance},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carTransmissionCodes",{get:function(){return this._carTransmissionCodes},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carTypeCodes",{get:function(){return this._carTypeCodes},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"vendors",{get:function(){return this._vendors},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sortingOptions",{get:function(){return this._sorting_options},enumerable:!1,configurable:!0}),i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeCarHireQuery()),this.estimatedMileage=null,this._isValid()},i.prototype._isValid=function(){var t,r,a;if(this.doChecks){switch(this.storageService.setSessionItem(i.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===(a=this.dropoff_datetime)||void 0===a?void 0:a.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)}},i.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)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ae.Car,searchArgs:t,travelDate:this.pickup_datetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.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},i.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)},i.prototype.getParamsForCarbyAirport=function(r){var a=this;this.locationType=e.LocationTypes.Airport,t.combineLatest([this.searchService.getAirportByCode(r.pickupCode),this.searchService.getAirportByCode(r.dropoffCode)]).subscribe((function(e){var t,r,i,n,o,s,l,u,c,d,p,h,m=S(e,2),f=m[0],v=m[1];f&&v&&(a.dropoff_location={destination:f.iataMatch.name,gateway:f.iataMatch.iata,terminals:a.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===(i=f.iataMatch)||void 0===i?void 0:i.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},a.pickup_location={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:a.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===(h=null===(p=v.iataMatch)||void 0===p?void 0:p.locationDetails)||void 0===h?void 0:h.countryCode},a.dropoff_country=a.dropoff_location.countryCode,a.pickup_country=a.pickup_location.countryCode,a.searchService.startSearches())}))},i.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()},i.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()},i.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)},i.prototype.getCarClasses=function(){return t.of(this._car_classes)},i.prototype.getLocationTypes=function(){return t.of(this._location_types)},i.prototype.filterResults=function(e,t){var r=this,a=this.helpers.clone(this.fullResults);a=a.filter((function(t){var a=r.getPrice(t);return a>=e.minPrice&&a<=e.maxPrice})),a=this.filterByTransmissionType(e.transmissions,a),a=this.filterByAirconType(e.airConditioning,a),a=this.filterByCarType(e.types,a),a=this.filterByCompany(e.companies,a),a=this.sortResults(t,a),this.results.next(a)},i.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},i.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},i.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},i.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},i.prototype.sortResults=function(e,t){var r=this,a=this.helpers.clone(t||this.results.value);switch(e){case 0:a=a.sort((function(e,t){return r.getPrice(e)-r.getPrice(t)}));break;case 1:a=a.sort((function(e,t){return r.getPrice(t)-r.getPrice(e)}));break;case 2:break;case 3:a=this.sortByBrand(a);break;case 4:a=this.sortBySize(a)}return this.results.next(a),a},i.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},i.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},i.prototype.sortBySize=function(e){var t=this,r=this.helpers.clone(e||this.results.value).sort((function(e,r){var a,i;return a=t.carClassMap[e.displayRecord.vehicle.class.toLowerCase()],i=t.carClassMap[r.displayRecord.vehicle.class.toLowerCase()],a>=0&&i>=0?a-i:-1}));return this.results.next(r),r},i.prototype.sortByBrand=function(e){var t=this.helpers.clone(e||this.results.value).sort((function(e,t){var r=e.identifiers.vendor,a=t.identifiers.vendor;switch(r){case"ZE":r="HE";break;case"ZI":r="AV"}switch(a){case"ZE":a="HE";break;case"ZI":a="AV"}return r<a?-1:r>a?1:0}));return this.results.next(t),t},i.prototype.getPrice=function(e){try{return Number(e.displayRecord.charges[0].amount)}catch(e){}return 0},i.prototype.getMinPrice=function(e){var t=this;return e.reduce((function(e,r){var a=t.getPrice(r);return a<e&&(e=a),e}),Number.MAX_SAFE_INTEGER)},i.prototype.getMaxPrice=function(e){var t=this;return e.reduce((function(e,r){var a=t.getPrice(r);return a>e&&(e=a),e}),Number.MIN_SAFE_INTEGER)},i.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)}))},i.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}},i.prototype.updateFromPreviousSearches=function(t){var r;if(console.log("PREPOPULATING CARHIRE FORM"),null===(r=t[ae.Flight])||void 0===r?void 0:r.searchQuery)try{var a=this.searchService.searches[ae.Flight].outBoundDate.toDate(),i=this.searchService.searches[ae.Flight].inboundDate.toDate();this.locationType=e.LocationTypes.Airport,this.pickup_datetime=this.searchService.searches[ae.Flight].outBoundDate,this.dropoff_datetime=this.searchService.searches[ae.Flight].inboundDate,this.pickup_date={day:a.getUTCDate(),month:a.getUTCMonth()+1,year:a.getUTCFullYear()},this.dropoff_date={day:i.getUTCDate(),month:i.getUTCMonth()+1,year:i.getUTCFullYear()},this.pickup_location=this.searchService.searches[ae.Flight].arriveLocation,this.dropoff_location=this.searchService.searches[ae.Flight].arriveLocation,this.pickup_country=this.searchService.searches[ae.Flight].arriveLocation.countryCode,this.dropoff_country=this.searchService.searches[ae.Flight].arriveLocation.countryCode}catch(e){console.error("Error trying to prepopulate carhire from flight item")}},i.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()}},i.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()}},i.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()}},i.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()}},i.prototype.isOverNight=function(){var e=this.pickup_datetime.date();return this.dropoff_datetime.date()-e>=1},i.prototype.updateLowestPrice=function(e){return e.length?{amount:this.getMinPrice(e),currencyCode:e[0].displayRecord.charges[0].currencyCode}:null},i.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})))},i.prototype.addCarHireToBasket=function(t,r){var a,i;return b(this,void 0,void 0,(function(){var n,o,s,l,u,c,d,p,h,m;return y(this,(function(f){switch(f.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return n=f.sent(),(o=null==n?void 0:n.subject.value)?(s=t.co2PerItem,l=t.co2PerPassenger,u=t.displayRecord,c=t.identifiers,d=t.sourceId,p=parseFloat(null!==(i=null===(a=null==u?void 0:u.charges[0])||void 0===a?void 0:a.amount)&&void 0!==i?i:"0"),h=this.getTermsAndCond(t,r),[4,this.basketService.addToBasket({adults:this.adults,basket:o.id,service:d.toString(),detail:{pickUpDatetime:u.pickup,dropOffDatetime:u.dropoff,pickUpLocation:{iata:this.locationType===e.LocationTypes.Airport?c.locationCode:"",name:u.pickupLocation.name,address:u.pickupLocation.topLine+", "+u.pickupLocation.city,postcode:u.pickupLocation.postCode},dropOffLocation:{iata:this.locationType===e.LocationTypes.Airport?c.dropOffLocation:"",name:u.returnLocation.name,address:u.returnLocation.topLine+", "+u.returnLocation.city,postcode:u.returnLocation.postCode},car:{type:u.vehicle.type,manualTransmission:u.vehicle.transmission.includes(I.Manual)},vendorName:u.vendor.name,identifiers:{dropOffLocation:c.dropOffLocation,locationCode:c.locationCode,locationName:c.locationName,vehType:c.vehType,vendor:c.vendor},termsAndCond:h},price:p,currency:"GBP",searchQuery:r,co2PerItem:s,co2PerPassenger:l,outboundDate:new Date(u.pickup).toISOString()},n,this.searchService,this.travellers,t.requiresReason)]):[3,3];case 2:return(m=f.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,m];case 3:return[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},i.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:""}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ae.Car,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},i}(c);ze.STORAGE_SESSION_PARAMS="carhire_params",ze.STORAGE_SESSION_RESULTS="carhire_results";var Ze,$e=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},et=function(e){},tt={next:et},rt=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]||tt).next(t)},e}();(Ze=e.FlightDisplayTypes||(e.FlightDisplayTypes={}))[Ze.returns=1]="returns",Ze[Ze.dualSingles=2]="dualSingles";var at,it=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:""});(at=e.FlightSearchType||(e.FlightSearchType={})).return="return",at.oneWay="oneWay",at.multiCity="multiCity";var nt=function(e){this.value=e};nt.MaxFlightClass=new nt("MaxFlightClass"),nt.SSO_no_password=new nt("SSO_no_password"),nt.HideFlightCabinClasses=new nt("hideFlightCabinClasses"),nt.AlternativeRailItineraryEnabled=new nt("alternativeRailItineraryEnabled"),nt.riskMinimumLevel=new nt("riskMinimumLevel"),nt.ENABLE_CHATBOT=new nt("enableChatbot");var ot=function(e){this.value=e};ot.non=new ot("non"),ot.EVI=new ot("evi");var st,lt;(st=e.TimeWindow||(e.TimeWindow={})).Anytime="Anytime",st.Depart="Depart By",st.Arrive="Arrive By",(lt=e.FlightSortTypes||(e.FlightSortTypes={})).Cheapest="Cheapest",lt.MostExpensive="Most Expensive",lt.Fastest="Fastest",lt.Preferred="Preferred",lt.LowestEmissions="Lowest Emissions",lt.DepartureTime="Departure Time",lt.ArrivalTime="Arrival Time",lt.Quickest="Quickest",lt.MostDirect="Most Direct";var ut,ct=function(a){function i(r,n,o,s,u,c,d,p){var h,m,f=a.call(this,u,n,c)||this;f.flightfetcher=r,f.userService=o,f.basketService=s,f.applyFlightRules=d,f.modalService=p,f.type=ae.Flight,f.avaliableClasses=new t.BehaviorSubject([]),f.timeCriteriaOptions=new t.BehaviorSubject([]),f.flightOperators=new t.BehaviorSubject([]),f._negotiated=!1,f._nearby_airports=!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=((h={})[e.FlightSortTypes.Cheapest]=function(e,t){return e.total.price-t.total.price},h[e.FlightSortTypes.MostExpensive]=function(e,t){return t.total.price-e.total.price},h[e.FlightSortTypes.Fastest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},h[e.FlightSortTypes.Preferred]=function(e,t){return e.preferred-t.preferred},h[e.FlightSortTypes.LowestEmissions]=function(e,t){return e.co2PerItem-t.co2PerItem},h[e.FlightSortTypes.DepartureTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeDeparting),a=l.default(t.outboundFlights[0].dateTimeDeparting);return r.isBefore(a)?-1:r.isSame(a)?0:1},h[e.FlightSortTypes.ArrivalTime]=function(e,t){var r=l.default(e.outboundFlights[0].dateTimeArriving),a=l.default(t.outboundFlights[0].dateTimeArriving);return r.isBefore(a)?-1:r.isSame(a)?0:1},h[e.FlightSortTypes.Quickest]=function(e,t){return e.outboundTotalDuration+(e.inboundTotalDuration?e.inboundTotalDuration:0)-(t.outboundTotalDuration+(t.inboundTotalDuration?t.inboundTotalDuration:0))},h[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))},h),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:(e.preferred?1:0)-(t.preferred?1: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),a=l.default(t.departDateTime);return r.isBefore(a)?-1:r.isSame(a)?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),a=l.default(t.arrivalDateTime);return r.isBefore(a)?-1:r.isSame(a)?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:j.Flexible,display:"Flexible"},{value:j.Leisure,display:"Leisure"},{value:j.Lowest,display:"Lowest"},{value:j.Negotiated,display:"Negotiated"},{value:j.NonNegotiated,display:"Non-Negotiated"},{value:j.RequestFareRules,display:"Request Fare Rules"},{value:j.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=i.STORAGE_SESSION_RESULTS,f.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,f._showHotelForm=!1,f._hotelSearchRequested=!1,f.filters=new t.BehaviorSubject(it),f.duralSingleFilter=new t.BehaviorSubject(it),f.choosenDisplayType=new t.BehaviorSubject(e.FlightDisplayTypes.returns),f._multiDestination=[];var v=u.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}},b=c.makeFlightQuery(v.tempParams);return f.updateTempParams(b),f._originalUserSearch=v.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){f.travellers=e;var t=f.helpers.selectedTravellers(e,ae.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===j.Negotiated,f}return m(i,a),Object.defineProperty(i.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(i.prototype,"preferredCarriers",{get:function(){return this.tempParams.preferredCarriers},set:function(e){this.tempParams.preferredCarriers=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.prototype,"minDate",{get:function(){return this._minDate=this._minDate||this.helpers.momentToNgDate(l.default()),this._minDate},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"children",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=Number(e),this.updateTravellers()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"queryOriginAiport",{get:function(){return this._originAirport},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"queryDestinationAiport",{get:function(){return this._destinationAirport},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.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(i.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(i.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(i.prototype,"cabinClass",{get:function(){return this.tempParams.cabinClass},set:function(e){this.tempParams.cabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"returnCabinClass",{get:function(){return this.tempParams.returnCabinClass},set:function(e){this.tempParams.returnCabinClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isReturn",{get:function(){return this.tempParams.chosenSearchType===e.FlightSearchType.return},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outTimeCriteria",{get:function(){return this.tempParams.outTimeCriteria},set:function(e){this.tempParams.outTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"inTimeCriteria",{get:function(){return this.tempParams.inTimeCriteria},set:function(e){this.tempParams.inTimeCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxConnections",{get:function(){return this.tempParams.maxConnections},set:function(e){this.tempParams.maxConnections=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"multiDestination",{get:function(){return this.tempParams.multiDestination},set:function(e){this.tempParams.multiDestination=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"showHotelForm",{get:function(){return this._showHotelForm},set:function(e){this._showHotelForm=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hotelSearchRequested",{get:function(){return this._hotelSearchRequested},set:function(e){this._hotelSearchRequested=e},enumerable:!1,configurable:!0}),i.prototype.setMultiDestinationQuery=function(e){var t=this;return this.helpers.clone(e).reduce((function(e,r){var a={};return a.orig=r.orig.gateway,a.dest=r.dest.gateway,a.date=t.helpers.formatIsoDate(r.date),e.push(a),e}),[])},Object.defineProperty(i.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fareTypesValues",{get:function(){return this._fareTypeArray},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fareType",{get:function(){return this.tempParams.fareType},set:function(e){this.tempParams.fareType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"negotiated",{get:function(){return this._negotiated},set:function(e){this._negotiated=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"includeNearbyAirports",{get:function(){return this.tempParams.includeNearbyAirports},set:function(e){this.tempParams.includeNearbyAirports=e},enumerable:!1,configurable:!0}),i.prototype.processResults=function(t){if(!t)return this._grouped=[],this.multi=[],this.resultQuery=null,[];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,it),this.filters.next(this.currentFilters),delete this.resultQuery.withGrouped;var r=t.multi.reduce((function(e,t){return e[0===t.order?"outbound":"inbound"]=t.results.reduce((function(e,t){return e[t.uid]=Object.assign({selected:!1,canSelect:!0},t),e}),e[0===t.order?"outbound":"inbound"]),e}),{outbound:{},inbound:{}}),a=this.helpers.createFlightFilters(Object.values(r.inbound),it);if(this.duralSingleFilter.next(this.helpers.createFlightFilters(Object.values(r.outbound),Object.assign(Object.assign({},it),{arrivalReturnAirport:a.arrivalAirport,depatureReturnAirport:a.depatureAirport,returnArrivalTime:a.arrivalTime,returnDuration:a.duration,returnDepartureTime:a.departureTime}))),t&&this.searchService.isFlightsGrouped()){var i=(t.journeys||[]).reduce((function(e,t){return e[t.uid]=Object.assign({selected:!1,canSelect:!0},t),e}),{}),n=A((t.grouped||[]).reduce(this.makeGroupedObjects(i),[]),(t.grouped||[]).reduce(this.makeGroupedObjects(r.outbound),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleOutbound,t})),(t.grouped||[]).reduce(this.makeGroupedObjects(r.inbound,!0),[]).map((function(t){return t.direction=e.FlightDirectionEnum.DualSingleInbound,t})));return console.log("Processed Grouped data",n),n}return t?[t]:[]},i.prototype.makeGroupedObjects=function(t,r){var a=this;return void 0===r&&(r=!1),function(i,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,preferredMessage:"",outboundFlightNumber:"",operator:"",operatorFull:"",inboundFlightNumber:"",isReturn:!1,minPrice:Number.MAX_SAFE_INTEGER,maxPrice:0,co2PerItem:0,co2PerPassenger:0,gid:n.referenceID},u=n.flights;return Object.keys(u).filter((function(e){return"_"!==e[0]})).forEach((function(e){u[e].length&&u[e].forEach((function(i){var n,o,u,c,d,p,h=t[i];if(h){s||r?a.createGroupedItem(l,h.source,h.outboundFlights,h.outboundTotalDuration,h.inboundFlights,h.inboundTotalDuration,h.co2PerItem,h.co2PerPassenger):a.createGroupedItem(l,h.source,h.inboundFlights,h.inboundTotalDuration,h.outboundFlights,h.outboundTotalDuration,h.co2PerItem,h.co2PerPassenger);var m=a.helpers.FlightCabinClassToBrandedOBTFlightCabinClass(e,!!h.baseFareId&&h.baseFareId!==h.uid),f=Math.floor(h.total.price),v=Math.ceil(h.total.price);l.minPrice=l.minPrice<f?l.minPrice:f,l.maxPrice=l.maxPrice>v?l.maxPrice:v,l.preferred=(null===(n=a._ruleActionSummary.journeyWhenSelected[h.journeyHash])||void 0===n?void 0:n.companyPreferred)||(null===(o=a._ruleActionSummary.whenSelectedAlone[h.journeyHash])||void 0===o?void 0:o.companyPreferred)||!1,l.preferredMessage=(null===(u=a._ruleActionSummary.journeyWhenSelected[h.journeyHash])||void 0===u?void 0:u.companyPreferredMessage)||(null===(c=a._ruleActionSummary.whenSelectedAlone[h.journeyHash])||void 0===c?void 0:c.companyPreferredMessage)||"",(null===(p=null===(d=l.classes[m])||void 0===d?void 0:d.flights)||void 0===p?void 0:p.length)?(l.classes[m].flights.push(h),l.classes[m].minprice=Math.min(l.classes[m].minprice,f),l.classes[m].maxprice=Math.max(l.classes[m].maxprice,v)):l.classes[m]={flights:[h],minprice:f,maxprice:v,currency:h.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}))&&i.push(l),i.filter((function(e){return!!e}))}},i.prototype.createGroupedItem=function(e,t,r,a,i,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=a,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==i?void 0:i.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=i.length,e.inlegs=i,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",i),e.isReturn=!0)},i.prototype.makeSessionResults=function(e){return{results:e,grouped:this._grouped,query:this.resultQuery}},i.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},i.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},i.prototype.resetQuery=function(e){void 0===e&&(e=!0),this.updateTempParams(this.searchService.makeFlightQuery()),e&&this._isValid()},i.prototype.resetParams=function(){this.reset(),this.resetQuery()},i.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(i.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)))},i.prototype.multiCityValidation=function(){var e=!1,t=!1,r=!1;this.tempParams.multiDestination.map((function(a,i){a.orig||(e=!0,i<2&&(t=!0)),a.orig===a.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")},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.flightfetcher.fetchList(e))}return Promise.resolve(!1)},i.prototype.getRecentSearchQuery=function(e){return{serviceType:ae.Flight,searchArgs:e,travelDate:this.outBoundDate.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.startRecentSearch=function(r){var a=this;if(r.searchArgs.outboundDate){var i=r.searchArgs.outboundDepartureTimeWindow?r.searchArgs.outboundDepartureTimeWindow:r.searchArgs.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(r.searchArgs.outboundDate,i)}if(r.searchArgs.returnDate){var n=r.searchArgs.returnDepartureTimeWindow?r.searchArgs.returnDepartureTimeWindow:r.searchArgs.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(r.searchArgs.returnDate,n)}this.fareType=r.searchArgs.fareType,this.maxConnections=r.searchArgs.maxConnections,r.searchArgs.outboundCabinClass&&(this.cabinClass=r.searchArgs.outboundCabinClass[0]),r.searchArgs.returnCabinClass&&(this.returnCabinClass=r.searchArgs.returnCabinClass[0]),this.includeNearbyAirports=!!r.searchArgs.includeNearbyAirports,this.chosenSearchType=r.searchArgs.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,t.combineLatest([this.searchService.getAirportByCode(r.searchArgs.originAirport),this.searchService.getAirportByCode(r.searchArgs.destinationAirport)]).subscribe((function(e){var t,i,n,o,s,l,u,c,d,p,h,m,f=S(e,2),v=f[0],b=f[1];if(v&&b){if(a.departLocation={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:a.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===(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},a.arriveLocation={destination:b.iataMatch.name,gateway:b.iataMatch.iata,terminals:a.searchService.processTerminals(b.iataMatch.terminals),country:null===(c=null===(u=b.iataMatch)||void 0===u?void 0:u.locationDetails)||void 0===c?void 0:c.country,postcode:null===(p=null===(d=b.iataMatch)||void 0===d?void 0:d.locationDetails)||void 0===p?void 0:p.postcode,countryCode:null===(m=null===(h=b.iataMatch)||void 0===h?void 0:h.locationDetails)||void 0===m?void 0:m.countryCode},r.searchArgs.preferredCarriers){var y=[];r.searchArgs.preferredCarriers.map((function(e){a.searchService.getAirlinesList(e).subscribe((function(t){t.map((function(t){t.code===e&&y.push(t)})),a.preferredCarriers=y,a.searchService.startSearches()}))}))}a.searchService.startSearches()}})),this.searchService.startSearches()},i.prototype.makeDepartureTimeWindow=function(t,r,a){return r===e.TimeWindow.Depart?a?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4):null},i.prototype.makeArrivalTimeWindow=function(t,r,a){return r!==e.TimeWindow.Arrive?null:a?this.helpers.makeTimeWindow(t,-2,2):this.helpers.makeTimeWindow(t,0,4)},i.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)},i.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,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,withGrouped:r},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}:{}))},i.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()},i.prototype.updateAvaliableClasses=function(){var e=this.userService.getUserFavoriteObject(nt.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)},i.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},i.prototype.updateFromPreviousSearches=function(e){},i.prototype.updateSearchFromExpiredBasketItem=function(r){var a=this,i=r.searchQuery;if(i.outboundDate){var n=i.outboundDepartureTimeWindow?i.outboundDepartureTimeWindow:i.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(i.outboundDate,n)}if(i.returnDate){var o=i.returnDepartureTimeWindow?i.returnDepartureTimeWindow:i.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(i.returnDate,o)}this.fareType=i.fareType,this.maxConnections=i.maxConnections,i.outboundCabinClass&&(this.cabinClass=i.outboundCabinClass),i.returnCabinClass&&(this.returnCabinClass=i.returnCabinClass),this.includeNearbyAirports=!!i.includeNearbyAirports,this.chosenSearchType=i.returnTrip?e.FlightSearchType.return:e.FlightSearchType.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,t.combineLatest([this.searchService.getAirportByCode(i.originAirport),this.searchService.getAirportByCode(i.destinationAirport)]).subscribe((function(e){var t,r,n,o,s,l,u,c,d,p,h,m,f=S(e,2),v=f[0],b=f[1];if(v&&b&&(a.departLocation={destination:v.iataMatch.name,gateway:v.iataMatch.iata,terminals:a.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},a.arriveLocation={destination:b.iataMatch.name,gateway:b.iataMatch.iata,terminals:a.searchService.processTerminals(b.iataMatch.terminals),country:null===(c=null===(u=b.iataMatch)||void 0===u?void 0:u.locationDetails)||void 0===c?void 0:c.country,postcode:null===(p=null===(d=b.iataMatch)||void 0===d?void 0:d.locationDetails)||void 0===p?void 0:p.postcode,countryCode:null===(m=null===(h=b.iataMatch)||void 0===h?void 0:h.locationDetails)||void 0===m?void 0:m.countryCode},i.preferredCarriers)){var y=i.preferredCarriers,g=[];y.map((function(e){a.searchService.getAirlinesList(e).subscribe((function(t){t.map((function(t){t.code===e&&g.push(t)})),a.preferredCarriers=g}))}))}})),r.users&&r.users.forEach((function(e){a.searchService.addTraveller(e)}))},i.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},i.prototype.isGroupedFlights=function(e){var t;return"FlightGroupedQuoteResult"===(null===(t=e[0])||void 0===t?void 0:t.type)},i.prototype.applyFilters=function(t,r){var a,i,n=this;this.currentFilters=t,this.currentSort=r,0===this.fullResults.length&&this.results.next([]);var o=this.selectedGroupFlight?(null===(a=this.selectedGroupFlight.inboundFlights)||void 0===a||a.length,function(t,r){return function(a){return r===e.FlightDirectionEnum.DualSingleInbound||t.includes(a.uid)}}):function(e,t){return function(e){return!0}},s=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}},u=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))},c=function(e,t){return function(r){var a,i=(a=n.helpers).fromObject.apply(a,A([r],u(t,r).split(".")));return i>=e.min&&i<=e.max}},d=function(e,t){return function(r){var a,i,o=l.default((a=n.helpers).fromObject.apply(a,A([r],u(t,r).split(".")))).get("hour"),s=l.default((i=n.helpers).fromObject.apply(i,A([r],u(t,r).split(".")))).get("minute"),c=Number(o+"."+n.helpers.normaliseMinuteToBase10(s));return c>=e.min&&c<=e.max}},p=function(e){return function(t,r){return t[e]===r}},h=[],m=[],f=[];h.push(d(t.arrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),h.push(d(t.departureTime,"OUTBOUND_DEPARTURE.dateTimeDeparting")),f.push(c(t.returnDuration,"outboundTotalDuration")),h.push(c(t.duration,"outboundTotalDuration")),h.push(c(t.price,"total.price")),h.push(s(t.stops,(function(e,t){return e.outboundFlights.length===t}))),m.push(s(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),f.push(s(t.totalStops,(function(e,t){return e.outboundFlights.length===t}))),h.push(s(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,A(r)):0)===t}))),h.push(s(t.depatureAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),h.push(s(t.arrivalAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[e.outboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),m.push(c(t.duration,"outboundTotalDuration")),m.push(c(t.price,"total.price")),f.push(c(t.price,"total.price")),m.push(d(t.returnArrivalTime,"INBOUND_ARRIVAL.dateTimeArriving")),f.push(d(t.returnArrivalTime,"OUTBOUND_ARRIVAL.dateTimeArriving")),m.push(d(t.returnDepartureTime,"INBOUND_DEPARTURE.dateTimeDeparting")),m.push(c(t.returnDuration,"inboundTotalDuration")),f.push(c(t.returnDuration,"outboundTotalDuration")),m.push(s(t.stops,(function(e,t){return e.inboundFlights.length===t}))),f.push(s(t.stops,(function(e,t){return e.outboundFlights.length===t}))),m.push(s(t.totalStops,(function(e,t){return e.outboundFlights.length+(e.inboundFlights||[]).length===t}))),m.push(s(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,A(r)):0)===t}))),f.push(s(t.baggage,(function(e,t){var r=e.baggageAllowance.map((function(e){return e.qty}));return(r.length?Math.min.apply(Math,A(r)):0)===t}))),m.push(s(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),f.push(s(t.depatureReturnAirport,(function(e,t){var r;return(null===(r=e.outboundFlights[0])||void 0===r?void 0:r.originAirport)===t}))),m.push(s(t.arrivalReturnAirport,(function(e,t){var r;return(null===(r=e.inboundFlights[e.inboundFlights.length-1])||void 0===r?void 0:r.destinationAirport)===t}))),f.push(s(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 v=[];v.push(s(t.classes,p("cabinClass"))),v.push(s(t.airlines,p("marketingCarrier")));var b=[];b.push(s(t.classes,p("cabinClass"))),b.push(s(t.airlines,p("marketingCarrier")));var y=function(e,t){return h.reduce((function(t,r){return t=t&&r(e)}),!0)&&(!e.outboundFlights||!!(e.outboundFlights||[]).find((function(e){return!!v.reduce((function(t,r){return t&&r(e)}),!0)})))},g=function(e){var t;return m.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)})))},C=function(e){var t;return f.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)})))},T=this._ruleActionSummary.dualSingleWhenSelected[null===(i=this.selectedGroupFlight)||void 0===i?void 0:i.journeyHash]||{},D=function(e,t,r){return n.helpers.fieldFromObject(n._ruleActionSummary,["journeyWhenSelected",e.journeyHash,t])||n.helpers.fieldFromObject(n._ruleActionSummary,["whenSelectedAlone",e.journeyHash,t])||n.helpers.fieldFromObject(T,[e.journeyHash,t])||r},P=function(e){var t;return e.selected=e.uid===(null===(t=n.selectedGroupFlight)||void 0===t?void 0:t.uid),e.unavailable=D(e,"unavailable",!1),e.unavailableMessage=D(e,"unavailableMessage",""),e.requiresReason=D(e,"requiresReason",!1),e.requiresReasonMessage=D(e,"requiresReasonMessage",""),e};if(this.isGroupedFlights(this.fullResults)){var k=this._grouped.find((function(e){return e.referenceID===n.selectedGroupId}));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?y:t.direction===e.FlightDirectionEnum.DualSingleInbound?C:g;return t.classes=Object.entries(t.classes).reduce((function(e,a){var i=S(a,2),s=i[0],l=i[1];if(l&&l.flights){var u=l.flights.filter((function(e){return!!e})).filter(o((null==k?void 0:k.flights[n.helpers.OBTFlightCabinClassToFlightCabinClass(s)])||[],t.direction)).filter(r).map(P);u.length>0&&(e[s]=Object.assign(Object.assign({},l),{flights:u}))}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 a=n.helpers.clone(e.journeys);if(t.flightNumber&&(a=a.filter((function(e){var r=e.outboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber})),a=e.inboundFlights.find((function(e){return e.marketingFlightNumber===t.flightNumber}));if(r||a)return e}))),a=a.filter(y),n.isReturn){var i=n.helpers.clone(e.journeys);i=i.filter(g),a=n.mergeOutInBound(a,i)}return a.sort(n._sortItinaryRoutines[r]),{type:"FlightAllQuoteResult",journeys:a}}))))},i.prototype.mergeOutInBound=function(e,t){return Object.values(A(e,t).reduce((function(e,t){var r=t.uid,a=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]])}return r}(t,["uid"]);return e[r]||(e[r]=Object.assign(Object.assign(Object.assign({},e[r]||{}),{uid:r}),a)),e}),[]))},i.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})}}},i.prototype.selectGroupedFlight=function(t,r,a){return b(this,void 0,void 0,(function(){var i,n,o=this;return y(this,(function(s){switch(s.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return i=s.sent(),(n=null==i?void 0:i.subject.value)&&this.originalUserSearch.chosenSearchType===e.FlightSearchType.oneWay&&r===e.FlightDirectionEnum.Outbound?(this.bookSingleFlight(i,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=a,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(i,t,{outboundFlights:A(t.outboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:A(t.inboundFlights.map((function(e,t){return o.makeSchemaFlights(e,"inbound",0,t)}))),journeyType:"roundtrip"},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(i,this.selectedGroupFlight),this.bookSingleFlight(i,t),this.selectedGroupFlight.selected=!1,this.selectedGroupFlight=null,this.applyFilters(this.currentFilters,this.currentSort)),[2]))}}))}))},i.prototype._updateTravelPolicies=function(){var e=this;if(this.selectedGroupFlight&&!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.applyFlightRules.fetchOne({selectedOutboundFlight:this.selectedGroupFlight,availableInboundFlights:t}).pipe(r.take(1)).subscribe((function(t){t&&(e._ruleActionSummary=e.helpers.mergeObjects(e._ruleActionSummary,t),e._applyFilter())}))}},i.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"},t.outboundFlights[0].dateTimeDeparting)},i.prototype.doBooking=function(t,r,a,i,n){return b(this,void 0,void 0,(function(){var o,s,l,u,c,d;return y(this,(function(p){switch(p.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:a,price:u.price,searchQuery:this.resultQuery,service:o.toString(),outboundDate:i},n&&(c.inboundDate=n),[4,this.basketService.addToBasket(c,t,this.searchService,this.travellers,r.requiresReason)];case 1:return(d=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,d]}}))}))},i.prototype.makeSchemaFlights=function(e,t,r,a){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:a}})},i.prototype.addFlightJourneysToBasket=function(t){return b(this,void 0,void 0,(function(){var r,a,i,n,o,s,u,c,d,p;return y(this,(function(h){switch(h.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return r=h.sent(),(null==r?void 0:r.subject.value)?(a=t.sourceId,i=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:A(t.outboundFlights.map((function(e,t){return Object.assign({},e)}))),inboundFlights:A(t.inboundFlights.map((function(e,t){return Object.assign({},e)}))),termsAndCond:c,journeyType:"single"},p={adults:this.adults,basket:r.id,children:this.children,co2PerItem:i,co2PerPassenger:n,currency:o.currency,detail:d,price:o.price,searchQuery:this.resultQuery,service:a.toString(),outboundDate:s.format()},u&&(p.inboundDate=u.format(),d.journeyType="roundtrip"),[2,this.basketService.addToBasket(p,r,this.searchService,this.travellers,t.requiresReason)]):[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]}}))}))},i.prototype.setFlightDisplayType=function(e){this.selectedGroupFlight=null,this.choosenDisplayType.next(e)},i.prototype._applyFilter=function(){this.applyFilters(this.currentFilters,this.currentSort)},i.prototype.openFlightFareRules=function(e,t,r,a){var i=this;(void 0===r&&(r=null),void 0===a&&(a=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:a}):this.searchService.getFlightFareRules(t[0]).subscribe((function(e){i.modalService.open(d.ModalFlightFareComponent,r,{rules:e.results[0],from:t[0].originAirport,to:t[t.length-1].destinationAirport,flight:a})}),(function(e){console.log(e)}))},i.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:""}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ae.Flight,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r,a=this;return y(this,(function(i){switch(i.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 b(a,void 0,void 0,(function(){var t,r,a;return y(this,(function(i){switch(i.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=i.sent(),a=t,[4,this.searchService.getAirportsList(e.dest).toPromise().then((function(t){return t.find((function(t){return t.gateway==e.dest}))}))];case 2:return a.dest=i.sent(),[2,t]}}))}))})))];case 1:return r=i.sent(),this.multiDestination=r,[3,3];case 2:this.searchService.getAirportsList(t.originAirport).subscribe((function(e){a.departLocation=e.find((function(e){return e.gateway==t.originAirport}))})),this.searchService.getAirportsList(t.destinationAirport).subscribe((function(e){a.arriveLocation=e.find((function(e){return e.gateway==t.destinationAirport}))})),i.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]}}))}))},i.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},i}(c);ct.STORAGE_SESSION_PARAMS="search_flight",ct.STORAGE_SESSION_RESULTS="results_flight",(ut=e.URLS||(e.URLS={})).AccessToken="accessToken",ut.LOGOUT_URL="logout",ut.Refresh="refreshToken",ut.CONFERMA_THUMBNAIL_URL="https://ssl.conferma.com/Images/PropertyThumbnails/",ut.CONFIRMA_PHOTO_URL="/confermainfo/Info.aspx?mode=media&key=MICROSSABS&id=",ut.CONFIRMA_INFO_URL="/confermainfo/Info.aspx?mode=hotel&key=MICROSSABS&id=",ut.RECOVER_PASSWORD_URL="password/getResetToken",ut.RESET_PASSWORD="password/resetByToken",ut.BECOME_USER="startUserSupport",ut.END_BECOME_USER="endUserSupport",ut.ADMIN_USER_PANEL="https://admin-staging.ctmlightning.co.uk/user";var dt,pt,ht=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=[]};(dt=e.HotelView||(e.HotelView={})).LIST="list",dt.MAP="map",(pt=e.SortTypesHotel||(e.SortTypesHotel={})).distance="distance",pt.name="name",pt.price="price";var mt=function(a){function i(r,n,o,s,u,c,d,p,h,m,f,v){var b=a.call(this,d,n,p)||this;b.hotelFetcher=r,b.userService=o,b.environment=s,b.avaliabilityService=u,b.basketService=c,b.httpCallService=h,b.quickListFetcher=m,b.getRailStationFetcher=f,b.applyHotelRulesFetcher=v,b.type=ae.Hotel,b.location_types=new t.BehaviorSubject([]),b.offices=new t.BehaviorSubject([]),b.lastActivePage=new t.BehaviorSubject(null),b.jitRulesReceived=new t.BehaviorSubject(!1),b.galleries={},b.occupied=0,b.results_details={chains:new Set,amenities:[],maxDistance:0},b._bookedTravellers=[],b.filterChange=new t.Subject,b.selectItemMapView=new t.Subject,b.display={minprice:Number.NEGATIVE_INFINITY,maxprice:Number.POSITIVE_INFINITY,filters:{breakfastType:[]}},b.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},b.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},b.localFilters=new ht,b.currentView=e.HotelView.LIST,b._max_no_of_rooms=4,b._max_rooms_array=new Array(b._max_no_of_rooms).fill(0),b._max_no_of_occupants=8,b._max_occupant_array=new Array(b._max_no_of_occupants).fill(0),b._distance_list=[1,2,5,10,20,25],b._default_currency=null,b.resultsSessionName=i.STORAGE_SESSION_RESULTS,b.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,b.query={},b.filterResults=function(){b.resultsFilterMethod=function(e){return e.filter((function(e){return b.inPriceRange(e)&&b.inDistanceRange(e)&&b.containsHotelname(e)&&b.hasChain(e)&&b.breakfastTypeFilter(e)}))},b.results.next(b.resultsFilterMethod(b.fullResults))},b.filterLighteningResults=function(){b.resultsFilterMethod=function(e){return e.filter((function(e){return b.inLighteningPriceRange(e)&&b.containsHotelname(e)&&b.hasChain(e)&&b.hasPreferred(e)&&b.breakfastTypeFilter(e)&&b.getExtraFilter(e)&&b.getAmenitiesFilter(e)&&b.accessibleRoomTypeFilter(e)}))},b.results.next(b.resultsFilterMethod(b.fullResults))},b.results_details.chains=new Set;var y=d.getSessionItem(i.STORAGE_SESSION_PARAMS)||{tempParams:{}};b.default_currency=b.tempParams.currency?b.tempParams.currency:b._default_currency,b.updateTempParams(p.makeHotelQuery(y.tempParams)),p.shouldAddTravellerSubscription()&&p.travellerInformation.subscribe((function(e){b.travellers=e;var t=b.helpers.selectedTravellers(e,ae.Hotel);b.tempParams.no_of_occupants=t.adults.length,b.travellers=e,b._isValid()}));var g=d.getSessionItemAsList(b.resultsSessionName)||[];return g.slice(0,b.environment.numberHotelToPreload).forEach((function(e){b.searchService.canBook(ae.Hotel)&&b.avaliabilityService.getAvailabilityForId(b.makeHotelAvalilityObject(e),e)})),g.forEach((function(e){b.results_details.chains.add(e.group)})),b.fullResults=g,b.jitRulesReceived.next(!1),b.results.next(g),b._isValid(),b.userService.changeUser.subscribe((function(t){b.location_types.next([e.LocationTypes.Airport,e.LocationTypes.City,e.LocationTypes.Office,e.LocationTypes.Shortlist,e.LocationTypes.TrainStation]),p.shouldFetchAllOffices()&&b.offices.next([])})),b.localFilters=new ht,b.avaliabilityService.fetching.subscribe((function(e){if(!e){var t=b.avaliabilityService.maxPriceForCurrency("GBP");t>0&&(b.filters.priceRange.max=t,b.localFilters.priceRange.max=t),b._cheapestResultPrice=b.updateLowestPrice(g),b.searchService.canBook(ae.Hotel)&&b._applyTravelRules()}})),b}return m(i,a),Object.defineProperty(i.prototype,"chains",{get:function(){return A(this.results_details.chains)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"amenities",{get:function(){return A(this.results_details.amenities)},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"maxPrice",{get:function(){return Math.ceil(this.filters.priceRange.max)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.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(i.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(i.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(i.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(i.prototype,"default_currency",{get:function(){return this.tempParams.currency},set:function(e){this.tempParams.currency=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this.tempParams.location},set:function(e){this.tempParams.location=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"formatted_location",{get:function(){return this.tempParams.location?this.tempParams.location.destination:"No Location Set"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"distance",{get:function(){return this.tempParams.distance},set:function(e){this.tempParams.distance=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"country",{get:function(){return this.tempParams.country},set:function(e){this.tempParams.country=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"postcode",{get:function(){return this.tempParams.postcode},set:function(e){this.tempParams.postcode=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"trainsStation",{get:function(){return this.tempParams.trainsStation},set:function(e){this.tempParams.trainsStation=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"office",{get:function(){return this.tempParams.office},set:function(e){this.tempParams.office=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"max_rooms_array",{get:function(){return this._max_rooms_array},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_occupant_array",{get:function(){return this._max_occupant_array},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_no_of_rooms",{get:function(){return this._max_no_of_rooms},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"distance_list",{get:function(){return this._distance_list},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.prototype,"filters",{get:function(){return this.localFilters},enumerable:!1,configurable:!0}),i.prototype.processResults=function(e){var t=this;return this.results_details.maxDistance=0,this.results_details.chains=new Set,e.map((function(e,r){return 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),Object.assign({sortedTags:t.sortTags(e.tags),Details:{distance_airport:0,distance_metro:0,distance_rail:0,airport_details:{name:"Not returned"},metro_details:{name:"Not returned"},rail_details:{name:"Not returned"}}},e)}))},i.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}));0!==t.length&&this.applyHotelRulesFetcher.fetchKeyedObject("id",{data:t}).pipe(r.take(1)).subscribe((function(t){var r=e.resultsFilterMethod(e.fullResults).map((function(r){return t[r.id]?e.avaliabilityService.setHotelAvalability(t[r.id]):r}));r.forEach((function(t){t.availableRates?(t.jitRemoveResultRule=!1,e.jitRulesReceived.next(!0)):t.jitRemoveResultRule=!0})),e.results.next(r)}))},i.prototype.makeLocations=function(e){return this.helpers.arrayToObjectArray(e,["distanceType"])},i.prototype.sortTags=function(e){var t=this;return e?A(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})})):[]},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeHotelQuery()),this.localFilters=new ht,this.results_details={chains:new Set,amenities:[],maxDistance:0},this._isValid()},i.prototype._isValid=function(){var t,r,a,n,o,s;if(this.doChecks){switch(this.storageService.setSessionItem(i.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===(a=this.tempParams.location.airport)||void 0===a?void 0:a.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)}},i.prototype.startSearch=function(){if(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)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ae.Hotel,searchArgs:t,travelDate:this.checkin_date.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(t){var r,a=t;switch(a.location_type_select=this.location_type_select,(null===(r=this.location)||void 0===r?void 0:r.name)&&(a.cityName=this.location.name),a.location_type_select){case e.LocationTypes.Office:a.officeName=this.office.name;break;case e.LocationTypes.TrainStation:a.trainsStationDetail=this.trainsStation;break;case e.LocationTypes.Airport:a.airportDetail=this.location.airport}return a},i.prototype.startRecentSearch=function(t){var a=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}};a.location=Object.assign(Object.assign({},t),e.iataMatch),a.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){a.office={id:e.id,name:e.name},a.searchService.startSearches()}));break;case e.LocationTypes.TrainStation:this.getRailStationByCode(t.searchArgs.trainStationCode).subscribe((function(t){a.trainsStation=Object.assign(Object.assign({},t),{type:e.LocationTypes.TrainStation}),a.searchService.startSearches()}));break;case e.LocationTypes.Shortlist:this.country={cCode:t.searchArgs.countryCode,cName:""},this.searchService.startSearches()}},i.prototype.getRailStationByCode=function(e){return e?this.getRailStationFetcher.fetchList({id:null,code:e}).pipe(r.take(1)):t.of()},i.prototype.getSearchQuery=function(e){return void 0===e&&(e=!1),this.buildQuery(e),this.helpers.removeNulls(this.query)},i.prototype.buildQuery=function(t){var r,a,i,n,o,s;void 0===t&&(t=!1);var l=t?this.originalUserSearch:this.tempParams,u={startDate:l.checkin_date.format("YYYY-MM-DD"),endDate:l.checkout_date.format("YYYY-MM-DD"),rooms:l.no_of_rooms,adults:l.no_of_occupants,currency:l.currency?l.currency:null,distance:l.distance,distanceType:e.ɵb.M,maxResults:100};switch(this.getRoomNumber(),l.location_type_select){case e.LocationTypes.Airport:u.iata=l.location.airport.gateway;break;case e.LocationTypes.City:u.countryCode=l.country.cCode,this.location?(u.latitude=l.location.latitude,u.longitude=l.location.longitude):l.postcode&&(u.postOrZipCode=l.postcode.name);break;case e.LocationTypes.TrainStation:(null===(a=null===(r=l.location)||void 0===r?void 0:r.railstation)||void 0===a?void 0:a.stationCode)?u.trainStationCode=l.location.railstation.stationCode:(null===(i=l.trainsStation)||void 0===i?void 0:i.stationCode)&&(u.trainStationCode=l.trainsStation.stationCode);break;case e.LocationTypes.Office:(null===(n=l.location)||void 0===n?void 0:n.id)?u.officeId=+l.location.id:(null===(o=l.office)||void 0===o?void 0:o.id)&&(u.officeId=+l.office.id);break;case e.LocationTypes.Shortlist:u.countryCode=l.country.cCode;break;case e.LocationTypes.Postcode:u.countryCode=l.country.cCode,u.postOrZipCode=l.location.name}l.hotel_name&&(u.hotelName=l.hotel_name),l.hotel_chain&&(u.groupName=null===(s=l.hotel_chain)||void 0===s?void 0:s.name),this.query=u},i.prototype.makeHotelAvalilityObject=function(e){return{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:"GBP"}},i.prototype.resultsHaveTag=function(e){var t=this,r=this.fullResults.filter((function(r){var a=r.tags.filter((function(r){if(r.name)return!!t.convertToOneString(r.name).toLowerCase().includes(t.convertToOneString(e).toLowerCase())}));return!!(a&&a.length>0)}));return!!(r&&r.length>0)},i.prototype.inPriceRange=function(e){var t=this.avaliabilityService.getAvailabilityValue(e);return!!t&&(this.helpers.inRange(t.maxprice,this.filters.priceRange)&&this.helpers.inRange(t.minprice,this.filters.priceRange))},i.prototype.inDistanceRange=function(e){return 0===this.filters.distanceRange.max||this.helpers.inRange(e.location.distance,this.filters.distanceRange)},i.prototype.containsHotelname=function(e){var t=this.filters.hotelName.toLowerCase();return!(t&&t.length>0)||e.name.toLowerCase().includes(t)},i.prototype.inLighteningPriceRange=function(e){var t=this.avaliabilityService.getAvailabilityValue(e);if(t&&0!==Object.keys(t).length){var r,a=0,i=this.helpers.inRange(t.prpn,this.filters.priceRange);return a=(null==t?void 0:t.maxprice)?t.maxprice:null==t?void 0:t.rooms.reduce((function(e,t){return e>t.total?e:t.total}),0),r=this.helpers.inRange(a,this.filters.priceRange),i&&r}return!0},i.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)}))},i.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 a=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_INCLUDED),i=this.filters.breakfastType.includes(e.SearchHandler.BREAKFAST_NOT_INCLUDED);return!!r.rooms.filter((function(e){return a&&i?e:a?e.rateDescription.match(Ie)&&!e.rateDescription.match(Oe):i?!e.rateDescription.match(Ie)||e.rateDescription.match(Oe):void 0})).length},i.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(Ee)||e.roomDescription.match(Ee)||e.roomType.match(Ee)})).length},i.prototype.getHotelObjectValue=function(e){var t=this.avaliabilityService.getAvailabilityForId(this.makeHotelAvalilityObject(e),e);return t||t.value?t.value:null},i.prototype.byMostExpensive=function(){this.sortByPrice(!1)},i.prototype.sortByPrice=function(e,t){var r=this;void 0===e&&(e=!0),void 0===t&&(t=!1);var a=this.fullResults,i=[],n=[];a.map((function(e){var t;(null===(t=r.avaliabilityService.getAvailabilityValue(e))||void 0===t?void 0:t.prpn)?i.push(e):n.push(e)})),i.sort((function(t,a){var i,n,o=null===(i=r.avaliabilityService.getAvailabilityValue(t))||void 0===i?void 0:i.prpn,s=null===(n=r.avaliabilityService.getAvailabilityValue(a))||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=A(i,n);this.results.next(o),t&&(console.log("++ sortByPrice() called ++"),console.log("++ hotel ++",a),console.log("++ hotelsWithPrices ++",i),console.log("++ hotelsWithoutPrices ++",n),console.log("++ sortedHotels ++",o))},i.prototype.sortByName=function(){this.results.next(this.helpers.clone(this.fullResults).sort((function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())})))},i.prototype.sortByDistance=function(){this.results.next(this.helpers.clone(this.fullResults).sort((function(e,t){return Number(e.location.distance)-Number(t.location.distance)})))},i.prototype.byPreferred=function(){var e=this,t=this.results.value||[];try{t=t.sort((function(t,r){return e.preferredToInt(r)-e.preferredToInt(t)}))}catch(e){console.error("+++ Error sorting by preferred: ",e," +++")}this.results.next(t)},i.prototype.preferredToInt=function(e){return(e.preferred.client?1:0)+(e.preferred.consumer?2:0)},i.prototype.intToPreferred=function(e){return{client:1==(1&e),consumer:2==(2&e)}},i.prototype.addFilter=function(e,t){this.localFilters[t].push(e)},i.prototype.removeFilter=function(e,t){var r=this.localFilters;Array.isArray(r[t])&&(r[t]=r[t].filter((function(t){return e!==t})))},i.prototype.resetFilters=function(){this.localFilters.chain=[],this.localFilters.amenitytype=[],this.localFilters.preferred=[],this.localFilters.extra=[],this.localFilters.hotelName="",this.localFilters.breakfastType=[]},i.prototype.updateSearchFromExpiredBasketItem=function(t){var a,i,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===(i=null===(a=t.detail)||void 0===a?void 0:a.hotelAaddress)||void 0===i?void 0:i.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)}))},i.prototype.updateFromPreviousSearches=function(t){var r,a;console.log("PREPOPULATING HOTEL FORM");var i=null===(r=t[ae.Flight])||void 0===r?void 0:r.searchQuery,n=null===(a=t[ae.Rail])||void 0===a?void 0:a.searchQuery;if(i)try{this.location_type_select=e.LocationTypes.Airport,this.checkin_date=this.searchService.searches[ae.Flight].outBoundDate,this.checkout_date=this.searchService.searches[ae.Flight].inboundDate,this.location={name:this.searchService.searches[ae.Flight].arriveLocation.destination,type:"Airport",airport:this.searchService.searches[ae.Flight].arriveLocation}}catch(e){console.error("Error trying to prepopulate hotel from flight item")}else if(n)try{this.location_type_select=e.LocationTypes.TrainStation,this.checkin_date=this.searchService.searches[ae.Rail].outBoundDateTime,this.checkout_date=this.searchService.searches[ae.Rail].inBoundDateTime,this.trainsStation=this.searchService.searches[ae.Rail].travellingTo,this.location=this.searchService.searches[ae.Rail].travellingTo}catch(e){console.error("Error trying to prepopulate hotel from rail item")}},i.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)},i.prototype.getmaxPriceForCurrency=function(e){return this.avaliabilityService.maxPriceForCurrency(e)},i.prototype.getExtraFilter=function(t){var r=this;return this.filters.extra.includes(e.SearchHandler.AVAILABILITY)?!0===t.unavailable:!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},i.prototype.getAmenitiesFilter=function(e){var t=this,r=!0;return this.filters.amenitytype.forEach((function(a){var i=e.tags.filter((function(e){if(e.name)return!!t.convertToOneString(e.name).toLowerCase().includes(t.convertToOneString(a).toLowerCase())}));return r=!!(i&&i.length>0)})),r},i.prototype.convertToOneString=function(e){return e.replace(/[^a-zA-Z]/g,"")},i.prototype.getImages=function(a){var i=this,n=this.environment.hostBaseUrl+e.URLS.CONFIRMA_PHOTO_URL+a.split(",")[0];return this.galleries[a]?t.of(this.galleries[a]):this.httpCallService.get(n,{responseType:"text"}).pipe(r.map((function(e){if(!e)throw Error("Gallery for "+a+" 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 "+a);return i.galleries[a]=r})))},i.prototype.addPaginationPage=function(e){var t="PaginationPageCount";return this.storageService.setSessionItem(t,e),this.storageService.getSessionItem(t)},i.prototype.toggleView=function(){this.currentView===e.HotelView.LIST?this.currentView=e.HotelView.MAP:this.currentView=e.HotelView.LIST},i.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")},i.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}},i.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 a=[],i=0;i<e.length;i++)for(var n=0;n<e[i].Adults;n++)a.push(i+1)},i.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},i.prototype.addHotelRoomToBasket=function(t,r,a,i){return b(this,void 0,void 0,(function(){var i,n,o,l,u,c,d,p,h,m,f=this;return y(this,(function(v){switch(v.label){case 0:return console.log(t),console.log(r),console.log(a),t.unavailable?[2,e.DifferentInvokdedUserReasons.cancel]:(a.startDate=new Date(a.startDate).toISOString(),a.endDate=new Date(a.endDate).toISOString(),delete(i=Object.assign({},a)).adults,(n=[]).push({rateDescription:r.rateDescription,roomDescription:r.roomDescription,roomId:r.roomId,roomType:r.roomType,rateCode:r.rateCode,checkIn:a.startDate,checkOut:a.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,p=s.default.chunk(this.travellers,d),h=t.address,m=this.getTermsAndCond(r,a),[2,c.reduce((function(s,u,c){return b(f,void 0,void 0,(function(){var u;return y(this,(function(f){switch(f.label){case 0:return[4,s];case 1:switch(f.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:h.addressLine1,town:h.addressLine2,county:h.addressLine3,postcode:h.postOrZipCode,countryCode:h.countryCode},hotelDescription:t.group,hotelId:t.id,hotelName:t.name,numberOfRooms:1,rooms:n,termsAndCond:m},price:r.total,currency:r.currencyCode,searchQuery:i,outboundDate:a.startDate},o,this.searchService,p[c]||[],r.requiresReason)];case 2:return(u=f.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,u]}}))}))}),e.DifferentInvokdedUserReasons.continue)]):[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.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}]},i.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 a={name:""+l.default(),serviceType:ae.Hotel,searchArgs:r};return this.searchService.saveFavouriteSearch(a)}},i.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r;return y(this,(function(a){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]}))}))},i}(c);mt.STORAGE_SESSION_PARAMS="search_hotel",mt.STORAGE_SESSION_RESULTS="results_hotel";var ft=function(r){function a(e,i,n,o,s){var u=r.call(this,o,i,s)||this;u.loungefetcher=e,u.basketService=n,u.type=ae.Lounge,u.terminals=new t.BehaviorSubject([]),u._flightNumber=null,u._selectedTerminal="",u.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},u._date=null,u._time=null,u.resultsSessionName=a.STORAGE_SESSION_RESULTS,u.multiResultsSessionName=a.STORAGE_SESSION_RESULTS;var c=o.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};u.updateTempParams(s.makeLoungesQuery(c.tempParams)),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){var t=u.helpers.selectedTravellers(e,ae.Lounge);u.tempParams.adults=t.adults.length,u.tempParams.children=t.children.length,u.travellers=e,u._isValid()}));var d=o.getSessionItemAsList(u.resultsSessionName)||[];return u._cheapestResultPrice=u.updateLowestPrice(d),u.results.next(d||[]),u}return m(a,r),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,"infants",{get:function(){return this.tempParams.infants},set:function(e){this.tempParams.infants=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"flightNumber",{get:function(){return this._flightNumber},set:function(e){this._flightNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.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(a.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(a.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}),a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeLoungesQuery()),this._isValid()},a.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)},a.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(a.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))},a.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()}},a.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)},a.prototype.getRecentSearchQuery=function(e){return{serviceType:ae.Lounge,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.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 a,i,n,o,s,l;r&&(t.locationCode={country:null===(i=null===(a=r.iataMatch)||void 0===a?void 0:a.locationDetails)||void 0===i?void 0:i.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()},a.prototype.sortByPrice=function(e,t){void 0===t&&(t=[]);var r=A(this.fullResults);r.length||(r=t),r=this.sortResultsPrice(r,e),this.results.next(r)},a.prototype.sortResultsPrice=function(e,t){var r=A(e);return r=t?r.sort((function(e,t){return t.price-e.price})):r.sort((function(e,t){return e.price-t.price}))},a.prototype.sortByTerminal=function(e){void 0===e&&(e=[]);var t=A(this.fullResults);t.length||(t=e);this.results.next(t.sort((function(e,t){return-1})))},a.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING LOUNGE FORM"),null===(t=e[ae.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[ae.Flight].outBoundDate.toDate();this.date={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.locationCode=this.searchService.searches[ae.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},a.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,a,i,n,o,s;e&&(t.locationCode={country:null===(a=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(n=null===(i=e.iataMatch)||void 0===i?void 0:i.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)}))},a.prototype.addLoungeToBasket=function(t,r){var a;return b(this,void 0,void 0,(function(){var i,n,o,s;return y(this,(function(l){switch(l.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return i=l.sent(),n=null==i?void 0:i.subject.value,o=this.getTermsAndCond(t),n?[4,this.basketService.addToBasket({adults:r.adults,children:r.children,infants:r.infants,basket:n.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===(a=t.lounge.terminal)||void 0===a?void 0:a.toString(),termsAndCond:o},price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format()},i,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(s=l.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,s];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.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}]},a.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})},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ae.Lounge,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},a.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},a}(c);ft.STORAGE_SESSION_PARAMS="search_lounge",ft.STORAGE_SESSION_RESULTS="results_lounge";var vt,bt,yt={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"},gt=function(r){function a(e,i,n,o,s){var u=r.call(this,o,i,s)||this;u.parkingfetcher=e,u.basketService=n,u.type=ae.Parking,u.terminals=new t.BehaviorSubject([]),u.listViewToggle=new t.BehaviorSubject(null),u.parkingFiltersText={onAirport:"On Airport",meetAndGreet:"Meet and greet",parkAndRide:"Park and ride",parkAndStroll:"Park and stroll",carParkedForYou:"Car parked for you"},u._selectedTerminal="",u.min_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},u.min_return_date={year:l.default().year(),month:l.default().month()+1,day:l.default().date()+1},u.resultsSessionName=a.STORAGE_SESSION_RESULTS,u.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,u._outdate=null,u._outtime=null,u._indate=null,u._intime=null;var c=o.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{}};u.updateTempParams(s.makeParkingQuery(c.tempParams));var d=o.getSessionItemAsList(u.resultsSessionName)||[];return u.results.next(d),u._cheapestResultPrice=u.updateLowestPrice(d),s.shouldAddTravellerSubscription()&&s.travellerInformation.subscribe((function(e){u.travellers=(null==e?void 0:e.slice(0,1))||[],u._isValid()})),u}return m(a,r),Object.defineProperty(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.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(a.prototype,"selectedTerminal",{get:function(){return this._selectedTerminal},set:function(e){this._selectedTerminal=e},enumerable:!1,configurable:!0}),a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeParkingQuery()),this._isValid()},a.prototype._isValid=function(){var e,t,r;this.doChecks&&(this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{location:this._locationCode,travellers:this.travellers,tempParams:this.tempParams}),this.validationMessages=[],this._locationCode&&""!==this._locationCode||this.validationMessages.push(yt.AirportFirst),(null===(e=this.tempParams)||void 0===e?void 0:e.arrivalDatetime.unix())<l.default().unix()&&this.validationMessages.push(yt.InvardJourney),(null===(t=this.tempParams)||void 0===t?void 0:t.departDatetime.unix())<l.default().unix()&&this.validationMessages.push(yt.OutwardJourney),(null===(r=this.tempParams.departDatetime)||void 0===r?void 0:r.isBefore(this.tempParams.arrivalDatetime))&&this.validationMessages.push(yt.DateOverlapped),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(e)),this._startSearch(this.parkingfetcher.fetchList(this.helpers.removeNulls(e)))}return Promise.resolve(!1)},a.prototype.getRecentSearchQuery=function(e){return{serviceType:ae.Parking,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.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,a,i,n,o,s;e&&(t.locationCode={country:null===(a=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(n=null===(i=e.iataMatch)||void 0===i?void 0:i.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()},a.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)},a.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)},a.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,a,i,n,o,s;e&&(t.locationCode={country:null===(a=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(n=null===(i=e.iataMatch)||void 0===i?void 0:i.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)}))},a.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING PARKING FORM"),null===(t=e[ae.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[ae.Flight].outBoundDate.toDate(),a=this.searchService.searches[ae.Flight].inboundDate.toDate();this.outdate={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.indate={day:a.getUTCDate(),month:a.getUTCMonth()+1,year:a.getUTCFullYear()},this.locationCode=this.searchService.searches[ae.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from flight item")}},a.prototype.addParkingToBasket=function(t,r){return b(this,void 0,void 0,(function(){var a,i,n,o;return y(this,(function(s){switch(s.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return a=s.sent(),i=null==a?void 0:a.subject.value,n=this.getTermsAndCond(t),i?[4,this.basketService.addToBasket({adults:1,basket:i.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:n},price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format(),inboundDate:r.departDatetime.format()},a,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(o=s.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,o];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.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}]},a.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})},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t={name:""+l.default(),serviceType:ae.Parking,searchArgs:e};return this.searchService.saveFavouriteSearch(t)}},a.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},a}(c);gt.STORAGE_SESSION_PARAMS="search_parking",gt.STORAGE_SESSION_RESULTS="results_parking",(vt=e.RailDirection||(e.RailDirection={})).Outbound="outbound",vt.Inbound="inbound",(bt=e.EurostarSearchType||(e.EurostarSearchType={})).return="return",bt.oneWay="oneWay";var St,At,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:2359},arrivalTime:{min:0,max:2359},returnDepartureTime:{min:0,max:2359},returnArrivalTime:{min:0,max:2359},flightNumber:""});(St=e.SortTypesEurostar||(e.SortTypesEurostar={})).CheapestFirst="C",St.EarliestFirst="E",St.LatestFirst="L",(At=e.SortMethod||(e.SortMethod={})).sortByPrice="sortByPrice",At.sortByDate="sortByDate";var Tt=function(r){function a(i,n,o,s,u,c,d){var p=r.call(this,u,n,c)||this;p.eurostarFetcher=i,p.basketService=s,p.modalService=d,p.type=ae.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._fareTypeArray=[{value:j.Flexible,display:"Flexible"},{value:j.Leisure,display:"Leisure"},{value:j.Lowest,display:"Lowest"},{value:j.Negotiated,display:"Negotiated"},{value:j.NonNegotiated,display:"Non-Negotiated"},{value:j.RequestFareRules,display:"Request Fare Rules"},{value:j.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(Ct),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 h=u.getSessionItem(a.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}},m=c.makeEurostarQuery(h.tempParams);p.updateTempParams(m),p._originalUserSearch=h.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){p.travellers=e;var t=p.helpers.selectedTravellers(e,ae.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 f=u.getSessionItem(p.resultsSessionName)||{results:[],groupData:{},grouped:[],query:{}};p.fullResults=p.helpers.clone(f.results),p.flightsToGroup=f.groupData||{},p.resultQuery=f.query;p.searchService.isFlightsGrouped();p.results.next(f.results||[]);var v=p.helpers.clone(f.results);return v.length&&p.filters.next(p.helpers.createFlightFilters(v[0].journeys,Ct)),p._isValid(),p.negotiated=p.tempParams.fareType===j.Negotiated,p}return m(a,r),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 a={};return a.orig=r.orig.gateway,a.dest=r.dest.gateway,a.date=t.helpers.formatIsoDate(r.date),e.push(a),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,"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(),delete this.resultQuery.withGrouped,this.filters.next(this.helpers.createFlightFilters(e.journeys,Ct)),e&&this.searchService.isFlightsGrouped()){var r=(e.journeys||[]).reduce((function(e,r,a){if(r.outboundFlights.length){var i=t.formatEurostarResults(r.outboundFlights,r.total,a);i.co2PerPassenger=r.co2PerPassenger,i.co2PerItem=r.co2PerItem,i.sourceId=r.sourceId,i.total=r.total,i.duration=t.minToHour(r.outboundTotalDuration),e.outbound.find((function(e){return e.dateDeparture===i.dateDeparture&&e.cabinClass===i.cabinClass}))||e.outbound.push(i)}if(r.inboundFlights.length){var n=t.formatEurostarResults(r.inboundFlights,r.total,a);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 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){var a=this,i={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},standardFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1},standardPremierFare:{class:null,fare:null,isDisabled:!0,price:NaN,currency:"GBP",selected:!1},requiresReason:!1};return e.forEach((function(e){switch(i.dateArrival=e.dateTimeArriving,i.dateDeparture=e.dateTimeDeparting,i.duration=a.minToHour(e.totalDuration),i.timeArrival=l.default(e.dateTimeArriving).format("HH:mm"),i.timeDeparture=l.default(e.dateTimeDeparting).format("HH:mm"),i.cabinClass=e.cabinClass,i.uid=r,e.cabinClass){case H.EconomyFlexi:case H.EconomyNoBags:case H.EconomyRestricted:case H.Economy:i.standardFare.isDisabled=!1,i.standardFare.fare=e,i.standardFare.price=t.price,i.standardFare.currency=t.currency,i.standardFare.class=e.cabinClass,i.standardFare.selected=!1;break;case"Premium":i.standardPremierFare.isDisabled=!1,i.standardPremierFare.fare=e,i.standardPremierFare.price=t.price,i.standardPremierFare.currency=t.currency,i.standardPremierFare.class=e.cabinClass,i.standardPremierFare.selected=!1;break;case H.Business:i.businessPremierFare.isDisabled=!1,i.businessPremierFare.fare=e,i.businessPremierFare.price=t.price,i.businessPremierFare.currency=t.currency,i.businessPremierFare.class=e.cabinClass,i.businessPremierFare.selected=!1;break;default:console.warn("new class to be implemented: ",e.cabinClass)}})),i},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:ae.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 a=t.searchArgs.returnDepartureTimeWindow?t.searchArgs.returnDepartureTimeWindow:t.searchArgs.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(t.searchArgs.returnDate,a)}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,a){var i=this.helpers.clone(a||this.fullResults);switch(t){case e.SortTypesEurostar.CheapestFirst:i=this.sortByPrice(i,r);break;case e.SortTypesEurostar.EarliestFirst:i=this.sortByDate(i,r);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}this.results.next(i)},a.prototype.sortResultsFlightJourneys=function(t,r,a){void 0===r&&(r=!1);var i=this.helpers.clone(a);switch(t){case e.SortTypesEurostar.CheapestFirst:i=this.sortByPriceFlight(i);break;case e.SortTypesEurostar.EarliestFirst:i=this.sortByDateFlight(i,r);break;case e.SortTypesEurostar.LatestFirst:i=this.sortByDateFlightDecending(i,r);break;default:console.error("+++ Unknown sorting method: "+t+" +++")}return i},a.prototype.sortByPriceFlight=function(e){return e.sort((function(e,t){return Number(e.total.price)-Number(t.total.price)}))},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 a=+e.standardFare.price||+e.standardPremierFare.price||+e.businessPremierFare.price,i=+r.standardFare.price||+r.standardPremierFare.price||+r.businessPremierFare.price;return t?a-i:i-a};return[{outbound:e[0].outbound.sort(r),inbound:e[0].inbound.sort(r)}]},a.prototype.updateSearchFromExpiredBasketItem=function(t){var r=this,a=t.searchQuery;if(a.outboundDate){var i=a.outboundDepartureTimeWindow?a.outboundDepartureTimeWindow:a.outboundArrivalTimeWindow;this.outBoundDate=this.convertRecentSearchDateTime(a.outboundDate,i)}if(a.returnDate){var n=a.returnDepartureTimeWindow?a.returnDepartureTimeWindow:a.returnArrivalTimeWindow;this.inboundDate=this.convertRecentSearchDateTime(a.returnDate,n)}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.EurostarSearchType.return:e.EurostarSearchType.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,a.originAirport&&this.searchService.lookupEurostarStations(a.originAirport).subscribe((function(e){r.departLocation=e[0]})),a.destinationAirport&&this.searchService.lookupEurostarStations(a.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;null===(t=e[ae.Flight])||void 0===t||t.searchQuery},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,a,i=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(a){var i,n,s=l.default((i=t.helpers).fromObject.apply(i,A([a],o(r,a).split(".")))).get("hour"),u=l.default((n=t.helpers).fromObject.apply(n,A([a],o(r,a).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,a="total.price",function(e){var i,n=(i=t.helpers).fromObject.apply(i,A([e],o(a,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(i(e.classes,s("cabinClass")));var p=[];p.push(i(e.classes,s("cabinClass")));for(var h=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!!p.reduce((function(t,r){return t&&r(e)}),!0)})))},f=this.helpers.clone(this.fullResults),v=0;v<f.length;v++){var b=f[v];b.journeys=b.journeys.filter(h),this.isReturn&&(b.journeys=b.journeys.filter(m)),b.journeys=b.journeys}this.results.next(f)},a.prototype.selectGroupedEurostar=function(t,r,a){var i,n,o,s;return b(this,void 0,void 0,(function(){var l,u,c,d,p;return y(this,(function(h){switch(h.label){case 0:return[4,this.basketService.getDefaultBasket()];case 1:return l=h.sent(),(u=null==l?void 0:l.subject.value)&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.oneWay&&a===e.FlightDirectionEnum.Outbound?(this.doBooking(l,t,{outboundFlights:[this.makeSchemaFlights(r.fare,"outbound",0)],inboundFlights:[],journeyType:"single"},t.dateDeparture,null,r.price,t.requiresReason),[2]):(u&&this.originalUserSearch.chosenSearchType===e.EurostarSearchType.return&&(a===e.FlightDirectionEnum.Outbound?(null===(i=this.selectedGroupEurostar)||void 0===i?void 0:i.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,t.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:a},this._selectedEurostarFare={item:r,direction:a},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}})))):a===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,t.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:a},this._selectedEurostarFare={item:r,direction:a},p=t.uid,this.results.next(this.fullResults.map((function(e){return{inbound:e.inbound.filter((function(e){return p===e.uid})),outbound:e.outbound}})))))),[2])}}))}))},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,a,i,n,o,s){return b(this,void 0,void 0,(function(){var l,u,c,d,p,h;return y(this,(function(m){switch(m.label){case 0:return l=r.sourceId,u=r.co2PerItem,c=r.co2PerPassenger,d=r.total,p={adults:this.adults,basket:t.id,children:this.children,co2PerItem:u,co2PerPassenger:c,currency:d.currency,detail:a,price:o,searchQuery:this.resultQuery,service:l.toString(),outboundDate:i},n&&(p.inboundDate=n),[4,this.basketService.addToBasket(p,t,this.searchService,this.travellers,s)];case 1:return(h=m.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h]}}))}))},a.prototype.makeSchemaFlights=function(e,t,r,a){return Object.assign(Object.assign({},e),{journeyInfo:{flightGroup:t,groupIndex:r,segmentIndex:a}})},a.prototype.createGroupedItem=function(e,t,r,a,i,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=a,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==i?void 0:i.length)&&!e.inboundTotalDuration&&(e.inboundTotalDuration=n,e.inlegsCount=i.length,e.inlegs=i,e.inboundFlightNumber=this.helpers.joinFromAttribute("-","operatingFlightNumber",i),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 b(this,void 0,void 0,(function(){var r,a,i,n,o,s,u,c,d,p,h,m=this;return y(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)?(a=t.sourceId,i=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:A(t.outboundFlights.map((function(e,t){return m.makeSchemaFlights(e,"outbound",0,t)}))),inboundFlights:A(t.inboundFlights.map((function(e,t){return m.makeSchemaFlights(e,"inbound",0,t)}))),termsAndCond:c,journeyType:"single"},p={adults:this.adults,basket:r.id,children:this.children,co2PerItem:i,co2PerPassenger:n,currency:o.currency,detail:d,price:o.price,searchQuery:this.resultQuery,service:a.toString(),outboundDate:s.format()},u&&(p.inboundDate=u.format(),d.journeyType="roundtrip"),[4,this.basketService.addToBasket(p,r,this.searchService,this.travellers,t.requiresReason)]):[3,3];case 2:return(h=f.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];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:ae.Eurostar,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.applyFavourite=function(t){return b(this,void 0,void 0,(function(){var r=this;return y(this,(function(a){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=A(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}(c);Tt.STORAGE_SESSION_PARAMS="search_eurostar",Tt.STORAGE_SESSION_RESULTS="results_eurostar";var Dt,Pt,kt=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),a=r[0],i=r[1];return e[a]=e[a]||{total:0,types:{}},e[a].types=Object.entries(i.types).reduce((function(e,t){var r=S(t,2),a=r[0],i=r[1];return e[a]=Math.max(e[a]||0,i),e}),e[a].types),e[a].total=Object.values(e[a].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),a=r[0],i=r[1];return e[a]=i.total,e}),{})},e.prototype.workoutIndexes=function(e){return Object.entries(this.data[e].types).sort((function(e,t){var r=S(e,2),a=r[0],i=(r[1],S(t,2)),n=i[0];i[1];return Number(a.split("_")[1])-Number(n.split("_")[1])})).reduce((function(t,r){for(var a=S(r,2),i=a[0],n=a[1],o=0;o<n;o++)t.push([e,i,o.toString()]);return t}),[])},e}();(Dt=e.RailSearchCriteria||(e.RailSearchCriteria={})).Depart="Depart After",Dt.Arrive="Arrive Before",(Pt=e.RailJourneyFareType||(e.RailJourneyFareType={})).Return="Return",Pt.Single="Single";var Ft,_t=function(a){function i(r,n,o,s,u,c,d,p){var h=a.call(this,u,o,c)||this;h.Railfetcher=r,h.getRailStationFetcher=n,h.basketService=s,h.userService=d,h.modalService=p,h.resultsSessionName=i.STORAGE_SESSION_RESULTS,h.multiResultsSessionName=i.STORAGE_SESSION_RESULTS,h.searchTypes=[{display:"Return",value:$.ReturnJourney},{display:"One-Way",value:$.SingleJourney}],h.classTypes=[{display:"Any",value:Z.All},{display:"Standard",value:Z.Standard},{display:"First",value:Z.First}],h.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"}],h.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"}},h.railCriteria=[e.RailSearchCriteria.Depart,e.RailSearchCriteria.Arrive],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.removePassingPointsFromResults=!0,h.type=ae.Rail,h._bookRailFromLive=!1,h.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}},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}},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}}}),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.maxDate={year:l.default().add("month",6).year(),month:l.default().add("month",6).month(),day:l.default().add("month",6).date()},h.summary={},h._outbound_date=null,h._outbound_time=null,h._return_date=null,h._return_time=null;var m=u.getSessionItem(i.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};return h.updateTempParams(h.searchService.makeRailQuery(m.tempParams)),m.originalUserSearch.transactionIdentifier=null,h._originalUserSearch=m.originalUserSearch,c.shouldAddTravellerSubscription()&&c.travellerInformation.subscribe((function(e){h.travellers=e;var t=h.helpers.selectedTravellers(e,ae.Rail);h.tempParams.noOfAdults=t.adults.length,h.tempParams.noOfChildren=t.children.length,h.travellers=e,h._isValid()})),h._isValid(),h}return m(i,a),Object.defineProperty(i.prototype,"selectedSection",{get:function(){return this._selectedSection},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"transactionIdentifier",{get:function(){return this.tempParams.transactionIdentifier},set:function(e){this.tempParams.transactionIdentifier=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bookRailFromLive",{get:function(){return this._bookRailFromLive},set:function(e){this._bookRailFromLive=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"openReturn",{get:function(){return this.tempParams.chosenSearchType===$.OpenReturnJourney},set:function(e){this.tempParams.chosenSearchType=e?$.OpenReturnJourney:$.ReturnJourney,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchType",{get:function(){return this.tempParams.chosenSearchType},set:function(e){this.tempParams.chosenSearchType=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfAdults",{get:function(){return this.tempParams.noOfAdults},set:function(e){this.tempParams.noOfAdults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noOfChildren",{get:function(){return this.tempParams.noOfChildren},set:function(e){this.tempParams.noOfChildren=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;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(i.prototype,"chosenRailClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chosenSearchClass",{get:function(){return this.tempParams.chosenSearchClass},set:function(e){this.tempParams.chosenSearchClass=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"extraTime",{get:function(){return this.tempParams.extraTime},set:function(e){this.tempParams.extraTime=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"via",{get:function(){return this.tempParams.via},set:function(e){this.tempParams.via=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(i.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(i.prototype,"outboundCriteria",{get:function(){return this.tempParams.outboundCriteria},set:function(e){this.tempParams.outboundCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.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(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,"returnCriteria",{get:function(){return this.tempParams.returnCriteria},set:function(e){this.tempParams.returnCriteria=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"carnetTicket",{get:function(){return this.tempParams.carnetTicket},set:function(e){this.tempParams.carnetTicket=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"disableAutoDiscounts",{get:function(){return this.tempParams.disableAutoDiscounts},set:function(e){this.tempParams.disableAutoDiscounts=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"prioritiseByPrice",{get:function(){return this.tempParams.prioritiseByPrice},set:function(e){this.tempParams.prioritiseByPrice=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"applyRailcards",{get:function(){return this.tempParams.applyRailcards},set:function(e){e||(this.railCards=[]),this.tempParams.applyRailcards=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"railCards",{get:function(){return this.tempParams.railCards},set:function(e){this.tempParams.railCards=e},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}),i.prototype.getAirportExpressStations=function(){return this.airportExpressStations},Object.defineProperty(i.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(i.prototype,"isAirportExpress",{get:function(){return this.tempParams.isAirportExpress},set:function(e){this.tempParams.isAirportExpress=e,this._isValid()},enumerable:!1,configurable:!0}),i.prototype.setAirportExpressStationIds=function(e){var t=e.departureLocationId,r=e.arrivalLocationId;t&&r&&(this._travellingFrom=t,this._travellingTo=r,this._isValid())},i.prototype._findSummary=function(e,t){return t.find((function(t){return t.journeyHash===e.journeyHash}))},i.prototype.updateLowestPrice=function(e){return null},i.prototype.processResults=function(e){var t=this;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})},a=function(e){return t.helpers.clone(e).sort((function(e,t){var r=l.default(e.departDateTime),a=l.default(t.departDateTime);return r.isBefore(a)?-1:r.isAfter(a)?1:0})).map((function(e){var a=function(e,t){return e.price-t.price},i=(e.dualSingleJourneyFares||[]).sort(a).map(r),n=(e.openReturnJourneyFares||[]).sort(a).map(r),o=(e.returnJourneyFares||[]).sort(a).map(r),s=(e.singleJourneyFares||[]).sort(a).map(r),l=i.map(r),u=n.map(r),c=o.map(r),d=s.map(r);return Object.assign(Object.assign({},e),{dualSingleJourneyFares:t.helpers.arrayToObjectArray(l,["type",["terms.ticketTypeCode","price"]]),openReturnJourneyFares:t.helpers.arrayToObjectArray(u,["type",["terms.ticketTypeCode","price"]]),returnJourneyFares:t.helpers.arrayToObjectArray(c,["type",["terms.ticketTypeCode","price"]]),singleJourneyFares:t.helpers.arrayToObjectArray(d,["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 a=n[r],i=a.getTicketTypes();return Object.entries(i).reduce((function(r,i){var n=S(i,2),o=n[0];n[1];return r[o]=a.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")})},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}},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}},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})}))},i.prototype.makeFareNames=function(e){var t=this;return["returnJourneyFares","openReturnJourneyFares","dualSingleJourneyFares","singleJourneyFares"].reduce((function(r,a){return r[a]=t._makeFareNames(e,a),r}),{returnJourneyFares:new kt,openReturnJourneyFares:new kt,dualSingleJourneyFares:new kt,singleJourneyFares:new kt})},i.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),a=r[0],i=r[1];Object.entries(i).forEach((function(t){var r=S(t,2),i=r[0],n=r[1];e.addFares(a,i,n)}))})),e.nextJourney(),e):e}),new kt)},i.prototype.updatePrices=function(t,r,a){var i=function(e,t,r){if(!t||0===t.length)return e;var a=t[0].price;return e.price>0&&e.price<a?e:{price:a,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===Z.Standard})),p=s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return e&&e.class===Z.First})),h=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===Z.Standard})),m=s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return e&&e.class===Z.First})),f=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===Z.Standard})),v=s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return e&&e.class===Z.First})),b=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===Z.Standard})),y=s.default.flatten(Object.values(r.singleJourneyFares)).filter((function(e){return e&&e.class===Z.First})),g=A(h,f,b),S=A(d,g).sort(c),C=A(m,v,y),T=A(p,C).sort(c);if(a||(g.sort(c),T.sort(c)),t.cheapestTickets.dualSingleJourneyFares=i(t.cheapestTickets.dualSingleJourneyFares,s.default.flatten(Object.values(r.dualSingleJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.openReturnJourneyFares=i(t.cheapestTickets.openReturnJourneyFares,s.default.flatten(Object.values(r.openReturnJourneyFares)).filter((function(e){return!!e})),r),t.cheapestTickets.returnJourneyFares=i(t.cheapestTickets.returnJourneyFares,s.default.flatten(Object.values(r.returnJourneyFares)).filter((function(e){return!!e})),r),a){if(t.cheapestClassTicket.inboundStandardClassFare=i(t.cheapestClassTicket.inboundStandardClassFare,S,r),t.cheapestClassTicket.inboundFirstClassFare=i(t.cheapestClassTicket.inboundFirstClassFare,T,r),t.outboundClassTicket.inboundStandardClassFare=i(t.outboundClassTicket.inboundStandardClassFare,g,r),t.outboundClassTicket.inboundFirstClassFare=i(t.outboundClassTicket.inboundFirstClassFare,C,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=i(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=i(t.cheapestClassTicket.inboundFirstClassFare,p,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=i(t.cheapestClassTicket.standardClassFare,S,r),t.cheapestClassTicket.firstClassFare=i(t.cheapestClassTicket.firstClassFare,T,r),t.outboundClassTicket.standardClassFare=i(t.outboundClassTicket.standardClassFare,g,r),t.outboundClassTicket.firstClassFare=i(t.outboundClassTicket.firstClassFare,C,r);return t}),r)},i.prototype.selectTicket=function(t,r,a,i,n,o){var s,u,c,p,h,m;return void 0===o&&(o=!1),b(this,void 0,void 0,(function(){var f,v,b,g,S,A,C,T;return y(this,(function(y){switch(y.label){case 0:return a.selectable?this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===a.fareHash?(this.selectedTicket=null,this._applyFilter(),[2]):(f=this.selectedTicket,this.alternativeWellbeing=this.userService.getUserFavoriteObject(nt.AlternativeRailItineraryEnabled),f&&!o&&this.alternativeWellbeing?(v=f.journey,b=r,g=l.default(v.arriveDateTime).diff(l.default(v.departDateTime),"hours",!0),S=l.default(b.arriveDateTime).diff(l.default(b.departDateTime),"hours",!0),A=l.default(b.departDateTime).diff(l.default(v.departDateTime),"day"),[4,this.checkAlternativeHours(g+S,A)]):[3,2]):[2];case 1:return y.sent()&&this.selectTicket(t,r,a,i,n,!0),[3,25];case 2:switch(C=this.originalUserSearch,n){case"singleJourneyFares":return[3,3];case"returnJourneyFares":return[3,7];case"dualSingleJourneyFares":return[3,13];case"openReturnJourneyFares":return[3,19]}return[3,23];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:T=y.sent(),r.ticketExtras=T||[],y.label=5;case 5:return[4,this.addSingleJourneyToBasket(i,C,r,a)];case 6:return y.sent(),this.selectedTicket=null,[3,24];case 7:return t!==e.RailDirection.Outbound?[3,8]:(this.selectedTicket={journey:r,fare:a},[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:T=y.sent(),f.journey.ticketExtras=T||[],y.label=10;case 10:return[4,this.addReturnJourneyToBasket(i,C,this.selectedTicket.journey,r,this.selectedTicket.fare,a)];case 11:y.sent(),this.selectedTicket=null,y.label=12;case 12:return[3,24];case 13:return t!==e.RailDirection.Outbound?[3,14]:(this.selectedTicket={journey:r,fare:a},[3,18]);case 14:return this.selectedTicket?(null===(h=null===(p=this.selectedTicket.journey)||void 0===p?void 0:p.ticketExtras)||void 0===h?void 0:h.length)>1?[4,this.modalService.open(d.RailTicketsDialogComponent,{centered:!0},{outboundRailJourneyOption:this.selectedTicket.journey})]:[3,16]:[3,18];case 15:T=y.sent(),console.log(T),f.journey.ticketExtras=T||[],y.label=16;case 16:return[4,this.addDualSingleToBasket(i,C,this.selectedTicket.journey,r,this.selectedTicket.fare,a)];case 17:y.sent(),this.selectedTicket=null,y.label=18;case 18:return[3,24];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:T=y.sent(),console.log(T),r.ticketExtras=T||[],y.label=21;case 21:return[4,this.addOpenReturnToBasket(i,C,r,a)];case 22:return y.sent(),this.selectedTicket=null,[3,24];case 23:n,y.label=24;case 24:this._applyFilter(),y.label=25;case 25:return[2]}}))}))},i.prototype.checkAlternativeHours=function(e,t){return b(this,void 0,void 0,(function(){var r;return y(this,(function(a){switch(a.label){case 0:return r=this.searchService.searches[ae.Rail],this.alternativeWellbeing.enable&&Number(this.alternativeWellbeing.hours)>0&&r.chosenSearchType===$.ReturnJourney&&e>=Number(this.alternativeWellbeing.hours)&&0===t&&this.noOfAdults+this.noOfChildren<=4?[4,this.modalService.open(d.AlternativeRailModalComponent)]:[3,2];case 1:return a.sent()?(this.selectedTicket=null,this._applyFilter(),this.performAlternativeRailAndHotelSearch(),[2,!1]):[2,!0];case 2:return[2,!0];case 3:return[2]}}))}))},i.prototype.performAlternativeRailAndHotelSearch=function(){console.log("+++ Creating the Alternative Search Params +++");var t=this.searchService.search_objects[ae.Hotel],r=this.searchService.search_objects[ae.Rail];t.chosen=!0,r.chosen=!0,t.priority=r.priority;var a=this.searchService.searches[ae.Hotel],i=this.searchService.searches[ae.Rail];i.inBoundDateTime=this.searchService.searches[ae.Rail].inBoundDateTime.add(1,"day"),a.location_type_select=e.LocationTypes.TrainStation,a.location=i.travellingTo,a.trainsStation=i.travellingTo.railstation,a.checkin_date=i.outBoundDateTime,a.checkout_date=i.inBoundDateTime,a.no_of_occupants=i.noOfAdults+i.noOfChildren,a.no_of_rooms=1,a.distance=10,this.searchService.startSearches(e.WellbeingEnum.WELLBEING)},i.prototype.selectTicketNoAdd=function(t,r,a,i,n){var o;return b(this,void 0,void 0,(function(){var i,s;return y(this,(function(l){if(!a.selectable)return console.warn("+++ Rail fare is not selectable +++"),[2];if(i=this.selectedTicket&&this.selectedTicket.journey.journeyHash===r.journeyHash&&this.selectedTicket.fare.fareHash===a.fareHash,s=t===e.RailDirection.Inbound&&(this.selectedInboundTicket&&this.selectedInboundTicket.journey.journeyHash===r.journeyHash&&this.selectedInboundTicket.fare.fareHash===a.fareHash),i||t===e.RailDirection.Inbound&&s)return console.warn("+++ Journey and fare are already selected - breaking out +++"),this._selectedInboundTicket=null,i&&(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)!==a.identifiers.fareIdentifier)&&(this.selectedTicket=null,this._selectedInboundTicket=null),this._selectedSection=n,this.originalUserSearch,n){case"singleJourneyFares":this.selectedTicket={journey:r,fare:a};break;case"returnJourneyFares":case"dualSingleJourneyFares":t===e.RailDirection.Outbound?this.selectedTicket={journey:r,fare:a}:this.selectedTicket&&(this.selectedInboundTicket={journey:r,fare:a});break;case"openReturnJourneyFares":this.selectedTicket={journey:r,fare:a};break;default:n}return this.applyFilter(),[2]}))}))},i.prototype.addToBasket=function(t,r,a,i,n,o){return b(this,void 0,void 0,(function(){return y(this,(function(s){switch(s.label){case 0:return r.chosenSearchType!==$.SingleJourney?[3,2]:[4,this.addSingleJourneyToBasket(t,r,a,i)];case 1:return s.sent(),[3,7];case 2:return"openReturnJourneyFares"!==this.selectedSection?[3,4]:[4,this.addOpenReturnToBasket(t,r,a,i)];case 3:return s.sent(),[3,7];case 4:return"Return"!==i.singleOrReturn?[3,5]:[2,this.addReturnJourneyToBasket(t,r,a,o,i,n)];case 5:return[4,this.addDualSingleToBasket(t,r,a,o,i,n)];case 6:s.sent(),s.label=7;case 7:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.addOpenReturnToBasket=function(e,t,r,a){return b(this,void 0,void 0,(function(){return y(this,(function(i){return[2,this.addSingleJourneyToBasket(e,t,r,a)]}))}))},i.prototype.addDualSingleToBasket=function(t,r,a,i,n,o){var s,l;return b(this,void 0,void 0,(function(){var u,c,d,p,h,m,f,v,b,g;return y(this,(function(y){switch(y.label){case 0:return u=this.getSearchQuery(r),(null===(s=null==i?void 0:i.ticketExtras)||void 0===s?void 0:s.length)&&(c=this.createTicketExtrasObject(i.ticketExtras[0])),(null===(l=null==a?void 0:a.ticketExtras)||void 0===l?void 0:l.length)&&(d=this.createTicketExtrasObject(a.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return p=y.sent(),h=null==p?void 0:p.subject.value,m=this.getTermsAndCond(n,a,i),h?(f=this.getLegsFromRailJourneyOption(a),v=this.getLegsFromRailJourneyOption(i),b={basket:h.id,service:t,detail:{ticketQueueList:(a.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(a.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,price:n.price,legs:f}]},inwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.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(a.journeyLegs),eTicket:!!n.eTicketAvailable},return:{fareIdentifiers:[o.identifiers.fareIdentifier],journeyIdentifier:o.identifiers.journeyIdentifier,isDualSingleReturn:!0,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs),eTicket:!!o.eTicketAvailable},termsAndCond:m},adults:u.adults,price:Number(Number(n.price+o.price).toFixed(2)),currency:n.currency,searchQuery:u,co2PerItem:a.co2PerItem,co2PerPassenger:a.co2PerPassenger,outboundDate:a.arriveDateTime,inboundDate:i.arriveDateTime},c&&(b.detail.return.ticketExtras=c),d&&(b.detail.outbound.ticketExtras=d),[4,this.basketService.addToBasket(b,p,this.searchService,this.travellers,n.requiresReason||o.requiresReason)]):[3,3];case 2:return(g=y.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,g];case 3:return[2,e.DifferentInvokdedUserReasons.continue]}}))}))},i.prototype.findCheapestTicket=function(){return 0},i.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeRailQuery()),this._isValid()},i.prototype._setAirportExpressStations=function(){var e=this.airportExpressStationsCodes[this.airportExpressStation];console.log("--- Parsed Station is :",e),e&&(this._travellingFrom=e.dep,this._travellingTo=e.arr)},i.prototype._isValid=function(){var e,t;if(this.doChecks){this.storageService.setSessionItem(i.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===$.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)}},i.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(i.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)},i.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ae.Rail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},i.prototype.updateSerchQuery=function(e){var t,r,a,i,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===(i=null===(a=this.travellingTo)||void 0===a?void 0:a.railstation)||void 0===i?void 0:i.stationCode,n},i.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===$.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 a={departureLocationId:e.searchArgs.departureLocationId,arrivalLocationId:e.searchArgs.arrivalLocationId};this.setAirportExpressStationIds(a)}e.searchArgs.journeyType===$.OpenReturnJourney&&(this.openReturn=!0),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(t){var r,a,i,n,o,s,l;this.isAirportExpress&&this.openReturn&&(this.openReturn=!1);var u={countryCode:"GB",journeyType:t.chosenSearchType,adults:t.noOfAdults,arrivalLocationId:null===(a=null===(r=t.travellingTo)||void 0===r?void 0:r.railstation)||void 0===a?void 0:a.id,departureLocationId:null===(n=null===(i=t.travellingFrom)||void 0===i?void 0:i.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 $.SingleJourney:case $.OpenReturnJourney:u.returnDepartureDateTime=null,u.returnArrivalDateTime=null}return t.isAirportExpress&&(u.arrivalLocationId=this._travellingTo,u.departureLocationId=this._travellingFrom),this.helpers.removeNulls(u)},i.prototype.getCriteria=function(t,r){return t?e.RailSearchCriteria.Depart:r?e.RailSearchCriteria.Arrive:null},i.prototype.updateFromPreviousSearches=function(e){},i.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===$.ReturnJourney&&(this.inBoundDateTime=r.returnDepartureDateTime?l.default(r.returnDepartureDateTime):l.default(r.returnArrivalDateTime),this.returnCriteria=this.getCriteria(r.returnDepartureDateTime,r.returnArrivalDateTime)),r.journeyType===$.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)}))},i.prototype.getRailStation=function(e,a){return 3===e.length?(null==a||a.next(!0),this.getRailStationFetcher.fetchList({code:e}).pipe(r.tap((function(){return null==a?void 0:a.next(!1)})),r.take(1))):t.of()},i.prototype.getSelectedRailJourneyFare=function(){return null},i.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},i.prototype.addSingleJourneyToBasket=function(t,r,a,i){var n;return b(this,void 0,void 0,(function(){var o,s,l,u,c,d,p,h;return y(this,(function(m){switch(m.label){case 0:return o=this.getSearchQuery(r),(null===(n=null==a?void 0:a.ticketExtras)||void 0===n?void 0:n.length)&&(s=this.createTicketExtrasObject(a.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return l=m.sent(),u=null==l?void 0:l.subject.value,c=this.getTermsAndCond(i,a),u?(d=this.getLegsFromRailJourneyOption(a),p={basket:u.id,service:t.toString(),detail:{ticketQueueList:(a.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(a.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:i.providerName,ticketDescription:i.type,price:i.price,legs:d}]},transactionIdentifier:i.identifiers.transactionIdentifier,outbound:{eTicket:!!i.eTicketAvailable,fareIdentifiers:[i.identifiers.fareIdentifier],journeyIdentifier:i.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(a.journeyLegs)},termsAndCond:c},adults:o.adults,price:i.price,currency:i.currency,searchQuery:o,co2PerItem:a.co2PerItem,co2PerPassenger:a.co2PerPassenger,outboundDate:a.departDateTime},s&&(p.detail.outbound.ticketExtras=s),[4,this.basketService.addToBasket(p,l,this.searchService,this.travellers,i.requiresReason)]):[3,3];case 2:return(h=m.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,h];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.addReturnJourneyToBasket=function(t,r,a,i,n,o){var s;return b(this,void 0,void 0,(function(){var l,u,c,d,p,h,m,f,v;return y(this,(function(b){switch(b.label){case 0:return l=this.getSearchQuery(r),(null===(s=null==a?void 0:a.ticketExtras)||void 0===s?void 0:s.length)&&(u=this.createTicketExtrasObject(a.ticketExtras[0])),[4,this.basketService.getDefaultBasket()];case 1:return c=b.sent(),d=null==c?void 0:c.subject.value,p=this.getTermsAndCond(n,a,i),d?(h=this.getLegsFromRailJourneyOption(a),m=this.getLegsFromRailJourneyOption(i),f={basket:d.id,service:t,detail:{ticketQueueList:(a.ticketQueueList||[]).map((function(e){return{id:e.id,name:e.name,type:e.type}})),accountsList:(a.accountsList||[]).map((function(e){return{id:e.id,description:e.description}})),outwardDetail:{arrivalDateTime:a.arriveDateTime,arrivalStationName:a.to,departureDateTime:a.departDateTime,departureStationName:a.from,supplierTickets:[{supplierName:n.providerName,ticketDescription:n.type,price:n.price,legs:h}]},inwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,departureDateTime:i.departDateTime,departureStationName:i.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(a.journeyLegs)},return:{eTicket:!!o.eTicketAvailable,fareIdentifiers:[o.identifiers.fareIdentifier],journeyIdentifier:o.identifiers.journeyIdentifier,journeyLegs:this.removedScheduledPlatformFromCallingPoints(i.journeyLegs)},termsAndCond:p},adults:l.adults,price:n.price,currency:n.currency,searchQuery:l,co2PerItem:a.co2PerItem,co2PerPassenger:a.co2PerPassenger,outboundDate:a.arriveDateTime,inboundDate:i.arriveDateTime},u&&(f.detail.outbound.ticketExtras=u),[4,this.basketService.addToBasket(f,c,this.searchService,this.travellers,n.requiresReason||o.requiresReason)]):[3,3];case 2:return(v=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,v];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},i.prototype.removedScheduledPlatformFromCallingPoints=function(e){for(var t=0;t<e.length;t++)for(var r=e[t],a=0;a<r.callingPoints.length;a++){delete r.callingPoints[a].scheduledPlatform}return e},i.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}]},i.prototype.calculateTimeDifferenceInMins=function(e){return this.helpers.getTimeDifference(e.arriveDateTime,e.departDateTime).toString()},i.prototype.ticketIsAnETicket=function(){return null},i.prototype.applyFilter=function(){this._applyFilter()},i.prototype._applyFilter=function(){var t=this,r=function(e,r){var a=t._findSummary(r,t.summary.return);return t._selectedSummary?function(r){return r.map((function(r){var i,n,o,s;return r?Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),[null===(i=t._selectedSummary[e][t.selectedTicket.fare.fareHash])||void 0===i?void 0:i.ruleDataWhenSelectedWith[r.fareHash],a?null===(n=a[e][r.fareHash])||void 0===n?void 0:n.ruleDataWhenSelectedAlone:null])),{selected:r.fareHash===t.selectedTicket.fare.fareHash,selectable:!!(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))}):null}))}:function(r){return r.map((function(r){return r?Object.assign(Object.assign({},t.helpers.addRailActionRules(Object.assign({},r),a?[a[e][r.fareHash].ruleDataWhenSelectedAlone]:[])),{selected:!1,selectable:!0}):null}))}},a=function(e,r,a){return function(i){var n=t._findSummary(r,t.summary[a]);return i.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(i,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||{},a("dualSingleJourneyFares",r,e.RailDirection.Outbound)),singleJourneyFares:t.helpers.map(r.singleJourneyFares||{},a("singleJourneyFares",r,e.RailDirection.Outbound)),returnJourneyFares:t.helpers.map(r.returnJourneyFares||{},a("returnJourneyFares",r,e.RailDirection.Outbound)),openReturnJourneyFares:t.helpers.map(r.openReturnJourneyFares||{},a("openReturnJourneyFares",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||{},a("singleJourneyFares",e,"return")),openReturnJourneyFares:t.helpers.map(e.openReturnJourneyFares||{},a("openReturnJourneyFares",e,"return"))})}))});return i.push(o),i}),[]))},i.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}]},i.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(this.tempParams),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ae.Rail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},i.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(this,(function(r){switch(this.noOfAdults=e.adults,this.noOfChildren=e.children,this.chosenSearchType=e.journeyType,e.class){case"First":this.chosenRailClass=Z.First;break;case"Any":this.chosenRailClass=Z.All;break;case"Standard":this.chosenRailClass=Z.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]}))}))},i}(c);_t.STORAGE_SESSION_PARAMS="search_rail",_t.STORAGE_SESSION_RESULTS="rail_results",_t.PASSING_POINT="Passing",(Ft=e.ages||(e.ages={})).Child="Child",Ft.Youth="Youth",Ft.Adult="Adult",Ft.Senior="Senior";var Rt,It,Ot=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.makeTravellerObjectFromUser=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.equals=function(e,t){return e.email===t.email},e.compare=function(t,r){var a=e.fullname(t),i=e.fullname(r);return a===i?0:a<i?-1:1},e}();(Rt=e.SortTypesIrl||(e.SortTypesIrl={})).CheapestFirst="C",Rt.EarliestFirst="E",Rt.LatestFirst="L",(It=e.ClassType||(e.ClassType={})).Class_1="1",It.Class_2="2",It.Second_Class="2nd Class",It.First_Class="1st Class";var Et=function(t){function a(r,i,n,o,s,u,c){var d=t.call(this,s,n,u)||this;d.Irlfetcher=r,d.irlDiscountCardsFetcher=i,d.basketService=o,d.getIrlSupplierStationFetcher=c,d.resultsSessionName=a.STORAGE_SESSION_RESULTS,d.multiResultsSessionName=a.STORAGE_SESSION_RESULTS,d._sortArray=[{title:"Price",methodRef:e.SortMethod.sortByPrice,icon:"ico-dollar"},{title:"Time",methodRef:e.SortMethod.sortByDate,icon:"ico-calendar"}],d.searchTypes=[{display:"Return",value:V.ReturnJourney},{display:"One-Way",value:V.SingleJourney}],d.classTypes=[{display:"Any",value:U.All},{display:"Standard",value:U.Standard},{display:"First",value:U.First}],d.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+)"}],d.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"}],d.type=ae.InternationalRail,d.minOutboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},d.minInboundDate={year:l.default().year(),month:l.default().month()+1,day:l.default().date()},d._supplier=null,d._countryCode=null,d._class=U.All,d._outboundDepartureDateTime=null,d._departureLocationId=null,d._arrivalLocationId=null,d._children=0,d._cheapestStandard=null,d._cheapestFirst=null,d._returnDepartureDateTime=null,d._ageRange=null,d._priceDir=!0,d._dateDir=!0,d._irlDiscountCardsArray=[],d._outbound_date=null,d._outbound_time=null,d._return_date=null,d._return_time=null,d._offline=!1,d._irlClass=U.All,d._journeytype=V.SingleJourney,d._trainNumber=null,d._additionalInstructions=null;var p=s.getSessionItem(a.STORAGE_SESSION_PARAMS)||{query:{},tempParams:{},originalUserSearch:{}};d.updateTempParams(d.searchService.makeIrlQuery(p.tempParams)),d._originalUserSearch=p.originalUserSearch,u.shouldAddTravellerSubscription()&&u.travellerInformation.subscribe((function(t){d.travellers=t,d.travellers[0]&&!d.travellers[0].ageType&&(d.travellers[0].ageType=e.ages.Adult);var r=d.helpers.selectedTravellers(t,ae.InternationalRail);d.tempParams.adults=r.adults.length,d.tempParams.children=r.children.length,d.travellers=t,d._isValid()})),d._isValid();var h=s.getSessionItemAsList(d.resultsSessionName)||[];return d._cheapestResultPrice=d.updateLowestPrice(h),d.fullResults=h,d.results.next(h||[]),d}return m(a,t),Object.defineProperty(a.prototype,"outboundJourneyOptions",{get:function(){return this._outboundJourneyOptions},set:function(e){this._outboundJourneyOptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"outboundTicket",{get:function(){return this._outboundTicket},set:function(e){this._outboundTicket=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfAdults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"noOfChildren",{get:function(){return this.tempParams.children},set:function(e){this.tempParams.children=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingTo",{get:function(){return this.tempParams.arrivalLocationId},set:function(e){var t;this.tempParams.arrivalLocationId=e,this._travellingTo="",(null===(t=null==e?void 0:e.railstation)||void 0===t?void 0:t.id)&&(this._travellingTo=e.railstation.id),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"travellingFrom",{get:function(){return this.tempParams.departureLocationId},set:function(e){var t,r=this;this.tempParams.departureLocationId=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}))),this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"supplier",{get:function(){return this._supplier},set:function(e){this._supplier=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"countryCode",{get:function(){return this._countryCode},set:function(e){this._countryCode=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"class",{get:function(){return this._class},set:function(e){this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.prototype,"departureLocationId",{get:function(){return this._departureLocationId},set:function(e){this._departureLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"arrivalLocationId",{get:function(){return this._arrivalLocationId},set:function(e){this._arrivalLocationId=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"children",{get:function(){return this._children},set:function(e){this._children=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cheapestStandard",{get:function(){return this._cheapestStandard},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cheapestFirst",{get:function(){return this._cheapestFirst},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.prototype,"ageRange",{get:function(){return this._ageRange},set:function(e){this._ageRange=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"priceDir",{get:function(){return this._priceDir},set:function(e){this._priceDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dateDir",{get:function(){return this._dateDir},set:function(e){this._dateDir=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"chosenSearchClass",{get:function(){return this.tempParams.class},set:function(e){this.tempParams.class=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"discountCard",{get:function(){return this.tempParams.irlDiscountCards},set:function(e){this.tempParams.irlDiscountCards=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"irlDiscountCardsArray",{get:function(){return this._irlDiscountCardsArray},set:function(e){this._irlDiscountCardsArray=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.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(a.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(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,"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(a.prototype,"offline",{get:function(){return this._offline},set:function(e){this._offline=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"irlClass",{get:function(){return this._irlClass},set:function(e){this._irlClass=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"journeyType",{get:function(){return this._journeytype},set:function(e){this._journeytype=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sortDropdownValues",{get:function(){return this._sortArray},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"trainNumber",{get:function(){return this._trainNumber},set:function(e){this._trainNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"additionalInstructions",{get:function(){return this._additionalInstructions},set:function(e){this._additionalInstructions=e},enumerable:!1,configurable:!0}),a.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},a.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeIrlQuery()),this._isValid()},a.prototype._isValid=function(){var e;this.storageService.setSessionItem(a.STORAGE_SESSION_PARAMS,{tempParams:this.tempParams,originalUserSearch:this.originalUserSearch}),this.validationMessages=[];var t=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(t))&&this.validationMessages.push("Departure Date/Time cannot be in the past."),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)},a.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(a.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)},a.prototype.getRecentSearchQuery=function(e){var t=this.updateSerchQuery(e);return{serviceType:ae.InternationalRail,searchArgs:t,travelDate:this.outBoundDateTime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},a.prototype.updateSerchQuery=function(e){var t=e;return this.travellingFrom&&(t.travellingFrom=this.travellingFrom),this.travellingTo&&(t.travellingTo=this.travellingTo),t},a.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()},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(){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.discountCard?this.discountCard.id:null,class:this.class,outboundDepartureDateTime:this.tempParams.outboundDepartureDateTime,departureLocationId:this._travellingFrom,arrivalLocationId:this._travellingTo,adults:this.tempParams.adults,children:this.tempParams.children,returnDepartureDateTime:this.tempParams.returnDepartureDateTime,journeyType:this.journeyType};switch(0===this.tempParams.children&&(r.children=null),this.tempParams.journeyType){case V.SingleJourney:r.returnDepartureDateTime=null}return this.helpers.removeNulls(r)},a.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)}))},a.prototype.updateFromPreviousSearches=function(e){},a.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]}))},a.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},a.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)}))},a.prototype.addSingleJourneyToBasket=function(t,r,a,i){return b(this,void 0,void 0,(function(){var n,o,s,l,u,c,d;return y(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(i,a,0),l=this.getLegsFromIrlJourneyOption(i),u=this.getTermsAndCond(i),c={basket:o.id,service:t,detail:{outwardDetail:{arrivalDateTime:i.arriveDateTime,arrivalStationName:i.to,arrivalStationCode:i.toCode,departureDateTime:i.departDateTime,departureStationName:i.from,departureStationCode:i.fromCode,supplierTickets:[{supplierName:i.providers[0].name,ticketDescription:s.type,price:s.price,legs:l}]},transactionIdentifier:i.identifiers.transactionIdentifier,outbound:{fareIdentifiers:[s.identifiers.fareIdentifier],journeyIdentifier:s.identifiers.journeyIdentifier},supplier:i.providers[0].providerId,termsAndCond:u},adults:r.adults,price:s.price,currency:s.currency,searchQuery:r,outboundDate:i.departDateTime},[4,this.basketService.addToBasket(c,n,this.searchService,this.travellers,!1)]):[3,3];case 2:return(d=p.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,d];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.addReturnJourneyToBasket=function(t,r,a,i,n,o){return b(this,void 0,void 0,(function(){var s,l,u,c,d,p,h,m,f,v;return y(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),p=this.getLegsFromIrlJourneyOption(l),h=this.getLegsFromIrlJourneyOption(i),m=this.getTermsAndCond(l),f={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:i.arriveDateTime,arrivalStationName:i.to,arrivalStationCode:i.toCode,departureStationCode:i.fromCode,departureDateTime:i.departDateTime,departureStationName:i.from,supplierTickets:[{supplierName:i.providers[0].name,ticketDescription:a.type,legs:h}]},transactionIdentifier:s.identifiers.transactionIdentifier,outbound:{fareIdentifiers:[d.identifiers.fareIdentifier],journeyIdentifier:d.identifiers.journeyIdentifier},supplier:l.providers[0].providerId,termsAndCond:m},adults:r.adults,price:Number((Number(d.price)+Number(a.price)).toFixed(2)),currency:d.currency,searchQuery:r,outboundDate:l.departDateTime},this.filterSelected(),[4,this.basketService.addToBasket(f,u,this.searchService,this.travellers,!1)]):[3,3];case 2:return(v=b.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,v];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},a.prototype.updateLowestPrice=function(e){var t,r,a,i;if(!e.length)return null;var n=null===(i=null===(a=null===(r=null===(t=e[0])||void 0===t?void 0:t.outbound[0])||void 0===r?void 0:r.providers[0])||void 0===a?void 0:a.cheapestTicket)||void 0===i?void 0:i.currency;return{amount:this.findCheapestTicket(e),currencyCode:n}},a.prototype.findCheapestTicket=function(e){var t=this;if(this._cheapestFirst=null,this._cheapestStandard=null,!e.length)return null;var r=[];return e.map((function(e){e.outbound.map((function(e){e.providers.map((function(e){var a=e.cheapestTicket.price;e.ticketOptions.map((function(e){var i,n,o=e.price,s=e.class;"First"===s&&((null===(i=t._cheapestFirst)||void 0===i?void 0:i.price)>o||!t._cheapestFirst)?t._cheapestFirst=e:"Standard"===s&&((null===(n=t._cheapestStandard)||void 0===n?void 0:n.price)>o||!t._cheapestStandard)&&(t._cheapestStandard=e),o===a&&r.push(a)}))}))}))})),Math.min.apply(Math,A(r))},a.prototype.sortByPrice=function(e){var t=this;void 0===e&&(e=!1),e||(this.priceDir=!this.priceDir);var r=this.filterSelected(this._isFiltered),a=function(e,r){return t.priceDir?e.providers[0].cheapestTicket.price-r.providers[0].cheapestTicket.price:r.providers[0].cheapestTicket.price-e.providers[0].cheapestTicket.price};r[0].outbound=r[0].outbound.sort(a),r[0].return=r[0].return.sort(a),this.results.next(r)},a.prototype.sortByDate=function(e){var t=this;void 0===e&&(e=!1),e||(this.dateDir=!this.dateDir);var r=this.filterSelected(this._isFiltered),a=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(a),r[0].return=r[0].return.sort(a),this.results.next(r)},a.prototype.addOutboundAndFilter=function(e,t){this.outboundJourneyOptions=t,this.outboundTicket=e,this.filterSelected(!0)},a.prototype.filterSelected=function(e){var t=this;void 0===e&&(e=!1);var r=this.helpers.clone(this.fullResults);return 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}))}))),this.results.next(r),r},a.prototype.getIrlDiscountCards=function(){var e=this.supplier;return this.irlDiscountCardsFetcher.fetchList({supplier:e})},a.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}]},a.prototype.saveSearch=function(){if(this.isValid.value){var e=this.getSearchQuery(),t=this.updateSerchQuery(e),r={name:""+l.default(),serviceType:ae.InternationalRail,searchArgs:t};return this.searchService.saveFavouriteSearch(r)}},a.prototype.generateFilters=function(t){if(null==t?void 0:t.length){var r=null,a=null,i=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))})),(!a||a>t.providers[0].cheapestTicket.price)&&(a=Math.floor(t.providers[0].cheapestTicket.price)),i&&!l.default(t.departDateTime).isBefore(l.default(i))||(i=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:a,dateArrMax:s,dateArrMin:o,dateDepMax:n,dateDepMin:i,classes:Object.values(u),changes:Object.values(c)};return console.log(d),d}},a.prototype.applyFilters=function(e,t){void 0===t&&(t="O");var r,a=this.helpers.clone(this.fullResults);switch(t){case"O":r=a[0].outbound;break;case"I":r=a[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 i=e.classes.filter((function(e){return e.selected}));(null==i?void 0:i.length)&&(r=r.filter((function(e){var t=[];return console.log("og tickets:",e.providers[0].ticketOptions),e.providers[0].ticketOptions.forEach((function(e){i.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":a[0].outbound=r;break;case"I":a[0].return=r}this.results.next(a)},a.prototype.applyFavourite=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(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]}))}))},a}(c);Et.STORAGE_SESSION_PARAMS="search_irl",Et.STORAGE_SESSION_RESULTS="irl_results",Et.PASSING_POINT="Passing";var Bt,Nt,Mt={type:"string"},Lt={type:"object",properties:{countryCode:Mt,areaCode:Mt,number:Mt,extension:Mt},required:["countryCode","areaCode","number","extension"]},wt={type:"object",properties:{numberOrName:Mt,street:Mt,town:Mt,county:Mt,postcode:Mt,countryCode:Mt},required:["numberOrName","street","town","county","postcode","countryCode"]},jt=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}(),Ht=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}(),xt=function(){function e(e,t,r,a,i,n){this.user=e,this.getUserFetcher=t,this.helpers=r,this.perPassengerPhoneNumber=a,this.perPassengerAddress=i,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 jt(this.helpers),this.userInfo.phoneNumber=new Ht(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}(),Ut=function(){function t(t,r,a){var i=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 xt(e,a,r,i.basketItem.perPassengerPhoneNumber,i.basketItem.perPassengerAddress,i.basketItem.perPassengerSupplementaryBookingInfoSchema)})),this.guestInfo=this.basketItem.guests.map((function(e){return new xt(e,a,r,i.basketItem.perPassengerPhoneNumber,i.basketItem.perPassengerAddress,i.basketItem.perPassengerSupplementaryBookingInfoSchema)})),this.address=new jt(this.helpers),this.phoneNumber=new Ht(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(a){console.log("here: ",a),r.hasDetails=!0;var i=t.properties[a];"object"===i.type&&(i.format=r.addRailFormat(a)||e.SchemaFormat.object,t.properties[a]=Object.assign(Object.assign({},r.processSchema(i)),{format:r.addRailFormat(a)||e.SchemaFormat.object})),i.format=i.format||r.schemaWidgetToFormat(i.widget)||r.schemaTypeToFormat(i.type),i.oneOf&&i.oneOf.length>0&&!r.noCovertSelectSchemas.includes(i.format)&&(i.format=e.SchemaFormat.select)})),console.log("+++ has Details: "+this.hasDetails+" +++"),t},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;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,wt)),void 0!==e.perItemPhoneNumber&&(r.phoneNumber=this.helpers.toStrings(e.perItemPhoneNumber,Lt)),void 0!==e.perItemSupplementarySchema&&(r.supplementaryInfo=this.helpers.toStrings(e.perItemSupplementarySchema,this.perItemSupplementarySchema)),r.userInfo=this.userInfo.map((function(r,a){var i,n,o={id:r.id,supplementaryInfo:{}},s=e["user_"+a]||{};return void 0!==s.perPassengerAddress&&(o.address=t.helpers.toStrings(s.perPassengerAddress,wt)),void 0!==s.perPassengerPhoneNumber&&(o.phoneNumber=t.helpers.toStrings(s.perPassengerPhoneNumber,Lt)),void 0!==s.perPassengerSupplementaryBookingInfoSchema&&(o.supplementaryInfo=t.helpers.toStrings(s.perPassengerSupplementaryBookingInfoSchema,t.perPassengerSupplementaryBookingInfoSchema)),o.supplementaryInfo.passport&&((null===(i=o.supplementaryInfo.passport.dateOfExpiry)||void 0===i?void 0:i.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})),r.guestInfo=this.guestInfo.map((function(r,a){var i,n,o={id:r.id,supplementaryInfo:{}},s=e["guest_"+a]||{};return void 0!==s.perPassengerAddress&&(o.address=t.helpers.toStrings(s.perPassengerAddress,wt)),void 0!==s.perPassengerPhoneNumber&&(o.phoneNumber=t.helpers.toStrings(s.perPassengerPhoneNumber,Lt)),void 0!==s.perPassengerSupplementaryBookingInfoSchema&&(o.supplementaryInfo=t.helpers.toStrings(s.perPassengerSupplementaryBookingInfoSchema,t.perPassengerSupplementaryBookingInfoSchema)),o.supplementaryInfo.passport&&((null===(i=o.supplementaryInfo.passport.dateOfExpiry)||void 0===i?void 0:i.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})),r},t}();(Bt=e.IncludedType||(e.IncludedType={})).Leg="leg",Bt.Photo="photo",Bt.PhotoAttachment="photo_attachment",Bt.Upa="upa",(Nt=e.IrlDirection||(e.IrlDirection={})).Outbound="out",Nt.Inbound="in";var Vt=function(e){function t(t,r,a){var i=e.call(this,r)||this;return i.query=t,i.helpers=a,i}return m(t,e),t.prototype.fetchOne=function(e){return this.processCall(this.query.fetch(this.helpers.removeNulls(e)))},t}(p),Gt=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.applyJITFlightRules},t}(Vt),Wt=function(e){function t(t,r,a){var i=e.call(this,a)||this;return i.query=t,i.helpers=r,i}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 a=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?a.helpers.arrayToObject(t,e):null})))},t.prototype.fetchKeyedObjectArray=function(e,t){var a=this;return this.processCall(this.query.fetch(t)).pipe(r.map((function(t){return t?a.helpers.arrayToObjectArray(t,[e]):null})))},t}(p),Jt=function(e){function a(t,r,a){return e.call(this,t,r,a)||this}return m(a,e),a.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.applyJITHotelRules.result},a.prototype.processCall=function(e){var a=this;return e.pipe(r.take(1),r.map((function(e){return a.checkError(e.errors),a.getDataFromResult(e)})),r.catchError((function(e){return a.checkError(e),t.of({})})))},a}(Wt),Qt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Vt),Yt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Kt=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.carHireAvailabilityDetailRequest},t}(Wt),qt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Xt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),zt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Vt),Zt=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),$t=function(e){function t(t,r,a){return e.call(this,t,r,a)||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.searchEurostar)||void 0===r?void 0:r.results},t}(Wt),er=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),tr=function(e){function t(t,r,a,i){var n=e.call(this,t,r,a)||this;return n.environment=i,n}return m(t,e),t.prototype.fetchList=function(t){var r,a;return(null===(r=this.environment)||void 0===r?void 0:r.groupMax)>0&&(t.groupMax=null===(a=this.environment)||void 0===a?void 0:a.groupMax),e.prototype.fetchList.call(this,t)},t.prototype.getDataFromResult=function(e){var t,r,a,i;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===(i=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.searchFlightsV2)||void 0===i?void 0:i.ruleActionSummary})},t}(Wt),rr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),ar=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),ir=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),nr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),or=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),sr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),lr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),ur=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserCurrentCarbonAllowance},t}(Wt),cr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserRecentSearches},t}(Wt),dr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserBaskets},t}(Wt),pr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserMIAutoSuggestValues},t}(Wt),hr=function(e){function a(t,r,a){return e.call(this,t,r,a)||this}return m(a,e),a.prototype.getDataFromResult=function(e){var t;return null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.getMultipleHotelsAvailability.results},a.prototype.processCall=function(e){var a=this;return e.pipe(r.take(1),r.map((function(e){return a.checkError(e.errors),a.getDataFromResult(e)})),r.catchError((function(e){return a.checkError(e),t.of({})})))},a}(Wt),mr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),fr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),vr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),br=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),yr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),gr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Sr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirlines},t}(Vt),Ar=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.searchAirports},t}(Vt),Cr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Tr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Vt),Dr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getCarHireDepots},t}(Wt),Pr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),kr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Fr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),_r=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Rr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Ir=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Or=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUser},t}(Vt),Er=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Br=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Nr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Mr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Lr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return e.data.getUserFavouriteSearches},t}(Wt),wr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),jr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Hr=function(e){function t(t,r,a){return e.call(this,t,a,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}(Vt),xr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Ur=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Vr=function(e){function t(t,r,a){return e.call(this,t,a,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}(Vt),Gr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Wr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Jr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Qr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),Yr=function(e){function t(t,r,a){return e.call(this,t,r,a)||this}return m(t,e),t.prototype.getDataFromResult=function(e){return null==e?void 0:e.data.getCancellationInfo},t}(Vt),Kr=function(e){function t(t,r,a){return e.call(this,t,r,a)||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}(Wt),qr=function(){};qr.WHITE_CHARS=/[\r\n\t\s]/gm,qr.CAPS=/([A-Z])/g,qr.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])+)\])/,qr.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})$/,qr.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 Xr,zr=function(e){function t(t,r,a,i,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=a,o.error=i,o.name="LoginError",o}return m(t,e),t}(Error);(Xr=e.LoginErrorReason||(e.LoginErrorReason={}))[Xr.PASSWORD_EXPIRED=0]="PASSWORD_EXPIRED",Xr[Xr.PASSWORD_CHANGE=1]="PASSWORD_CHANGE",Xr[Xr.LOGED_IN=2]="LOGED_IN",Xr[Xr.AUTH_ERROR=3]="AUTH_ERROR",Xr[Xr.SSO=4]="SSO";var Zr=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(qr.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(qr.WHITE_CHARS,"")}catch(e){console.error("Sorry there is no enough information to get token string.",e)}},e}(),$r=function(){function e(e,t){this.modalService=e,this.basketService=t}return e.prototype.addBasketItem=function(e){return b(this,void 0,void 0,(function(){var t,r,a=this;return y(this,(function(i){switch(i.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,5];case 1:return(r=i.sent())?[4,Promise.all(this.workingOn.basket.basketItems.map((function(e){return Promise.all((e.managementInfo||[]).map((function(e){return r[e.id]?a.basketService.setMiSelectedValue(a.workingOn.basket.id,e,r[e.id],null):Promise.resolve()})))})))]:[3,3];case 2:return i.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 a.basketService.removeBasketItem(a.workingOn.basket.id,a.workingOn.basket.basketItems.find((function(e){return e.id===r})))})))];case 4:i.sent(),this.workingOn=null,i.label=5;case 5:return[2]}}))}))},e}(),ea=function(){function e(e,r,a,i,n){this.helpers=r,this.basketService=a,this.getUserFetcher=i,this.requiresService=n,Object.assign(this,{subject: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.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 a=Object.assign(Object.assign({},e),(e.basketItems||[]).reduce((function(e,t,a){var i,n,o;return e.prices[t.currency]||(e.prices[t.currency]=0),e.prices[t.currency]+=t.price,e.suppInfo.push(new Ut(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===(n=t.users)||void 0===n?void 0:n.length)>0||(null===(o=t.guests)||void 0===o?void 0:o.length))&&e.basketInfoMiDetails.push(new Te(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:[]}));a.mixedCurrency=Object.keys(a.prices).length>1,this.subject.next(a),this.requiresService.addBasketItem(e)}else this.basketService.getBasket({convertCurrencyTo:"GBP",id:e.id,withSupplemental:!0}).subscribe((function(e){r.next(e)}))},e}(),ta=function(){function a(r,a,i,n,o,s,l,u,c,d,p,h,m,f,v,b,y,g,S,A,C,T,D,P,k,F){var _=this;this.acceptNewPriceUpdater=r,this.addItemToBasketUpdater=a,this.addUserToBasketItem=i,this.basketCreator=n,this.basketFetcher=o,this.bookBasketUpdater=s,this.deleteBasketUpdater=l,this.getMiAutoSugestionFetcher=u,this.helpers=c,this.removeItemFromBasketUpdater=d,this.revalidateBasketUpdater=p,this.setBasketItemMiGroupUpdater=h,this.setBasketItemMiValueUpdater=m,this.validateMiFreeValue=f,this.sendBasketForApprovalUpdater=v,this.getUserFetcher=b,this.getUserBasketsFetcher=y,this.SetBasketItemLeadPassenger=g,this.moveItemToADifferentBasket=S,this.updateBasketNotesUpdater=A,this.updateBasketTitleUpdater=C,this.setPaymentMethodUpdater=T,this.getCancellationInfoFetcher=D,this.userService=P,this.modalService=k,this.webTokenService=F,this.currentBaskets=[],this.highlightBasketItemsEmitter=new t.Subject,this.basketChangeEmitter=new t.BehaviorSubject(""),this.baskets=new t.BehaviorSubject([]),this.basketList=[{type:ae.Flight,text:"FLIGHTS",price:0},{type:ae.Rail,text:"RAIL",price:0},{type:ae.Hotel,text:"HOTELS",price:0},{type:ae.Cab,text:"TAXIS",price:0},{type:ae.Car,text:"CARS",price:0},{type:ae.Eurostar,text:"EUROSTAR",price:0},{type:ae.InternationalRail,text:"INTERNATIONAL RAIL",price:0},{type:ae.Parking,text:"PARKING",price:0},{type:ae.Lounge,text:"LOUNGES",price:0},{type:ae.Coach,text:"COACH",price:0},{type:ae.FastTrack,text:"FAST_TRACK",price:0}],this.basketPrices=new t.BehaviorSubject({total:null,list:this.basketList}),this.menuState=e.MenuSlideEnum.OUT,this.requiresService=new $r(k,this),this.userService.changeUser.subscribe({next:function(e){_.reset()}})}return Object.defineProperty(a.prototype,"currentBasketID",{get:function(){return this.basketChangeEmitter.value},set:function(e){e!==this.currentBasketID&&this.basketChangeEmitter.next(e)},enumerable:!1,configurable:!0}),a.prototype.getRequiresReasonService=function(){return this.requiresService},a.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 ea(t,e.helpers,e,e.getUserFetcher,e.requiresService),e.currentBaskets.push(r)),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))},a.prototype.getAllOpenBaskets=function(e){return b(this,void 0,void 0,(function(){var t=this;return y(this,(function(a){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 ea(e,t.helpers,t,t.getUserFetcher,t.requiresService);t.currentBaskets.push(r)}})),e}))).toPromise()]}))}))},a.prototype.addToBasket=function(t,a,i,n,o){return void 0===n&&(n=[]),b(this,void 0,void 0,(function(){var s=this;return y(this,(function(l){switch(l.label){case 0:return[4,this.checkBasketForInvoked(a,this.webTokenService.bobo)];case 1:switch(l.sent()){case e.DifferentInvokdedUserReasons.continue:return[3,2];case e.DifferentInvokdedUserReasons.cancel:return[3,3];case e.DifferentInvokdedUserReasons.newBasket:return[3,4];case e.DifferentInvokdedUserReasons.research:return[3,6]}return[3,7];case 2:return[3,7];case 3:return[2,e.DifferentInvokdedUserReasons.cancel];case 4:return[4,this.createBasket()];case 5:return a=l.sent(),this.currentBasketID=a.id,[3,7];case 6:return this.webTokenService.bobo=a.subject.value.invokedUser,[2,e.DifferentInvokdedUserReasons.research];case 7:return t.basket=a.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?J.Guest:J.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),this.removeBookedBasket(),t&&a&&this.addItemToBasketUpdater.updateOne(t).pipe(r.take(1)).subscribe((function(e){a.next(Object.assign(Object.assign({},a.subject.value),e));var r=s.userService.findService(t.service).type;i.search_objects[r].booking_chosen=!0,i.search_objects[r].chosen=!1;var n=e.basketItems;s.highlightBasketItemsEmitter.next(n)}),(function(e){console.error(e),a.subject.next(a.subject.value)})),[2,e.DifferentInvokdedUserReasons.continue]}}))}))},a.prototype.checkBasketForInvoked=function(t,r){var a;return(null===(a=t.subject.value.invokedUser)||void 0===a?void 0:a.id)!==(null==r?void 0:r.id)?this.modalService.open(d.DifferentInvokdedUserComponent,{},{basketBobo:t.subject.value.invokedUser,currentBobo:r}):Promise.resolve(e.DifferentInvokdedUserReasons.continue)},a.prototype.loadBasket=function(e){var t=this.findBasket(e);t||(t=new ea({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)}))},a.prototype.subsribeToBasket=function(e,t){var r=this.findBasket(e);r&&r.subject.subscribe(t)},a.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)}))},a.prototype.removeBasketItem=function(e,t){return b(this,void 0,void 0,(function(){var r,a,i=this;return y(this,(function(n){switch(n.label){case 0:return r=this.findBasket(e),t.service.type!==ae.Hotel?[3,4]:(a=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(),a.forEach((function(t){i.removeItemFromBasketUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id}).subscribe((function(t){r.next(Object.assign(Object.assign({},r.subject.value),t)),i.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)),i.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)),i.basketChangeEmitter.next(e)})),n.label=5;case 5:return[2]}}))}))},a.prototype.getDefaultBasket=function(e){return void 0===e&&(e=!1),b(this,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return null,[4,this.findOrCreateBasket(this.currentBasketID,e).then((function(e){return e}))];case 1:return[2,t.sent()]}}))}))},a.prototype.findBasket=function(e){return this.currentBaskets.find((function(t){return t.id===e||t.tempid===e}))},a.prototype.findOrCreateBasket=function(e,t){return void 0===t&&(t=!1),b(this,void 0,void 0,(function(){var r,a;return y(this,(function(i){switch(i.label){case 0:return r=null,e?[3,7]:[4,this.getAllOpenBaskets(this.userService.getfullUserDetails(!0).userData.value.user_id.toString())];case 1:return(null==(a=i.sent())?void 0:a.length)?[3,3]:[4,this.createBasket()];case 2:return r=i.sent(),[3,6];case 3:return"BOOKED"!==(r=this.findBasket(a[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=i.sent(),this.currentBaskets.push(r),i.label=5;case 5:this.baskets.next(this.currentBaskets),i.label=6;case 6:return[3,8];case 7:r=this.findBasket(e),i.label=8;case 8:return[2,r]}}))}))},a.prototype.createBasket=function(){return b(this,void 0,void 0,(function(){var e,t,r;return y(this,(function(a){switch(a.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 ea(e,this.helpers,this,this.getUserFetcher,this.requiresService),[4,this.createBasketOnDB(t)];case 1:return r=a.sent(),this.currentBaskets.push(r),this.baskets.next(this.currentBaskets),this.basketChangeEmitter.next(r.id),[2,r]}}))}))},a.prototype.createBasketOnDB=function(e){var t,a,i=this,n=(null===(t=this.webTokenService.bobo)||void 0===t?void 0:t.id)?{invokedUser:null===(a=this.webTokenService.bobo)||void 0===a?void 0:a.id}:{};return new Promise((function(t,a){i.basketCreator.updateOne(n).pipe(r.take(1)).subscribe((function(r){e.id=r.id,e.next(r),t(e)}),(function(e){a(e)}),(function(){}))}))},a.prototype.toggleMenu=function(){this.menuState===e.MenuSlideEnum.IN||this.menuState===e.MenuSlideEnum.FLAT?this.menuState=e.MenuSlideEnum.OUT:this.menuState=e.MenuSlideEnum.IN},a.prototype.closeMenu=function(){this.menuState=e.MenuSlideEnum.IN},a.prototype.getLatestBasketItemForTypes=function(e){return(e||[]).reduce((function(e,t){return e[t.service.type]=t,e}),{})},a.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(e){return!0})),r.addFormat("passport",(function(e){return!0})),r.addFormat("specialRequest",(function(e){return!0}));var a=r.compile(t.detailSchema),i=r.compile(t.searchQuerySchema);if(e.searchQuery=this.helpers.sanitizeMomentDates(e.searchQuery),e.detail=this.helpers.removeNulls(e.detail),!i(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",i.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}if(!a(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",a.errors),this.modalService.open(d.ModalErrorComponent,{},{error:n}),null}return e},a.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},a.prototype.removeBasket=function(e){var a=this;if(e)return this.deleteBasketUpdater.updateOne({id:e}).pipe(r.take(1),r.switchMap((function(r){var i,n;return null===(i=a.findBasket(e))||void 0===i||i.destructor(),a.currentBaskets=a.currentBaskets.filter((function(t){return t.id!==e})),a.baskets.next(a.currentBaskets),e===a.currentBasketID&&(a.currentBasketID=(null===(n=a.currentBaskets[0])||void 0===n?void 0:n.id)||null),t.of(r)})))},a.prototype.continueSearchAndBook=function(e,t,r){var a=this.getLatestBasketItemForTypes(e),i=r.getHighestSearchPriorityObject(a);return i?(r.searches[i.type].updateFromPreviousSearches(a),[i.searchUrl]):t},a.prototype.addTravellers=function(e,t,r,a){var i=this;void 0===a&&(a=0);var n=this.findBasket(e);if(a<r.length){var o=r[a],s=o.isChild?K.Child:o.isInfant?K.Infant:K.Adult;this.addUserToBasketItem.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,users:[{id:o.id,passengerType:s}],withSupplemental:!1}).subscribe((function(){}),(function(){}),(function(){i.addTravellers(n.id,t,r,a+1)}))}else this.basketFetcher.fetchOne({convertCurrencyTo:"GBP",id:n.id}).subscribe((function(e){n.subject.next(Object.assign(Object.assign({},n.subject.value),e))}),(function(e){}),(function(){n.next(n.subject.value)}))},a.prototype.setLeadPassenger=function(e,t,r,a,i){var n=this;void 0===a&&(a=0),void 0===i&&(i=J.User);var o=this.findBasket(e);a<1?this.SetBasketItemLeadPassenger.updateOne({convertCurrencyTo:"GBP",id:t.id,userOrGuest:r.id,withSupplemental:!1,leadPassengerType:i}).subscribe((function(){}),(function(){}),(function(){n.setLeadPassenger(o.id,t,r,a+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)}))},a.prototype.updateBasket=function(e,t){var a=this;return new Promise((function(i,n){t.pipe(r.take(1)).subscribe((function(t){a.findBasket(e).next(t),i()}),(function(t){console.error(t);var r=a.findBasket(e);r.next(r.subject.value),n(t)}),(function(){}))}))},a.prototype.revalidate=function(e){this.updateBasket(e,this.revalidateBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e}))},a.prototype.setBasketItemMiGroup=function(e,t,r){this.updateBasket(e,this.setBasketItemMiGroupUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t,group:r}))},a.prototype.acceptNewPrice=function(e,t){this.updateBasket(e,this.acceptNewPriceUpdater.updateOne({convertCurrencyTo:"GBP",id:t.id}))},a.prototype.validateFreeValeMi=function(e,t){var r=this;return new Promise((function(a,i){r.validateMiFreeValue.test({mi:e.id,freeValue:t}).subscribe(a,i)}))},a.prototype.setMiFreeValue=function(e,t,a,i,n){var o=this;void 0===i&&(i=null);var s=this.findBasket(e),l={convertCurrencyTo:"GBP",mi:t.id,miFreeValue:a};return i&&(n?l.guest=i:l.user=i),new Promise((function(e,t){o.setBasketItemMiValueUpdater.updateOne(l).pipe(r.take(1)).subscribe((function(e){s.next(e)}),(function(e){t(e)}),(function(){s.next(s.subject.value),e()}))}))},a.prototype.setMiSelectedValue=function(e,t,r,a,i){void 0===a&&(a=null);var n={convertCurrencyTo:"GBP",mi:t.id,miValue:r};return a&&(i?n.guest=a:n.user=a),this.updateBasket(e,this.setBasketItemMiValueUpdater.updateOne(n))},a.prototype.getMiAutoSugestions=function(e,t,a){return null==a||a.next(!0),this.getMiAutoSugestionFetcher.fetchList({mi:e,partialLabel:t}).pipe(r.tap((function(e){null==a||a.next(!1)})))},a.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)}))}))}))},a.prototype.sendBasketForApproval=function(e){return this.updateBasket(e,this.sendBasketForApprovalUpdater.updateOne({convertCurrencyTo:"GBP",basket:e}).pipe(r.take(1)))},a.prototype.setBasketItemPaymentOption=function(e,t,r){return this.updateBasket(e.id,this.setPaymentMethodUpdater.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,paymentMethod:r}))},a.prototype.bookBasket=function(e,t){return this.updateBasket(e,this.bookBasketUpdater.updateOne({convertCurrencyTo:"GBP",id:e,supplementaryInfo:t}))},a.prototype.moveBasketItem=function(e,t,r){var a=this;this.moveItemToADifferentBasket.updateOne({convertCurrencyTo:"GBP",basketItem:t.id,newBasket:r}).subscribe((function(){a.loadBasket(e),a.loadBasket(r)}))},a.prototype.updateBasketNotes=function(e,t){this.updateBasket(e,this.updateBasketNotesUpdater.updateOne({convertCurrencyTo:"GBP",id:e,notes:t}))},a.prototype.updateBasketTitle=function(e,t){this.updateBasket(e,this.updateBasketTitleUpdater.updateOne({convertCurrencyTo:"GBP",id:e,newTitle:t}))},a.prototype.getBasket=function(e){return this.basketFetcher.fetchOne(e)},a.prototype.atLeastOneSearchChosen=function(){return!!this.currentBaskets.filter((function(e){return e.subject.value.basketItems.length})).length},a.prototype.getBasketStats=function(e){var t,r,a,i=this,n=(null===(a=null===(r=null===(t=this.baskets.value[e])||void 0===t?void 0:t.subject)||void 0===r?void 0:r.value)||void 0===a?void 0:a.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,a,n;t.price=null===(n=null===(a=null===(r=i.baskets.value[e])||void 0===r?void 0:r.subject)||void 0===a?void 0:a.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)})),this.basketPrices},a.prototype.canCancel=function(e){return this.getCancellationInfoFetcher.fetchOne({basketItem:e.id})},a.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)},a}(),ra="results_hotel_avallibility",aa=function(){function e(e,r,a,i){this.avalibilityFethcer=e,this.sessionStorage=r,this.helpers=a,this.environment=i,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(ra)||{};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(ra),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 a;if(null===(a=null==r?void 0:r.availableRates)||void 0===a?void 0:a.rooms){if(this.behaviours[e.hotel])return this.behaviours[e.hotel];this.behaviours[e.hotel]=new t.BehaviorSubject(null);var i=r.availableRates;return i.minprice=r.availableRates.rooms[0]?r.availableRates.rooms[0].total:0,i.maxprice=i.minprice?r.availableRates.rooms[r.availableRates.rooms.length-1].total:0,this.behaviours[e.hotel].next(i),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){return e.availableRates&&(null==e?void 0:e.availableRates.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=this;this.fetching.next(!0),this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0);var t=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 a={hotel:t.map((function(e){return e.hotel})),currency:t[0].currency,endDate:t[0].endDate,startDate:t[0].startDate,occupants:t[0].occupants,rooms:t[0].rooms};this.avalibilityFethcer.fetchList(a).pipe(r.take(1)).subscribe((function(t){t.forEach((function(t){(t=e.helpers.clone(t)).rooms=(t.rooms||[]).filter((function(e){return e.total>0})).map((function(t){return(t=e.helpers.clone(t)).LocalPrice=t.currencyConversion?t.currencyConversion.localTotal:t.total,t.LocalCurrency=t.currencyConversion?t.currencyConversion.localCode:t.currencyCode,t})),t.currencies=t.rooms.reduce((function(t,r){return r.currencyConversion&&(t[r.currencyConversion.convertedCode]=t[r.currencyConversion.convertedCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},t[r.currencyConversion.convertedCode].maxprice=Math.max(t[r.currencyConversion.convertedCode].maxprice,r.currencyConversion.convertedTotal),t[r.currencyConversion.convertedCode].minprice=Math.min(t[r.currencyConversion.convertedCode].minprice,r.currencyConversion.convertedTotal),e.currencies[r.currencyConversion.convertedCode]=e.currencies[r.currencyConversion.convertedCode]||{maxprice:Number.MIN_VALUE,minprice:Number.MAX_VALUE},e.currencies[r.currencyConversion.convertedCode].minprice=Math.ceil(Math.min(e.currencies[r.currencyConversion.convertedCode].minprice,r.currencyConversion.convertedTotal)),e.currencies[r.currencyConversion.convertedCode].maxprice=Math.ceil(Math.max(e.currencies[r.currencyConversion.convertedCode].maxprice,r.currencyConversion.convertedTotal))),t}),{});var r=t.rooms.map(e.helpers.mapFieldFromObject("total"));r.length||r.push(0),t.minprice=Math.min.apply(Math,A(r)),t.maxprice=Math.max.apply(Math,A(r)),t.rooms=t.rooms,(null==t?void 0:t.hotelId)&&e.behaviours[t.hotelId]&&(e.data[t.hotelId]=t,e.behaviours[t.hotelId].next(t))})),e.sessionStorage.setSessionItem(ra,t),e.toFetch.length>0?setTimeout((function(){e.fetchAvalilbility()}),e.environment.hotelAvalibilityTimeout):e.fetching.next(!1)}),(function(t){return console.error("+++ Error recovering hotel availabilty: "+t+" - reseting availabilty +++"),e.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 a=g(Object.entries(this.data)),i=a.next();!i.done;i=a.next()){var n=S(i.value,2),o=(n[0],n[1]);(null==o?void 0:o.prpn)&&r++}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return r},e}(),ia=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}(),na="USER_SIGNEDOUT",oa=function(){function e(e,r,a,i,n,o,s,l,u,c,d,p,h){this.getUserFetcher=e,this.userUiConfigsFetcher=r,this.userProductsFetcher=a,this.userMessagesFetcher=i,this.baseConfirmMessagesUpdater=n,this.getCompaniesFetcher=o,this.getCompanyFetcher=s,this.setUserLanguageUpdater=l,this.editUserUpdater=u,this.createGuestUpdater=c,this.getUserGuestsFetcher=d,this.storageService=p,this.helpers=h,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)}return e.prototype.setUser=function(e){var t=this,a=this.fullUserDetails.userData.value;a&&a.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(Ot.makeTravellerObjectFromUser(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(),a=this.getUserBookingType(),i=this.getUserTitle();return t&&(e.name=t),r&&(e.email=r),a&&(e.account_type=a),i&&(e.title=i),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=ot.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=ot.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,a,i,n,o,s,l,u,c){return{isChild:l,isInfant:u,childDOB:c,guest:!0,id:"",forename:t,surname:r,email:a,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===F.Traveller},e.prototype.userIsAgent=function(){return this.fullUserDetails.userData.value.booker_type===F.Company},e.prototype.userIsAdmin=function(){return this.fullUserDetails.userData.value.admin},e.prototype.userIsCompanyAdmin=function(){return this.fullUserDetails.userData.value.company_admin},e.prototype.isSelfBook=function(){return this.fullUserDetails.userData.value.booker_type===F.SelfBook},e.prototype.isBooker=function(){return this.fullUserDetails.userData.value.booker_type===F.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===F.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.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}(),sa=function(){function a(e,t,r,a,i,n,o,s){this.userService=e,this.modalService=t,this.http=r,this.router=a,this.eventMessenager=i,this.storageService=n,this.environment=o,this.webTokenService=s,this.loading=!1,this.isLoggedIn=!1,this.redirectUrl="",this.refreshPromise=null}return a.prototype.checkLogin=function(){return this.refreshToken()},a.prototype.refreshToken=function(){var t=this;return this.refreshPromise=this.refreshPromise||new Promise((function(a,i){t.clearRefresh(),t.http.formEncodedPostNoErrorHandling(e.URLS.Refresh,{}).pipe(r.take(1),r.map((function(e){return t.handleResponse(e)}))).subscribe((function(e){if("string"==typeof e){if(a(!1),"login"!==t.router.url)t.modalService.open(d.BaseModalComponent,{},{title:"Auto Logout",body:"",isLoading:!1,options:{buttonCancel:!1,buttonOk:!0,buttonOkText:"Continue"}}).then((function(){t.logout(),a(!1)}))}else a(!0),t.setRefresh()}),(function(e){a(!1)}))})).then((function(e){return t.refreshPromise=null,e})).catch((function(e){throw t.refreshPromise=null,e})),this.refreshPromise},a.prototype.clearRefresh=function(){this.timeoutSubscription&&(clearTimeout(this.timeoutSubscription),this.timeoutSubscription=null)},a.prototype.setRefresh=function(){this.timeoutSubscription=window.setTimeout(this.refreshToken.bind(this),1e3*this.environment.authRefreshTimeout)},a.prototype.becomeUser=function(t){var a=this;return new Promise((function(i,n){a.clearRefresh(),a.http.post(e.URLS.BECOME_USER,{username:t}).pipe(r.take(1)).subscribe((function(e){console.log(e),a.userService.setUser(e.jwtObject),a.router.navigate(["main"]),i(!0)}),(function(e){n(e)}))}))},a.prototype.endBecomeUserSession=function(){var t=this;return new Promise((function(a,i){t.clearRefresh(),t.http.post(e.URLS.END_BECOME_USER,{}).pipe(r.take(1)).subscribe((function(e){console.log(e),t.userService.setUser(e.jwtObject),a(!0)}),(function(e){i(e)}))}))},a.prototype.login=function(t,a,i){var n=this;return this.userService.emptyUserData(),this.storageService.clearSessionData(),this.clearRefresh(),this.http.formEncodedPostNoErrorHandling(e.URLS.AccessToken,{username:t,password:a}).pipe(r.take(1),r.map((function(e,t){return n.webTokenService.bobo=null,n.setRefresh(),n.handleResponse(e)})))},a.prototype.handleResponse=function(e){return"object"==typeof e&&e.jwt&&(this.userService.setUser(e.jwtObject),delete e.jwt,delete e.jwtObject),e},a.prototype.cookieLogin=function(e){return t.of(null)},a.prototype.logout=function(){var t=this;this.userService.isUserFavoriteSet(nt.SSO_no_password);this.clearRefresh(),this.isLoggedIn=!1,this.webTokenService.bobo=null,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(na,{}),t.userService.isUserFavoriteSet(nt.SSO_no_password)?t.router.navigate(["logOutDigitsUser"]):t.router.navigate(["logon"])}))},a.prototype.changePassword=function(e){return t.of(null)},a.prototype.resetPassword=function(t,r){return this.http.formEncodedPost(e.URLS.RESET_PASSWORD,{passwordResetToken:t,newPassword:r})},a.prototype.recoverPassword=function(t){return this.http.formEncodedPost(e.URLS.RECOVER_PASSWORD_URL,{username:""+t},"text")},a.prototype.handleError=function(e){var t={error:e};this.modalService.open(d.ModalErrorComponent,{},t)},a}(),la=function(){function e(){this.openModalEvent=new t.Subject}return e.prototype.open=function(e,t,r){var a=this;return void 0===t&&(t=null),void 0===r&&(r=null),new Promise((function(i,n){a.openModalEvent.next({type:e,data:r||{},options:t||{},results:i})}))},e.prototype.subscribe=function(e){return this.openModalEvent.subscribe(e)},e}(),ua=function(){function e(e,r,a){var i,n;this.getUserBasketsFetcher=e,this.searchUserCanBookFor=r,this.cancelBookingUpdater=a,this.baskets=new t.BehaviorSubject([]),this._basketStatusIconClasses=((i={})[P.Approved]="ico-tick",i[P.AwaitingApproval]="ico-clock",i[P.BookingFailed]="ico-deny",i[P.Disapproved]="ico-deny",i[P.Open]="ico-calendar",i[P.PartiallyBooked]="ico-deny",i[P.Booked]="ico-deny",i),this._serviceTypeIconClasses=((n={})[ae.Cab]="ico-m-taxi",n[ae.Car]="ico-car",n[ae.Coach]="ico-bus",n[ae.Flight]="ico-flight",n[ae.Hotel]="ico-bed",n[ae.FastTrack]="",n[ae.InternationalRail]="ico-rail",n[ae.Lounge]="ico-material ico-lounge",n[ae.Parking]="ico-material ico-parking",n[ae.Rail]="ico-rail",n[ae.Eurostar]="ico-rail",n)}return e.prototype.getUserBaskets=function(e,t){var a=this;t.next(!0),this.getUserBasketsFetcher.fetchList(e).pipe(r.take(1)).subscribe((function(e){a.baskets.next(e),t.next(!1)}),(function(e){console.error(e),t.next(!1)}))},e.prototype.getSearchUserCanBookFor=function(e,a){return e.length>2?(a.next(!0),this.searchUserCanBookFor.fetchList({email:e}).pipe(r.take(1),r.map((function(e){return a.next(!1),e})))):t.of([])},e.prototype.getServiceTypeFilters=function(e){var t,r,a=[];try{for(var i=g(Object.entries(e.search_objects)),n=i.next();!n.done;n=i.next()){var o=S(n.value,1)[0];a.push(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return a},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 ae.Cab:return"Taxi";case ae.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){return e.users.map((function(e){return t.push(e.forename+" "+e.surname)}))})),t=A(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,a=e.streetName,i=e.town,n=[];return a&&n.push(a),i&&n.push(i),t&&n.push(t),r&&n.push(r),n.join(", ")},e.prototype.getHotelLocation=function(e){var t=e.county,r=e.town,a=[];return r&&a.push(r),t&&a.push(t),a.join(", ")},e.prototype.cancelBooking=function(e){return this.cancelBookingUpdater.updateOne({basketItem:e})},e}(),ca=[{cName:"Afghanistan",dCode:"93",cCode:"AF"},{cName:"Aland Islands",dCode:"358",cCode:"AX"},{cName:"Albania",dCode:"355",cCode:"AL"},{cName:"Algeria",dCode:"213",cCode:"DZ"},{cName:"AmericanSamoa",dCode:"1684",cCode:"AS"},{cName:"Andorra",dCode:"376",cCode:"AD"},{cName:"Angola",dCode:"244",cCode:"AO"},{cName:"Anguilla",dCode:"1264",cCode:"AI"},{cName:"Antarctica",dCode:"672",cCode:"AQ"},{cName:"Antigua and Barbuda",dCode:"1268",cCode:"AG"},{cName:"Argentina",dCode:"54",cCode:"AR"},{cName:"Armenia",dCode:"374",cCode:"AM"},{cName:"Aruba",dCode:"297",cCode:"AW"},{cName:"Australia",dCode:"61",cCode:"AU"},{cName:"Austria",dCode:"43",cCode:"AT"},{cName:"Azerbaijan",dCode:"994",cCode:"AZ"},{cName:"Bahamas",dCode:"1242",cCode:"BS"},{cName:"Bahrain",dCode:"973",cCode:"BH"},{cName:"Bangladesh",dCode:"880",cCode:"BD"},{cName:"Barbados",dCode:"1246",cCode:"BB"},{cName:"Belarus",dCode:"375",cCode:"BY"},{cName:"Belgium",dCode:"32",cCode:"BE"},{cName:"Belize",dCode:"501",cCode:"BZ"},{cName:"Benin",dCode:"229",cCode:"BJ"},{cName:"Bermuda",dCode:"1441",cCode:"BM"},{cName:"Bhutan",dCode:"975",cCode:"BT"},{cName:"Bolivia, Plurinational State of",dCode:"591",cCode:"BO"},{cName:"Bosnia and Herzegovina",dCode:"387",cCode:"BA"},{cName:"Botswana",dCode:"267",cCode:"BW"},{cName:"Brazil",dCode:"55",cCode:"BR"},{cName:"British Indian Ocean Territory",dCode:"246",cCode:"IO"},{cName:"Brunei Darussalam",dCode:"673",cCode:"BN"},{cName:"Bulgaria",dCode:"359",cCode:"BG"},{cName:"Burkina Faso",dCode:"226",cCode:"BF"},{cName:"Burundi",dCode:"257",cCode:"BI"},{cName:"Cambodia",dCode:"855",cCode:"KH"},{cName:"Cameroon",dCode:"237",cCode:"CM"},{cName:"Canada",dCode:"1",cCode:"CA"},{cName:"Cape Verde",dCode:"238",cCode:"CV"},{cName:"Cayman Islands",dCode:" 345",cCode:"KY"},{cName:"Central African Republic",dCode:"236",cCode:"CF"},{cName:"Chad",dCode:"235",cCode:"TD"},{cName:"Chile",dCode:"56",cCode:"CL"},{cName:"China",dCode:"86",cCode:"CN"},{cName:"Christmas Island",dCode:"61",cCode:"CX"},{cName:"Cocos (Keeling) Islands",dCode:"61",cCode:"CC"},{cName:"Colombia",dCode:"57",cCode:"CO"},{cName:"Comoros",dCode:"269",cCode:"KM"},{cName:"Congo",dCode:"242",cCode:"CG"},{cName:"Congo, The Democratic Republic of the Congo",dCode:"243",cCode:"CD"},{cName:"Cook Islands",dCode:"682",cCode:"CK"},{cName:"Costa Rica",dCode:"506",cCode:"CR"},{cName:"Cote d'Ivoire",dCode:"225",cCode:"CI"},{cName:"Croatia",dCode:"385",cCode:"HR"},{cName:"Cuba",dCode:"53",cCode:"CU"},{cName:"Cyprus",dCode:"357",cCode:"CY"},{cName:"Czech Republic",dCode:"420",cCode:"CZ"},{cName:"Denmark",dCode:"45",cCode:"DK"},{cName:"Djibouti",dCode:"253",cCode:"DJ"},{cName:"Dominica",dCode:"1767",cCode:"DM"},{cName:"Dominican Republic",dCode:"1849",cCode:"DO"},{cName:"Ecuador",dCode:"593",cCode:"EC"},{cName:"Egypt",dCode:"20",cCode:"EG"},{cName:"El Salvador",dCode:"503",cCode:"SV"},{cName:"Equatorial Guinea",dCode:"240",cCode:"GQ"},{cName:"Eritrea",dCode:"291",cCode:"ER"},{cName:"Estonia",dCode:"372",cCode:"EE"},{cName:"Ethiopia",dCode:"251",cCode:"ET"},{cName:"Falkland Islands (Malvinas)",dCode:"500",cCode:"FK"},{cName:"Faroe Islands",dCode:"298",cCode:"FO"},{cName:"Fiji",dCode:"679",cCode:"FJ"},{cName:"Finland",dCode:"358",cCode:"FI"},{cName:"France",dCode:"33",cCode:"FR"},{cName:"French Guiana",dCode:"594",cCode:"GF"},{cName:"French Polynesia",dCode:"689",cCode:"PF"},{cName:"Gabon",dCode:"241",cCode:"GA"},{cName:"Gambia",dCode:"220",cCode:"GM"},{cName:"Georgia",dCode:"995",cCode:"GE"},{cName:"Germany",dCode:"49",cCode:"DE"},{cName:"Ghana",dCode:"233",cCode:"GH"},{cName:"Gibraltar",dCode:"350",cCode:"GI"},{cName:"Greece",dCode:"30",cCode:"GR"},{cName:"Greenland",dCode:"299",cCode:"GL"},{cName:"Grenada",dCode:"1473",cCode:"GD"},{cName:"Guadeloupe",dCode:"590",cCode:"GP"},{cName:"Guam",dCode:"1671",cCode:"GU"},{cName:"Guatemala",dCode:"502",cCode:"GT"},{cName:"Guernsey",dCode:"44",cCode:"GG"},{cName:"Guinea",dCode:"224",cCode:"GN"},{cName:"Guinea-Bissau",dCode:"245",cCode:"GW"},{cName:"Guyana",dCode:"595",cCode:"GY"},{cName:"Haiti",dCode:"509",cCode:"HT"},{cName:"Holy See (Vatican City State)",dCode:"379",cCode:"VA"},{cName:"Honduras",dCode:"504",cCode:"HN"},{cName:"Hong Kong",dCode:"852",cCode:"HK"},{cName:"Hungary",dCode:"36",cCode:"HU"},{cName:"Iceland",dCode:"354",cCode:"IS"},{cName:"India",dCode:"91",cCode:"IN"},{cName:"Indonesia",dCode:"62",cCode:"ID"},{cName:"Iran, Islamic Republic of Persian Gulf",dCode:"98",cCode:"IR"},{cName:"Iraq",dCode:"964",cCode:"IQ"},{cName:"Ireland",dCode:"353",cCode:"IE"},{cName:"Isle of Man",dCode:"44",cCode:"IM"},{cName:"Israel",dCode:"972",cCode:"IL"},{cName:"Italy",dCode:"39",cCode:"IT"},{cName:"Jamaica",dCode:"1876",cCode:"JM"},{cName:"Japan",dCode:"81",cCode:"JP"},{cName:"Jersey",dCode:"44",cCode:"JE"},{cName:"Jordan",dCode:"962",cCode:"JO"},{cName:"Kazakhstan",dCode:"77",cCode:"KZ"},{cName:"Kenya",dCode:"254",cCode:"KE"},{cName:"Kiribati",dCode:"686",cCode:"KI"},{cName:"Korea, Democratic People's Republic of Korea",dCode:"850",cCode:"KP"},{cName:"Korea, Republic of South Korea",dCode:"82",cCode:"KR"},{cName:"Kuwait",dCode:"965",cCode:"KW"},{cName:"Kyrgyzstan",dCode:"996",cCode:"KG"},{cName:"Laos",dCode:"856",cCode:"LA"},{cName:"Latvia",dCode:"371",cCode:"LV"},{cName:"Lebanon",dCode:"961",cCode:"LB"},{cName:"Lesotho",dCode:"266",cCode:"LS"},{cName:"Liberia",dCode:"231",cCode:"LR"},{cName:"Libyan Arab Jamahiriya",dCode:"218",cCode:"LY"},{cName:"Liechtenstein",dCode:"423",cCode:"LI"},{cName:"Lithuania",dCode:"370",cCode:"LT"},{cName:"Luxembourg",dCode:"352",cCode:"LU"},{cName:"Macao",dCode:"853",cCode:"MO"},{cName:"Macedonia",dCode:"389",cCode:"MK"},{cName:"Madagascar",dCode:"261",cCode:"MG"},{cName:"Malawi",dCode:"265",cCode:"MW"},{cName:"Malaysia",dCode:"60",cCode:"MY"},{cName:"Maldives",dCode:"960",cCode:"MV"},{cName:"Mali",dCode:"223",cCode:"ML"},{cName:"Malta",dCode:"356",cCode:"MT"},{cName:"Marshall Islands",dCode:"692",cCode:"MH"},{cName:"Martinique",dCode:"596",cCode:"MQ"},{cName:"Mauritania",dCode:"222",cCode:"MR"},{cName:"Mauritius",dCode:"230",cCode:"MU"},{cName:"Mayotte",dCode:"262",cCode:"YT"},{cName:"Mexico",dCode:"52",cCode:"MX"},{cName:"Micronesia, Federated States of Micronesia",dCode:"691",cCode:"FM"},{cName:"Moldova",dCode:"373",cCode:"MD"},{cName:"Monaco",dCode:"377",cCode:"MC"},{cName:"Mongolia",dCode:"976",cCode:"MN"},{cName:"Montenegro",dCode:"382",cCode:"ME"},{cName:"Montserrat",dCode:"1664",cCode:"MS"},{cName:"Morocco",dCode:"212",cCode:"MA"},{cName:"Mozambique",dCode:"258",cCode:"MZ"},{cName:"Myanmar",dCode:"95",cCode:"MM"},{cName:"Namibia",dCode:"264",cCode:"NA"},{cName:"Nauru",dCode:"674",cCode:"NR"},{cName:"Nepal",dCode:"977",cCode:"NP"},{cName:"Netherlands",dCode:"31",cCode:"NL"},{cName:"Netherlands Antilles",dCode:"599",cCode:"AN"},{cName:"New Caledonia",dCode:"687",cCode:"NC"},{cName:"New Zealand",dCode:"64",cCode:"NZ"},{cName:"Nicaragua",dCode:"505",cCode:"NI"},{cName:"Niger",dCode:"227",cCode:"NE"},{cName:"Nigeria",dCode:"234",cCode:"NG"},{cName:"Niue",dCode:"683",cCode:"NU"},{cName:"Norfolk Island",dCode:"672",cCode:"NF"},{cName:"Northern Mariana Islands",dCode:"1670",cCode:"MP"},{cName:"Norway",dCode:"47",cCode:"NO"},{cName:"Oman",dCode:"968",cCode:"OM"},{cName:"Pakistan",dCode:"92",cCode:"PK"},{cName:"Palau",dCode:"680",cCode:"PW"},{cName:"Palestinian Territory, Occupied",dCode:"970",cCode:"PS"},{cName:"Panama",dCode:"507",cCode:"PA"},{cName:"Papua New Guinea",dCode:"675",cCode:"PG"},{cName:"Paraguay",dCode:"595",cCode:"PY"},{cName:"Peru",dCode:"51",cCode:"PE"},{cName:"Philippines",dCode:"63",cCode:"PH"},{cName:"Pitcairn",dCode:"872",cCode:"PN"},{cName:"Poland",dCode:"48",cCode:"PL"},{cName:"Portugal",dCode:"351",cCode:"PT"},{cName:"Puerto Rico",dCode:"1939",cCode:"PR"},{cName:"Qatar",dCode:"974",cCode:"QA"},{cName:"Romania",dCode:"40",cCode:"RO"},{cName:"Russia",dCode:"7",cCode:"RU"},{cName:"Rwanda",dCode:"250",cCode:"RW"},{cName:"Reunion",dCode:"262",cCode:"RE"},{cName:"Saint Barthelemy",dCode:"590",cCode:"BL"},{cName:"Saint Helena, Ascension and Tristan Da Cunha",dCode:"290",cCode:"SH"},{cName:"Saint Kitts and Nevis",dCode:"1869",cCode:"KN"},{cName:"Saint Lucia",dCode:"1758",cCode:"LC"},{cName:"Saint Martin",dCode:"590",cCode:"MF"},{cName:"Saint Pierre and Miquelon",dCode:"508",cCode:"PM"},{cName:"Saint Vincent and the Grenadines",dCode:"1784",cCode:"VC"},{cName:"Samoa",dCode:"685",cCode:"WS"},{cName:"San Marino",dCode:"378",cCode:"SM"},{cName:"Sao Tome and Principe",dCode:"239",cCode:"ST"},{cName:"Saudi Arabia",dCode:"966",cCode:"SA"},{cName:"Senegal",dCode:"221",cCode:"SN"},{cName:"Serbia",dCode:"381",cCode:"RS"},{cName:"Seychelles",dCode:"248",cCode:"SC"},{cName:"Sierra Leone",dCode:"232",cCode:"SL"},{cName:"Singapore",dCode:"65",cCode:"SG"},{cName:"Slovakia",dCode:"421",cCode:"SK"},{cName:"Slovenia",dCode:"386",cCode:"SI"},{cName:"Solomon Islands",dCode:"677",cCode:"SB"},{cName:"Somalia",dCode:"252",cCode:"SO"},{cName:"South Africa",dCode:"27",cCode:"ZA"},{cName:"South Sudan",dCode:"211",cCode:"SS"},{cName:"South Georgia and the South Sandwich Islands",dCode:"500",cCode:"GS"},{cName:"Spain",dCode:"34",cCode:"ES"},{cName:"Sri Lanka",dCode:"94",cCode:"LK"},{cName:"Sudan",dCode:"249",cCode:"SD"},{cName:"SuricName",dCode:"597",cCode:"SR"},{cName:"Svalbard and Jan Mayen",dCode:"47",cCode:"SJ"},{cName:"Swaziland",dCode:"268",cCode:"SZ"},{cName:"Sweden",dCode:"46",cCode:"SE"},{cName:"Switzerland",dCode:"41",cCode:"CH"},{cName:"Syrian Arab Republic",dCode:"963",cCode:"SY"},{cName:"Taiwan",dCode:"886",cCode:"TW"},{cName:"Tajikistan",dCode:"992",cCode:"TJ"},{cName:"Tanzania, United Republic of Tanzania",dCode:"255",cCode:"TZ"},{cName:"Thailand",dCode:"66",cCode:"TH"},{cName:"Timor-Leste",dCode:"670",cCode:"TL"},{cName:"Togo",dCode:"228",cCode:"TG"},{cName:"Tokelau",dCode:"690",cCode:"TK"},{cName:"Tonga",dCode:"676",cCode:"TO"},{cName:"Trinidad and Tobago",dCode:"1868",cCode:"TT"},{cName:"Tunisia",dCode:"216",cCode:"TN"},{cName:"Turkey",dCode:"90",cCode:"TR"},{cName:"Turkmenistan",dCode:"993",cCode:"TM"},{cName:"Turks and Caicos Islands",dCode:"1649",cCode:"TC"},{cName:"Tuvalu",dCode:"688",cCode:"TV"},{cName:"Uganda",dCode:"256",cCode:"UG"},{cName:"Ukraine",dCode:"380",cCode:"UA"},{cName:"United Arab Emirates",dCode:"971",cCode:"AE"},{cName:"United Kingdom",dCode:"44",cCode:"GB"},{cName:"United States",dCode:"1",cCode:"US"},{cName:"Uruguay",dCode:"598",cCode:"UY"},{cName:"Uzbekistan",dCode:"998",cCode:"UZ"},{cName:"Vanuatu",dCode:"678",cCode:"VU"},{cName:"Venezuela, Bolivarian Republic of Venezuela",dCode:"58",cCode:"VE"},{cName:"Vietnam",dCode:"84",cCode:"VN"},{cName:"Virgin Islands, British",dCode:"1284",cCode:"VG"},{cName:"Virgin Islands, U.S.",dCode:"1340",cCode:"VI"},{cName:"Wallis and Futuna",dCode:"681",cCode:"WF"},{cName:"Yemen",dCode:"967",cCode:"YE"},{cName:"Zambia",dCode:"260",cCode:"ZM"},{cName:"Zimbabwe",dCode:"263",cCode:"ZW"}],da=[{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)"}],pa=function(t){function r(e,a,i,n,o){var s=t.call(this,n,a,o)||this;s.fasttrackFetcher=e,s.basketService=i,s.type=ae.FastTrack,s._date=null,s._time=null,s.resultsSessionName=r.STORAGE_SESSION_RESULTS,s.multiResultsSessionName=r.STORAGE_SESSION_RESULTS;var l=n.getSessionItem(r.STORAGE_SESSION_PARAMS)||{tempParams:{},originalUserSearch:{}};s._originalUserSearch=l.originalUserSearch,s.updateTempParams(o.makeFastTrackQuery(l.tempParams)),o.shouldAddTravellerSubscription()&&o.travellerInformation.subscribe((function(e){var t=s.helpers.selectedTravellers(e,ae.FastTrack);s.tempParams.adults=t.adults.length,s.tempParams.children=t.children.length,s.travellers=e,s._isValid()}));var u=n.getSessionItemAsList(s.resultsSessionName)||[];return s._cheapestResultPrice=s.updateLowestPrice(u),s.results.next(u||[]),s}return m(r,t),Object.defineProperty(r.prototype,"adults",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"children",{get:function(){return this.tempParams.adults},set:function(e){this.tempParams.adults=e,this._isValid()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"time",{get:function(){return this._time},set:function(e){this._time=e,this._updateDateTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.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}),r.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(r.prototype,"locationCode",{get:function(){return this.tempParams.locationCode},set:function(e){this.tempParams.locationCode=e,"string"==typeof e?(this._locationCode="",this._isValid()):e&&e.gateway?(this._locationCode=e.gateway,this._isValid()):(this._locationCode=null,this._isValid())},enumerable:!1,configurable:!0}),r.prototype._isValid=function(){this.doChecks&&(this.storageService.setSessionItem(r.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))},r.prototype.resetQuery=function(){this.updateTempParams(this.searchService.makeFastTrackQuery()),this._isValid()},r.prototype.startSearch=function(){if(this.results.next([]),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.searchService.saveRecentSearch(this.getRecentSearchQuery(e)),this._startSearch(this.fasttrackFetcher.fetchList(e))}return Promise.resolve(!1)},r.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)},r.prototype.getRecentSearchQuery=function(e){return{serviceType:ae.FastTrack,searchArgs:e,travelDate:this.arrivalDatetime.format(),travellers:this.helpers.getTravellersId(this.travellers)}},r.prototype.startRecentSearch=function(e){var t=this;this.arrivalDatetime=l.default(e.searchArgs.arrivalDatetime),this.searchService.getAirportByCode(e.searchArgs.locationCode).subscribe((function(e){var r,a,i,n,o,s;e&&(t.locationCode={country:null===(a=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(n=null===(i=e.iataMatch)||void 0===i?void 0:i.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()},r.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,a,i,n,o,s;e&&(t.locationCode={country:null===(a=null===(r=e.iataMatch)||void 0===r?void 0:r.locationDetails)||void 0===a?void 0:a.country,countryCode:null===(n=null===(i=e.iataMatch)||void 0===i?void 0:i.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)})}))},r.prototype.updateFromPreviousSearches=function(e){var t;if(console.log("PREPOPULATING LOUNGE FORM"),null===(t=e[ae.Flight])||void 0===t?void 0:t.searchQuery)try{var r=this.searchService.searches[ae.Flight].outBoundDate.toDate();this.date={day:r.getUTCDate(),month:r.getUTCMonth()+1,year:r.getUTCFullYear()},this.locationCode=this.searchService.searches[ae.Flight].arriveLocation}catch(e){console.error("Error trying to prepopulate parking from lounge item")}},r.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})},r.prototype.addFastTrackToBasket=function(t,r){var a;return b(this,void 0,void 0,(function(){var i,n,o;return y(this,(function(s){switch(s.label){case 0:return t.unavailable?[2,Promise.resolve(e.DifferentInvokdedUserReasons.cancel)]:[4,this.basketService.getDefaultBasket()];case 1:return i=s.sent(),n=null==i?void 0:i.subject.value,this.getTermsAndCond(t),n?[4,this.basketService.addToBasket({adults:r.adults,children:r.children,basket:n.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===(a=t.terminal)||void 0===a?void 0:a.toString()},price:t.price,currency:t.currency,searchQuery:r,outboundDate:r.arrivalDatetime.format()},i,this.searchService,this.travellers,t.requiresReason)]:[3,3];case 2:return(o=s.sent())===e.DifferentInvokdedUserReasons.research&&this.performSearch(),[2,o];case 3:return[2,e.DifferentInvokdedUserReasons.cancel]}}))}))},r.prototype.getTermsAndCond=function(e){return[{name:"Name",value:e.name},{name:"Important Information",value:e.importantInfo}]},r.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)},r.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},r.prototype.getMinPrice=function(e){return e.reduce((function(e,t){return t.price<e&&(e=t.price),e}),Number.MAX_SAFE_INTEGER)},r.prototype.getMaxPrice=function(e){return e.reduce((function(e,t){return t.price>e&&(e=t.price),e}),Number.MIN_SAFE_INTEGER)},r}(c);pa.STORAGE_SESSION_PARAMS="search_fasttrack",pa.STORAGE_SESSION_RESULTS="results_fasttrack";var ha;(ha=e.TravellerSearchTypes||(e.TravellerSearchTypes={})).email="email",ha.name="name",ha.employeeNumber="employeeNumber";var ma=function(){function a(e,r,i,n,o,l,u,c,d,p,h,m,f,v,b,y,g,S,A,C,T,D,P,k,F,_,R,I,O,E,B,N,M,L,w,j,H,x,U,V,G,W,J,Q,Y,K,q,X,z,Z,$,ee,te,re,ie,ne,oe,se,le,ue,ce,de,pe,he){var me,fe=this;this.searchAirportsFetcher=e,this.searchAirlinesFetcher=r,this.storageService=i,this.userService=n,this.modalService=o,this.router=l,this.helpers=u,this.hotelAvalibilityService=c,this.citiesFetcher=d,this.confermaCitiesFetcher=p,this.postcodeFetcher=h,this.railStationFetcher=m,this.saveUserAddressUpdater=f,this.userAddressesFetcher=v,this.basketService=b,this.getUserCompanyOfficesFetcher=y,this.searchHotelChainsFetcher=g,this.getConfermaRoomImagesFetcher=S,this.baseValidateIsPostcodeValidTester=A,this.depotFetcher=C,this.confermaOfficeNamesFetcher=T,this.confermaOfficeFetcher=D,this.baseDeleteUserAddressUpdater=P,this.baseDeleteRecentSearchUpdater=k,this.baseSaveRecentSearchUpdater=F,this.getUserCurrentCarbonAllowanceFetcher=_,this.baseSaveFavouriteSearchUpdater=R,this.getRailStationFetcher=U,this.getIrlSupplierStationFetcher=V,this.baseWebTokenService=G,this.riskAlertsFetcher=W,this.getUserRecentSearchesFetcher=Q,this.getRailCardsFetcher=Y,this.getCovidMicrositeTokenFetcher=K,this.searchUsersCanBookForFetcher=X,this.searchIrlStationsFetcher=z,this.irlDiscountCardsFetcher=Z,this.getFlightFareRulesFetcher=$,this.getFlightSeatMapFetcher=ee,this.getRailLiveDeparturesFetcher=te,this.getUserFavouriteSearchesFetcher=ne,this.deleteFavouriteSearchUpdater=oe,this.emailBasketFetcher=se,this.sendOfflineNotificationFetcher=ue,this.getHotelChainsFetcher=ce,this.getRailProvidersFetcher=de,this.getAllAirlinesFetcher=pe,this.getCarHireProvidersFetcher=he,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=ca,this.eurostations=s.default.toArray(da),console.log("Enterpise search service being inited"),this.searches=((me={})[ae.Lounge]=new ft(O,u,b,i,this),me[ae.Parking]=new gt(E,u,b,i,this),me[ae.Flight]=new ct(N,u,n,b,i,this,ie,o),me[ae.Hotel]=new mt(M,u,n,I,c,b,i,this,B,J,U,re),me[ae.Car]=new ze(L,w,u,b,i,this),me[ae.Cab]=new Xe(j,u,i,this,b),me[ae.InternationalRail]=new Et(x,Z,u,b,i,this,V),me[ae.FastTrack]=new pa(le,u,b,i,this),me[ae.Coach]=null,me[ae.Rail]=new _t(H,U,u,b,i,this,n,o),me[ae.Eurostar]=new Tt(q,u,n,b,i,this,o),me),console.log("Newly created search objects: ",this.searches),this.search_objects=this.helpers.clone(this.init_search_objects()),this.selectedTravellers=this.storageService.getSessionItemAsList(a.SESSION_TRAVELLER),this.travellerInformation.next(this.selectedTravellers),n.fullUserDetails.userServices.subscribe((function(e){e&&(fe.search_objects=Object.keys(fe.search_objects).reduce((function(t,r){return t[r].enabled=!!e&&!!e[r],t}),fe.search_objects))})),Array.isArray(this.countries)&&(this.countries=this.countries.sort((function(e,t){return e.cName<t.cName?-1:e.cName>t.cName?1:0}))),G.autoLogoutConfig=this.getAutoLogoutConfig()}return a.prototype.ngOnDestroy=function(){this.allSubscription&&this.allSubscription.unsubscribe()},a.prototype.reset=function(){this.resetAllSearchItems(),this.basketService.reset()},a.prototype.resetAllSearchItems=function(){Object.values(this.searches).forEach((function(e){null==e||e.reset()})),this.removeAllTravellers(),this.resetSearchObjects()},a.prototype.getUserCurrentCarbonAllowance=function(e,t){t&&t.next(!0);var a={user:e};return this.getUserCurrentCarbonAllowanceFetcher.fetchList(a).pipe(r.take(1),r.map((function(e){return e})))},a.prototype.getRiskAlerts=function(e,t,a,i){i&&i.next(!0);var n={minLevel:e,maxLevel:t,countryIsoCode:a};return this.riskAlertsFetcher.fetchList(n).pipe(r.take(1),r.map((function(e){return i&&i.next(!1),e})))},a.prototype.getAirportsList=function(e,a,i,n,o,s){var l=this;if(e.length>2){i&&i.next(!0);var u={query:e};return a&&(u.countryCode=a),"boolean"==typeof n&&(u.hasLounge=n),"boolean"==typeof o&&(u.hasParking=o),"boolean"==typeof s&&(u.hasFastTrack=s),this.searchAirportsFetcher.fetchOne(u).pipe(r.take(1),r.map((function(e){if(i&&i.next(!1),e&&e.generalMatches)return l.helpers.clone(e.generalMatches).map((function(e){var t,r,a;return{destination:e.name,gateway:e.iata,terminals:l.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===(a=null==e?void 0:e.locationDetails)||void 0===a?void 0:a.countryCode}}))})))}return t.of([])},a.prototype.getAirlinesList=function(e,a){var i=this;if(e.length>=2){a&&a.next(!0);var n={query:e};return this.searchAirlinesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(e){if(a&&a.next(!1),e&&e.generalMatches)return i.helpers.clone(e.generalMatches).map((function(e){return{code:e.iata,name:e.name}}))})))}return t.of([])},a.prototype.getAirportLocations=function(t,a,i,n,o,s){return this.getAirportsList(t,a,i,n,o,s).pipe(r.map((function(t){return t.map((function(t){return{name:t.destination,type:e.LocationTypes.Airport,airport:t}}))})))},a.prototype.getCityLocations=function(e,t,r,a){if(!(e.length<=2))return a?this.getConfermaCityLocations(e,t,r):this._getCityLocations(e,t,r)},a.prototype._getCityLocations=function(t,a,i){null==i||i.next(!0);var n={query:t};a&&(n.countryCode=a);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==i||i.next(!1),r})))},a.prototype.getConfermaCityLocations=function(t,a,i){null==i||i.next(!0);var n={cityName:t};a&&(n.countryCode=a);return this.confermaCitiesFetcher.fetchOne(n).pipe(r.take(1),r.map((function(t){return null==i||i.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:t.countryCode}})):[]})))},a.prototype.getCarHireDepots=function(e,t,r,a){null==a||a.next(!0);var i={latitude:e,longitude:t};return r&&(i.radius=r),this.depotFetcher.fetchList(i)},a.prototype.getPostcodeList=function(a){return qr.UK_POSTCODE.test(a)?this.postcodeFetcher.fetchList({postcode:a}).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([])},a.prototype.addToSelectedPlaces=function(e){this.selectedPlaces.push(e)},a.prototype.getSelectedPlaceById=function(e){return this.selectedPlaces.find((function(t){return t.place_id===e}))},a.prototype.getConfirmaOffices=function(a){if((null==a?void 0:a.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([])},a.prototype.getOfficeLocations=function(a){if(a.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([])},a.prototype.getStationLocations=function(a,i,n){return void 0===n&&(n=!1),a.length>2?(null==i||i.next(!0),this.railStationFetcher.fetchList({query:a,hasTod:n}).pipe(r.take(1),r.map((function(t){return i&&i.next(!1),t?t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name,railstation:t}})):[]})))):t.of([])},a.prototype.getRailStationById=function(e){return e?this.getRailStationFetcher.fetchList({id:e}).pipe(r.take(1)):t.of()},a.prototype.searchIrlStationsLocations=function(a,i){return a.length>2?(null==i||i.next(!0),this.searchIrlStationsFetcher.fetchList({query:a}).pipe(r.take(1),r.map((function(t){return i&&i.next(!1),t.map((function(t){return{type:e.LocationTypes.TrainStation,name:t.name+" ("+t.supplier+")",railstation:t}}))})))):t.of([])},a.prototype.getHotelLocationsList=function(a,i,n){return a.length>2?qr.UK_POSTCODE.test(a)?this.getPostcodeList(a):((null==n?void 0:n.value)||n.next(!0),t.forkJoin([this.getAirportLocations(a,i,n),this.getCityLocations(a,i,n,this.userService.userHasServiceProvider(ae.Hotel,e.ServiceProvider.Confirma)),this.getStationLocations(a,n),this.getConfirmaOffices(a)]).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,A(t)),e}),[])})))):t.of([])},a.prototype.getStationsAndAirportsList=function(e,a,i){return e.length>2?((null==i?void 0:i.value)||i.next(!0),t.forkJoin([this.getAirportLocations(e,a,i),this.getStationLocations(e,i)]).pipe(r.map((function(e){return(null==i?void 0:i.value)&&i.next(!1),e.reduce((function(e,t){return e.push.apply(e,A(t)),e}),[])})))):t.of([])},a.prototype.removeTraveller=function(e){this._removeTraveller(e),this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},a.prototype._removeTraveller=function(e){this.selectedTravellers=this.selectedTravellers.filter((function(t){return!Ot.equals(t,e)}))},a.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(a.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation()},a.prototype.addTraveller=function(e){this.travellerAlreadyAdded(e)||this.currentNoOfTravellersGreaterOrEqualToMax()||(this.selectedTravellers.push(e),this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.selectedTravellers),this.updateTravellerInformation())},a.prototype.currentNoOfTravellersGreaterOrEqualToMax=function(){return this.selectedTravellers.length>=this.maxTravellers()},a.prototype.maxTravellers=function(){return this.canUseTravellerProfile()?1:8},a.prototype.travellerAlreadyAdded=function(e){return!!this.selectedTravellers.find((function(t){return Ot.equals(t,e)}))},a.prototype.canUseTravellerProfile=function(){return!1},a.prototype.getCurrentNoOfTravellers=function(){return this.selectedTravellers.length},a.prototype.updateTravellerInformation=function(){this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.selectedTravellers),this.travellerInformation.next(A(this.selectedTravellers)),this.searches[ae.Rail]&&(this.searches[ae.Rail].railCards=new Array(this.selectedTravellers.length).fill({name:"",code:""},0,this.selectedTravellers.length))},a.prototype.determineHighestSearchPriority=function(){return this.highest_search_priority=this._getHighestSearchPriorityObject().highest},a.prototype.getHighestSearchPriorityObject=function(e){return this._getHighestSearchPriorityObject(e).currentItem},a.prototype._getHighestSearchPriorityObject=function(e){return void 0===e&&(e={}),Object.values(this.search_objects).reduce((function(t,r){var a=t.highest,i=t.currentItem;if(r.chosen&&r.priority<a){if(!e[r.type])return{highest:r.priority,currentItem:r};r.chosen=!1}return{highest:a,currentItem:i}}),{highest:Number.MAX_SAFE_INTEGER,currentItem:null})},a.prototype.getSelectedOptions=function(){var e=this;return Object.keys(this.search_objects).reduce((function(t,r){var a;return(null===(a=e.search_objects[r])||void 0===a?void 0:a.chosen)&&t.push(r),t}),[])},a.prototype.hasSimpleGuests=function(){return!1},a.prototype.setGetMeThereSearchObjects=function(){console.log("+++ Setting GetMeThere Search Objects +++"),this.search_objects=this.helpers.clone(this.getMeThereSearchObjects())},a.prototype.resetSearchParams=function(){console.log("Reseting Search Params!"),this.search_objects=this.helpers.clone(this.init_search_objects()),this.storageService.setSessionItem(a.SESSION_TRAVELLER,this.search_objects),Object.values(this.searches).forEach((function(e){e.reset()}))},a.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)},a.prototype.hasHighestSearchPriority=function(e){return this.determineHighestSearchPriority(),e<=this.highest_search_priority},a.prototype.getAllErrorMessages=function(){var e=this,t=Object.entries(this.search_objects).reduce((function(t,r){var a=S(r,2),i=a[0],n=a[1];return(null==n?void 0:n.chosen)&&e.canSearch(i)&&t.push.apply(t,A(e.searches[i].validationMessages)),t}),this.travellerValidationMessages);return this.errors.next(t),t},a.prototype.travellersContainUser=function(){var e=this;return!!this.selectedTravellers.find((function(t){return t.id===e.userService.getUserId().toString()}))},a.prototype.validateTravellers=function(){switch(this.travellerValidationMessages=[],this.userService.fullUserDetails.userData.value.booker_type){case F.SelfBook:1===this.selectedTravellers.length&&this.travellersContainUser()||this.travellerValidationMessages.push("Current user must be a traveller");break;case F.BookerWithSelf:this.selectedTravellers.length<1&&this.travellersContainUser()||(this.travellerValidationMessages.push("Please add your self."),this.traveller_error=!0);break;case F.Booker:case F.Company:case F.CompanyGroup:case F.Office:case F.Tmc:case F.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},a.prototype.findPaxInTravellers=function(e){return this.selectedTravellers.find((function(t){return e===t.email}))},a.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)},a.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}))},a.prototype.startSearches=function(e){var t,r=this;this.newSearchStarted.next(!0),this.search_loading=!0,(t=this._findSearchObtect())&&(t.chosen=!0),e?(this.router.navigate([e]),this.searches.INTERNATIONAL_RAIL&&this.submitIrlForm()):t&&!this.router.url.includes(t.resultUrl)&&this.router.navigate([t.resultUrl]);try{Promise.all(Object.values(this.searches).map((function(e){var t;return e&&r.search_objects[e.type]&&(null===(t=r.search_objects[e.type])||void 0===t?void 0:t.chosen)?e.startSearch():Promise.resolve(!1)}))).finally((function(){r.search_loading=!1,r.searchLoadingDone.next(!0)}))}catch(e){console.error(e),this.search_loading=!1,this.searchLoadingDone.next(!0)}},a.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"}])},a.prototype.getAddresses=function(e){return t.of([{House:"Cecil Court",Street:"28-36 Cecil Road",Town:"Hale",PostCode:"WA15 9PB",Country:"UK"}])},a.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}}))})))},a.prototype.deleteUserAddressByID=function(e){return this.baseDeleteUserAddressUpdater.updateOne({id:e})},a.prototype.getHotelChain=function(e,a){if(e.length>2){null==a||a.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==a||a.next(!1),t})))}return t.of([])},a.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}}))})))},a.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()},a.prototype.getAllHotelChains=function(){return this.getHotelChainsFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},a.prototype.getAllRailProviders=function(){return this.getRailProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},a.prototype.getCarHireProivders=function(){return this.getCarHireProvidersFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return{name:e}}))})))},a.prototype.getAllAirlines=function(){return this.getAllAirlinesFetcher.fetchList().pipe(r.take(1),r.map((function(e){return e.map((function(e){return e}))})))},a.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)}))})))},a.prototype.getAirportByCode=function(e){return e?this.searchAirportsFetcher.fetchOne({query:e}).pipe(r.take(1),r.map((function(e){return e}))):t.of()},a.prototype.init_search_objects=function(){return{}},a.prototype.getMeThereSearchObjects=function(){return{}},a.prototype.getSelectedtravellers=function(){return this.selectedTravellers},a.prototype.resetSearchObjects=function(){this.search_objects=this.helpers.clone(this.init_search_objects())},a.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},a.prototype.saveUserAddress=function(e){return b(this,void 0,void 0,(function(){return y(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]}}))}))},a.prototype.canBook=function(e){return!!this.userService.canBook(e)},a.prototype.isPostcodeVaild=function(e){return this.baseValidateIsPostcodeValidTester.test({postcode:e})},a.prototype.makeCabHireQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a={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(a,Object.assign.apply(Object,A([{}],t)),["departs"])},a.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,A([{}],e)),["pickup_datetime","dropoff_datetime"])},a.prototype.makeFlightQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a=this.helpers.makeMomentDayTime(),i=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(a,30),o=this.helpers.momentRoundMinutes(i,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:null,departLocation:null,fareType:j.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,A([{}],t)),["outBoundDate","inboundDate"])},a.prototype.makeHotelQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a={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(a,Object.assign.apply(Object,A([{}],t)),["checkin_date","checkout_date"])},a.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,A([{}],e)),["arrivalDatetime"])},a.prototype.makeParkingQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.makeMomentDayTime(),a=this.helpers.makeMomentDayTime(1),i=this.helpers.momentRoundMinutes(r,30),n=this.helpers.momentRoundMinutes(a,30),o={arrivalDatetime:i,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,A([{}],e)),["arrivalDatetime","departDatetime"])},a.prototype.makeRailQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a=this.helpers.momentRoundMinutes(l.default(),30),i={airportExpressStation:null,applyRailcards:!1,carnetTicket:!1,chosenSearchClass:Z.All,chosenSearchType:$.ReturnJourney,disableAutoDiscounts:!1,extraTime:!1,inBoundDateTime:a,isAirportExpress:!1,noOfAdults:0,noOfChildren:0,outboundCriteria:e.RailSearchCriteria.Depart,outBoundDateTime:a,prioritiseByPrice:!1,returnCriteria:e.RailSearchCriteria.Depart,travellingFrom:null,travellingTo:null,via:!1,viaLocation:null,railCards:[],transactionIdentifier:null};return this.helpers.sanatizeReturns(i,Object.assign.apply(Object,A([{}],t)),["inBoundDateTime","outBoundDateTime"])},a.prototype.makeIrlQuery=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.helpers.momentRoundMinutes(l.default(),30),a={supplier:null,countryCode:"",journeyType:V.ReturnJourney,class:null,outboundDepartureDateTime:r,departureLocationId:null,arrivalLocationId:null,adults:0,children:0,returnDepartureDateTime:r,irlDiscountCards:null};return this.helpers.sanatizeReturns(a,Object.assign.apply(Object,A([{}],e)),["returnDepartureDateTime","outboundDepartureDateTime"])},a.prototype.makeEurostarQuery=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a=this.helpers.makeMomentDayTime(),i=this.helpers.makeMomentDayTime(1),n=this.helpers.momentRoundMinutes(a,30),o=this.helpers.momentRoundMinutes(i,30),s={adults:0,arriveLocation:null,cabinClass:H.Any,children:0,chosenSearchType:e.EurostarSearchType.return,departLocation:null,fareType:j.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,A([{}],t)),["outBoundDate","inboundDate"])},a.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,A([{}],e)),["arrivalDatetime"])},a.prototype.shouldAddTravellerSubscription=function(){return!1},a.prototype.getAutoLogoutConfig=function(){return{}},a.prototype.shouldFetchAllOffices=function(){return!1},a.prototype.isFlightsGrouped=function(){return!1},a.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"},a.prototype.getUserRecentSearches=function(e,t){null==t||t.next(!0);var a={serviceType:e};return this.getUserRecentSearchesFetcher.fetchList(a).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})))},a.prototype.getUserFavouriteSearches=function(e,t){null==t||t.next(!0);var a={serviceType:e};return this.getUserFavouriteSearchesFetcher.fetchList(a).pipe(r.take(1),r.tap((function(e){null==t||t.next(!1)})))},a.prototype.deleteRecentSearchByID=function(e){return this.baseDeleteRecentSearchUpdater.updateOne({id:e})},a.prototype.deleteFavouriteSearchByID=function(e){return this.deleteFavouriteSearchUpdater.updateOne({id:e})},a.prototype.saveRecentSearch=function(e){e&&!this.selectedTravellers.find((function(e){return e.guest}))&&this.baseSaveRecentSearchUpdater.updateOne(e).pipe(r.take(1)).subscribe()},a.prototype.getCovidMicrositeToken=function(){return this.getCovidMicrositeTokenFetcher.fetchList()},a.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})))},a.prototype.searchTravellers=function(t,a){var i=this,n=this.userService.getUserBookingType();if(this.traveller_error=!1,n&&n!==F.SelfBook&&n!==F.Traveller&&t.length>=1){var o=t.toLowerCase().match(/([\w])+/g),s={};switch(a){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?i.helpers.clone(e).sort((function(e,t){return e.surname<t.surname?-1:e.surname>t.surname?1:0})):[]})))}},a.prototype.getFlightFareRules=function(e){return this.getFlightFareRulesFetcher.fetchList({flight:e})},a.prototype.getRailLiveDepartures=function(e,t){return this.getRailLiveDeparturesFetcher.fetchList({stationCode:e,departDateTime:t})},a.prototype.getFlightSeatMap=function(e){return this.getFlightSeatMapFetcher.fetchList({flight:e}).pipe(r.map((function(e){if(e)return e.results})))},a.prototype.saveFavouriteSearch=function(e){return this.baseSaveFavouriteSearchUpdater.updateOne(e)},a.prototype.getConfermaRoomImages=function(e){if(e)return this.getConfermaRoomImagesFetcher.fetchList({hotelId:e}).pipe(r.take(1))},a.prototype.emailBasket=function(e){return this.emailBasketFetcher.fetchList({id:e})},a.prototype.submitIrlForm=function(){var e,t,r=this,a=this.userService.getUserEmail(),i=this.searches[ae.InternationalRail];if(this.allSubscription.add(this.travellerInformation.subscribe((function(r){t=r.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())||"Not specified",discountCard:"Discount Card "+(t+1),loyaltyCard:"Loyalty Card "+(t+1)}})),e=r[0].email?r[0].email:a}))),this.allSubscription.add(i.results.subscribe((function(e){var t,a;(null===(t=e[0])||void 0===t?void 0:t.jrfreference)&&(r.jrfReference=null===(a=e[0])||void 0===a?void 0:a.jrfreference)}))),this.jrfReference&&t){var n={trainNumber:i.trainNumber||"Any",departureStation:i.travellingFrom.name,destinationStation:i.travellingTo.name,outboundDate:i.outboundDepartureDateTime,inboundDate:i.returnDepartureDateTime,additionalInfo:i.additionalInstructions||"No additional instructions",serviceClass:i.irlClass||"Any",offlineReference:this.jrfReference,notifyEmail:a,onBehalfOf:e,passengers:t};console.log(n),this.sendOfflineNotification(n).subscribe((function(e){e.success?r.modalService.open(d.OfflineRequestDialogComponent,{centered:!0,size:"md"},{jrfReference:r.jrfReference}):r.modalService.open(d.ModalErrorComponent,{centered:!0},{error:"Unable to send offline notification"})}))}},a.prototype.sendOfflineNotification=function(e){return this.sendOfflineNotificationFetcher.fetchOne(e)},a.prototype.getCountries=function(){return this.countries},a}();ma.SESSION_TRAVELLER="search_travellers";var fa=function(){},va=function(){function t(e,t){this.modalOpenerService=e,this._jwtToken=null,this.timer=null,this.timeoutDuration=3600,this.autoLogoutConfig={},this._bobo=null,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}),Object.defineProperty(t.prototype,"bobo",{get:function(){return this._bobo},set:function(e){this._bobo=e||null},enumerable:!1,configurable:!0}),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(),this.modalOpenerService.open(d.AutoLogout,this.autoLogoutConfig,{}).then((function(t){t!==e.LogoutEnum.LOGOUT?r._updateTimer():r._jwtToken=null}))):this._updateTimer()},t}(),ba=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 a=r(e.links.segments[0],t.segments);return{seat:r(a.links.seat.toString(),t.seats),wifi:r(a.links.wifi.toString(),t.wifis),power:r(a.links.power.toString(),t.entertainments),entertainment:r(a.links.entertainment.toString(),t.entertainments),fresh_food:r(a.links.fresh_food.toString(),t.fresh_foods),beverage:r(a.links.beverage.toString(),t.beverages),layout:r(a.links.layout.toString(),t.layouts),aircraft:r(a.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,a=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())}]}})),a},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},a=e.included.reduce((function(e,r){return e[t(r.type,r.id)]=r,e}),{}),i=function(e){return a[function(e){return t(e.type,e.id)}(e)]};return e.data.relationships.legs.data.map((function(e){var t=i(e).relationships.leg_fares.data.map(i).filter((function(e){return!!e.relationships.fare.data}));return{brands:t.map((function(e){return i(e.relationships.fare.data)})).map(r),upas:t.map((function(e){return e.relationships.leg_fare_segments.data.map(i)})).map((function(e){return e.map((function(e){return e.relationships.upas.data.map(i).map((function(e){return{id:e.id,details:r(e)}})).reduce((function(e,t){return e[t.id]=t.details,e}),{})}))}))}}))},e}();f([Ve(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],ba.prototype,"getAmenitiesForFlight",null),f([Ve(),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",t.BehaviorSubject)],ba.prototype,"getUpasForFlight",null);var ya=function(e){function t(t,r){var a=e.call(this,r)||this;return a.query=t,a}return m(t,e),t.prototype.test=function(e){return this.processCall(this.query.fetch(e))},t}(p),ga=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}(ya),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.isPostcodeValid},t}(ya),Aa=function(e){function t(t,r){var a=e.call(this,r)||this;return a.query=t,a}return m(t,e),t.prototype.updateOne=function(e){return this.processCall(this.query.mutate(e))},t}(p),Ca=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}(Aa),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.addItemToBasket},t}(Aa),Da=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}(Aa),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.bookBasket},t}(Aa),ka=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}(Aa),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.moveItemToADifferentBasket},t}(Aa),_a=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}(Aa),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.removeItemFromBasket},t}(Aa),Ia=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}(Aa),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.deleteRecentSearch},t}(Aa),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.revalidateBasket},t}(Aa),Ba=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}(Aa),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.sendBasketForApproval},t}(Aa),Ma=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}(Aa),La=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}(Aa),wa=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}(Aa),ja=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}(Aa),Ha=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}(Aa),xa=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}(Aa),Ua=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}(Aa),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.confirmMessages},t}(Aa),Ga=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}(Aa),Wa=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}(Aa),Ja=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}(Aa),Qa=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}(Aa),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.editUser},t}(Aa),Ka=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}(Aa);e.AbstractHttpCallService=ia,e.AddressImpl=jt,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=Zr,e.BaseAcceptNewPriceUpdater=Ca,e.BaseAddItemToBasketUpdater=Ta,e.BaseAddUserToBasketItemUpdater=Da,e.BaseApplyJitFlightRulesFetcher=Gt,e.BaseBookBasketUpdater=Pa,e.BaseCabhireQuoteFetcher=Yt,e.BaseCancelBookingUpdater=Ga,e.BaseCarHireAvailabilityDetailFetcher=Kt,e.BaseCarhireQuoteFetcher=qt,e.BaseConfermaOfficeFetcher=zt,e.BaseConfermaOfficeNamesFetcher=Xt,e.BaseConfirmMessagesUpdater=Va,e.BaseCreateBasketUpdater=ka,e.BaseCreateGuestUpdater=Ka,e.BaseDeleteBasketUpdater=_a,e.BaseDeleteFavouriteSearchUpdater=Ja,e.BaseDeleteRecentSearchUpdater=Oa,e.BaseDeleteUserAddressUpdater=Ia,e.BaseEditUserUpdater=Ya,e.BaseEmailBasketFetcher=xr,e.BaseEnterpriseBasketService=ta,e.BaseEnterpriseMyBookingsService=ua,e.BaseEnterpriseSearch=c,e.BaseEnterpriseSearchService=ma,e.BaseEnvironment=$e,e.BaseEurostarQuoteFetcher=$t,e.BaseEventMessenager=rt,e.BaseFastTrackQuoteFetcher=Ur,e.BaseFlightQuoteFetcher=tr,e.BaseGetAllAirlinesFetcher=Jr,e.BaseGetBasketFetcher=Qt,e.BaseGetCancellationInfoFetcher=Yr,e.BaseGetCarHireProvidersFetcher=Qr,e.BaseGetCompaniesFetcher=jr,e.BaseGetCompanyFetcher=Hr,e.BaseGetConfermaRoomImagesFetcher=wr,e.BaseGetCovidMicrositeTokenFetcher=rr,e.BaseGetFlightFareRulesFetcher=er,e.BaseGetFlightSeatMapFetcher=Mr,e.BaseGetHotelChainsFetcher=Gr,e.BaseGetIrlSupplierStationFetcher=or,e.BaseGetMiAutoSugestionFetcher=pr,e.BaseGetRailLiveDeparturesFetcher=ir,e.BaseGetRailProvidersFetcher=Wr,e.BaseGetRailStationFetcher=nr,e.BaseGetRailcardsFetcher=ar,e.BaseGetRiskAlertsFetcher=sr,e.BaseGetUserBasketsFetcher=dr,e.BaseGetUserCompanyOfficesFetcher=lr,e.BaseGetUserCurrentCarbonAllowanceFetcher=ur,e.BaseGetUserFavouriteSearchesFetcher=Lr,e.BaseGetUserFetcher=Or,e.BaseGetUserGuestsFetcher=Kr,e.BaseGetUserRecentSearchesFetcher=cr,e.BaseHelperRoutines=Ye,e.BaseHotelAvalibilityQuoteFetcher=hr,e.BaseHotelAvalibilityService=aa,e.BaseHotelQuoteFetcher=mr,e.BaseHotelRulesFetcher=Jt,e.BaseIrlDiscountCardFetcher=fr,e.BaseIrlQuoteFetcher=vr,e.BaseLogonService=sa,e.BaseLoungeQuoteFetcher=br,e.BaseModalOpenerService=la,e.BaseNetworkCall=p,e.BaseParkingQuoteFetcher=yr,e.BaseRailQuoteFetcher=gr,e.BaseRemoveItemFromBasketUpdater=Ra,e.BaseRequiresReasonService=$r,e.BaseRevalidateBasketUpdater=Ea,e.BaseRouteHappyService=ba,e.BaseSaveFavouriteSearchUpdater=Wa,e.BaseSaveRecentSearchUpdater=xa,e.BaseSaveUserAddressUpdater=Ba,e.BaseSearchAirlinesFetcher=Sr,e.BaseSearchAirportsFetcher=Ar,e.BaseSearchCityFetcher=Cr,e.BaseSearchConfermaCityFetcher=Tr,e.BaseSearchConfermaQuicklistFetcher=Zt,e.BaseSearchDepotFetcher=Dr,e.BaseSearchHotelChainsFetcher=Pr,e.BaseSearchIrlStationsFetcher=kr,e.BaseSearchPostcodeFetcher=Fr,e.BaseSearchRailStationsFetcher=_r,e.BaseSearchUsersCanBookForFetcher=Rr,e.BaseSendBasketForApprovalUpdater=Na,e.BaseSendOfflineNotificationFetcher=Vr,e.BaseSetBasketItemLeadPassengerUpdater=Ma,e.BaseSetBasketItemMiGroupUpdater=La,e.BaseSetBasketItemMiValueUpdater=wa,e.BaseSetPaymentOptionUpdater=Ua,e.BaseSetUserLanguageUpdater=Qa,e.BaseStorageService=fa,e.BaseUpdateBasketNoteUpdater=Ha,e.BaseUpdateBasketTitleUpdater=ja,e.BaseUserAddressesFetcher=Ir,e.BaseUserMessagesFetcher=Er,e.BaseUserProductsFetcher=Br,e.BaseUserService=oa,e.BaseUserUiConfigsFetcher=Nr,e.BaseValidateIsPostcodeValidTester=Sa,e.BaseValidateMiFreeValueTester=ga,e.BaseWebTokenService=va,e.BasemoveBasketItemToBasket=Fa,e.BasketInfoMiDetailsImpl=Te,e.BookableBasket=He,e.CabHireEnterpriseSearch=Xe,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=ze,e.DEFAULT_FLIGHT_FILTERS=it,e.DistanceType=je,e.DocTypes=Le,e.EurostarEnterpriseSearch=Tt,e.FlightEnterpriseSearch=ct,e.Genders=we,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=mt,e.HotelFilters=ht,e.IRLEnterpriseSearch=Et,e.InternalBasket=ea,e.LimitedCache=Ue,e.LoginError=zr,e.LoungesEnterpriseSearch=ft,e.MAX_TRAVELLERS=8,e.ManagementInfoAndIsValid=be,e.Memorise=Ve,e.ModalTypes=d,e.PREFERENCE_VALUES=Me,e.ParkingEnterpriseSearch=gt,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=Ht,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=_t,e.RegExps=qr,e.SupplementaryBookingInfoImpl=Ut,e.Suppliers=ot,e.TravellerObject=Ot,e.USER_SIGNEDIN="USER_SIGNEDIN",e.USER_SIGNEDOUT=na,e.UserFavorurite=nt,e.UserInfoImpl=xt,e.ValidatorChecker=oe,e.defaultValidations=yt,e.excludedExpression=Oe,e.filtersKeys={chain:"chain",preferred:"preferred",amenitytype:"amenitytype",distanceRange:"distanceRange",extra:"extra",hotelName:"hotelName",priceRange:"priceRange",breakfastType:"breakfastType",accessibleRoomType:"accessibleRoomType"},e.includedAccessibilityExpression=Ee,e.includedExpression=Ie,e.makeManagamentInfo=Ce,e.maxTravellerWellbeing=4,e.ɵ0=et,e.ɵh=Wt,e.ɵi=Vt,e.ɵj=Aa,e.ɵk=ya,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=sabstravtech-obtservices-base.umd.min.js.map
|