PageSourceSearch

https://malaysiaaviationgroup.com.my/etc.clientlibs/mh/clientlibs/…/assets/RedeemFlightSearch-DfDsF0Jl.js

js malaysiaaviationgroup.com.my collected 2026-10-02 17:11:49 UTC 16,797 bytes, 2 lines download raw bytes

1import{_ as Be,r as g,b0 as fe,Z as ye,o as Ce,ck as ve,aw as Ae,af as ce,a8 as ke,bd as we,be as ue,K as p,R as T,c2 as Oe,m as Pe,ah as Fe,av as He,a as De,b as O,d as R,w as Ve,n as xe,f as s,h as F,j as G,O as _e,i as _,t as ae,I as We,F as Ie,x as de,cc as Le,b1 as Re,a2 as Ue,cw as Qe,cv as je,cj as Ne,ci as Me,cl as Ee,cm as Ge}from"./main-BRllkcH1.js";const Ye={name:"RedeemFlightSearch",inheritAttrs:!1},qe=Object.assign(Ye,{props:{bonusSideTrip:{type:Object,default:null},bookFlight:{type:Object,default:null},termsAndConditionsTab:{type:Object,default:null},labels:{type:Object,default:null},mobileAddOns:{type:Object,default:null},multiCity:{type:Object,default:null},isInBookingWidget:{type:Boolean,default:!1},flightSearchApiUrl:{type:String,default:""},cabinClassCashList:{type:Array,default:()=>[]},cabinClassMilesList:{type:Array,default:()=>[]},componentIdAA:{type:String,default:""},togglePointsApiURL:{type:String,default:""},signUpApiUrl:{type:String,default:""},countryVariants:{type:Array,default:()=>[]},redeemFlight:{type:Object,default:null},redeemFlightOW:{type:Object,default:null},dspBookingRedirector:{type:Object,default:null},dspBookingApiUrl:{type:String,default:""},isHideContinueYourSearchSection:{type:Boolean,default:!1},enrichAlwaysOnCountriesData:{type:Array,default:()=>[]},cabinClassMilesOWList:{type:Array,default:()=>[]}},emits:["update:active-sub-tab"],setup(Y,{expose:i,emit:he}){i();const e=Y,ne=he,d=g(null),L=g(null),q=g(null),be=g(null),M=g(null),z=window.siteName==="enrich-portal",{isMobileSubpageVisible:E}=fe({hashKey:["flight-search","flight-search-tab"],rootEl:d}),{isEditorMode:re}=ye(),l=g("book-flight"),B=g("book-flight"),f=g(!1);Ce(()=>{const t=ve(d.value,".SwitchTabContent");Ae(t==null?void 0:t[0],o=>{f.value&&Q()})});const le=()=>{f.value&&U()},se=()=>{},K=ce("booking-widget"),{isSapphireCookiePresent:Z}=ke();K.on((t,o)=>{switch(t){case"sticky:sticked":{f.value=!0,J(o);break}case"sticky:unsticked":{f.value=!1,X(o);break}}});const J=async t=>{B.value=l.value,t.resizeObserver.unobserve(t.triggerEl),Q({skipAnimation:!0});const{paused:o}=we();o.value=!0,await ue(200),t.triggerEl.classList.remove("pre-stick"),p.fromTo(t.triggerEl,{y:"-100%"},{y:0,duration:.3,overwrite:!0,onComplete:()=>{o.value=!1}})},X=async t=>{l.value=B.value,U({skipAnimation:!0}),await T(),await ue(200),t.resizeObserver.observe(t.triggerEl)},U=({skipAnimation:t=!1}={})=>{const o=d.value.querySelector(".VueTabs"),r=o.querySelector(".SubTabBookFlight .TransitionHeight"),S=d.value.querySelector(".continue-your-search-container");p.to(r,{duration:t?0:.2,height:"auto",onComplete:()=>{p.set(r,{overflow:"visible"})},overwrite:!0}),S&&p.to(S,{duration:t?0:.2,height:"auto",overwrite:!0}),p.to(o,{duration:t?0:.2,marginTop:0,overwrite:!0})},Q=async({skipAnimation:t=!1}={})=>{const r=d.value.querySelector(".VueTabs"),I=32+r.querySelector(".VueTabs .VueSwiper").offsetHeight,k=r.querySelector(".SubTabBookFlight .TransitionHeight"),w=d.value.querySelector(".continue-your-search-container");l.value="book-flight",p.set(k,{overflow:"hidden"}),p.to(k,{duration:t?0:.2,height:0,overwrite:!0}),w&&p.to(w,{duration:t?0:.2,height:0,overwrite:!0}),p.to(r,{duration:t?0:.2,marginTop:`-${I}`,overwrite:!0})},a=g(null),b=t=>{a.value.saveSearch(t)},P=async t=>{de.value&&!z&&(E.value=!0,await T()),t.payByEnrichPoints?(l.value="redeem-flight",await T(),M.value.scrollToTab("redeem-flight"),q.value.restorePastSearch(t),q.value.isExpanded=!0):(l.value="book-flight",await T(),M.value.scrollToTab("book-flight"),L.value.restorePastSearch(t),L.value.isExpanded=!0)},y=g(!1),{commitDataToBSTOverlay:H}=Oe(),D=()=>{y.value=!0},C=async t=>{de.value&&(E.value=!0,await T()),l.value="book-flight",B.value="book-flight",await T(),M.value.scrollToTab("book-flight"),L.value.updateLocationFromTo(t)},n=ce("booking-widget:book-flight");n.on(async(t,o)=>{switch(t){case"active-tab-and-fill-up-form":C(o),await T();break;default:console.log(`Unknown event: ${t}. Ignore it.`);break}});const c=ce("booking-widget:enrich-points-toggle-switch");c.on(async(t,o)=>{switch(t){case"update-toggle-switch":o==="logout"&&(l.value="book-flight",ne("update:active-sub-tab","book-flight")),await T();break;default:console.log(`Unknown event: ${t}. Ignore it.`);break}}),Pe(l,t=>{Fe([{clickName:t,clickComponentType:"Button",componentName:"FlightSearch",componentID:e.componentIdAA},{name:t,type:"other"}])});let u=!1,h=!1;Ce(()=>{const t=o=>{u||o.target.tagName!=="FORM"&&(u=!0,d.value.removeEventListener("focus",t,{capture:!0}))};d.value.addEventListener("focus",t,{capture:!0})});const V=()=>{Me(l.value)},x=t=>{h||(h=!0,Ee(t))},W=t=>t==="redeem-flight"&&!Z(),v=t=>{if(!t)return;de.value&&(E.value=!0);const o=t.subtab??"";o&&(l.value=o,ne("update:active-sub-tab",o))},m=t=>{const{registerQueryChange:o}=Le({mainTabName:t});o(v)};m("flight-search-tab"),m("enrich-flight-search");const A={props:e,emit:ne,rootEl:d,subTabBookFlightEl:L,subTabRedeemFlightEl:q,subTabBonusSideTripEl:be,vueTabsComponent:M,isEnrichPortal:z,isMobileSubpageVisible:E,isEditorMode:re,activeSubTab:l,activeSubTabPreStick:B,isSticked:f,handleRootFocusWithin:le,handleRootBlurWithin:se,bookingWidgetBus:K,isSapphire
1CookiePresent:Z,handleOnStick:J,handleOnUnstick:X,stickyExpand:U,stickyCollapse:Q,continueYourSearchComponent:a,handleSaveSearchData:b,restorePastSearch:P,isBSTOverlayVisible:y,commitDataToBSTOverlay:H,handleShowBSTOverlay:D,handleFillUpForm:C,globalBookFlightBus:n,globalBookFlightWidgetBus:c,get AAHasSentStart(){return u},set AAHasSentStart(t){u=t},get AAHasSentEnd(){return h},set AAHasSentEnd(t){h=t},triggerFlightStartEvent:V,sendFormCompleteAA:x,shouldRedirectToLogin:W,handleQueryChange:v,setupTabWatcher:m,tabClickHandler:async t=>{var o,r;(r=(o=e.bookFlight)==null?void 0:o.general)!=null&&r.isExpandOriginDropdownOnClickTab&&t==="book-flight"&&(await T(),L.value.openFromONDPicker())},MobileSubpage:Re,get useBookingWidgetSubpage(){return fe},VueTabs:Ue,SubTabRedeemFlight:Qe,SubTabTermsConditions:je,ContinueYourSearch:Ne,get useGlobalAEMState(){return ye},get onClickOutside(){return Ae},get useEventBus(){return ce},get gsap(){return p},get getAncestorBySelector(){return ve},get isMobileViewport(){return de},get useBSTOverlayInterimData(){return Oe},get pushAA_flightSearchStart(){return Me},get pushAA_flightSearchEnd(){return Ee},get pushAA_click(){return Fe},get useHeaderScroll(){return we},get sleep(){return ue},get useBookingWidgetUrlQuery(){return Le},get useAuthStore(){return ke}};return Object.defineProperty(A,"__isScriptSetup",{enumerable:!1,value:!0}),A}}),ze={class:"generic-container"},Ke={key:0,class:"title-editor-mode"},Ze={class:"flex items-center justify-center p-4"},Je={class:"inline-block ml-1"},Xe={class:"flex items-center justify-center p-4"},$e={class:"inline-block ml-1"},et={key:0,identifier:"redeem-flight"},tt={key:1,identifier:"terms-and-conditions"},ot={class:"text-center"},it={class:"generic-container mb-20"},at={class:"flex items-center justify-center p-4"},nt={class:"inline-block ml-1"},rt={class:"flex items-center justify-center p-4"},lt={class:"inline-block ml-1"},st={key:0,identifier:"multi-city"},ct={key:1,identifier:"terms-and-conditions"};function dt(Y,i,he,e,ne,d){var M,z,E,re,l,B,f,le,se,K,Z,J,X,U,Q;const L=Ge,q=He("SubTabMultiCity"),be=De("focus-within");return O(),R(Ie,null,[Ve((O(),R("div",{ref:"rootEl",class:xe(["FlightSearch multicity-variant booking-widget-subcomponent",{isEditorMode:e.isEditorMode}]),tabindex:"-1",onFocusWithin:e.handleRootFocusWithin,onBlurWithin:e.handleRootBlurWithin},[s("div",ze,[e.isEditorMode?(O(),R("h5",Ke,[F(L,{class:"mr-2 fill-current inline-block"}),i[8]||(i[8]=s("span",null,"Booking Widget: Flight Search",-1))])):G("",!0),F(e.VueTabs,{ref:"vueTabsComponent",modelValue:e.activeSubTab,"onUpdate:modelValue":[i[2]||(i[2]=a=>e.activeSubTab=a),i[3]||(i[3]=a=>Y.$emit("update:active-sub-tab",a))],dormantMode:e.isEditorMode,renderPanelsWithVShow:"",onTabClick:e.tabClickHandler},_e({default:_(()=>{var a,b,P,y,H,D,C,n,c,u,h,V,x,W,v,m,j,A,t,o,r,S,N,I,k,w,$,ee,te,oe;return[(b=(a=e.props.multiCity)==null?void 0:a.general)!=null&&b.isHideInDesktop?G("",!0):(O(),R("div",et,[F(e.SubTabRedeemFlight,{ref:"subTabRedeemFlightEl",class:"pt-6",payByEnrichPoints:!0,hideTodayDateIndicator:(y=(P=e.props.labels)==null?void 0:P.paymentType)==null?void 0:y.hideTodayDateIndicator,owGeneralDetails:e.props.redeemFlightOW.general,owOndSelection:(H=e.props.redeemFlightOW)==null?void 0:H.ondSelection,owDatePicker:(D=e.props.redeemFlightOW)==null?void 0:D.datePicker,owPassengerSelection:(C=e.props.redeemFlightOW)==null?void 0:C.passengerSelection,owPromoCode:(n=e.props.redeemFlightOW)==null?void 0:n.promoCode,owEnrichAlwaysOn:(c=e.props.redeemFlightOW)==null?void 0:c.enrichAlwaysOn,mhGeneralDetails:(u=e.props.redeemFlight)==null?void 0:u.general,mhOndSelection:(h=e.props.redeemFlight)==null?void 0:h.ondSelection,mhDatePicker:(V=e.props.redeemFlight)==null?void 0:V.datePicker,mhPassengerSelection:(x=e.props.redeemFlight)==null?void 0:x.passengerSelection,mhPromoCode:(W=e.props.redeemFlight)==null?void 0:W.promoCode,mhEnrichAlwaysOn:(v=e.props.redeemFlight)==null?void 0:v.enrichAlwaysOn,subHeaderTooltipCTATextMobileLabel:(m=e.props.mobileAddOns)==null?void 0:m.subHeaderTooltipCTATextMobileLabel,fromQuestionMobile:(j=e.props.mobileAddOns)==null?void 0:j.fromQuestionMobile,toQuestionMobile:(A=e.props.mobileAddOns)==null?void 0:A.toQuestionMobile,flightSearchApiUrl:e.props.flightSearchApiUrl,cabinClassCashList:e.props.cabinClassCashList,cabinClassMilesList:e.props.cabinClassMilesList,togglePointsApiURL:e.props.togglePointsApiURL,enableMattaToggleButton:(o=(t=e.props.labels)==null?void 0:t.mattaFair)==null?void 0:o.enableMattaToggleButton,mattaToggleButtonLabel:(S=(r=e.props.labels)==null?void 0:r.mattaFair)==null?void 0:S.mattaToggleButtonLabel,enrichAlwaysOnCountriesData:e.props.enrichAlwaysOnCountriesData,disableGeolocation:(I=(N=e.props.labels)==null?void 0:N.nearYou)==null?void 0:I.disableGeolocation,enableONDLocaleTranslation:(w=(k=e.props.labels)==null?void 0:k.ondLocale)==null?void 0:w.isEnableLocale,countryVariants:e.props.countryVariants,cabinClassMilesOWList:e.props.cabinClassMilesOWList,onSaveSearchData:i[0]||(i[0]=ie=>e.handleSaveSearchData({isBSTTab:!1,...ie})),onShowBstOverlay:e.handleShowBSTOverlay,onFormSubmission:i[1]||(i[1]=ie=>e.sendFormCompleteAA("redeem-flight"))},null,8,["hideTodayDateIndicator","owGeneralDetails","owOndSelection","owDatePicker","owPasse
1ngerSelection","owPromoCode","owEnrichAlwaysOn","mhGeneralDetails","mhOndSelection","mhDatePicker","mhPassengerSelection","mhPromoCode","mhEnrichAlwaysOn","subHeaderTooltipCTATextMobileLabel","fromQuestionMobile","toQuestionMobile","flightSearchApiUrl","cabinClassCashList","cabinClassMilesList","togglePointsApiURL","enableMattaToggleButton","mattaToggleButtonLabel","enrichAlwaysOnCountriesData","disableGeolocation","enableONDLocaleTranslation","countryVariants","cabinClassMilesOWList"])])),!((ee=($=e.props.termsAndConditionsTab)==null?void 0:$.general)!=null&&ee.isHideInDesktop)&&((te=e.props.termsAndConditionsTab)!=null&&te.showTandCTab)?(O(),R("div",tt,[F(e.SubTabTermsConditions,{content:(oe=e.props.termsAndConditionsTab)==null?void 0:oe.termsAndConditions},null,8,["content"])])):G("",!0)]}),_:2},[!((z=(M=e.props.labels)==null?void 0:M.flightType)!=null&&z.isHideInDesktopRedeemFlight)&&((re=(E=e.props.labels)==null?void 0:E.flightType)!=null&&re.redeemFlightLabel)?{name:"tab-redeem-flight",fn:_(()=>{var a,b;return[s("div",Ze,[s("span",Je,ae((b=(a=e.props.labels)==null?void 0:a.flightType)==null?void 0:b.redeemFlightLabel),
11)])]}),key:"0"}:void 0,!((B=(l=e.props.termsAndConditionsTab)==null?void 0:l.general)!=null&&B.isHideInDesktop)&&((f=e.props.termsAndConditionsTab)!=null&&f.showTandCTab)?{name:"tab-terms-and-conditions",fn:_(()=>{var a;return[s("div",Xe,[s("span",$e,ae((a=e.props.termsAndConditionsTab)==null?void 0:a.termsAndConditionsLabel),1)])]}),key:"1"}:void 0]),1032,["modelValue","dormantMode"]),e.props.isHideContinueYourSearchSection?G("",!0):(O(),We(e.ContinueYourSearch,{key:1,ref:"continueYourSearchComponent",class:"continue-your-search-container mt-5",continueYourSearchLabel:(se=(le=e.props.bookFlight)==null?void 0:le.continueYourSearch)==null?void 0:se.continueYourSearchLabel,economyLabel:(Z=(K=e.props.bookFlight)==null?void 0:K.passengerSelection)==null?void 0:Z.economyLabel,businessLabel:(X=(J=e.props.bookFlight)==null?void 0:J.passengerSelection)==null?void 0:X.businessLabel,businessSuiteLabel:(Q=(U=e.props.bookFlight)==null?void 0:U.passengerSelection)==null?void 0:Q.businessSuiteLabel,onRestorePastSearch:e.restorePastSearch},null,8,["continueYourSearchLabel","economyLabel","businessLabel","businessSuiteLabel"]))])],34)),[[be]]),F(e.MobileSubpage,{isVisible:e.isMobileSubpageVisible&&!e.isEnrichPortal,class:"text-white",style:{"--overlay-container-bg-color":"var(--secondary-blue-extradark)"},"onUpdate:isVisible":i[7]||(i[7]=a=>e.isMobileSubpageVisible=a)},{"banner-title":_(()=>[s("h1",ot,ae(Y.$t("Flight Search")),1)]),default:_(()=>{var a,b,P,y,H,D,C;return[s("div",it,[F(e.VueTabs,{ref:"vueTabsComponent",modelValue:e.activeSubTab,"onUpdate:modelValue":[i[5]||(i[5]=n=>e.activeSubTab=n),i[6]||(i[6]=n=>Y.$emit("update:active-sub-tab",n))],renderPanelsWithVShow:""},_e({default:_(()=>{var n,c,u,h,V,x,W,v,m,j,A,t,o,r,S,N,I,k,w,$,ee,te,oe,ie,ge,pe,me,Se,Te;return[(c=(n=e.props.multiCity)==null?void 0:n.general)!=null&&c.isHideInMobile?G("",!0):(O(),R("div",st,[F(q,{class:"pt-6",subHeaderTabDescription:(h=(u=e.props.multiCity)==null?void 0:u.general)==null?void 0:h.subHeaderTabDescription,subHeaderTabTooltipBody:(x=(V=e.props.multiCity)==null?void 0:V.general)==null?void 0:x.subHeaderTabTooltipBody,subHeaderTabTooltipLabel:(v=(W=e.props.multiCity)==null?void 0:W.general)==null?void 0:v.subHeaderTabTooltipLabel,note:(j=(m=e.props.multiCity)==null?void 0:m.general)==null?void 0:j.note,removeCTAText:(t=(A=e.props.multiCity)==null?void 0:A.general)==null?void 0:t.removeCTAText,addAnotherFlightCTAText:(r=(o=e.props.multiCity)==null?void 0:o.general)==null?void 0:r.addAnotherFlightCTAText,searchFlightCTAText:(N=(S=e.props.multiCity)==null?void 0:S.general)==null?void 0:N.searchFlightCTAText,ondSelection:(I=e.props.multiCity)==null?void 0:I.ondSelection,datePicker:(k=e.props.multiCity)==null?void 0:k.datePicker,passengerSelection:(w=e.props.multiCity)==null?void 0:w.passengerSelection,subHeaderTooltipCTATextMobileLabel:($=e.props.mobileAddOns)==null?void 0:$.subHeaderTooltipCTATextMobileLabel,fromQuestionMobile:(ee=e.props.mobileAddOns)==null?void 0:ee.fromQuestionMobile,toQuestionMobile:(te=e.props.mobileAddOns)==null?void 0:te.toQuestionMobile,datePickerQuestionMobile:(oe=e.props.mobileAddOns)==null?void 0:oe.datePickerQuestionMobile,passengerSelectionQuestion:(ie=e.props.mobileAddOns)==null?void 0:ie.passengerSelectionQuestion,flightSearchApiUrl:e.props.flightSearchApiUrl,cabinClassCashList:e.props.cabinClassCashList,promoCode:(ge=e.props.multiCity)==null?void 0:ge.promoCode,countryVariants:e.props.countryVariants,onFormSubmission:i[4]||(i[4]=bt=>e.sendFormCompleteAA("multi-city"))},null,8,["subHeaderTabDescription","subHeaderTabTooltipBody","subHeaderTabTooltipLabel","note","removeCTAText","addAnotherFlightCTAText","searchFlightCTAText","ondSelection","datePicker","passengerSelection","subHeaderTooltipCTATextMobileLabel","fromQuestionMobile","toQuestionMobile","datePickerQuestionMobile","passengerSelectionQuestion","flightSearchApiUrl","cabinClassCashList","promoCode","countryVariants"])])),!((me=(pe=e.props.termsAndConditionsTab)==null?void 0:pe.general)!=null&&me.isHideInMobile)&&((Se=e.props.termsAndConditionsTab)!=null&&Se.showTandCTab)?(O(),R("div",ct,[F(e.SubTabTermsConditions,{content:(Te=e.props.termsAndConditionsTab)==null?void 0:Te.termsAndConditions},null,8,["content"])])):G("",!0)]}),_:2},[!((b=(a=e.props.multiCity)==null?void 0:a.general)!=null&&b.isHideInMobile)&&((y=(P=e.props.labels)==null?void 0:P.flightType)!=null&&y.multiCityLabel)?{name:"tab-multi-city",fn:_(()=>{var n,c;return[s("div",at,[s("span",nt,ae((c=(n=e.props.labels)==null?void 0:n.flightType)==null?void 0:c.multiCityLabel),1)])]}),key:"0"}:void 0,!((D=(H=e.props.termsAndConditionsTab)==null?void 0:H.general)!=null&&D.isHideInMobile)&&((C=e.props.termsAndConditionsTab)!=null&&C.showTandCTab)?{name:"tab-terms-and-conditions",fn:_(()=>{var n;return[s("div",rt,[s("span",lt,ae((n=e.props.termsAndConditionsTab)==null?void 0:n.termsAndConditionsLabel),1)])]}),key:"1"}:void 0]),1032,["modelValue"])])]}),_:1},8,["isVisible"])],64)}const ht=Be(qe,[["render",dt],["__scopeId","data-v-d3feb02e"],["__file","RedeemFlightSearch.vue"]]);export{ht as default};
2//# sourceMappingURL=RedeemFlightSearch-DfDsF0Jl.js.map

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.