1"use strict";(self.webpackChunkviva_web=self.webpackChunkviva_web||[]).push([[2962],{37526(f,h,t){t.d(h,{D:()=>u});var u=function(d){return d.PAY_NOW="pay-now",d.PAY_LATER="pay-later",d}(u||{})},38073(f,h,t){t.d(h,{y:()=>M});var u=t(72200),d=t(141),m=t(60345),E=t(43329),v=t(52957),A=t(2615),b=t(73664);let M=(()=>{class c{static{this.\u0275fac=function(r){return new(r||c)}}static{this.\u0275mod=b.$C({type:c})}static{this.\u0275inj=A.G2t({imports:[u.MD,m.d,d.Q,E.b,v.K]})}}return c})()},6970(f,h,t){t.d(h,{F:()=>n});var u=t(74523),d=t(18359),m=t(93207),E=t(22806),v=t(7673),A=t(96354),b=t(85119),M=t(45312),c=t(79328),O=t(49556),P=t(37526),r=t(2615),T=t(71910),I=t(13845),B=t(51242),y=t(65163),D=t(46211),R=t(95398);let n=(()=>{class i{constructor(s,e,a,l,_,g){this.basketSvc=s,this.contentful=e,this.cmsConfig=a,this.bookingApiSvc=l,this.tualiadoSvc=_,this.utilsSvc=g,this.monthlyPayments=12,this.showMonthsInterestFree=!1,this.onBasketSubscription=d.yU.EMPTY,this.isZeroFare=!1,this.isTuaPaymentRequired=!0,this.isZeroFareEnabledFromCms=!1,this.MSI_BASKET_CHARGE_CODES=["VBAARO"],this.monthlyPayments=12,this.isZeroFareEnabledFromCms=this.cmsConfig.getBookingFeatureValue(O.MK.EnableMonthlyPaymentsForVZ),this.init()}ngOnDestroy(){this.onBasketSubscription.closed||this.onBasketSubscription.unsubscribe()}init(){this.onBasketSubscription=this.basketSvc.fullBasket$.subscribe(s=>{const{basket:e}=s??{};this.showMonthsInterestFree=!1,this.isZeroFare=!1;const a=this.utilsSvc.getFareFromBasket(e?.travel?.journeys[0]),l=e?.apiSource===b.R2.IB_GLOBAL;this.isZeroFare=[c.nD.VIVA_ZERO,c.nD.VIVA_BASE].includes(a)&&!this.isElligibleFlowForMonthInterestFree(e);const{installmentsAvailability:_}=e??{};_&&!l?(this.installmentsAvailability=_,this.showMonthsInterestFree=!this.isZeroFare&&_.minimumAmount>0):(this.showMonthsInterestFree=!1,this.installmentsAvailability=void 0),this.isTuaPaymentRequired=this.getIsTuaPaymentRequiredValue(s)})}get _missingAmount(){return this.installmentsAvailability?.missingAmount||0}get _minimumAmount(){return this.installmentsAvailability?.minimumAmount||0}get _isZeroFare(){return this.isZeroFare}get _showMonthsInterestFree(){return this.showMonthsInterestFree}get _upsellServicesAvailable(){return this.installmentsAvailability?.upsellServicesAvailable||!1}get _isActive(){return this._showMonthsInterestFree&&this.installmentsAvailability?.installmentsAvailable&&0===this.installmentsAvailability?.missingAmount}get banksImages(){return this.response?(0,v.of)(this.response):(this.observable||(this.observable=(0,E.H)(this.contentful.getEntries({content_type:"itemsGroup",select:"sys.id,fields","fields.code":"Bancos_MSI"})).pipe((0,A.T)(s=>{const e=[];return s.items[0].fields.items.forEach(a=>{e.push(a)}),e})),this.observable.subscribe(s=>{this.response=s,this.observable=void 0})),this.observable)}get _isTuaPaymentRequired(){return this.isTuaPaymentRequired}checkAvailability(s){const{installmentsAvailable:e,minimumAmount:a}=this.installmentsAvailability??{};return!!e||a>0&&s>=a}set _selectedMonthlyPayments(s){this.selectedMonthlyPayments=s}get _selectedMonthlyPayments(){return this.selectedMonthlyPayments}get _upsellServices(){return this.upsellServices}checkUpsellservices(){var s=this;return(0,u.A)(function*(){try{const e=yield(0,m.s)(s.getUpsellservices());s.upsellServices=e.services.filter(a=>"Baggage"===a.category)}catch(e){M.cA.production||console.error("getUpsellservices",e)}})()}getUpsellservices(){return this.bookingApiSvc.getBookingUpsellservices(this.basketSvc.basketId)}isElligibleFlowForMonthInterestFree(s){return this.isZeroFareEnabledFromCms||"Event"===s?.bookingType||!0===s?.customFields?.vivaCandy}msiBasketChargeExist(s){const{charges:e=[],misconfiguredCharges:a=[],additionalCharges:l=[]}=s?.travel??{};return[...e,...a,...l].find(_=>this.MSI_BASKET_CHARGE_CODES.includes(_?.code))}get getInstallmentsBannerContent(){return this.bannerOptions?(0,v.of)(this.bannerOptions):(this.bannerObservable||(this.bannerObservable=(0,E.H)(this.contentful.getEntries({content_type:"itemsGroup","fields.code":"BookingFlowPromos",include:10})).pipe((0,A.T)(s=>{const e=[];
1return s?.items?.[0]?.fields?.items.forEach(a=>{e.push(a.fields)}),e})),this.bannerObservable.subscribe(s=>{this.bannerOptions=s,this.bannerObservable=void 0})),this.bannerObservable)}getIsTuaPaymentRequiredValue(s){if(s?.basket?.customFields?.dyTualiadoSelection===P.D.PAY_LATER)return!1;const{isEnabled:a=!1}=this.tualiadoSvc.getTualiadoBookingDataFromFullBasket(s);return!a}static{this.\u0275fac=function(e){return new(e||i)(r.KVO(T.S),r.KVO(I.w),r.KVO(B.R),r.KVO(y.V),r.KVO(D.D),r.KVO(R.TJ))}}static{this.\u0275prov=r.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()},46211(f,h,t){t.d(h,{D:()=>y});var u=t(74523),d=t(84412),m=t(93207),E=t(10452),v=t(85119),A=t(38355),b=t(45312),M=t(78403),c=t(52339),O=t(79328),P=t(95398),r=t(2615),T=t(71910),I=t(13713),B=t(65163);let y=(()=>{class D{constructor(n,i,o){this.basket=n,this.basketApi=i,this.bookingApi=o,this.$tualiadoModalData=new d.t(void 0)}getTualiadoBookingDataPostBooking(n,i){const{apiSource:o,notifications:s=[]}=n??{},{isTualiadoProgramPostBooking:e=!1}=i?.customFields??{},a=e||this.hasTUAliadoNotification(s);if(a&&o===v.R2.REGULAR){const l=this.getTuaAmountDue(n);return{isEnabled:a,tuaIncluded:l<=0,tuaAmountDue:l}}return{isEnabled:!1,tuaIncluded:!1,tuaAmountDue:0}}setTUAliadoModalData(n,i,o,s){this.$tualiadoModalData.next({isBookingView:i,journeys:n,currency:o,isMulticity:s})}get _tualiadoModalData$(){return this.$tualiadoModalData.asObservable()}getTualiadoBookingDataFromFullBasket(n){const{basket:i,basketBooking:o}=n??{},{flowType:s,apiSource:e}=i??{},{notifications:a=[]}=o??{},l=this.hasTUAliadoNotification(a);if(s===M.zY.Booking&&e===v.R2.REGULAR&&l){const _=this.getTuaAmountDue(o),g=this.getTuaIsIncluded(o)||_<=0,C={isEnabled:l&&_>0,tuaIncluded:g,tuaAmountDue:_};if(g){const{tualiadoConfig:U}=i?.customFields??{};C.tuaIncludedReason=U?.tuaWillBeAdded?O.Hi.TuaWillBeAdded:O.Hi.TuaAdded}return C}return{isEnabled:!1,tuaIncluded:!1,tuaAmountDue:0}}hasTUAliadoNotification(n){return(0,P.lC)(n)}fareHasTuaWillBeAdded(n){const{notifications:i=[]}=n??{};return i.some(o=>o.code===O.Hi.TuaWillBeAdded)}callTuaChange(n){var i=this;return(0,u.A)(function*(){const{basket:o}=n??{},{isEnabled:s}=i.getTualiadoBookingDataFromFullBasket(n),{tualiadoConfig:e}=o?.customFields??{};if(s&&!1===e?.tuaChangeCalled)try{const{data:a,action:l}=yield(0,m.s)(i.bookingApi.checkBookingTUA(o.basketId));return l===c.UD.REFRESH_BASKET&&(yield(0,m.s)(i.basket.syncDone$)),e.tuaChangeCalled=!0,i.updateTUAliadoProgramConfig(o,e),a.status}catch(a){return void(b.cA.production||console.error("::callTuaChange::",a))}})()}updateTUAliadoProgramConfig(n,i){var o=this;return(0,u.A)(function*(){if(n&&i){const{basketId:s,bookingType:e,flowType:a}=n??{},_={basketId:s,flowType:a,bookingType:e,customFieldUpdates:[{path:"tualiadoConfig",value:i,updateType:A.R.Replace}]};yield(0,m.s)(o.basketApi.updateBasket(_))}})()}getTuaIsIncluded(n){const{journeys:i=[]}=n??{};return i.some(({tua:o})=>o?.status===E.I9.NotPaid)}getTuaAmountDue(n){const{journeys:i=[]}=n??{},o=[E.I9.NotPaid,E.I9.NotAdded];return i.filter(s=>o.includes(s.tua.status)).reduce((s,e)=>s+e.tua.amountDue.amount,0)}static{this.\u0275fac=function(i){return new(i||D)(r.KVO(T.S),r.KVO(I.U),r.KVO(B.V))}}static{this.\u0275prov=r.jDH({token:D,factory:D.\u0275fac,providedIn:"root"})}}return D})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.