-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7233.d675e4e3afd0995f.js
1 lines (1 loc) · 157 KB
/
7233.d675e4e3afd0995f.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[7233],{27233:(ae,B,h)=>{h.r(B),h.d(B,{BalanceOutsidePageComponent:()=>vt,DetailBalanceOutsideComponent:()=>Gt,ManageBalanceOutsideConsiderPageComponent:()=>cn,ManageBalanceOutsidePageComponent:()=>qt,OutsideDepositComponent:()=>z,OutsideIssueComponent:()=>Y,OutsideRefundComponent:()=>$,OutsideSurchargeComponent:()=>X,OutsideVoidComponent:()=>te});var d=h(36895),l=h(24006),S=h(82761),b=h(83700),p=h(72506),_=h(44143),q=h(19123),N=h(74713),D=(()=>{return(a=D||(D={})).DERIVATIVE="DERIVATIVE",a.SURCHARGE="SURCHARGE",a.VOID_TICKET="VOID_TICKET",a.REFUND_TICKET="REFUND_TICKET",a.DEPOSIT_BALANCE="DEPOSIT_BALANCE",D;var a})(),F=(()=>{return(a=F||(F={})).BOOKING_INFO="BOOKING_INFO",a.EXPENSE="EXPENSE",F;var a})(),O=(()=>{return(a=O||(O={})).TICKET="TICKET",a.SURCHARGE="SURCHARGE",O;var a})(),y=h(67460),I=h(76978),K=h(34541),A=h(40899),Z=h(28746),e=h(94650),w=h(64287);function re(a,s){1&a&&e._UZ(0,"cf-input-hint",16),2&a&&e.Q6J("hint","Ng\xe2n h\xe0ng kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function se(a,s){1&a&&e._UZ(0,"cf-input-hint",16),2&a&&e.Q6J("hint","S\u1ed1 ti\u1ec1n kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function le(a,s){if(1&a&&e._UZ(0,"cf-input-hint",16),2&a){const t=e.oxw();e.Q6J("hint",t.errorMsgMinAmount)}}function ce(a,s){if(1&a&&e._UZ(0,"cf-input-hint",16),2&a){const t=e.oxw();e.Q6J("hint",t.errorMsgMaxAmount)}}let z=(()=>{class a{constructor(t,n){this._fb=t,this._balanceService=n,this.valueChange=new e.vpe,this.bankOptions=[],this.ePlus=1e21,this.maxValue=1e9}ngOnChanges(){this.outsideDepositForm&&this.onAmountChange(this.outsideDepositForm.value.amount)}ngOnInit(){this.initFormGroup(),this.getListBank()}initFormGroup(){this.outsideDepositForm=this._fb.group({bankNumber:[null,l.kI.required],amount:[null,l.kI.required],description:[null]})}getListBank(){this._balanceService.getListBankInfo().subscribe({next:t=>{t.success&&(this.bankOptions=t.data.map(n=>({code:n.bankNumber,name:n.bankName})))}})}onSubmit(){this.outsideDepositForm.markAllAsTouched(),this.valueChange.emit(this.outsideDepositForm.invalid?null:this.outsideDepositForm.value)}onAmountChange(t){if(!isNaN(t)){if(t%1!=0){const n=Math.floor(t).toString();this.outsideDepositForm.get("amount").setValue(n)}t>=this.ePlus&&console.log("Gi\xe1 tr\u1ecb \u0111\xe3 \u0111\u1ea1t \u0111\u1ebfn ho\u1eb7c v\u01b0\u1ee3t qu\xe1 gi\u1edbi h\u1ea1n e+")}if(t<=0)if(Math.abs(t)>this.maxValue){const n=new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(-this.maxValue);this.errorMsgMinAmount=`Gi\xe1 tr\u1ecb t\u1ed1i thi\u1ec3u l\xe0 ${n}`,this.outsideDepositForm.get("amount").setErrors({minAmount:!0})}else this.outsideDepositForm.get("amount").setErrors(null);else if(t>this.maxValue){const n=new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(this.maxValue);this.errorMsgMaxAmount=`Gi\xe1 tr\u1ecb t\u1ed1i \u0111a l\xe0 ${n}`,this.outsideDepositForm.get("amount").setErrors({maxAmount:!0})}else this.outsideDepositForm.get("amount").setErrors(null);t||this.outsideDepositForm.get("amount").setErrors({required:!0})}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(l.qu),e.Y36(w.mO))},a.\u0275cmp=e.Xpm({type:a,selectors:[["outside-deposit"]],inputs:{balanceAmount:"balanceAmount"},outputs:{valueChange:"valueChange"},standalone:!0,features:[e.TTD,e.jDz],decls:27,vars:16,consts:[[1,"flex","flex-col","h-full"],[1,"flex","gap-x-[20px]","mb-4"],[1,"w-1","bg-primary-2-4"],[1,"text-heading-md","text-neutral-black"],[1,"bg-white","rounded","shadow-cf-md","p-6","flex","flex-col","gap-y-3"],["textField","name","valueField","code","placeholder","Ch\u1ecdn ng\xe2n h\xe0ng",1,"w-full","!max-w-full",3,"status","data","allowSearch","formControl"],["cfLabel","",1,"text-express-sm","text-black",3,"CfRequired"],["cfHint","",3,"hint",4,"ngIf"],[1,"w-full",3,"status"],["size","medium",3,"placeholder","decimal","formControl","ngModelChange"],[1,"flex","flex-col","gap-y-1.5"],["cfLabel","",1,"text-express-sm","text-black"],["placeholder","Nh\u1eadp th\xf4ng tin di\u1ec5n gi\u1ea3i",1,"w-full","placeholder:text-body-md","placeholder:text-neutral-gray-4","border","border-neutral-gray-2","rounded-[8px]","shadow-xs","px-[14px]","py-[10px]",3,"formControl"],[1,"flex","justify-between","mt-8"],["cf-button","","size","medium",3,"disabled","click"],["cfHeadIcon","","icon","check","size","small",1,"ml-2"],["cfHint","",3,"hint"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"div",2),e.TgZ(3,"div",3),e._uU(4,"Th\xf4ng tin n\u1ea1p ti\u1ec1n"),e.qZA()(),e.TgZ(5,"div",4)(6,"cf-select",5)(7,"label",6),e._uU(8," Ng\xe2n h\xe0ng nh\u1eadn "),e.qZA(),e.YNc(9,re,1,1,"cf-input-hint",7),e.qZA(),e.TgZ(10,"cf-input-group",8)(11,"label",6),e._uU(12," S\u1ed1 ti\u1ec1n n\u1ea1p "),e.qZA(),e.TgZ(13,"cf-input-number",9),e.NdJ("ngModelChange",function(o){return n.onAmountChange(o)}),e.qZA(),e.YNc(14,se,1,1,"cf-input-hint",7),e.YNc(15,le,1,1,"cf-input-hint",7),e.YNc(16,ce,1,1,"cf-input-hint",7),e.qZA(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19," Di\u1ec5n gi\u1ea3i "),e.qZA(),e.TgZ(20,"textarea",12),e._uU(21," "),e.qZA()()()(),e.TgZ(22,"div",13),e._UZ(23,"div"),e.TgZ(24,"button",14),e.NdJ("click",function(){return n.onSubmit()}),e._uU(25," Th\xeam c\xf4ng n\u1ee3 "),e._UZ(26,"cf-icon",15),e.qZA()()),2&t&&(e.xp6(6),e.Q6J("status",n.outsideDepositForm.controls.bankNumber.invalid&&(n.outsideDepositForm.controls.bankNumber.dirty||n.outsideDepositForm.controls.bankNumber.touched)?"error":"default")("data",n.bankOptions)("allowSearch",!1)("formControl",n.outsideDepositForm.controls.bankNumber),e.xp6(1),e.Q6J("CfRequired",!0),e.xp6(2),e.Q6J("ngIf",n.outsideDepositForm.controls.bankNumber.hasError("required")&&(n.outsideDepositForm.controls.bankNumber.touched||n.outsideDepositForm.controls.bankNumber.dirty)),e.xp6(1),e.Q6J("status",n.outsideDepositForm.controls.amount.invalid&&(n.outsideDepositForm.controls.amount.dirty||n.outsideDepositForm.controls.amount.touched)?"error":"default"),e.xp6(1),e.Q6J("CfRequired",!0),e.xp6(2),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n n\u1ea1p")("decimal",!1)("formControl",n.outsideDepositForm.controls.amount),e.xp6(1),e.Q6J("ngIf",n.outsideDepositForm.controls.amount.hasError("required")&&(n.outsideDepositForm.controls.amount.touched||n.outsideDepositForm.controls.amount.dirty)),e.xp6(1),e.Q6J("ngIf",n.outsideDepositForm.controls.amount.hasError("minAmount")&&(n.outsideDepositForm.controls.amount.touched||n.outsideDepositForm.controls.amount.dirty)),e.xp6(1),e.Q6J("ngIf",n.outsideDepositForm.controls.amount.hasError("maxAmount")&&(n.outsideDepositForm.controls.amount.touched||n.outsideDepositForm.controls.amount.dirty)),e.xp6(4),e.Q6J("formControl",n.outsideDepositForm.controls.description),e.xp6(4),e.Q6J("disabled",n.outsideDepositForm.invalid))},dependencies:[d.ez,d.O5,b.N8,b.Xq,l.u5,l.Fj,l.JJ,l.UX,l.oH,_.j$,_.ND,_.v2,_.lt,K.C,N.q,p.AxE,p.Sm8],encapsulation:2}),a})();var x=h(48373);const J=[{code:"",name:"Kh\xf4ng c\xf3"}];var ue=h(17489);function de(a,s){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"tr",20)(2,"td",21)(3,"cf-input-group",22),e._UZ(4,"input",23),e.qZA()(),e.TgZ(5,"td",24)(6,"cf-input-group",22),e._UZ(7,"input",25),e.qZA()(),e.TgZ(8,"td",24)(9,"cf-input-group",22)(10,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("baseFare",o))}),e.qZA()()(),e.TgZ(11,"td",24)(12,"cf-input-group",22)(13,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("vatFare",o))}),e.qZA()()(),e.TgZ(14,"td",24)(15,"cf-input-group",22)(16,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("taxFare",o))}),e.qZA()()(),e.TgZ(17,"td",24)(18,"cf-input-group",22)(19,"cf-input-number",27),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("serviceFee",o))}),e.qZA()()(),e.TgZ(20,"td",24)(21,"cf-input-group",22)(22,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("otherFee",o))}),e.qZA()()(),e.TgZ(23,"td",24),e._UZ(24,"cf-select",28),e.qZA(),e.TgZ(25,"td",24)(26,"cf-input-group",22)(27,"cf-input-number",27),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("discountPayNow",o))}),e.qZA()()(),e.TgZ(28,"td",24)(29,"cf-input-group",22)(30,"cf-input-number",27),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("discountPayLater",o))}),e.qZA()()(),e.TgZ(31,"td",29),e._uU(32),e.ALo(33,"replace"),e.ALo(34,"number"),e.qZA(),e.TgZ(35,"td",24)(36,"cf-input-group",22),e._UZ(37,"input",30),e.qZA()(),e.TgZ(38,"td",24)(39,"div",31),e.NdJ("click",function(){const i=e.CHM(t),o=i.index,r=i.$implicit,c=e.oxw();return e.KtG(c.onRemoveOutSideIssue(o,r))}),e._uU(40," X\xf3a "),e.qZA()()(),e.BQk()}if(2&a){const t=s.$implicit,n=e.oxw();e.xp6(2),e.Q6J("sticky","left"),e.xp6(1),e.Q6J("status",t.controls.ticketNumber.invalid&&(t.controls.ticketNumber.dirty||t.controls.ticketNumber.touched)?"error":"default"),e.xp6(1),e.Q6J("formControl",t.controls.ticketNumber),e.xp6(2),e.Q6J("status","default"),e.xp6(1),e.Q6J("formControl",t.controls.description),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.baseFare)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.vatFare.invalid&&(t.controls.vatFare.dirty||t.controls.vatFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.vatFare)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.taxFare.invalid&&(t.controls.taxFare.dirty||t.controls.taxFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.taxFare)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.serviceFee.invalid&&(t.controls.serviceFee.dirty||t.controls.serviceFee.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.serviceFee),e.xp6(2),e.Q6J("status",t.controls.otherFee.invalid&&(t.controls.otherFee.dirty||t.controls.otherFee.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.otherFee)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.provider.invalid&&(t.controls.provider.dirty||t.controls.provider.touched)?"error":"default")("data",n.providerOptions)("allowSearch",!1)("formControl",t.controls.provider),e.xp6(2),e.Q6J("status",t.controls.discountPayNow.invalid&&(t.controls.discountPayNow.dirty||t.controls.discountPayNow.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.discountPayNow),e.xp6(2),e.Q6J("status",t.controls.discountPayLater.invalid&&(t.controls.discountPayLater.dirty||t.controls.discountPayLater.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.discountPayLater),e.xp6(2),e.hij(" ",e.Dn7(33,40,e.lcZ(34,44,t.value.finalPrice||0),",",".")," "),e.xp6(4),e.Q6J("status",t.controls.remark.invalid&&(t.controls.remark.dirty||t.controls.remark.touched)?"error":"default"),e.xp6(1),e.Q6J("formControl",t.controls.remark)}}let Y=(()=>{class a{constructor(t,n){this._fb=t,this.cdr=n,this.previousStep=new e.vpe,this.valueChange=new e.vpe,this.OUTSIDE_STEP=F,this.providerOptions=J,this.totalBalance={baseFare:0,vatFare:0,taxFare:0,serviceFee:0,otherFee:0,discountPayNow:0,discountPayLater:0,finalPrice:0},this.finalPrice=0,this.isDisabledForm=!0,this.initLineNumber=4,this.searchChange=(i,o)=>o,this.sortChange=(i,o)=>o}ngOnInit(){this.initFormGroup(),this.outsideIssueForm.valueChanges.subscribe(()=>{this.isDisabledForm=this.listOutsideIssue.controls.every(t=>t.invalid)&&!this.outsideIssueForm.value.length})}calculateSum(t,n){this.checkDirtyNumber(t,n),this.totalBalance[t]=this.listOutsideIssue.value.reduce((o,r)=>o+(r[t]||0),0),this.getFinalPrice(n),this.totalBalance.finalPrice=this.totalBalance.baseFare+this.totalBalance.vatFare+this.totalBalance.taxFare+this.totalBalance.serviceFee+this.totalBalance.otherFee-this.totalBalance.discountPayNow}get listOutsideIssue(){return this.outsideIssueForm.get("ticketDetails")}initFormGroup(){this.outsideIssueForm=this._fb.group({ticketDetails:this._fb.array([])});for(let t=0;t<this.initLineNumber;t++)this.onAddOutSideIssue()}initTicketDetailGroup(){const t=this._fb.group({ticketNumber:[null],description:[null],baseFare:[null,l.kI.required],vatFare:[null,l.kI.required],taxFare:[null,l.kI.required],serviceFee:[null,l.kI.required],otherFee:[null,l.kI.required],discountPayNow:[null,l.kI.required],discountPayLater:[null,l.kI.required],finalPrice:[null],provider:[""],remark:[null]});if(this.bookingInfo&&["VN","QH"].includes(this.bookingInfo.airline)){const n=t.controls.ticketNumber;n.setValidators([l.kI.required]),n.updateValueAndValidity()}return t}onAddOutSideIssue(){this.listOutsideIssue.push(this.initTicketDetailGroup())}onRemoveOutSideIssue(t,n){this.listOutsideIssue.removeAt(t);const i=n.value;this.totalBalance.baseFare-=i.baseFare,this.totalBalance.vatFare-=i.vatFare,this.totalBalance.taxFare-=i.taxFare,this.totalBalance.serviceFee-=i.serviceFee,this.totalBalance.otherFee-=i.otherFee,this.totalBalance.discountPayNow-=i.discountPayNow,this.totalBalance.discountPayLater-=i.discountPayLater,this.totalBalance.finalPrice-=i.finalPrice}getFinalPrice(t){const n=t.value,i=(n.baseFare||0)+(n.vatFare||0)+(n.taxFare||0)+(n.serviceFee||0)+(0|n.otherFee)-(n.discountPayNow||0);return t.get("finalPrice").setValue(i),i||0}checkDirtyNumber(t,n){const i=n.value;i[t]&&(0,ue.isNumber)(i[t])||0===i[t]?n.controls[t].setErrors(null):n.controls[t].setErrors({required:!0})}checkValid(t){Object.values(t.controls).forEach(n=>{n.invalid&&(n.markAsDirty(),n.updateValueAndValidity({onlySelf:!0}))})}get litsTicketDetail(){return this.outsideIssueForm.get("ticketDetails")}onSubmit(){if(this.isDisabledForm)return;const t=this.litsTicketDetail.controls;for(let i=this.litsTicketDetail.length-1;i>=0;i--)t[i].invalid&&this.litsTicketDetail.removeAt(i);this.outsideIssueForm.controls.ticketDetails.controls.forEach(i=>{this.checkValid(i)}),this.outsideIssueForm.invalid||this.valueChange.emit(this.outsideIssueForm.value.ticketDetails)}onChangeStep(t){this.previousStep.emit(t)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(l.qu),e.Y36(e.sBO))},a.\u0275cmp=e.Xpm({type:a,selectors:[["outside-issue"]],hostAttrs:[1,"h-full"],inputs:{bookingInfo:"bookingInfo"},outputs:{previousStep:"previousStep",valueChange:"valueChange"},standalone:!0,features:[e.jDz],decls:97,vars:63,consts:[[1,"flex","flex-col","h-full"],[1,"flex","flex-col","bg-neutral-gray-1","rounded","shadow-cf-md"],[1,"p-4","bg-neutral-white","flex","justify-between","items-center","text-heading-sm"],[1,""],["mode","template",1,"bg-neutral-white",3,"fnSort","fnSearch"],["managerTable",""],["cf-thead",""],["cf-th","",1,"whitespace-nowrap",3,"sticky"],[1,"flex-col","w-[150px]"],["cf-th","",1,"whitespace-nowrap"],[4,"ngFor","ngForOf"],["colspan","100%","cf-td","",1,"flex","items-center","p-3","text-body-md","text-secondary-3-4","whitespace-nowrap","!bg-neutral-white","cursor-pointer",3,"sticky","click"],["icon","plus","size","small",1,"mr-2.5"],["cf-td","",1,"bg-neutral-white",3,"sticky"],[1,"py-2","px-3","text-espressive-semibold-sm","text-right"],[1,"flex","justify-between","mt-5"],["cf-button","","size","medium","type","secondary",1,"bg-white",3,"click"],["cfHeadIcon","","icon","chevron_left","size","small",1,"mr-2"],["cf-button","","size","medium",3,"disabled","click"],["cfHeadIcon","","icon","check","size","small",1,"ml-2"],[1,"border-b","border-neutral-gray-1"],["cf-td","",1,"py-2","px-3","text-body-sm","!bg-neutral-white",3,"sticky"],[1,"grow-[400]","!w-full",3,"status"],["cf-input","","size","medium","placeholder","Nh\u1eadp s\u1ed1 v\xe9",3,"formControl"],["cf-td","",1,"py-2","px-3","text-body-sm"],["cf-input","","size","medium","placeholder","Nh\u1eadp di\u1ec5n gi\u1ea3i",3,"formControl"],["size","medium",3,"placeholder","formControl","negative","ngModelChange"],["size","medium",3,"placeholder","negative","formControl","ngModelChange"],["textField","name","valueField","code","placeholder","L\u1ef1a ch\u1ecdn...",1,"!w-full","!max-w-full",3,"status","data","allowSearch","formControl"],["cf-td","",1,"py-2","px-3","text-body-sm","text-right"],["cf-input","","size","medium","placeholder","Nh\u1eadp remark",3,"formControl"],[1,"text-body-md","text-secondary-6-4","cursor-pointer",3,"click"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._uU(3," Th\xeam c\xf4ng n\u1ee3 v\xe9 "),e.qZA(),e.TgZ(4,"div",3)(5,"cf-table",4,5)(7,"thead",6)(8,"th",7)(9,"div",8),e._uU(10," S\u1ed1 v\xe9 "),e.qZA()(),e.TgZ(11,"th",9)(12,"div",8),e._uU(13," Di\u1ec5n gi\u1ea3i "),e.qZA()(),e.TgZ(14,"th",9)(15,"div",8),e._uU(16," Gi\xe1 NET "),e.qZA()(),e.TgZ(17,"th",9)(18,"div",8),e._uU(19," VAT "),e.qZA()(),e.TgZ(20,"th",9)(21,"div",8),e._uU(22," Thu\u1ebf "),e.qZA()(),e.TgZ(23,"th",9)(24,"div",8),e._uU(25," Ph\xed d\u1ecbch v\u1ee5 "),e.qZA()(),e.TgZ(26,"th",9)(27,"div",8),e._uU(28," Ph\xed kh\xe1c "),e.qZA()(),e.TgZ(29,"th",9)(30,"div",8),e._uU(31," Nh\xe0 cung c\u1ea5p "),e.qZA()(),e.TgZ(32,"th",9)(33,"div",8),e._uU(34," Chi\u1ebft kh\u1ea5u tr\u1ea3 ngay "),e.qZA()(),e.TgZ(35,"th",9)(36,"div",8),e._uU(37," Chi\u1ebft kh\u1ea5u tr\u1ea3 sau "),e.qZA()(),e.TgZ(38,"th",9)(39,"div",8),e._uU(40," Gi\xe1 cu\u1ed1i "),e.qZA()(),e.TgZ(41,"th",9)(42,"div",8),e._uU(43," Remark "),e.qZA()(),e.TgZ(44,"th",9),e._uU(45," Ch\u1ee9c n\u0103ng "),e.qZA()(),e.TgZ(46,"tbody"),e.YNc(47,de,41,46,"ng-container",10),e.TgZ(48,"tr")(49,"td",11),e.NdJ("click",function(){return n.onAddOutSideIssue()}),e._UZ(50,"cf-icon",12),e._uU(51," Th\xeam "),e.qZA()()(),e.TgZ(52,"tfoot")(53,"tr"),e._UZ(54,"td",13)(55,"td"),e.TgZ(56,"td",14),e._uU(57),e.ALo(58,"replace"),e.ALo(59,"number"),e.qZA(),e.TgZ(60,"td",14),e._uU(61),e.ALo(62,"replace"),e.ALo(63,"number"),e.qZA(),e.TgZ(64,"td",14),e._uU(65),e.ALo(66,"replace"),e.ALo(67,"number"),e.qZA(),e.TgZ(68,"td",14),e._uU(69),e.ALo(70,"replace"),e.ALo(71,"number"),e.qZA(),e.TgZ(72,"td",14),e._uU(73),e.ALo(74,"replace"),e.ALo(75,"number"),e.qZA(),e._UZ(76,"td"),e.TgZ(77,"td",14),e._uU(78),e.ALo(79,"replace"),e.ALo(80,"number"),e.qZA(),e.TgZ(81,"td",14),e._uU(82),e.ALo(83,"replace"),e.ALo(84,"number"),e.qZA(),e.TgZ(85,"td",14),e._uU(86),e.ALo(87,"replace"),e.ALo(88,"number"),e.qZA(),e._UZ(89,"td"),e.qZA()()()()(),e.TgZ(90,"div",15)(91,"button",16),e.NdJ("click",function(){return n.onChangeStep(n.OUTSIDE_STEP.BOOKING_INFO)}),e._UZ(92,"cf-icon",17),e._uU(93," Quay l\u1ea1i "),e.qZA(),e.TgZ(94,"button",18),e.NdJ("click",function(){return n.onSubmit()}),e._uU(95," Th\xeam c\xf4ng n\u1ee3 "),e._UZ(96,"cf-icon",19),e.qZA()()()),2&t&&(e.xp6(5),e.Q6J("fnSort",n.sortChange)("fnSearch",n.searchChange),e.xp6(3),e.Q6J("sticky","left"),e.xp6(39),e.Q6J("ngForOf",n.listOutsideIssue.controls),e.xp6(2),e.Q6J("sticky","left"),e.xp6(5),e.Q6J("sticky","left"),e.xp6(3),e.hij(" ",e.Dn7(58,15,e.lcZ(59,19,(null==n.totalBalance?null:n.totalBalance.baseFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(62,21,e.lcZ(63,25,(null==n.totalBalance?null:n.totalBalance.vatFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(66,27,e.lcZ(67,31,(null==n.totalBalance?null:n.totalBalance.taxFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(70,33,e.lcZ(71,37,(null==n.totalBalance?null:n.totalBalance.serviceFee)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(74,39,e.lcZ(75,43,(null==n.totalBalance?null:n.totalBalance.otherFee)||0),",",".")," "),e.xp6(5),e.hij(" ",e.Dn7(79,45,e.lcZ(80,49,(null==n.totalBalance?null:n.totalBalance.discountPayNow)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(83,51,e.lcZ(84,55,(null==n.totalBalance?null:n.totalBalance.discountPayLater)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(87,57,e.lcZ(88,61,(null==n.totalBalance?null:n.totalBalance.finalPrice)||0),",",".")," "),e.xp6(8),e.Q6J("disabled",n.isDisabledForm))},dependencies:[d.ez,d.sg,d.JJ,b.N8,b.Xq,l.u5,l.Fj,l.JJ,l.UX,l.oH,x.rC,x.E_,x.zs,x.qS,_.j$,_.ND,_.BN,_.lt,p.AxE,p.Sm8,N.q,I.AS],encapsulation:2}),a})();function pe(a,s){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"tr",27)(2,"td",28)(3,"cf-input-group",29),e._UZ(4,"input",30),e.qZA()(),e.TgZ(5,"td",31)(6,"cf-input-group",29),e._UZ(7,"input",32),e.qZA()(),e.TgZ(8,"td",31)(9,"cf-input-group",29)(10,"cf-input-number",33),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("baseFare",o))}),e.qZA()()(),e.TgZ(11,"td",31)(12,"cf-input-group",29)(13,"cf-input-number",34),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("vatFare",o))}),e.qZA()()(),e.TgZ(14,"td",31)(15,"cf-input-group",29)(16,"cf-input-number",34),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("taxFare",o))}),e.qZA()()(),e.TgZ(17,"td",31)(18,"cf-input-group",29)(19,"cf-input-number",33),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("serviceFee",o))}),e.qZA()()(),e.TgZ(20,"td",31)(21,"cf-input-group",29)(22,"cf-input-number",33),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("otherFee",o))}),e.qZA()()(),e.TgZ(23,"td",31),e._UZ(24,"cf-select",35),e.qZA(),e.TgZ(25,"td",31)(26,"cf-input-group",29)(27,"cf-input-number",33),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("discountPayNow",o))}),e.qZA()()(),e.TgZ(28,"td",31)(29,"cf-input-group",29)(30,"cf-input-number",33),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("discountPayLater",o))}),e.qZA()()(),e.TgZ(31,"td",36),e._uU(32),e.ALo(33,"replace"),e.ALo(34,"number"),e.qZA(),e.TgZ(35,"td",31)(36,"cf-input-group",29),e._UZ(37,"input",37),e.qZA()(),e.TgZ(38,"td",38)(39,"div",39),e.NdJ("click",function(){const i=e.CHM(t),o=i.index,r=i.$implicit,c=e.oxw();return e.KtG(c.onRemoveOutSideRefund(o,r))}),e._uU(40," X\xf3a "),e.qZA()()(),e.BQk()}if(2&a){const t=s.$implicit,n=e.oxw();e.xp6(2),e.Q6J("sticky","left"),e.xp6(1),e.Q6J("status",t.controls.ticketNumber.invalid&&(t.controls.ticketNumber.dirty||t.controls.ticketNumber.touched)?"error":"default"),e.xp6(1),e.Q6J("formControl",t.controls.ticketNumber),e.xp6(2),e.Q6J("status","default"),e.xp6(1),e.Q6J("formControl",t.controls.description),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.baseFare)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.vatFare.invalid&&(t.controls.vatFare.dirty||t.controls.vatFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.vatFare),e.xp6(2),e.Q6J("status",t.controls.taxFare.invalid&&(t.controls.taxFare.dirty||t.controls.taxFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.taxFare),e.xp6(2),e.Q6J("status",t.controls.serviceFee.invalid&&(t.controls.serviceFee.dirty||t.controls.serviceFee.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.serviceFee)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.otherFee.invalid&&(t.controls.otherFee.dirty||t.controls.otherFee.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.otherFee)("negative",!1)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.provider.invalid&&(t.controls.provider.dirty||t.controls.provider.touched)?"error":"default")("data",n.providerOptions)("allowSearch",!1)("formControl",t.controls.provider),e.xp6(2),e.Q6J("status",t.controls.discountPayNow.invalid&&(t.controls.discountPayNow.dirty||t.controls.discountPayNow.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.discountPayNow)("negative",!1)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.discountPayLater.invalid&&(t.controls.discountPayLater.dirty||t.controls.discountPayLater.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.discountPayLater)("negative",!1),e.xp6(2),e.hij(" ",e.Dn7(33,43,e.lcZ(34,47,t.value.finalPrice||0),",",".")," "),e.xp6(4),e.Q6J("status",t.controls.remark.invalid&&(t.controls.remark.dirty||t.controls.remark.touched)?"error":"default"),e.xp6(1),e.Q6J("formControl",t.controls.remark),e.xp6(1),e.Q6J("sticky","right")}}let $=(()=>{class a{constructor(t){this._fb=t,this.previousStep=new e.vpe,this.valueChange=new e.vpe,this.OUTSIDE_STEP=F,this.providerOptions=J,this.totalBalance={baseFare:0,vatFare:0,taxFare:0,serviceFee:0,otherFee:0,discountPayNow:0,discountPayLater:0,finalPrice:0},this.finalPrice=0,this.isDisabledForm=!0,this.initLineNumber=4,this.searchChange=(n,i)=>i,this.sortChange=(n,i)=>i}ngOnInit(){this.initFormGroup(),this.outsideRefundForm.valueChanges.subscribe(()=>{this.isDisabledForm=this.listOutsideRefund.controls.every(t=>t.invalid)&&!this.outsideRefundForm.value.length})}initFormGroup(){this.outsideRefundForm=this._fb.group({ticketDetails:this._fb.array([])});for(let t=0;t<this.initLineNumber;t++)this.onAddOutSideRefund()}get listOutsideRefund(){return this.outsideRefundForm.get("ticketDetails")}initRefundDetailGroup(){const t=this._fb.group({ticketNumber:[null],description:[null],baseFare:[null,l.kI.required],vatFare:[null,l.kI.required],taxFare:[null,l.kI.required],serviceFee:[null,l.kI.required],otherFee:[null,l.kI.required],discountPayNow:[null,l.kI.required],discountPayLater:[null,l.kI.required],finalPrice:[null],provider:[""],remark:[null]});if(this.bookingInfo&&!["VJ"].includes(this.bookingInfo.airline)){const n=t.controls.ticketNumber;n.setValidators([l.kI.required]),n.updateValueAndValidity()}return t}onAddOutSideRefund(){this.listOutsideRefund.push(this.initRefundDetailGroup())}onRemoveOutSideRefund(t,n){this.listOutsideRefund.removeAt(t);const i=n.value;this.totalBalance.baseFare-=i.baseFare,this.totalBalance.vatFare-=i.vatFare,this.totalBalance.taxFare-=i.taxFare,this.totalBalance.serviceFee-=i.serviceFee,this.totalBalance.otherFee-=i.otherFee,this.totalBalance.discountPayNow-=i.discountPayNow,this.totalBalance.discountPayLater-=i.discountPayLater,this.totalBalance.finalPrice-=i.finalPrice}getFinalPrice(t){const n=t.value,i=(n.baseFare||0)+(n.vatFare||0)+(n.taxFare||0)+(n.serviceFee||0)+(0|n.otherFee)-(n.discountPayNow||0);return t.get("finalPrice").setValue(i),i||0}calculateSum(t,n){this.checkDirtyNumber(t,n),this.totalBalance[t]=this.listOutsideRefund.value.reduce((o,r)=>o+(r[t]||0),0),this.getFinalPrice(n),this.totalBalance.finalPrice=this.totalBalance.baseFare+this.totalBalance.vatFare+this.totalBalance.taxFare+this.totalBalance.serviceFee+this.totalBalance.otherFee-this.totalBalance.discountPayNow}checkDirtyNumber(t,n){const i=n.value;n.controls[t].setErrors(i[t]||0===i[t]?null:{required:!0})}checkValid(t){Object.values(t.controls).forEach(n=>{n.invalid&&(n.markAsDirty(),n.updateValueAndValidity({onlySelf:!0}))})}onSubmit(){if(this.outsideRefundForm.controls.ticketDetails.controls.forEach(i=>{this.checkValid(i)}),this.isDisabledForm)return;const t=this.listOutsideRefund.controls;for(let i=this.listOutsideRefund.length-1;i>=0;i--)t[i].invalid&&this.listOutsideRefund.removeAt(i);this.outsideRefundForm.controls.ticketDetails.controls.forEach(i=>{this.checkValid(i)}),this.outsideRefundForm.invalid||this.valueChange.emit(this.outsideRefundForm.value.ticketDetails)}onChangeStep(t){this.previousStep.emit(t)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(l.qu))},a.\u0275cmp=e.Xpm({type:a,selectors:[["outside-refund"]],inputs:{bookingInfo:"bookingInfo"},outputs:{previousStep:"previousStep",valueChange:"valueChange"},standalone:!0,features:[e.jDz],decls:106,vars:65,consts:[[1,"flex","flex-col","h-full"],[1,"rounded","bg-[#F0EAF4]","text-neutral-gray-6","p-4","flex","justify-between","gap-x-2.5"],[1,"flex","items-start","gap-x-2"],["icon","info","size","small",1,"text-secondary-2-4"],[1,"text-express-md"],[1,"text-body-md-short"],[1,"bg-neutral-white","mt-2.5","rounded"],[1,"p-4","bg-neutral-white","flex","justify-between","items-center","text-heading-sm"],[1,"flex-1"],[1,"bg-neutral-white",3,"mode","fnSort","fnSearch"],["managerTable",""],["cf-thead",""],["cf-th","",1,"whitespace-nowrap",3,"sticky"],[1,"flex-col","w-[150px]"],["cf-th","",1,"whitespace-nowrap"],[1,"w-[150px]"],[4,"ngFor","ngForOf"],["colspan","100%","cf-td","",1,"flex","items-center","p-3","text-body-md","text-secondary-3-4","whitespace-nowrap","cursor-pointer","!bg-neutral-white",3,"sticky","click"],["icon","plus","size","small",1,"mr-2.5"],["cf-td","",1,"bg-neutral-white",3,"sticky"],[1,"py-2","px-3","text-espressive-semibold-sm","text-right"],[1,"h-10","bg-neutral-white"],[1,"flex","justify-between","mt-5"],["cf-button","","size","medium","type","secondary",1,"bg-white",3,"click"],["cfHeadIcon","","icon","chevron_left","size","small",1,"mr-2"],["cf-button","","size","medium",3,"disabled","click"],["cfHeadIcon","","icon","plus","size","small",1,"mr-2.5"],[1,"border-b","border-neutral-gray-1"],["cf-td","",1,"py-2","px-3","text-body-sm","!bg-neutral-white",3,"sticky"],[1,"grow-[400]","!w-full",3,"status"],["cf-input","","size","medium","placeholder","Nh\u1eadp s\u1ed1 v\xe9",3,"formControl"],["cf-td","",1,"py-2","px-3","text-body-sm"],["cf-input","","size","medium","placeholder","Nh\u1eadp di\u1ec5n gi\u1ea3i",3,"formControl"],["size","medium",3,"placeholder","formControl","negative","ngModelChange"],["size","medium",3,"placeholder","negative","formControl","ngModelChange"],["textField","name","valueField","code","placeholder","L\u1ef1a ch\u1ecdn...",1,"!w-full","!max-w-full",3,"status","data","allowSearch","formControl"],["cf-td","",1,"py-2","px-3","text-body-sm","text-right"],["cf-input","","size","medium","placeholder","Nh\u1eadp remark",3,"formControl"],["cf-td","",1,"py-2","px-3","text-body-sm","bg-neutral-white",3,"sticky"],[1,"text-body-md","text-secondary-6-4","cursor-pointer",3,"click"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._UZ(3,"cf-icon",3),e.TgZ(4,"div")(5,"div",4),e._uU(6,"C\xf4ng n\u1ee3 Refund c\u1ea7n x\xe9t duy\u1ec7t tr\u01b0\u1edbc"),e.qZA(),e.TgZ(7,"div",5),e._uU(8," C\xe1c c\xf4ng n\u1ee3 Refund sau khi t\u1ea1o s\u1ebd \u0111\u01b0\u1ee3c g\u1eedi \u0111\u1ebfn b\u1ed9 ph\u1eadn K\u1ebf to\xe1n \u0111\u1ec3 \u0111\u01b0\u1ee3c x\xe9t duy\u1ec7t tr\u01b0\u1edbc khi ghi nh\u1eadn v\xe0o c\xf4ng n\u1ee3 c\u1ee7a \u0111\u1ea1i l\xfd. "),e.qZA()()()(),e.TgZ(9,"div",6)(10,"div",7),e._uU(11," Th\xeam c\xf4ng n\u1ee3 refund "),e.qZA(),e.TgZ(12,"div",8)(13,"cf-table",9,10)(15,"thead",11)(16,"th",12)(17,"div",13),e._uU(18," S\u1ed1 v\xe9 "),e.qZA()(),e.TgZ(19,"th",14)(20,"div",15),e._uU(21," Di\u1ec5n gi\u1ea3i "),e.qZA()(),e.TgZ(22,"th",14)(23,"div",13),e._uU(24," Gi\xe1 Net "),e.qZA()(),e.TgZ(25,"th",14)(26,"div",13),e._uU(27," VAT "),e.qZA()(),e.TgZ(28,"th",14)(29,"div",13),e._uU(30," Thu\u1ebf "),e.qZA()(),e.TgZ(31,"th",14)(32,"div",13),e._uU(33," Ph\xed d\u1ecbch v\u1ee5 "),e.qZA()(),e.TgZ(34,"th",14)(35,"div",13),e._uU(36," Ph\xed kh\xe1c "),e.qZA()(),e.TgZ(37,"th",14)(38,"div",13),e._uU(39," Nh\xe0 cung c\u1ea5p "),e.qZA()(),e.TgZ(40,"th",14)(41,"div",13),e._uU(42," Chi\u1ebft kh\u1ea5u tr\u1ea3 ngay "),e.qZA()(),e.TgZ(43,"th",14)(44,"div",13),e._uU(45," Chi\u1ebft kh\u1ea5u tr\u1ea3 sau "),e.qZA()(),e.TgZ(46,"th",14)(47,"div",13),e._uU(48," Gi\xe1 cu\u1ed1i "),e.qZA()(),e.TgZ(49,"th",14)(50,"div",13),e._uU(51," Remark "),e.qZA()(),e.TgZ(52,"th",12),e._uU(53,"Ch\u1ee9c n\u0103ng"),e.qZA()(),e.TgZ(54,"tbody"),e.YNc(55,pe,41,49,"ng-container",16),e.TgZ(56,"tr")(57,"td",17),e.NdJ("click",function(){return n.onAddOutSideRefund()}),e._UZ(58,"cf-icon",18),e._uU(59," Th\xeam "),e.qZA()()(),e.TgZ(60,"tfoot")(61,"tr"),e._UZ(62,"td",19)(63,"td"),e.TgZ(64,"td",20),e._uU(65),e.ALo(66,"replace"),e.ALo(67,"number"),e.qZA(),e.TgZ(68,"td",20),e._uU(69),e.ALo(70,"replace"),e.ALo(71,"number"),e.qZA(),e.TgZ(72,"td",20),e._uU(73),e.ALo(74,"replace"),e.ALo(75,"number"),e.qZA(),e.TgZ(76,"td",20),e._uU(77),e.ALo(78,"replace"),e.ALo(79,"number"),e.qZA(),e.TgZ(80,"td",20),e._uU(81),e.ALo(82,"replace"),e.ALo(83,"number"),e.qZA(),e._UZ(84,"td"),e.TgZ(85,"td",20),e._uU(86),e.ALo(87,"replace"),e.ALo(88,"number"),e.qZA(),e.TgZ(89,"td",20),e._uU(90),e.ALo(91,"replace"),e.ALo(92,"number"),e.qZA(),e.TgZ(93,"td",20),e._uU(94),e.ALo(95,"replace"),e.ALo(96,"number"),e.qZA(),e._UZ(97,"td"),e.qZA()()()(),e._UZ(98,"div",21),e.qZA(),e.TgZ(99,"div",22)(100,"button",23),e.NdJ("click",function(){return n.onChangeStep(n.OUTSIDE_STEP.BOOKING_INFO)}),e._UZ(101,"cf-icon",24),e._uU(102," Quay l\u1ea1i "),e.qZA(),e.TgZ(103,"button",25),e.NdJ("click",function(){return n.onSubmit()}),e._UZ(104,"cf-icon",26),e._uU(105," Th\xeam c\xf4ng n\u1ee3 "),e.qZA()()()),2&t&&(e.xp6(13),e.Q6J("mode","template")("fnSort",n.sortChange)("fnSearch",n.searchChange),e.xp6(3),e.Q6J("sticky","left"),e.xp6(36),e.Q6J("sticky","right"),e.xp6(3),e.Q6J("ngForOf",n.listOutsideRefund.controls),e.xp6(2),e.Q6J("sticky","left"),e.xp6(5),e.Q6J("sticky","left"),e.xp6(3),e.hij(" ",e.Dn7(66,17,e.lcZ(67,21,(null==n.totalBalance?null:n.totalBalance.baseFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(70,23,e.lcZ(71,27,(null==n.totalBalance?null:n.totalBalance.vatFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(74,29,e.lcZ(75,33,(null==n.totalBalance?null:n.totalBalance.taxFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(78,35,e.lcZ(79,39,(null==n.totalBalance?null:n.totalBalance.serviceFee)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(82,41,e.lcZ(83,45,(null==n.totalBalance?null:n.totalBalance.otherFee)||0),",",".")," "),e.xp6(5),e.hij(" ",e.Dn7(87,47,e.lcZ(88,51,(null==n.totalBalance?null:n.totalBalance.discountPayNow)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(91,53,e.lcZ(92,57,(null==n.totalBalance?null:n.totalBalance.discountPayLater)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(95,59,e.lcZ(96,63,(null==n.totalBalance?null:n.totalBalance.finalPrice)||0),",",".")," "),e.xp6(9),e.Q6J("disabled",n.isDisabledForm))},dependencies:[d.ez,d.sg,d.JJ,b.N8,b.Xq,x.rC,x.E_,x.zs,x.qS,_.j$,_.ND,_.BN,_.lt,p.AxE,p.Sm8,l.u5,l.Fj,l.JJ,l.UX,l.oH,N.q,I.AS],encapsulation:2}),a})();function ge(a,s){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"tr",20)(2,"td",21)(3,"cf-input-group",22),e._UZ(4,"input",23),e.qZA()(),e.TgZ(5,"td",24)(6,"cf-input-group",22),e._UZ(7,"input",25),e.qZA()(),e.TgZ(8,"td",24)(9,"cf-input-group",22)(10,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("baseFare",o))}),e.qZA()()(),e.TgZ(11,"td",24)(12,"cf-input-group",22)(13,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("vatFare",o))}),e.qZA()()(),e.TgZ(14,"td",24)(15,"cf-input-group",22)(16,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("taxFare",o))}),e.qZA()()(),e.TgZ(17,"td",24)(18,"cf-input-group",22)(19,"cf-input-number",27),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("serviceFee",o))}),e.qZA()()(),e.TgZ(20,"td",24)(21,"cf-input-group",22)(22,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("otherFee",o))}),e.qZA()()(),e.TgZ(23,"td",24),e._UZ(24,"cf-select",28),e.qZA(),e.TgZ(25,"td",24)(26,"cf-input-group",22)(27,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("discountPayNow",o))}),e.qZA()()(),e.TgZ(28,"td",24)(29,"cf-input-group",22)(30,"cf-input-number",26),e.NdJ("ngModelChange",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.calculateSum("discountPayLater",o))}),e.qZA()()(),e.TgZ(31,"td",29),e._uU(32),e.ALo(33,"replace"),e.ALo(34,"number"),e.qZA(),e.TgZ(35,"td",24)(36,"cf-input-group",22),e._UZ(37,"input",30),e.qZA()(),e.TgZ(38,"td",24)(39,"div",31),e.NdJ("click",function(){const i=e.CHM(t),o=i.index,r=i.$implicit,c=e.oxw();return e.KtG(c.onRemoveOutSideSurcharge(o,r))}),e._uU(40," X\xf3a "),e.qZA()()(),e.BQk()}if(2&a){const t=s.$implicit,n=e.oxw();e.xp6(2),e.Q6J("sticky","left"),e.xp6(1),e.Q6J("status","default"),e.xp6(1),e.Q6J("formControl",t.controls.ticketNumber),e.xp6(2),e.Q6J("status","default"),e.xp6(1),e.Q6J("formControl",t.controls.description),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.baseFare)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.vatFare.invalid&&(t.controls.vatFare.dirty||t.controls.vatFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.vatFare)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.taxFare.invalid&&(t.controls.taxFare.dirty||t.controls.taxFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.taxFare)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.serviceFee.invalid&&(t.controls.serviceFee.dirty||t.controls.serviceFee.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.serviceFee),e.xp6(2),e.Q6J("status",t.controls.otherFee.invalid&&(t.controls.otherFee.dirty||t.controls.otherFee.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.otherFee)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.provider.invalid&&(t.controls.provider.dirty||t.controls.provider.touched)?"error":"default")("data",n.providerOptions)("allowSearch",!1)("formControl",t.controls.provider),e.xp6(2),e.Q6J("status",t.controls.discountPayNow.invalid&&(t.controls.discountPayNow.dirty||t.controls.discountPayNow.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.discountPayNow)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.discountPayLater.invalid&&(t.controls.discountPayLater.dirty||t.controls.discountPayLater.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.discountPayLater)("negative",!1),e.xp6(2),e.hij(" ",e.Dn7(33,40,e.lcZ(34,44,t.value.finalPrice||0),",",".")," "),e.xp6(4),e.Q6J("status",t.controls.remark.invalid&&(t.controls.remark.dirty||t.controls.remark.touched)?"error":"default"),e.xp6(1),e.Q6J("formControl",t.controls.remark)}}let X=(()=>{class a{constructor(t,n){this._fb=t,this.cdr=n,this.previousStep=new e.vpe,this.valueChange=new e.vpe,this.OUTSIDE_STEP=F,this.providerOptions=J,this.totalBalance={baseFare:0,vatFare:0,taxFare:0,serviceFee:0,otherFee:0,discountPayNow:0,discountPayLater:0,finalPrice:0},this.finalPrice=0,this.isDisabledForm=!0,this.initLineNumber=4,this.searchChange=(i,o)=>o,this.sortChange=(i,o)=>o}ngOnInit(){this.initFormGroup(),this.outsideSurchargeForm.valueChanges.subscribe(()=>{this.isDisabledForm=this.listOutsideSurcharge.controls.every(t=>t.invalid)&&!this.outsideSurchargeForm.value.length})}calculateSum(t,n){this.checkDirtyNumber(t,n),this.totalBalance[t]=this.listOutsideSurcharge.value.reduce((o,r)=>o+(r[t]||0),0),this.getFinalPrice(n),this.totalBalance.finalPrice=this.totalBalance.baseFare+this.totalBalance.vatFare+this.totalBalance.taxFare+this.totalBalance.serviceFee+this.totalBalance.otherFee-this.totalBalance.discountPayNow}get listOutsideSurcharge(){return this.outsideSurchargeForm.get("ticketDetails")}initFormGroup(){this.outsideSurchargeForm=this._fb.group({ticketDetails:this._fb.array([])});for(let t=0;t<this.initLineNumber;t++)this.onAddOutSideSurcharge()}initTicketDetailGroup(){return this._fb.group({ticketNumber:[null],description:[null],baseFare:[null,l.kI.required],vatFare:[null,l.kI.required],taxFare:[null,l.kI.required],serviceFee:[null,l.kI.required],otherFee:[null,l.kI.required],discountPayNow:[null,l.kI.required],discountPayLater:[null,l.kI.required],finalPrice:[null],provider:[""],remark:[null]})}onAddOutSideSurcharge(){this.listOutsideSurcharge.push(this.initTicketDetailGroup())}onRemoveOutSideSurcharge(t,n){this.listOutsideSurcharge.removeAt(t);const i=n.value;this.totalBalance.baseFare-=i.baseFare,this.totalBalance.vatFare-=i.vatFare,this.totalBalance.taxFare-=i.taxFare,this.totalBalance.serviceFee-=i.serviceFee,this.totalBalance.otherFee-=i.otherFee,this.totalBalance.discountPayNow-=i.discountPayNow,this.totalBalance.discountPayLater-=i.discountPayLater,this.totalBalance.finalPrice-=i.finalPrice}getFinalPrice(t){const n=t.value,i=(n.baseFare||0)+(n.vatFare||0)+(n.taxFare||0)+(n.serviceFee||0)+(0|n.otherFee)-(n.discountPayNow||0);return t.get("finalPrice").setValue(i),i||0}checkDirtyNumber(t,n){const i=n.value;n.controls[t].setErrors(i[t]||0===i[t]?null:{required:!0})}checkValid(t){Object.values(t.controls).forEach(n=>{n.invalid&&(n.markAsDirty(),n.updateValueAndValidity({onlySelf:!0}))})}get litsTicketDetail(){return this.outsideSurchargeForm.get("ticketDetails")}onSubmit(){if(this.isDisabledForm)return;const t=this.litsTicketDetail.controls;for(let i=this.litsTicketDetail.length-1;i>=0;i--)t[i].invalid&&this.litsTicketDetail.removeAt(i);this.outsideSurchargeForm.controls.ticketDetails.controls.forEach(i=>{this.checkValid(i)}),this.outsideSurchargeForm.invalid||this.valueChange.emit(this.outsideSurchargeForm.value.ticketDetails)}onChangeStep(t){this.previousStep.emit(t)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(l.qu),e.Y36(e.sBO))},a.\u0275cmp=e.Xpm({type:a,selectors:[["outside-surcharge"]],hostAttrs:[1,"h-full"],inputs:{bookingInfo:"bookingInfo"},outputs:{previousStep:"previousStep",valueChange:"valueChange"},standalone:!0,features:[e.jDz],decls:97,vars:63,consts:[[1,"flex","flex-col","h-full"],[1,"flex","flex-col","bg-neutral-gray-1","rounded","shadow-cf-md"],[1,"p-4","bg-neutral-white","flex","justify-between","items-center","text-heading-sm"],[1,""],["mode","template",1,"bg-neutral-white",3,"fnSort","fnSearch"],["managerTable",""],["cf-thead",""],["cf-th","",1,"whitespace-nowrap",3,"sticky"],[1,"flex-col","w-[150px]"],["cf-th","",1,"whitespace-nowrap"],[4,"ngFor","ngForOf"],["colspan","100%","cf-td","",1,"flex","items-center","p-3","text-body-md","text-secondary-3-4","whitespace-nowrap","!bg-neutral-white","cursor-pointer",3,"sticky","click"],["icon","plus","size","small",1,"mr-2.5"],["cf-td","",1,"bg-neutral-white",3,"sticky"],[1,"py-2","px-3","text-espressive-semibold-sm","text-right"],[1,"flex","justify-between","mt-5"],["cf-button","","size","medium","type","secondary",1,"bg-white",3,"click"],["cfHeadIcon","","icon","chevron_left","size","small",1,"mr-2"],["cf-button","","size","medium",3,"disabled","click"],["cfHeadIcon","","icon","check","size","small",1,"ml-2"],[1,"border-b","border-neutral-gray-1"],["cf-td","",1,"py-2","px-3","text-body-sm","!bg-neutral-white",3,"sticky"],[1,"grow-[400]","!w-full",3,"status"],["cf-input","","size","medium","placeholder","Nh\u1eadp s\u1ed1 v\xe9",3,"formControl"],["cf-td","",1,"py-2","px-3","text-body-sm"],["cf-input","","size","medium","placeholder","Nh\u1eadp di\u1ec5n gi\u1ea3i",3,"formControl"],["size","medium",3,"placeholder","formControl","negative","ngModelChange"],["size","medium",3,"placeholder","negative","formControl","ngModelChange"],["textField","name","valueField","code","placeholder","L\u1ef1a ch\u1ecdn...",1,"!w-full","!max-w-full",3,"status","data","allowSearch","formControl"],["cf-td","",1,"py-2","px-3","text-body-sm","text-right"],["cf-input","","size","medium","placeholder","Nh\u1eadp remark",3,"formControl"],[1,"text-body-md","text-secondary-6-4","cursor-pointer",3,"click"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._uU(3," Th\xeam c\xf4ng ph\u1ee5 thu "),e.qZA(),e.TgZ(4,"div",3)(5,"cf-table",4,5)(7,"thead",6)(8,"th",7)(9,"div",8),e._uU(10," S\u1ed1 v\xe9 "),e.qZA()(),e.TgZ(11,"th",9)(12,"div",8),e._uU(13," Di\u1ec5n gi\u1ea3i "),e.qZA()(),e.TgZ(14,"th",9)(15,"div",8),e._uU(16," Gi\xe1 NET "),e.qZA()(),e.TgZ(17,"th",9)(18,"div",8),e._uU(19," VAT "),e.qZA()(),e.TgZ(20,"th",9)(21,"div",8),e._uU(22," Thu\u1ebf "),e.qZA()(),e.TgZ(23,"th",9)(24,"div",8),e._uU(25," Ph\xed d\u1ecbch v\u1ee5 "),e.qZA()(),e.TgZ(26,"th",9)(27,"div",8),e._uU(28," Ph\xed kh\xe1c "),e.qZA()(),e.TgZ(29,"th",9)(30,"div",8),e._uU(31," Nh\xe0 cung c\u1ea5p "),e.qZA()(),e.TgZ(32,"th",9)(33,"div",8),e._uU(34," Chi\u1ebft kh\u1ea5u tr\u1ea3 ngay "),e.qZA()(),e.TgZ(35,"th",9)(36,"div",8),e._uU(37," Chi\u1ebft kh\u1ea5u tr\u1ea3 sau "),e.qZA()(),e.TgZ(38,"th",9)(39,"div",8),e._uU(40," Gi\xe1 cu\u1ed1i "),e.qZA()(),e.TgZ(41,"th",9)(42,"div",8),e._uU(43," Remark "),e.qZA()(),e.TgZ(44,"th",9),e._uU(45," Ch\u1ee9c n\u0103ng "),e.qZA()(),e.TgZ(46,"tbody"),e.YNc(47,ge,41,46,"ng-container",10),e.TgZ(48,"tr")(49,"td",11),e.NdJ("click",function(){return n.onAddOutSideSurcharge()}),e._UZ(50,"cf-icon",12),e._uU(51," Th\xeam "),e.qZA()()(),e.TgZ(52,"tfoot")(53,"tr"),e._UZ(54,"td",13)(55,"td"),e.TgZ(56,"td",14),e._uU(57),e.ALo(58,"replace"),e.ALo(59,"number"),e.qZA(),e.TgZ(60,"td",14),e._uU(61),e.ALo(62,"replace"),e.ALo(63,"number"),e.qZA(),e.TgZ(64,"td",14),e._uU(65),e.ALo(66,"replace"),e.ALo(67,"number"),e.qZA(),e.TgZ(68,"td",14),e._uU(69),e.ALo(70,"replace"),e.ALo(71,"number"),e.qZA(),e.TgZ(72,"td",14),e._uU(73),e.ALo(74,"replace"),e.ALo(75,"number"),e.qZA(),e._UZ(76,"td"),e.TgZ(77,"td",14),e._uU(78),e.ALo(79,"replace"),e.ALo(80,"number"),e.qZA(),e.TgZ(81,"td",14),e._uU(82),e.ALo(83,"replace"),e.ALo(84,"number"),e.qZA(),e.TgZ(85,"td",14),e._uU(86),e.ALo(87,"replace"),e.ALo(88,"number"),e.qZA(),e._UZ(89,"td"),e.qZA()()()()(),e.TgZ(90,"div",15)(91,"button",16),e.NdJ("click",function(){return n.onChangeStep(n.OUTSIDE_STEP.BOOKING_INFO)}),e._UZ(92,"cf-icon",17),e._uU(93," Quay l\u1ea1i "),e.qZA(),e.TgZ(94,"button",18),e.NdJ("click",function(){return n.onSubmit()}),e._uU(95," Th\xeam c\xf4ng n\u1ee3 "),e._UZ(96,"cf-icon",19),e.qZA()()()),2&t&&(e.xp6(5),e.Q6J("fnSort",n.sortChange)("fnSearch",n.searchChange),e.xp6(3),e.Q6J("sticky","left"),e.xp6(39),e.Q6J("ngForOf",n.listOutsideSurcharge.controls),e.xp6(2),e.Q6J("sticky","left"),e.xp6(5),e.Q6J("sticky","left"),e.xp6(3),e.hij(" ",e.Dn7(58,15,e.lcZ(59,19,(null==n.totalBalance?null:n.totalBalance.baseFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(62,21,e.lcZ(63,25,(null==n.totalBalance?null:n.totalBalance.vatFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(66,27,e.lcZ(67,31,(null==n.totalBalance?null:n.totalBalance.taxFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(70,33,e.lcZ(71,37,(null==n.totalBalance?null:n.totalBalance.serviceFee)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(74,39,e.lcZ(75,43,(null==n.totalBalance?null:n.totalBalance.otherFee)||0),",",".")," "),e.xp6(5),e.hij(" ",e.Dn7(79,45,e.lcZ(80,49,(null==n.totalBalance?null:n.totalBalance.discountPayNow)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(83,51,e.lcZ(84,55,(null==n.totalBalance?null:n.totalBalance.discountPayLater)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(87,57,e.lcZ(88,61,(null==n.totalBalance?null:n.totalBalance.finalPrice)||0),",",".")," "),e.xp6(8),e.Q6J("disabled",n.isDisabledForm))},dependencies:[d.ez,d.sg,d.JJ,b.N8,b.Xq,l.u5,l.Fj,l.JJ,l.UX,l.oH,x.rC,x.E_,x.zs,x.qS,_.j$,_.ND,_.BN,_.lt,p.AxE,p.Sm8,N.q,I.AS],encapsulation:2}),a})();var M=h(4688),k=h(62331),W=h(24513),P=(()=>{return(a=P||(P={})).VALID="VALID",a.INVALID="INVALID",P;var a})(),ee=h(836),he=h(78372),_e=h(71884),R=h(97579);const me=["tooltip"];function fe(a,s){1&a&&e._UZ(0,"cf-icon",36)}function ve(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"cf-icon",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).$implicit,o=e.oxw();return e.KtG(o.onGetOutsideDetail(i.controls.ticketNumber.value,i))}),e.qZA()}}function xe(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"cf-icon",38),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).$implicit,o=e.oxw();return e.KtG(o.onRemoveTicket(i))}),e.qZA()}}function Ce(a,s){1&a&&(e.TgZ(0,"span"),e._uU(1,"Nh\u1eadp s\u1ed1 v\xe9 \u0111\u1ec3 b\u1eaft \u0111\u1ea7u"),e.qZA())}function be(a,s){1&a&&(e.TgZ(0,"span"),e._uU(1,"B\u1ea5m n\xfat t\xecm ki\u1ebfm ho\u1eb7c enter \u0111\u1ec3 \u0111i\u1ec1n th\xf4ng tin"),e.qZA())}function Ee(a,s){1&a&&(e.TgZ(0,"span"),e._uU(1,'B\u1ea5m n\xfat "X" \u0111\u1ec3 reset th\xf4ng tin'),e.qZA())}function Te(a,s){if(1&a&&(e.YNc(0,Ce,2,0,"span",39),e.YNc(1,be,2,0,"span",39),e.YNc(2,Ee,2,0,"span",39)),2&a){const t=e.oxw(3);e.Q6J("ngIf","INIT"===t.tooltipType),e.xp6(1),e.Q6J("ngIf","SEARCH"===t.tooltipType),e.xp6(1),e.Q6J("ngIf","RESET"===t.tooltipType)}}function ye(a,s){if(1&a&&(e.TgZ(0,"div",33,34),e.YNc(2,fe,1,0,"cf-icon",27),e.YNc(3,ve,1,0,"cf-icon",28),e.YNc(4,xe,1,0,"cf-icon",29),e.YNc(5,Te,3,3,"ng-template",null,35,e.W1O),e.qZA()),2&a){const t=e.MAs(6),n=e.oxw().$implicit;e.Q6J("manualHandle",!0)("placement","topCenter")("cfTooltip",t),e.xp6(2),e.Q6J("ngIf",!n.value.ticketNumber),e.xp6(1),e.Q6J("ngIf",n.value.ticketNumber&&!n.value.valid),e.xp6(1),e.Q6J("ngIf",n.value.valid)}}function Ae(a,s){1&a&&e._UZ(0,"cf-icon",36)}function Ze(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"cf-icon",37),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.onGetOutsideDetail(i.controls.ticketNumber.value,i))}),e.qZA()}}function Fe(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"cf-icon",38),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.onRemoveTicket(i))}),e.qZA()}}function De(a,s){1&a&&(e.TgZ(0,"cf-label",51)(1,"span"),e._uU(2,"H\u1ee3p l\u1ec7"),e.qZA()()),2&a&&e.Q6J("color","green")}function Ne(a,s){1&a&&(e.TgZ(0,"cf-label",51)(1,"span"),e._uU(2,"C\u1ea7n x\xe9t duy\u1ec7t"),e.qZA()()),2&a&&e.Q6J("color","yellow")}const ke=function(){return[]};function Se(a,s){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",40),e._uU(2),e.qZA(),e.TgZ(3,"td",41),e.YNc(4,De,3,1,"cf-label",42),e.YNc(5,Ne,3,1,"cf-label",42),e.qZA(),e.TgZ(6,"td",41)(7,"cf-input-group",43),e._UZ(8,"input",44),e.qZA()(),e.TgZ(9,"td",45)(10,"cf-input-group",43)(11,"cf-input-number",46),e.NdJ("ngModelChange",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.calculateSum("baseFare",i))}),e.qZA()()(),e.TgZ(12,"td",45)(13,"cf-input-group",43)(14,"cf-input-number",46),e.NdJ("ngModelChange",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.calculateSum("vatFare",i))}),e.qZA()()(),e.TgZ(15,"td",45)(16,"cf-input-group",43)(17,"cf-input-number",46),e.NdJ("ngModelChange",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.calculateSum("taxFare",i))}),e.qZA()()(),e.TgZ(18,"td",45)(19,"cf-input-group",43)(20,"cf-input-number",46),e.NdJ("ngModelChange",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.calculateSum("serviceFee",i))}),e.qZA()()(),e.TgZ(21,"td",45)(22,"cf-input-group",43)(23,"cf-input-number",46),e.NdJ("ngModelChange",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.calculateSum("otherFee",i))}),e.qZA()()(),e.TgZ(24,"td",45),e._UZ(25,"cf-select",47),e.qZA(),e.TgZ(26,"td",45)(27,"cf-input-group",43)(28,"cf-input-number",48),e.NdJ("ngModelChange",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.calculateSum("discountPayNow",i))}),e.qZA()()(),e.TgZ(29,"td",45)(30,"cf-input-group",43)(31,"cf-input-number",46),e.NdJ("ngModelChange",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.calculateSum("discountPayLater",i))}),e.qZA()()(),e.TgZ(32,"td",49),e._uU(33),e.ALo(34,"replace"),e.ALo(35,"number"),e.qZA(),e.TgZ(36,"td",45)(37,"cf-input-group",43),e._UZ(38,"input",50),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw().$implicit,n=e.oxw();e.xp6(2),e.hij(" ",t.value.issueTime," "),e.xp6(2),e.Q6J("ngIf",t.value.state===n.OUTSIDE_VOID.VALID),e.xp6(1),e.Q6J("ngIf",t.value.state===n.OUTSIDE_VOID.INVALID),e.xp6(2),e.Q6J("status","default"),e.xp6(1),e.Q6J("formControl",t.controls.description),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.baseFare),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.vatFare),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.taxFare),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.serviceFee),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.otherFee),e.xp6(2),e.Q6J("disabled",!0)("data",n.providerOptions||e.DdM(46,ke))("allowSearch",!1)("formControl",t.controls.provider),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("formControl",t.controls.discountPayNow)("negative",!1),e.xp6(2),e.Q6J("status",t.controls.baseFare.invalid&&(t.controls.baseFare.dirty||t.controls.baseFare.touched)?"error":"default"),e.xp6(1),e.Q6J("placeholder","Nh\u1eadp s\u1ed1 ti\u1ec1n")("negative",!1)("formControl",t.controls.discountPayLater),e.xp6(2),e.hij(" ",e.Dn7(34,40,e.lcZ(35,44,t.value.finalPrice||0),",",".")," "),e.xp6(4),e.Q6J("status","default"),e.xp6(1),e.Q6J("formControl",t.controls.remark)}}function Oe(a,s){1&a&&e._UZ(0,"td",52)}const we=function(a){return{"pointer-events-none":a}};function Ie(a,s){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"tr",22)(2,"td",23)(3,"div",24)(4,"input",25),e.NdJ("keydown.enter",function(){const o=e.CHM(t).$implicit,r=e.oxw();return e.KtG(r.onGetOutsideDetail(o.controls.ticketNumber.value,o))}),e.qZA(),e.TgZ(5,"div"),e.YNc(6,ye,7,6,"div",26),e.YNc(7,Ae,1,0,"cf-icon",27),e.YNc(8,Ze,1,0,"cf-icon",28),e.YNc(9,Fe,1,0,"cf-icon",29),e.qZA()()(),e.YNc(10,Se,39,47,"ng-container",30),e.YNc(11,Oe,1,0,"ng-template",null,31,e.W1O),e.TgZ(13,"td",23)(14,"div",32),e.NdJ("click",function(){const i=e.CHM(t),o=i.index,r=i.$implicit,c=e.oxw();return e.KtG(c.onRemoveOutSideVoid(o,r))}),e._uU(15," X\xf3a "),e.qZA()()(),e.BQk()}if(2&a){const t=s.$implicit,n=s.first,i=e.MAs(12);e.xp6(2),e.Q6J("sticky","left"),e.xp6(2),e.Q6J("formControl",t.controls.ticketNumber)("ngClass",e.VKq(10,we,t.value.valid)),e.xp6(2),e.Q6J("ngIf",n),e.xp6(1),e.Q6J("ngIf",!t.value.ticketNumber&&!n),e.xp6(1),e.Q6J("ngIf",t.value.ticketNumber&&!t.value.valid&&!n),e.xp6(1),e.Q6J("ngIf",t.value.valid&&!n),e.xp6(1),e.Q6J("ngIf",t.value.valid)("ngIfElse",i),e.xp6(3),e.Q6J("sticky","right")}}let te=(()=>{class a{constructor(t,n,i,o){this._fb=t,this._balanceService=n,this._toastService=i,this._modal=o,this.previousStep=new e.vpe,this.valueChange=new e.vpe,this.OUTSIDE_STEP=F,this.OUTSIDE_VOID=P,this.providerOptions=J,this.totalBalance={baseFare:0,vatFare:0,taxFare:0,serviceFee:0,otherFee:0,discountPayNow:0,discountPayLater:0,finalPrice:0},this.finalPrice=0,this.isDisabledForm=!0,this.initLineNumber=4,this.tooltipType="INIT",this.listeningCount=0,this.searchChange=(r,c)=>c,this.sortChange=(r,c)=>c}ngAfterViewInit(){this.tooltip.showTooltip()}ngOnInit(){this.initFormGroup(),this.outsideVoidForm.get("listVoidDetail").controls[0].valueChanges.pipe((0,he.b)(3e3),(0,_e.x)()).subscribe(i=>{i.valid||(this.tooltip.showTooltip(),this.tooltipType="SEARCH")}),this.outsideVoidForm.valueChanges.subscribe(()=>{this.isDisabledForm=this.listOutsideVoid.controls.every(i=>!i.value.valid)&&!this.outsideVoidForm.value.length})}onClick(){this.listeningCount+=1,this.listeningCount>1&&this.tooltip.hideTooltip()}initFormGroup(){this.outsideVoidForm=this._fb.group({listVoidDetail:this._fb.array([])});for(let t=0;t<this.initLineNumber;t++)this.onAddOutSideVoid()}get listOutsideVoid(){return this.outsideVoidForm.get("listVoidDetail")}initVoidDetailGroup(){return this._fb.group({ticketNumber:[null,l.kI.required],description:[null],baseFare:[null,l.kI.required],vatFare:[null,l.kI.required],taxFare:[null,l.kI.required],serviceFee:[null,l.kI.required],otherFee:[null,l.kI.required],discountPayNow:[null,l.kI.required],discountPayLater:[null,l.kI.required],finalPrice:[null],provider:[""],remark:[null],issueTime:[null],state:[null],valid:[!1]})}calculateSum(t,n){this.checkDirtyNumber(t,n),this.totalBalance[t]=this.listOutsideVoid.value.reduce((o,r)=>o+(r[t]||0),0),this.getFinalPrice(n),this.totalBalance.finalPrice=this.totalBalance.baseFare+this.totalBalance.vatFare+this.totalBalance.taxFare+this.totalBalance.serviceFee+this.totalBalance.otherFee-this.totalBalance.discountPayNow}checkDirtyNumber(t,n){const i=n.value;n.controls[t].setErrors(i[t]||0===i[t]?null:{required:!0})}onGetOutsideDetail(t,n){var i;if(this.isExistTicketNumber(t))return void this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 nh\u1eadp 1 s\u1ed1 v\xe9 nhi\u1ec1u l\u1ea7n.",sticky:!0});const o={agentId:this.agentId,ticketNumber:t,bookingCode:(null===(i=this.bookingInfo)||void 0===i?void 0:i.bookingCode)||""};this._balanceService.getTicketNumberOutside(o).subscribe({next:r=>{if(r.success&&r.data){const c={description:r.data.description,baseFare:r.data.baseFare||0,vatFare:r.data.vatFare||0,taxFare:r.data.taxFare||0,serviceFee:r.data.serviceFee||0,otherFee:r.data.otherFee||0,discountPayNow:r.data.discountPayNow||0,discountPayLater:r.data.discountPayLater||0,finalPrice:r.data.finalPrice,issueTime:r.data.issueTime?(0,ee.Z)(1e3*r.data.issueTime,"dd/MM/yyyy"):"",provider:r.data.provider||"",remark:r.data.remark,state:r.data.state,valid:!0};this.totalBalance.baseFare+=c.baseFare,this.totalBalance.vatFare+=c.vatFare,this.totalBalance.taxFare+=c.taxFare,this.totalBalance.serviceFee+=c.serviceFee,this.totalBalance.otherFee+=c.otherFee,this.totalBalance.discountPayNow+=c.discountPayNow,this.totalBalance.discountPayLater+=c.discountPayLater,this.totalBalance.finalPrice+=c.finalPrice,n.patchValue(c),this.tooltipType="RESET",this.tooltip.showTooltip()}else this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:r.objectError.errorDescription.vi,sticky:!0})},error:()=>{this._toastService.add({severity:"error",summary:"Th\u1ea5t b\u1ea1i",detail:"C\xf3 l\u1ed7i x\u1ea3y ra",sticky:!0})}})}isExistTicketNumber(t){let n=0;return this.listOutsideVoid.value.forEach(i=>{i.ticketNumber&&i.ticketNumber===t&&(n+=1)}),n>1}onRemoveTicket(t){this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn h\u1ee7y s\u1ed1 v\xe9?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n h\u1ee7y s\u1ed1 v\xe9 n\xe0y? Th\xf4ng tin \u0111\u01b0\u1ee3c nh\u1eadp s\u1ebd b\u1ecb m\u1ea5t.",okText:"X\xe1c nh\u1eadn",cancelText:"H\u1ee7y b\u1ecf",isSecondary:!0}).afterClosed$.subscribe({next:i=>{if(i.data){const o=Object.assign({},t.value);t.patchValue({ticketNumber:"",description:"",baseFare:0,vatFare:0,taxFare:0,serviceFee:0,otherFee:0,discountPayNow:0,discountPayLater:0,finalPrice:0,issueTime:"",provider:"",remark:"",state:"",valid:!1}),this.totalBalance.baseFare-=o.baseFare,this.totalBalance.vatFare-=o.vatFare,this.totalBalance.taxFare-=o.taxFare,this.totalBalance.serviceFee-=o.serviceFee,this.totalBalance.otherFee-=o.otherFee,this.totalBalance.discountPayNow-=o.discountPayNow,this.totalBalance.discountPayLater-=o.discountPayLater,this.totalBalance.finalPrice-=o.finalPrice}}})}onAddOutSideVoid(){this.listOutsideVoid.push(this.initVoidDetailGroup())}onRemoveOutSideVoid(t,n){this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn x\xf3a d\xf2ng?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a d\xf2ng n\xe0y? Th\xf4ng tin \u0111\u01b0\u1ee3c nh\u1eadp s\u1ebd b\u1ecb m\u1ea5t.",okText:"X\xe1c nh\u1eadn",cancelText:"H\u1ee7y b\u1ecf",isSecondary:!0}).afterClosed$.subscribe({next:o=>{if(o.data){this.listOutsideVoid.removeAt(t);const r=n.value;this.totalBalance.baseFare-=r.baseFare,this.totalBalance.vatFare-=r.vatFare,this.totalBalance.taxFare-=r.taxFare,this.totalBalance.serviceFee-=r.serviceFee,this.totalBalance.otherFee-=r.otherFee,this.totalBalance.discountPayNow-=r.discountPayNow,this.totalBalance.discountPayLater-=r.discountPayLater,this.totalBalance.finalPrice-=r.finalPrice}}})}getFinalPrice(t){const n=t.value,i=(n.baseFare||0)+(n.vatFare||0)+(n.taxFare||0)+(n.serviceFee||0)+(0|n.otherFee)-(n.discountPayNow||0);return t.get("finalPrice").setValue(i),i||0}onChangeStep(t){this.previousStep.emit(t)}checkValid(t){Object.values(t.controls).forEach(n=>{n.invalid&&(n.markAsDirty(),n.updateValueAndValidity({onlySelf:!0}))})}get isFormValid(){return this.outsideVoidForm.valid}onSubmit(){if(this.isDisabledForm)return;const t=this.listOutsideVoid.controls;for(let i=this.listOutsideVoid.length-1;i>=0;i--)t[i].invalid&&this.listOutsideVoid.removeAt(i);if(this.outsideVoidForm.controls.listVoidDetail.controls.forEach(i=>{this.checkValid(i)}),this.outsideVoidForm.invalid)return;const n=this.outsideVoidForm.value;n.state="INVALID",this.valueChange.emit(n.listVoidDetail)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(l.qu),e.Y36(w.mO),e.Y36(k.BX),e.Y36(R.oE))},a.\u0275cmp=e.Xpm({type:a,selectors:[["outside-void"]],viewQuery:function(t,n){if(1&t&&e.Gf(me,5,W.Lk),2&t){let i;e.iGM(i=e.CRH())&&(n.tooltip=i.first)}},hostBindings:function(t,n){1&t&&e.NdJ("click",function(o){return n.onClick(o)},!1,e.evT)},inputs:{agentId:"agentId",bookingInfo:"bookingInfo"},outputs:{previousStep:"previousStep",valueChange:"valueChange"},standalone:!0,features:[e.jDz],decls:108,vars:64,consts:[[1,"flex","flex-col","h-full"],[1,"flex-1","flex","flex-col","bg-neutral-gray-1","rounded","shadow-cf-md"],[1,"p-4","bg-neutral-white","flex","justify-between","items-center","text-heading-sm"],[1,"flex-1"],["mode","template",1,"bg-neutral-white",3,"fnSort","fnSearch"],["managerTable",""],["cf-thead",""],["cf-th","",1,"whitespace-nowrap",3,"sticky"],[1,"flex-col","w-[150px]"],["cf-th","",1,"whitespace-nowrap"],[1,"w-[150px]"],[4,"ngFor","ngForOf"],["cf-td","",1,"flex","items-center","p-3","text-body-md","text-secondary-3-4","whitespace-nowrap","cursor-pointer","bg-neutral-white",3,"sticky","click"],["icon","plus","size","small",1,"mr-2.5"],["cf-td","",1,"bg-neutral-white",3,"sticky"],[1,"py-2","px-3","text-espressive-semibold-sm","text-right"],[1,"h-10","bg-neutral-white"],[1,"flex","justify-between","mt-5"],["cf-button","","size","medium","type","secondary",1,"bg-white",3,"click"],["cfHeadIcon","","icon","chevron_left","size","small",1,"mr-2"],["cf-button","","size","medium",3,"disabled","click"],["cfHeadIcon","","icon","plus","size","small",1,"mr-2.5"],[1,"border-b","border-neutral-gray-1"],["cf-td","",1,"py-2","px-3","text-body-sm","bg-neutral-white",3,"sticky"],[1,"flex","items-center"],["cf-input","","placeholder","Nh\u1eadp s\u1ed1 v\xe9",3,"formControl","ngClass","keydown.enter"],[3,"manualHandle","placement","cfTooltip",4,"ngIf"],["icon","circle_help","size","small","class","text-neutral-gray-4 cursor-pointer",4,"ngIf"],["icon","search","size","small","class","text-neutral-gray-4 cursor-pointer",3,"click",4,"ngIf"],["icon","close","size","small","class","text-neutral-gray-4 cursor-pointer",3,"click",4,"ngIf"],[4,"ngIf","ngIfElse"],["tempElseContent",""],[1,"text-body-md","text-secondary-6-4","cursor-pointer",3,"click"],[3,"manualHandle","placement","cfTooltip"],["tooltip",""],["toolTipTemplate",""],["icon","circle_help","size","small",1,"text-neutral-gray-4","cursor-pointer"],["icon","search","size","small",1,"text-neutral-gray-4","cursor-pointer",3,"click"],["icon","close","size","small",1,"text-neutral-gray-4","cursor-pointer",3,"click"],[4,"ngIf"],["cf-td","",1,"text-body-sm","py-2","px-3"],["cf-td","",1,"text-body-sm"],["class","flex","type","inverted",3,"color",4,"ngIf"],[1,"grow-[400]","!w-full",3,"status"],["cf-input","","size","medium","placeholder","Nh\u1eadp di\u1ec5n gi\u1ea3i",3,"formControl"],["cf-td","",1,"py-2","px-3","text-body-sm"],["size","medium",3,"placeholder","negative","formControl","ngModelChange"],["textField","name","valueField","code","placeholder","L\u1ef1a ch\u1ecdn...",1,"!w-full","!max-w-full",3,"disabled","data","allowSearch","formControl"],["size","medium",3,"placeholder","formControl","negative","ngModelChange"],["cf-td","",1,"py-2","px-3","text-body-sm","text-right"],["cf-input","","size","medium","placeholder","Remark",3,"formControl"],["type","inverted",1,"flex",3,"color"],["colspan","13",1,"bg-neutral-gray-1"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._uU(3," Th\xeam c\xf4ng n\u1ee3 void v\xe9 "),e.qZA(),e.TgZ(4,"div",3)(5,"cf-table",4,5)(7,"thead",6)(8,"th",7)(9,"div",8),e._uU(10," S\u1ed1 v\xe9 "),e.qZA()(),e.TgZ(11,"th",9)(12,"div",10),e._uU(13," Ng\xe0y xu\u1ea5t v\xe9 "),e.qZA()(),e.TgZ(14,"th",9)(15,"div",8),e._uU(16," Tr\u1ea1ng th\xe1i "),e.qZA()(),e.TgZ(17,"th",9)(18,"div",8),e._uU(19," Di\u1ec5n gi\u1ea3i "),e.qZA()(),e.TgZ(20,"th",9)(21,"div",8),e._uU(22," Gi\xe1 Net "),e.qZA()(),e.TgZ(23,"th",9)(24,"div",8),e._uU(25," VAT "),e.qZA()(),e.TgZ(26,"th",9)(27,"div",8),e._uU(28," Thu\u1ebf "),e.qZA()(),e.TgZ(29,"th",9)(30,"div",8),e._uU(31," Ph\xed d\u1ecbch v\u1ee5 "),e.qZA()(),e.TgZ(32,"th",9)(33,"div",8),e._uU(34," Ph\xed kh\xe1c "),e.qZA()(),e.TgZ(35,"th",9)(36,"div",8),e._uU(37," Nh\xe0 cung c\u1ea5p "),e.qZA()(),e.TgZ(38,"th",9)(39,"div",8),e._uU(40," Chi\u1ebft kh\u1ea5u tr\u1ea3 ngay "),e.qZA()(),e.TgZ(41,"th",9)(42,"div",8),e._uU(43," Chi\u1ebft kh\u1ea5u tr\u1ea3 sau "),e.qZA()(),e.TgZ(44,"th",9)(45,"div",8),e._uU(46," Gi\xe1 cu\u1ed1i "),e.qZA()(),e.TgZ(47,"th",9)(48,"div",8),e._uU(49," Remark "),e.qZA()(),e.TgZ(50,"th",7),e._uU(51,"Ch\u1ee9c n\u0103ng"),e.qZA()(),e.TgZ(52,"tbody"),e.YNc(53,Ie,16,12,"ng-container",11),e.TgZ(54,"tr")(55,"td",12),e.NdJ("click",function(){return n.onAddOutSideVoid()}),e._UZ(56,"cf-icon",13),e._uU(57," Th\xeam "),e.qZA()()(),e.TgZ(58,"tfoot")(59,"tr"),e._UZ(60,"td",14)(61,"td")(62,"td")(63,"td"),e.TgZ(64,"td",15),e._uU(65),e.ALo(66,"replace"),e.ALo(67,"number"),e.qZA(),e.TgZ(68,"td",15),e._uU(69),e.ALo(70,"replace"),e.ALo(71,"number"),e.qZA(),e.TgZ(72,"td",15),e._uU(73),e.ALo(74,"replace"),e.ALo(75,"number"),e.qZA(),e.TgZ(76,"td",15),e._uU(77),e.ALo(78,"replace"),e.ALo(79,"number"),e.qZA(),e.TgZ(80,"td",15),e._uU(81),e.ALo(82,"replace"),e.ALo(83,"number"),e.qZA(),e._UZ(84,"td"),e.TgZ(85,"td",15),e._uU(86),e.ALo(87,"replace"),e.ALo(88,"number"),e.qZA(),e.TgZ(89,"td",15),e._uU(90),e.ALo(91,"replace"),e.ALo(92,"number"),e.qZA(),e.TgZ(93,"td",15),e._uU(94),e.ALo(95,"replace"),e.ALo(96,"number"),e.qZA(),e._UZ(97,"td")(98,"td"),e.qZA()()()(),e._UZ(99,"div",16),e.qZA(),e.TgZ(100,"div",17)(101,"button",18),e.NdJ("click",function(){return n.onChangeStep(n.OUTSIDE_STEP.BOOKING_INFO)}),e._UZ(102,"cf-icon",19),e._uU(103," Quay l\u1ea1i "),e.qZA(),e.TgZ(104,"button",20),e.NdJ("click",function(){return n.onSubmit()}),e._UZ(105,"cf-icon",21),e._uU(106," Th\xeam c\xf4ng n\u1ee3 "),e.qZA()()(),e._UZ(107,"cf-toast")),2&t&&(e.xp6(5),e.Q6J("fnSort",n.sortChange)("fnSearch",n.searchChange),e.xp6(3),e.Q6J("sticky","left"),e.xp6(42),e.Q6J("sticky","right"),e.xp6(3),e.Q6J("ngForOf",n.listOutsideVoid.controls),e.xp6(2),e.Q6J("sticky","left"),e.xp6(5),e.Q6J("sticky","left"),e.xp6(5),e.hij(" ",e.Dn7(66,16,e.lcZ(67,20,(null==n.totalBalance?null:n.totalBalance.baseFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(70,22,e.lcZ(71,26,(null==n.totalBalance?null:n.totalBalance.vatFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(74,28,e.lcZ(75,32,(null==n.totalBalance?null:n.totalBalance.taxFare)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(78,34,e.lcZ(79,38,(null==n.totalBalance?null:n.totalBalance.serviceFee)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(82,40,e.lcZ(83,44,(null==n.totalBalance?null:n.totalBalance.otherFee)||0),",",".")," "),e.xp6(5),e.hij(" ",e.Dn7(87,46,e.lcZ(88,50,(null==n.totalBalance?null:n.totalBalance.discountPayNow)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(91,52,e.lcZ(92,56,(null==n.totalBalance?null:n.totalBalance.discountPayLater)||0),",",".")," "),e.xp6(4),e.hij(" ",e.Dn7(95,58,e.lcZ(96,62,(null==n.totalBalance?null:n.totalBalance.finalPrice)||0),",",".")," "),e.xp6(10),e.Q6J("disabled",n.isDisabledForm))},dependencies:[d.ez,d.mk,d.sg,d.O5,d.JJ,b.N8,b.Xq,x.rC,x.E_,x.zs,x.qS,_.j$,_.ND,_.BN,_.lt,p.AxE,p.Sm8,l.u5,l.Fj,l.JJ,l.UX,l.oH,M.b,N.q,W.Lk,k.hj,I.AS],encapsulation:2}),a})();var Be=h(40105),qe=h(2225),Je=h(92347),Ue=h(28490);function Me(a,s){1&a&&e._UZ(0,"cf-input-hint",27),2&a&&e.Q6J("hint","\u0110\u1ea1i l\xfd kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function Pe(a,s){1&a&&e._UZ(0,"cf-icon",28)}function Qe(a,s){1&a&&(e.TgZ(0,"cf-radio",29),e._uU(1,"C\xf4ng n\u1ee3 v\xe9"),e.qZA()),2&a&&e.Q6J("value","DERIVATIVE")}function Ve(a,s){1&a&&(e.TgZ(0,"cf-radio",29),e._uU(1,"C\xf4ng n\u1ee3 ph\u1ee5 thu"),e.qZA()),2&a&&e.Q6J("value","SURCHARGE")}function Le(a,s){1&a&&(e.TgZ(0,"cf-radio",29),e._uU(1,"Void v\xe9"),e.qZA()),2&a&&e.Q6J("value","VOID_TICKET")}function Re(a,s){1&a&&(e.TgZ(0,"cf-radio",29),e._uU(1,"Refund"),e.qZA()),2&a&&e.Q6J("value","REFUND_TICKET")}function He(a,s){1&a&&(e.TgZ(0,"cf-radio",29),e._uU(1,"N\u1ea1p ti\u1ec1n"),e.qZA()),2&a&&e.Q6J("value","DEPOSIT_BALANCE")}function Ge(a,s){1&a&&e._UZ(0,"cf-input-hint",27),2&a&&e.Q6J("hint","M\xe3 \u0111\u1eb7t ch\u1ed7 kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function je(a,s){1&a&&e._UZ(0,"cf-input-hint",27),2&a&&e.Q6J("hint","M\xe3 \u0111\u1eb7t ch\u1ed7 kh\xf4ng t\u1ed3n t\u1ea1i trong h\u1ec7 th\u1ed1ng")}function Ke(a,s){1&a&&e._UZ(0,"cf-input-hint",27),2&a&&e.Q6J("hint","H\xe3ng bay kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function ze(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"cf-select",39),e.NdJ("selectedChange",function(i){e.CHM(t);const o=e.oxw(4);return e.KtG(o.onSelectedAirline(i))}),e.TgZ(1,"label",19),e._uU(2," H\xe3ng bay "),e.qZA(),e.YNc(3,Ke,1,1,"cf-input-hint",20),e.qZA()}if(2&a){const t=e.oxw(4);e.Q6J("status",t.bookingDetailForm.controls.airline.invalid&&(t.bookingDetailForm.controls.airline.dirty||t.bookingDetailForm.controls.airline.touched)?"error":"default")("data",t.airlineOptions)("allowSearch",!1)("formControl",t.bookingDetailForm.controls.airline),e.xp6(1),e.Q6J("CfRequired",!0),e.xp6(2),e.Q6J("ngIf",t.bookingDetailForm.controls.airline.hasError("required")&&(t.bookingDetailForm.controls.airline.touched||t.bookingDetailForm.controls.airline.dirty))}}function Ye(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"button",40),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onSearchPNR())}),e._UZ(1,"cf-icon",41),e._uU(2," T\xecm ki\u1ebfm "),e.qZA()}if(2&a){const t=e.oxw(4);e.Q6J("disabled",!t.bookingDetailForm.value.bookingCode)}}function $e(a,s){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const t=e.oxw(5);e.xp6(1),e.hij(" - ",t.bookingInfo.endTime," ")}}function Xe(a,s){if(1&a&&(e.TgZ(0,"div",42)(1,"div",43)(2,"div"),e._UZ(3,"img",44),e.qZA(),e.TgZ(4,"div",45)(5,"div",46),e._uU(6),e.qZA(),e.TgZ(7,"div",47),e._uU(8),e.qZA(),e.TgZ(9,"div",48),e._uU(10),e.YNc(11,$e,2,1,"span",3),e.qZA()()()()),2&a){const t=e.oxw(4);e.xp6(3),e.Q6J("src","assets/airline-logo/"+t.bookingInfo.airline+".png",e.LSH),e.xp6(3),e.Oqu(t.bookingInfo.bookingCode),e.xp6(2),e.HOy("",t.bookingInfo.startPoint," (",t.bookingInfo.startCode,") - ",t.bookingInfo.endPoint," (",t.bookingInfo.endCode,")"),e.xp6(2),e.hij(" ",t.bookingInfo.startTime," "),e.xp6(1),e.Q6J("ngIf",t.bookingInfo.endTime)}}function We(a,s){1&a&&e._UZ(0,"cf-input-hint",27),2&a&&e.Q6J("hint","M\xe3 hi\u1ec7u h\xe3ng bay kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function et(a,s){if(1&a&&(e.TgZ(0,"div")(1,"cf-input-group",49)(2,"label",19),e._uU(3," M\xe3 hi\u1ec7u h\xe3ng bay kh\xe1c "),e.qZA(),e._UZ(4,"input",50),e.YNc(5,We,1,1,"cf-input-hint",20),e.qZA()()),2&a){const t=e.oxw(4);e.xp6(1),e.Q6J("status",t.bookingDetailForm.controls.airlineOther.invalid&&(t.bookingDetailForm.controls.airlineOther.dirty||t.bookingDetailForm.controls.airlineOther.touched)?"error":"default"),e.xp6(1),e.Q6J("CfRequired",!0),e.xp6(2),e.Q6J("formControl",t.bookingDetailForm.controls.airlineOther),e.xp6(1),e.Q6J("ngIf",t.bookingDetailForm.controls.airlineOther.hasError("required")&&(t.bookingDetailForm.controls.airlineOther.touched||t.bookingDetailForm.controls.airlineOther.dirty))}}function tt(a,s){1&a&&(e.TgZ(0,"div",42),e._UZ(1,"ticket-item-skeleton"),e.qZA())}function nt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",12)(1,"div",13),e._UZ(2,"div",14),e.TgZ(3,"div",15),e._uU(4,"Th\xf4ng tin \u0111\u1eb7t ch\u1ed7"),e.qZA()(),e.TgZ(5,"div",30)(6,"cf-radio-group",31),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.typeBooking=i)})("checkChange",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onChangeTypeBooking(i))}),e.TgZ(7,"cf-radio",29),e._uU(8,"Trong h\u1ec7 th\u1ed1ng"),e.qZA(),e.TgZ(9,"cf-radio",32),e._uU(10," Ngo\xe0i h\u1ec7 th\u1ed1ng "),e.qZA()(),e.TgZ(11,"div",33)(12,"cf-input-group",34)(13,"label",19),e._uU(14," M\xe3 \u0111\u1eb7t ch\u1ed7 "),e.qZA(),e.TgZ(15,"input",35),e.NdJ("keydown.enter",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.onSearchPNR())}),e.qZA(),e.YNc(16,Ge,1,1,"cf-input-hint",20),e.YNc(17,je,1,1,"cf-input-hint",20),e.qZA(),e.YNc(18,ze,4,6,"cf-select",36),e.YNc(19,Ye,3,1,"button",37),e.qZA(),e.TgZ(20,"div"),e.YNc(21,Xe,12,8,"div",38),e.YNc(22,et,6,4,"div",3),e.YNc(23,tt,2,0,"div",38),e.qZA()()()}if(2&a){const t=e.oxw(3);e.xp6(6),e.Q6J("ngModel",t.typeBooking),e.xp6(1),e.Q6J("value","internal"),e.xp6(2),e.Q6J("disabled","DEPOSIT_BALANCE"===t.balanceType)("value","external"),e.xp6(3),e.Q6J("status",t.bookingDetailForm.controls.bookingCode.invalid&&(t.bookingDetailForm.controls.bookingCode.dirty||t.bookingDetailForm.controls.bookingCode.touched)?"error":"default"),e.xp6(1),e.Q6J("CfRequired",!0),e.xp6(2),e.Q6J("formControl",t.bookingDetailForm.controls.bookingCode),e.xp6(1),e.Q6J("ngIf",t.bookingDetailForm.controls.bookingCode.hasError("required")&&(t.bookingDetailForm.controls.bookingCode.touched||t.bookingDetailForm.controls.bookingCode.dirty)),e.xp6(1),e.Q6J("ngIf",t.bookingDetailForm.controls.bookingCode.hasError("notFound")&&(t.bookingDetailForm.controls.bookingCode.touched||t.bookingDetailForm.controls.bookingCode.dirty)),e.xp6(1),e.Q6J("ngIf","external"===t.typeBooking),e.xp6(1),e.Q6J("ngIf","internal"===t.typeBooking),e.xp6(2),e.Q6J("ngIf",!t.isLoadingPNR&&t.bookingInfo&&t.bookingInfo.bookingCode&&"internal"===t.typeBooking),e.xp6(1),e.Q6J("ngIf","external"===t.typeBooking&&"other"===t.bookingDetailForm.value.airline),e.xp6(1),e.Q6J("ngIf",t.isLoadingPNR)}}function it(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div")(1,"outside-deposit",51),e.NdJ("valueChange",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onOutsideDeposit(i))}),e.qZA()()}if(2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("balanceAmount",t.agentBalanceAmount)}}function ot(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"button",52),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.onChangeStep(i.OUTSIDE_STEP.EXPENSE))}),e._uU(1," Ti\u1ebfp t\u1ee5c "),e._UZ(2,"cf-icon",53),e.qZA()}if(2&a){const t=e.oxw(3);e.Q6J("disabled","internal"===t.typeBooking&&!t.isContinue||"external"===t.typeBooking&&t.bookingDetailForm.invalid)}}const at=function(a){return{"opacity-50 pointer-events-none cursor-default":a}};function rt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"div",13),e._UZ(3,"div",14),e.TgZ(4,"div",15),e._uU(5,"Th\xf4ng tin \u0111\u1ea1i l\xfd"),e.qZA()(),e.TgZ(6,"div",16)(7,"div",17)(8,"cf-select",18),e.NdJ("selectedChange",function(i){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onSelectAgentChange(i))}),e.TgZ(9,"label",19),e._uU(10," \u0110\u1ea1i l\xfd "),e.qZA(),e.YNc(11,Me,1,1,"cf-input-hint",20),e.qZA(),e.YNc(12,Pe,1,0,"cf-icon",21),e.qZA(),e.TgZ(13,"cf-radio-group",22),e.NdJ("checkChange",function(i){e.CHM(t);const o=e.oxw(2);return e.KtG(o.balanceTypeChange(i))})("ngModelChange",function(i){e.CHM(t);const o=e.oxw(2);return e.KtG(o.balanceType=i)}),e.YNc(14,Qe,2,1,"cf-radio",23),e.YNc(15,Ve,2,1,"cf-radio",23),e.YNc(16,Le,2,1,"cf-radio",23),e.YNc(17,Re,2,1,"cf-radio",23),e.YNc(18,He,2,1,"cf-radio",23),e.qZA()()(),e.YNc(19,nt,24,14,"div",24),e.YNc(20,it,2,1,"div",3),e.TgZ(21,"div",25),e._UZ(22,"div"),e.YNc(23,ot,3,1,"button",26),e.qZA()()}if(2&a){const t=e.oxw(2);e.xp6(8),e.Q6J("ngClass",e.VKq(17,at,t.isDisableAgentOption))("status",t.balanceForm.controls.agentId.invalid&&(t.balanceForm.controls.agentId.dirty||t.balanceForm.controls.agentId.touched)?"error":"default")("data",t.agentOptions)("allowSearch",!0)("formControl",t.balanceForm.controls.agentId),e.xp6(1),e.Q6J("CfRequired",!0),e.xp6(2),e.Q6J("ngIf",t.balanceForm.controls.agentId.hasError("required")&&(t.balanceForm.controls.agentId.touched||t.balanceForm.controls.agentId.dirty)),e.xp6(1),e.Q6J("ngIf",t.isDisableAgentOption),e.xp6(1),e.Q6J("ngModel",t.balanceType),e.xp6(1),e.Q6J("ngIf",t.isShowDerivative),e.xp6(1),e.Q6J("ngIf",t.isShowDerivative),e.xp6(1),e.Q6J("ngIf",t.isShowVoid),e.xp6(1),e.Q6J("ngIf",t.isShowRefund),e.xp6(1),e.Q6J("ngIf",t.isShowDeposit),e.xp6(1),e.Q6J("ngIf","DEPOSIT_BALANCE"!==t.balanceType),e.xp6(1),e.Q6J("ngIf","DEPOSIT_BALANCE"===t.balanceType),e.xp6(3),e.Q6J("ngIf",t.balanceType!==t.BALANCE_TYPE.DEPOSIT_BALANCE)}}function st(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",56)(1,"outside-issue",57),e.NdJ("previousStep",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onChangeStep(i))})("valueChange",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onOutsideIssue(i))}),e.qZA()()}if(2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("bookingInfo",t.bookingInfo)}}function lt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",56)(1,"outside-surcharge",57),e.NdJ("previousStep",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onChangeStep(i))})("valueChange",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onOutsideSurcharge(i))}),e.qZA()()}if(2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("bookingInfo",t.bookingInfo)}}function ct(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",56)(1,"outside-void",58),e.NdJ("previousStep",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onChangeStep(i))})("valueChange",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onOutsideVoid(i))}),e.qZA()()}if(2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("bookingInfo",t.bookingInfo)("agentId",t.agentInfo.code)}}function ut(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",56)(1,"outside-refund",57),e.NdJ("previousStep",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onChangeStep(i))})("valueChange",function(i){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onOutsideRefund(i))}),e.qZA()()}if(2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("bookingInfo",t.bookingInfo)}}function dt(a,s){if(1&a&&(e.TgZ(0,"div",54),e.YNc(1,st,2,1,"div",55),e.YNc(2,lt,2,1,"div",55),e.YNc(3,ct,2,2,"div",55),e.YNc(4,ut,2,1,"div",55),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.balanceType===t.BALANCE_TYPE.DERIVATIVE),e.xp6(1),e.Q6J("ngIf",t.balanceType===t.BALANCE_TYPE.SURCHARGE),e.xp6(1),e.Q6J("ngIf",t.balanceType===t.BALANCE_TYPE.VOID_TICKET),e.xp6(1),e.Q6J("ngIf",t.balanceType===t.BALANCE_TYPE.REFUND_TICKET)}}const ne=function(a){return{"text-neutral-gray-6":a}};function pt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div")(1,"div",4)(2,"div",5)(3,"div",6),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onChangeStep(i.OUTSIDE_STEP.BOOKING_INFO))}),e._uU(4," Th\xf4ng tin c\u01a1 b\u1ea3n "),e.qZA(),e._UZ(5,"cf-icon",7),e.TgZ(6,"div",8),e._uU(7," Chi ti\u1ebft c\xf4ng n\u1ee3 "),e.qZA()(),e.YNc(8,rt,24,19,"div",9),e.YNc(9,dt,5,4,"div",10),e.qZA()()}if(2&a){const t=e.oxw();e.xp6(3),e.Q6J("ngClass",e.VKq(4,ne,t.step===t.OUTSIDE_STEP.BOOKING_INFO)),e.xp6(3),e.Q6J("ngClass",e.VKq(6,ne,t.step===t.OUTSIDE_STEP.EXPENSE)),e.xp6(2),e.Q6J("ngIf","BOOKING_INFO"===t.step),e.xp6(1),e.Q6J("ngIf","EXPENSE"===t.step)}}function gt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div")(1,"div",59)(2,"div",60),e._UZ(3,"img",61),e.TgZ(4,"div",62)(5,"div",15),e._uU(6),e.qZA(),e._UZ(7,"div",63),e.qZA(),e.TgZ(8,"div",33)(9,"button",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onManagBalanceOutside())}),e._UZ(10,"cf-icon",65),e._uU(11," Xem danh s\xe1ch "),e.qZA(),e.TgZ(12,"button",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onCreateNew())}),e._UZ(13,"cf-icon",67),e._uU(14," T\u1ea1o m\u1edbi "),e.qZA()()()()()}if(2&a){const t=e.oxw();e.xp6(6),e.Oqu(t.titleText),e.xp6(1),e.Q6J("innerHTML",t.bodyText,e.oJD)}}function ht(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div")(1,"div",59)(2,"div",60),e._UZ(3,"img",68),e.TgZ(4,"div",69)(5,"div",15),e._uU(6),e.qZA(),e._UZ(7,"div",63),e.qZA(),e.TgZ(8,"div",33)(9,"button",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onCreateNew())}),e._UZ(10,"cf-icon",65),e._uU(11," T\u1ea1o m\u1edbi "),e.qZA(),e.TgZ(12,"button",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onRetryCreate())}),e._UZ(13,"cf-icon",70),e._uU(14," Th\u1eed l\u1ea1i "),e.qZA()()()()()}if(2&a){const t=e.oxw();e.xp6(6),e.hij("",t.titleText," "),e.xp6(1),e.Q6J("innerHTML",t.bodyText,e.oJD)}}function _t(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div")(1,"div",59)(2,"div",60),e._UZ(3,"img",71),e.TgZ(4,"div",72)(5,"div",15),e._uU(6),e.qZA(),e._UZ(7,"div",63),e.qZA(),e.TgZ(8,"div",33)(9,"button",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onManagBalanceOutside())}),e._UZ(10,"cf-icon",65),e._uU(11," Xem danh s\xe1ch "),e.qZA(),e.TgZ(12,"button",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onCreateNew())}),e._UZ(13,"cf-icon",67),e._uU(14," T\u1ea1o m\u1edbi "),e.qZA()()()()()}if(2&a){const t=e.oxw();e.xp6(6),e.Oqu(t.titleText),e.xp6(1),e.Q6J("innerHTML",t.bodyText,e.oJD)}}function mt(a,s){1&a&&e._UZ(0,"div")}function ft(a,s){1&a&&e._UZ(0,"cf-spinner")}let vt=(()=>{class a{constructor(t,n,i,o,r,c,u,g,f,C,T){this._fb=n,this._searchFlightService=i,this._userService=o,this._balanceService=r,this._bankDataService=c,this._router=u,this._toastService=g,this._locationDataService=f,this._modal=C,this._permissionService=T,this.BALANCE_TYPE=D,this.OUTSIDE_STEP=F,this.TICKET_DETAIL_TYPE=O,this.balanceType=D.DERIVATIVE,this.step=F.BOOKING_INFO,this.ticketDetailType=O.TICKET,this.airlineOptions=[{code:"VN",name:"Vietnam Airlines"},{code:"VJ",name:"Vietjet Air"},{code:"QH",name:"Bamboo Airways"},{code:"other",name:"H\xe3ng bay kh\xe1c"}],this.agentInfo={code:"",name:"",available:0},this.agentOptions=[],this.isContinue=!1,this.isLoadingPNR=!1,this.isLoadingSubmitted=!1,this.isShowDerivative=this._permissionService.hasPermission(A.or.EnterAriseBalanceManual),this.isShowVoid=this._permissionService.hasPermission(A.or.EnterVoidBalanceManual),this.isShowRefund=this._permissionService.hasPermission(A.or.EnterRefundBalanceManual),this.isShowDeposit=this._permissionService.hasPermission(A.or.EnterTopUpBalanceManual),this.state="CREATE",this.typeBooking="internal",this.isDisableAgentOption=!0,this.searchChange=(v,m)=>m,this.sortChange=(v,m)=>m,t.registerIcons([p.toh,p.rJw,p.NNX,p.TM4,p.PcQ,p.S7Q,p.D7,p.$S,p.UNF,p.gW0,p.SK7])}ngOnInit(){this.getAllAgentBelong(),this.initFormGroup(),this.bankOptions=this._bankDataService.getBankOption(),this.isShowDerivative?this.balanceType=D.DERIVATIVE:this.isShowVoid?this.balanceType=D.VOID_TICKET:this.isShowRefund?this.balanceType=D.REFUND_TICKET:this.isShowDeposit&&(this.balanceType=D.DEPOSIT_BALANCE)}initFormGroup(){this.bookingDetailForm=this._fb.group({bookingCode:[null,l.kI.required],airline:[null],airlineOther:[null]}),this.balanceForm=this._fb.group({agentId:["",l.kI.required]}),this.outsideDepositForm=this._fb.group({bankNumber:[null,l.kI.required],bankName:[null,l.kI.required],amount:[null,l.kI.required],description:[null],userAction:[null]})}getAllAgentBelong(){this._balanceService.getAllAgentOutside().pipe((0,Z.x)(()=>this.isDisableAgentOption=!1)).subscribe({next:t=>{var n;this.agentOptions=(null===(n=t.data)||void 0===n?void 0:n.map(i=>({code:i.agentId,name:`${i.username} - ${i.displayName}`,available:i.available})))||[]}})}balanceTypeChange(t){this.balanceType=t,["DEPOSIT_BALANCE"].includes(this.balanceType)&&(this.typeBooking="internal")}onTicketDetailTypeChange(t){this.ticketDetailType=t}onChangeStep(t){if(t===F.EXPENSE){if(this.balanceForm.markAllAsTouched(),this.balanceForm.invalid)return;this.step=t}else this.step=t}onSearchPNR(){if(this.bookingDetailForm.markAllAsTouched(),this.balanceForm.markAllAsTouched(),this.bookingDetailForm.invalid||this.balanceForm.invalid)return;const i={agentId:this.balanceForm.value.agentId,bookingCode:this.bookingDetailForm.value.bookingCode||""};this.isLoadingPNR=!0,this._balanceService.searchPnrForOutside(i).pipe((0,Z.x)(()=>this.isLoadingPNR=!1)).subscribe({next:o=>{if(o.success&&o.data){this.isContinue=!0;const r=o.data;this.bookingInfo={bookingCode:r.bookingCode,airline:r.airline,startCode:r.startPoint.code,startPoint:this._locationDataService.getCityNameByCode(r.startPoint.code),endCode:r.endPoint.code,endPoint:this._locationDataService.getCityNameByCode(r.endPoint.code),startTime:(0,d.p6)(new Date(r.departureTime),"EEEE, dd/MM/yyyy","vi-VN"),endTime:r.returnTime?(0,d.p6)(new Date(r.returnTime),"EEEE, dd/MM/yyyy","vi-VN"):""}}else this.resetBookingInfo(),"BE-EA002"===o.errorCode?this.bookingDetailForm.get("bookingCode").setErrors({notFound:!0}):this._toastService.add({severity:"error",summary:"Th\u1ea5t b\u1ea1i",detail:o.objectError.errorDescription.vi,sticky:!0})},error:()=>{this.resetBookingInfo(),this.bookingDetailForm.setErrors({notFound:!0})}})}onChangeTypeBooking(t){this.resetBookingInfo();const n=this.bookingDetailForm.controls.airline;if("external"===t)n.setValidators([l.kI.required]),n.updateValueAndValidity();else{const i=this.bookingDetailForm.controls.airlineOther;i.setValidators(null),i.updateValueAndValidity(),n.setValidators(null),n.updateValueAndValidity()}}resetBookingInfo(){this.bookingInfo=void 0,this.isContinue=!1}onSelectedAirline(t){const n=this.bookingDetailForm.controls.airlineOther;this.bookingInfo={bookingCode:this.bookingDetailForm.value.bookingCode,airline:t.code,startCode:"",startPoint:"",endCode:"",endPoint:"",startTime:"",endTime:""},"other"===t.code?(n.setValidators([l.kI.required]),n.updateValueAndValidity()):(n.setValidators(null),n.updateValueAndValidity())}get getOutsideData(){var t;const i=this.bookingDetailForm.value;return{agentId:this.balanceForm.value.agentId,bookingCode:i.bookingCode,airline:"internal"===this.typeBooking?(null===(t=this.bookingInfo)||void 0===t?void 0:t.airline)||"":"other"===i.airline?i.airlineOther:i.airline,type:this.balanceType,internal:"internal"===this.typeBooking}}onOutsideIssue(t){const n=Object.assign(Object.assign({},this.getOutsideData),{ticketDetails:t.map(o=>({ticketNumber:o.ticketNumber||"",description:o.description||"",baseFare:o.baseFare||0,vatFare:o.vatFare||0,taxFare:o.taxFare||0,serviceFee:o.serviceFee||0,otherFee:o.otherFee||0,discountPayNow:o.discountPayNow||0,discountPayLater:o.discountPayLater||0,finalPrice:o.finalPrice||0,provider:o.provider||"",remark:o.remark||""}))});this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn th\xeam c\xf4ng n\u1ee3?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn th\xf4ng tin nh\u1eadp ch\xednh x\xe1c?",okText:"X\xe1c nh\u1eadn",cancelText:"H\u1ee7y",hasIcon:!1}).afterClosed$.subscribe({next:o=>{o.data&&(this.isLoadingSubmitted=!0,this._balanceService.outsideIssue(n).pipe((0,Z.x)(()=>this.isLoadingSubmitted=!1)).subscribe({next:r=>{var c,u;if(r.success)this.titleText="Th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh th\xe0nh c\xf4ng",this.bodyText=`\n <div> C\xf4ng n\u1ee3 ph\xe1t sinh cho \u0111\u1ea1i l\xfd <span class="font-semibold">${this.agentInfo.name}</span> \u0111\xe3 \u0111\u01b0\u1ee3c th\xeam th\xe0nh c\xf4ng. </div>\n <div> C\xf4ng n\u1ee3 n\xe0y \u0111\xe3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt v\xe0o s\u1ed1 d\u01b0 c\xf4ng n\u1ee3 c\u1ee7a \u0111\u1ea1i l\xfd. </div>\n `,this.state="SUCCESS";else{const g=(null===(u=null===(c=r.objectError)||void 0===c?void 0:c.errorDescription)||void 0===u?void 0:u.vi)||"C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh";this.titleText="Th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh th\u1ea5t b\u1ea1i!",this.bodyText=`${g}. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch!`,this.state="ERROR"}},error:()=>{this.titleText="Th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh th\u1ea5t b\u1ea1i!",this.bodyText="C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch!",this.state="ERROR"}}))}})}onOutsideSurcharge(t){const n=Object.assign(Object.assign({},this.getOutsideData),{ticketDetails:t.map(o=>({ticketNumber:o.ticketNumber||"",description:o.description||"",baseFare:o.baseFare||0,vatFare:o.vatFare||0,taxFare:o.taxFare||0,serviceFee:o.serviceFee||0,otherFee:o.otherFee||0,discountPayNow:o.discountPayNow||0,discountPayLater:o.discountPayLater||0,finalPrice:o.finalPrice||0,provider:o.provider||"",remark:o.remark||""}))});this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn th\xeam c\xf4ng n\u1ee3?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn th\xf4ng tin nh\u1eadp ch\xednh x\xe1c?",okText:"X\xe1c nh\u1eadn",cancelText:"H\u1ee7y",hasIcon:!1}).afterClosed$.subscribe({next:o=>{o.data&&(this.isLoadingSubmitted=!0,this._balanceService.outsideSurcharge(n).pipe((0,Z.x)(()=>this.isLoadingSubmitted=!1)).subscribe({next:r=>{var c,u;if(r.success)this.titleText="Th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh th\xe0nh c\xf4ng",this.bodyText=`\n <div> C\xf4ng n\u1ee3 ph\xe1t sinh cho \u0111\u1ea1i l\xfd <span class="font-semibold">${this.agentInfo.name}</span> \u0111\xe3 \u0111\u01b0\u1ee3c th\xeam th\xe0nh c\xf4ng. </div>\n <div> C\xf4ng n\u1ee3 n\xe0y \u0111\xe3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt v\xe0o s\u1ed1 d\u01b0 c\xf4ng n\u1ee3 c\u1ee7a \u0111\u1ea1i l\xfd. </div>\n `,this.state="SUCCESS";else{const g=(null===(u=null===(c=r.objectError)||void 0===c?void 0:c.errorDescription)||void 0===u?void 0:u.vi)||"C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh";this.titleText="Th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh th\u1ea5t b\u1ea1i!",this.bodyText=`${g}. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch!`,this.state="ERROR"}},error:()=>{this.titleText="Th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh th\u1ea5t b\u1ea1i!",this.bodyText="C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 ph\xe1t sinh. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch!",this.state="ERROR"}}))}})}onOutsideVoid(t){const n=Object.assign(Object.assign({},this.getOutsideData),{listVoidDetail:t.map(o=>({otherFee:o.otherFee,ticketNumber:o.ticketNumber||"",baseFare:o.baseFare||0,description:o.description||"",discountPayLater:o.discountPayLater||0,discountPayNow:o.discountPayNow||0,finalPrice:o.finalPrice||0,provider:o.provider||"",remark:o.remark||"",serviceFee:o.serviceFee||0,taxFare:o.taxFare||0,vatFare:o.vatFare||0}))});this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn th\xeam c\xf4ng n\u1ee3?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn th\xf4ng tin nh\u1eadp ch\xednh x\xe1c?.<br>C\xe1c c\xf4ng n\u1ee3 c\u1ea7n x\xe9t duy\u1ec7t s\u1ebd \u0111\u01b0\u1ee3c x\u1eed l\xfd s\u1edbm.",okText:"X\xe1c nh\u1eadn",cancelText:"Ki\u1ec3m tra l\u1ea1i",hasIcon:!1}).afterClosed$.subscribe({next:o=>{o.data&&(this.isLoadingSubmitted=!0,this._balanceService.outsideVoid(n).pipe((0,Z.x)(()=>this.isLoadingSubmitted=!1)).subscribe({next:r=>{var c,u;if(r.success)t.some(g=>"INVALID"===g.state)?(this.titleText="Th\xeam c\xf4ng n\u1ee3 void v\xe9 th\xe0nh c\xf4ng!",this.bodyText=`\n <div> C\xf4ng n\u1ee3 void v\xe9 cho \u0111\u1ea1i l\xfd <span class="font-semibold">${this.agentInfo.name}</span> \u0111\xe3 \u0111\u01b0\u1ee3c th\xeam th\xe0nh c\xf4ng. </div>\n <div> To\xe0n b\u1ed9 c\xf4ng n\u1ee3 \u0111\xe3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt v\xe0o s\u1ed1 d\u01b0 c\xf4ng n\u1ee3 c\u1ee7a \u0111\u1ea1i l\xfd. </div>\n `,this.state="SUCCESS"):(this.titleText="\u0110\xe3 y\xeau c\u1ea7u x\xe9t duy\u1ec7t c\xf4ng n\u1ee3 void v\xe9!",this.bodyText=`\n <div> C\xf4ng n\u1ee3 c\u1ea7n x\xe9t duy\u1ec7t cho \u0111\u1ea1i l\xfd <span class="font-semibold">${this.agentInfo.name}</span> \u0111\xe3 \u0111\u01b0\u1ee3c g\u1eedi y\xeau c\u1ea7u. </div>\n <div> Sau khi \u0111\u01b0\u1ee3c x\xe9t duy\u1ec7t, c\xe1c c\xf4ng n\u1ee3 n\xe0y s\u1ebd \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt v\xe0o s\u1ed1 d\u01b0 c\xf4ng n\u1ee3 c\u1ee7a \u0111\u1ea1i l\xfd. </div>\n <div> C\xe1c c\xf4ng n\u1ee3 h\u1ee3p l\u1ec7 \u0111\xe3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt ngay l\u1eadp t\u1ee9c </div>\n `,this.state="RECORDED");else{const g=(null===(u=null===(c=r.objectError)||void 0===c?void 0:c.errorDescription)||void 0===u?void 0:u.vi)||"C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 void v\xe9";this.titleText="Th\xeam c\xf4ng n\u1ee3 void v\xe9 th\u1ea5t b\u1ea1i!",this.bodyText=`${g}. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch!`,this.state="ERROR"}},error:()=>{this.titleText="Th\xeam c\xf4ng n\u1ee3 void v\xe9 th\u1ea5t b\u1ea1i!",this.bodyText="C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 void v\xe9. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch!",this.state="ERROR"}}))}})}onOutsideRefund(t){const n=Object.assign(Object.assign({},this.getOutsideData),{ticketDetails:t.map(o=>({otherFee:o.otherFee||0,ticketNumber:o.ticketNumber||"",baseFare:o.baseFare||0,description:o.description||"",discountPayLater:o.discountPayLater||0,discountPayNow:o.discountPayNow||0,finalPrice:o.finalPrice||0,provider:o.provider||"",remark:o.remark||"",serviceFee:o.serviceFee||0,taxFare:o.taxFare||0,vatFare:o.vatFare||0}))});this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn g\u1eedi y\xeau c\u1ea7u x\xe9t duy\u1ec7t?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn th\xf4ng tin nh\u1eadp ch\xednh x\xe1c?",okText:"X\xe1c nh\u1eadn",cancelText:"H\u1ee7y",hasIcon:!1}).afterClosed$.subscribe({next:o=>{o.data&&(this.isLoadingSubmitted=!0,this._balanceService.outsideRefund(n).pipe((0,Z.x)(()=>this.isLoadingSubmitted=!1)).subscribe({next:r=>{var c,u;if(r.success)this.titleText="\u0110\xe3 y\xeau c\u1ea7u x\xe9t duy\u1ec7t c\xf4ng n\u1ee3 refund!",this.bodyText=`\n <div> C\xf4ng n\u1ee3 c\u1ea7n x\xe9t duy\u1ec7t cho \u0111\u1ea1i l\xfd <span class="font-semibold">${this.agentInfo.name}</span> \u0111\xe3 \u0111\u01b0\u1ee3c g\u1eedi y\xeau c\u1ea7u. </div>\n <div> Sau khi \u0111\u01b0\u1ee3c x\xe9t duy\u1ec7t, c\xe1c c\xf4ng n\u1ee3 n\xe0y s\u1ebd c\u1eadp nh\u1eadt v\xe0o s\u1ed1 d\u01b0 c\xf4ng n\u1ee3 c\u1ee7a \u0111\u1ea1i l\xfd. </div>\n `,this.state="RECORDED";else{const g=(null===(u=null===(c=r.objectError)||void 0===c?void 0:c.errorDescription)||void 0===u?void 0:u.vi)||"C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh t\u1ea1o y\xeau c\u1ea7u x\xe9t duy\u1ec7t c\xf4ng n\u1ee3 refund";this.titleText="Y\xeau c\u1ea7u x\xe9t duy\u1ec7t c\xf4ng n\u1ee3 refund th\u1ea5t b\u1ea1i!",this.bodyText=`\n <div> ${g}. </div>\n <div> Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch! </div>\n `,this.state="ERROR"}},error:()=>{this.titleText="Y\xeau c\u1ea7u x\xe9t duy\u1ec7t c\xf4ng n\u1ee3 refund th\u1ea5t b\u1ea1i!",this.bodyText="\n <div> C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh t\u1ea1o y\xeau c\u1ea7u x\xe9t duy\u1ec7t c\xf4ng n\u1ee3 refund. </div>\n <div> Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch! </div>\n ",this.state="ERROR"}}))}})}onOutsideDeposit(t){if(this.balanceForm.markAllAsTouched(),!t||this.balanceForm.invalid)return;const i={agentId:this.balanceForm.value.agentId,amount:t.amount,bankNumber:t.bankNumber,description:t.description||""};this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn th\xeam c\xf4ng n\u1ee3?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn th\xf4ng tin nh\u1eadp ch\xednh x\xe1c?",okText:"X\xe1c nh\u1eadn",cancelText:"H\u1ee7y",hasIcon:!1}).afterClosed$.subscribe({next:r=>{r.data&&(this.isLoadingSubmitted=!0,this._balanceService.depositBalanceOutside(i).pipe((0,Z.x)(()=>this.isLoadingSubmitted=!1)).subscribe({next:c=>{if(c.success)this.titleText="Th\xeam c\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n th\xe0nh c\xf4ng!",this.bodyText=`\n <div> C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n cho \u0111\u1ea1i l\xfd <span class="font-semibold">${this.agentInfo.name}</span> \u0111\xe3 \u0111\u01b0\u1ee3c th\xeam th\xe0nh c\xf4ng. </div>\n <div> S\u1ed1 d\u01b0 c\xf4ng n\u1ee3 c\u1ee7a \u0111\u1ea1i l\xfd \u0111\xe3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt. </div>\n `,this.state="SUCCESS";else{const u=c.objectError.errorDescription.vi;this.titleText="Th\xeam c\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n th\u1ea5t b\u1ea1i!",this.bodyText=u||"\n <div> C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch! </div>\n ",this.state="ERROR"}},error:()=>{this.titleText="Th\xeam c\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n th\u1ea5t b\u1ea1i!",this.bodyText="\n <div> C\xf3 l\u1ed7i x\u1ea3y ra trong qu\xe1 tr\xecnh th\xeam c\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n. Vui l\xf2ng th\u1eed l\u1ea1i ho\u1eb7c tr\u1edf v\u1ec1 m\xe0n h\xecnh danh s\xe1ch! </div>\n ",this.state="ERROR"}}))}})}onSelectAgentChange(t){this.agentInfo=t,this.agentBalanceAmount=t.available,this.balanceForm.controls.agentId.setValue(t.code)}onCreateNew(){this.state="CREATE",this.step=F.BOOKING_INFO,this.ticketDetailType=O.TICKET,this.initFormGroup(),this.bookingInfo=void 0}onManagBalanceOutside(){this._router.navigate(["admin/manage-balance-outside"])}onRetryCreate(){this.state="CREATE"}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(p.KNP),e.Y36(l.qu),e.Y36(Be.t7),e.Y36(qe.KD),e.Y36(w.mO),e.Y36(Je.j),e.Y36(S.F0),e.Y36(k.BX),e.Y36(Ue._),e.Y36(R.oE),e.Y36(A.$A))},a.\u0275cmp=e.Xpm({type:a,selectors:[["balance-outside-page"]],hostAttrs:[1,"h-full"],standalone:!0,features:[e.jDz],decls:7,vars:6,consts:[[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[4,"ngIf"],[1,"p-6","h-full","flex","flex-col","justify-center"],[1,"flex","gap-x-2","mb-5"],[1,"text-body-md-short","text-neutral-gray-4","cursor-pointer",3,"ngClass","click"],["icon","chevron_right","size","small",1,"text-neutral-gray-4"],[1,"text-body-md-short","text-neutral-gray-4",3,"ngClass"],["class","flex-auto flex flex-col gap-y-8",4,"ngIf"],["class","h-full flex-auto",4,"ngIf"],[1,"flex-auto","flex","flex-col","gap-y-8"],[1,"flex","flex-col"],[1,"flex","gap-x-[20px]","mb-4"],[1,"w-1","bg-primary-2-4"],[1,"text-heading-md","text-neutral-black"],[1,"bg-white","rounded","shadow-cf-md","flex","flex-col","gap-y-3","p-6"],[1,"flex","items-center","gap-x-2"],["textField","name","valueField","code","placeholder","Ch\u1ecdn \u0111\u1ea1i l\xfd",1,"!w-full","!max-w-full",3,"ngClass","status","data","allowSearch","formControl","selectedChange"],["cfLabel","",1,"text-express-sm","text-black",3,"CfRequired"],["cfHint","",3,"hint",4,"ngIf"],["class","animate-spin mt-5 opacity-50","icon","refresh","size","small",4,"ngIf"],[1,"flex","items-center","gap-x-8",3,"ngModel","checkChange","ngModelChange"],["size","medium",3,"value",4,"ngIf"],["class","flex flex-col",4,"ngIf"],[1,"flex","justify-between"],["cf-button","","size","medium",3,"disabled","click",4,"ngIf"],["cfHint","",3,"hint"],["icon","refresh","size","small",1,"animate-spin","mt-5","opacity-50"],["size","medium",3,"value"],[1,"bg-white","rounded","shadow-cf-md","p-6","flex","flex-col","gap-y-3"],[1,"flex","items-center","gap-x-8",3,"ngModel","ngModelChange","checkChange"],["size","medium",3,"disabled","value"],[1,"flex","gap-x-3"],[1,"flex-1",3,"status"],["cf-input","","size","medium","placeholder","Nh\u1eadp m\xe3 \u0111\u1eb7t ch\u1ed7",3,"formControl","keydown.enter"],["class","w-[180px]","textField","name","valueField","code","placeholder","Ch\u1ecdn h\xe3ng bay",3,"status","data","allowSearch","formControl","selectedChange",4,"ngIf"],["class","!text-button-md mt-7","cf-button","","size","medium","type","secondary",3,"disabled","click",4,"ngIf"],["class","border border-neutral-gray-2 rounded p-4",4,"ngIf"],["textField","name","valueField","code","placeholder","Ch\u1ecdn h\xe3ng bay",1,"w-[180px]",3,"status","data","allowSearch","formControl","selectedChange"],["cf-button","","size","medium","type","secondary",1,"!text-button-md","mt-7",3,"disabled","click"],["icon","search","size","small",1,"mr-2.5"],[1,"border","border-neutral-gray-2","rounded","p-4"],[1,"flex","items-center","gap-x-6"],[1,"w-[80px]","h-[40px]","object-contain",3,"src"],[1,"flex","flex-col","gap-y-3"],[1,"text-heading-sm"],[1,"text-espressive-md"],[1,"text-body-md","text-neutral-black"],[1,"w-full",3,"status"],["cf-input","","size","medium","placeholder","Nh\u1eadp m\xe3 hi\u1ec7u h\xe3ng bay",3,"formControl"],[3,"balanceAmount","valueChange"],["cf-button","","size","medium",3,"disabled","click"],["cfHeadIcon","","icon","chevron_right","size","small"],[1,"h-full","flex-auto"],["class","flex flex-col h-full",4,"ngIf"],[1,"flex","flex-col","h-full"],[3,"bookingInfo","previousStep","valueChange"],[3,"bookingInfo","agentId","previousStep","valueChange"],[1,"p-8","px-40","w-full","h-full"],[1,"flex","flex-col","justify-center","items-center","gap-y-6","bg-white","rounded","p-8"],["src","assets/images/wow-factor.svg"],[1,"flex","flex-col","items-center","gap-y-4"],[1,"text-center","text-body-md-long",3,"innerHTML"],["cf-button","","size","medium","type","secondary",1,"bg-white",3,"click"],["cfHeadIcon","","icon","document","size","small",1,"mr-2"],["cf-button","","size","medium",3,"click"],["cfHeadIcon","","icon","plus","size","small",1,"mr-2"],["src","assets/images/error.svg"],[1,"flex","flex-col","gap-y-4","text-center"],["cfHeadIcon","","icon","refresh","size","small",1,"mr-2"],["src","assets/images/validation.svg"],[1,"flex","flex-col","justify-center","items-center","gap-y-4"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0),e.YNc(1,pt,10,8,"div",1),e.YNc(2,gt,15,2,"div",1),e.YNc(3,ht,15,2,"div",1),e.YNc(4,_t,15,2,"div",1),e.YNc(5,mt,1,0,"div",2),e.qZA(),e.YNc(6,ft,1,0,"cf-spinner",3)),2&t&&(e.Q6J("ngSwitch",n.state),e.xp6(1),e.Q6J("ngSwitchCase","CREATE"),e.xp6(1),e.Q6J("ngSwitchCase","SUCCESS"),e.xp6(1),e.Q6J("ngSwitchCase","ERROR"),e.xp6(1),e.Q6J("ngSwitchCase","RECORDED"),e.xp6(2),e.Q6J("ngIf",n.isLoadingSubmitted))},dependencies:[d.ez,d.mk,d.O5,d.RF,d.n9,d.ED,b.N8,b.Xq,p.AxE,p.Sm8,l.u5,l.Fj,l.JJ,l.On,l.UX,l.oH,_.j$,_.ND,_.BN,_.v2,K.C,q.o,q.T,N.q,S.Bz,I.IA,Y,te,$,z,y.OR,X],encapsulation:2}),a})();var E=h(3447),Q=h(88516),H=h(35119),G=h(81664),ie=h(15439);function xt(a,s){1&a&&e._UZ(0,"cf-input-hint",27),2&a&&e.Q6J("hint","Th\u1eddi gian kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function Ct(a,s){if(1&a&&e._UZ(0,"img",48),2&a){const t=e.oxw().$implicit;e.Q6J("src",t.airlineLogo,e.LSH)}}function bt(a,s){1&a&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function Et(a,s){if(1&a&&(e.ynx(0),e.TgZ(1,"cf-label",49),e._UZ(2,"cf-icon",50),e._uU(3),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(1),e.Q6J("color","green"),e.xp6(2),e.hij(" ",n.stateObj[t.state]," ")}}function Tt(a,s){if(1&a&&(e.ynx(0),e.TgZ(1,"cf-label",51),e._UZ(2,"cf-icon",52),e._uU(3),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(1),e.Q6J("color","yellow"),e.xp6(2),e.hij(" ",n.stateObj[t.state]," ")}}function yt(a,s){if(1&a&&(e.ynx(0),e.TgZ(1,"cf-label",51),e._UZ(2,"cf-icon",53),e._uU(3),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(1),e.Q6J("color","red"),e.xp6(2),e.hij(" ",n.stateObj[t.state]," ")}}function At(a,s){if(1&a&&(e.ynx(0),e.TgZ(1,"cf-label",49),e._UZ(2,"cf-icon",54),e._uU(3),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(1),e.Q6J("color","purple"),e.xp6(2),e.hij(" ",n.stateObj[t.state]," ")}}function Zt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"tr",40)(1,"td",41),e._uU(2),e.qZA(),e.TgZ(3,"td",41),e._uU(4),e.qZA(),e.TgZ(5,"td",41),e._uU(6),e.ALo(7,"date"),e.qZA(),e.TgZ(8,"td",42),e._uU(9),e.qZA(),e.TgZ(10,"td",41),e._uU(11),e.qZA(),e.TgZ(12,"td",42),e.YNc(13,Ct,1,1,"img",43),e.YNc(14,bt,2,0,"span",26),e.qZA(),e.TgZ(15,"td",42)(16,"div",44),e.YNc(17,Et,4,2,"ng-container",45),e.YNc(18,Tt,4,2,"ng-container",45),e.YNc(19,yt,4,2,"ng-container",45),e.YNc(20,At,4,2,"ng-container",45),e.qZA()(),e.TgZ(21,"td",46)(22,"a",47),e.NdJ("click",function(){const o=e.CHM(t).$implicit,r=e.oxw(2);return e.KtG(r.onEdit(o.id))}),e._uU(23,"Chi ti\u1ebft"),e.qZA()()()}if(2&a){const t=s.$implicit,n=e.oxw(2);e.xp6(2),e.hij(" ",t.agentDisplay||"-"," "),e.xp6(2),e.hij(" ",n.typeObj[t.type]||"-"," "),e.xp6(2),e.hij(" ",t.timeAction?e.xi3(7,13,1e3*t.timeAction,"dd/MM/yyyy"):"-"," "),e.xp6(3),e.hij(" ",t.bookingCode||"-"," "),e.xp6(2),e.hij(" ",t.ticketNumber||"-"," "),e.xp6(2),e.Q6J("ngIf",t.airline),e.xp6(1),e.Q6J("ngIf",!t.airline),e.xp6(2),e.Q6J("ngSwitch",t.state),e.xp6(1),e.Q6J("ngSwitchCase","RECORDED"),e.xp6(1),e.Q6J("ngSwitchCase","PENDING"),e.xp6(1),e.Q6J("ngSwitchCase","REJECT"),e.xp6(1),e.Q6J("ngSwitchCase","APPROVED"),e.xp6(1),e.Q6J("sticky","right")}}const Ft=function(){return{num:25}},Dt=function(){return{num:50}},Nt=function(){return{num:75}},kt=function(){return{num:100}},St=function(a,s,t,n){return[a,s,t,n]},V=function(){return[]};function Ot(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",28)(1,"div",29),e._uU(2,"Danh s\xe1ch c\xf4ng n\u1ee3 th\u1ee7 c\xf4ng \u0111\xe3 t\u1ea1o"),e.qZA(),e.TgZ(3,"cf-table",30,31)(5,"thead",32)(6,"th",33),e._uU(7,"\u0110\u1ea1i l\xfd"),e.qZA(),e.TgZ(8,"th",33),e._uU(9,"Lo\u1ea1i c\xf4ng n\u1ee3"),e.qZA(),e.TgZ(10,"th",33),e._uU(11,"Ng\xe0y th\u1ef1c hi\u1ec7n"),e.qZA(),e.TgZ(12,"th",33),e._uU(13,"M\xe3 \u0111\u1eb7t ch\u1ed7"),e.qZA(),e.TgZ(14,"th",33),e._uU(15,"S\u1ed1 v\xe9"),e.qZA(),e.TgZ(16,"th",33),e._uU(17,"H\xe3ng bay"),e.qZA(),e.TgZ(18,"th",33),e._uU(19,"Tr\u1ea1ng th\xe1i"),e.qZA(),e.TgZ(20,"th",34),e._uU(21,"Ch\u1ee9c n\u0103ng"),e.qZA()(),e.TgZ(22,"tbody")(23,"tr")(24,"td",35)(25,"cf-input-group",36)(26,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.agentDisplay=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(27,"td",35)(28,"cf-input-group",36)(29,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.type=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(30,"td",35)(31,"cf-input-group",36)(32,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.timeAction=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(33,"td",35)(34,"cf-input-group",36)(35,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.bookingCode=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(36,"td",35)(37,"cf-input-group",36)(38,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.ticketNumber=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(39,"td",35)(40,"cf-input-group",36)(41,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.airline=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(42,"td",35)(43,"cf-input-group",36)(44,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.state=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e._UZ(45,"td",38),e.qZA(),e.YNc(46,Zt,24,16,"ng-template",39),e.qZA()()()}if(2&a){const t=e.MAs(4),n=e.oxw();e.xp6(3),e.Q6J("fnSort",n.sortChange)("fnSearch",n.searchChange)("pageSizeList",e.l5B(26,St,e.DdM(22,Ft),e.DdM(23,Dt),e.DdM(24,Nt),e.DdM(25,kt)))("listData",n.listOfData||e.DdM(31,V))("pageSize",n.pageSize),e.xp6(3),e.Q6J("sortName","agent"),e.xp6(2),e.Q6J("sortName","type"),e.xp6(2),e.Q6J("sortName","timeAction"),e.xp6(2),e.Q6J("sortName","bookingCode"),e.xp6(2),e.Q6J("sortName","ticketNumber"),e.xp6(2),e.Q6J("sortName","airline"),e.xp6(2),e.Q6J("sortName","state"),e.xp6(2),e.Q6J("sticky","right"),e.xp6(6),e.Q6J("ngModel",n.filterData.agentDisplay),e.xp6(3),e.Q6J("ngModel",n.filterData.type),e.xp6(3),e.Q6J("ngModel",n.filterData.timeAction),e.xp6(3),e.Q6J("ngModel",n.filterData.bookingCode),e.xp6(3),e.Q6J("ngModel",n.filterData.ticketNumber),e.xp6(3),e.Q6J("ngModel",n.filterData.airline),e.xp6(3),e.Q6J("ngModel",n.filterData.state),e.xp6(1),e.Q6J("sticky","right"),e.xp6(1),e.Q6J("ngForOf",t.partOfdata)}}function wt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",28)(1,"div",55)(2,"div"),e._UZ(3,"img",56),e.qZA(),e.TgZ(4,"div",57)(5,"div",58),e._uU(6,"Kh\xf4ng c\xf3 k\u1ebft qu\u1ea3"),e.qZA(),e.TgZ(7,"div",59)(8,"div"),e._uU(9,"Kh\xf4ng c\xf3 k\u1ebft qu\u1ea3 \u0111\u1ec3 hi\u1ec3n th\u1ecb"),e.qZA(),e.TgZ(10,"div"),e._uU(11,"Vui l\xf2ng ki\u1ec3m tra l\u1ea1i \u0111i\u1ec1u ki\u1ec7n t\xecm ki\u1ebfm ho\u1eb7c t\u1ea1o m\u1edbi c\xf4ng n\u1ee3 th\u1ee7 c\xf4ng."),e.qZA()()(),e.TgZ(12,"button",60),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onCreateNew())}),e._UZ(13,"cf-icon",61),e._uU(14," T\u1ea1o m\u1edbi "),e.qZA()()()}if(2&a){const t=e.oxw();e.xp6(12),e.Q6J("disabled",t.invalidTimeFilter)}}function It(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",28)(1,"div",55)(2,"div"),e._UZ(3,"img",62),e.qZA(),e.TgZ(4,"div",57)(5,"div",58),e._uU(6,"C\xf3 l\u1ed7i x\u1ea3y ra"),e.qZA(),e.TgZ(7,"div",59)(8,"div"),e._uU(9,"Kh\xf4ng th\u1ec3 hi\u1ec3n th\u1ecb danh s\xe1ch c\xf4ng n\u1ee3 \u0111\xe3 t\u1ea1o. Vui l\xf2ng th\u1eed l\u1ea1i!"),e.qZA()()(),e.TgZ(10,"button",60),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onRetry())}),e._UZ(11,"cf-icon",63),e._uU(12," Th\u1eed l\u1ea1i "),e.qZA()()()}if(2&a){const t=e.oxw();e.xp6(10),e.Q6J("disabled",t.invalidTimeFilter)}}function Bt(a,s){1&a&&e._UZ(0,"cf-spinner")}let qt=(()=>{class a{constructor(t,n,i,o,r,c){this._fb=n,this._balanceService=i,this._router=o,this._toastService=r,this._permissionService=c,this.pageSize=25,this.currentPage=1,this.typeOptions=[],this.typeObj={ALL:"T\u1ea5t c\u1ea3 lo\u1ea1i c\xf4ng n\u1ee3",DERIVATIVE:"C\xf4ng n\u1ee3 v\xe9",SURCHARGE:"C\xf4ng n\u1ee3 ph\u1ee5 thu",VOID_TICKET:"C\xf4ng n\u1ee3 void v\xe9",REFUND_TICKET:"C\xf4ng n\u1ee3 refund",DEPOSIT_BALANCE:"C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n",WITHDRAW_BALANCE:"C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n"},this.stateObj={ALL:"T\u1ea5t c\u1ea3 tr\u1ea1ng th\xe1i",RECORDED:"\u0110\xe3 ghi nh\u1eadn",PENDING:"C\u1ea7n x\xe9t \u0111uy\u1ec7t",REJECT:"\u0110\xe3 t\u1eeb ch\u1ed1i",APPROVED:"\u0110\xe3 ph\xea duy\u1ec7t"},this.stateOptions=[],this.agentOptions=[{code:"ALL",name:"T\u1ea5t c\u1ea3 \u0111\u1ea1i l\xfd"}],this.listOfData=[],this.dataSource=[],this.isLoadingData=!1,this.filterData={agent:"",agentDisplay:"",type:"",timeAction:"",bookingCode:"",ticketNumber:"",airline:"",state:""},this.dateRangeStr="",this.invalidTimeFilter=!1,this.state="SUCCESS",this.isShowDerivative=this._permissionService.hasPermission(A.or.EnterAriseBalanceManual),this.isShowVoid=this._permissionService.hasPermission(A.or.EnterVoidBalanceManual),this.isShowRefund=this._permissionService.hasPermission(A.or.EnterRefundBalanceManual),this.isShowDeposit=this._permissionService.hasPermission(A.or.EnterTopUpBalanceManual),this.searchChange=(u,g)=>g,this.increaseAlphabetSort=(u,g)=>u<g?-1:u>g?1:0,this.decreaseAlphabetSort=(u,g)=>u>g?-1:u<g?1:0,this.increaseNumberSort=(u,g)=>(u||(u=0),g||(g=0),u-g),this.decreaseNumberSort=(u,g)=>(u||(u=0),g||(g=0),g-u),this.sortChange=(u,g)=>{let f=g.map(C=>C);for(let C=0;C<u.length;C++){const T=u[C];switch(T.key){case"agent":f=f.sort("ascend"===T.sort?(v,m)=>this.increaseAlphabetSort(v.agent,m.agent):(v,m)=>this.decreaseAlphabetSort(v.agent,m.agent));break;case"type":f=f.sort("ascend"===T.sort?(v,m)=>this.increaseAlphabetSort(v.type,m.type):(v,m)=>this.decreaseAlphabetSort(v.type,m.type));break;case"timeAction":f=f.sort("ascend"===T.sort?(v,m)=>v.timeAction-m.timeAction:(v,m)=>m.timeAction-v.timeAction);break;case"bookingCode":f=f.sort("ascend"===T.sort?(v,m)=>this.increaseAlphabetSort(v.bookingCode,m.bookingCode):(v,m)=>this.decreaseAlphabetSort(v.bookingCode,m.bookingCode));break;case"ticketNumber":f=f.sort("ascend"===T.sort?(v,m)=>this.increaseAlphabetSort(v.ticketNumber,m.ticketNumber):(v,m)=>this.decreaseAlphabetSort(v.ticketNumber,m.ticketNumber));break;case"airline":f=f.sort("ascend"===T.sort?(v,m)=>this.increaseAlphabetSort(v.airline,m.airline):(v,m)=>this.decreaseAlphabetSort(v.airline,m.airline));break;case"state":f=f.sort("ascend"===T.sort?(v,m)=>this.increaseAlphabetSort(v.state,m.state):(v,m)=>this.decreaseAlphabetSort(v.state,m.state))}}return f},t.registerIcons([p.Rcu,p.D7,p.S7Q,p.fXw,p.PcQ,p.TM4,p.$S])}ngOnInit(){this.initOption(),this.initSearchForm(),this.getAllAgentBelong(),this.onSearch()}initSearchForm(){const t=(0,d.p6)((0,H.Z)(new Date),"dd/MM/yyyy","vi-VN"),n=(0,d.p6)((0,G.Z)(new Date),"dd/MM/yyyy","vi-VN");this.dateRangeStr=t+" - "+n,this.searchForm=this._fb.group({agentId:[null],startTime:[(0,H.Z)(new Date),l.kI.required],endTime:[(0,G.Z)(new Date),l.kI.required],state:["ALL"],type:["ALL"],searchInput:[null]})}initOption(){this.typeOptions=[{value:"ALL",name:"T\u1ea5t c\u1ea3 lo\u1ea1i c\xf4ng n\u1ee3",valid:!0},{value:"DERIVATIVE",name:"C\xf4ng n\u1ee3 v\xe9",valid:this.isShowDerivative},{value:"SURCHARGE",name:"C\xf4ng n\u1ee3 ph\u1ee5 thu",valid:this.isShowDerivative},{value:"VOID_TICKET",name:"C\xf4ng n\u1ee3 void v\xe9",valid:this.isShowVoid},{value:"REFUND_TICKET",name:"C\xf4ng n\u1ee3 refund",valid:this.isShowRefund},{value:"DEPOSIT_BALANCE",name:"C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n",valid:this.isShowDeposit},{value:"WITHDRAW_BALANCE",name:"C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n",valid:this.isShowDeposit}].filter(n=>n.valid).map(n=>({value:n.value,name:n.name}));for(const[n,i]of Object.entries(this.stateObj))this.stateOptions.push({value:n,name:i})}getAllAgentBelong(){this._balanceService.getAllAgentOutside().subscribe({next:t=>{const n=t.data.map(i=>({code:i.agentId,name:`${i.username} - ${i.displayName}`}));this.agentOptions=[...this.agentOptions,...n]}})}fromDateChange(t){t&&(this.minToDate=new Q.Ao(t.getFullYear(),t.getMonth()+1,t.getDate()))}onDateSelection(t,n,i,o){if(n.value||i.value)if(n.value&&!i.value&&t&&t.getTime()>=n.value.getTime()){i.setValue(t),o.close(),this.startDate=n.value;const r=(0,d.p6)(t,"dd/MM/yyyy","vi-VN");this.dateRangeStr+=r}else{i.setValue(null),n.setValue(t);const r=(0,d.p6)(t,"dd/MM/yyyy","vi-VN");this.dateRangeStr=r+" - "}else{n.setValue(t),i.setValue(null);const r=(0,d.p6)(t,"dd/MM/yyyy","vi-VN");this.dateRangeStr=r+" - "}this.invalidTimeFilter=n.invalid||i.invalid}onSearch(){this.state="SUCCESS";const t=this.searchForm.value,n={agentId:t.agentId||"ALL",startTime:t.startTime?ie(t.startTime).format("DD/MM/YYYY"):"",endTime:t.endTime?ie(t.endTime).format("DD/MM/YYYY"):"",searchInput:t.searchInput||"",state:t.state||"ALL",type:t.type||"ALL",zone:7};this.isLoadingData=!0,this._balanceService.getListOutside(n).pipe((0,Z.x)(()=>this.isLoadingData=!1)).subscribe({next:i=>{"OK"===i.status?(this.dataSource=i.data.map(o=>Object.assign(Object.assign({},o),{agentDisplay:`${o.username} - ${o.agent}`,airlineLogo:o.airline?["VN","VJ","QH"].includes(o.airline)?"assets/airline-logo/"+o.airline+".png":"assets/icons/airline-default.svg":""})),this.listOfData=this.dataSource.map(o=>o),this.listOfData.length||(this.state="EMPTY")):this.state="ERROR"},error:()=>{this.state="ERROR"}})}onEdit(t){this._router.navigate([`admin/balance-outside/${t}`])}filterChange(){this.listOfData=this.dataSource.filter(t=>{var n,i,o;const r=(0,E.E)(this.filterData.agentDisplay.toLowerCase());if(!(0,E.E)(t.agentDisplay.toLowerCase()).includes(r))return!1;const u=(0,E.E)(this.filterData.type.toLowerCase());if(!(0,E.E)(this.typeObj[t.type].toLowerCase()).includes(u))return!1;const f=(0,E.E)(this.filterData.timeAction.toLowerCase());if(!(0,E.E)((0,d.p6)(new Date(1e3*t.timeAction),"dd/MM/yyyy","vi-VN").toLowerCase()).includes(f))return!1;const T=(0,E.E)(this.filterData.bookingCode.toLowerCase());if(!(0,E.E)((null===(n=t.bookingCode)||void 0===n?void 0:n.toLowerCase())||"").includes(T))return!1;const m=(0,E.E)(this.filterData.ticketNumber.toLowerCase());if(!(0,E.E)((null===(i=t.ticketNumber)||void 0===i?void 0:i.toLowerCase())||"").includes(m))return!1;const j=(0,E.E)(this.filterData.airline.toLowerCase());if(!(0,E.E)((null===(o=t.airline)||void 0===o?void 0:o.toLowerCase())||"").includes(j))return!1;const un=(0,E.E)(this.filterData.state.toLowerCase());return!!(0,E.E)(this.stateObj[t.state].toLowerCase()).includes(un)})}onCreateNew(){this._router.navigate(["/admin/balance-outside"])}onRetry(){this.state="SUCCESS",this.onSearch()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(p.KNP),e.Y36(l.qu),e.Y36(w.mO),e.Y36(S.F0),e.Y36(k.BX),e.Y36(A.$A))},a.\u0275cmp=e.Xpm({type:a,selectors:[["manage-balance-outside-page"]],standalone:!0,features:[e.jDz],decls:38,vars:29,consts:[[1,"flex","flex-col","py-4","px-[30px]","bg-white","w-full"],[1,"flex","gap-x-[17px]"],[1,"w-full","flex","justify-between","gap-x-4"],[1,"flex","flex-col","grow","gap-y-4"],[1,"flex","w-full"],[1,"flex","mr-2"],[1,"grow",3,"status"],["cfHeadIcon","","icon","calendar","size","small"],["cfLabel",""],["cf-input","","type","text","size","medium","placeholder","Ch\u1ecdn ng\xe0y kh\u1edfi h\xe0nh",1,"py-[7px]",3,"ngModel","click","ngModelChange"],[1,"hidden"],["cfHint","",3,"hint",4,"ngIf"],["cfDatepicker","","type","text","outsideDays","hidden",1,"w-0","m-0","mr-2","bottom-0",3,"secondaryCalendar","displayMonths","rangeSelection","containerWidth","startDate","canReset","fromDate","toDate","dateSelect"],["dateRange","cfDatepicker"],["textField","name","valueField","value","size","medium","placeholder","Ch\u1ecdn \u0111\u1ea1i l\xfd",1,"grow-[180]","mr-4",3,"data","allowSearch","formControl"],["textField","name","valueField","value","size","medium","placeholder","Ch\u1ecdn lo\u1ea1i c\xf4ng n\u1ee3",1,"grow-[180]","mr-4",3,"data","allowSearch","formControl"],["textField","name","valueField","value","size","medium","placeholder","Ch\u1ecdn tr\u1ea1ng th\xe1i",1,"grow-[180]",3,"data","allowSearch","formControl"],[1,"!w-full"],["cfHeadIcon","","icon","search","size","small"],["size","medium","cf-input","","placeholder","T\xecm ki\u1ebfm trong danh s\xe1ch k\u1ebft qu\u1ea3...",3,"formControl"],["tableSearchInput",""],[1,"flex","flex-col","justify-end","w-[168px]","shrink-0"],["cf-button","","type","secondary","size","medium",1,"justify-center",3,"disabled","click"],["cfHeadIcon","","icon","search","size","small",1,"mr-2"],[1,"py-4","px-[30px]","rounded-lg"],["class","bg-neutral-white rounded-lg shadow-cf-md",4,"ngIf"],[4,"ngIf"],["cfHint","",3,"hint"],[1,"bg-neutral-white","rounded-lg","shadow-cf-md"],[1,"text-heading-sm","py-5","px-4"],[1,"",3,"fnSort","fnSearch","pageSizeList","listData","pageSize"],["managerTable",""],["cf-thead",""],["cf-th","",1,"whitespace-nowrap",3,"sortName"],["cf-th","",1,"whitespace-nowrap",3,"sticky"],["cf-td","",1,"py-2","px-1","!bg-neutral-white"],[1,"grow","!w-auto"],["type","text","size","medium","cf-input","","placeholder","L\u1ecdc",3,"ngModel","ngModelChange","input"],["cf-td","",3,"sticky"],["ngFor","",3,"ngForOf"],[1,"border-b","border-neutral-gray-1"],[1,"py-2","px-3","text-body-sm","whitespace-nowrap"],[1,"py-2","px-3","text-body-sm"],["class","w-[80px] h-[40px] object-contain",3,"src",4,"ngIf"],[1,"w-[150px]",3,"ngSwitch"],[4,"ngSwitchCase"],["cf-td","",1,"py-2","px-3",3,"sticky"],[1,"text-espressive-sm","text-secondary-3-4","cursor-pointer","whitespace-nowrap",3,"click"],[1,"w-[80px]","h-[40px]","object-contain",3,"src"],["type","inverted",3,"color"],["icon","document","size","small",1,"mr-2.5"],["type","inverted",1,"whitespace-nowrap",3,"color"],["icon","circle_warning","size","small",1,"mr-2.5"],["icon","error","size","small",1,"mr-2.5"],["icon","circle_check","size","small",1,"mr-2.5"],[1,"flex","flex-col","gap-y-8","justify-center","items-center","py-[120px]"],["src","assets/images/empty-result.svg","alt",""],[1,"flex","flex-col","gap-y-2","items-center"],[1,"text-heading-md"],[1,"text-body-md-short","text-center"],["cf-button","","size","medium",1,"justify-center",3,"disabled","click"],["icon","plus","size","small",1,"mr-2"],["src","assets/images/error.svg","alt",""],["icon","refresh","size","small",1,"mr-2"]],template:function(t,n){if(1&t){const i=e.EpF();e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"cf-input-group",6),e._UZ(7,"cf-icon",7),e.TgZ(8,"label",8),e._uU(9,"Th\u1eddi gian th\u1ef1c hi\u1ec7n"),e.qZA(),e.TgZ(10,"input",9),e.NdJ("click",function(){e.CHM(i);const r=e.MAs(14);return e.KtG(r.open())})("ngModelChange",function(r){return n.dateRangeStr=r}),e.qZA(),e.TgZ(11,"div",10),e.YNc(12,xt,1,1,"cf-input-hint",11),e.qZA()(),e.TgZ(13,"input",12,13),e.NdJ("dateSelect",function(r){e.CHM(i);const c=e.MAs(14);return e.KtG(n.onDateSelection(r,n.searchForm.controls.startTime,n.searchForm.controls.endTime,c))}),e.qZA()(),e.TgZ(15,"cf-select",14)(16,"label",8),e._uU(17,"\u0110\u1ea1i l\xfd"),e.qZA()(),e.TgZ(18,"cf-select",15)(19,"label",8),e._uU(20,"Lo\u1ea1i c\xf4ng n\u1ee3"),e.qZA()(),e.TgZ(21,"cf-select",16)(22,"label",8),e._uU(23,"Tr\u1ea1ng th\xe1i"),e.qZA()()(),e.TgZ(24,"cf-input-group",17),e._UZ(25,"cf-icon",18)(26,"input",19,20),e.qZA()(),e.TgZ(28,"div",21)(29,"button",22),e.NdJ("click",function(){return n.onSearch()}),e._UZ(30,"cf-icon",23),e._uU(31," T\xecm ki\u1ebfm "),e.qZA()()()()(),e.TgZ(32,"div",24),e.YNc(33,Ot,47,32,"div",25),e.YNc(34,wt,15,1,"div",25),e.YNc(35,It,13,1,"div",25),e.qZA(),e._UZ(36,"cf-toast"),e.YNc(37,Bt,1,0,"cf-spinner",26)}2&t&&(e.xp6(6),e.Q6J("status",n.invalidTimeFilter?"error":"default"),e.xp6(4),e.Q6J("ngModel",n.dateRangeStr),e.xp6(2),e.Q6J("ngIf",n.invalidTimeFilter),e.xp6(1),e.Q6J("secondaryCalendar","lunar")("displayMonths",2)("rangeSelection",!0)("containerWidth",600)("startDate",n.startDate)("canReset",!1)("fromDate",n.searchForm.controls.startTime.value)("toDate",n.searchForm.controls.endTime.value),e.xp6(2),e.Q6J("data",n.agentOptions||e.DdM(26,V))("allowSearch",!0)("formControl",n.searchForm.controls.agentId),e.xp6(3),e.Q6J("data",n.typeOptions||e.DdM(27,V))("allowSearch",!1)("formControl",n.searchForm.controls.type),e.xp6(3),e.Q6J("data",n.stateOptions||e.DdM(28,V))("allowSearch",!1)("formControl",n.searchForm.controls.state),e.xp6(5),e.Q6J("formControl",n.searchForm.controls.searchInput),e.xp6(3),e.Q6J("disabled",n.invalidTimeFilter),e.xp6(4),e.Q6J("ngIf","SUCCESS"===n.state),e.xp6(1),e.Q6J("ngIf","EMPTY"===n.state),e.xp6(1),e.Q6J("ngIf","ERROR"===n.state),e.xp6(2),e.Q6J("ngIf",n.isLoadingData))},dependencies:[d.ez,d.sg,d.O5,d.RF,d.n9,d.uU,l.u5,l.Fj,l.JJ,l.On,N.q,_.j$,_.ND,_.BN,_.v2,p.AxE,p.Sm8,Q.Cs,l.UX,l.oH,b.N8,b.Xq,x.rC,x.E_,x.zs,x.qS,M.b,k.hj,y.OR],encapsulation:2}),a})();function Jt(a,s){1&a&&(e.TgZ(0,"cf-label",34),e._UZ(1,"cf-icon",35),e._uU(2," \u0110\xe3 ghi nh\u1eadn "),e.qZA()),2&a&&e.Q6J("color","green")}function Ut(a,s){1&a&&(e.TgZ(0,"cf-label",34),e._UZ(1,"cf-icon",36),e._uU(2," C\u1ea7n x\xe9t duy\u1ec7t "),e.qZA()),2&a&&e.Q6J("color","yellow")}function Mt(a,s){1&a&&(e.TgZ(0,"cf-label",37),e._UZ(1,"cf-icon",38),e._uU(2," \u0110\xe3 t\u1eeb ch\u1ed1i "),e.qZA()),2&a&&e.Q6J("color","red")}function Pt(a,s){1&a&&(e.TgZ(0,"cf-label",34),e._UZ(1,"cf-icon",39),e._uU(2," \u0110\xe3 ph\xea duy\u1ec7t "),e.qZA()),2&a&&e.Q6J("color","purple")}function Qt(a,s){if(1&a&&(e.TgZ(0,"div",6)(1,"div",15),e._UZ(2,"div",16),e.TgZ(3,"div",17),e._uU(4,"Th\xf4ng tin n\u1ea1p ti\u1ec1n"),e.qZA()(),e.TgZ(5,"div",40)(6,"cf-input-group",41),e._UZ(7,"input",42),e.TgZ(8,"label",43),e._uU(9," Ng\xe2n h\xe0ng nh\u1eadn "),e.qZA()(),e.TgZ(10,"cf-input-group",41),e._UZ(11,"input",42),e.TgZ(12,"label",43),e._uU(13," S\u1ed1 ti\u1ec1n n\u1ea1p "),e.qZA()(),e.TgZ(14,"cf-input-group",41),e._UZ(15,"input",42),e.TgZ(16,"label",43),e._uU(17," Di\u1ec5n gi\u1ea3i "),e.qZA()()()()),2&a){const t=e.oxw();e.xp6(6),e.Q6J("disabled",!0)("status","default"),e.xp6(1),e.Q6J("value",t.agentDisplay.bankName),e.xp6(3),e.Q6J("disabled",!0)("status","default"),e.xp6(1),e.Q6J("value",t.agentDisplay.amount),e.xp6(3),e.Q6J("disabled",!0)("status","default"),e.xp6(1),e.Q6J("value",t.agentDisplay.depositDescription)}}function Vt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",6)(1,"div",15),e._UZ(2,"div",16),e.TgZ(3,"div",17),e._uU(4,"Th\xf4ng tin \u0111\u1eb7t ch\u1ed7"),e.qZA()(),e.TgZ(5,"div",23)(6,"cf-radio-group",19),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.agentDisplay.internal=i)}),e.TgZ(7,"cf-radio",20),e._uU(8,"Trong h\u1ec7 th\u1ed1ng"),e.qZA(),e.TgZ(9,"cf-radio",20),e._uU(10,"Ngo\xe0i h\u1ec7 th\u1ed1ng"),e.qZA()(),e.TgZ(11,"div",44)(12,"div",45)(13,"div",46)(14,"div",47)(15,"label",25),e._uU(16," M\xe3 \u0111\u1eb7t ch\u1ed7 "),e.qZA()(),e.TgZ(17,"div",48),e._uU(18),e.qZA()(),e.TgZ(19,"div",46)(20,"div",47)(21,"label",25),e._uU(22," H\xe3ng bay "),e.qZA()(),e.TgZ(23,"div",48),e._uU(24),e.qZA()()(),e.TgZ(25,"div",46)(26,"div",47)(27,"label",25),e._uU(28," S\u1ed1 v\xe9 "),e.qZA()(),e.TgZ(29,"div",48),e._uU(30),e.qZA()()()()(),e.TgZ(31,"div",6)(32,"div",15),e._UZ(33,"div",16),e.TgZ(34,"div",17),e._uU(35,"Th\xf4ng tin chi ph\xed"),e.qZA()(),e.TgZ(36,"div",40)(37,"div",49)(38,"div",46)(39,"div",47)(40,"label",25),e._uU(41," Gi\xe1 Net "),e.qZA()(),e.TgZ(42,"div",48),e._uU(43),e.qZA()(),e.TgZ(44,"div",46)(45,"div",47)(46,"label",25),e._uU(47," VAT "),e.qZA()(),e.TgZ(48,"div",48),e._uU(49),e.qZA()(),e.TgZ(50,"div",46)(51,"div",47)(52,"label",25),e._uU(53," Thu\u1ebf "),e.qZA()(),e.TgZ(54,"div",48),e._uU(55),e.qZA()(),e.TgZ(56,"div",46)(57,"div",47)(58,"label",25),e._uU(59," Ph\xed d\u1ecbch v\u1ee5 "),e.qZA()(),e.TgZ(60,"div",48),e._uU(61),e.qZA()(),e.TgZ(62,"div",46)(63,"div",47)(64,"label",25),e._uU(65," Ph\xed kh\xe1c "),e.qZA()(),e.TgZ(66,"div",48),e._uU(67),e.qZA()(),e.TgZ(68,"div",46)(69,"div",47)(70,"label",25),e._uU(71," Nh\xe0 cung c\u1ea5p "),e.qZA()(),e.TgZ(72,"div",48),e._uU(73),e.qZA()(),e.TgZ(74,"div",46)(75,"div",47)(76,"label",25),e._uU(77," Chi\u1ebft kh\u1ea5u tr\u1ea3 ngay "),e.qZA()(),e.TgZ(78,"div",48),e._uU(79),e.qZA()(),e.TgZ(80,"div",46)(81,"div",47)(82,"label",25),e._uU(83," Chi\u1ebft kh\u1ea5u tr\u1ea3 sau "),e.qZA()(),e.TgZ(84,"div",48),e._uU(85),e.qZA()(),e.TgZ(86,"div",46)(87,"div",47)(88,"label",25),e._uU(89," Gi\xe1 cu\u1ed1i "),e.qZA()(),e.TgZ(90,"div",48),e._uU(91),e.qZA()()()()()}if(2&a){const t=e.oxw();e.xp6(6),e.Q6J("ngModel",t.agentDisplay.internal),e.xp6(1),e.Q6J("disabled",!0)("value","true"),e.xp6(2),e.Q6J("disabled",!0)("value","false"),e.xp6(9),e.hij(" ",t.agentDisplay.bookingCode," "),e.xp6(6),e.hij(" ",t.agentDisplay.airline," "),e.xp6(6),e.hij(" ",t.agentDisplay.ticketNumber," "),e.xp6(13),e.hij(" ",t.agentDisplay.baseFare," "),e.xp6(6),e.hij(" ",t.agentDisplay.vatFare," "),e.xp6(6),e.hij(" ",t.agentDisplay.taxFare," "),e.xp6(6),e.hij(" ",t.agentDisplay.serviceFee," "),e.xp6(6),e.hij(" ",t.agentDisplay.otherFee," "),e.xp6(6),e.hij(" ",t.agentDisplay.provider," "),e.xp6(6),e.hij(" ",t.agentDisplay.discountPayNow," "),e.xp6(6),e.hij(" ",t.agentDisplay.discountPayLater," "),e.xp6(6),e.hij(" ",t.agentDisplay.finalPrice," ")}}function Lt(a,s){if(1&a&&(e.TgZ(0,"div",50)(1,"div",51)(2,"div"),e._UZ(3,"img",52),e.qZA(),e.TgZ(4,"div")(5,"div",11),e._uU(6),e.qZA(),e.TgZ(7,"div",53),e._uU(8),e.ALo(9,"date"),e.qZA()()(),e.TgZ(10,"div",54),e._uU(11),e.qZA()()),2&a){const t=s.$implicit;e.xp6(3),e.Q6J("src","https://cheapflighttest.s3.ap-southeast-1.amazonaws.com/avarta-default.jpg",e.LSH),e.xp6(3),e.Oqu(t.displayName),e.xp6(2),e.hij("",e.xi3(9,4,1e3*t.timeAction,"HH:mm - dd/MM/yyyy")," "),e.xp6(3),e.hij(" ",t.description," ")}}function Rt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",45)(1,"button",55),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onRejectOutside())}),e._UZ(2,"cf-icon",56),e._uU(3," T\u1eeb ch\u1ed1i "),e.qZA(),e.TgZ(4,"button",57),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onApproveOutside())}),e._UZ(5,"cf-icon",58),e._uU(6," Duy\u1ec7t "),e.qZA()()}}function Ht(a,s){1&a&&e._UZ(0,"cf-spinner")}let Gt=(()=>{class a{constructor(t,n,i,o,r,c,u){this._balanceService=t,this._modal=o,this._toastService=r,this._route=c,this._permissionService=u,this.listRemark=[],this.canApproveOutside=!1,this.isLoading=!1,this.isDisable=!0,this.typeOptions={DERIVATIVE:"C\xf4ng n\u1ee3 v\xe9",SURCHARGE:"C\xf4ng n\u1ee3 ph\u1ee5 thu",VOID_TICKET:"C\xf4ng n\u1ee3 void v\xe9",REFUND_TICKET:"C\xf4ng n\u1ee3 refund",DEPOSIT_BALANCE:"C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n",WITHDRAW_BALANCE:"C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n"},this.outsideId=n.snapshot.params.id,i.registerIcons([p.HTW,p.rks,p.UNF,p.PcQ,p.S7Q,p.fXw,p.TM4]),this.agentDisplay={agentAvatar:"",agentName:"",agentUserName:"",timeAction:0,state:"",type:"",internal:"true",bookingCode:"",airline:"",ticketNumber:"",baseFare:"",vatFare:"",taxFare:"",serviceFee:"",otherFee:"",provider:"",discountPayNow:"",discountPayLater:"",finalPrice:"",bankName:"",amount:"",depositDescription:""},this.getDetailOutside()}getDetailOutside(){this.isLoading=!0,this._balanceService.getDetailOutsideById(this.outsideId).pipe((0,Z.x)(()=>this.isLoading=!1)).subscribe({next:t=>{t.success&&this.mappingData(t.data)},error:t=>{403===t.status&&this._route.navigate(["/admin/403"],{replaceUrl:!0})}})}mappingData(t){var n;this.agentDisplay={agentAvatar:t.agentAvatar,agentName:t.agentName,agentUserName:t.agentUserName,timeAction:t.timeAction,state:t.state,type:t.type,internal:t.internal+"",bookingCode:t.bookingCode,airline:t.airline,ticketNumber:t.ticketNumber,baseFare:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.baseFare),vatFare:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.vatFare),taxFare:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.taxFare),serviceFee:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.serviceFee),otherFee:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.otherFee),provider:t.provider||"Kh\xf4ng c\xf3",discountPayNow:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.discountPayNow),discountPayLater:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.discountPayLater),finalPrice:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.finalPrice),bankName:t.bankName,amount:new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(t.amount),depositDescription:t.depositDescription},this.canApproveOutside=this._permissionService.hasPermission(A.or.CanApproveOutsideConsider)&&"PENDING"===t.state,this.listRemark=(null===(n=t.remarkList)||void 0===n?void 0:n.sort((i,o)=>o.timeAction-i.timeAction).map(i=>({displayName:i.displayName,timeAction:i.timeAction,avatar:i.avatar,description:i.description})))||[]}onAddRemark(){const t={outsideId:this.outsideId,description:this.remark};this.isLoading=!0,this._balanceService.addReamrkOutside(t).pipe((0,Z.x)(()=>this.isLoading=!1)).subscribe({next:n=>{n.success?(this._toastService.add({severity:"success",summary:"\u0110\xe3 c\u1eadp nh\u1eadt th\xe0nh c\xf4ng",detail:"\u0110\xe3 th\xeam th\xf4ng tin Remark m\u1edbi c\u1ee7a c\xf4ng n\u1ee3 th\xe0nh c\xf4ng!",sticky:!1}),this.listRemark.unshift({displayName:n.data.displayName,timeAction:n.data.timeAction,avatar:n.data.avatar,description:n.data.description}),this.remark=""):this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 th\xeam th\xf4ng tin Remark m\u1edbi. Vui l\xf2ng th\u1eed l\u1ea1i!",sticky:!0})},error:()=>{this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 th\xeam th\xf4ng tin Remark m\u1edbi. Vui l\xf2ng th\u1eed l\u1ea1i!",sticky:!0})}})}onApproveOutside(){this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn duy\u1ec7t y\xeau c\u1ea7u c\xf4ng n\u1ee3?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn ch\u1ea5p thu\u1eadn y\xeau c\u1ea7u c\xf4ng n\u1ee3 n\xe0y?",okText:"Duy\u1ec7t",cancelText:"H\u1ee7y",hasIcon:!1}).afterClosed$.subscribe({next:n=>{if(n.data){const i={id:this.outsideId,approve:!0};this.isLoading=!0,this._balanceService.updateOutside(i).pipe((0,Z.x)(()=>this.isLoading=!1)).subscribe({next:o=>{o.success?(this._toastService.add({severity:"success",summary:"Duy\u1ec7t c\xf4ng n\u1ee3 th\xe0nh c\xf4ng",detail:`\u0110\xe3 duy\u1ec7t y\xeau c\u1ea7u ${this.typeOptions[this.agentDisplay.type]} th\xe0nh c\xf4ng!`,sticky:!1}),this.mappingData(o.data)):this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 duy\u1ec7t y\xeau c\u1ea7u c\xf4ng n\u1ee3 l\xfac n\xe0y. Vui l\xf2ng th\u1eed l\u1ea1i sau!",sticky:!0})},error:()=>{this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 t\u1eeb ch\u1ed1i y\xeau c\u1ea7u c\xf4ng n\u1ee3 l\xfac n\xe0y. Vui l\xf2ng th\u1eed l\u1ea1i sau!",sticky:!0})}})}}})}onRejectOutside(){this._modal.open(y.V0,{title:"X\xe1c nh\u1eadn t\u1eeb ch\u1ed1i y\xeau c\u1ea7u c\xf4ng n\u1ee3?",body:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn t\u1eeb ch\u1ed1i y\xeau c\u1ea7u c\xf4ng n\u1ee3 n\xe0y?",okText:"T\u1eeb ch\u1ed1i",cancelText:"H\u1ee7y",hasIcon:!1}).afterClosed$.subscribe({next:n=>{n.data&&this._balanceService.updateOutside({id:this.outsideId,approve:!1}).subscribe({next:o=>{o.success?(this._toastService.add({severity:"success",summary:"T\u1eeb ch\u1ed1i c\xf4ng n\u1ee3 th\xe0nh c\xf4ng",detail:`\u0110\xe3 t\u1eeb ch\u1ed1i y\xeau c\u1ea7u ${this.typeOptions[this.agentDisplay.type]} th\xe0nh c\xf4ng!`,sticky:!1}),this.mappingData(o.data)):this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 t\u1eeb ch\u1ed1i y\xeau c\u1ea7u c\xf4ng n\u1ee3 l\xfac n\xe0y. Vui l\xf2ng th\u1eed l\u1ea1i sau!",sticky:!0})},error:()=>{this._toastService.add({severity:"error",summary:"C\xf3 l\u1ed7i x\u1ea3y ra",detail:"Kh\xf4ng th\u1ec3 t\u1eeb ch\u1ed1i y\xeau c\u1ea7u c\xf4ng n\u1ee3 l\xfac n\xe0y. Vui l\xf2ng th\u1eed l\u1ea1i sau!",sticky:!0})}})}})}onPreviousStep(){this._route.navigate(["admin/manage-balance-outside"])}onChangeRemark(t){this.isDisable=!t.trim()}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(w.mO),e.Y36(S.gz),e.Y36(p.KNP),e.Y36(R.oE),e.Y36(k.BX),e.Y36(S.F0),e.Y36(A.$A))},a.\u0275cmp=e.Xpm({type:a,selectors:[["detail-balance-outside"]],standalone:!0,features:[e.jDz],decls:68,vars:29,consts:[[1,"py-8","flex","justify-center"],[1,"w-[764px]","max-w-[764]","flex","flex-col","gap-y-6"],[1,"py-[20px]","px-6","flex","justify-between","bg-white","rounded"],[1,"flex","items-center","gap-x-[20px]"],[1,"w-[64px]","h-[64px]","overflow-hidden","relative"],["alt","",1,"object-cover","h-full","w-full","rounded-full",3,"src"],[1,"flex","flex-col"],[1,"text-heading-md"],[1,"text-body-lg"],[1,"flex","flex-col","justify-between"],[1,"flex","gap-x-8"],[1,"text-express-sm"],[1,"flex","gap-x-6","items-center"],["type","inverted",3,"color",4,"ngIf"],["class","whitespace-nowrap","type","inverted",3,"color",4,"ngIf"],[1,"flex","gap-x-[20px]","mb-4"],[1,"w-1","bg-primary-2-4"],[1,"text-heading-md","text-neutral-black"],[1,"bg-white","rounded","p-6"],[1,"flex","items-center","gap-x-8",3,"ngModel","ngModelChange"],["size","medium",3,"disabled","value"],["class","flex flex-col",4,"ngIf","ngIfElse"],["elseTempBalance",""],[1,"bg-white","rounded","p-6","flex","flex-col","gap-y-4"],["class","p-3 bg-neutral-gray-1 rounded flex flex-col gap-y-2",4,"ngFor","ngForOf"],[1,"text-espressive-sm","text-black","mb-1.5"],["placeholder","Ghi ch\xfa",1,"w-full","placeholder:text-body-md","placeholder:text-neutral-gray-4","border","border-neutral-gray-2","rounded-lg","shadow-xs","px-[14px]","py-[10px]","max-h-80",3,"ngModel","ngModelChange"],["cf-button","","size","small","type","secondary",1,"float-right","mt-1",3,"disabled","click"],["cfHeadIcon","","icon","plus","size","small",1,"mr-2"],[1,"flex","justify-between"],["cf-button","","size","medium","type","secondary",1,"bg-white",3,"click"],["cfHeadIcon","","icon","arrow_left","size","small",1,"mr-2"],["class","flex gap-x-4",4,"ngIf"],[4,"ngIf"],["type","inverted",3,"color"],["icon","document","size","small",1,"mr-2.5"],["icon","circle_warning","size","small",1,"mr-2.5"],["type","inverted",1,"whitespace-nowrap",3,"color"],["icon","error","size","small",1,"mr-2.5"],["icon","circle_check","size","small",1,"mr-2.5"],[1,"bg-white","rounded","p-6","flex","flex-col"],[1,"grow-[400]","!w-full",3,"disabled","status"],["cf-input","","size","medium",3,"value"],["cfLabel","",1,"text-espressive-sm","text-black","mb-1.5"],[1,"flex","flex-col","gap-y-4"],[1,"flex","gap-x-4"],[1,"flex","flex-col","gap-y-1.5","grow-[400]","!w-full"],[1,"text-espressive-md","text-neutral-gray-5"],[1,"w-full","h-[36px]","px-3","flex","items-center","text-body-md","text-neutral-gray-6","rounded","border","border-neutral-gray-3","bg-neutral-gray-0.5"],[1,"grid","grid-cols-3","gap-4"],[1,"p-3","bg-neutral-gray-1","rounded","flex","flex-col","gap-y-2"],[1,"flex","items-center","gap-x-2"],[1,"w-10","h-10","rounded-full","object-cover","ng-star-inserted",3,"src"],[1,"text-body-sm","text-neutral-gray-4"],[1,"text-body-sm","text-neutral-gray-6"],["cf-button","","size","medium",1,"!bg-neutral-gray-5",3,"click"],["cfHeadIcon","","icon","close","size","small",1,"mr-2"],["cf-button","","size","medium",3,"click"],["cfHeadIcon","","icon","circle_check","size","small",1,"mr-2"]],template:function(t,n){if(1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),e._UZ(5,"img",5),e.qZA(),e.TgZ(6,"div",6)(7,"div",7),e._uU(8),e.qZA(),e.TgZ(9,"div",8),e._uU(10),e.qZA()()(),e.TgZ(11,"div",9)(12,"div",10)(13,"div",11),e._uU(14,"Ng\xe0y th\u1ef1c hi\u1ec7n"),e.qZA(),e.TgZ(15,"div",11),e._uU(16,"Tr\u1ea1ng th\xe1i"),e.qZA()(),e.TgZ(17,"div",12)(18,"div",11),e._uU(19),e.ALo(20,"date"),e.qZA(),e.TgZ(21,"div"),e.YNc(22,Jt,3,1,"cf-label",13),e.YNc(23,Ut,3,1,"cf-label",13),e.YNc(24,Mt,3,1,"cf-label",14),e.YNc(25,Pt,3,1,"cf-label",13),e.qZA()()()(),e.TgZ(26,"div",6)(27,"div",15),e._UZ(28,"div",16),e.TgZ(29,"div",17),e._uU(30,"Lo\u1ea1i c\xf4ng n\u1ee3"),e.qZA()(),e.TgZ(31,"div",18)(32,"cf-radio-group",19),e.NdJ("ngModelChange",function(o){return n.agentDisplay.type=o}),e.TgZ(33,"cf-radio",20),e._uU(34,"C\xf4ng n\u1ee3 v\xe9"),e.qZA(),e.TgZ(35,"cf-radio",20),e._uU(36,"C\xf4ng n\u1ee3 ph\u1ee5 thu"),e.qZA(),e.TgZ(37,"cf-radio",20),e._uU(38,"Void v\xe9"),e.qZA(),e.TgZ(39,"cf-radio",20),e._uU(40,"Refund"),e.qZA(),e.TgZ(41,"cf-radio",20),e._uU(42,"N\u1ea1p ti\u1ec1n"),e.qZA()()()(),e.YNc(43,Qt,18,9,"div",21),e.YNc(44,Vt,92,17,"ng-template",null,22,e.W1O),e.TgZ(46,"div",6)(47,"div",15),e._UZ(48,"div",16),e.TgZ(49,"div",17),e._uU(50,"Remark"),e.qZA()(),e.TgZ(51,"div",23),e.YNc(52,Lt,12,7,"div",24),e.TgZ(53,"div")(54,"div",25),e._uU(55,"Remark m\u1edbi"),e.qZA(),e.TgZ(56,"textarea",26),e.NdJ("ngModelChange",function(o){return n.remark=o})("ngModelChange",function(o){return n.onChangeRemark(o)}),e._uU(57," "),e.qZA(),e.TgZ(58,"button",27),e.NdJ("click",function(){return n.onAddRemark()}),e._UZ(59,"cf-icon",28),e._uU(60," Th\xeam remark "),e.qZA()()()(),e.TgZ(61,"div",29)(62,"button",30),e.NdJ("click",function(){return n.onPreviousStep()}),e._UZ(63,"cf-icon",31),e._uU(64," Quay l\u1ea1i "),e.qZA(),e.TgZ(65,"div"),e.YNc(66,Rt,7,0,"div",32),e.qZA()()()(),e.YNc(67,Ht,1,0,"cf-spinner",33)),2&t){const i=e.MAs(45);e.xp6(5),e.Q6J("src","https://cheapflighttest.s3.ap-southeast-1.amazonaws.com/avarta-default.jpg",e.LSH),e.xp6(3),e.Oqu(n.agentDisplay.agentName),e.xp6(2),e.Oqu(n.agentDisplay.agentUserName),e.xp6(9),e.Oqu(e.xi3(20,26,1e3*n.agentDisplay.timeAction,"dd/MM/yyyy")),e.xp6(3),e.Q6J("ngIf","RECORDED"===n.agentDisplay.state),e.xp6(1),e.Q6J("ngIf","PENDING"===n.agentDisplay.state),e.xp6(1),e.Q6J("ngIf","REJECT"===n.agentDisplay.state),e.xp6(1),e.Q6J("ngIf","APPROVED"===n.agentDisplay.state),e.xp6(7),e.Q6J("ngModel",n.agentDisplay.type),e.xp6(1),e.Q6J("disabled",!0)("value","DERIVATIVE"),e.xp6(2),e.Q6J("disabled",!0)("value","SURCHARGE"),e.xp6(2),e.Q6J("disabled",!0)("value","VOID_TICKET"),e.xp6(2),e.Q6J("disabled",!0)("value","REFUND_TICKET"),e.xp6(2),e.Q6J("disabled",!0)("value","DEPOSIT_BALANCE"),e.xp6(2),e.Q6J("ngIf","DEPOSIT_BALANCE"===n.agentDisplay.type||"WITHDRAW_BALANCE"===n.agentDisplay.type)("ngIfElse",i),e.xp6(9),e.Q6J("ngForOf",n.listRemark),e.xp6(4),e.Q6J("ngModel",n.remark),e.xp6(2),e.Q6J("disabled",n.isDisable),e.xp6(8),e.Q6J("ngIf",n.canApproveOutside),e.xp6(1),e.Q6J("ngIf",n.isLoading)}},dependencies:[d.ez,d.sg,d.O5,d.uU,l.u5,l.Fj,l.JJ,l.On,b.N8,b.Xq,p.AxE,p.Sm8,M.b,q.o,q.T,_.j$,_.ND,_.BN,y.OR],encapsulation:2}),a})();function jt(a,s){1&a&&e._UZ(0,"cf-input-hint",27),2&a&&e.Q6J("hint","Th\u1eddi gian kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function Kt(a,s){if(1&a&&e._UZ(0,"img",46),2&a){const t=e.oxw().$implicit;e.Q6J("src","assets/airline-logo/"+t.airline+".png",e.LSH)}}function zt(a,s){if(1&a&&(e.TgZ(0,"cf-label",47),e._UZ(1,"cf-icon",48),e._uU(2),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("color","green"),e.xp6(2),e.hij(" ",t.stateStr," ")}}function Yt(a,s){if(1&a&&(e.TgZ(0,"cf-label",47),e._UZ(1,"cf-icon",49),e._uU(2),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("color","yellow"),e.xp6(2),e.hij(" ",t.stateStr," ")}}function $t(a,s){if(1&a&&(e.TgZ(0,"cf-label",47),e._UZ(1,"cf-icon",50),e._uU(2),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("color","red"),e.xp6(2),e.hij(" ",t.stateStr," ")}}function Xt(a,s){if(1&a&&(e.TgZ(0,"cf-label",47),e._UZ(1,"cf-icon",51),e._uU(2),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("color","purple"),e.xp6(2),e.hij(" ",t.stateStr," ")}}function Wt(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"tr",39)(1,"td",40),e._uU(2),e.qZA(),e.TgZ(3,"td",40),e._uU(4),e.qZA(),e.TgZ(5,"td",41),e._uU(6),e.qZA(),e.TgZ(7,"td",41),e._uU(8),e.qZA(),e.TgZ(9,"td",41),e._uU(10),e.qZA(),e.TgZ(11,"td",41),e.YNc(12,Kt,1,1,"img",42),e.qZA(),e.TgZ(13,"td",41),e.YNc(14,zt,3,2,"cf-label",43),e.YNc(15,Yt,3,2,"cf-label",43),e.YNc(16,$t,3,2,"cf-label",43),e.YNc(17,Xt,3,2,"cf-label",43),e.qZA(),e.TgZ(18,"td",44)(19,"a",45),e.NdJ("click",function(){const o=e.CHM(t).$implicit,r=e.oxw(2);return e.KtG(r.onEdit(o.id))}),e._uU(20,"Chi ti\u1ebft"),e.qZA()()()}if(2&a){const t=s.$implicit;e.xp6(2),e.hij(" ",t.agentDisplay," "),e.xp6(2),e.hij(" ",t.typeStr," "),e.xp6(2),e.hij(" ",t.timeActionStr," "),e.xp6(2),e.hij(" ",t.bookingCode," "),e.xp6(2),e.hij(" ",t.ticketNumber," "),e.xp6(2),e.Q6J("ngIf",t.airline),e.xp6(2),e.Q6J("ngIf","RECORDED"===t.state),e.xp6(1),e.Q6J("ngIf","PENDING"===t.state),e.xp6(1),e.Q6J("ngIf","REJECT"===t.state),e.xp6(1),e.Q6J("ngIf","APPROVED"===t.state)}}const en=function(){return{num:25}},tn=function(){return{num:50}},nn=function(){return{num:75}},on=function(){return{num:100}},an=function(a,s,t,n){return[a,s,t,n]},L=function(){return[]};function rn(a,s){if(1&a){const t=e.EpF();e.TgZ(0,"div",28)(1,"div",29),e._uU(2,"Danh s\xe1ch y\xeau c\u1ea7u c\xf4ng n\u1ee3 th\u1ee7 c\xf4ng c\u1ea7n ph\xea duy\u1ec7t"),e.qZA(),e.TgZ(3,"cf-table",30,31)(5,"thead",32)(6,"th",33),e._uU(7,"\u0110\u1ea1i l\xfd"),e.qZA(),e.TgZ(8,"th",33),e._uU(9,"Lo\u1ea1i c\xf4ng n\u1ee3"),e.qZA(),e.TgZ(10,"th",33),e._uU(11,"Ng\xe0y th\u1ef1c hi\u1ec7n"),e.qZA(),e.TgZ(12,"th",33),e._uU(13,"M\xe3 \u0111\u1eb7t ch\u1ed7"),e.qZA(),e.TgZ(14,"th",33),e._uU(15,"S\u1ed1 v\xe9"),e.qZA(),e.TgZ(16,"th",33),e._uU(17,"H\xe3ng bay"),e.qZA(),e.TgZ(18,"th",33),e._uU(19,"Tr\u1ea1ng th\xe1i"),e.qZA(),e._UZ(20,"th",34),e.qZA(),e.TgZ(21,"tbody")(22,"tr")(23,"td",35)(24,"cf-input-group",36)(25,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.agentDisplay=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(26,"td",35)(27,"cf-input-group",36)(28,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.typeStr=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(29,"td",35)(30,"cf-input-group",36)(31,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.timeActionStr=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(32,"td",35)(33,"cf-input-group",36)(34,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.bookingCode=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(35,"td",35)(36,"cf-input-group",36)(37,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.ticketNumber=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(38,"td",35)(39,"cf-input-group",36)(40,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.airline=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()(),e.TgZ(41,"td",35)(42,"cf-input-group",36)(43,"input",37),e.NdJ("ngModelChange",function(i){e.CHM(t);const o=e.oxw();return e.KtG(o.filterData.stateStr=i)})("input",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.filterChange())}),e.qZA()()()(),e.YNc(44,Wt,21,10,"ng-template",38),e.qZA()()()}if(2&a){const t=e.MAs(4),n=e.oxw();e.xp6(3),e.Q6J("fnSort",n.sortChange)("fnSearch",n.searchChange)("pageSizeList",e.l5B(24,an,e.DdM(20,en),e.DdM(21,tn),e.DdM(22,nn),e.DdM(23,on)))("listData",n.listOfData||e.DdM(29,L))("pageSize",n.pageSize),e.xp6(3),e.Q6J("sortName","agent"),e.xp6(2),e.Q6J("sortName","typeStr"),e.xp6(2),e.Q6J("sortName","timeAction"),e.xp6(2),e.Q6J("sortName","bookingCode"),e.xp6(2),e.Q6J("sortName","ticketNumber"),e.xp6(2),e.Q6J("sortName","airline"),e.xp6(2),e.Q6J("sortName","stateStr"),e.xp6(7),e.Q6J("ngModel",n.filterData.agentDisplay),e.xp6(3),e.Q6J("ngModel",n.filterData.typeStr),e.xp6(3),e.Q6J("ngModel",n.filterData.timeActionStr),e.xp6(3),e.Q6J("ngModel",n.filterData.bookingCode),e.xp6(3),e.Q6J("ngModel",n.filterData.ticketNumber),e.xp6(3),e.Q6J("ngModel",n.filterData.airline),e.xp6(3),e.Q6J("ngModel",n.filterData.stateStr),e.xp6(1),e.Q6J("ngForOf",t.partOfdata)}}function sn(a,s){1&a&&(e.TgZ(0,"div",28)(1,"div",52)(2,"div"),e._UZ(3,"img",53),e.qZA(),e.TgZ(4,"div",54)(5,"div",55),e._uU(6,"Kh\xf4ng c\xf3 k\u1ebft qu\u1ea3"),e.qZA(),e.TgZ(7,"div",56)(8,"div"),e._uU(9,"Kh\xf4ng c\xf3 k\u1ebft qu\u1ea3 \u0111\u1ec3 hi\u1ec3n th\u1ecb"),e.qZA(),e.TgZ(10,"div"),e._uU(11,"Vui l\xf2ng ki\u1ec3m tra l\u1ea1i \u0111i\u1ec1u ki\u1ec7n t\xecm ki\u1ebfm."),e.qZA()()()()())}function ln(a,s){1&a&&e._UZ(0,"cf-spinner")}let cn=(()=>{class a{constructor(t,n,i,o,r){this._fb=n,this._balanceService=i,this._router=o,this._toastService=r,this.pageSize=25,this.currentPage=1,this.typeOptions=[],this.typeObj={ALL:"T\u1ea5t c\u1ea3 lo\u1ea1i c\xf4ng n\u1ee3",DERIVATIVE:"C\xf4ng n\u1ee3 ph\xe1t sinh",VOID_TICKET:"C\xf4ng n\u1ee3 void v\xe9",REFUND_TICKET:"C\xf4ng n\u1ee3 refund",DEPOSIT_BALANCE:"C\xf4ng n\u1ee3 n\u1ea1p ti\u1ec1n"},this.stateObj={ALL:"T\u1ea5t c\u1ea3 tr\u1ea1ng th\xe1i",RECORDED:"\u0110\xe3 ghi nh\u1eadn",PENDING:"C\u1ea7n x\xe9t \u0111uy\u1ec7t",REJECT:"\u0110\xe3 t\u1eeb ch\u1ed1i",APPROVED:"\u0110\xe3 ph\xea duy\u1ec7t"},this.stateOptions=[],this.agentOptions=[{code:"ALL",name:"T\u1ea5t c\u1ea3 \u0111\u1ea1i l\xfd"}],this.listOfData=[],this.dataSource=[],this.isLoadingData=!1,this.dateRangeStr="",this.isEmpty=!1,this.filterData={agent:"",agentDisplay:"",typeStr:"",timeActionStr:"",bookingCode:"",ticketNumber:"",airline:"",stateStr:""},this.searchChange=(c,u)=>u,this.sortChange=(c,u)=>{let g=u.map(f=>f);for(let f=0;f<c.length;f++){const C=c[f];switch(C.key){case"agent":g=this.agentSort(g,C);break;case"typeStr":g=this.typeStrSort(g,C);break;case"timeAction":g=this.timeActionSort(g,C);break;case"bookingCode":g=this.bookingCodeSort(g,C);break;case"ticketNumber":g=this.ticketNumberSort(g,C);break;case"airline":g=this.airlineSort(g,C);break;case"stateStr":g=this.stateStrSort(g,C)}}return g},this.increaseAlphabetSort=(c,u)=>c<u?-1:c>u?1:0,this.decreaseAlphabetSort=(c,u)=>c>u?-1:c<u?1:0,this.increaseNumberSort=(c,u)=>c-u,this.decreaseNumberSort=(c,u)=>u-c,t.registerIcons([p.Rcu,p.D7,p.S7Q,p.fXw,p.PcQ])}ngOnInit(){this.initOption(),this.initSearchForm(),this.getAllAgentBelong(),this.onSearch()}initSearchForm(){const t=(0,H.Z)(new Date),n=(0,G.Z)(new Date),i=(0,d.p6)(t,"dd/MM/yyyy","vi-VN"),o=(0,d.p6)(n,"dd/MM/yyyy","vi-VN");this.dateRangeStr=i+" - "+o,this.searchForm=this._fb.group({agentId:["ALL"],startTime:[t,l.kI.required],endTime:[n,l.kI.required],state:["ALL"],type:["ALL"],searchText:[null]})}initOption(){for(const[t,n]of Object.entries(this.typeObj))this.typeOptions.push({code:t,name:n});for(const[t,n]of Object.entries(this.stateObj))this.stateOptions.push({code:t,name:n})}getAllAgentBelong(){this._balanceService.getAllAgentOutside().subscribe({next:t=>{const n=t.data.map(i=>({code:i.agentId,name:`${i.username} - ${i.displayName}`}));this.agentOptions=[...this.agentOptions,...n]}})}fromDateChange(t){t&&(this.minToDate=new Q.Ao(t.getFullYear(),t.getMonth()+1,t.getDate()))}resetRangeDate(t,n){t.setValue(""),n.setValue("")}onDateSelection(t,n,i,o){if(n.value||i.value)if(n.value&&!i.value&&t&&t.getTime()>=n.value.getTime()){i.setValue(t),o.close(),this.startDate=n.value;const r=(0,d.p6)(t,"dd/MM/yyyy","vi-VN");this.dateRangeStr+=r}else{i.setValue(null),n.setValue(t);const r=(0,d.p6)(t,"dd/MM/yyyy","vi-VN");this.dateRangeStr=r+" - "}else{n.setValue(t),i.setValue(null);const r=(0,d.p6)(t,"dd/MM/yyyy","vi-VN");this.dateRangeStr=r+" - "}}onSearch(){const t=this.searchForm.value,n={agentId:t.agentId||"ALL",startTime:(0,d.p6)(new Date(t.startTime),"dd/MM/yyyy","vi-VN"),endTime:(0,d.p6)(new Date(t.endTime),"dd/MM/yyyy","vi-VN"),searchInput:t.searchText||"",state:t.state||"ALL",type:t.type||"ALL",zone:7};this.isLoadingData=!0,this._balanceService.getListOutsideConsider(n).pipe((0,Z.x)(()=>this.isLoadingData=!1)).subscribe({next:i=>{var o,r;this.dataSource=null!==(r=null===(o=i.data)||void 0===o?void 0:o.map(c=>Object.assign(Object.assign({},c),{agentDisplay:`${c.username} - ${c.agent}`,typeStr:this.typeObj[c.type],stateStr:this.stateObj[c.state],timeActionStr:(0,ee.Z)(1e3*c.timeAction,"dd/MM/yyyy")||""})))&&void 0!==r?r:[],this.listOfData=this.dataSource.map(c=>c),this.isEmpty=!this.listOfData.length},error:()=>{this.isEmpty=!0,this._toastService.add({severity:"error",summary:"Th\u1ea5t b\u1ea1i",detail:"Kh\xf4ng c\xf3 k\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1",sticky:!0})}})}onEdit(t){this._router.navigate([`admin/balance-outside/${t}`])}agentSort(t,n){return t.sort("ascend"===n.sort?(i,o)=>this.increaseAlphabetSort(i.agent,o.agent):(i,o)=>this.decreaseAlphabetSort(i.agent,o.agent))}typeStrSort(t,n){return t.sort("ascend"===n.sort?(i,o)=>this.increaseAlphabetSort(i.typeStr,o.typeStr):(i,o)=>this.decreaseAlphabetSort(i.typeStr,o.typeStr))}timeActionSort(t,n){return t.sort("ascend"===n.sort?(i,o)=>this.increaseNumberSort(i.timeAction,o.timeAction):(i,o)=>this.decreaseNumberSort(i.timeAction,o.timeAction))}bookingCodeSort(t,n){return t.sort("ascend"===n.sort?(i,o)=>this.increaseAlphabetSort(i.bookingCode,o.bookingCode):(i,o)=>this.decreaseAlphabetSort(i.bookingCode,o.bookingCode))}ticketNumberSort(t,n){return t.sort("ascend"===n.sort?(i,o)=>this.increaseAlphabetSort(i.ticketNumber,o.ticketNumber):(i,o)=>this.decreaseAlphabetSort(i.ticketNumber,o.ticketNumber))}airlineSort(t,n){return t.sort("ascend"===n.sort?(i,o)=>this.increaseAlphabetSort(i.airline,o.airline):(i,o)=>this.decreaseAlphabetSort(i.airline,o.airline))}stateStrSort(t,n){return t.sort("ascend"===n.sort?(i,o)=>this.increaseAlphabetSort(i.stateStr,o.stateStr):(i,o)=>this.decreaseAlphabetSort(i.stateStr,o.stateStr))}removeAccents(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\u0111/g,"d").replace(/\u0110/g,"D")}filterChange(){this.listOfData=this.dataSource.filter(t=>{const n=this.removeAccents(t.agentDisplay.toLowerCase()),i=this.removeAccents(this.filterData.agentDisplay.toLowerCase());if(!n.includes(i))return!1;const o=this.removeAccents(t.typeStr.toLowerCase()),r=this.removeAccents(this.filterData.typeStr.toLowerCase());if(!o.includes(r))return!1;const c=this.removeAccents(t.timeActionStr.toLowerCase()),u=this.removeAccents(this.filterData.timeActionStr.toLowerCase());if(!c.includes(u))return!1;const g=this.removeAccents(t.bookingCode.toLowerCase()),f=this.removeAccents(this.filterData.bookingCode.toLowerCase());if(!g.includes(f))return!1;const C=this.removeAccents(t.ticketNumber.toLowerCase()),T=this.removeAccents(this.filterData.ticketNumber.toLowerCase());if(!C.includes(T))return!1;const v=this.removeAccents(t.airline.toLowerCase()),m=this.removeAccents(this.filterData.airline.toLowerCase());if(!v.includes(m))return!1;const oe=this.removeAccents(t.stateStr.toLowerCase()),j=this.removeAccents(this.filterData.stateStr.toLowerCase());return!!oe.includes(j)})}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(p.KNP),e.Y36(l.qu),e.Y36(w.mO),e.Y36(S.F0),e.Y36(k.BX))},a.\u0275cmp=e.Xpm({type:a,selectors:[["manage-balance-outside-consider-page"]],standalone:!0,features:[e.jDz],decls:37,vars:28,consts:[[1,"flex","flex-col","py-4","px-[30px]","bg-white","w-full"],[1,"flex","gap-x-[17px]"],[1,"flex","flex-col","grow","gap-y-4"],[1,"flex","w-full","justify-center"],[1,"flex","mr-2"],[1,"grow",3,"status"],["cfHeadIcon","","icon","calendar","size","small"],["cfLabel",""],["cf-input","","type","text","size","medium","placeholder","Ch\u1ecdn kho\u1ea3ng th\u1eddi gian",1,"py-[7px]",3,"ngModel","click","ngModelChange"],[1,"hidden"],["cfHint","",3,"hint",4,"ngIf"],["cfDatepicker","","type","text","outsideDays","hidden",1,"w-0","m-0","mr-2","bottom-0",3,"secondaryCalendar","displayMonths","rangeSelection","containerWidth","startDate","canReset","fromDate","toDate","dateSelect"],["dateRange","cfDatepicker"],["textField","name","valueField","code","size","medium","placeholder","Ch\u1ecdn \u0111\u1ea1i l\xfd",1,"grow-[180]","mr-4",3,"data","allowSearch","formControl"],["textField","name","valueField","code","size","medium","placeholder","Ch\u1ecdn lo\u1ea1i c\xf4ng n\u1ee3",1,"grow-[180]","mr-4",3,"data","allowSearch","formControl"],["textField","name","valueField","code","size","medium","placeholder","Ch\u1ecdn tr\u1ea1ng th\xe1i",1,"grow-[180]",3,"data","allowSearch","formControl"],[1,"flex","justify-center","gap-x-4","items-center"],[1,"!w-full"],["cfHeadIcon","","icon","search","size","small"],["size","medium","cf-input","","placeholder","T\xecm ki\u1ebfm theo s\u1ed1 v\xe9, m\xe3 \u0111\u1eb7t ch\u1ed7...",3,"formControl"],["tableSearchInput",""],[1,"flex","flex-col","justify-end","w-[168px]","shrink-0"],["cf-button","","type","secondary","size","medium",1,"justify-center",3,"disabled","click"],["cfHeadIcon","","icon","search","size","small",1,"mr-2"],[1,"py-4","px-[30px]","rounded-lg"],["class","bg-neutral-white rounded-lg shadow-cf-md",4,"ngIf"],[4,"ngIf"],["cfHint","",3,"hint"],[1,"bg-neutral-white","rounded-lg","shadow-cf-md"],[1,"text-heading-sm","py-5","px-4"],[1,"",3,"fnSort","fnSearch","pageSizeList","listData","pageSize"],["managerTable",""],["cf-thead",""],["cf-th","",1,"whitespace-nowrap",3,"sortName"],["cf-th",""],["cf-td","",1,"py-2","px-1","!bg-neutral-white"],[1,"grow","!w-auto"],["type","text","size","medium","cf-input","","placeholder","L\u1ecdc",3,"ngModel","ngModelChange","input"],["ngFor","",3,"ngForOf"],[1,"border-b","border-neutral-gray-1"],[1,"py-2","px-3","text-body-sm","whitespace-nowrap"],[1,"py-2","px-3","text-body-sm"],["class","w-[80px] h-[40px] object-contain",3,"src",4,"ngIf"],["type","inverted",3,"color",4,"ngIf"],[1,"py-2","px-3"],[1,"text-espressive-sm","text-secondary-3-4","cursor-pointer","whitespace-nowrap",3,"click"],[1,"w-[80px]","h-[40px]","object-contain",3,"src"],["type","inverted",3,"color"],["icon","document","size","small",1,"mr-2.5"],["icon","circle_warning","size","small",1,"mr-2.5"],["icon","error","size","small",1,"mr-2.5"],["icon","circle_check","size","small",1,"mr-2.5"],[1,"flex","flex-col","gap-y-8","justify-center","items-center","py-[120px]"],["src","assets/images/empty-result.svg","alt",""],[1,"flex","flex-col","gap-y-2","items-center"],[1,"text-heading-md"],[1,"text-body-md-short","text-center"]],template:function(t,n){if(1&t){const i=e.EpF();e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"cf-input-group",5),e._UZ(6,"cf-icon",6),e.TgZ(7,"label",7),e._uU(8,"Th\u1eddi gian th\u1ef1c hi\u1ec7n"),e.qZA(),e.TgZ(9,"input",8),e.NdJ("click",function(){e.CHM(i);const r=e.MAs(13);return e.KtG(r.open())})("ngModelChange",function(r){return n.dateRangeStr=r}),e.qZA(),e.TgZ(10,"div",9),e.YNc(11,jt,1,1,"cf-input-hint",10),e.qZA()(),e.TgZ(12,"input",11,12),e.NdJ("dateSelect",function(r){e.CHM(i);const c=e.MAs(13);return e.KtG(n.onDateSelection(r,n.searchForm.controls.startTime,n.searchForm.controls.endTime,c))}),e.qZA()(),e.TgZ(14,"cf-select",13)(15,"label",7),e._uU(16,"\u0110\u1ea1i l\xfd"),e.qZA()(),e.TgZ(17,"cf-select",14)(18,"label",7),e._uU(19,"Lo\u1ea1i c\xf4ng n\u1ee3"),e.qZA()(),e.TgZ(20,"cf-select",15)(21,"label",7),e._uU(22,"Tr\u1ea1ng th\xe1i"),e.qZA()()(),e.TgZ(23,"div",16)(24,"cf-input-group",17),e._UZ(25,"cf-icon",18)(26,"input",19,20),e.qZA(),e.TgZ(28,"div",21)(29,"button",22),e.NdJ("click",function(){return n.onSearch()}),e._UZ(30,"cf-icon",23),e._uU(31," T\xecm ki\u1ebfm "),e.qZA()()()()()(),e.TgZ(32,"div",24),e.YNc(33,rn,45,30,"div",25),e.YNc(34,sn,12,0,"div",25),e.qZA(),e._UZ(35,"cf-toast"),e.YNc(36,ln,1,0,"cf-spinner",26)}2&t&&(e.xp6(5),e.Q6J("status",n.searchForm.invalid?"error":"default"),e.xp6(4),e.Q6J("ngModel",n.dateRangeStr),e.xp6(2),e.Q6J("ngIf",n.searchForm.invalid),e.xp6(1),e.Q6J("secondaryCalendar","lunar")("displayMonths",2)("rangeSelection",!0)("containerWidth",600)("startDate",n.startDate)("canReset",!1)("fromDate",n.searchForm.controls.startTime.value)("toDate",n.searchForm.controls.endTime.value),e.xp6(2),e.Q6J("data",n.agentOptions||e.DdM(25,L))("allowSearch",!0)("formControl",n.searchForm.controls.agentId),e.xp6(3),e.Q6J("data",n.typeOptions||e.DdM(26,L))("allowSearch",!1)("formControl",n.searchForm.controls.type),e.xp6(3),e.Q6J("data",n.stateOptions||e.DdM(27,L))("allowSearch",!1)("formControl",n.searchForm.controls.state),e.xp6(6),e.Q6J("formControl",n.searchForm.controls.searchText),e.xp6(3),e.Q6J("disabled",n.searchForm.invalid),e.xp6(4),e.Q6J("ngIf",!n.isEmpty),e.xp6(1),e.Q6J("ngIf",n.isEmpty),e.xp6(2),e.Q6J("ngIf",n.isLoadingData))},dependencies:[d.ez,d.sg,d.O5,N.q,_.j$,_.ND,_.BN,_.v2,p.AxE,p.Sm8,Q.Cs,l.u5,l.Fj,l.JJ,l.On,l.UX,l.oH,b.N8,b.Xq,x.rC,x.E_,x.zs,M.b,k.hj,y.OR],encapsulation:2}),a})()},3447:(ae,B,h)=>{h.d(B,{E:()=>d});const d=l=>l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\u0111/g,"d").replace(/\u0110/g,"D")}}]);