-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6372.b1b70534fecdfa80.js
1 lines (1 loc) · 5.59 KB
/
6372.b1b70534fecdfa80.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[6372],{36372:(b,p,n)=>{n.r(p),n.d(p,{BtcOrderLookupComponent:()=>j});var f=n(36895),t=n(94650),i=n(24006),g=n(83700),l=n(72506),h=n(44143),x=n(47911),E=n(6158),v=n(88001),y=n(77579),I=n(71884),m=n(63900),O=n(44671),L=n(60515);let Z=(()=>{class e{constructor(){this.container=(0,t.f3M)(i.gN,{optional:!0}),this.control=(0,t.f3M)(i.a5,{optional:!0}),this.refresh$=new y.x,this.valueChanges=this.refresh$.pipe((0,I.x)(),function k(){return(0,m.w)(O.y)}())}ngDoCheck(){var o,r;this.refresh$.next((null===(o=this.control)||void 0===o?void 0:o.valueChanges)||(null===(r=this.container)||void 0===r?void 0:r.valueChanges)||L.E)}}return e.\u0275fac=function(o){return new(o||e)},e.\u0275dir=t.lG2({type:e,selectors:[["","valueChanges",""]],outputs:{valueChanges:"valueChanges"},standalone:!0}),e})();var C=n(80529),B=n(50494),D=n(54004),a=n(97582),d=n(87067);let T=(()=>{class e{}return(0,a.gn)([(0,d.C)()],e.prototype,"data",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"errorCode",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"objectError",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"status",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"success",void 0),(0,a.gn)([(0,d.C)()],e.prototype,"traceId",void 0),e})();var A=n(49557);const N={headers:new C.WM({"Content-Type":"application/json"})};let F=(()=>{class e{constructor(o,r,c){this.http=o,this.appConfig=r,this._recaptchaService=c}checkOrderExist(o){return this._recaptchaService.getRecaptchaToken$().pipe((0,m.w)(r=>this.http.post(this.appConfig.apiB2cUrl+"b2c-ticket/check-order-exist",JSON.stringify({orderId:o,recaptcha:r}),N)),(0,D.U)(r=>(0,B.yE)(T,r,{excludeExtraneousValues:!0})))}}return e.\u0275fac=function(o){return new(o||e)(t.LFG(C.eN),t.LFG(v.qB),t.LFG(A.K))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var J=n(77492);function U(e,s){1&e&&t._UZ(0,"cf-input-hint",14),2&e&&t.Q6J("hint","M\xe3 \u0111\u01a1n h\xe0ng kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function S(e,s){1&e&&t._UZ(0,"cf-input-hint",14),2&e&&t.Q6J("hint","M\xe3 \u0111\u01a1n h\xe0ng kh\xf4ng ch\xednh x\xe1c")}let j=(()=>{class e{constructor(o,r,c,u){this.cfIconRegister=o,this.CheckOrderExistSvc=r,this.appConfig=c,this._eventLogService=u,this.isOrderIdCorrect=!0,this.isLoading=!1,this.form=(0,t.f3M)(i.qu).nonNullable.group({orderId:["",i.kI.required]}),o.registerIcons([l.YwC])}orderIdChanges(o){o&&!this.isOrderIdCorrect&&(this.isOrderIdCorrect=!0)}submit(){if(this.form.markAllAsTouched(),this.form.invalid||this.isLoading)return;const o=this.form.value.orderId;this.isLoading=!0,this.CheckOrderExistSvc.checkOrderExist(o).subscribe({next:r=>{var c;this.isOrderIdCorrect=r.data&&(null===(c=r.data)||void 0===c?void 0:c.isExist),this.isOrderIdCorrect&&(this._eventLogService.lookupBooking({booking_code:o}),window.parent.postMessage({action:"redirect",url:"DEV"===this.appConfig.env?`/order-dev.html?id=${o}`:`/order.html?id=${o}`},"*"))},error:r=>{console.error("Error checking order:",r)},complete:()=>{this.isLoading=!1}})}}return e.\u0275fac=function(o){return new(o||e)(t.Y36(l.KNP),t.Y36(F),t.Y36(v.qB),t.Y36(J.x))},e.\u0275cmp=t.Xpm({type:e,selectors:[["btc-order-lookup"]],standalone:!0,features:[t.jDz],decls:19,vars:5,consts:[[1,"h-screen","!h-[100svh]","overflow-auto","w-full","bg-[#F2F4F6]","flex","flex-col"],[1,"py-20","my-10","md:my-4","md:py-6","max-w-[764px]","md:px-3","flex","items-center","justify-center","mx-auto"],[1,"flex-1","p-10","rounded-lg","bg-white","md:flex-col","flex","gap-10","w-full","mx-auto","justify-center","items-center",3,"formGroup"],["src","/assets/images/b2c/search-order-lookup.svg","alt","search-order-lookup",1,"w-[300px]","h-[300px]","md:w-[160px]","md:h-[160px]"],[1,"flex","flex-col","gap-10","items-center","justify-center","text-center","w-full"],[1,"flex","gap-x-[10px]"],["src","/assets/images/b2c/flight-minimum.svg"],[1,"text-heading-md","uppercase","font-bold","text-red-4"],[1,"w-full","flex","text-start","flex-1"],[1,"w-full",3,"status"],["cfHeadIcon","","icon","ticket","size","small"],["cf-input","","size","medium","placeholder","Nh\u1eadp m\xe3 \u0111\u01a1n h\xe0ng","formControlName","orderId",3,"valueChanges"],["cfHint","",3,"hint",4,"ngIf"],["cf-button","","type","solid",1,"min-w-[100px]","justify-center","bg-neutral-white","w-full",3,"disabled","click"],["cfHint","",3,"hint"]],template:function(o,r){1&o&&(t.TgZ(0,"div",0),t._UZ(1,"header-btc"),t.TgZ(2,"div",1)(3,"form",2),t._UZ(4,"img",3),t.TgZ(5,"div",4)(6,"div",5),t._UZ(7,"img",6),t.TgZ(8,"div",7),t._uU(9,"tra c\u1ee9u \u0111\u01a1n h\xe0ng"),t.qZA()(),t.TgZ(10,"div",8)(11,"cf-input-group",9),t._UZ(12,"cf-icon",10),t.TgZ(13,"input",11),t.NdJ("valueChanges",function(u){return r.orderIdChanges(u)}),t.qZA(),t.YNc(14,U,1,1,"cf-input-hint",12),t.YNc(15,S,1,1,"cf-input-hint",12),t.qZA()(),t.TgZ(16,"button",13),t.NdJ("click",function(){return r.submit()}),t._uU(17," Ti\u1ebfp t\u1ee5c "),t.qZA()()()(),t._UZ(18,"footer-btc"),t.qZA()),2&o&&(t.xp6(3),t.Q6J("formGroup",r.form),t.xp6(8),t.Q6J("status",r.form.controls.orderId.invalid&&(r.form.controls.orderId.dirty||r.form.controls.orderId.touched)||!r.isOrderIdCorrect?"error":"default"),t.xp6(3),t.Q6J("ngIf",r.form.controls.orderId.hasError("required")&&(r.form.controls.orderId.touched||r.form.controls.orderId.dirty)),t.xp6(1),t.Q6J("ngIf",!(r.form.controls.orderId.hasError("required")&&(r.form.controls.orderId.touched||r.form.controls.orderId.dirty)||r.isOrderIdCorrect)),t.xp6(1),t.Q6J("disabled",r.isLoading))},dependencies:[f.ez,f.O5,g.N8,g.Xq,l.AxE,l.Sm8,i.UX,i._Y,i.Fj,i.JJ,i.JL,i.sg,i.u,h.j$,h.ND,h.BN,h.v2,Z,E.s,x.Q],styles:["[_nghost-%COMP%]{display:block}"]}),e})()}}]);