1import"./chunk-C5RKRHU2.js";import{o as Wc,q as Kc}from"./chunk-3QOT6XML.js";import{A as Oc,B as qi,C as Do,D as qc,E as jc,F as ji,H as An,I as nt,J as Qi,K as Qc,a as $c,b as Dc,c as Hc,e as Hi,f as Gi,g as vn,k as Sn,l as Gc,s as bt,w as Oi}from"./chunk-RHZEMOXT.js";import{a as Sc,b as Ac,c as Ec,d as Lc,e as Fc,g as Rc,h as Mc,i as kc,j as Nc,k as Vc,l as Bc}from"./chunk-CNPCWFMS.js";import{a as Di,b as Uc}from"./chunk-RD5DYUMZ.js";import"./chunk-HU3ORVED.js";import"./chunk-BVPTKC2G.js";import"./chunk-WOU5QES2.js";import"./chunk-K5F3YTBA.js";import"./chunk-YFMIEPH7.js";import"./chunk-TDGDCDRL.js";import"./chunk-UCW2MGZY.js";import{a as $i}from"./chunk-J2P2GWEZ.js";import{c as Pc,d as Tc}from"./chunk-BZIUBWW6.js";import{$a as wc,Sa as Ic,Ya as xc,c as Bi}from"./chunk-NHYJEYTC.js";import"./chunk-HFFUHT32.js";import"./chunk-HOGHYNUB.js";import"./chunk-4KKIVUA6.js";import{$ as yo,$H as ws,$P as bl,$R as ko,$U as Gl,$b as wa,$e as Ta,$o as fr,AH as Tn,AP as fl,AQ as Pl,Ap as gi,BF as Xr,BJ as Qs,BT as Ul,BW as Xl,BX as Bo,Ba as Be,C as ga,CF as Zr,CH as _s,Ct as Po,D as je,DF as es,DH as Cs,DJ as Ws,DX as Ct,Dj as or,EF as pt,EO as ll,Ec as ee,F as Qe,FF as ts,FJ as Ks,FP as hl,FY as rc,Fg as za,G as We,GF as ns,GP as _l,GZ as mc,Gg as Xa,H as Ve,HJ as Ys,HL as al,HY as sc,HZ as yn,Hg as ni,I as ua,Ig as Za,Ij as ai,Ip as br,It as Tr,J as w,JH as Fo,JJ as Js,JL as Ro,JT as Vl,Ja as Sa,Jd as La,Jg as er,KE as Wr,KH as ys,KO as vi,KT as Rn,KX as Ri,Ka as Aa,L as qt,LH as bs,LJ as zs,Ld as ne,Lj as ar,Ln as tn,Lp as vr,MH as vs,MT as _t,Mp as Sr,N as ze,NF as Ci,NH as Ss,NJ as Xs,Nc as Kn,Nd as V,Nf as zn,Nn as nn,Nv as To,O as jt,OH as As,Ob as vo,Og as Io,Op as Ar,PJ as Zs,PM as rl,PP as Cl,Pf as ka,Pg as xo,Pn as on,Pp as Ir,Pv as Fr,Q as Qt,QJ as el,Qf as xe,Qg as Mt,Qn as mr,R as Ke,R0 as gc,RG as bi,RM as sl,RY as lc,Rd as lt,Rf as Rt,Rg as ii,SH as Is,SX as yt,SY as cc,Sf as pe,Sg as tr,Si as wo,Sn as pr,Sp as xr,TH as xs,TI as Ms,TV as Ti,Tp as wr,UF as is,UI as ks,UW as Zl,UY as Cn,UZ as bn,Ub as Se,Ud as zt,Ue as Yn,Uf as Xn,Uj as rr,VF as os,Vb as xa,Vf as Xe,W as fa,WJ as tl,WT as Uo,Wf as En,Wg as en,Wj as sr,X as Ye,X0 as uc,XJ as nl,XQ as we,XV as Vo,Xe as Jn,Xf as Ze,Xw as fi,Y as qn,Yf as Zn,Yi as dt,Yw as hi,Z as ha,ZE as Kr,ZJ as il,ZP as xi,ZQ as Ee,ZR as Tl,Zf as Xt,Zw as _i,_ as Co,_F as gt,_P as yl,_T as Bl,_W as ec,_e as Pa,_f as ei,_j as lr,aA as Mr,aK as ol,aS as Fl,aV as Ol,aa as fe,ac as Jt,af as Fa,ag as ti,b1 as fc,bA as kr,bQ as vl,bV as ql,ba as Wt,bb as H,bc as Qn,bg as Na,bp as Lo,c as ve,c1 as hc,cA as Nr,cQ as Sl,cU as kt,cV as jl,ca as Z,cb as Kt,cg as Ua,cy as Rr,d as ca,d1 as ki,dA as Ur,dG as as,dP as cl,dQ as Al,dV as Ql,dZ as $o,da as st,do as an,dp as hr,eG as rs,eP as dl,eQ as Il,eV as Wl,eX as tc,eZ as dc,ec as Wn,ef as wn,eg as Va,eh as nr,eo as gr,fA as Vr,fI as Es,fJ as Ns,fL as pn,fQ as xl,fS as Rl,fV as Kl,fY as Mi,fb as Re,fc as Ft,fp as _r,g1 as _c,gA as Br,gG as ss,gI as Ls,gT as Ml,gU as $l,gV as Yl,gY as Mn,ga as bo,gg as Ba,gj as Eo,h1 as Cc,hA as $r,hG as ls,hJ as Us,hM as Fn,hT as kl,hV as Jl,hc as Ea,hj as ir,i as On,i1 as Ni,iA as Dr,iG as yi,iH as ms,iI as Ps,iP as ml,iT as Nl,ia as _a,ig as $a,ik as cr,io as ur,iw as cn,j as z,j1 as yc,jA as Hr,jJ as Vs,jQ as hn,jU as Dl,jY as ic,ja as Fe,jb as Ia,jc as Ae,jf as ct,jk as dr,jt as Er,k as da,k1 as bc,kA as Gr,kH as ps,kI as Ts,kQ as wi,kU as Hl,kg as Da,kp as li,l as ma,l1 as Ui,lA as Or,lD as Qr,lH as gs,lJ as Bs,lP as Mo,lQ as ht,lX as De,lc as So,mA as qr,mI as Fs,mQ as _n,mf as Ra,mg as Ha,mp as rn,n as pa,nJ as $s,nQ as wl,nU as Li,nY as oc,nb as Yt,ng as Me,o1 as vc,oF as Yr,oI as Rs,oP as gn,oQ as El,oU as Pi,og as Ga,op as sn,pA as jr,pH as us,pJ as Ds,pP as ut,pQ as Ei,pX as Fi,pY as ac,pc as Ie,pf as Ma,pg as Oa,pj as oi,pp as ci,pt as Lr,qP as ft,qQ as Ll,qY as he,qg as qa,qh as q,qp as ln,qt as Pr,qw as ui,rH as Pn,rJ as Hs,rP as pl,rg as ja,sH as mn,sP as gl,sb as Pt,sg as Qa,so as ri,sp as di,t1 as Vi,tG as dn,tJ as Gs,tg as Wa,tp as mt,uP as un,uT as X,ua as Ca,ug as Zt,up as Cr,vG as et,vJ as Os,vP as Si,vT as te,vb as Tt,vc as Ao,vg as Ka,vo as si,vp as yr,wF as Jr,wG as Ln,wP as Ai,wT as N
1o,wW as tt,wa as ya,wg as Ya,xG as cs,xH as fs,xJ as qs,xM as ge,xP as Ii,xW as zl,xX as nc,xa as ba,xg as Ja,xp as mi,y0 as pc,yH as hs,yP as fn,ya as va,yc as $e,yp as pi,zF as zr,zG as ds,zJ as js,zP as ul,za as jn}from"./chunk-DQVPEXLR.js";import{$a as ho,$c as Ge,Ac as Y,Ad as _o,Ba as x,Bc as _,Bd as J,Ca as Zo,Cc as r,Cd as sa,Dc as s,Ec as A,G as B,Gb as $t,Gd as v,H as N,Hd as S,Ia as j,Ic as ae,Id as Je,Ja as Dn,Jc as re,Kc as xn,Lb as na,Ld as de,Ma as ie,Mb as o,Mc as L,Na as Te,O as zo,Qd as rt,R as $,Sd as la,Ta as u,Td as Ot,Ua as f,Uc as I,Ud as be,Va as uo,W as $n,Wa as fo,Wb as h,Wc as l,Za as Bt,_c as qe,a as T,ab as ea,ac as D,ad as Oe,b as U,ba as Xo,bc as Hn,cd as Dt,db as ta,dd as Ht,ed as Gn,f as Ce,fc as Ue,ga as Vt,gc as ce,gd as Q,id as at,jd as c,kb as ot,kd as g,la as Ne,ld as P,m as Bn,md as Gt,p as Wo,pd as oa,qd as aa,rd as ra,s as Ko,sc as me,tc as ia,uc as y,vc as Lt,w as Yo,wc as b,x as ue,y as Jo,yc as oe,yd as W,zc as K}from"./chunk-LL4UPCF5.js";var Yc=(i,m)=>m.key;function Rd(i,m){if(i&1){let e=L();r(0,"span",5),c(1),r(2,"button",6),I("click",function(t){let a=u(e).$implicit,d=l(2);return f(d.removeQueue(t,a))}),c(3," \xD7 "),s()()}if(i&2){let e=m.$implicit;o(),P(" ",e.name," "),o(),me("aria-label","Remove "+e.name)}}function Md(i,m){if(i&1&&(r(0,"div",2),K(1,Rd,4,2,"span",5,Yc),s()),i&2){let e=l();o(),Y(e.selectedQueuesList())}}function kd(i,m){if(i&1&&(r(0,"span",3),c(1),s()),i&2){let e=l();o(),g(e.label())}}function Nd(i,m){if(i&1&&(r(0,"mat-option",4),c(1),s()),i&2){let e=m.$implicit;_("value",e.key),o(),P(" ",e.name," ")}}var Wi=(()=>{class i{constructor(){this.label=Ot("Select Alert Queue"),this.options=Ot([]),this.selectedQueues=Ot({}),this.selectedQueuesChange=la(),this.selectedQueuesList=rt(()=>{let e=this.selectedQueues();return Object.keys(e).map(n=>e[n]).filter(n=>n)}),this.selectedKeys=rt(()=>this.selectedQueuesList().map(e=>e.key))}onSelectionChange(e){let n=this.selectedKeys(),t=this.options(),a=e.filter(C=>!n.includes(C));if(a.length>0){let C=t.find(F=>F.key===a[0]);C&&this.selectedQueuesChange.emit({key:C.key,queue:C})}let d=n.filter(C=>!e.includes(C));d.length>0&&this.selectedQueuesChange.emit({key:d[0],queue:null})}removeQueue(e,n){e.stopPropagation(),this.selectedQueuesChange.emit({key:n.key,queue:null})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=D({type:i,selectors:[["app-queue-multi-select"]],inputs:{label:[1,"label"],options:[1,"options"],selectedQueues:[1,"selectedQueues"]},outputs:{selectedQueuesChange:"selectedQueuesChange"},decls:9,vars:4,consts:[["appearance","outline",1,"queue-multi-select","w-100"],["multiple","",3,"valueChange","value","placeholder"],[1,"chips-container"],[1,"placeholder"],[3,"value"],[1,"queue-chip"],["type","button",1,"chip-remove-btn",3,"click"]],template:function(n,t){n&1&&(r(0,"mat-form-field",0)(1,"mat-label"),c(2),s(),r(3,"mat-select",1),I("valueChange",function(d){return t.onSelectionChange(d)}),r(4,"mat-select-trigger"),y(5,Md,3,0,"div",2)(6,kd,2,1,"span",3),s(),K(7,Nd,2,2,"mat-option",4,Yc),s()()),n&2&&(o(2),g(t.label()),o(),_("value",t.selectedKeys())("placeholder",t.label()),o(2),b(t.selectedQueuesList().length>0?5:6),o(2),Y(t.options()))},dependencies:[qn,ki,hc,fc,Ui,yc,bc,Cc,Ni],styles:["[_nghost-%COMP%]{display:block}.queue-multi-select[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper{background-color:var(--lightest)}.queue-multi-select[_ngcontent-%COMP%] .mat-mdc-form-field-focus-overlay{background-color:transparent}.chips-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;padding:.25rem 0}.queue-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.375rem .75rem;background-color:var(--light);color:var(--dark);border:1px solid var(--medium);border-radius:1rem;font-size:.875rem;line-height:1.2}.queue-chip[_ngcontent-%COMP%] .chip-remove-btn[_ngcontent-%COMP%]{border:none;background:none;padding:0;margin-left:.25rem;font-size:1.25rem;line-height:1;cursor:pointer;color:var(--dark);transition:color .2s}.queue-chip[_ngcontent-%COMP%] .chip-remove-btn[_ngcontent-%COMP%]:hover{color:var(--danger)}.placeholder[_ngcontent-%COMP%]{color:var(--medium)}"],changeDetection:0})}}return i})();var Zc=Ce(Re());var Ki=(()=>{class i{constructor(e,n){this.mfaPrincipalAuthService=e,this.errorNotificationService=n,this.federatedLoginEnabled=!1,this.federatedInformationNotSetErrorMessage="MFA is enabled but the federation information is not set up, please contact help center to complete the setup.",this.siteHeaderConfiguration=new Mo,this.sessionTimeoutModalConfiguration=new Do}loadConfigSettingsAndI18nMessages(e,n,t,a,d){let C=new V(t,n,"i18n");new V(t,e,"config").setProperties(this,[["boolean","federatedLoginEnabled","agentLogin.federatedLogin.enabled"]]),C.setProperties(this,[["string","federatedInformationNotSetErrorMessage","agentLogin.federatedLogin.federationInformationNotSet.errorMessage"]]),this.siteHeaderConfiguration=new Mo,this.siteHeaderConfiguration.loadSiteHeaderConfiguration(e,n,null,"dashboard.siteHeader",t,a,d),this.sessionTimeoutModalConfiguration=new Do,this.sessionTimeoutModalConfiguration.loadConfigSettingsAndI18nMessages(e,n,"agent",t),this.federatedLoginEnabled&&!this.mfaPrincipalAuthService.amplifyConfigured&&this.errorNotificationService.n
1otify(this.federatedInformationNotSetErrorMessage)}static{this.\u0275fac=function(n){return new(n||i)(ie(xa),ie(Kt))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var Ho=Ce(Re());var Jc=Ce(Re());var Yi=(()=>{class i{constructor(e){this.configHelper=e,this.creditLabel="Credit",this.agencyLabel="Agency",this.companyLabel="Company",this.reservationLabel="Reservations",this.dashboardLabel="Dashboard",this.bookFlightLabel="Book a flight",this.searchReservationsLabel="Search Reservations",this.transferFundsLabel="Transfer funds",this.makeDepositLabel="Make a deposit",this.flightLabel="Flight",this.alertsLabel="Alerts",this.flightWatchLabel="Flight Watch",this.flightStatusLabel="Flight Status",this.flightInfoLabel="Flight Info",this.reportLabel="Report",this.companyPaymentsLabel="Company Payments",this.companyTransactionsLabel="Company Transactions",this.agencyPaymentsLabel="Agency Payments",this.agencyPassengerSegmentsLabel="Agency Passenger Segments",this.dmToolReportLabel="Disruption Management Report",this.logoutLabel="Logout",this.userActionsLabel="User actions",this.changePasswordLabel="Change Password",this.welcomeLabel="Welcome",this.managementLabel="Management",this.agentSignUpManagementLabel="Agent Sign Up Management",this.freeCancellationLimitLabel="Free Cancellation",this.freeCancellationLimitUsed="Used",this.freeCancellationLimitResetOn="Reset on",this.dateNgDateFormat="HH:mm MMM d, y",this.changePasswordEnabled=!0,this.creditAmountEnabled=!0,this.freeCancellationLimitEnabled=!0,this.companyPricingDateRangeEnabled=!0,this.reservationEnabled=!1,this.bookFlightEnabled=!0,this.searchReservationsEnabled=!0,this.transferFundsEnabled=!0,this.makeDepositEnabled=!0,this.flightEnabled=!1,this.alertsEnabled=!0,this.flightWatchEnabled=!0,this.flightStatusEnabled=!0,this.flightInfoEnabled=!0,this.reportEnabled=!1,this.companyPaymentsEnabled=!0,this.agencyPaymentsEnabled=!0,this.agencyPassengerSegmentsEnabled=!0,this.companyTransactionsEnabled=!0,this.dmToolReportEnabled=!1,this.agentSignUpManagementEnabledByPermission=!1,this.agentSignUpManagementEnabledByConfig=!1,this.agentAdministrationLabel="Agent Administration",this.agentManageAgencyEnabled=!1,this.agentManageAgencyLabel="Manage Agency",this.agentSubAgenciesEnabled=!1,this.agentSubAgenciesLabel="Sub Agencies",this.agentManageSubAgencyEnabled=!1,this.agentManageSubAgencyLabel="Manage Sub Agency",this.currencyCode="USD",this.currencyISOCode="USD",this.currencySymbolDisplay="symbol-narrow",this.agencyCompanyItemConfiguration=new Dc(this.configHelper)}loadConfigSettingsAndI18nMessages(e,n,t,a){let d="agent.leftSideBar",C=new V(a,e,"config"),F=new V(a,n,"i18n");this.currencyCode=(0,Jc.isObject)(t)?t.code:e["defaultCurrency.code"],this.currencyISOCode=this.configHelper.getCurrencyISOCode_new(C,this.currencyCode),C.setProperties(this,[["boolean","agentSignUpManagementEnabledByPermission",`${d}.agentSignUpManagementPermission.enabled`],["boolean","agentSignUpManagementEnabledByConfig",`${d}.agentSignUpManagementConfig.enabled`],["string","currencySymbolDisplay","defaultCurrency.symbolDisplay"],["boolean","changePasswordEnabled","agent.changePassword.enabled"],["boolean","creditAmountEnabled",`${d}.credit.enabled`],["boolean","companyPricingDateRangeEnabled",`${d}.companyPricingDateRange.enabled`],["boolean","reservationEnabled",`${d}.reservation.enabled`],["boolean","bookFlightEnabled",`${d}.bookFlight.enabled`],["boolean","searchReservationsEnabled",`${d}.searchReservations.enabled`],["boolean","transferFundsEnabled",`${d}.transferFunds.enabled`],["boolean","makeDepositEnabled",`${d}.makeDeposit.enabled`],["boolean","flightEnabled",`${d}.flight.enabled`],["boolean","alertsEnabled",`${d}.alerts.enabled`],["boolean","flightWatchEnabled",`${d}.flightWatch.enabled`],["boolean","flightStatusEnabled",`${d}.flightStatus.enabled`],["boolean","flightInfoEnabled",`${d}.flightInfo.enabled`],["boolean","reportEnabled",`${d}.report.enabled`],["boolean","companyPaymentsEnabled",`${d}.companyPayments.enabled`],["boolean","companyTransactionsEnabled",`${d}.companyTransactions.enabled`],["boolean","agencyPaymentsEnabled",`${d}.agencyPayments.enabled`],["boolean","agencyPassengerSegmentsEnabled",`${d}.agencyPassengerSegments.enabled`],["boolean","dmToolReportEnabled",`${d}.dmToolReport.enabled`],["boolean","agentManageAgencyEnabled",`${d}.agentManageAgency.enabled`],["boolean","agentSubAgenciesEnabled",`${d}.agentSubAgencies.enabled`],["boolean","agentManageSubAgencyEnabled",`${d}.agentManageSubAgency.enabled`],["boolean","freeCancellationLimitEnabled","agent.freeCancellationLimit.enabled"],["string","dateNgDateFormat",`${d}.date.ngDateFormat`]]),F.setProperties(this,[["string","creditLabel","agent.selectionModal.credit.label"],["string","agencyLabel",`${d}.agency.label`],["string","companyLabel",`${d}.company.label`],["string","dashboardLabel",`${d}.dashboard.label`],["string","reservationLabel",`${d}.reservation.label`],["string","bookFlightLabel",`${d}.bookFlight.label`],["string","searchReservationsLabel",`${d}.searchReservations.label`],["string","transferFundsLabel",`${d}.transferFunds.label`],["string","makeDepositLabel",`${d}.makeDeposit.label`],["string","flightLabel",`${d}.flight.label`],["string","alertsLabel",`${d}.alerts.label`],["string","flightWatchLabel",`${d}.flightWatch.label`],["string","flightStatusLabel",`${d}.flightStatus.label`],["string","flightInfoLabel",`${d}.flightInfo.label`],["string","reportLabel",`${d}.report.label`],["string","companyPaymentsLabel",`${d}.companyPayments.label`],["string","companyTransactionsLabel",`${d}.companyTransactions.label`],["string","agencyPaymentsLabel",`${d}.agencyPayments.label`],["string","agencyPassengerSegmentsLabel",`${d}.agencyPassengerSegments.label`],["string","dmToolReportLabel",`${d}.dmToolReport.label`],["string","logoutLabel",`${d}.logout.label`],["string","changePasswordLabel",`${d}.changePassword.label`],["string","welcomeLabel",`${d}.welcome.label`],["string","userActionsLabel",`${d}.userActions.label`],["string","managementLabel",`${d}.management.label`],["string","agentSignUpManagementLabel",`${d}.agentSignUpManagement.label`],["string","agentManageAgencyLabel",`${d}.agentManageAgency.label`],["string","agentAdministrationLabel",`${d}.agentAdministration.label`],["string","agentSubAgenciesLabel",`${d}.agentSubAgencies.label`],["string","agentManageSubAgencyLabel",`${d}.agentManageSubAgency.label`],["string","freeCancellationLimitLabel",`${d}.freeCancellationLimit.label`],["string","freeCancellationLimitUsed",`${d}.freeCancellationLimitUsed.label`],["string","freeCancellationLimitResetOn",`${d}.freeCancellationLimitResetOn.label`]]),this.agencyCompanyItemConfiguration.loadConfigAndI18n("",C,F,t),this.loadAgencyCompanyItemConfiguration()}loadAgencyCompanyItemConfiguration(){this.agencyCompanyItemConfiguration.companyLabel=this.companyLabel,this.agencyCompanyItemConfiguration.creditLabel=this.creditLabel,this.agencyCompanyItemConfiguration.currencyISOCode=this.currencyISOCode,this.agencyCompanyItemConfiguration.currencySymbolDisplay=this.currencySymbolDisplay,this.agencyCompanyItemConfiguration.creditAmountEnabled=this.creditAmountEnabled,this.agencyCompanyItemConfiguration.companyPricingDateRangeEnabled=this.companyPricingDateRangeEnabled}static{this.\u0275fac=function(n){return new(n||i)(ie(ne))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var Pe=i=>[i];function Dd(i,m){if(i&1&&(r(0,"div",18)(1,"div",21)(2,"div"),c(3),s(),r(4,"div")(5,"span"),c(6),s(),r(7,"span",22),c(8),s()()(),r(9,"div",21)(10,"div"),c(11),s(),r(12,"div",22),c(13),v(14,"date"),s()()()),i&2){let e=l(),n=l();o(3),g(n.configuration.freeCancellationLimitLabel),o(3),P("",n.configuration.freeCancellationLimitUsed," "),o(2),Gt("",e.agency.freeCancellationLimit.used,"/",e.agency.freeCancellationLimit.limit),o(3),g(n.configuration.freeCancellationLimitResetOn),o(2),P(" ",Je(14,6,e.agency.freeCancellationLimit.resetTime,n.configuration.dateNgDateFormat)," ")}}function Hd(i,m){if(i&1){let e=L();r(0,"div",3)(1,"div",7)(2,"div",15)(3,"span",16),c(4),s(),r(5,"div",17),c(6),s(),y(7,Dd,15,9,"div",18),s(),r(8,"div",19)(9,"app-agency-company-item",20),v(10,"async"),I("selectCompany",function(){u(e);let t=l();return f(t.selectCompany())}),s()()()()}if(i&2){let e=m,n=l();o(4),g(n.configuration.agencyLabel),o(2),P(" ",e.agency.name," "),o(),b(n.configuration.freeCancellationLimitEnabled&&e.agency.freeCancellationLimit?7:-1),o(2),_("company",S(10,6,n.selectedCompany$))("configuration",n.configuration.agencyCompanyItemConfiguration)("canChangeCompany",n.canChangeCompany())}}function Gd(i,m){if(i&1){let e=L();r(0,"li",26)(1,"a",28),I("click",function(){u(e);let t=l(2);return f(t.bookNewFlight())}),c(2),s()()}if(i&2){let e=l(2);o(2),g(e.configuration.bookFlightLabel)}}
1function Od(i,m){if(i&1&&(r(0,"li",27)(1,"a",29),c(2),s()()),i&2){let e=l(2);o(),_("routerLink",J(2,Pe,e.AGENT_RESERVATIONS_SEARCH)),o(),g(e.configuration.searchReservationsLabel)}}function qd(i,m){if(i&1){let e=L();r(0,"div",8)(1,"span"),c(2),s(),r(3,"ul",23),I("click",function(){u(e);let t=l();return f(t.onCloseSidebarMenu())}),r(4,"li",24)(5,"a",25),I("click",function(){u(e);let t=l();return f(t.cleanBookingRelatedData())}),c(6),s()(),y(7,Gd,3,1,"li",26),y(8,Od,3,4,"li",27),s()()}if(i&2){let e=l();o(2),g(e.configuration.reservationLabel),o(3),_("routerLink",J(5,Pe,e.AGENT_DASHBOARD)),o(),g(e.configuration.dashboardLabel),o(),b(e.configuration.bookFlightEnabled?7:-1),o(),b(e.configuration.searchReservationsEnabled?8:-1)}}function jd(i,m){if(i&1&&(r(0,"li",30)(1,"a",29),c(2),s()()),i&2){let e=l(3);o(),_("routerLink",J(2,Pe,e.AGENT_TRANSFER_FUNDS_URL)),o(),g(e.configuration.transferFundsLabel)}}function Qd(i,m){if(i&1&&(r(0,"li",31)(1,"a",29),c(2),s()()),i&2){let e=l(3);o(),_("routerLink",J(2,Pe,e.AGENT_DEPOSIT_FUND_URL)),o(),g(e.configuration.makeDepositLabel)}}function Wd(i,m){if(i&1){let e=L();r(0,"div",19)(1,"span"),c(2),s(),r(3,"ul",23),I("click",function(){u(e);let t=l(2);return f(t.onCloseSidebarMenu())}),y(4,jd,3,4,"li",30),y(5,Qd,3,4,"li",31),s()()}if(i&2){let e=l(2);o(2),g(e.configuration.companyLabel),o(2),b(e.configuration.transferFundsEnabled?4:-1),o(),b(e.configuration.makeDepositEnabled?5:-1)}}function Kd(i,m){if(i&1&&(ae(0),y(1,Wd,6,3,"div",19),re()),i&2){let e=l();o(),b(e.configuration.transferFundsEnabled||e.configuration.makeDepositEnabled?1:-1)}}function Yd(i,m){if(i&1&&(r(0,"li",33)(1,"a",29),c(2),s()()),i&2){let e=l(2);o(),_("routerLink",J(2,Pe,e.AGENT_FLIGHT_ALERTS_URL)),o(),g(e.configuration.alertsLabel)}}function Jd(i,m){if(i&1&&(r(0,"li",34)(1,"a",37),c(2),s()()),i&2){let e=l(2);o(2),g(e.configuration.flightWatchLabel)}}function zd(i,m){if(i&1&&(r(0,"li",35)(1,"a",29),c(2),s()()),i&2){let e=l(2);o(),_("routerLink",J(2,Pe,e.AGENT_FLIGHT_STATUS_URL)),o(),g(e.configuration.flightStatusLabel)}}function Xd(i,m){if(i&1&&(r(0,"li",36)(1,"a",37),c(2),s()()),i&2){let e=l(2);o(2),g(e.configuration.flightInfoLabel)}}function Zd(i,m){if(i&1){let e=L();r(0,"div",9)(1,"div",32),A(2,"hr"),r(3,"span"),c(4),s(),r(5,"ul",23),I("click",function(){u(e);let t=l();return f(t.onCloseSidebarMenu())}),y(6,Yd,3,4,"li",33),y(7,Jd,3,1,"li",34),y(8,zd,3,4,"li",35),y(9,Xd,3,1,"li",36),s()()()}if(i&2){let e=l();o(4),g(e.configuration.flightLabel),o(2),b(e.configuration.alertsEnabled?6:-1),o(),b(e.configuration.flightWatchEnabled?7:-1),o(),b(e.configuration.flightStatusEnabled?8:-1),o(),b(e.configuration.flightInfoEnabled?9:-1)}}function em(i,m){if(i&1&&(r(0,"li",41)(1,"a",29),c(2),s()()),i&2){let e=l(3);o(),_("routerLink",J(2,Pe,e.AGENT_COMPANY_PAYMENT_URL)),o(),g(e.configuration.companyPaymentsLabel)}}function tm(i,m){if(i&1&&(r(0,"li",42)(1,"a",29),c(2),s()()),i&2){let e=l(3);o(),_("routerLink",J(2,Pe,e.AGENT_COMPANY_TRANSACTION_URL)),o(),g(e.configuration.companyTransactionsLabel)}}function nm(i,m){if(i&1&&(ae(0),y(1,em,3,4,"li",41),y(2,tm,3,4,"li",42),re()),i&2){let e=l(2);o(),b(e.configuration.companyPaymentsEnabled?1:-1),o(),b(e.configuration.companyTransactionsEnabled?2:-1)}}function im(i,m){if(i&1&&(r(0,"li",38)(1,"a",29),c(2),s()()),i&2){let e=l(2);o(),_("routerLink",J(2,Pe,e.AGENCY_PAYMENT_REPORT_URL)),o(),g(e.configuration.agencyPaymentsLabel)}}function om(i,m){if(i&1&&(r(0,"li",39)(1,"a",29),c(2),s()()),i&2){let e=l(2);o(),_("routerLink",J(2,Pe,e.AGENCY_PASSENGER_SEGMENTS_URL)),o(),g(e.configuration.agencyPassengerSegmentsLabel)}}function am(i,m){if(i&1&&(r(0,"li",40)(1,"a",29),c(2),s()()),i&2){let e=l(2);o(),_("routerLink",J(2,Pe,e.AGENT_DM_TOOL_REPORT_URL)),o(),g(e.configuration.dmToolReportLabel)}}function rm(i,m){if(i&1){let e=L();r(0,"div",10)(1,"div",32),A(2,"hr"),r(3,"span"),c(4),s(),r(5,"ul",23),I("click",function(){u(e);let t=l();return f(t.onCloseSidebarMenu())}),y(6,nm,3,2,"ng-container"),v(7,"async"),y(8,im,3,4,"li",38),y(9,om,3,4,"li",39),y(10,am,3,4,"li",40),s()()()}if(i&2){let e=l();o(4),g(e.configuration.reportLabel),o(2),b(S(7,5,e.selectedCompany$)?6:-1),o(2),b(e.configuration.agencyPaymentsEnabled?8:-1),o(),b(e.configuration.agencyPassengerSegmentsEnabled?9:-1),o(),b(e.configuration.dmToolReportEnabled?10:-1)}}function sm(i,m){if(i&1){let e=L();r(0,"div",11)(1,"div",32),A(2,"hr"),r(3,"span"),c(4),s(),r(5,"ul",23),I("click",function(){u(e);let t=l();return f(t.onCloseSidebarMenu())}
1),r(6,"li",43)(7,"a",29),c(8),s()()()()()}if(i&2){let e=l();o(4),g(e.configuration.managementLabel),o(3),_("routerLink",J(3,Pe,e.AGENT_SIGN_UP_MANAGEMENT)),o(),g(e.configuration.agentSignUpManagementLabel)}}function lm(i,m){if(i&1&&(r(0,"li",60)(1,"a",29),c(2),s()()),i&2){let e=l(3);o(),_("routerLink",J(2,Pe,e.AGENT_MANAGE_AGENCY)),o(),g(e.configuration.agentManageAgencyLabel)}}function cm(i,m){if(i&1&&(r(0,"li",61)(1,"a",29),c(2),s()()),i&2){let e=l(3);o(),_("routerLink",J(2,Pe,e.AGENT_SUB_AGENCIES)),o(),g(e.configuration.agentSubAgenciesLabel)}}function dm(i,m){if(i&1){let e=L();r(0,"div",45)(1,"div",58)(2,"div",59)(3,"span"),c(4),s(),r(5,"ul",23),I("click",function(){u(e);let t=l(2);return f(t.onCloseSidebarMenu())}),y(6,lm,3,4,"li",60),y(7,cm,3,4,"li",61),s()()()()}if(i&2){let e=l(2);o(4),g(e.configuration.agentAdministrationLabel),o(2),b(e.configuration.agentManageAgencyEnabled?6:-1),o(),b(e.configuration.agentSubAgenciesEnabled?7:-1)}}function mm(i,m){i&1&&xn(0)}function pm(i,m){if(i&1&&(r(0,"div",14)(1,"div",44)(2,"div",32),y(3,dm,8,3,"div",45),s()(),r(4,"div",7)(5,"div",32)(6,"div",21)(7,"div",46)(8,"div",47),A(9,"i",48),s(),r(10,"div",49)(11,"span",50),c(12),s(),r(13,"div",51),c(14),s()()(),r(15,"div",52)(16,"div",53)(17,"button",54),A(18,"i",55),s(),r(19,"div",56),ce(20,mm,1,0,"ng-container",57),s()()()()()()()),i&2){let e=l(),n=Gn(20);o(3),b(e.configuration.agentManageAgencyEnabled||e.configuration.agentSubAgenciesEnabled?3:-1),o(9),g(e.configuration.welcomeLabel),o(2),g(m.name),o(3),me("aria-label",e.configuration.agencyLabel),o(3),_("ngTemplateOutlet",n)}}function gm(i,m){if(i&1){let e=L();A(0,"div",63),r(1,"a",64),I("click",function(){u(e);let t=l(2);return f(t.changePassword())}),c(2),s()}if(i&2){let e=l(2);o(2),g(e.configuration.changePasswordLabel)}}function um(i,m){if(i&1){let e=L();r(0,"div",62)(1,"small")(2,"b"),c(3),s()()(),ae(4),y(5,gm,3,1),A(6,"div",63),r(7,"a",64),I("click",function(){u(e);let t=l();return f(t.logout())}),c(8),s(),re()}if(i&2){let e=l();o(3),g(e.configuration.userActionsLabel),o(2),b(e.configuration.changePasswordEnabled?5:-1),o(3),g(e.configuration.logoutLabel)}}var Xc=(()=>{class i{constructor(e,n,t,a,d,C,F,p,E){this.configuration=e,this.store=n,this.router=t,this.log=a,this.gtmHelper=d,this._jwtAuthenticationService=C,this.navigationUrlHelper=F,this.userSessionService=p,this.ssoClientService=E,this.isSidebarMenuOpened=Ot(!1),this.closeSidebarMenu=new ho,this.onLogoutTriggered=new ho,this.fetchDataLoading$=ue([!1]),this.AGENT_BOOKING_URL=`/${pe}`,this.AGENT_RESERVATIONS_SEARCH=`/${Xt}`,this.AGENT_FLIGHT_ALERTS_URL=`/${xe}/${ei}`,this.AGENT_FLIGHT_STATUS_URL=`/${xe}/${ti}`,this.AGENT_DASHBOARD=`/${Me}`,this.AGENT_COMPANY_PAYMENT_URL=`/${Va}`,this.AGENT_COMPANY_TRANSACTION_URL=`/${Ba}`,this.AGENT_DEPOSIT_FUND_URL=`/${ni}`,this.AGENCY_PAYMENT_REPORT_URL=`/${$a}`,this.AGENT_TRANSFER_FUNDS_URL=`/${Za}`,this.AGENCY_PASSENGER_SEGMENTS_URL=`/${Da}`,this.AGENT_DM_TOOL_REPORT_URL=`/${Ha}`,this.AGENT_SIGN_UP_MANAGEMENT=`/${qa}`,this.AGENT_MANAGE_AGENCY=`/${Qa}`,this.AGENT_SUB_AGENCIES=`/${Zt}`,this.currency=null,this.alive=!0,this.gtmHelper.disable()}ngOnInit(){this.activeLanguage$=this.store.select(bi),this.selectedCompany$=this.store.select(ut),this.agentUserInfo$=this.store.select(Si),this.configSettingsAndI18nMessages$=N([this.store.select(te),this.store.select(X)]),N([this.configSettingsAndI18nMessages$,this.store.select(fl)]).pipe(x(()=>this.alive),$(([[e,n],t])=>(0,Ho.isObject)(e)&&(0,Ho.isObject)(n))).subscribe(e=>{let[[n,t],a]=e;this.configuration.loadConfigSettingsAndI18nMessages(n,t,a,this.log)})}selectCompany(){this.store.dispatch(new mr)}canChangeCompany(){let e=this.navigationUrlHelper.isAgentBookingRoute()&&!this.navigationUrlHelper.isAgentBookingFlightSearchRoute(),n=this.navigationUrlHelper.isMmbRoutes();return!e&&!n}changePassword(){this.onCloseSidebarMenu(),this.router.navigate([`/${xe}/${Zn}`])}logout(){this.alive=!1,this.onLogoutTriggered.emit(),this.store.dispatch(new an),this._jwtAuthenticationService.logout().pipe(Ne()).subscribe(()=>{this.userSessionService.isUserLoginWithSso()?(this.userSessionService.clearSsoSession(),this.ssoClientService.logout().subscribe()):this.router.navigate([`/${en}`])})}bookNewFlight(){this.router.url.includes(`${Rt}/${Xe}`)||(this.cleanBookingRelatedData(),this.router.navigate([this.AGENT_BOOKING_URL]))}cleanBookingRelatedData(){this.onCloseSidebarMenu(),this.store.dispatch(new Yr([new dr,new Er(!1)],0))}onCloseSidebarMenu(){this.closeSidebarMenu.emit()}ngOnDestroy(){this.alive=!1}static{this.\u0275fac=function(n){return new(n||i)(h(Yi),h(q),h(Z),h(H),h(lt),h(Jt),h(Ti),h(Qn),h(Mi))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-left-sidebar"]],inputs:{isSidebarMenuOpened:[1,"isSidebarMenuOpened"]},outputs:{closeSidebarMenu:"closeSidebarMenu",onLogoutTriggered:"onLogoutTriggered"},standalone:!1,features:[W([Yi])],decls:21,vars:15,consts:[["userActionTemplate",""],["data-bs-scroll","false","id","offcanvasScrolling",1,"offcanvas-lg","sider-container","position-fixed","d-flex","flex-column","w-100","offcanvas-start","bg-light","top-spacing","px-2"],[1,"offcanvas-header","d-flex","p-0"],[1,"d-flex","flex-column","flex-grow-1"],[1,"offcanvas-body","my-3","p-0","flex-grow-1"],[1,"w-100","h-100","position-relative","overflow-hidden"],[1,"h-100","position-relative","ngi-scrollbar"],[1,"row"],[1,"col-12","reservation","mb-4"],[1,"row","flight"],[1,"row","report"],[1,"row","agency-management"],[1,"offcanvas-footer"],[1,"d-flex","flex-column","position-relative","d-print-none","w-100"],[1,"account-info","mt-auto","mb-3"],[1,"col-12","agent","lh-12"],[1,"fs-12"],[1,"fs-16","fw-bold","agency-name","text-primary"],[1,"agencyFreePenaltyLimit","fs-14","lh-base","mt-2"],[1,"col-12","company"],[3,"selectCompany","company","configuration","canChangeCompany"],[1,"d-flex","justify-content-between"],[1,"text-info"],[1,"nav","flex-column",3,"click"],[1,"nav-item","nav-item-dashboard","fs-16"],[1,"pointer","text-secondary","fw-bold",3,"click","routerLink"],[1,"nav-item","nav-item-book-flight","fs-16"],[1,"nav-item","nav-item-search-reservations","fs-16"],[1,"pointer","text-secondary","fw-bold",3,"click"],[1,"pointer","text-secondary","fw-bold",3,"routerLink"],[1,"nav-item","nav-item-transfer-funds","fs-16"],[1,"nav-item","nav-item-make-deposit","fs-16"],[1,"col-12"],[1,"nav-item","nav-item-alerts","fs-16"],[1,"nav-item","nav-item-flight-watch","f
1s-16"],[1,"nav-item","nav-item-flight-status","fs-16"],[1,"nav-item","nav-item-flight-info","fs-16"],["href","",1,"pointer","text-secondary","fw-bold"],[1,"nav-item","nav-item-agency-payments","fs-16"],[1,"nav-item","nav-item-agency-passenger-segments","fs-16"],[1,"nav-item","nav-item-dm-tool-report","fs-16"],[1,"nav-item","nav-item-company-payments","fs-16"],[1,"nav-item","nav-item-company-transactions","fs-16"],[1,"nav-item","nav-item-agent-signup-management","fs-16"],[1,"row","mb-4"],[1,"card","mt-3"],[1,"d-flex"],[1,"align-self-center","fs-24","me-3"],[1,"iasi","ic-hide","ic-user-circle-af","text-primary"],[1,"align-self-center","lh-12"],[1,"fs-14","text-muted"],[1,"fw-bold"],[1,"align-self-center"],["ngbDropdown","",1,"me-2","d-sm-block"],["ngbDropdownToggle","",1,"btn","fs-18","pointer","border-0","p-0"],[1,"iasi","ic-hide","ic-cog-af"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1",1,"agent-action-dropdown","dropdown-menu-left"],[4,"ngTemplateOutlet"],[1,"card-body","py-1","px-2"],[1,"agent-administration"],[1,"nav-item","nav-item-agent-manage-agency","fs-16"],[1,"nav-item","nav-item-agent-sub-agencies","fs-16"],[1,"text-medium","px-4"],[1,"dropdown-divider"],["ngbDropdownItem","",1,"pointer","text-dark",3,"click"]],template:function(n,t){if(n&1&&(r(0,"div",1)(1,"div",2),y(2,Hd,11,8,"div",3),v(3,"async"),s(),ae(4),r(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7),y(9,qd,9,7,"div",8),y(10,Kd,2,1,"ng-container"),v(11,"async"),s(),y(12,Zd,10,5,"div",9),y(13,rm,11,7,"div",10),y(14,sm,9,5,"div",11),s()()(),re(),r(15,"div",12)(16,"div",13),y(17,pm,21,5,"div",14),v(18,"async"),s()()(),ce(19,um,9,3,"ng-template",null,0,de)),n&2){let a,d;Q("show",t.isSidebarMenuOpened()),o(2),b((a=S(3,9,t.agentUserInfo$))?2:-1,a),o(7),b(t.configuration.reservationEnabled?9:-1),o(),b(S(11,11,t.selectedCompany$)?10:-1),o(2),b(t.configuration.flightEnabled&&(t.configuration.alertsEnabled||t.configuration.flightWatchEnabled||t.configuration.flightStatusEnabled||t.configuration.flightInfoEnabled)?12:-1),o(),b(t.configuration.reportEnabled&&(t.configuration.companyPaymentsEnabled||t.configuration.companyTransactionsEnabled||t.configuration.agencyPaymentsEnabled||t.configuration.agencyPassengerSegmentsEnabled)?13:-1),o(),b(t.configuration.agentSignUpManagementEnabledByPermission&&t.configuration.agentSignUpManagementEnabledByConfig?14:-1),o(3),b((d=S(18,13,t.agentUserInfo$))?17:-1,d)}},dependencies:[On,st,va,ba,ya,Ca,Hc,z,zt],styles:[".sider-container[_ngcontent-%COMP%]{padding-top:3vh!important;bottom:0;z-index:1031}.sider-container.top-spacing[_ngcontent-%COMP%]{top:calc(1.625rem + var(--logo-height))!important}@media screen and (min-width:992px){.sider-container[_ngcontent-%COMP%]{max-width:240px!important}.sider-container[_ngcontent-%COMP%] .offcanvas-body[_ngcontent-%COMP%]{overflow-y:hidden!important}}@media(min-width:576px)and (max-width:992px){.sider-container[_ngcontent-%COMP%]{max-width:var(--agent-left-sidebar-mobile-max-width)!important}}.dropdown-toggle[_ngcontent-%COMP%]:after{content:initial}.ngi-scrollbar[_ngcontent-%COMP%]{overflow-x:hidden}"]})}}return i})();function hm(i,m){i&1&&(r(0,"nav",2)(1,"span",3),c(2,"Loading..."),s()(),r(3,"div",4)(4,"div",5)(5,"div",6),A(6,"app-ias-loading-placeholder"),s()()())}function _m(i,m){if(i&1&&(A(0,"app-agency-mobile-breadcrumb",9),v(1,"async")),i&2){let e=l(2);_("breadcrumbs",S(1,1,e.breadcrumbs$))}}function Cm(i,m){if(i&1&&(A(0,"app-site-header-flight-summary-mobile",10),v(1,"async")),i&2){let e=l(2);_("searchSummary",S(1,2,e.searchSummary$))("configuration",e.configuration.siteHeaderConfiguration)}}function ym(i,m){if(i&1){let e=L();r(0,"main",1)(1,"div",7)(2,"div")(3,"app-site-header",8),v(4,"async"),v(5,"async"),v(6,"async"),I("onToggleSidebarMenu",function(t){u(e);let a=l();return f(a.toggleSidebarMenu(t))})("onChange",function(t){u(e);let a=l();return f(a.uiLanguageChanged(t))}),s(),y(7,_m,2,3,"app-agency-mobile-breadcrumb",9)(8,Cm,2,4,"app-site-header-flight-summary-mobile",10),s()(),r(9,"div",11)(10,"nav",12)(11,"app-agent-left-sidebar",13),I("closeSidebarMenu",function(){u(e);let t=l();return f(t.closeSidebarMenu())})("onLogoutTriggered",function(){u(e);let t=l();return f(t.onLogoutTriggered())}),s()(),r(12,"div",14),A(13,"router-outlet"),s()()()}if(i&2){let e=l();o(3),_("isSidebarMenuOpened",e.isSidebarMenuOpened)("configuration",e.configuration.siteHeaderConfiguration)("activeLanguage",S(4,9,e.activeLanguage$))("isAgentSite",!0)("breadcrumbs",S(5,11,e.breadcrumbs$))("isBookingModule",e.isBookingModule)("searchSummary",S(6,13,e.searchSummary$)),o(4),b(e.isBookingModule?8:7),o(4),_("isSidebarMenuOpened",e.isSidebarMenuOpened)}}var ed=(()=>{class i{constructor(e,n,t,a,d,C,F,p,E,R,k,M,xt,In){this.configuration=e,this.store=n,this.log=t,this.gtmHelper=a,this.breadcrumbHelper=d,this.router=C,this.activatedRoute=F,this.modalService=p,this._jwtAuthenticationService=E,this.sessionTimeoutService=R,this.zone=k,this.userSessionService=M,this.ssoClientService=xt,this.agentSessionInactivityService=In,this.activeLanguage$=this.store.select(bi),this.initialDataLoading$=N([this.store.select(we),this.store.select(Ee),this.store.select(yi),this.store.select(Cl)]).pipe(B(le=>!le.every(Et=>!Et))),this.dataLoading$=N([this.store.select(ft)]).pipe(B(le=>!le.every(Et=>!Et))),this.showSpinner$=N([this.initialDataLoading$,this.dataLoading$]).pipe(B(le=>!le.every(Et=>!Et))),this.configSettingsAndI18nMessages$=N([this.store.select(te),this.store.select(X)]),this.isSidebarMenuOpened=!1,this.isBookingModule=!1,this.isLoggingOutSignal=ta(!1),this.configPrefix=xe,this.alive=!0,this.sessionTimeoutInitialized=!1,this.remainingMinutes$=new Bn(3),this.BOOKING_URL=Rt,this.AGENT_BOOKING_URL=pe,this.gtmHelper.disable(),this.store.dispatch(new Kr(!1)),this.breadcrumbs$=this.buildBreadCrumb();let wt=this.activatedRoute.firstChild.routeConfig.path;this.isBookingModule=this.isOnBookingFlow(wt),this.router.events.pipe(x(()=>this.alive),$(le=>le instanceof Co||le instanceof yo)).subscribe(le=>{le instanceof Co&&this.cleanUpProgressBar(le.url),le instanceof yo&&(this.breadcrumbs$=this.buildBreadCrumb(),wt=this.activatedRoute.firstChild.routeConfig.path,this.isBookingModule=this.isOnBookingFlow(wt),(le.url.includes(ii)||le.url.includes(Mt)||le.url.includes("/checkout")||le.url.includes("/checkout-success"))&&this.store.dispatch(new gr))})}buildBreadCrumb(){return this.loadI18nMessages().pipe(B(e=>this.breadcrumbHelper.buildBreadCrumbHelper(this.activatedRoute.root,void 0,void 0,new V(this.log,e,"i18n"))))}ngOnInit(){N([this.configSettingsAndI18nMessages$.pipe(x(()=>this.alive),$(e=>e[0]!==null&&e[1]!==null)),this.store.select(ls)]).pipe(x(()=>this.alive)).subscribe(e=>{let[[n,t],a]=e;n!==null&&t!==null&&this.configuration.loadConfigSettingsAndI18nMessages(n,t,this.log,a,this.configPrefix),this.sessionTimeoutInitialized||(this.sessionTimeoutInitialized=!0,this.configuration.sessionTimeoutModalConfiguration.warningSessionTimeoutEnabled&&(this.userSessionService.isUserLoginWithSso()?this.ssoClientService.getSsoSessionStatus().pipe($n(()=>Jo({state:"unknown"}))).subscribe(d=>{console.log("SSO Session Status on Agency Init:",d),d.state==="new"&&this.userSessionService.setSsoSessionValid(!0)}):this.initWarningSessionTimeout()))})}ngOnDestroy(){this.alive=!1,this.sessionTimeoutService?.stop()}uiLanguageChanged(e){this.store.dispatch(new Wr(e.next))}cleanUpProgressBar(e){e.startsWith(`/${pe}`)||this.store.dispatch(new _i)}loadI18nMessages(){return this.store.select(X).pipe($(e=>e!==null))}initWarningSessionTimeout(){this.agentSessionInactivityService.arm(this.configuration.sessionTimeoutModalConfiguration.maxInactivityDuration);let e=this,n={start(){e.openAccountTimeoutModal()},tick(t){e.remainingMinutes$.next(Math.floor(t/60))},reset(){},end(){e.modalService.dismissAll(),e.logout()},maxInactivityDuration:e.configuration.sessionTimeoutModalConfiguration.maxInactivityDuration,countdownDuration:e.configuration.sessionTimeoutModalConfiguration.countdownDuration};this.remainingMinutes$.next(Math.floor(n.countdownDuration/60)),this.sessionTimeoutService.registerCountdown(n)}openAccountTimeoutModal(){if(!this.modalService.hasOpenModals()){let e=this.modalService.open(Oc,{centered:!0}),n=e.componentInstance;n.configuration=this.configuration.sessionTimeoutModalConfiguration,n.remainingMinutesSrc$=this.remainingMinutes$.asObservable(),n.modalDismissed.pipe(x(()=>this.alive)).subscribe(t=>{e.dismiss()}),n.logout.pipe(x(()=>this.alive)).subscribe(t=>{e.dismiss(),this.sessionTimeoutService?.stop(),this.logout()}),n.stayOnline.pipe(x(()=>this.alive)).subscribe(t=>{e.dismiss(),this.sessionTimeoutService?.refresh()})}}logout(){this.alive=!1,this.sessionTimeoutService.broadcastExpiry(),this.sessionTimeoutService?.stop(),this.onLogoutTriggered(),this.store.dispatch(new an),this._jwtAuthenticationService.logout().pipe(Ne()).subscribe(()=>{this.router.navigate([`/${en}`])})}toggleSidebarMenu(e){this.isSidebarMenuOpened=e}closeSidebarMenu(){this.isSidebarMenuOpened=!1}onLogoutTriggered(){this.isLoggingOutSignal.set(!0)}isOnBookingFlow(e){return e===Rt?(this.searchSummary$=this.store.select(ds).pipe(x(()=>this.alive),B(n=>(0,Zc.isArrayLike)(n)&&n.length>0&&n[0].originAirport&&n[0].destinationAirport?n[0]:null)),!0):!1}static{this.\u0275fac=function(n){return new(n||i)(h(Ki),h(q),h(H),h(lt),h(La),h(Z),h(fe),h(Be),h(Jt),h(ji),h(ea),h(Qn),h(Mi),h(wa))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agency"]],standalone:!1,features:[W([Ki])],decls:5,vars:6,consts:[[3,"showSpinner"],["aria-label","agency container"],[1,"navbar","navbar-expand-lg","navbar-primary","bg-primary"],[1,"invisible"],[1,"container","mt-5"],[1,"row"],[1,"col"],[1,"site-header","sticky-top"],[1,"page-header","navbar","navbar-expand-sm","navbar-dark","bg-primary","px-4","justify-content-between",3,"onToggleSidebarMenu","onChange","isSidebarMenuOpened","configuration","activeLanguage","isAgentSite","breadcrumbs","isBookingModule","searchSummary"],[3,"breadcrumbs"],[3,"searchSummary","configuration"],[1,"agent-page","position-relative"],["aria-label","agent sidebar"],[3,"closeSidebarMenu","onLogoutTriggered","isSidebarMenuOpened"],[1,"agent-content","w-100"]],template:function(n,t){n&1&&(A(0,"app-loading-spinner",0),v(1,"async"),y(2,hm,7,0),v(3,"async"),Lt(4,ym,14,15,"main",1)),n&2&&(_("showSpinner",S(1,2,t.showSpinner$)||t.isLoggingOutSignal()),o(2),b(S(3,4,t.initialDataLoading$)?2:4))},dependencies:[Wt,ge,uc,gc,yt,zl,Xc,z],styles:[".agent-page[_ngcontent-%COMP%]{display:flex;position:relative}@media(min-width:992px){.agent-content[_ngcontent-%COMP%]{padding-left:240px}}"]})}}return i})();var Xi=Ce(Re());var Ji=class{constructor(){this.typeOfAlertLabel="Type of Alert",this.detailsLabel="Details",this.statusLabel="Status",this.actionsLabel="Actions",this.viewLabel="View",this.reservationsLabel="Reservations",this.pnrLabel="PNR",this.manageLabel="Manage",this.affectedFlightLabel="Affected Flight",this.affectedLegsLabel="Affected Legs",this.openLabel="Open",this.doneLabel="Done",this.emptyViewLabel="Select an alert queue to proceed",this.reservationUpdateLabel="Reservation Update",this.reservationUpdateTitleLabel="Has the issue been solved for this reservation?",this.reservationUpdateDescriptionLabel="Solving the issue for this reservation will mark it as \u201Cdone\u201D and avoid confusion for other agents working on resolving other cases.",this.solvedButton="Solved!",this.notYetButton="Not yet"}loadConfigSettingsAndI18nMessages(m,e,n,t){let a=new V(n,m,"config");new V(n,e,"i18n").setProperties(this,[["string","typeOfAlertLabel",`${t}.typeOfAlert.label`],["string","detailsLabel",`${t}.details.label`],["string","statusLabel",`${t}.status.label`],["string","actionsLabel",`${t}.actions.label`],["string","viewLabel",`${t}.view.label`],["string","reservationsLabel",`${t}.reservations.label`],["string","pnrLabel",`${t}.pnr.label`],["string","manageLabel",`${t}.manage.label`],["string","affectedFlightLabel",`${t}.affectedFlight.label`],["string","affectedLegsLabel",`${t}.affectedLegs.label`],["string","openLabel",`${t}.open.label`],["string","doneLabel",`${t}.done.label`],["string","emptyViewLabel",`${t}.emptyView.label`],["string","reservationUpdateLabel",`${t}.reservationUpdate.label`],["string","reservationUpdateTitleLabel",`${t}.reservationUpdateTitle.label`],["string","reservationUpdateDescriptionLabel",`${t}.reservationUpdateDescription.label`],["string","solvedButton",`${t}.solved.button`],["string","notYetButton",`${t}.notYet.button`]])}};var zi=(()=>{class i{constructor(){this.selectAlertQueueLabel="Select Alert Queue",this.viewAlertsLabel="View Alerts",this.viewAlertQueueDetailConfiguration=new Ji}loadConfigSettingsAndI18nMessages(e,n,t){let a="agent.alerts",d=new V(t,e,"config");new V(t,n,"i18n").setProperties(this,[["string","selectAlertQueueLabel",`${a}.selectAlertQueue.label`],["string","viewAlertsLabel",`${a}.viewAlerts.label`]]),this.viewAlertQueueDetailConfiguration.loadConfigSettingsAndI18nMessages(e,n,t,a)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var td=(()=>{class i{constructor(e,n,t,a,d){this.configuration=e,this.router=n,this.store=t,this.log=a,this.reservationIdentifierPipe=d,this.alive=!0,this.dataLoading$=ue([!1])}ngOnInit(){this.dataLoading$=N([this.store.select(we),this.store.select(Ee),this.store.select(Ol),this.store.select(ql),this.store.select(Ql),this.store.select(Jl)]).pipe(B(e=>!e.every(n=>!n))),N([this.store.select(te),this.store.select(X)]).pipe(x(()=>this.alive),$(([e,n])=>(0,Xi.isObject)(e)&&(0,Xi.isObject)(n))).subscribe(e=>{let[n,t]=e;this.configuration.loadConfigSettingsAndI18nMessages(n,t,this.log),this.store.dispatch(new br)}),this.availableQueues$=this.store.select(Gl),this.selectingQueues$=this.store.select(jl),this.selectingQueueItem$=this.store.select(Wl),this.queueSubItems$=this.store.select(Kl),this.selectingSubItem$=this.store.select(Yl)}onSelectQueue({key:e,queue:n}){n?this.store.dispatch(new Sr(e)):this.store.dispatch(new vr(e,null))}onSelectQueueItem({queueKey:e,queueItem:n}){this.store.dispatch(new Ar(n)),(0,Xi.isObject)(n)&&n?.key&&this.store.dispatch(new Ir(e,n.key))}onManageSubItemQueue(e){this.store.dispatch(new xr(e)),this.router.navigate([`/${xe}/${Fn}`.replace(`:${ka}`,encodeURIComponent(this.reservationIdentifierPipe.transform(e.reservation)))])}onUpdateSubItemStatus({queueKey:e,queueItemKey:n,subItem:t}){this.store.dispatch(new wr(e,n,t))}ngOnDestroy(){this.alive=!1}static{this.\u0275fac=function(n){return new(n||i)(h(zi),h(Z),h(q),h(H),h(Jn))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-alerts"]],standalone:!1,features:[W([zi])],decls:23,vars:25,consts:[[3,"showSpinner"],[1,"page-body","container-fluid"],[1,"container-lg"],[1,"row"],[1,"col-12"],[1,"h2","text-primary"],[1,"row","mt-2"],[3,"selectedQueuesChange","label","options","selectedQueues"],[1,"row","mt-5"],[1,"w-100",3,"selectQueueItem","manageSubItemQueue","updateSubItemStatus","configuration","selectingQueues","selectingQueueItem","queueSubItems","selectingSubItem"]],template:function(n,t){n&1&&(A(0,"app-loading-spinner",0),v(1,"async"),r(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",3)(7,"div",5),c(8),s()(),r(9,"div",6)(10,"app-queue-multi-select",7),v(11,"async"),v(12,"async"),I("selectedQueuesChange",function(d){return t.onSelectQueue(d)}),s()()(),r(13,"div",4)(14,"div",8)(15,"div",5),c(16),s()(),r(17,"div",6)(18,"app-view-alert-queue-detail",9),v(19,"async"),v(20,"async"),v(21,"async"),v(22,"async"),I("selectQueueItem",function(d){return t.onSelectQueueItem(d)})("manageSubItemQueue",function(d){return t.onManageSubItemQueue(d)})("updateSubItemStatus",function(d){return t.onUpdateSubItemStatus(d)}),s()()()()()()),n&2&&(_("showSpinner",S(1,11,t.dataLoading$)),o(8),g(t.configuration.selectAlertQueueLabel),o(2),_("label",t.configuration.selectAlertQueueLabel)("options",S(11,13,t.availableQueues$))("selectedQueues",S(12,15,t.selectingQueues$)),o(6),g(t.configuration.viewAlertsLabel),o(2),_("configuration",t.configuration.viewAlertQueueDetailConfiguration)("selectingQueues",S(19,17,t.selectingQueues$))("selectingQueueItem",S(20,19,t.selectingQueueItem$))("queueSubItems",S(21,21,t.queueSubItems$))("selectingSubItem",S(22,23,t.selectingSubItem$)))},dependencies:[ge,vc,Wi,z],encapsulation:2})}}return i})();var G=Ce(Re(
1));var St=Ce(Re());var _e=(()=>{class i{constructor(){this.prefix="",this.backButtonLabel="Back",this.continueButtonLabel="Continue",this.commonCartConfiguration=new ml}loadConfigSettingsAndI18nMessages(e,n,t,a,d,C=this.prefix){new V(a,n,"i18n").setProperties(this,[["string","backButtonLabel",`${this.prefix}.backButton.label`],["string","continueButtonLabel",`${this.prefix}.continueButton.label`]]),this.commonCartConfiguration.loadConfigSettingsAndI18nMessages(e,n,t,a,d,C)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var Sm=["mainContentComponent"],He=(()=>{class i{constructor(e,n,t,a,d,C,F){this.store=e,this.router=n,this.location=t,this.activatedRoute=a,this.configHelper=d,this.log=C,this.configuration=F,this.navigationUrlHelper=Te(Ti),this.quotationTotal$=ue([0]),this.dataRoute=null,this.alive=!0}ngOnInit(){this.dataRoute=this.activatedRoute.snapshot.data||null,this.quotationTotal$=this.store.select(Cs).pipe(x(()=>this.alive)),this.hasSelectedJourneys$=this.store.select(Pn).pipe(B(e=>(0,St.isArray)(e)&&e.length>0)),N([this.store.select(te),this.store.select(X),this.store.select(et)]).pipe(x(()=>this.alive),$(e=>e[0]!==null&&e[1]!==null&&e[2]!==null)).subscribe(e=>{let[n,t,a]=e;this.configuration&&this.configuration.loadConfigSettingsAndI18nMessages(n,t,a,this.log,this.configHelper)})}back(){(0,St.isObject)(this.mainContentComponent)&&(0,St.isFunction)(this.mainContentComponent.previousStep)?this.mainContentComponent.previousStep():(this.log.debug("Cannot find the mainContentComponent. Please check it on your Component"),this.navigationUrlHelper.backToPreviousStep())}nextPage(){(0,St.isObject)(this.mainContentComponent)&&(0,St.isFunction)(this.mainContentComponent.nextStep)?this.mainContentComponent.nextStep():(this.log.debug("Cannot find the mainContentComponent. Please check it on your Component"),this.router.navigateByUrl(`/${this.dataRoute?.nextPage??""}`))}onOpenCart(e){e&&this.store.dispatch(new ar)}get selectedFareOption(){return this.mainContentComponent?.selectedFareOption??null}ngOnDestroy(){this.alive=!1}static{this.\u0275fac=function(n){return new(n||i)(h(q),h(Z),h(ve),h(fe),h(ne),h(H),h(_e))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-booking-sticky-footer-base"]],viewQuery:function(n,t){if(n&1&&qe(Sm,5),n&2){let a;Ge(a=Oe())&&(t.mainContentComponent=a.first)}},standalone:!1,features:[W([_e])],decls:0,vars:0,template:function(n,t){},encapsulation:2})}}return i})();var nd="agent.booking",Nt=`${nd}.confirmBooking`,Zi=(()=>{class i extends _e{constructor(e,n,t,a){super(),this.configHelper=e,this.componentsConfigurationHelper=n,this.log=t,this.typeScriptHelper=a,this.reservationBookingInfoEnabled=!0,this.reservationChargesConfiguration=new tc(this.componentsConfigurationHelper),this.paymentWidgetConfiguration=new wc(this.componentsConfigurationHelper,this.log,this.typeScriptHelper),this.reservationBookingCostSummaryConfiguration=new cl(this.componentsConfigurationHelper,this.configHelper),this.pageHeaderMessageConfiguration=new Ct,this.pageFooterMessageConfiguration=new ec,this.reservationsBookingInfoFormConfiguration=new Ra,this.pendingBookingBanner=new Ec,this.reuseReservationSessionEnabled=!1}loadConfigSettingsAndI18nMessagesWithFooter(e,n,t,a=[],d=[],C=[],F=[],p=[],E,R){super.loadConfigSettingsAndI18nMessages(e,n,t,E,R,"agent.booking.confirmAndPay");let k=new V(this.log,e,"config"),M=new V(this.log,n,"i18n");this.reuseReservationSessionEnabled=k.getBoolean("checkout.reuseReservationSession.enabled",!1),this.pendingBookingBanner.loadConfigSettingsAndI18nMessages(k,M,`${nd}.`),this.reservationChargesConfiguration.loadReservationChargesConfiguration(k,M,t,a,C,d,Nt,F,p,this.log),this.reservationBookingCostSummaryConfiguration.loadConfigAndI18n(Nt,k,M,t,d,C),this.reservationChargesConfiguration.loadPassengerSummaryConfiguration(Nt,k,M,a,p),this.paymentWidgetConfiguration.loadConfigSettingsAndI18nMessages(Nt,e,n,t)}loadPaymentWidgetConfiguration(e,n,t,a,d){this.paymentWidgetConfiguration.loadPaymentMethodConfigSettingsAndI18nMessages(e,n,t,a,d,Nt)}loadReservationsBookingInfoFormConfiguration(e,n,t,a=[],d=[]){new V(this.log,e,"config").setProperties(this,[["boolean","reservationBookingInfoEnabled",`${Nt}.reservationBookingInfo.enabled`]]),this.reservationBookingInfoEnabled&&this.reservationsBookingInfoFormConfiguration.loadConfigSettingsAndI18nMessages(Nt,e,n,t,a,d)}static{this.\u0275fac=function(n){return new(n||i)(ie(ne),ie(ct),ie(H),ie(Se))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var wm=["reservationBookingInfoElement"],Em=["paymentWidgetAnchor"],Lm=i=>({invisible:i});
1function Pm(i,m){i&1&&(r(0,"nav",10)(1,"span",11),c(2,"Loading..."),s()(),r(3,"div",12)(4,"div",13)(5,"div",14),A(6,"app-ias-loading-placeholder"),s()()())}function Tm(i,m){if(i&1&&(A(0,"app-progress-bar",16),v(1,"async"),v(2,"async")),i&2){let e=l(2);_("steps",S(1,2,e.availableSteps$))("furthestStepUrl",S(2,4,e.furthestStepUrl$))}}function Fm(i,m){if(i&1){let e=L();r(0,"app-pending-booking-banner",23),I("startNewBooking",function(){u(e);let t=l(2);return f(t.onStartNewBooking())})("payNow",function(){u(e);let t=l(2);return f(t.scrollToPaymentWidget())}),s()}if(i&2){let e=l(2);_("configuration",e.configuration.pendingBookingBanner)}}function Rm(i,m){if(i&1&&A(0,"app-polling-payment-modal",18),i&2){let e=l(2);_("currentStatusMode",e.statusMode.nonThirdPartyPayment)}}function Mm(i,m){if(i&1){let e=L();r(0,"app-reservation-charges",31),v(1,"async"),v(2,"async"),I("onChange",function(){u(e);let t=l(3);return f(t.changeBooking())}),s()}if(i&2){let e=l(3);_("configuration",e.configuration.reservationChargesConfiguration)("reservation",e.reservationWithQuotation)("partnerCarriers",e.partnerCarriers)("seatSelectionOptions",S(1,10,e.cachedSeatSelectionOptions$))("selectedJourneys",e.selectedJourneys)("journeysTravelOptions",e.journeysTravelOptions)("ancillaryOptionsByBookingKey",S(2,12,e.ancillaryOptionsByBookingKey$))("fareClassByJourney",e.fareClassByJourney)("fareClassByKey",e.fareClassByKey())("changeEnabledByJourneyIdentifier",e.allJourneysChangeEnabled)}}function km(i,m){if(i&1){let e=L();r(0,"section",28)(1,"div",32)(2,"div",33,0)(4,"app-reservations-booking-info-form",34),I("onChange",function(t){u(e);let a=l(3);return f(a.bookingInfoChanged(t))}),s()()()()}if(i&2){let e=l(3);o(4),_("configuration",e.configuration.reservationsBookingInfoFormConfiguration)("isEditBookingContact",!1)("bookingInformation",e.reservation.bookingInformation)("formSubmitAttempt",e.formSubmitAttempt)("bookingInformationForm",e.bookingInformationForm)}}function Nm(i,m){if(i&1){let e=L();A(0,"div",35,1),r(2,"app-payment-widget-v2-container",36),v(3,"async"),v(4,"async"),v(5,"async"),I("paymentTransactionsUpdated",function(t){u(e);let a=l(3);return f(a.onPaymentTransactionUpdated(t))})("removeVoucherPM",function(){u(e);let t=l(3);return f(t.onRemoveVoucherPM())})("countryChanged",function(t){u(e);let a=l(3);return f(a.onCountryChanged(t))})("usePrimaryPaxAddressForBillingAddress",function(t){u(e);let a=l(3);return f(a.onUsePrimaryPaxAddressForBillingAddressChanged(t))})("validateVoucher",function(t){u(e);let a=l(3);return f(a.onValidateVoucher(t))})("searchVoucher",function(t){u(e);let a=l(3);return f(a.onSearchVoucher(t))})("paymentVoucherChanged",function(t){u(e);let a=l(3);return f(a.onPaymentVoucherChanged(t))})("deselectPaymentMonthly",function(){u(e);let t=l(3);return f(t.onDeselectPaymentMonthly())})("requestReservation",function(){u(e);let t=l(3);return f(t.onRequestReservation())})("captchaResponseUpdated",function(t){u(e);let a=l(3);return f(a.onCaptchaResponseUpdated(t))})("selectedPaymentMethodsChanged",function(t){u(e);let a=l(3);return f(a.onSelectedPaymentMethodsChanged(t))})("newPaymentMethodSelected",function(t){u(e);let a=l(3);return f(a.onNewPaymentMethodSelected(t))})("submitPaymentTransactions",function(t){u(e);let a=l(3);return f(a.onSubmitPaymentTransactions(t))}),A(6,"app-reservation-booking-cost-summary",37),v(7,"async"),v(8,"async"),s()}if(i&2){let e=l(3);o(2),_("configuration",e.configuration.paymentWidgetConfiguration)("reservation",e.reservation)("isBookingInformationFormValid",e.isBookingInformationFormValid)("dataLoading",S(3,13,e.dataLoading$)||e.selectIsAnyPaymentLoading())("paymentFailureRedirectUrl",e.AGENT_DASHBOARD_URL)("agencyCompany",S(4,15,e.selectedAgencyCompany$))("poNumber",S(5,17,e.poNumber$)),o(4),_("reservation",e.reservation)("quotation",e.displayedQuotation)("configuration",e.configuration.reservationBookingCostSummaryConfiguration)("allAncillaryOptionsForAllJourneys",S(7,19,e.allAncillaryOptionsForAllJourneys$))("voucherPaymentIdentifier",S(8,21,e.voucherPaymentMethodIdentifier$))("currencyCode",e.configuration.reservationBookingCostSummaryConfiguration.currencyCode)}}function Um(i,m){if(i&1){let e=L();r(0,"app-payment-widget-container",38),v(1,"async"),v(2,"async"),v(3,"async"),I("paymentTransactionsUpdated",function(t){u(e);let a=l(3);return f(a.onPaymentTransactionUpdated(t))})("removeVoucherPM",function(){u(e);let t=l(3);return f(t.onRemoveVoucherPM())})("countryChanged",function(t){u(e);let a=l(3);return f(a.onCountryChanged(t))})("usePrimaryPaxAddressForBillingAddress",function(t){u(e);let a=l(3);return f(a.onUsePrimaryPaxAddressForBillingAddressChanged(t))})("validateVoucher",function(t){u(e);let a=l(3);return f(a.onValidateVoucher(t))})("searchVoucher",function(t){u(e);let a=l(3);return f(a.onSearchVoucher(t))})("paymentVoucherChanged",function(t){u(e);let a=l(3);return f(a.onPaymentVoucherChanged(t))})("deselectPaymentMonthly",function(){u(e);let t=l(3);return f(t.onDeselectPaymentMonthly())})("requestReservation",function(){u(e);let t=l(3);return f(t.onRequestReservation())})("captchaResponseUpdated",function(t){u(e);let a=l(3);return f(a.onCaptchaResponseUpdated(t))})("selectedPaymentMethodsChanged",function(t){u(e);let a=l(3);return f(a.onSelectedPaymentMethodsChanged(t))})("newPaymentMethodSelected",function(t){u(e);let a=l(3);return f(a.onNewPaymentMethodSelected(t))})("submitPaymentTransactions",function(t){u(e);let a=l(3);return f(a.onSubmitPaymentTransactions(t))}),A(4,"app-reservation-booking-cost-summary",37),v(5,"async"),v(6,"async"),s()}if(i&2){let e=l(3);_("configuration",e.configuration.paymentWidgetConfiguration)("reservation",e.reservation)("isBookingInformationFormValid",e.isBookingInformationFormValid)("dataLoading",S(1,13,e.dataLoading$)||e.selectIsAnyPaymentLoading())("paymentFailureRedirectUrl",e.AGENT_DASHBOARD_URL)("agencyCompany",S(2,15,e.selectedAgencyCompany$))("poNumber",S(3,17,e.poNumber$)),o(4),_("reservation",e.reservation)("quotation",e.displayedQuotation)("configuration",e.configuration.reservationBookingCostSummaryConfiguration)("allAncillaryOptionsForAllJourneys",S(5,19,e.allAncillaryOptionsForAllJourneys$))("voucherPaymentIdentifier",S(6,21,e.voucherPaymentMethodIdentifier$))("currencyCode",e.configuration.reservationBookingCostSummaryConfiguration.currencyCode)}}function Vm(i,m){if(i&1&&(r(0,"ul",40)(1,"li",41),c(2),s()()),i&2){let e=l(4);o(2),g(e.configuration.paymentWidgetConfiguration.inputErrorText)}}function Bm(i,m){if(i&1&&(r(0,"div")(1,"div",39),y(2,Vm,3,1,"ul",40),s()()),i&2){let e=l(3);
1o(2),b(e.bookingInformationForm.invalid&&e.bookingInformationForm.touched?2:-1)}}function $m(i,m){if(i&1&&(r(0,"div",24)(1,"div",25)(2,"div",13)(3,"div",26)(4,"div",13)(5,"div",14),A(6,"div",13),y(7,Mm,3,14,"app-reservation-charges",27),y(8,km,5,5,"section",28),s()()()()()(),r(9,"section",29),y(10,Nm,9,23)(11,Um,7,23,"app-payment-widget-container",30),s(),y(12,Bm,3,1,"div")),i&2){let e=l(2);o(7),b(e.quotation!=null?7:-1),o(),b(e.configuration.reservationBookingInfoEnabled?8:-1),o(),_("ngClass",J(5,Lm,e.newPaymentFlowEnabled&&e.externalPaymentsLoading())),o(),b(e.paymentWidgetV2Enabled()?10:11),o(2),b(e.configuration.reservationBookingInfoEnabled?12:-1)}}function Dm(i,m){if(i&1){let e=L();r(0,"div",3)(1,"div",15),y(2,Tm,3,6,"app-progress-bar",16),s(),A(3,"app-page-header-message",17),y(4,Fm,1,1,"app-pending-booking-banner",17),A(5,"app-loading-spinner",2),v(6,"async"),y(7,Rm,1,1,"app-polling-payment-modal",18),y(8,$m,13,7),A(9,"router-outlet",19),r(10,"div",20)(11,"app-common-cart",21),v(12,"async"),I("openCart",function(t){u(e);let a=l();return f(a.onOpenCart(t))}),s(),r(13,"button",22),I("click",function(){u(e);let t=l();return f(t.back())}),c(14),s()()()}if(i&2){let e=l();o(2),b(!e.externalPaymentsLoading()||!e.newPaymentFlowEnabled?2:-1),o(),_("configuration",e.configuration.pageHeaderMessageConfiguration),o(),b(e.paymentWidgetV2Enabled()&&e.hasPendingBooking()?4:-1),o(),_("showSpinner",S(6,9,e.dataLoading$)),o(2),b(e.selectIsAnyPaymentLoading()&&!e.systempayIframeActive()?7:-1),o(),b(e.initialized?8:-1),o(3),_("quotationTotal",S(12,11,e.quotationTotal$))("configuration",e.configuration.commonCartConfiguration),o(3),P(" ",e.configuration.backButtonLabel," ")}}var od=(()=>{class i extends He{get displayedQuotation(){return this.existingReservationOutstandingBalanceQuotation()??this.quotation}constructor(e,n,t,a,d,C,F,p,E,R,k,M,xt,In,wt){super(n,C,M,k,xt,F,e),this.configuration=e,this.store=n,this.formElementHelper=t,this.typeScriptHelper=a,this.reservationsHelper=d,this.router=C,this.log=F,this.thirdPartyBookingSubmitHelper=p,this._modalService=E,this.errorNotifier=R,this.activatedRoute=k,this.location=M,this.configHelper=xt,this.pendingBookingGateService=In,this.bookingResetService=wt,this.hasPendingBooking=this.store.selectSignal(Hl),this.voucherPaymentMethodIdentifier$=this.store.select(Jr),this.AGENT_DASHBOARD_URL=`/${xe}`,this.initialized=!1,this.bookingInformationForm=null,this.formSubmitAttempt=!1,this.fareClassByKey=this.store.selectSignal(is),this.captchaResponse=null,this.alive=!0,this.configuration$=new Bn(null),this.currentThirdPartyPayment=this.store.selectSignal(Ml),this.existingReservationOutstandingBalanceQuotation=this.store.selectSignal(rl),this.configSettings={},this.currentRawReservation=this.store.selectSignal(ol),this.externalPaymentsLoadingSignal=this.store.selectSignal(ko),this.externalPayments=this.store.selectSignal(Fl),this.currentExternalPayment=rt(()=>this.externalPayments()?.[this.currentThirdPartyPayment()?.id]),this.paymentV2State=this.store.selectSignal(sc),this.externalPaymentsLoading=rt(()=>Object.values(this.externalPaymentsLoadingSignal()).some(le=>le)),this.statusMode=dc,this.selectIsAnyPaymentLoading=this.store.selectSignal($l),this.paymentWidgetV2Enabled=rc(this.store,"agentBooking"),this.systempayIframeActive=this.store.selectSignal(ws)}ngAfterViewChecked(){this.scrollToPaymentWidgetIfRequested()}onStartNewBooking(){this.bookingResetService.startNewBooking({isAgent:!0})}scrollToPaymentWidgetIfRequested(){!this.initialized||!this.paymentWidgetAnchor?.nativeElement||this.pendingBookingGateService.consumeScrollToPayment()&&this.scrollToPaymentWidget()}scrollToPaymentWidget(){if(!this.paymentWidgetAnchor?.nativeElement)return;let e=window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;setTimeout(()=>{this.paymentWidgetAnchor.nativeElement.scrollIntoView({block:"start",behavior:e?"auto":"smooth"})},20)}ngOnInit(){super.ngOnInit(),this.store.dispatch(new jr(null)),this.store.dispatch(new hi(`${pe}/${Mt}`)),this.availableSteps$=this.store.select(Li),this.furthestStepUrl$=this.store.select(Pi),N([this.store.select(te),this.store.select(X)]).pipe(x(()=>this.alive),$(e=>e[0]!==null&&e[1]!==null)).subscribe(([e,n])=>{let t=new $i(this.log);this.configSettings=e;let a=t.convertConfigSettingsAndI18nMessages(e,n,En);this.store.dispatch(new fi(a))}),N([N([this.store.select(te),this.store.select(X)]).pipe(x(()=>this.alive),$(e=>e[0]!==null&&e[1]!==null)),this.store.select(et),this.store.select(gt),this.store.select(Vl),this.store.select(Ms),this.store.select(No)]).pipe(x(()=>this.alive)).subscribe(([[e,n],t,a,[d,C],F,p])=>{let E=(0,G.flatten)(Object.values(p||{})).map(R=>R.ancillaryItem);this.partnerCarriers=F,this.configuration.loadConfigSettingsAndI18nMessagesWithFooter(e,n,t,a,d,C,F,E,this.log,this.configHelper),[this.configuration.paymentWidgetConfiguration.travelRestrictionAcknowledgement,this.configuration.paymentWidgetConfiguration.paymentMethodPickerConfiguration.travelRestrictionAcknowledgement].forEach(R=>{this.overrideTravelRestrictionAcknowledgementConfig(R)})}),N([this.store.select(te),this.store.select(X),this.store.select(Uo),this.store.select(pt),this.store.select(_t)]).pipe(x(()=>this.alive)).subscribe(([e,n,t,a,d])=>{this.configuration.loadPaymentWidgetConfiguration(e,n,t,a,d)}),N([this.store.select(te),this.store.select(X),this.store.select(Zr),this.store.select(hs)]).pipe(x(()=>this.alive)).subscribe(([e,n,t,a])=>{this.configuration.loadReservationsBookingInfoFormConfiguration(e,n,this.log,t,a?.contactInformation?.notificationPreferences),this.configuration$.next(this.configuration)}),this.initialDataLoading$=N([this.store.select(as),this.store.select(ms).pipe(B(e=>!e.every(n=>!n)))]).pipe(x(()=>this.alive),B(e=>!e.every(n=>!n))),this.dataLoading$=N([this.store.select(rs),this.store.select(_s),this.store.select(Fo),this.store.select(Is),this.store.select(xs),this.store.select(Pl),this.store.select(Tl),this.store.select(Bl),this.store.select(ko).pipe(B(e=>Object.values(e).some(n=>n&&!this.newPaymentFlowEnabled))),this.store.select(Rl),this.store.select(kl),this.store.select(sl),this.store.select(tl)]).pipe(x(()=>this.alive),B(e=>!e.every(n=>!n))),this.allAncillaryOptionsForAllJourneys$=this.store.select(Ul).pipe(Vt((e,n)=>(0,G.isEqual)((0,G.sortBy)(e.map(t=>t.key)),n.map(t=>t.key)))),this.selectedAgencyCompany$=this.store.select(ut),this.poNumber$=this.store.select(dn),N([this.store.select(mn),this.store.select(Tn)]).pipe(x(()=>this.alive)).subscribe(([e,n])=>{(0,G.isObject)(e)?this.reservationWithQuotation=U(T({},e),{charges:[...n.charges]}):this.reservationWithQuotation=null}),N([this.store.select(mn),this.configuration$]).pipe(x(()=>this.alive),$(([e,n])=>(0,G.isObject)(e)&&(0,G.isObject)(n))).subscribe(([e,n])=>{this.reservation=e,this.fareClassByJourney=new Map;let t=e?.journeys;(0,G.isArray)(t)&&t.length>0&&t.forEach(a=>{this.fareClassByJourney.set(this.reservationsHelper.getJourneyIdentifier(a),a.passengerJourneyDetails[0]?.fareClass)}),this.configuration.reservationBookingInfoEnabled?(0,G.isObject)(this.bookingInformationForm)?this.updateFormValidationRules(this.configuration.reservationsBookingInfoFormConfiguration):this.bookingInformationForm=this.createReservationBookingInformationInputForm(this.reservation.bookingInformation,this.configuration.reservationsBookingInfoFormConfiguration):this.bookingInformationForm=null}),this.store.select(Pn).pipe(x(()=>this.alive),$(e=>(0,G.isArray)(e))).subscribe(e=>{this.selectedJourneys=e,this.configuration.paymentWidgetConfiguration.paymentMethodPickerConfiguration.paymentConfigurations=this.configuration.paymentWidgetConfiguration.paymentMethodPickerConfiguration.paymentConfigurations.filter(n=>this.reservationsHelper.isAvailableBeforeDeparture(this.selectedJourneys[0]?.travelOption?.flights[0].departure.scheduledTime,this.configuration.paymentWidgetConfiguration.paymentMethodAvailabilityThresholds[n.paymentMethod.identifier]))}),N([this.store.select(Pn),this.store.select(Ln)]).pipe(x(()=>this.alive),$(([e])=>(0,G.isArray)(e))).subscribe(([e,n])=>{this.journeysTravelOptions=[],(0,G.isArrayLike)(e)&&e.length>0&&(n===cn.MultiCity?e.forEach(t=>{this.journeysTravelOptions.push(t.travelOption)}):((0,G.isObject)(e[0])&&this.journeysTravelOptions.push(e[0].travelOption),e.length>1&&(0,G.isObject)(e[1])&&n===cn.Return&&this.journeysTravelOptions.push(e[1].travelOption)))}),this.store.select(Es).pipe(x(()=>this.alive)).subscribe(e=>{this.eCommpayPaymentStatus=e}),this.store.select(Ps).pipe(x(()=>this.alive)).subscribe(e=>{this.billwerkPaymentStatus=e}),this.store.select(Ts).pipe(x(()=>this.alive)).subscribe(e=>{this.payPalPaymentStatus=e}),this.store.select(Ns).pipe(x(()=>this.alive)).subscribe(e=>{this.tinggPaymentStatus=e}),this.store.select(Us).pipe(x(()=>this.alive)).subscribe(e=>{this.waafiPayPaymentStatus=e}),this.store.select(Vs).pipe(x(()=>this.alive)).subscribe(e=>{this.mongolIdPaymentStatus=e}),this.store.select(Fs).pipe(x(()=>this.alive)).subscribe(e=>{this.netsEasyPaymentStatus=e}),this.store.select(Rs).pipe(x(()=>this.alive)).subscribe(e=>{this.alBusairiBankPaymentStatus=e}),this.store.select(Nl).pipe(x(()=>this.alive)).subscribe(e=>{e&&this.reservation?.locator&&!this.paymentWidgetV2Enabled()&&this.store.dispatch(new To)}),this.store.select(Bs).pipe(x(()=>this.alive)).subscribe(e=>{this.payMongoPaymentStatus=e}),this.store.select($s).pipe(x(()=>this.alive)).subscribe(e=>{this.mayaPaymentStatus=e}),this.store.select(Ds).pipe(x(()=>this.alive)).subscribe(e=>{this.ccAvenuePaymentStatus=e}),this.store.select(Ls).pipe(x(()=>this.alive)).subscribe(e=>{this.twoC2PPaymentStatus=e}),this.store.select(Hs).pipe(x(()=>this.alive)).subscribe(e=>{this.revolutPaymentStatus=e}),this.store.select(Gs).pipe(x(()=>this.alive)).subscribe(e=>{this.loovPaymentStatus=e}),this.store.select(Os).pipe(x(()=>this.alive)).subscribe(e=>{this.boricaPaymentStatus=e}),this.store.select(qs).pipe(x(()=>this.alive)).subscribe(e=>{this.stripePaymentStatus=e}),this.store.select(js).pipe(x(()=>this.alive)).subscribe(e=>{this.directPayPaymentStatus=e}),this.store.select(Qs).pipe(x(()=>this.alive)).subscribe(e=>{this.emerchantPayPaymentStatus=e}),this.store.select(Ws).pipe(x(()=>this.alive)).subscribe(e=>{this.payTabsPaymentStatus=e}),this.store.select(Ks).pipe(x(()=>this.alive)).subscribe(e=>{this.kaspiPaymentStatus=e}),this.store.select(nl).pipe(x(()=>this.alive)).subscribe(e=>{this.freedompayPaymentStatus=e}),this.store.select(Ys).pipe(x(()=>this.alive)).subscribe(e=>{this.halykepayPaymentStatus=e}),this.store.select(Js).pipe(x(()=>this.alive)).subscribe(e=>{this.quickPayPaymentStatus=e}),this.store.select(zs).pipe(x(()=>this.alive)).subscribe(e=>{this.umoneyPaymentStatus=e}),this.store.select(Xs).pipe(x(()=>this.alive)).subscribe(e=>{this.datatransPaymentStatus=e}),this.store.select(Zs).pipe(x(()=>this.alive)).subscribe(e=>{this.raiffeisenPaymentStatus=e}),this.store.select(el).pipe(x(()=>this.alive)).subscribe(e=>{this.genericRedirectPaymentStatus=e}),this.cachedSeatSelectionOptions$=this.store.select(us),this.ancillaryOptionsByBookingKey$=this.store.select(No),this.feedDataToReservationCheckoutState(),this.initialized=!0,this.store.dispatch(new ir),this.store.dispatch(new Fr)}
1ngOnDestroy(){this.alive=!1}onPostMessage(e){if((0,G.isString)(e.data))try{let n=JSON.parse(e.data);if(n?.eventName==="LYRA_AUTH_INSTRUCTION_RESULT"){this.store.dispatch(new lr(n));return}}catch(n){}finally{document.getElementById("instructionContainer")?.classList.remove("processing")}}changeBooking(){this.router.navigateByUrl(`/${pe}`)}get allJourneysChangeEnabled(){return(this.reservation?.journeys??[]).reduce((e,n)=>(e[this.reservationsHelper.getJourneyIdentifier(n)]=!0,e),{})}onPaymentTransactionUpdated(e){this.store.dispatch(new dt(this.getNewReservation(e)))}onNewPaymentMethodSelected(e){let n=this.getNewReservation(e,!0);if(!this.paymentWidgetV2Enabled()){if(!this.configuration.reuseReservationSessionEnabled){this.store.dispatch(new oi(n)),this.store.dispatch(new dt(n));return}if(n.locator&&this.isReservationSessionValid&&n.paymentTransactions?.length>0){this.store.dispatch(new dt(n)),this.store.dispatch(new Po(n.key,n.paymentTransactions));return}this.store.dispatch(new dt(this.currentRawReservation()?.reservationPayload??n)),this.store.dispatch(new oi(this.currentRawReservation()?.reservationPayload??n));return}if(((0,G.isString)(n.locator)||(0,G.isString)(n.key))&&this.isReservationSessionValid){this.store.dispatch(new dt(n)),this.store.dispatch(new Po(n.key,n.paymentTransactions));return}let a=this.cleanReservationSnapshot,d=(0,G.isObject)(a)?U(T({},a),{paymentTransactions:n.paymentTransactions}):n;this.store.dispatch(new dt(d)),this.currentExternalPayment()||this.store.dispatch(new oi(d))}get newPaymentFlowEnabled(){return(0,G.isObject)(this.currentThirdPartyPayment())&&$o.has(this.currentThirdPartyPayment()?.provider)}get isBookingInformationFormValid(){return!this.configuration.reservationBookingInfoEnabled||(0,G.isObject)(this.bookingInformationForm)&&this.bookingInformationForm?.valid}onSubmitPaymentTransactions(e){if(this.formSubmitAttempt=!0,(0,G.isObject)(this.bookingInformationForm)&&!this.bookingInformationForm?.valid){this.bookingInformationForm.markAllAsTouched(),this.scrollIntoBookingInfo();return}let n=[],t=this.getNewReservation(e),a=t,d=this.thirdPartyBookingSubmitHelper.resolve(t,this.quotation.paymentTransactions,this.configSettings,this.getThirdPartyPaymentStatuses(),"booking",this.paymentWidgetV2Enabled());if(n.push(...d.actions),this.isReservationSessionValid&&(0,G.isString)(this.reservation?.key)){d.actions.forEach(F=>this.store.dispatch(F));let C=this.reservation.paymentTransactions.filter(F=>!F?.paymentMethod?.type?.voucher).map(F=>{let p=this.existingReservationOutstandingBalanceQuotation()?.paymentTransactions?.find(R=>R.paymentMethod?.identifier===F.paymentMethod?.identifier),E=T(T({},F),(0,G.isObject)(p)?{currencyAmounts:p.currencyAmounts,processingCurrencyAmounts:p.processingCurrencyAmounts}:{});return Vo(E,this.configSettings)});this.requestAddPaymentTransaction(C)}else{let F=this.cleanReservationSnapshot??t,p=(0,G.isArray)(t.paymentTransactions)?t.paymentTransactions.map(E=>Vo(E,this.configSettings)):t.paymentTransactions;a=U(T({},F),{paymentTransactions:p}),n.push(new dt(a,!0)),$o.has(this.currentThirdPartyPayment()?.provider)&&n.push(new To),n.push(new Eo(a,this.captchaResponse));for(let E=0;E<n.length-1;E++)n[E][il]=!1;n.some(E=>this.store.dispatch(E))}}getThirdPartyPaymentStatuses(){return{[ee.ECommpay]:this.eCommpayPaymentStatus,[ee.Billwerk]:this.billwerkPaymentStatus,[ee.PayPal]:this.payPalPaymentStatus,[ee.Tingg]:this.tinggPaymentStatus,[ee.NetsEasy]:this.netsEasyPaymentStatus,[ee.AlBusairiBank]:this.alBusairiBankPaymentStatus,[ee.WaafiPay]:this.waafiPayPaymentStatus,[ee.MongolId]:this.mongolIdPaymentStatus,[ee.PayMongo]:this.payMongoPaymentStatus,[ee.Maya]:this.mayaPaymentStatus,[ee.CCAvenue]:this.ccAvenuePaymentStatus,[ee.TwoC2P]:this.twoC2PPaymentStatus,[ee.Revolut]:this.revolutPaymentStatus,[ee.Loov]:this.loovPaymentStatus,[ee.Borica]:this.boricaPaymentStatus,[ee.Stripe]:this.stripePaymentStatus,[ee.DirectPay]:this.directPayPaymentStatus,[ee.EmerchantPay]:this.emerchantPayPaymentStatus,[ee.PayTabs]:this.payTabsPaymentStatus,[ee.Kaspi]:this.kaspiPaymentStatus,[ee.FreedomPay]:this.freedompayPaymentStatus,[ee.HalykEpay]:this.halykepayPaymentStatus,[ee.QuickPay]:this.quickPayPaymentStatus,[ee.Umoney]:this.umoneyPaymentStatus,[ee.Datatrans]:this.datatransPaymentStatus,[ee.Raiffeisen]:this.raiffeisenPaymentStatus,[ee.Nuvei]:this.genericRedirectPaymentStatus}}onCaptchaResponseUpdated(e){this.captchaResponse=e}onSelectedPaymentMethodsChanged(e){}onRequestReservation(){if(this.formSubmitAttempt=!0,(0,G.isObject)(this.bookingInformationForm)&&!this.bookingInformationForm?.valid){this.bookingInformationForm.markAllAsTouched(),this.scrollIntoBookingInfo();return}this.store.dispatch(new Eo(this.reservation,this.captchaResponse))}onDeselectPaymentMonthly(){}onUsePrimaryPaxAddressForBillingAddressChanged(e){}onRemoveVoucherPM(){this.store.dispatch(new ai(null)),this.store.dispatch(new sr)}onCountryChanged(e){this.store.dispatch(new Rr(e))}onValidateVoucher(e){(0,G.isString)(e)&&e!==""&&this.store.dispatch(new or(e,""))}onSearchVoucher(e){(0,G.isString)(e)&&e!==""&&this.store.dispatch(new rr(e))}onPaymentVoucherChanged(e){this.store.dispatch(new ai(e))}feedDataToReservationCheckoutState(){this.store.select(et).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new Nr(e))}),this.store.select(mn).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new kr(e))}),this.store.select(fs).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new $r(e)),this.store.dispatch(new Br(e))}),this.store.select(Uo).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new Ur(e))}),this.store.select(Tn).pipe(x(()=>this.alive)).subscribe(e=>{this.quotation=e,this.store.dispatch(new Vr(e))}),this.store.select(ys).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new Hr(e))}),this.store.select(bs).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new qr(e))}),this.store.select(Fo).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new Dr(e))}),this.store.select(vs).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new Gr(e))}),this.store.select(Ss).pipe(x(()=>this.alive)).subscribe(e=>{this.store.dispatch(new Or(e))}),this.store.select(As).pipe(x(()=>this.alive)).subscribe(e=>{(0,G.isString)(e?.serialNumber)?this.store.dispatch(new Mr(e)):this.store.dispatch(new ai(this.formElementHelper.initializePMVoucher()))})}createReservationBookingInformationInputForm(e,n){return new Ve({notes:new w(e?.notes,this.formElementHelper.createValidators(n.notes))})}updateFormValidationRules(e){this.bookingInformationForm.get("notes").setValidators(this.formElementHelper.createValidators(e.notes))}getNewReservation(e,n=!1){return this.reservation?.paymentTransactions?.length>0&&e?.length>0&&e?.every(t=>t?.paymentMethod?.type?.thirdParty)&&!n?this.reservation:U(T({},this.reservation),{paymentTransactions:e?.length>0?e:null})}scrollIntoBookingInfo(){setTimeout(()=>{this.reservationBookingInfoElRef?.nativeElement!=null&&this.reservationBookingInfoElRef.nativeElement.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},20)}
1bookingInfoChanged(e){this.store.dispatch(new cr(this.typeScriptHelper.deepCopy(e.next)))}overrideTravelRestrictionAcknowledgementConfig(e){if(!(0,G.isObject)(this.selectedJourneys))return;let n=this.selectedJourneys.map(a=>a.travelOption.departureDate),t=this.selectedJourneys.map(a=>a.travelOption.cityPair.identifier);this.formElementHelper.loadTravelRestrictionAcknowledgementEnabledByJourneys(e,n,t)}requestAddPaymentTransaction(e){this.store.dispatch(new Qr(!1)),this.store.dispatch(new Lr({locator:this.reservation.locator,lastName:this.reservation.passengers[0].reservationProfile.lastName,firstName:this.reservation.passengers[0].reservationProfile.firstName})),this.store.dispatch(new Pr(this.reservation.locator,this.reservation)),this.store.dispatch(new Tr(this.reservation.key,e,"",!1,[]))}get isReservationSessionValid(){return Dl(this.reservation,"booking")}get cleanReservationSnapshot(){let e=this.currentRawReservation()?.reservationPayload;if((0,G.isObject)(e))return e;let n=this.paymentV2State()?.providers??{},t=this.currentThirdPartyPayment()?.provider,a=t?n[t]?.reservationPayload:null;return(0,G.isObject)(a)?a:Object.values(n).map(d=>d?.reservationPayload).find(d=>(0,G.isObject)(d))??null}static{this.\u0275fac=function(n){return new(n||i)(h(Zi),h(q),h($e),h(Se),h(Kn),h(Z),h(H),h(Lc),h(Be),h(Kt),h(fe),h(ve),h(ne),h(cc),h(lc))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-booking-confirm-and-pay"]],viewQuery:function(n,t){if(n&1&&qe(wm,5)(Em,5),n&2){let a;Ge(a=Oe())&&(t.reservationBookingInfoElRef=a.first),Ge(a=Oe())&&(t.paymentWidgetAnchor=a.first)}},hostBindings:function(n,t){n&1&&I("message",function(d){return t.onPostMessage(d)},na)},standalone:!1,features:[W([Zi]),Ue],decls:12,vars:9,consts:[["reservationBookingInfoElement",""],["paymentWidgetAnchor",""],[3,"showSpinner"],[2,"margin-bottom","7rem"],["id","instructionContainer",1,"d-none"],["tabindex","-1","role","dialog",1,"modal","fade","show","d-block"],["role","document",1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content"],["id","instructionIFrameContainer",1,"modal-body","d-flex","flex-column","align-items-center","iframe-container"],[1,"modal-backdrop","fade","show"],[1,"navbar","navbar-expand-lg","navbar-primary","bg-primary"],[1,"invisible"],[1,"container","mt-5"],[1,"row"],[1,"col"],[1,"sticky-top","z-index-fixed","bg-white"],[3,"steps","furthestStepUrl"],[3,"configuration"],[3,"currentStatusMode"],["name","modal"],[1,"sticky-footer","d-flex","justify-content-end","footer-container","align-items-center","p-3"],[3,"openCart","quotationTotal","configuration"],["type","button",1,"btn","btn-outline-primary","rounded-pill","ms-sm-3","me-3",3,"click"],[3,"startNewBooking","payNow","configuration"],[1,"page-body","container-fluid","bg-white"],[1,"container-lg"],[1,"col-sm-12"],[3,"configuration","reservation","partnerCarriers","seatSelectionOptions","selectedJourneys","journeysTravelOptions","ancillaryOptionsByBookingKey","fareClassByJourney","fareClassByKey","changeEnabledByJourneyIdentifier"],["aria-label","booking note"],[3,"ngClass"],[3,"configuration","reservation","isBookingInformationFormValid","dataLoading","paymentFailureRedirectUrl","agencyCompany","poNumber"],[3,"onChange","configuration","reservation","partnerCarriers","seatSelectionOptions","selectedJourneys","journeysTravelOptions","ancillaryOptionsByBookingKey","fareClassByJourney","fareClassByKey","changeEnabledByJourneyIdentifier"],[1,"row","my-3"],[1,"col-12","booking-info","py-4","border-bottom","border-bottom-thick","border-top"],[3,"onChange","configuration","isEditBookingContact","bookingInformation","formSubmitAttempt","bookingInformationForm"],["data-test-id","payment-widget-anchor"],["flowMode","booking",3,"paymentTransactionsUpdated","removeVoucherPM","countryChanged","usePrimaryPaxAddressForBillingAddress","validateVoucher","searchVoucher","paymentVoucherChanged","deselectPaymentMonthly","requestReservation","captchaResponseUpdated","selectedPaymentMethodsChanged","newPaymentMethodSelected","submitPaymentTransactions","configuration","reservation","isBookingInformationFormValid","dataLoading","paymentFailureRedirectUrl","agencyCompany","poNumber"],[3,"reservation","quotation","configuration","allAncillaryOptionsForAllJourneys","voucherPaymentIdentifier","currencyCode"],[3,"paymentTransactionsUpdated","removeVoucherPM","countryChanged","usePrimaryPaxAddressForBillingAddress","validateVoucher","searchVoucher","paymentVoucherChanged","deselectPaymentMonthly","requestReservation","captchaResponseUpdated","selectedPaymentMethodsChanged","newPaymentMethodSelected","submitPaymentTransactions","configuration","reservation","isBookingInformationFormValid","dataLoading","paymentFailureRedirectUrl","agencyCompany","poNumber"],[1,"col-10","offset-1"],[1,"list-group","error-container","mb-3"],[1,"list-group-item","list-group-item-danger"]],template:function(n,t){n&1&&(A(0,"app-loading-spinner",2),v(1,"async"),y(2,Pm,7,0),v(3,"async"),y(4,Dm,15,13,"div",3),v(5,"async"),r(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),A(10,"div",8),s()()(),A(11,"div",9),s()),n&2&&(_("showSpinner",S(1,3,t.initialDataLoading$)),o(2),b(S(3,5,t.initialDataLoading$)?2:-1),o(2),b(S(5,7,t.initialDataLoading$)?-1:4))},dependencies:[ca,Wt,Zl,ge,pc,vi,dl,bn,yt,De,Fa,Ic,Pc,Bi,z],encapsulation:2})}}return i})();var eo=(()=>{class i extends _e{constructor(){super(...arguments),this.prefix="agent.booking.extras"}static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=ot(i)))(t||i)}})()}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var ad=(()=>{class i extends He{constructor(e,n,t,a,d,C,F){super(n,t,a,d,F,C,e),this.configuration=e,this.store=n,this.router=t,this.location=a,this.activatedRoute=d,this.log=C,this.configHelper=F}static{this.\u0275fac=function(n){return new(n||i)(h(eo),h(q),h(Z),h(ve),h(fe),h(H),h(ne))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-booking-extras"]],standalone:!1,features:[W([eo]),Ue],decls:9,vars:6,consts:[["mainContentComponent",""],[1,"sticky-footer","d-flex","justify-content-end","footer-container","align-items-center","p-3"],[3,"openCart","quotationTotal","configuration"],["type","button",1,"btn","btn-outline-primary","rounded-pill","me-3",3,"click"],["type","button",1,"btn","btn-primary","rounded-pill",3,"click"]],template:function(n,t){if(n&1){let a=L();A(0,"app-extras",null,0),r(2,"div",1)(3,"app-common-cart",2),v(4,"async"),I("openCart",function(C){return u(a),f(t.onOpenCart(C))}),s(),r(5,"button",3),I("click",function(){return u(a),f(t.back())}),c(6),s(),r(7,"button",4),I("click",function(){return u(a),f(t.nextPage())}),c(8),s()()}
1n&2&&(o(3),_("quotationTotal",S(4,4,t.quotationTotal$))("configuration",t.configuration.commonCartConfiguration),o(3),g(t.configuration.backButtonLabel),o(2),g(t.configuration.continueButtonLabel))},dependencies:[De,Rc,z],encapsulation:2})}}return i})();var no=Ce(Re());var to=(()=>{class i extends _e{constructor(){super(...arguments),this.prefix="agent.booking.passengers"}static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=ot(i)))(t||i)}})()}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var rd=(()=>{class i extends He{constructor(e,n,t,a,d,C,F){super(n,t,a,d,F,C,e),this.configuration=e,this.store=n,this.router=t,this.location=a,this.activatedRoute=d,this.log=C,this.configHelper=F}ngOnInit(){super.ngOnInit()}nextPage(){(0,no.isObject)(this.mainContentComponent)&&(0,no.isFunction)(this.mainContentComponent.nextStep)?this.mainContentComponent.nextStep():(this.log.debug("Cannot find the mainContentComponent. Please check it on your Component"),this.router.navigateByUrl(`/${this.dataRoute?.nextPage??""}`))}static{this.\u0275fac=function(n){return new(n||i)(h(to),h(q),h(Z),h(ve),h(fe),h(H),h(ne))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-booking-passengers"]],standalone:!1,features:[W([to]),Ue],decls:9,vars:6,consts:[["mainContentComponent",""],[1,"sticky-footer","d-flex","justify-content-end","footer-container","align-items-center","p-3"],[3,"openCart","quotationTotal","configuration"],["type","button",1,"btn","btn-outline-primary","rounded-pill","ms-sm-3","me-3",3,"click"],["type","button",1,"btn","btn-primary","rounded-pill",3,"click"]],template:function(n,t){if(n&1){let a=L();A(0,"app-passengers",null,0),r(2,"div",1)(3,"app-common-cart",2),v(4,"async"),I("openCart",function(C){return u(a),f(t.onOpenCart(C))}),s(),r(5,"button",3),I("click",function(){return u(a),f(t.back())}),c(6),s(),r(7,"button",4),I("click",function(){return u(a),f(t.nextPage())}),c(8),s()()}n&2&&(o(3),_("quotationTotal",S(4,4,t.quotationTotal$))("configuration",t.configuration.commonCartConfiguration),o(3),P(" ",t.configuration.backButtonLabel," "),o(2),g(t.configuration.continueButtonLabel))},dependencies:[De,Mc,z],encapsulation:2})}}return i})();var io=(()=>{class i extends _e{constructor(){super(...arguments),this.prefix="agent.booking.seatsSelection"}static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=ot(i)))(t||i)}})()}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var sd=(()=>{class i extends He{constructor(e,n,t,a,d,C,F){super(n,t,a,d,F,C,e),this.configuration=e,this.store=n,this.router=t,this.location=a,this.activatedRoute=d,this.log=C,this.configHelper=F}static{this.\u0275fac=function(n){return new(n||i)(h(io),h(q),h(Z),h(ve),h(fe),h(H),h(ne))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-booking-seats-selection"]],standalone:!1,features:[W([io]),Ue],decls:9,vars:6,consts:[["mainContentComponent",""],[1,"sticky-footer","d-flex","justify-content-end","footer-container","align-items-center","p-3"],[3,"openCart","quotationTotal","configuration"],["type","button",1,"btn","btn-outline-primary","rounded-pill","me-3",3,"click"],["type","button",1,"btn","btn-primary","rounded-pill",3,"click"]],template:function(n,t){if(n&1){let a=L();A(0,"app-seats-selection",null,0),r(2,"div",1)(3,"app-common-cart",2),v(4,"async"),I("openCart",function(C){return u(a),f(t.onOpenCart(C))}),s(),r(5,"button",3),I("click",function(){return u(a),f(t.back())}),c(6),s(),r(7,"button",4),I("click",function(){return u(a),f(t.nextPage())}),c(8),s()()}n&2&&(o(3),_("quotationTotal",S(4,4,t.quotationTotal$))("configuration",t.configuration.commonCartConfiguration),o(3),g(t.configuration.backButtonLabel),o(2),g(t.configuration.continueButtonLabel))},dependencies:[De,kc,z],encapsulation:2})}}return i})();var cd=Ce(Re()),ld="publicBooking",At=class{constructor(){this.publicBookingLabel="Including public fares"}loadConfigSettingsAndI18nMessages(m,e,n,t){let a=new V(t,n,"i18n"),d=!(0,cd.isString)(m)||m===""?ld:`${m}.${ld}`;a.setProperties(this,[["string","publicBookingLabel",`${d}.label`]])}};var oo=(()=>
1{class i extends _e{constructor(){super(...arguments),this.whereAreYouFlyingLabel="Where are you flying?",this.pageHeaderMessageConfiguration=new Ct,this.publicBookingCheckboxConfiguration=new At,this.prefix="agent.booking.flightSearch"}loadConfigSettingsAndI18nMessages(e,n,t,a){let d=new V(a,n,"i18n"),C=new ne;super.loadConfigSettingsAndI18nMessages(e,n,t,a,C),d.setProperties(this,[["string","whereAreYouFlyingLabel","home.whereAreYouFlying.label"]]),this.pageHeaderMessageConfiguration=new Ct,this.pageHeaderMessageConfiguration.loadConfigSettingsAndI18nMessages("page.home",e,n,a),this.commonCartConfiguration.loadConfigSettingsAndI18nMessages(e,n,t,a,C,this.prefix),this.publicBookingCheckboxConfiguration=new At,this.publicBookingCheckboxConfiguration.loadConfigSettingsAndI18nMessages(this.prefix,e,n,a)}static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=ot(i)))(t||i)}})()}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var Km=["searchResult"];function Ym(i,m){i&1&&A(0,"app-flight-search-results",null,1)}function Jm(i,m){if(i&1){let e=L();r(0,"app-common-cart",22),I("openCart",function(t){u(e);let a=l(3);return f(a.onOpenCart(t))}),s()}if(i&2){let e=l(3);_("quotationTotal",m)("configuration",e.configuration.commonCartConfiguration)}}function zm(i,m){if(i&1){let e=L();r(0,"div",18),y(1,Jm,1,2,"app-common-cart",19),v(2,"async"),r(3,"button",20),I("click",function(){u(e);let t=l(2);return f(t.back())}),c(4),s(),r(5,"button",21),I("click",function(){u(e);let t=l(2);return f(t.nextPage())}),c(6),s()()}if(i&2){let e,n=l(2);o(),b((e=S(2,4,n.quotationTotal$))?1:-1,e),o(3),P(" ",n.configuration.backButtonLabel," "),o(),_("disabled",n.selectedFareOption===null),o(),P(" ",n.configuration.continueButtonLabel," ")}}function Xm(i,m){if(i&1&&(r(0,"div",3),A(1,"app-progress-bar",4),v(2,"async"),v(3,"async"),s(),A(4,"app-page-header-message",5),r(5,"section",6)(6,"div",7)(7,"div",8)(8,"div",9)(9,"div",10)(10,"div",9)(11,"div",11)(12,"div",12)(13,"div",11)(14,"div",13),c(15),s()()(),r(16,"div",14)(17,"div",15)(18,"app-flight-search"),ae(19,16),A(20,"app-public-booking-checkbox",5),re(),s()(),r(21,"div",17,0),y(23,Ym,2,0,"app-flight-search-results"),v(24,"async"),s()()()()()()()()(),y(25,zm,7,6,"div",18),v(26,"async")),i&2){let e=l();o(),_("steps",S(2,7,e.availableSteps$))("furthestStepUrl",S(3,9,e.furthestStepUrl$)),o(3),_("configuration",e.configuration.pageHeaderMessageConfiguration),o(11),g(e.configuration.whereAreYouFlyingLabel),o(5),_("configuration",e.configuration.publicBookingCheckboxConfiguration),o(3),b(S(24,11,e.isShowSearchResult$)?23:-1),o(2),b(S(26,13,e.hasSelectedJourneys$)?25:-1)}}var dd=(()=>{class i extends He{constructor(e,n,t,a,d,C,F,p,E){super(e,d,C,t,F,n,a),this.store=e,this.log=n,this.activatedRoute=t,this.configuration=a,this.router=d,this.location=C,this.configHelper=F,this.gtmHelper=p,this.typeScriptHelper=E,this.isShowSearchResult$=ue([!1]),this.initialDataLoading$=ue([!1]),this.dataLoading$=ue([!1]),this.showSpinner$=ue([!1]),this.gtmHelper.disable()}ngOnInit(){super.ngOnInit(),this.store.dispatch(new hi(`${pe}/${Xe}`)),this.initialDataLoading$=N([this.store.select(Xr),this.store.select(we),this.store.select(ts),this.store.select(ns),this.store.select(Ee),this.store.select(yi),this.store.select(zr),this.store.select(ks)]).pipe(B(e=>!e.every(n=>!n))),this.dataLoading$=N([this.store.select(ss),this.store.select(os),this.store.select(es)]).pipe(B(e=>!e.every(n=>!n))),this.showSpinner$=N([this.initialDataLoading$,this.dataLoading$]).pipe(B(e=>!e.every(n=>!n))),N([N([this.store.select(te),this.store.select(X)]).pipe(x(()=>this.alive),$(e=>e[0]!==null&&e[1]!==null)),this.store.select(et)]).pipe(x(()=>this.alive)).subscribe(e=>{let n=e[0][0],t=e[0][1],a=e[1];this.configuration.loadConfigSettingsAndI18nMessages(n,t,a,this.log)}),this.availableSteps$=this.store.select(Li),this.furthestStepUrl$=this.store.select(Pi),N([this.store.select(te),this.store.select(X)]).pipe(x(()=>this.alive),$(e=>e[0]!==null&&e[1]!==null)).subscribe(([e,n])=>{let a=new $i(this.log).convertConfigSettingsAndI18nMessages(e,n,this.dataRoute?.configPrefix);this.store.dispatch(new fi(a))}
1),this.isShowSearchResult$=this.store.select(Rn),this.isShowSearchResult$.pipe(x(()=>this.alive),Vt()).subscribe(e=>{e&&this.scrollIntoFareInfo()}),this.poNumber$=this.store.select(dn),this.selectedCompany$=this.store.select(ut)}poNumberChanged(e){this.typeScriptHelper.isNonEmptyString(e)||(e=null),this.store.dispatch(new ui(e))}scrollIntoFareInfo(){setTimeout(()=>{this.searchResultElRef?.nativeElement!=null&&this.searchResultElRef.nativeElement.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},20)}static{this.\u0275fac=function(n){return new(n||i)(h(q),h(H),h(fe),h(oo),h(Z),h(ve),h(ne),h(lt),h(Se))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-booking-flight-search"]],viewQuery:function(n,t){if(n&1&&qe(Km,5),n&2){let a;Ge(a=Oe())&&(t.searchResultElRef=a.first)}},standalone:!1,features:[W([oo]),Ue],decls:4,vars:6,consts:[["searchResult",""],["mainContentComponent",""],[3,"showSpinner"],[1,"sticky-top","bg-white",2,"z-index","1000"],[3,"steps","furthestStepUrl"],[3,"configuration"],["aria-label","agent booking container"],[1,"page-body","container-fluid","bg-light"],[1,"container-lg"],[1,"row"],[1,"col-sm-12"],[1,"col"],[1,"row","mb-1"],[1,"h2"],[1,"row","search-widget","mt-5"],[1,"col-12"],["publicBooking",""],[1,"col-12","mt-5"],[1,"sticky-footer","d-flex","justify-content-end","footer-container","align-items-center","p-3"],[3,"quotationTotal","configuration"],["type","button",1,"btn","btn-outline-primary","rounded-pill","ms-sm-3","me-3",3,"click"],["type","button",1,"btn","btn-primary","rounded-pill",3,"click","disabled"],[3,"openCart","quotationTotal","configuration"]],template:function(n,t){n&1&&(A(0,"app-loading-spinner",2),v(1,"async"),y(2,Xm,27,15),v(3,"async")),n&2&&(_("showSpinner",S(1,2,t.showSpinner$)),o(2),b(S(3,4,t.initialDataLoading$)?-1:2))},dependencies:[ge,vi,bn,Ri,De,Oi,Di,z],styles:["div.sticky-top[_ngcontent-%COMP%]{top:calc(1.625rem + var(--logo-height))!important}@media screen and (max-width:768px){.sticky-top[_ngcontent-%COMP%]{top:calc(1.625rem + var(--logo-height))!important}}"]})}}return i})();var md=(()=>{class i{constructor(e){this.store=e}ngOnInit(){this.store.dispatch(new _i)}ngOnDestroy(){}static{this.\u0275fac=function(n){return new(n||i)(h(q))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-booking"]],standalone:!1,decls:1,vars:0,template:function(n,t){n&1&&A(0,"router-outlet")},dependencies:[Wt],encapsulation:2})}}return i})();var Un=Ce(Re()),jo=Ce(Ia());var ao=(()=>{class i{constructor(){this.recentReservationsTableName="Recent Reservations",this.recentReservationsTableHeaderSurnameLabel="Surname",this.recentReservationsTableHeaderDateLabel="Date",this.recentReservationsTableHeaderPnrLabel="PNR",this.recentReservationsTableHeaderActionsLabel="Actions",this.recentReservationsNoResultMessage="No Reservations have been created today.",this.recentReservationsTableSeeMore="More",this.recentReservationPageSize=5,this.recentReservationsTableDateFormat="MMM d, y",this.recentReservationsTableViewActionLabel="View",this.recentReservationsNoBookingButtonLabel="Make a Booking",this.recentReservationsTableHeaderAgencyLabel="Agency",this.recentReservationsTableAgencyEnabled=!1}loadConfigSettingsAndI18nMessages(e,n,t){let a=new V(t,n,"i18n"),d=new V(t,e,"config"),C=`${xe}.recentReservations`;d.setProperties(this,[["int","recentReservationPageSize",`${C}.pageSize`],["boolean","recentReservationsTableAgencyEnabled",`${C}.agencyColumn.enabled`]]),a.setProperties(this,[["string","recentReservationsTableName",`${C}.tableName`],["string","recentReservationsTableHeaderDateLabel",`${C}.tableHeaderDate.label`],["string","recentReservationsTableHeaderActionsLabel",`${C}.tableHeaderActions.label`],["string","recentReservationsTableHeaderSurnameLabel",`${C}.tableHeaderSurname.label`],["string","recentReservationsTableSeeMore",`${C}.tableHeaderSeeMore.label`],["string","recentReservationsTableHeaderPnrLabel",`${C}.tableHeaderPnr.label`],["string","recentReservationsNoResultMessage",`${C}.noResult.message`],["string","recentReservationsTableDateFormat",`${C}.date.ngDateFormat`],["string","recentReservationsTableViewActionLabel",`${
1C}.view.label`],["string","recentReservationsNoBookingButtonLabel",`${C}.noBookingButton.label`],["string","recentReservationsTableHeaderAgencyLabel",`${C}.tableHeaderAgency.label`]])}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var ro=(()=>{class i extends _e{constructor(){super(),this.reservationSearchEnabled=!0,this.welcomeBackTitle="Welcome back",this.reservationSearchHeaderText="Reservation Search",this.bookAFlightText="Book a flight",this.reservationIdentifier=new Ie,this.lastName=new Ie,this.departureDate=new Ao,this.returnDate=new Ao,this.pageHeaderMessageConfiguration=new Ct,this.dateNgDateFormat="d MMM yyyy",this.timerNgTimeFormat="HH:mm z",this.dateRangePickerLocale=new Bo,this.advanceSearchText="Advance Search",this.searchText="Search",this.localTimeText="Local time",this.publicBookingCheckboxConfiguration=new At,this.agentRecentReservationsConfiguration=new ao,this.prefix="agent.dashboard",this.bookFlightEnabled=!0,this.recentReservationsTableEnabled=!0,this.reservationIdentifier.enabled=!0,this.reservationIdentifier.label="Booking Reference",this.reservationIdentifier.placeholder="Eg: Q5H8X1",this.reservationIdentifier.validation=new Ae,this.reservationIdentifier.validation={required:!1,requiredMessage:"PNR is required",pattern:Ea,patternMessage:"Reservation Number must be 6 characters long."},this.lastName.enabled=!0,this.lastName.label="Last Name",this.lastName.placeholder="Last Name",this.lastName.validation=new Ae,this.lastName.validation={required:!1,requiredMessage:"Last Name is required"},this.departureDate.enabled=!0,this.departureDate.label="Departure Date",this.departureDate.placeholder=this.dateNgDateFormat,this.departureDate.validation=new So,this.departureDate.validation={required:!1,requiredMessage:"Departure Date is required"},this.returnDate.enabled=!0,this.returnDate.label="Return Date",this.returnDate.placeholder=this.dateNgDateFormat,this.returnDate.validation=new So,this.returnDate.validation={required:!1,requiredMessage:"Return Date is required"}}loadConfigSettingsAndI18nMessages(e,n,t,a){let d=new ne,C=this.prefix,F=new V(a,e,"config"),p=new V(a,n,"i18n");super.loadConfigSettingsAndI18nMessages(e,n,t,a,d,"agent.dashboard.flightSearch"),F.setProperties(this,[["boolean","reservationSearchEnabled","agent.leftSideBar.searchReservations.enabled"],["boolean","bookFlightEnabled","agent.leftSideBar.bookFlight.enabled"],["boolean","recentReservationsTableEnabled",`${C}.recentReservationsTable.enabled`]]),p.setProperties(this,[["string","welcomeBackTitle",`${C}.welcomeBack.title`],["string","advanceSearchText",`${C}.advanceSearch.text`],["string","searchText",`${C}.search.text`],["string","dateNgDateFormat",`${C}.date.ngDateFormat`],["string","timerNgTimeFormat",`${C}.timer.ngTimeFormat`],["string","bookAFlightText",`${C}.bookAFlight.text`],["string","localTimeText",`${C}.localTime.text`],["string","reservationSearchHeaderText",`${C}.reservationSearchHeader.text`]]);let E=R=>{F.setProperties(this[R],[["boolean","enabled",`${C}.${R}.enabled`]]),p.setProperties(this[R],[["string","label",`${C}.${R}.label`],["string","placeholder",`${C}.${R}.placeholder`]]),F.setProperties(this[R].validation,[["boolean","required",`${C}.${R}.validation.required`]]),p.setProperties(this[R].validation,[["string","requiredMessage",`${C}.${R}.validation.requiredMessage`]]),F.setProperties(this[R],[["boolean","readonly",`${C}.${R}.readonly`]])};F.setProperties(this.reservationIdentifier.validation,[["string","pattern","res.search.reservationIdentifier.validation.pattern"]]),p.setProperties(this.reservationIdentifier.validation,[["string","patternMessage","res.search.reservationIdentifier.validation.patternMessage"]]),E("reservationIdentifier"),E("lastName"),E("departureDate"),E("returnDate"),this.pageHeaderMessageConfiguration=new Ct,this.pageHeaderMessageConfiguration.loadConfigSettingsAndI18nMessages("page.dashboard",e,n,a),this.dateRangePickerLocale=new Bo(n,a,e),this.publicBookingCheckboxConfiguration=new At,this.publicBookingCheckboxConfiguration.loadConfigSettingsAndI18nMessages(C,e,n,a),this.commonCartConfiguration.loadConfigSettingsAndI18nMessages(e,n,t,a,d,"agent.dashboard.flightSearch"),this.agentRecentReservationsConfiguration.loadConfigSettingsAndI18nMessages(e,n,a)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var fd=Ce(Ia());function ep(i,m){if(i&1&&(r(0,"a",2)(1,"button",3),c(2),s()()),i&2){let e=l();_("routerLink",e.AGENT_BOOKING_FLIGHT_SEARCH),o(2),P(" ",e.noBookingButtonLabel," ")}}var gd=(()=>{class i{constructor(){this.emptyBookingMessage="No Reservations have been created today.",this.noBookingButtonLabel="Make a booking",this.allowMakingBooking=!1,this.AGENT_BOOKING_FLIGHT_SEARCH=`/${Ja}`}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=D({type:i,selectors:[["app-empty-booking"]],inputs:{emptyBookingMessage:"emptyBookingMessage",noBookingButtonLabel:"noBookingButtonLabel",allowMakingBooking:"allowMakingBooking"},decls:4,vars:2,consts:[[1,"empty-container","w-100","d-flex","flex-column","align-items-center","justify-content-center","gap-3","px-3","py-5"],[1,"text-center","fs-16px","fw-semibold","d-flex","flex-column","gap-3","align-items-center"],[3,"routerLink"],[1,"btn","btn-secondary","rounded","fs-14","fw-bold"]],template:function(n,t){n&1&&(r(0,"div",0)(1,"div",1),c(2),y(3,ep,3,2,"a",2),s()()),n&2&&(o(2),P(" ",t.emptyBookingMessage," "),o(),b(t.allowMakingBooking?3:-1))},dependencies:[st],encapsulation:2,changeDetection:0})}}return i})();function ud(i){return{reservationIdentifier:i?.reservationIdentifier??"",lastName:i?.lastName??"",firstName:i?.firstName??"",departureDate:i?.departureDate??"",returnDate:i?.returnDate??"",departureAirport:i?.departureAirport??"",earliestBookingDate:i?.earliestBookingDate??"",latestBookingDate:i?.latestBookingDate??"",localDateRequest:i?.localDateRequest??!1,partialMatch:i?.partialMatch??!1,airlineCode:i?.airlineCode??"",flightNumber:i?.flightNumber??"",doesSearchDepartures:i?.doesSearchDepartures??!1,pageIndex:i?.pageIndex??1,isRecentReservationSearch:i?.isRecentReservationSearch??!1,parentReservationKey:i?.parentReservationKey??null}}var hd=i=>[i],tp=(i,m)=>m.key;function np(i,m){if(i&1){let e=L();r(0,"a",4),I("click",function(){u(e);let t=l();return f(t.seeMoreRecentReservationsBooked())}),c(1),s()}if(i&2){let e=l();_("routerLink",J(2,hd,e.AGENT_RESERVATIONS_SEARCH)),o(),P(" ",e.agentRecentReservationsConfiguration.recentReservationsTableSeeMore," ")}}function ip(i,m){i&1&&A(0,"app-ias-loading-placeholder")}function op(i,m){if(i&1&&(r(0,"div",5),A(1,"app-empty-booking",7),s()),i&2){let e=l(2);o(),_("emptyBookingMessage",e.agentRecentReservationsConfiguration.recentReservationsNoResultMessage)("allowMakingBooking",e.bookFlightEnabled)("noBookingButtonLabel",e.agentRecentReservationsConfiguration.recentReservationsNoBookingButtonLabel)}}function ap(i,m){if(i&1&&(r(0,"th",10),c(1),s()),i&2){let e=l(3);o(),P(" ",e.agentRecentReservationsConfiguration.recentReservationsTableHeaderAgencyLabel," ")}}function rp(i,m){if(i&1&&(r(0,"td",10),c(1),s()),i&2){let e=l().$implicit;o(),g(e.bookingInformation.agency==null?null:e.bookingInformation.agency.name)}}function sp(i,m){if(i&1&&(r(0,"a",13),c(1),s()),i&2){let e=l().$implicit,n=l(3);_("routerLink",n.getRouterLinkToResDetail(e))("queryParams",n.getResDetailQueryParams(e)),o(),P(" ",n.agentRecentReservationsConfiguration.recentReservationsTableViewActionLabel," ")}}function lp(i,m){if(i&1&&(r(0,"tr",11)(1,"td",10),c(2),v(3,"date"),s(),r(4,"td",10),c(5),v(6,"uppercase"),s(),r(7,"td",10),c(8),s(),y(9,rp,2,1,"td",10),r(10,"td",10),ce(11,sp,2,3,"a",12),s()()),i&2){let e=m.$implicit,n=l(3);o(2),P(" ",Je(3,5,e.bookingInformation.creation.time,n.agentRecentReservationsConfiguration.recentReservationsTableDateFormat)," "),o(3),g(S(6,8,e.locator)),o(3),g(e.reservationSummary.passenger.reservationProfile.lastName),o(),b(n.agentRecentReservationsConfiguration.recentReservationsTableAgencyEnabled?9:-1),o(2),_("hasPermission",J(10,hd,n.viewResPermission))}}function cp(i,m){if(i&1&&(r(0,"div",6)(1,"table",8)(2,"thead")(3,"tr",9)(4,"th",10),c(5),s(),r(6,"th",10),c(7),s(),r(8,"th",10),c(9),s(),y(10,ap,2,1,"th",10),r(11,"th",10),c(12),s()()(),r(13,"tbody"),K(14,lp,12,12,"tr",11,tp),v(16,"async"),s()()()),i&2){let e=l(2);o(5),g(e.agentRecentReservationsConfiguration.recentReservationsTableHeaderDateLabel),o(2),g(e.agentRecentReservationsConfiguration.recentReservationsTableHeaderPnrLabel),o(2),g(e.agentRecentReservationsConfiguration.recentReservationsTableHeaderSurnameLabel),o(),b(e.agentRecentReservationsConfiguration.recentReservationsTableAgencyEnabled?10:-1),o(2),g(e.agentRecentReservationsConfiguration.recentReservationsTableHeaderActionsLabel),o(2),Y(S(16,5,e.reservations$))}}function dp(i,m){if(i&1&&(y(0,op,2,3,"div",5),v(1,"async"),Lt(2,cp,17,7,"div",6)),i&2){let e,n=l();b(((e=S(1,1,n.reservations$))==null?null:e.length)<=0?0:2)}}var so=(()=>{class i{constructor(e,n,t){this.store=e,this.reservationsHelper=n,this.reservationIdentifierPipe=t,this._alive=!0,this.dateNgDateFormat=wn,this.dataLoading$=N([this.store.select(hl)]).pipe(x(()=>this._alive),B(a=>!a.every(d=>!d))),this.AGENT_RESERVATIONS_SEARCH=`/${Xt}`,this.viewResPermission=er.RESERVATIONS_WEB_EDIT_RES_ACCESS,this.setIntialSearchCriteria()}ngOnInit(){this.setIntialSearchCriteria(),this.getRecentReservation(),this.reservations$=this.store.select(_l).pipe(x(()=>this._alive),B(e=>e.slice(0,this.agentRecentReservationsConfiguration.recentReservationPageSize)))}setIntialSearchCriteria(){let e=(0,fd.default)().format(this.dateNgDateFormat);this.initialSearchData=ud({earliestBookingDate:e,latestBookingDate:e})}getRecentReservation(){this.store.dispatch(new ri(this.initialSearchData))}getRouterLinkToResDetail(e){return[`/${xe}/${Fn}`.replace(`:${Ro}`,encodeURIComponent(this.reservationIdentifierPipe.transform(e)))]}getResDetailQueryParams(e){return{lastName:this.reservationsHelper.getReservationOwnerLastName(e),firstName:this.reservationsHelper.getReservationOwnerFirstName(e)}}seeMoreRecentReservationsBooked(){this.initialSearchData=U(T({},this.initialSearchData),{isRecentReservationSearch:!0}),this.store.dispatch(new si(this.initialSearchData))}ngOnDestroy(){this._alive=!1}static{this.\u0275fac=function(n){return new(n||i)(h(q),h(Kn),h(Jn))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-recent-reservation"]],inputs:{agentRecentReservationsConfiguration:"agentRecentReservationsConfiguration",bookFlightEnabled:"bookFlightEnabled"},features:[W([ao])],decls:9,vars:7,consts:[[1,"pt-3","table-container","shadow","rounded","table-responsive","bg-white"],[1,"w-100","d-flex","justify-content-between","align-items-center","pb-3","px-4","text-primary"],[1,"fs-24","fw-bold","flex-grow-1"],[1,"fs-14",3,"routerLink"],[1,"fs-14",3,"click","routerLink"],[1,"p-4"],[1,"px-4"],[3,"emptyBookingMessage","allowMakingBooking","noBookingButtonLabel"],[1,"table","table-striped","mb-0"],[1,"px-3","fs-16","fw-bold"],[1,"text-center","py-3"],[1,"align-middle","fs-16"],[3,"routerLink","queryParams",4,"hasPermission"],[3,"routerLink","queryParams"]],template:function(n,t){n&1&&(r(0,"div",0)(1,"div",1)(2,"div",2),c(3),s(),y(4,np,2,4,"a",3),v(5,"async"),s(),y(6,ip,1,0,"app-ias-loading-placeholder"),v(7,"async"),Lt(8,dp,3,3),s()),n&2&&(o(3),g(t.agentRecentReservationsConfiguration.recentReservationsTableName),o(),b(S(5,3,t.reservations$).length>0?4:-1),o(2),b(S(7,5,t.dataLoading$)?6:8))},dependencies:[Vi,yt,st,gd,qi,bt,z,ma,da],encapsulation:2})}}return i})();var pp=["searchResult"],gp=()=>({controlName:"reservationIdentifier"}),up=()=>({controlName:"lastName"});function fp(i,m){if(i&1&&(r(0,"div",15),c(1),s(),r(2,"div",16),c(3),v(4,"date"),s()),i&2){let e=l();o(),P(" ",e.configuration.localTimeText," "),o(2),g(Je(4,2,m,e.configuration.timerNgTimeFormat))}}function hp(i,m){i&1&&xn(0)}function _p(i,m){i&1&&xn(0)}function Cp(i,m){if(i&1){let e=L();r(0,"div",23)(1,"div",29)(2,"app-date-range-picker",30),I("dateChanged",function(t){u(e);let a=l(2);return f(a.onDepartureDateSelected(t))}),s()()()}if(i&2){let e=l(2);o(2),_("isSingleDatePicker",!0)("fromDateLabel",e.configuration.departureDate.label)("clearable",!0)("fromDatePlaceholder",e.configuration.departureDate.placeholder)("fromDateAsMoment",e.departureDate)("fromNgDateFormat",e.configuration.dateNgDateFormat)("locale",e.configuration.dateRangePickerLocale)("showAllDates",!0)("disabled",e.configuration.departureDate.readonly)}}function yp(i,m){if(i&1){let e=L();
1r(0,"div",24)(1,"div",29)(2,"app-date-range-picker",31),I("dateChanged",function(t){u(e);let a=l(2);return f(a.onReturnDateSelected(t))}),s()()()}if(i&2){let e=l(2);o(2),_("isSingleDatePicker",!0)("fromDateLabel",e.configuration.returnDate.label)("clearable",!0)("fromDatePlaceholder",e.configuration.returnDate.placeholder)("minFromDate",e.departureDate)("fromNgDateFormat",e.configuration.dateNgDateFormat)("locale",e.configuration.dateRangePickerLocale)("showAllDates",!0)("disabled",e.configuration.returnDate.readonly)}}function bp(i,m){if(i&1&&A(0,"app-agent-recent-reservation",28),i&2){let e=l(2);_("bookFlightEnabled",e.configuration.bookFlightEnabled)("agentRecentReservationsConfiguration",e.configuration.agentRecentReservationsConfiguration)}}function vp(i,m){if(i&1){let e=L();r(0,"div",12)(1,"div",17)(2,"div",18)(3,"div",19),c(4),s(),r(5,"form")(6,"div",20)(7,"div",21),ce(8,hp,1,0,"ng-container",22),s(),r(9,"div",21),ce(10,_p,1,0,"ng-container",22),s()(),r(11,"div",20)(12,"div",21),y(13,Cp,3,9,"div",23),s(),r(14,"div",21),y(15,yp,3,9,"div",24),s()(),r(16,"div",25)(17,"button",26),I("click",function(){u(e);let t=l();return f(t.onSubmit())}),c(18),s(),r(19,"a",27),c(20),s()()()(),y(21,bp,1,2,"app-agent-recent-reservation",28),s()()}if(i&2){let e=l(),n=Gn(17);o(4),g(e.configuration.reservationSearchHeaderText),o(4),_("ngTemplateOutlet",n)("ngTemplateOutletContext",_o(12,gp)),o(2),_("ngTemplateOutlet",n)("ngTemplateOutletContext",_o(13,up)),o(3),b(e.configuration.departureDate.enabled?13:-1),o(2),b(e.configuration.returnDate.enabled?15:-1),o(2),_("disabled",!e.hasSearchCriteria),o(),P(" ",e.configuration.searchText," "),o(),_("routerLink",e.AGENT_RESERVATIONS_SEARCH),o(),g(e.configuration.advanceSearchText),o(),b(e.configuration.reservationSearchEnabled&&e.configuration.recentReservationsTableEnabled?21:-1)}}function Sp(i,m){i&1&&A(0,"app-flight-search-results",null,2)}function Ap(i,m){if(i&1&&(r(0,"div",13)(1,"div",32)(2,"div",33),c(3),s(),r(4,"app-flight-search"),ae(5,34),A(6,"app-public-booking-checkbox",3),re(),s(),r(7,"div",35,1),y(9,Sp,2,0,"app-flight-search-results"),v(10,"async"),s()()()),i&2){let e=l();o(3),g(e.configuration.bookAFlightText),o(3),_("configuration",e.configuration.publicBookingCheckboxConfiguration),o(3),b(S(10,3,e.isShowSearchResult$)?9:-1)}}function Ip(i,m){if(i&1){let e=L();r(0,"app-common-cart",39),I("openCart",function(t){u(e);let a=l(2);return f(a.onOpenCart(t))}),s()}if(i&2){let e=l(2);_("quotationTotal",m)("configuration",e.configuration.commonCartConfiguration)}}function xp(i,m){if(i&1){let e=L();r(0,"div",14),y(1,Ip,1,2,"app-common-cart",36),v(2,"async"),r(3,"button",37),I("click",function(){u(e);let t=l();return f(t.back())}),c(4),s(),r(5,"button",38),v(6,"async"),I("click",function(){u(e);let t=l();return f(t.nextPage())}),c(7),s()()}if(i&2){let e,n=l();o(),b((e=S(2,4,n.quotationTotal$))?1:-1,e),o(3),P(" ",n.configuration.backButtonLabel," "),o(),_("disabled",n.selectedFareOption===null||!S(6,6,n.hasValidQuotationToGoToNextPage$)),o(2),P(" ",n.configuration.continueButtonLabel," ")}}function wp(i,m){if(i&1&&c(0),i&2){let e=m.$implicit;P(" ",e," ")}}function Ep(i,m){if(i&1&&K(0,wp,1,1,null,null,oe),i&2){let e=l(2).controlName,n=l();Y(n.getFieldValidationErrors(e))}}function Lp(i,m){if(i&1&&(r(0,"div",40)(1,"label",41),c(2),s(),A(3,"input",42),y(4,Ep,2,0),s()),i&2){let e=l().controlName,n=l();_("formGroup",n.searchFormGroup),o(),Q("ibe-data-required",n.configuration[e].validation.required),_("for",e),o(),g(n.configuration[e].label),o(),Q("is-invalid",n.isFieldInValid(e)),_("id",e)("name",e)("formControlName",e)("placeholder",n.configuration[e].placeholder),o(),b(n.isFieldInValid(e)?4:-1)}}function Pp(i,m){if(i&1&&y(0,Lp,5,12,"div",40),i&2){let e=m.controlName,n=l();b(n.configuration[e].enabled==!0?0:-1)}}var _d=(()=>{class i extends He{constructor(e,n,t,a,d,C,F,p,E,R){super(n,C,p,F,E,t,e),this.configuration=e,this.store=n,this.log=t,this.fb=a,this.formElementHelper=d,this.router=C,this.activatedRoute=F,this.location=p,this.configHelper=E,this.typeScriptHelper=R,this.time$=zo(0,1e3).pipe(x(()=>this.alive),B(()=>new Date)),this.formSubmitAttempt=!1,this.AGENT_RESERVATIONS_SEARCH=`/${Xt}`,this.AGENT_PASSENGERS_URL=`/${Ga}`,this.isRoundTrip$=this.store.select(Ln).pipe(B(k=>k===cn.Return)),this.isMultiCityTrip$=this.store.select(Ln).pipe(B(k=>k===cn.MultiCity)),this.hasValidQuotationToGoToNextPage$=N([this.store.select(Tn),this.isRoundTrip$,this.isMultiCityTrip$,this.store.select(gs),this.store.select(ps),this.store.select(cs)]).pipe(B(([k,M,xt,In,wt,le])=>{let Et=()=>!M&&!xt,Td=()=>M&&In,Fd=()=>xt&&wt===le.length-1;return Et()||Td()||Fd()?(0,Un.isObject)(k):!0}),Yo(Wo)),this.searchFormGroup=this.fb.group({reservationIdentifier:new w,lastName:new w,departureDate:new w,returnDate:new w})}ngOnInit(){super.ngOnInit(),this.store.select(mn).pipe(Ne()).subscribe(e=>{(0,Un.isObject)(e)&&(0,Un.isString)(e.locator)&&this.store.dispatch(new wo)}),this.configSettingsAndI18nMessages$=N([this.store.select(te),this.store.select(X)]),N([this.configSettingsAndI18nMessages$,this.store.select(et)]).pipe(x(()=>this.alive),$(e=>e[0][0]!==null&&e[0][1]!==null&&e[1]!==null)).subscribe(e=>{let n=e[0][0],t=e[0][1],a=e[1];this.configuration.loadConfigSettingsAndI18nMessages(n,t,a,this.log),this.updateFormValidationRules(this.configuration)}
1),this.isShowSearchResult$=this.store.select(Rn),this.store.select(Rn).pipe(x(()=>this.alive),Vt()).subscribe(e=>{e?this.scrollIntoFareInfo():this.store.dispatch(new wo)}),this.poNumber$=this.store.select(dn),this.selectedCompany$=this.store.select(ut),this.store.select(ul).pipe(x(()=>this.alive)).subscribe(e=>{e&&this.router.navigate([`/${ni}`])})}scrollIntoFareInfo(){setTimeout(()=>{this.searchResultElRef?.nativeElement!=null&&this.searchResultElRef.nativeElement.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},20)}isFieldInValid(e){return this.formElementHelper.isFieldInValid(e,this.searchFormGroup,this.formSubmitAttempt)}getFieldValidationErrors(e){return this.formElementHelper.getFieldValidationErrors(e,this.searchFormGroup,this.configuration[e].validation)}get departureDateField(){return this.searchFormGroup.get("departureDate")}get returnDateField(){return this.searchFormGroup.get("returnDate")}get departureDate(){return(0,jo.default)(this.departureDateField.value)}get returnDate(){return(0,jo.default)(this.returnDateField.value)}onDepartureDateSelected(e){this.searchFormGroup.get("departureDate").setValue(e?.fromDate?e?.fromDate?.format(wn):null)}onReturnDateSelected(e){this.searchFormGroup.get("returnDate").setValue(e?.fromDate?e?.fromDate?.format(wn):null)}get reservationIdentifierField(){return this.searchFormGroup.get("reservationIdentifier")}get lastNameField(){return this.searchFormGroup.get("lastName")}onSubmit(){if(this.formSubmitAttempt=!0,this.searchFormGroup.valid){let e={reservationIdentifier:this.reservationIdentifierField.value,lastName:this.lastNameField.value,firstName:"",departureDate:this.departureDateField.value,returnDate:this.returnDateField.value,departureAirport:"",earliestBookingDate:"",latestBookingDate:"",partialMatch:!1,localDateRequest:!1,airlineCode:"",flightNumber:"",doesSearchDepartures:!1,pageIndex:1};this.store.dispatch(new si(e)),this.store.dispatch(new ri(e)),this.router.navigateByUrl(this.AGENT_RESERVATIONS_SEARCH)}}get hasSearchCriteria(){return this.departureDateField.value&&!this.returnDateField.value||!this.departureDateField.value&&this.returnDateField.value?!1:!!this.reservationIdentifierField.value||!!this.lastNameField.value||!!this.departureDateField.value||!!this.returnDateField.value}poNumberChanged(e){this.typeScriptHelper.isNonEmptyString(e)||(e=null),this.store.dispatch(new ui(e))}ngOnDestroy(){super.ngOnDestroy()}updateFormValidationRules(e){this.reservationIdentifierField.setValidators(this.formElementHelper.createValidators(e.reservationIdentifier)),this.lastNameField.setValidators(this.formElementHelper.createValidators(e.lastName)),this.departureDateField.setValidators(this.formElementHelper.createValidators(e.departureDate)),this.returnDateField.setValidators(this.formElementHelper.createValidators(e.returnDate)),this.searchFormGroup.updateValueAndValidity({onlySelf:!0})}static{this.\u0275fac=function(n){return new(n||i)(h(ro),h(q),h(H),h(Ye),h($e),h(Z),h(fe),h(ve),h(ne),h(Se))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-dashboard"]],viewQuery:function(n,t){if(n&1&&qe(pp,5),n&2){let a;Ge(a=Oe())&&(t.searchResultElRef=a.first)}},standalone:!1,features:[W([ro]),Ue],decls:18,vars:10,consts:[["textFieldTemplate",""],["searchResult",""],["mainContentComponent",""],[3,"configuration"],[1,"page-body","mt-md-0","container-fluid","overflow-x-hidden"],[1,"container-lg"],[1,"row","welcome-container","px-4"],[1,"w-100"],[1,"col-12","d-flex","text-white","align-items-end","justify-content-between","flex-wrap"],[1,"h2","mb-4"],[1,"terminal-icon","ms-3"],[1,"d-flex","flex-column","mb-4"],[1,"px-4"],[1,"row","mt-5","mb-3"],[1,"sticky-footer","d-flex","justify-content-end","footer-container","align-items-center","p-3"],[1,"col-12","text-white","pe-5"],[1,"h2"],[1,"row","mt-4","mb-3","gap-xl-0","gap-4"],[1,"col-12","col-xl-6","order-xl-1"],[1,"col-12","h2","fs-24","pt-4","text-primary"],[1,"row"],[1,"col-12","col-md-6"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"w-100","mb-3","mx-0"],[1,"w-100","mx-0"],[1,"row","d-flex","align-items-center","mx-0","gx-3"],["type","submit",1,"btn","btn-secondary","rounded-pill","text-nowrap","col-12","col-sm-5",3,"click","disabled"],[1,"pointer","text-secondary","col-12","col-sm-5","col-lg-3","text-nowrap","text-center",3,"routerLink"],[1,"col-12","col-xl-6",3,"bookFlightEnabled","agentRecentReservationsConfiguration"],[1,"form-group","w-100"],[3,"dateChanged","isSingleDatePicker","fromDateLabel","clearable","fromDatePlaceholder","fromDateAsMoment","fromNgDateFormat","locale","showAllDates","disabled"],[3,"dateChanged","isSingleDatePicker","fromDateLabel","clearable","fromDatePlaceholder","minFromDate","fromNgDateFormat","locale","showAllDates","disabled"],[1,"col-12","border","pt-5","px-5","pb-0","rounded"],[1,"h2","text-primary"],["publicBo
1oking",""],[1,"mt-5"],[3,"quotationTotal","configuration"],["type","button",1,"btn","btn-outline-primary","rounded-pill","ms-sm-3","me-3",3,"click"],["type","button",1,"btn","btn-primary","rounded-pill",3,"click","disabled"],[3,"openCart","quotationTotal","configuration"],[1,"form-group",3,"formGroup"],[1,"fw-bold","text-nowrap",3,"for"],["type","text","maxlength","255",1,"form-control",3,"id","name","formControlName","placeholder"]],template:function(n,t){if(n&1&&(A(0,"app-page-header-message",3),r(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"div",8)(6,"div",9),c(7),A(8,"div",10),s(),r(9,"div",11),y(10,fp,5,5),v(11,"async"),s()()()(),y(12,vp,22,14,"div",12),y(13,Ap,11,5,"div",13),s()(),y(14,xp,8,8,"div",14),v(15,"async"),ce(16,Pp,1,1,"ng-template",null,0,de)),n&2){let a;_("configuration",t.configuration.pageHeaderMessageConfiguration),o(7),P(" ",t.configuration.welcomeBackTitle," "),o(3),b((a=S(11,6,t.time$))?10:-1,a),o(2),b(t.configuration.reservationSearchEnabled?12:-1),o(),b(t.configuration.bookFlightEnabled?13:-1),o(),b(S(15,8,t.hasSelectedJourneys$)?14:-1)}},dependencies:[On,st,qt,je,Qe,We,fa,ua,nc,bn,Ri,De,Ke,Qt,Oi,Di,so,z,zt],styles:["[_nghost-%COMP%] .welcome-container[_ngcontent-%COMP%] .w-100[_ngcontent-%COMP%]{margin-top:140px}[_nghost-%COMP%] .welcome-container[_ngcontent-%COMP%] .terminal-icon[_ngcontent-%COMP%]{height:34px;width:14px;background-color:#fff;float:right;-webkit-animation:_ngcontent-%COMP%_blink .8s infinite}@keyframes _ngcontent-%COMP%_blink{0%{background-color:transparent}50%{background-color:var(--lightest)}to{background-color:transparent}}@media screen and (max-width:767px){.page-body[_ngcontent-%COMP%] .container-lg[_ngcontent-%COMP%]{margin-top:3rem!important}}"]})}}return i})();var Vn=Ce(Re());var co=(()=>{class i{constructor(){this.agentSignUpManagementLabel="Agent Sign Up Management",this.emptyViewLabel="There is no request.",this.pageSize=10,this.actionsLabel="Actions",this.requestAtLabel="Request at",this.expiryDateLabel="Expiry Date",this.usernameLabel="User name",this.agencyTypeLabel="Agency type",this.nameLabel="Agency Name",this.emailLabel="Email",this.phoneNumberLabel="Phone Number",this.approveLabel="Approve",this.rejectLabel="Reject",this.ngDateFormat="dd/MM/yyyy HH:mm",this.approvePendingAgentSuccessLabel="Approve pending agent successfully!",this.approvePendingAgentFailedLabel="Approve pending agent failed!",this.rejectPendingAgentSuccessLabel="Reject pending agent successfully!",this.rejectPendingAgentFailedLabel="Reject pending agent failed!",this.closeButton="Close",this.informationLabel="Information",this.contactInformationLabel="Contact Information",this.contactNameLabel="Contact Name"}loadConfigSettingsAndI18nMessages(e,n,t){let a="agent.agentSignUpManagement",d=new V(t,e,"config");new V(t,n,"i18n").setProperties(this,[["string","agentSignUpManagementLabel",`${a}.label`],["string","emptyViewLabel",`${a}.emptyView.label`],["string","actionsLabel",`${a}.actions.label`],["string","requestAtLabel",`${a}.requestAt.label`],["string","expiryDateLabel",`${a}.expiryDate.label`],["string","usernameLabel",`${a}.username.label`],["string","agencyTypeLabel",`${a}.agencyType.label`],["string","nameLabel",`${a}.name.label`],["string","emailLabel",`${a}.email.label`],["string","phoneNumberLabel",`${a}.phoneNumber.label`],["string","approveLabel",`${a}.approve.label`],["string","rejectLabel",`${a}.reject.label`],["string","ngDateFormat",`${a}.ngDateFormat`],["string","approvePendingAgentSuccessLabel",`${a}.approvePendingAgentSuccess.label`],["string","approvePendingAgentFailedLabel",`${a}.approvePendingAgentFailed.label`],["string","rejectPendingAgentSuccessLabel",`${a}.rejectPendingAgentSuccess.label`],["string","rejectPendingAgentFailedLabel",`${a}.rejectPendingAgentFailed.label`],["string","closeButton","closeButton.text"],["string","informationLabel",`${a}.information.label`],["string","contactInformationLabel",`${a}.contactInformation.label`],["string","contactNameLabel",`${a}.contactName.label`]]),d.setProperties(this,[["int","pageSize",`${a}.pageSize`]])}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var Fp=["actionResultTemplate"];function Rp(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=l().$implicit,n=l(2);o(),Gt("",n.configuration.contactNameLabel,": ",e.agentData.contactInformation.name)}}function Mp(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=l().$implicit,n=l(2);o(),Gt("",n.configuration.emailLabel,": ",e.agentData.contactInformation.email)}}function kp(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=l().$implicit,n=l(2);o(),Gt("",n.configuration.phoneNumberLabel,": ",e.agentData.contactInformation.phoneNumber)}}function Np(i,m){if(i&1){let e=L();r(0,"tr")(1,"td"),c(2),v(3,"date"),s(),r(4,"td"),c(5),s(),r(6,"td",13),c(7),s(),r(8,"td"),c(9),s(),r(10,"td",14)(11,"div"),y(12,Rp,2,2,"div"),y(13,Mp,2,2,"div"),y(14,kp,2,2,"div"),s()(),r(15,"td"),c(16),v(17,"date"),s(),r(18,"td")(19,"button",15),I("click",function(){let t=u(e).$implicit,a=l(2);return f(a.approve(t))}),c(20),s()(),r(21,"td")(22,"button",16),I("click",function(){let t=u(e).$implicit,a=l(2);return f(a.reject(t))}),c(23),s()()()}if(i&2){let e=m.$implicit,n=l(2);o(2),g(Je(3,10,e.requestedAt,n.configuration.ngDateFormat)),o(3),g(e.agentData.name),o(2),g(e.agentData.userLogonName),o(2),g(e.agentData.agentProfile.agencyType.name),o(3),b(e.agentData.contactInformation!=null&&e.agentData.contactInformation.name?12:-1),o(),b(e.agentData.contactInformation!=null&&e.agentData.contactInformation.email?13:-1),o(),b(e.agentData.contactInformation!=null&&e.agentData.contactInformation.phoneNumber?14:-1),o(2),g(Je(17,13,e.expiry,n.configuration.ngDateFormat)),o(4),g(n.configuration.approveLabel),o(3),P(" ",n.configuration.rejectLabel," ")}}function Up(i,m){if(i&1){let e=L();r(0,"div",12)(1,"ngb-pagination",17),ra("pageChange",function(t){u(e);let a=l(2);return aa(a.page,t)||(a.page=t),f(t)}),I("pageChange",function(){u(e);let t=l(2);return f(t.refreshReportData())}),s()()}if(i&2){let e=l(2);
1o(),_("collectionSize",e.pendingAgents.length),oa("page",e.page),_("pageSize",e.configuration.pageSize)("maxSize",5)("boundaryLinks",!0)}}function Vp(i,m){if(i&1&&(r(0,"div",5)(1,"div",9)(2,"table",10)(3,"thead")(4,"tr")(5,"th"),c(6),s(),r(7,"th"),c(8),s(),r(9,"th"),c(10),s(),r(11,"th"),c(12),s(),r(13,"th"),c(14),s(),r(15,"th"),c(16),s(),r(17,"th",11),c(18),s()()(),r(19,"tbody"),K(20,Np,24,16,"tr",null,ia().trackByKeyFn,!0),s()()(),y(22,Up,2,5,"div",12),s()),i&2){let e=l();o(6),g(e.configuration.requestAtLabel),o(2),g(e.configuration.nameLabel),o(2),g(e.configuration.usernameLabel),o(2),g(e.configuration.agencyTypeLabel),o(2),g(e.configuration.contactInformationLabel),o(2),g(e.configuration.expiryDateLabel),o(2),g(e.configuration.actionsLabel),o(2),Y(e.results),o(2),b(e.pendingAgents.length>e.configuration.pageSize?22:-1)}}function Bp(i,m){if(i&1&&(r(0,"div",8)(1,"div",18),A(2,"i",19),s(),r(3,"p",20),c(4),s()()),i&2){let e=l();o(4),P(" ",e.configuration.emptyViewLabel," ")}}function $p(i,m){if(i&1){let e=L();r(0,"div",21)(1,"h4",22),c(2),s()(),r(3,"div",23),A(4,"div",24),v(5,"safeHtml"),s(),r(6,"div",25)(7,"button",26),I("click",function(){let t=u(e).$implicit;return f(t.close())}),c(8),s()()}if(i&2){let e=l();o(2),g(e.configuration.informationLabel),o(2),_("innerHTML",S(5,3,e.alertMessage),$t),o(4),g(e.configuration.closeButton)}}var yd=(()=>{class i{constructor(e,n,t,a){this.configuration=e,this.store=n,this.log=t,this.modalService=a,this.alive=!0,this.dataLoading$=ue([!1]),this.pendingAgents=[],this.results=[],this.page=1,this.store.dispatch(new Lo)}ngOnInit(){this.dataLoading$=N([this.store.select(we),this.store.select(Ee),this.store.select(vl),this.store.select(Sl),this.store.select(Al)]).pipe(B(e=>!e.every(n=>!n))),N([this.store.select(te),this.store.select(X)]).pipe(x(()=>this.alive),$(([e,n])=>(0,Vn.isObject)(e)&&(0,Vn.isObject)(n))).subscribe(e=>{let[n,t]=e;this.configuration.loadConfigSettingsAndI18nMessages(n,t,this.log)}),this.store.select(Il).pipe(x(()=>this.alive)).subscribe(e=>{this.pendingAgents=e,this.refreshReportData()}),this.store.select(xl).pipe(x(()=>this.alive)).subscribe(e=>{switch(e){case tn.Init:this.alertMessage=null;break;case tn.ApproveAgentSuccess:this.alertMessage=this.configuration.approvePendingAgentSuccessLabel;break;case tn.ApproveAgentFailed:this.alertMessage=this.configuration.approvePendingAgentFailedLabel;break;case tn.RejectAgentSuccess:this.alertMessage=this.configuration.rejectPendingAgentSuccessLabel;break;case tn.RejectAgentFailed:this.alertMessage=this.configuration.rejectPendingAgentFailedLabel;break;default:this.alertMessage=null;break}(0,Vn.isString)(this.alertMessage)&&this.modalService.open(this.actionResultTemplate,{centered:!0}).result.then(()=>{this.store.dispatch(new Lo)})})}approve(e){this.store.dispatch(new hr(e.agentData.userLogonName))}reject(e){this.store.dispatch(new _r(e.agentData.userLogonName))}trackByKeyFn(e,n){return n.agentData.userLogonName}refreshReportData(){this.results=this.pendingAgents?this.pendingAgents.map((e,n)=>T({id:n+1},e)).slice((this.page-1)*this.configuration.pageSize,(this.page-1)*this.configuration.pageSize+this.configuration.pageSize):[]}ngOnDestroy(){this.alive=!1}static{this.\u0275fac=function(n){return new(n||i)(h(co),h(q),h(H),h(Be))}}static{this.\u0275cmp=D({type:i,selectors:[["app-agent-sign-up-management"]],viewQuery:function(n,t){if(n&1&&qe(Fp,5),n&2){let a;Ge(a=Oe())&&(t.actionResultTemplate=a.first)}},standalone:!1,features:[W([co])],decls:15,vars:5,consts:[["actionResultTemplate",""],[3,"showSpinner"],[1,"page-body","container-fluid"],[1,"container-lg"],[1,"row"],[1,"col-12"],[1,"h2","text-primary"],[1,"row","mt-3"],[1,"empty-view","border-dashed","text-medium","d-flex","justify-content-center","align-items-center","flex-column","w-100",2,"min-height","200px"],[1,"p-3","table-container","shadow","table-borderless","table-responsive"],[1,"table","table-striped"],["colspan","2",1,"text-center"],[1,"d-flex","justify-content-center","mt-5"],[1,"fw-bold"],[1,"fs-14"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-outline-primary",3,"click"],[3,"pageChange","collectionSize","page","pageSize","maxSize","boundaryLinks"],[1,"d-flex","justify-content-center"],[1,"iasi","ic-hide","ic-lightbulb-on-bf"],["aria-disabled","true"],[1,"modal-header"],[1,"modal-title"],[1,"modal-body"],[3,"innerHTML"],[1,"modal-footer"],["type","button","ngbAutofocus","",1,"btn","btn-outline-primary",3,"click"]],template:function(n,t){n&1&&(A(0,"app-loading-spinner",1),v(1,"async"),r(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",4)(7,"div",6),c(8),s()()(),r(9,"div",5)(10,"div",7),y(11,Vp,23,8,"div",5)(12,Bp,5,1,"div",8),s()()()()(),ce(13,$p,9,5,"ng-template",null,0,de)),n&2&&(_("showSpinner",S(1,3,t.dataLoading$)),o(8),g(t.configuration.agentSignUpManagementLabel),o(3),b(t.pendingAgents.length?11:12))},dependencies:[Sa,ge,z,zt,Yt],styles:["td[_ngcontent-%COMP%]{vertical-align:middle}"]})}}return i})();var Qo=(()=>{class i{constructor(e){this.typeScriptHelper=e,this.oldPassword=new Ie,this.newPassword=new pn,this.changePasswordLabel="Change Password",this.updateButtonText="Update",this.inValidOldPasswordMessage="Old password is not val
1id.",this.inValidLoginMessage="Failed to login using the new password.",this.consecutiveFailedAttemptsExceededText="Too many consecutive failed logins. Please try again in 5 minutes.",this.passwordChangeSuccessMessage="Password changed successfully",this.unexpectedAuthenticationErrorMessage="An unexpected login error occurred. Please try again or contact customer support.",this.httpErrorGenericMessage="Woops! some thing went wrong. Try again after some time.",this.oldPassword.label="Old Password",this.oldPassword.placeholder="Old Password",this.oldPassword.validation=new Ae,this.oldPassword.validation={required:!0,requiredMessage:"Old Password is required"}}loadConfigSettingsAndI18nMessages(e,n,t){let a="agent",d=new V(t,n,"i18n");this.newPassword.loadConfigSettingsAndI18nMessages(`${a}.changePassword.password`,e,n,t),d.setProperties(this,[["string","changePasswordLabel",`${a}.changePassword.changePassword.label`],["string","updateButtonText",`${a}.changePassword.updateButton.text`],["string","inValidOldPasswordMessage",`${a}.changePassword.inValidOldPasswordMessage`],["string","inValidLoginMessage",`${a}.changePassword.inValidLoginMessage`],["string","passwordChangeSuccessMessage",`${a}.changePassword.passwordChangeSuccessMessage`],["string","consecutiveFailedAttemptsExceededText",`${a}.changePassword.consecutiveFailedAttemptsExceeded.text`],["string","unexpectedAuthenticationErrorMessage",`${a}.changePassword.unexpectedAuthenticationErrorMessage.text`]]),this.oldPassword.label=n[`${a}.changePassword.oldPassword.label`],this.oldPassword.placeholder=n[`${a}.changePassword.oldPassword.placeholder`],this.oldPassword.validation={required:this.typeScriptHelper.toBoolean(e[`${a}.changePassword.oldPassword.validation.required`]),requiredMessage:n[`${a}.changePassword.oldPassword.validation.requiredMessage`]},this.httpErrorGenericMessage=n["http.error.genericMessage"]}static{this.\u0275fac=function(n){return new(n||i)(ie(Se))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();function Dp(i,m){i&1&&(r(0,"div",1)(1,"div",3)(2,"div",4),A(3,"app-ias-loading-placeholder"),s()()())}function Hp(i,m){if(i&1&&(r(0,"div",11),c(1),s()),i&2){let e=l(3);o(),P(" ",e.configuration.passwordChangeSuccessMessage," ")}}function Gp(i,m){if(i&1&&(r(0,"div",12),c(1),s()),i&2){let e=l(3);o(),P(" ",e.authenticationErrorMessage," ")}}function Op(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),P(" ",e," ")}}function qp(i,m){if(i&1&&(r(0,"div",18),K(1,Op,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getFieldValidationErrors("oldPassword"))}}function jp(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function Qp(i,m){if(i&1&&(r(0,"div",18),K(1,jp,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getPasswordValidationErrors("newPassword"))}}function Wp(i,m){if(i&1){let e=L();r(0,"div",9)(1,"div",4)(2,"form",10),I("ngSubmit",function(){u(e);let t=l(2);return f(t.onSubmit())}),y(3,Hp,2,1,"div",11),y(4,Gp,2,1,"div",12),r(5,"div",3)(6,"div",13)(7,"div",14)(8,"label",15),c(9),s(),r(10,"div",16),A(11,"input",17),y(12,qp,3,0,"div",18),s()()()(),A(13,"app-new-password-control",19),y(14,Qp,3,0,"div",18),r(15,"div",3)(16,"div",20)(17,"button",21),v(18,"async"),c(19),s()()()()()()}if(i&2){let e=l(2);o(2),_("formGroup",e.changePasswordForm),o(),b(e.passwordChangedSuccess?3:-1),o(),b(e.authenticationErrorMessage?4:-1),o(4),Q("ibe-data-required",e.configuration.oldPassword.validation.required),o(),g(e.configuration.oldPassword.label),o(2),Q("is-invalid",e.isFieldInValid("oldPassword")),_("readonly",e.configuration.oldPassword==null?null:e.configuration.oldPassword.readonly)("placeholder",e.configuration.oldPassword==null?null:e.configuration.oldPassword.placeholder),o(),b(e.isFieldInValid("oldPassword")?12:-1),o(),_("configuration",e.configuration.newPassword)("isFullRow",!0),o(),b(e.isFieldInValid("newPassword")?14:-1),o(3),_("disabled",S(18,16,e.dataLoading$)||!e.changePasswordForm.valid),o(2),P(" ",e.configuration.updateButtonText," ")}}function Kp(i,m){if(i&1&&(r(0,"div",2)(1,"div",5)(2,"div",3)(3,"div",6)(4,"div",3)(5,"div",4)(6,"div",7)(7,"div",4)(8,"div",8),c(9),s()()(),y(10,Wp,20,18,"div",9),v(11,"async"),s()()()()()()),i&2){let e=l();o(9),g(e.configuration.changePasswordLabel),o(),b(S(11,2,e.loggedIn$)?10:-1)}}var vd=(()=>{class i{constructor(){this.router=Te(Z),this._log=Te(H),this.gtmHelper=Te(lt),this.store=Te(q),this.formBuilder=Te(Ye),this.usersService=Te(Xl),this.errorNotifier=Te(Kt),this.formElementHelper=Te($e),this.jwtAuthenticationService=Te(Jt),this.configuration=Te(Qo),this.dataLoading$=ue([!1]),this.formSubmitAttempt=!1,this.changePasswordForm=null,this.passwordChangedSuccess=!1,this.authenticationErrorMessage="",this.alive=!0,this.userKey=rt(()=>this.store.selectSignal(Si)().key),this.gtmHelper.enable(),this.changePasswordForm=this.formBuilder.group({oldPassword:new w("",this.formElementHelper.createValidators(this.configuration.oldPassword)),newPassword:new w("",this.formElementHelper.createValidators(this.configuration.newPassword,!0))})}ngOnInit(){this.loggedIn$=this.jwtAuthenticationService.isAuthenticatedAsAgent$().pipe(x(()=>this.alive)),N([N([this.store.select(te),this.store.select(X)]).pipe(x(()=>this.alive),$(e=>e[0]!==null&&e[1]!==null))]).pipe(x(()=>this.alive)).subscribe(e=>{let n=e[0][0],t=e[0][1];n!==null&&t!==null&&this.configuration.loadConfigSettingsAndI18nMessages(n,t,this._log)})}isFieldInValid(e){return this.formElementHelper.isFieldInValid(e,this.changePasswordForm,this.formSubmitAttempt)}getFieldValidationErrors(e){return this.formElementHelper.getFieldValidationErrors(e,this.changePasswordForm,this.configuration[e].validation)}getPasswordValidationErrors(e){return this.formElementHelper.getFieldValidationErrors(e,this.changePasswordForm,this.configuration.newPassword.newPassword.validation)}onSubmit(){if(this.formSubmitAttempt=!0,this.passwordChangedSuccess=!1,this.authenticationErrorMessage="",this.changePasswordForm.valid){let e=this.changePasswordForm.value.oldPassword,n=this.changePasswordForm.value.newPassword;this.dataLoading$=ue([!0]),this.usersService.changeOwnPassword(this.userKey(),e,n).pipe(x(()=>this.alive),$n(t=>(this.dataLoading$=ue([!1]),t.reason===vo.TooManyFailedAttempts?this.authenticationErrorMessage=this.configuration.consecutiveFailedAttemptsExceededText:t.reason===vo.InvalidCredentials?this.authenticationErrorMessage=this.configuration.inValidOldPasswordMessage:this.authenticationErrorMessage=this.configuration.unexpectedAuthenticationErrorMessage,this.formSubmitAttempt=!1,Ko))).subscribe(t=>{this.store.dispatch(new an),this.jwtAuthenticationService.logout().pipe(x(()=>this.alive),Xo(1)).subscribe(()=>{this.errorNotifier.notify(ll),this.router.navigate([`/${en}`])})})}}ngOnDestroy(){this.alive=!1}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=D({type:i,selectors:[["app-change-password-agent"]],standalone:!1,features:[W([Qo])],decls:5,vars:6,consts:[[3,"showSpinner"],[1,"container","mt-5"],[1,"page-body","container-fluid","bg-light"],[1,"row"],[1,"col"],[1,"container-lg"],[1,"col-sm-12"],[1,"row","mb-1"],[1,"h2"],[1,"row","search-widget","mt-5","shadow","rounded","bg-white","p-3","py-4"],["novalidate","novalidate",1,"ui","form",3,"ngSubmit","formGroup"],[1,"alert","alert-success"],[1,"alert","alert-danger"],[1,"col-md-12"],[1,"input-box","form-group","row"],["for","oldPassword",1,"col-sm-3","col-form-label"],[1,"col-sm-8"],["id","oldPassword","type","password","formControlName","oldPassword",1,"form-control",3,"readonly","placeholder"],[1,"invalid-feedback"],["formControlName","newPassword",3,"configuration","isFullRow"],[1,"col-lg-12"],[1,"btn","btn-primary","pull-right",3,"disabled"]],template:function(n,t){n&1&&(A(0,"app-loading-spinner",0),v(1,"async"),y(2,Dp,4,0,"div",1),v(3,"async"),Lt(4,Kp,12,4,"div",2)),n&2&&(_("showSpinner",S(1,2,t.dataLoading$)),o(2),b(S(3,4,t.dataLoading$)?2:4))},dependencies:[qt,je,Qe,We,ge,yn,yt,mc,Ke,Qt,z],encapsulation:2})}}return i})();var Ut=Ce(Re());var mo=(()=>{class i{constructor(e,n,t,a){this.log=e,this.typeScriptHelper=n,this.componentsConfigurationHelper=t,this.configHelper=a,this.companyInfoFormConfiguration=new nt,this.manageAgencyLabel="Manage Agency",this.viewSubAgenciesLabel="View Sub Agencies",this.addNewUserL
1abel="Add New User",this.agencyInfoLabel="Agency Info",this.companyInfoLabel="Company Info",this.contactInformationLabel="Contact Information",this.addressLabel="Address",this.notesLabel="Notes",this.accountLabel="Account",this.emailLabel="Email",this.primaryPhoneLabel="Primary Phone",this.editLabel="Edit",this.agencyUserManagementConfiguration=new Qi(this.typeScriptHelper),this.editAgencyInfoLabel="Edit Agency Info",this.updateButton="Update",this.cancelButton="Cancel",this.closeButton="Close",this.editCompanyInfoLabel="Edit Company Info",this.agencyInfoFormConfiguration=new nt,this.agencyCreateUserFormConfiguration=new An,this.editUserFormConfiguration=new nt,this.userGroupsLabel="User Groups",this.defaultAirportCode="",this.accessInfoLabel="Access Information",this.username=new Ie,this.password=new pn,this.fullname=new Ie,this.username.enabled=!0,this.username.label="Username",this.username.placeholder="Username",this.username.validation=new Ae,this.username.validation={maxLength:50,maxLengthMessage:"Username is too long",minLength:4,minLengthMessage:"Username is too short",required:!0,requiredMessage:"Username is required",pattern:Wn,patternMessage:"Username contains invalid characters"},this.fullname.enabled=!0,this.fullname.label="Full name",this.fullname.placeholder="Full name",this.fullname.validation=new Ae,this.fullname.validation={required:!0,requiredMessage:"Full name is required",minLength:2,minLengthMessage:"Full name doesn't match the minimum length of 2",pattern:Ft,patternMessage:"Full name contains invalid characters",maxLength:50,maxLengthMessage:"Full name is too long"}}loadConfigSettingsAndI18nMessages(e,n,t,a,d,C,F){let p="agent.manageAgency",E=new V(this.log,e,"config"),R=new V(this.log,n,"i18n");R.setProperties(this,[["string","manageAgencyLabel",`${p}.label`],["string","viewSubAgenciesLabel",`${p}.viewSubAgencies.label`],["string","addNewUserLabel",`${p}.addNewUser.label`],["string","agencyInfoLabel",`${p}.agencyInfo.label`],["string","companyInfoLabel",`${p}.companyInfo.label`],["string","contactInformationLabel",`${p}.contactInformation.label`],["string","emailLabel",`${p}.email.label`],["string","addressLabel",`${p}.address.label`],["string","notesLabel",`${p}.notes.label`],["string","accountLabel",`${p}.account.label`],["string","primaryPhoneLabel",`${p}.primaryPhone.label`],["string","editLabel",`${p}.edit.label`],["string","editAgencyInfoLabel",`${p}.editAgencyInfo.label`],["string","updateButton","userProfile.updateButton.text"],["string","cancelButton","cancelButton.text"],["string","closeButton","closeButton.text"],["string","editCompanyInfoLabel",`${p}
1.editCompanyInfo.label`],["string","accessInfoLabel",`${p}.accessInfo.label`],["string","userGroupsLabel",`${p}.userGroups.label`]]),E.setProperties(this,[["string","defaultAirportCode","agents.registration.closestAirport.defaultCode"]]),this.agencyUserManagementConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,""),this.companyInfoFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,`${p}.companyInfo`),this.agencyInfoFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,`${p}.agencyInfo`),this.agencyCreateUserFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,F,`${p}.createAgencyUser`),this.editUserFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,`${p}.editUser`),[{controlConfig:this.fullname,prefixConfig:"fullname"}].forEach(({controlConfig:k,prefixConfig:M})=>{R.setProperties(k,[["string","label",`${p}.${M}.label`],["string","placeholder",`${p}.${M}.placeholder`]]),R.setProperties(k.validation,[["string","requiredMessage",`${p}.${M}.validation.requiredMessage`],["string","patternMessage",`${p}.${M}.validation.patternMessage`]]),E.setProperties(k,[["boolean","enabled",`${p}.${M}.enabled`]]),E.setProperties(k.validation,[["boolean","required",`${p}.${M}.validation.required`],["string","pattern",`${p}.${M}.validation.pattern`]])}),E.setProperties(this.fullname.validation,[["int","maxLength",`${p}.fullname.validation.maxLength`],["int","minLength",`${p}.fullname.validation.minLength`]]),R.setProperties(this.fullname.validation,[["string","maxLengthMessage",`${p}.fullname.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.fullname.validation.minLengthMessage`]]),[{controlConfig:this.username,prefixConfig:"username"},{controlConfig:this.fullname,prefixConfig:"fullname"}].forEach(({controlConfig:k,prefixConfig:M})=>{R.setProperties(k,[["string","label",`${p}.${M}.label`],["string","placeholder",`${p}.${M}.placeholder`]]),R.setProperties(k.validation,[["string","requiredMessage",`${p}.${M}.validation.requiredMessage`],["string","patternMessage",`${p}.${M}.validation.patternMessage`]]),E.setProperties(k,[["boolean","enabled",`${p}.${M}.enabled`]]),E.setProperties(k.validation,[["boolean","required",`${p}.${M}.validation.required`],["string","pattern",`${p}.${M}.validation.pattern`]])}),E.setProperties(this.fullname.validation,[["int","maxLength",`${p}.fullname.validation.maxLength`],["int","minLength",`${p}.fullname.validation.minLength`]]),R.setProperties(this.fullname.validation,[["string","maxLengthMessage",`${p}.fullname.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.fullname.validation.minLengthMessage`]]),E.setProperties(this.username.validation,[["int","maxLength",`${p}.username.validation.maxLength`],["int","minLength",`${p}.username.validation.minLength`]]),R.setProperties(this.username.validation,[["string","maxLengthMessage",`${p}.username.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.username.validation.minLengthMessage`]]),this.password.loadConfigSettingsAndI18nMessages(p,e,n,this.log),[{inputConfiguration:this.agencyInfoFormConfiguration.profileInputConfiguration.notes,name:"agencyInfo.notes"},{inputConfiguration:this.editUserFormConfiguration.profileInputConfiguration.notes,name:"editUser.notes"}].forEach(k=>{let M=`${p}.${k.name}`;E.setInt(k.inputConfiguration.validation,"maxLength",`${M}.validation.maxLength`),R.setString(k.inputConfiguration.validation,"maxLengthMessage",`${M}.validation.maxLengthMessage`)})}static{this.\u0275fac=function(n){return new(n||i)(ie(H),ie(Se),ie(ct),ie(ne))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var eg=["agencyInfoDetailTemplate"],tg=["companyInfoDetailTemplate"],ng=["createUserTemplate"],ig=["editUserTemplate"],og=["userDetailTemplate"],ag=i=>[i],Id=i=>({"form-control":!0,"is-invalid":i}),rg=(i,m)=>m.key;function sg(i,m){if(i&1){let e=L();r(0,"div",31),I("click",function(){u(e);let t=l();return f(t.editAgencyInfo())}),c(1),A(2,"i",32),s()}if(i&2){let e=l();o(),P(" (",e.configuration.editLabel,") ")}}function lg(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function cg(i,m){if(i&1&&(r(0,"div",40),K(1,lg,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getFieldValidationErrors("fullname","createUserForm"))}}function dg(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function mg(i,m){if(i&1&&(r(0,"div",40),K(1,dg,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getFieldValidationErrors("username","createUserForm"))}}function pg(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function gg(i,m){if(i&1&&(r(0,"div",40),K(1,pg,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getPasswordValidationErrors("password"))}}function ug(i,m){if(i&1){let e=L();r(0,"label",45)(1,"input",46),I("change",function(t){u(e);let a=l().$implicit,d=l(2);return f(d.userSecurityGroupsChanged(a.group.key,t.target.checked))}),s(),A(2,"span",47),v(3,"safeHtml"),s()}if(i&2){let e=l().$implicit,n=l(2);o(),_("name",e.group.name)("id",e.group.key)("checked",n.isUserSecurityGroupSelected(e.group.key))("value",e.group.key),me("aria-label",e.group.name),o(),_("innerHTML",S(3,6,e.group.name),$t)}}function fg(i,m){if(i&1&&(ae(0,44),y(1,ug,4,8,"label",45),re()),i&2){let e=m.$implicit;o(),b(e?1:-1)}}function hg(i,m){if(i&1){let e=L();r(0,"app-agent-create-modal",33),v(1,"async"),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("addressChanged",function(t){u(e);let a=l();return f(a.addressChanged(t))})("created",function(){u(e);let t=l();return f(t.onCreateUser())}),ae(2,34),r(3,"div",8)(4,"h5"),c(5),s(),r(6,"div",35)(7,"div",36)(8,"label",37),c(9),s(),r(10,"div",38),A(11,"input",39),y(12,cg,3,0,"div",40),s()()(),r(13,"div",35)(14,"div",36)(15,"label",41),c(16),s(),r(17,"div",38),A(18,"input",42),y(19,mg,3,0,"div",40),s()()()(),A(20,"app-new-password-control",43),y(21,gg,3,0,"div",40),r(22,"div",8)(23,"div",35)(24,"div",36)(25,"label",37),c(26),s(),r(27,"div",38),K(28,fg,2,1,"ng-container",44,rg),s()()()(),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.agencyCreateUserFormConfiguration)("contactInformation",null)("isLoading",S(1,35,e.dataLoading$))("title",e.configuration.addNewUserL
1abel)("address",null)("creationState",e.creationAgencyUserStateSignal())("addressInputForm",e.addressCreateFormArray.controls[0])("formSubmitAttempt",e.formSubmitAttempt)("contactInformationForm",e.contactInfoCreateFormGroup)("agencyName",e.agencyInfo.name),o(5),g(e.configuration.accessInfoLabel),o(3),Q("ibe-data-required",!0),o(),g(e.configuration.fullname.label),o(2),Q("is-invalid",e.isFieldInValid("fullname","createUserForm")),_("formControl",e.fullnameControl)("placeholder",e.configuration.fullname.placeholder),o(),b(e.isFieldInValid("fullname","createUserForm")?12:-1),o(3),Q("ibe-data-required",!0),o(),g(e.configuration.username.label),o(2),Q("is-invalid",e.isFieldInValid("username","createUserForm")),_("formControl",e.usernameControl)("placeholder",e.configuration.username.placeholder),o(),b(e.isFieldInValid("username","createUserForm")?19:-1),o(),_("formControl",e.passwordControl)("configuration",e.configuration.password)("formSubmitAttempt",e.formSubmitAttempt)("isFullRow",!0),o(),b(e.isFieldInValid("password","createUserForm")?21:-1),o(4),Q("ibe-data-required",!1),o(),g(e.configuration.userGroupsLabel),o(2),Y(e.userSecurityGroupsSignal())}}function _g(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),P(" ",e," ")}}function Cg(i,m){if(i&1&&(r(0,"div",40),K(1,_g,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getFieldValidationErrorsByConfig("notes","editAgencyInfoForm",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration))}}function yg(i,m){if(i&1&&(r(0,"div",35)(1,"div",36)(2,"label",50),c(3),s(),r(4,"div",51),A(5,"textarea",52),y(6,Cg,3,0,"div",40),r(7,"div",53),A(8,"i",54),r(9,"div",55),c(10),s()()()()()),i&2){let e=l(2);o(2),Q("ibe-data-required",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.validation.required),o(),g(e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.label),o(2),at(J(10,Id,e.isFieldInValid("notes","editAgencyInfoForm"))),_("readonly",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes==null?null:e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.readonly)("value",e.agencyInfo==null?null:e.agencyInfo.notes)("formControl",e.notesAgencyControl),o(),b(e.isFieldInValid("notes","editAgencyInfoForm")?6:-1),o(4),P(" ",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.description," ")}}function bg(i,m){if(i&1){let e=L();r(0,"app-agent-update-modal",48),v(1,"async"),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("addressChanged",function(t){u(e);let a=l();return f(a.addressChanged(t))})("updated",function(t){let a=u(e).$implicit,d=l();return f(d.onUpdateAgencyInfo(t,a))})("contactInformationChanged",function(t){u(e);let a=l();return f(a.agencyInfoChanged(t))}),ae(2,49),y(3,yg,11,12,"div",35),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.agencyInfoFormConfiguration)("formSubmitAttempt",e.formSubmitAttempt)("address",e.agencyInfo.address)("isLoading",S(1,8,e.dataLoading$))("contactInformation",e.agencyEditedInfo.contactInformation)("contactInformationForm",e.editAgencyInfoForm)("addressInputForm",e.addressEditAgencyFormArray==null?null:e.addressEditAgencyFormArray.controls[0]),o(3),b(e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.enabled?3:-1)}}function vg(i,m){if(i&1){let e=L();r(0,"app-agent-update-modal",56),v(1,"async"),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("updated",function(t){let a=u(e).$implicit,d=l();return f(d.onUpdateCompanyInfo(t,a))})("contactInformationChanged",function(t){u(e);let a=l();return f(a.companyInfoChanged(t))}),s()}if(i&2){let e=l();_("configuration",e.configuration.companyInfoFormConfiguration)("formSubmitAttempt",e.formSubmitAttempt)("contactInformation",e.agencyEditedInfo.contactInformation)("contactInformationForm",e.editCompanyInfoForm)("isLoading",S(1,5,e.dataLoading$))}}function Sg(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),P(" ",e," ")}}function Ag(i,m){if(i&1&&(r(0,"div",40),K(1,Sg,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getFieldValidationErrorsByConfig("notes","editUserForm",e.configuration.editUserFormConfiguration.profileInputConfiguration))}}function Ig(i,m){if(i&1&&(r(0,"div",35)(1,"div",36)(2,"label",50),c(3),s(),r(4,"div",51),A(5,"textarea",52),y(6,Ag,3,0,"div",40),r(7,"div",53),A(8,"i",54),r(9,"div",55),c(10),s()()()()()),i&2){let e=l(2);o(2),Q("ibe-data-required",e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.val
1idation.required),o(),g(e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.label),o(2),at(J(10,Id,e.isFieldInValid("notes","editUserForm"))),_("readonly",e.configuration.editUserFormConfiguration.profileInputConfiguration.notes==null?null:e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.readonly)("value",e.agencyInfo==null?null:e.agencyInfo.notes)("formControl",e.notesUserControl),o(),b(e.isFieldInValid("notes","editUserForm")?6:-1),o(4),P(" ",e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.description," ")}}function xg(i,m){if(i&1){let e=L();r(0,"app-agent-update-modal",48),v(1,"async"),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("addressChanged",function(t){u(e);let a=l();return f(a.addressChanged(t))})("updated",function(){let t=u(e).$implicit,a=l();return f(a.onUpdateUserInfo(t))})("contactInformationChanged",function(t){u(e);let a=l();return f(a.agencyInfoChanged(t))}),ae(2,49),y(3,Ig,11,12,"div",35),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.editUserFormConfiguration)("formSubmitAttempt",e.formSubmitAttempt)("address",e.currentUserSignal().address)("isLoading",S(1,8,e.dataLoading$))("contactInformation",e.currentUserSignal().contactInformation)("contactInformationForm",e.editUserForm)("addressInputForm",e.addressEditUserFormArray==null?null:e.addressEditUserFormArray.controls[0]),o(3),b(e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.enabled?3:-1)}}function wg(i,m){if(i&1){let e=L();r(0,"app-agency-user-detail",57),I("updateUser",function(){let t=u(e).$implicit,a=l();return t==null||t.close(),f(a.onRequestEditUserDetail(a.currentUserSignal().key))})("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())}),s()}if(i&2){let e=l();_("configuration",e.configuration.agencyUserManagementConfiguration.agencyUserDetailConfiguration)("user",e.currentUserSignal())}}var xd=(()=>{class i{constructor(e,n,t,a,d,C,F,p){this.configuration=e,this.router=n,this.store=t,this.log=a,this.modalService=d,this.formElementHelper=C,this.fb=F,this.destroyRef=p,this.agencyInfoDetailTemplate=be.required("agencyInfoDetailTemplate"),this.companyInfoDetailTemplate=be.required("companyInfoDetailTemplate"),this.createUserTemplate=be.required("createUserTemplate"),this.editUserTemplate=be.required("editUserTemplate"),this.userDetailTemplate=be.required("userDetailTemplate"),this.dataLoading$=N([this.store.select(we),this.store.select(Ee),this.store.select(un),this.store.select(hn),this.store.select(_n),this.store.select(ft),this.store.select(xi),this.store.select(Ii)]).pipe(B(E=>!E.every(R=>!R))),this.editAgencyInfoForm=null,this.editCompanyInfoForm=null,this.createUserForm=null,this.editUserForm=null,this.formSubmitAttempt=!1,this.creationAgencyUserStateSignal=this.store.selectSignal(Ei),this.airportsSignal=this.store.selectSignal(Ci),this.agencyUsersSignal=this.store.selectSignal(wi),this.currentUserSignal=this.store.selectSignal(ht),this.userSecurityGroupsSignal=this.store.selectSignal(Ai),this.selectedUserSecurityGroups=[],this.editAgencyPermission="ReservationsAdminAgenciesModify",this.store.dispatch(new li),this.store.dispatch(new ur),this.onResetCurrentUserDetail()}ngOnInit(){N([this.store.select(fn),this.store.select(gn)]).pipe(Fe(this.destroyRef)).subscribe(e=>{let[n,t]=e;this.agencyInfo=n;let a=t.find(d=>d.key===n.agencyAccount?.company?.key);this.agencyInfo=U(T({},this.agencyInfo),{agencyAccount:U(T({},this.agencyInfo.agencyAccount),{company:a})}),this.agencyEditedInfo=this.agencyInfo}),N([this.store.select(te),this.store.select(X),this.store.select(pt),this.store.select(_t),this.store.select(gt),this.store.select(kt)]).pipe(Fe(this.destroyRef),$(([e,n])=>(0,Ut.isObject)(e)&&(0,Ut.isObject)(n))).subscribe(([e,n,t,a,d,C])=>{this.configuration.loadConfigSettingsAndI18nMessages(e,n,t,a,"adult",d,C)}),this.store.dispatch(new rn(on,!0))}get addressEditAgencyFormArray(){return this.editAgencyInfoForm.controls.addressForm}get notesAgencyControl(){return this.editAgencyInfoForm.get("notes")}get addressEditUserFormArray(){return this.editUserForm.controls.addressForm}get notesUserControl(){return this.editUserForm.get("notes")}isFieldInValid(e,n){return this.formElementHelper.isFieldInValid(e,this[n],this.formSubmitAttempt)}getFieldValidationErrorsByConfig(e,n,t){return this.formElementHelper.getFieldValidationErrors(e,this[n],t[e].validation)}getFieldValidationErrors(e,n){return this.formElementHelper.getFieldValidationErrors(e,this[n],this.configuration[e].validation)}getPasswordValidationErrors(e){return this.formElementHelper.getFieldValidationErrors(e,this.createUserForm,this.configuration.password.newPassword.validation)}agencyInfoChanged(e){this.agencyEditedInfo=U(T({},this.agencyEditedInfo),{contactInformation:e.next})}addressChanged(e){this.agencyEditedInfo=U(T({},this.agencyEditedInfo),{address:e.next})}onUpdateUserInfo(e){if(this.formSubmitAttempt=!0,this.editUserForm.valid){let n=T({},this.editUserForm.value);delete n?.addressForm,delete n?.notes;let t=this.addressEditUserFormArray.controls[0].value,a=U(T({},this.currentUserSignal()),{contactInformation:T(T({},this.currentUserSignal().contactInformation),n),address:U(T(T({},this.currentUserSignal().address),t),{location:U(T({},this.currentUserSignal().address.location),{province:{code:t.province},country:{code:t.country}})}),notes:this.notesUserControl.value});this.store.dispatch(new ln(a.key,a)),e.close()}}onCreateUser(){this.formSubmitAttempt=!0;let e=this.airportsSignal().find(t=>t.code===this.configuration.defaultAirportCode.toUpperCase()),n=this.addressCreateFormArray.controls[0].value;if(this.createUserForm.valid){let t={name:this.fullnameControl.value,agency:{key:this.agencyInfo.key},status:{active:!0,inactive:!1},userLogonName:this.usernameControl.value,password:this.passwordControl.value,closestAirport:e,address:U(T({},n),{location:{province:{code:n.province},country:{code:n.country}}}),contactInformation:this.contactInfoCreateFormGroup.value};this.store.dispatch(new pi(t,this.selectedUserSecurityGroups))}}editAgencyInfo(){this.agencyInfo&&(this.editAgencyInfoForm=this.createAgencyInfoInputForm(this.agencyInfo,this.configuration.agencyInfoFormConfiguration)),this.formSubmitAttempt=!1,this.modalService.open(this.agencyInfoDetailTemplate(),{centered:!0}).result.then(()=>{})}onUpdateAgencyInfo(e,n){if(this.formSubmitAttempt=!0,this.editAgencyInfoForm.valid){this.addressEditAgencyFormArray?.controls[0];let t=U(T(T({},this.agencyInfo),this.agencyEditedInfo),{notes:this.notesAgencyControl.value});this.store.dispatch(new mt(t)),n?.close()}}viewSubAgencies(){this.router.navigate([`/${Zt}`])}onAddNewUser(){this.store.dispatch(new mi);let e=new Pt;e.location=new Tt,this.createUserForm=this.fb.group({fullname:new w("",this.formElementHelper.createValidators(this.configuration.fullname)),username:new w("",this.formElementHelper.createValidators(this.configuration.username)),password:new w("",this.formElementHelper.createValidators(this.configuration.password.newPassword,!0)),contactInputForm:this.createAddUserInputForm(this.configuration.agencyCreateUserFormConfiguration),addressInputForm:new ze([tt.initAddressForm(this.formElementHelper,e,this.configuration.agencyCreateUserFormConfiguration.profileInputConfiguration.address)])}),this.formSubmitAttempt=!1,this.modalService.open(this.createUserTemplate(),{centered:!0}).result.then(()=>{this.creationAgencyUserStateSignal()===nn.CreateSuccess&&this.store.dispatch(new rn(on,!0))})}companyInfoChanged(e){this.agencyEditedInfo=U(T({},this.agencyEditedInfo),{agencyAccount:U(T({},this.agencyInfo.agencyAccount),{company:U(T({},this.agencyInfo.agencyAccount.company),{contactInformation:e.next.contactInformation})})})}editCompanyInfo(){this.agencyInfo&&(this.editCompanyInfoForm=this.createCompanyInfoInputForm(this.agencyInfo,this.configuration.companyInfoFormConfiguration)),this.formSubmitAttempt=!1,this.modalService.open(this.companyInfoDetailTemplate(),{centered:!0}).result.then(()=>{})}onUpdateCompanyInfo(e,n){if(this.formSubmitAttempt=!0,this.editCompanyInfoForm.valid){let t=T(T({},this.agencyInfo),this.agencyEditedInfo);this.store.dispatch(new mt(t)),n?.close()}}onRequestEditUserDetail(e){this.onResetCurrentUserDetail(),this.store.dispatch(new sn(e)),this.store.select(ht).pipe(Fe(this.destroyRef),$(n=>(0,Ut.isObject)(n)&&!this.modalService.hasOpenModals()),Ne()).subscribe(n=>{this.editUserForm=this.createAgencyInfoInputForm(n,this.configuration.editUserFormConfiguration),this.formSubmitAttempt=!1,this.modalService.open(this.editUserTemplate(),{centered:!0}).result.then(()=>{})})}onRequestUserDetail(e){this.onResetCurrentUserDetail(),this.store.dispatch(new sn(e)),this.store.select(ht).pipe(Fe(this.destroyRef),$(n=>(0,Ut.isObject)(n)&&!this.modalService.hasOpenModals()),Ne()).subscribe(()=>{this.modalService.open(this.userDetailTemplate(),{centered:!0}).result.then(()=>{})})}onResetCurrentUserDetail(){this.store.dispatch(new ci(null)),this.store.dispatch(new di(null))}createAgencyInfoInputForm(e,n){return new Ve({name:new w(e.contactInformation.name,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.name)),mobileNumber:new w(e.contactInformation.mobileNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.mobileNumber)),faxNumber:new w(e.contactInformation.faxNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.faxNumber)),email:new w(e.contactInformation.email,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.email)),phoneNumber:new w(e.contactInformation.phoneNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.phoneNumber)),extension:new w(e.contactInformation.extension,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.extension)),notes:new w(e.notes,this.formElementHelper.createValidators(n.profileInputConfiguration.notes)),language:new w(e.contactInformation?.language?.code,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.language)),addressForm:new ze([tt.initAddressForm(this.formElementHelper,e.address,n.profileInputConfiguration.address)])})}createCompanyInfoInputForm(e,n){return new Ve({name:new w(e.contactInformation.name,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.name)),mobileNumber:new w(e.contactInformation.mobileNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.mobileNumber)),faxNumber:new w(e.contactInformation.faxNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.faxNumber)),email:new w(e.contactInformation.email,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.email)),phoneNumber:new w(e.contactInformation.phoneNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.phoneNumber)),extension:new w(e.contactInformation.extension,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.extension)),notes:new w(e.notes,this.formElementHelper.createValidators(n.profileInputConfiguration.notes)),language:new w(e.contactInformation?.language?.code,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.language))})}createAddUserInputForm(e){return new Ve({name:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.name)),mobileNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.mobileNumber)),faxNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.faxNumber)),email:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.email)),phoneNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.phoneNumber)),extension:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.extension)),notes:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.notes)),language:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.language))})}get contactInfoCreateFormGroup(){return this.createUserForm.get("contactInputForm")}get addressCreateFormArray(){return this.createUserForm.controls.addressInputForm}get usernameControl(){return this.createUserForm.get("username")}get passwordControl(){return this.createUserForm.get("password")}get fullnameControl(){return this.createUserForm.get("fullname")}onRequestChangeUserStatus(e){let n;e.activated?n=U(T({},e.user),{status:{active:!0,inactive:!1,pending:!1,denied:!1,historical:!1}}):n=U(T({},e.user),{status:{active:!1,inactive:!0,pending:!1,denied:!1,historical:!1}}),this.store.dispatch(new ln(n.key,n))}isUserSecurityGroupSelected(e){return(0,Ut.isArray)(this.selectedUserSecurityGroups)&&this.selectedUserSecurityGroups.includes(e)}
1userSecurityGroupsChanged(e,n){n===!0&&this.selectedUserSecurityGroups.includes(e)===!1?this.selectedUserSecurityGroups=[...this.selectedUserSecurityGroups,e]:n===!1&&this.selectedUserSecurityGroups.includes(e)===!0&&(this.selectedUserSecurityGroups=this.selectedUserSecurityGroups.filter(t=>t!==e))}static{this.\u0275fac=function(n){return new(n||i)(h(mo),h(Z),h(q),h(H),h(Be),h($e),h(Ye),h(Bt))}}static{this.\u0275cmp=D({type:i,selectors:[["app-manage-agency"]],viewQuery:function(n,t){n&1&&Dt(t.agencyInfoDetailTemplate,eg,5)(t.companyInfoDetailTemplate,tg,5)(t.createUserTemplate,ng,5)(t.editUserTemplate,ig,5)(t.userDetailTemplate,og,5),n&2&&Ht(5)},standalone:!1,features:[W([mo,jn])],decls:86,vars:41,consts:[["createUserTemplate",""],["agencyInfoDetailTemplate",""],["companyInfoDetailTemplate",""],["editUserTemplate",""],["userDetailTemplate",""],[3,"showSpinner"],[1,"page-body","container-fluid"],[1,"container-lg"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-between"],[1,"d-flex"],[1,"fw-bold","fs-20"],[1,"ms-4","pointer","align-self-end",3,"click"],[1,"iasi","ic-hide","ic-long-arrow-right-af"],[1,"h2","text-primary"],[1,"row","mt-3"],[1,"agency-info","col-12","col-md-7","py-4","border-bottom"],[1,"header","d-flex","justify-content-between"],[1,"fs-24","text-primary"],["class","pointer align-self-center",3,"click",4,"hasPermission"],[1,"body","row"],[1,"col-12","col-md-6","py-4"],[1,"fw-bold","mb-3","fs-18"],[1,"mt-3","contact-data--item","contact-data--item__phone-number"],[1,"contact-data--item","contact-data--item__phone-number"],[1,"col-12","py-4"],[1,"fw-bold","fs-18"],[1,"company-info","col-12","col-md-4","offset-md-1","py-4","border-bottom"],[1,"mt-3"],[3,"requestAddNewUser","requestEditUserDetail","requestChangeUserStatus","resetCurrentUserDetail","requestUserDetail","users","currentUser","dataLoading","configuration"],[1,"pointer","align-self-center",3,"click"],[1,"iasi","ic-hide","ic-edit-af","ms-1"],[3,"closedModal","addressChanged","created","configuration","contactInformation","isLoading","title","address","creationState","addressInputForm","formSubmitAttempt","contactInformationForm","agencyName"],["agentCreateModalContent",""],[1,"col-md-12"],[1,"form-group","row"],["for","create-fullname",1,"col-md-3","col-form-label"],[1,"col-md-8"],["type","text","id","create-fullname","name","fullname",1,"form-control",3,"formControl","placeholder"],[1,"invalid-feedback"],["for","registration-username",1,"col-md-3","col-form-label"],["type","text","id","registration-username","name","username",1,"form-control",3,"formControl","placeholder"],[3,"formControl","configuration","formSubmitAttempt","isFullRow"],[3,"formGroup"],[1,"align-middle","m-0","pointer","d-flex","flex-nowrap","mb-2","align-items-baseline"],["type","checkbox",1,"flex-shrink-0","ctm-checkbox","small","mono","me-3",3,"change","name","id","checked","value"],[3,"innerHTML"],[3,"closedModal","addressChanged","updated","contactInformationChanged","configuration","formSubmitAttempt","address","isLoading","contactInformation","contactInformationForm","addressInputForm"],["agentUpdateModalContent",""],["htmlFor","notes",1,"h5","col-md-12","col-form-label"],[1,"col-md-8","offset-3"],["autocomplete","new-password","id","notes","rows","4",3,"readonly","value","formControl"],[1,"col-md-12","text-warning-dark","text-warning","fs-14","d-flex","mt-2"],[1,"iasi","ic-hide","ic-triangle-exclamation-af","me-2","fs-16"],[1,"fs-14","lh-12"],[3,"closedModal","updated","contactInformationChanged","configuration","formSubmitAttempt","contactInformation","contactInformationForm","isLoading"],[3,"updateUser","closedModal","configuration","user"]],template:function(n,t){if(n&1){let a=L();A(0,"app-loading-spinner",5),v(1,"async"),r(2,"div",6)(3,"div",7)(4,"div",8)(5,"div",9)(6,"div",8)(7,"div",10)(8,"div")(9,"div",11)(10,"div",12),c(11),s(),r(12,"a",13),I("click",function(){return u(a),f(t.viewSubAgencies())}),c(13),A(14,"i",14),s()(),r(15,"div",15),c(16),s()()()()(),r(17,"div",9)(18,"div",16)(19,"div",17)(20,"div",18)(21,"div",19),c(22),s(),ce(23,sg,3,1,"div",20),s(),r(24,"div",21)(25,"div",22)(26,"div",23),c(27),s(),r(28,"div"),c(29),s(),r(30,"div"),c(31),s(),r(32,"div"),c(33),s(),r(34,"div"),c(35),s(),r(36,"div"),c(37),v(38,"customCountries"),s()(),r(39,"div",22)(40,"div",23),c(41),s(),r(42,"div"),c(43),s(),r(44,"div"),c(45),s(),r(46,"div",24),c(47),s(),r(48,"div",25),c(49),v(50,"phoneNumber"),s()(),r(51,"div",26)(52,"div",27),c(53),s(),r(54,"div"),c(55),s()()()(),r(56,"div",28)(57,"div",18)(58,"div",19),c(59),s()(),r(60,"div",21)(61,"div",22)(62,"div",23),c(63),s(),r(64,"div"),c(65),s(),r(66,"div"),c(67),s(),r(68,"div",29),c(69),s(),r(70,"div"),c(71),v(72,"phoneNumber"),s()()()()()(),r(73,"div",9)(74,"app-agency-user-management",30),v(75,"async"),I("requestAddNewUser",function(){return u(a),f(t.onAddNewUser())})("requestEditUserDetail",function(C){return u(a),f(t.onRequestEditUserDetail(C))})("requestChangeUserStatus",function(C){return u(a),f(t.onRequestChangeUserStatus(C))})("resetCurrentUserDetail",function(){return u(a),f(t.onResetCurrentUserDetail())})("requestUserDetail",function(C){return u(a),f(t.onRequestUserDetail(C))}),s()()()()(),ce(76,hg,30,37,"ng-template",null,0,de)(78,bg,4,10,"ng-template",null,1,de)(80,vg,2,7,"ng-template",null,2,de)(82,xg,4,10,"ng-template",null,3,de)(84,wg,1,2,"ng-template",null,4,de)}n&2&&(_("showSpinner",S(1,29,t.dataLoading$)),o(11),g(t.configuration.manageAgencyLabel),o(2),P("",t.configuration.viewSubAgenciesLabel," "),o(3),g(t.agencyInfo.name),o(6),g(t.configuration.agencyInfoLabel),o(),_("hasPermission",J(39,ag,t.editAgencyPermission)),o(4),g(t.configuration.addressLabel),o(2),g(t.agencyInfo.address==null?null:t.agencyInfo.address.address1),o(2),g(t.agencyInfo.address==null?null:t.agencyInfo.address.address2),o(2),g(t.agencyInfo.address==null?null:t.agencyInfo.address.city),o(2),g(t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.province==null?null:t.agencyInfo.address.location.province.name),o(2),P(" ",!(t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.country==null)&&t.agencyInfo.address.location.country.name?t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.country==null?null:t.agencyInfo.address.location.country.name:S(38,31,t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.country==null?null:t.agencyInfo.address.location.country.code)," "),o(4),g(t.configuration.contactInformationLabel),o(2),P("",t.configuration.emailLabel,":"),o(2),g(t.agencyInfo.contactInformation==null?null:t.agencyInfo.contactInformation.email),o(2),P("",t.configuration.primaryPhoneLabel,":"),o(2),P(" ",S(50,33,t.agencyInfo.contactInformation==null?null:t.agencyInfo.contactInformation.phoneNumber)," "),o(4),g(t.configuration.notesLabel),o(2),g(t.agencyInfo.notes),o(4),g(t.configuration.companyInfoLabel),o(4),g(t.configuration.accountLabel),o(2),P("",t.configuration.emailLabel,":"),o(2),g(t.agencyInfo.agencyAccount==null||t.agencyInfo.agencyAccount.company==null||t.agencyInfo.agencyAccount.company.contactInformation==null?null:t.agencyInfo.agencyAccount.company.contactInformation.email),o(2),P("",t.configuration.primaryPhoneLabel,":"),o(2),g(S(72,35,t.agencyInfo.agencyAccount==null||t.agencyInfo.agencyAccount.company==null||t.agencyInfo.agencyAccount.company.contactInformation==null?null:t.agencyInfo.agencyAccount.company.contactInformation.phoneNumber)),o(3),_("users",t.agencyUsersSignal())("currentUser",t.currentUserSignal())("dataLoading",S(75,37,t.dataLoading$))("configuration",t.configuration.agencyUserManagementConfiguration))},dependencies:[je,Qe,We,ge,yn,jt,Ke,bt,Gi,Hi,Sn,vn,z,Yt,Yn,Fi],encapsulation:2})}}return i})();var It=Ce(Re());var po=(()=>{class i{constructor(e,n,t,a){this.log=e,this.typeScriptHelper=n,this.componentsConfigurationHelper=t,this.configHelper=a,this.manageSubAgencyLabel="Manage Sub Agency",this.viewSubAgenciesLabel="View Sub Agencies",this.addNewUserL
1abel="Add New User",this.agencyInfoLabel="Agency Info",this.companyInfoLabel="Company Info",this.contactInformationLabel="Contact Information",this.addressLabel="Address",this.notesLabel="Notes",this.accountLabel="Account",this.emailLabel="Email",this.primaryPhoneLabel="Primary Phone",this.editLabel="Edit",this.agencyUserManagementConfiguration=new Qi(this.typeScriptHelper),this.editAgencyInfoLabel="Edit Agency Info",this.updateButton="Update",this.cancelButton="Cancel",this.closeButton="Close",this.editCompanyInfoLabel="Edit Company Info",this.userGroupsLabel="User Groups",this.backToParentAgencyLabel="Back to Parent Agency",this.parentAgencyLabel="Parent Agency",this.agencyInfoFormConfiguration=new nt,this.agencyCreateUserFormConfiguration=new An,this.editUserFormConfiguration=new nt,this.defaultAirportCode="YQM",this.accessInfoLabel="Access Information",this.username=new Ie,this.password=new pn,this.fullname=new Ie,this.username.enabled=!0,this.username.label="Username",this.username.placeholder="Username",this.username.validation=new Ae,this.username.validation={maxLength:50,maxLengthMessage:"Username is too long",minLength:4,minLengthMessage:"Username is too short",required:!0,requiredMessage:"Username is required",pattern:Wn,patternMessage:"Username contains invalid characters"},this.fullname.enabled=!0,this.fullname.label="Full name",this.fullname.placeholder="Full name",this.fullname.validation=new Ae,this.fullname.validation={required:!0,requiredMessage:"Full name is required",minLength:2,minLengthMessage:"Full name doesn't match the minimum length of 2",pattern:Ft,patternMessage:"Full name contains invalid characters",maxLength:50,maxLengthMessage:"Full name is too long"}}loadConfigSettingsAndI18nMessages(e,n,t,a,d,C,F){let p="agent.manageAgency",E=new V(this.log,e,"config"),R=new V(this.log,n,"i18n");R.setProperties(this,[["string","manageSubAgencyLabel",`${p}.subAgency.label`],["string","viewSubAgenciesLabel",`${p}.viewSubAgencies.label`],["string","addNewUserLabel",`${p}.addNewUser.label`],["string","agencyInfoLabel",`${p}.agencyInfo.label`],["string","companyInfoLabel",`${p}.companyInfo.label`],["string","contactInformationLabel",`${p}.contactInformation.label`],["string","emailLabel",`${p}.email.label`],["string","addressLabel",`${p}.address.label`],["string","notesLabel",`${p}.notes.label`],["string","accountLabel",`${p}.account.label`],["string","primaryPhoneLabel",`${p}.primaryPhone.label`],["string","editLabel",`${p}.edit.label`],["string","editAgencyInfoLabel",`${p}.editAgencyInfo.label`],["string","updateButton","userProfile.updateButton.text"],["string","cancelButton","cancelButton.text"],["string","closeButton","closeButton.text"],["string","editCompanyInfoLabel",`${p}
1.editCompanyInfo.label`],["string","accessInfoLabel",`${p}.accessInfo.label`],["string","backToParentAgencyLabel",`${p}.backToParentAgency.label`],["string","parentAgencyLabel",`${p}.parentAgency.label`]]),E.setProperties(this,[["string","defaultAirportCode","agents.registration.closestAirport.defaultCode"]]),this.agencyUserManagementConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,""),this.agencyInfoFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,`${p}.agencyInfo`),this.agencyCreateUserFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,F,`${p}.createAgencyUser`),this.editUserFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,`${p}.editUser`),[{controlConfig:this.fullname,prefixConfig:"fullname"}].forEach(({controlConfig:k,prefixConfig:M})=>{R.setProperties(k,[["string","label",`${p}.${M}.label`],["string","placeholder",`${p}.${M}.placeholder`]]),R.setProperties(k.validation,[["string","requiredMessage",`${p}.${M}.validation.requiredMessage`],["string","patternMessage",`${p}.${M}.validation.patternMessage`]]),E.setProperties(k,[["boolean","enabled",`${p}.${M}.enabled`]]),E.setProperties(k.validation,[["boolean","required",`${p}.${M}.validation.required`],["string","pattern",`${p}.${M}.validation.pattern`]])}),E.setProperties(this.fullname.validation,[["int","maxLength",`${p}.fullname.validation.maxLength`],["int","minLength",`${p}.fullname.validation.minLength`]]),R.setProperties(this.fullname.validation,[["string","maxLengthMessage",`${p}.fullname.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.fullname.validation.minLengthMessage`]]),[{controlConfig:this.username,prefixConfig:"username"},{controlConfig:this.fullname,prefixConfig:"fullname"}].forEach(({controlConfig:k,prefixConfig:M})=>{R.setProperties(k,[["string","label",`${p}.${M}.label`],["string","placeholder",`${p}.${M}.placeholder`]]),R.setProperties(k.validation,[["string","requiredMessage",`${p}.${M}.validation.requiredMessage`],["string","patternMessage",`${p}.${M}.validation.patternMessage`]]),E.setProperties(k,[["boolean","enabled",`${p}.${M}.enabled`]]),E.setProperties(k.validation,[["boolean","required",`${p}.${M}.validation.required`],["string","pattern",`${p}.${M}.validation.pattern`]])}),E.setProperties(this.fullname.validation,[["int","maxLength",`${p}.fullname.validation.maxLength`],["int","minLength",`${p}.fullname.validation.minLength`]]),R.setProperties(this.fullname.validation,[["string","maxLengthMessage",`${p}.fullname.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.fullname.validation.minLengthMessage`]]),E.setProperties(this.username.validation,[["int","maxLength",`${p}.username.validation.maxLength`],["int","minLength",`${p}.username.validation.minLength`]]),R.setProperties(this.username.validation,[["string","maxLengthMessage",`${p}.username.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.username.validation.minLengthMessage`]]),this.password.loadConfigSettingsAndI18nMessages(p,e,n,this.log),[{inputConfiguration:this.agencyInfoFormConfiguration.profileInputConfiguration.notes,name:"agencyInfo.notes"},{inputConfiguration:this.editUserFormConfiguration.profileInputConfiguration.notes,name:"editUser.notes"}].forEach(k=>{let M=`${p}.${k.name}`;E.setInt(k.inputConfiguration.validation,"maxLength",`${M}.validation.maxLength`),R.setString(k.inputConfiguration.validation,"maxLengthMessage",`${M}.validation.maxLengthMessage`)})}static{this.\u0275fac=function(n){return new(n||i)(ie(H),ie(Se),ie(ct),ie(ne))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var Lg=["agencyInfoDetailTemplate"],Pg=["editUserTemplate"],Tg=["userDetailTemplate"],Fg=["createUserTemplate"],Rg=(i,m)=>[i,m],wd=i=>({"form-control":!0,"is-invalid":i}),Mg=(i,m)=>m.key;function kg(i,m){if(i&1){let e=L();r(0,"div",31),I("click",function(){u(e);let t=l();return f(t.editAgencyInfo())}),c(1),A(2,"i",32),s()}if(i&2){let e=l();o(),P(" (",e.configuration.editLabel,") ")}}function Ng(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function Ug(i,m){if(i&1&&(r(0,"div",40),K(1,Ng,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getFieldValidationErrors("fullname","createUserForm"))}}function Vg(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function Bg(i,m){if(i&1&&(r(0,"div",40),K(1,Vg,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getFieldValidationErrors("username","createUserForm"))}}function $g(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function Dg(i,m){if(i&1&&(r(0,"div",40),K(1,$g,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getPasswordValidationErrors("password"))}}function Hg(i,m){if(i&1){let e=L();r(0,"label",45)(1,"input",46),I("change",function(t){u(e);let a=l().$implicit,d=l(2);return f(d.userSecurityGroupsChanged(a.group.key,t.target.checked))}),s(),A(2,"span",47),v(3,"safeHtml"),s()}if(i&2){let e=l().$implicit,n=l(2);o(),_("name",e.group.name)("id",e.group.key)("checked",n.isUserSecurityGroupSelected(e.group.key))("value",e.group.key),me("aria-label",e.group.name),o(),_("innerHTML",S(3,6,e.group.name),$t)}}function Gg(i,m){if(i&1&&(ae(0,44),y(1,Hg,4,8,"label",45),re()),i&2){let e=m.$implicit;o(),b(e?1:-1)}}function Og(i,m){if(i&1){let e=L();r(0,"app-agent-create-modal",33),v(1,"async"),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("addressChanged",function(t){u(e);let a=l();return f(a.addressChanged(t))})("created",function(){u(e);let t=l();return f(t.onCreateUser())}),ae(2,34),r(3,"div",7)(4,"h5"),c(5),s(),r(6,"div",35)(7,"div",36)(8,"label",37),c(9),s(),r(10,"div",38),A(11,"input",39),y(12,Ug,3,0,"div",40),s()()(),r(13,"div",35)(14,"div",36)(15,"label",41),c(16),s(),r(17,"div",38),A(18,"input",42),y(19,Bg,3,0,"div",40),s()()()(),A(20,"app-new-password-control",43),y(21,Dg,3,0,"div",40),r(22,"div",7)(23,"div",35)(24,"div",36)(25,"label",37),c(26),s(),r(27,"div",38),K(28,Gg,2,1,"ng-container",44,Mg),s()()()(),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.agencyCreateUserFormConfiguration)("contactInformation",null)("isLoading",S(1,35,e.dataLoading$))("title",e.configuration.addNewUserL
1abel)("address",null)("creationState",e.creationAgencyUserStateSignal())("addressInputForm",e.addressCreateFormArray.controls[0])("formSubmitAttempt",e.formSubmitAttempt)("contactInformationForm",e.contactInfoCreateFormGroup)("agencyName",e.agencyInfo.name),o(5),g(e.configuration.accessInfoLabel),o(3),Q("ibe-data-required",!0),o(),g(e.configuration.fullname.label),o(2),Q("is-invalid",e.isFieldInValid("fullname","createUserForm")),_("formControl",e.fullnameControl)("placeholder",e.configuration.fullname.placeholder),o(),b(e.isFieldInValid("fullname","createUserForm")?12:-1),o(3),Q("ibe-data-required",!0),o(),g(e.configuration.username.label),o(2),Q("is-invalid",e.isFieldInValid("username","createUserForm")),_("formControl",e.usernameControl)("placeholder",e.configuration.username.placeholder),o(),b(e.isFieldInValid("username","createUserForm")?19:-1),o(),_("formControl",e.passwordControl)("configuration",e.configuration.password)("formSubmitAttempt",e.formSubmitAttempt)("isFullRow",!0),o(),b(e.isFieldInValid("password","createUserForm")?21:-1),o(4),Q("ibe-data-required",!1),o(),g(e.configuration.userGroupsLabel),o(2),Y(e.userSecurityGroupsSignal())}}function qg(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function jg(i,m){if(i&1&&(r(0,"div",40),K(1,qg,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getFieldValidationErrorsByConfig("notes","editAgencyInfoForm",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration))}}function Qg(i,m){if(i&1&&(r(0,"div",35)(1,"div",36)(2,"label",50),c(3),s(),r(4,"div",51),A(5,"textarea",52),y(6,jg,3,0,"div",40),r(7,"div",53),A(8,"i",54),r(9,"div",55),c(10),s()()()()()),i&2){let e=l(2);o(2),Q("ibe-data-required",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.validation.required),o(),g(e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.label),o(2),at(J(10,wd,e.isFieldInValid("notes","editAgencyInfoForm"))),_("readonly",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes==null?null:e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.readonly)("value",e.agencyInfo==null?null:e.agencyInfo.notes)("formControl",e.notesAgencyControl),o(),b(e.isFieldInValid("notes","editAgencyInfoForm")?6:-1),o(4),P(" ",e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.description," ")}}function Wg(i,m){if(i&1){let e=L();r(0,"app-agent-update-modal",48),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("addressChanged",function(t){u(e);let a=l();return f(a.addressChanged(t))})("updated",function(t){let a=u(e).$implicit,d=l();return f(d.onUpdateAgencyInfo(t,a))})("contactInformationChanged",function(t){u(e);let a=l();return f(a.agencyInfoChanged(t))}),ae(1,49),y(2,Qg,11,12,"div",35),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.agencyInfoFormConfiguration)("formSubmitAttempt",e.formSubmitAttempt)("address",e.agencyInfo.address)("contactInformation",e.agencyEditedInfo.contactInformation)("contactInformationForm",e.editAgencyInfoForm)("addressInputForm",e.addressEditAgencyFormArray==null?null:e.addressEditAgencyFormArray.controls[0]),o(2),b(e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.enabled?2:-1)}}function Kg(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function Yg(i,m){if(i&1&&(r(0,"div",40),K(1,Kg,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getFieldValidationErrorsByConfig("notes","editUserForm",e.configuration.editUserFormConfiguration.profileInputConfiguration))}}function Jg(i,m){if(i&1&&(r(0,"div",35)(1,"div",36)(2,"label",50),c(3),s(),r(4,"div",51),A(5,"textarea",52),y(6,Yg,3,0,"div",40),r(7,"div",53),A(8,"i",54),r(9,"div",55),c(10),s()()()()()),i&2){let e=l(2);o(2),Q("ibe-data-required",e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.validation.required),o(),g(e.configuration.agencyInfoFormConfiguration.profileInputConfiguration.notes.label),o(2),at(J(10,wd,e.isFieldInValid("notes","editUserForm"))),_("readonly",e.configuration.editUserFormConfiguration.profileInputConfiguration.notes==null?null:e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.readonly)("value",e.agencyInfo==null?null:e.agencyInfo.notes)("formControl",e.notesUserControl),o(),b(e.isFieldInValid("notes","editUserForm")?6:-1),o(4),P(" ",e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.description," ")}}function zg(i,m){if(i&1){let e=L();r(0,"app-agent-update-modal",48),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("addressChanged",function(t){u(e);let a=l();return f(a.addressChanged(t))})("updated",function(){let t=u(e).$implicit,a=l();return f(a.onUpdateUserInfo(t))})("contactInformationChanged",function(t){u(e);let a=l();return f(a.agencyInfoChanged(t))}),ae(1,49),y(2,Jg,11,12,"div",35),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.editUserFormConfiguration)("formSubmitAttempt",e.formSubmitAttempt)("address",e.currentUserSignal().address)("contactInformation",e.currentUserSignal().contactInformation)("contactInformationForm",e.editUserForm)("addressInputForm",e.addressEditUserFormArray==null?null:e.addressEditUserFormArray.controls[0]),o(2),b(e.configuration.editUserFormConfiguration.profileInputConfiguration.notes.enabled?2:-1)}}function Xg(i,m){if(i&1){let e=L();
1r(0,"app-agency-user-detail",56),I("updateUser",function(){let t=u(e).$implicit,a=l();return t==null||t.close(),f(a.onRequestEditUserDetail(a.currentUserSignal().key))})("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())}),s()}if(i&2){let e=l();_("configuration",e.configuration.agencyUserManagementConfiguration.agencyUserDetailConfiguration)("user",e.currentUserSignal())}}var Ed=(()=>{class i{constructor(e,n,t,a,d,C,F,p){this.configuration=e,this.router=n,this.store=t,this.log=a,this.modalService=d,this.formElementHelper=C,this.destroyRef=F,this.fb=p,this.agencyInfoDetailTemplate=be.required("agencyInfoDetailTemplate"),this.editUserTemplate=be.required("editUserTemplate"),this.userDetailTemplate=be.required("userDetailTemplate"),this.createUserTemplate=be.required("createUserTemplate"),this.dataLoading$=N([this.store.select(we),this.store.select(Ee),this.store.select(un),this.store.select(hn),this.store.select(_n),this.store.select(ft),this.store.select(xi),this.store.select(Ii)]).pipe(B(E=>!E.every(R=>!R))),this.parentAgencyName$=this.store.select(fn).pipe(B(E=>E.name)),this.editAgencyInfoForm=null,this.editCompanyInfoForm=null,this.editUserForm=null,this.createUserForm=null,this.formSubmitAttempt=!1,this.editAgencyPermission="ReservationsAdminAgenciesModify",this.editSubAgenciesPermission="ReservationsAdminAgenciesAgencySubAgenciesModify",this.agencyUsersSignal=this.store.selectSignal(wi),this.currentUserSignal=this.store.selectSignal(ht),this.creationAgencyUserStateSignal=this.store.selectSignal(Ei),this.airportsSignal=this.store.selectSignal(Ci),this.userSecurityGroupsSignal=this.store.selectSignal(Ai),this.selectedUserSecurityGroups=[],this.onResetCurrentUserDetail()}ngOnInit(){N([this.store.select(Ll),this.store.select(gn)]).pipe(Fe(this.destroyRef),$(([e])=>(0,It.isObject)(e))).subscribe(e=>{let[n,t]=e;this.agencyInfo=n;let a=t.find(d=>d.key===n?.agencyAccount?.company?.key);this.agencyInfo=U(T({},this.agencyInfo),{agencyAccount:U(T({},this.agencyInfo?.agencyAccount),{company:a})}),this.agencyEditedInfo=this.agencyInfo,this.store.dispatch(new rn(on,!0,n.key))}),N([this.store.select(te),this.store.select(X),this.store.select(pt),this.store.select(_t),this.store.select(gt),this.store.select(kt)]).pipe(Fe(this.destroyRef),$(([e,n])=>(0,It.isObject)(e)&&(0,It.isObject)(n))).subscribe(([e,n,t,a,d,C])=>{this.configuration.loadConfigSettingsAndI18nMessages(e,n,t,a,"adult",d,C)})}get addressEditAgencyFormArray(){return this.editAgencyInfoForm.controls.addressForm}get notesAgencyControl(){return this.editAgencyInfoForm.get("notes")}get addressEditUserFormArray(){return this.editUserForm.controls.addressForm}get notesUserControl(){return this.editUserForm.get("notes")}isFieldInValid(e,n){return this.formElementHelper.isFieldInValid(e,this[n],this.formSubmitAttempt)}getFieldValidationErrorsByConfig(e,n,t){return this.formElementHelper.getFieldValidationErrors(e,this[n],t[e].validation)}getFieldValidationErrors(e,n){return this.formElementHelper.getFieldValidationErrors(e,this[n],this.configuration[e].validation)}agencyInfoChanged(e){this.agencyEditedInfo=U(T({},this.agencyEditedInfo),{contactInformation:e.next})}addressChanged(e){this.agencyEditedInfo=U(T({},this.agencyEditedInfo),{address:e.next})}onUpdateUserInfo(e){if(this.formSubmitAttempt=!0,this.editUserForm.valid){let n=T({},this.editUserForm.value);delete n?.addressForm,delete n?.notes;let t=this.addressEditUserFormArray.controls[0].value,a=U(T({},this.currentUserSignal()),{contactInformation:T(T({},this.currentUserSignal().contactInformation),n),address:U(T(T({},this.currentUserSignal().address),t),{location:U(T({},this.currentUserSignal().address.location),{province:{code:t.province},country:{code:t.country}})}),notes:this.notesUserControl.value});this.store.dispatch(new ln(a.key,a,this.agencyInfo.key)),e.close()}}editAgencyInfo(){this.agencyInfo&&(this.editAgencyInfoForm=this.createAgencyInfoInputForm(this.agencyInfo,this.configuration.agencyInfoFormConfiguration)),this.formSubmitAttempt=!1,this.modalService.open(this.agencyInfoDetailTemplate(),{centered:!0}).result.then(()=>{})}onUpdateAgencyInfo(e,n){if(this.formSubmitAttempt=!0,this.editAgencyInfoForm.valid){this.addressEditAgencyFormArray?.controls[0];let t=U(T(T({},this.agencyInfo),this.agencyEditedInfo),{notes:this.notesAgencyControl.value});this.store.dispatch(new mt(t,!1,!0)),n?.close()}}ngOnDestroy(){this.store.dispatch(new gi(null))}onRequestEditUserDetail(e){this.onResetCurrentUserDetail(),this.store.dispatch(new sn(e)),this.store.select(ht).pipe(Fe(this.destroyRef),$(n=>(0,It.isObject)(n)&&!this.modalService.hasOpenModals()),Ne()).subscribe(n=>{this.editUserForm=this.createAgencyInfoInputForm(n,this.configuration.editUserFormConfiguration),this.formSubmitAttempt=!1,this.modalService.open(this.editUserTemplate(),{centered:!0}).result.then(()=>{})})}onRequestUserDetail(e){this.onResetCurrentUserDetail(),this.store.dispatch(new sn(e)),this.store.select(ht).pipe(Fe(this.destroyRef),$(n=>(0,It.isObject)(n)&&!this.modalService.hasOpenModals()),Ne()).subscribe(()=>{this.modalService.open(this.userDetailTemplate(),{centered:!0}).result.then(()=>{})})}onResetCurrentUserDetail(){this.store.dispatch(new ci(null)),this.store.dispatch(new di(null))}createAgencyInfoInputForm(e,n){return new Ve({name:new w(e.contactInformation.name,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.name)),mobileNumber:new w(e.contactInformation.mobileNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.mobileNumber)),faxNumber:new w(e.contactInformation.faxNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.faxNumber)),email:new w(e.contactInformation.email,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.email)),phoneNumber:new w(e.contactInformation.phoneNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.phoneNumber)),extension:new w(e.contactInformation.extension,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.extension)),notes:new w(e.notes,this.formElementHelper.createValidators(n.profileInputConfiguration.notes)),language:new w(e.contactInformation?.language?.code,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.language)),addressForm:new ze([tt.initAddressForm(this.formElementHelper,e.address,n.profileInputConfiguration.address)])})}createAddUserInputForm(e){return new Ve({name:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.name)),mobileNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.mobileNumber)),faxNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.faxNumber)),email:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.email)),phoneNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.phoneNumber)),extension:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.extension)),notes:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.notes)),language:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.language))})}onRequestChangeUserStatus(e){let n;e.activated?n=U(T({},e.user),{status:{active:!0,inactive:!1,pending:!1,denied:!1,historical:!1}}):n=U(T({},e.user),{status:{active:!1,inactive:!0,pending:!1,denied:!1,historical:!1}}),this.store.dispatch(new ln(n.key,n,this.agencyInfo.key))}backToParentAgency(){this.router.navigate([`/${Zt}`])}getPasswordValidationErrors(e){return this.formElementHelper.getFieldValidationErrors(e,this.createUserForm,this.configuration.password.newPassword.validation)}onCreateUser(){this.formSubmitAttempt=!0;let e=this.airportsSignal().find(t=>t.code===this.configuration.defaultAirportCode.toUpperCase()),n=this.addressCreateFormArray.controls[0].value;if(this.createUserForm.valid){let t={name:this.fullnameControl.value,agency:{key:this.agencyInfo.key},status:{active:!0,inactive:!1},userLogonName:this.usernameControl.value,password:this.passwordControl.value,closestAirport:e,address:U(T({},n),{location:{province:{code:n.province},country:{code:n.country}}}),contactInformation:this.contactInfoCreateFormGroup.value};this.store.dispatch(new pi(t,this.selectedUserSecurityGroups))}}onAddNewUser(){this.store.dispatch(new mi);let e=new Pt;e.location=new Tt,this.createUserForm=this.fb.group({fullname:new w("",this.formElementHelper.createValidators(this.configuration.fullname)),username:new w("",this.formElementHelper.createValidators(this.configuration.username)),password:new w("",this.formElementHelper.createValidators(this.configuration.password.newPassword,!0)),contactInputForm:this.createAddUserInputForm(this.configuration.agencyCreateUserFormConfiguration),addressInputForm:new ze([tt.initAddressForm(this.formElementHelper,e,this.configuration.agencyCreateUserFormConfiguration.profileInputConfiguration.address)])}),this.formSubmitAttempt=!1,this.modalService.open(this.createUserTemplate(),{centered:!0}).result.then(()=>{this.creationAgencyUserStateSignal()===nn.CreateSuccess&&this.store.dispatch(new rn(on,!0,this.agencyInfo.key))})}isUserSecurityGroupSelected(e){return(0,It.isArray)(this.selectedUserSecurityGroups)&&this.selectedUserSecurityGroups.includes(e)}
1userSecurityGroupsChanged(e,n){n===!0&&this.selectedUserSecurityGroups.includes(e)===!1?this.selectedUserSecurityGroups=[...this.selectedUserSecurityGroups,e]:n===!1&&this.selectedUserSecurityGroups.includes(e)===!0&&(this.selectedUserSecurityGroups=this.selectedUserSecurityGroups.filter(t=>t!==e))}get contactInfoCreateFormGroup(){return this.createUserForm.get("contactInputForm")}get addressCreateFormArray(){return this.createUserForm.controls.addressInputForm}get usernameControl(){return this.createUserForm.get("username")}get passwordControl(){return this.createUserForm.get("password")}get fullnameControl(){return this.createUserForm.get("fullname")}static{this.\u0275fac=function(n){return new(n||i)(h(po),h(Z),h(q),h(H),h(Be),h($e),h(Bt),h(Ye))}}static{this.\u0275cmp=D({type:i,selectors:[["app-manage-sub-agency"]],viewQuery:function(n,t){n&1&&Dt(t.agencyInfoDetailTemplate,Lg,5)(t.editUserTemplate,Pg,5)(t.userDetailTemplate,Tg,5)(t.createUserTemplate,Fg,5),n&2&&Ht(4)},standalone:!1,features:[W([po,jn])],decls:89,vars:46,consts:[["createUserTemplate",""],["agencyInfoDetailTemplate",""],["editUserTemplate",""],["userDetailTemplate",""],[3,"showSpinner"],[1,"page-body","container-fluid"],[1,"container-lg"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-between"],[1,"d-flex"],[1,"me-5"],[1,"fw-bold","fs-20"],[1,"h2","mb-0","text-primary"],[1,"align-content-end"],["type","button",1,"btn","btn-outline-primary","text-nowrap","rounded-pill",3,"click"],[1,"row","mt-3"],[1,"agency-info","col-12","col-md-7","py-4","border-bottom"],[1,"header","d-flex","justify-content-between"],[1,"fs-20","text-primary"],["class","pointer align-self-center",3,"click",4,"hasPermission"],[1,"body","row"],[1,"col-12","col-md-6","py-4"],[1,"fw-bold","mb-3","fs-18"],[1,"mt-3","contact-data--item","contact-data--item__phone-number"],[1,"contact-data--item","contact-data--item__phone-number"],[1,"col-12","py-4"],[1,"fw-bold","fs-18"],[1,"company-info","col-12","col-md-4","offset-md-1","py-4","border-bottom"],[1,"mt-3"],[3,"requestEditUserDetail","requestChangeUserStatus","requestAddNewUser","resetCurrentUserDetail","requestUserDetail","users","currentUser","dataLoading","configuration"],[1,"pointer","align-self-center",3,"click"],[1,"iasi","ic-hide","ic-edit-af","ms-1"],[3,"closedModal","addressChanged","created","configuration","contactInformation","isLoading","title","address","creationState","addressInputForm","formSubmitAttempt","contactInformationForm","agencyName"],["agentCreateModalContent",""],[1,"col-md-12"],[1,"form-group","row"],["for","create-fullname",1,"col-md-3","col-form-label"],[1,"col-md-8"],["type","text","id","create-fullname","name","fullname",1,"form-control",3,"formControl","placeholder"],[1,"invalid-feedback"],["for","registration-username",1,"col-md-3","col-form-label"],["type","text","id","registration-username","name","username",1,"form-control",3,"formControl","placeholder"],[3,"formControl","configuration","formSubmitAttempt","isFullRow"],[3,"formGroup"],[1,"align-middle","m-0","pointer","d-flex","flex-nowrap","mb-2","align-items-baseline"],["type","checkbox",1,"flex-shrink-0","ctm-checkbox","small","mono","me-3",3,"change","name","id","checked","value"],[3,"innerHTML"],[3,"closedModal","addressChanged","updated","contactInformationChanged","configuration","formSubmitAttempt","address","contactInformation","contactInformationForm","addressInputForm"],["agentUpdateModalContent",""],["htmlFor","notes",1,"h5","col-md-12","col-form-label"],[1,"col-md-8","offset-3"],["autocomplete","new-password","id","notes","rows","4",3,"readonly","value","formControl"],[1,"col-md-12","text-warning-dark","text-warning","fs-14","d-flex","mt-2"],[1,"iasi","ic-hide","ic-triangle-exclamation-af","me-2","fs-16"],[1,"fs-14","lh-12"],[3,"updateUser","closedModal","configuration","user"]],template:function(n,t){if(n&1){let a=L();A(0,"app-loading-spinner",4),v(1,"async"),r(2,"div",5)(3,"div",6)(4,"div",7)(5,"div",8)(6,"div",7)(7,"div",9)(8,"div",10)(9,"div",11)(10,"div",12),c(11),s(),r(12,"div",13),c(13),s()(),r(14,"div",14)(15,"div"),c(16),s(),r(17,"div",12),c(18),v(19,"async"),s()()(),r(20,"button",15),I("click",function(){return u(a),f(t.backToParentAgency())}),c(21),s()()()(),r(22,"div",8)(23,"div",16)(24,"div",17)(25,"div",18)(26,"div",19),c(27),s(),ce(28,kg,3,1,"div",20),s(),r(29,"div",21)(30,"div",22)(31,"div",23),c(32),s(),r(33,"div"),c(34),s(),r(35,"div"),c(36),s(),r(37,"div"),c(38),s(),r(39,"div"),c(40),s(),r(41,"div"),c(42),v(43,"customCountries"),s()(),r(44,"div",22)(45,"div",23),c(46),s(),r(47,"div"),c(48),s(),r(49,"div"),c(50),s(),r(51,"div",24),c(52),s(),r(53,"div",25),c(54),v(55,"ph
1oneNumber"),s()(),r(56,"div",26)(57,"div",27),c(58),s(),r(59,"div"),c(60),s()()()(),r(61,"div",28)(62,"div",18)(63,"div",19),c(64),s()(),r(65,"div",21)(66,"div",22)(67,"div",23),c(68),s(),r(69,"div"),c(70),s(),r(71,"div"),c(72),s(),r(73,"div",29),c(74),s(),r(75,"div"),c(76),v(77,"phoneNumber"),s()()()()()(),r(78,"div",8)(79,"app-agency-user-management",30),v(80,"async"),I("requestEditUserDetail",function(C){return u(a),f(t.onRequestEditUserDetail(C))})("requestChangeUserStatus",function(C){return u(a),f(t.onRequestChangeUserStatus(C))})("requestAddNewUser",function(){return u(a),f(t.onAddNewUser())})("resetCurrentUserDetail",function(){return u(a),f(t.onResetCurrentUserDetail())})("requestUserDetail",function(C){return u(a),f(t.onRequestUserDetail(C))}),s()()()()(),ce(81,Og,30,37,"ng-template",null,0,de)(83,Wg,3,7,"ng-template",null,1,de)(85,zg,3,7,"ng-template",null,2,de)(87,Xg,1,2,"ng-template",null,3,de)}n&2&&(_("showSpinner",S(1,31,t.dataLoading$)),o(11),g(t.configuration.manageSubAgencyLabel),o(2),g(t.agencyInfo.name),o(3),P(" ",t.configuration.parentAgencyLabel," "),o(2),P(" ",S(19,33,t.parentAgencyName$)," "),o(3),P(" ",t.configuration.backToParentAgencyLabel," "),o(6),g(t.configuration.agencyInfoLabel),o(),_("hasPermission",sa(43,Rg,t.editAgencyPermission,t.editSubAgenciesPermission)),o(4),g(t.configuration.addressLabel),o(2),g(t.agencyInfo.address==null?null:t.agencyInfo.address.address1),o(2),g(t.agencyInfo.address==null?null:t.agencyInfo.address.address2),o(2),g(t.agencyInfo.address==null?null:t.agencyInfo.address.city),o(2),g(t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.province==null?null:t.agencyInfo.address.location.province.name),o(2),P(" ",!(t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.country==null)&&t.agencyInfo.address.location.country.name?t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.country==null?null:t.agencyInfo.address.location.country.name:S(43,35,t.agencyInfo.address==null||t.agencyInfo.address.location==null||t.agencyInfo.address.location.country==null?null:t.agencyInfo.address.location.country.code)," "),o(4),g(t.configuration.contactInformationLabel),o(2),P("",t.configuration.emailLabel,":"),o(2),g(t.agencyInfo.contactInformation==null?null:t.agencyInfo.contactInformation.email),o(2),P("",t.configuration.primaryPhoneLabel,":"),o(2),P(" ",S(55,37,t.agencyInfo.contactInformation==null?null:t.agencyInfo.contactInformation.phoneNumber)," "),o(4),g(t.configuration.notesLabel),o(2),g(t.agencyInfo.notes),o(4),g(t.configuration.companyInfoLabel),o(4),g(t.configuration.accountLabel),o(2),P("",t.configuration.emailLabel,":"),o(2),g(t.agencyInfo.agencyAccount==null||t.agencyInfo.agencyAccount.company==null||t.agencyInfo.agencyAccount.company.contactInformation==null?null:t.agencyInfo.agencyAccount.company.contactInformation.email),o(2),P("",t.configuration.primaryPhoneLabel,":"),o(2),g(S(77,39,t.agencyInfo.agencyAccount==null||t.agencyInfo.agencyAccount.company==null||t.agencyInfo.agencyAccount.company.contactInformation==null?null:t.agencyInfo.agencyAccount.company.contactInformation.phoneNumber)),o(3),_("users",t.agencyUsersSignal())("currentUser",t.currentUserSignal())("dataLoading",S(80,41,t.dataLoading$))("configuration",t.configuration.agencyUserManagementConfiguration))},dependencies:[je,Qe,We,ge,yn,jt,Ke,bt,Gi,Hi,Sn,vn,z,Yt,Yn,Fi],encapsulation:2})}}return i})();var it=Ce(Re());var go=(()=>{class i{constructor(e,n){this.log=e,this.componentsConfigurationHelper=n,this.subAgenciesLabel="Sub Agencies",this.addNewSubAgencyLabel="Add New Sub Agency",this.agencyNameLabel="Agency Name",this.iataNumberLabel="IATA Number",this.includeInactiveLabel="Include Inactive",this.includeInactiveDescription="This will include agencies that are not currently active",this.searchLabel="Search",this.clearAllFieldsLabel="Clear all fields",this.agencyInfoLabel="Agency Infomation",this.agencyName=new Ie,this.iataNumber=new Ie,this.agenciesListConfiguration=new Qc,this.agencyCreateFormConfiguration=new An,this.editAgencyFormConfiguration=new nt,this.agencyTypeDefault="Travel Agency",this.iataNumber.enabled=!0,this.iataNumber.label="IATA Number",this.iataNumber.placeholder="IATA Number",this.iataNumber.validation=new Ae,this.iataNumber.validation={required:!1,requiredMessage:"IATA Number is required",minLength:2,minLengthMessage:"IATA Number doesn't match the minimum length of 2",pattern:
1Ft,patternMessage:"IATA Number contains invalid characters",maxLength:50,maxLengthMessage:"IATA Number is too long"},this.agencyName.enabled=!0,this.agencyName.label="Agency Name",this.agencyName.placeholder="Agency Name",this.agencyName.validation=new Ae,this.agencyName.validation={required:!0,requiredMessage:"Agency Name is required",minLength:2,minLengthMessage:"Agency Name doesn't match the minimum length of 2",pattern:Ft,patternMessage:"Agency Name contains invalid characters",maxLength:50,maxLengthMessage:"Agency Name is too long"}}loadConfigSettingsAndI18nMessages(e,n,t,a,d,C,F){let p="agent.subAgencies",E=new V(this.log,e,"config"),R=new V(this.log,n,"i18n");R.setProperties(this,[["string","subAgenciesLabel",`${p}.label`],["string","addNewSubAgencyLabel",`${p}.addNewSubAgency.label`],["string","agencyNameLabel",`${p}.agencyName.label`],["string","iataNumberLabel",`${p}.iataNumber.label`],["string","includeInactiveLabel",`${p}.includeInactive.label`],["string","includeInactiveDescription",`${p}.includeInactive.description`],["string","searchLabel",`${p}.search.label`],["string","clearAllFieldsLabel",`${p}.clearAllFields.label`],["string","agencyInfoLabel",`${p}.agencyInfo.label`]]),E.setProperties(this,[["string","agencyTypeDefault",`${p}.agencyType.default`]]),this.agenciesListConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,p),this.agencyCreateFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,F,`${p}.createSubAgency`),this.editAgencyFormConfiguration.loadConfigSettingsAndI18nMessages(e,n,this.log,this.componentsConfigurationHelper,t,a,d,C,`${p}.editAgency`),[{controlConfig:this.agencyName,prefixConfig:"agencyName"},{controlConfig:this.iataNumber,prefixConfig:"iataNumber"}].forEach(({controlConfig:k,prefixConfig:M})=>{R.setProperties(k,[["string","label",`${p}.${M}.label`],["string","placeholder",`${p}.${M}.placeholder`]]),R.setProperties(k.validation,[["string","requiredMessage",`${p}.${M}.validation.requiredMessage`],["string","patternMessage",`${p}.${M}.validation.patternMessage`]]),E.setProperties(k,[["boolean","enabled",`${p}.${M}.enabled`]]),E.setProperties(k.validation,[["boolean","required",`${p}.${M}.validation.required`],["string","pattern",`${p}.${M}.validation.pattern`]])}),E.setProperties(this.agencyName.validation,[["int","maxLength",`${p}.agencyName.validation.maxLength`],["int","minLength",`${p}.agencyName.validation.minLength`]]),R.setProperties(this.agencyName.validation,[["string","maxLengthMessage",`${p}.agencyName.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.agencyName.validation.minLengthMessage`]]),E.setProperties(this.iataNumber.validation,[["int","maxLength",`${p}.iataNumber.validation.maxLength`],["int","minLength",`${p}.iataNumber.validation.minLength`]]),R.setProperties(this.iataNumber.validation,[["string","maxLengthMessage",`${p}.iataNumber.validation.maxLengthMesssage`],["string","minLengthMessage",`${p}.iataNumber.validation.minLengthMessage`]]),[{inputConfiguration:this.editAgencyFormConfiguration.profileInputConfiguration.notes,name:"editAgency.notes"}].forEach(k=>{let M=`${p}.${k.name}`;E.setInt(k.inputConfiguration.validation,"maxLength",`${M}.validation.maxLength`),R.setString(k.inputConfiguration.validation,"maxLengthMessage",`${M}.validation.maxLengthMessage`)})}static{this.\u0275fac=function(n){return new(n||i)(ie(H),ie(ct))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac})}}return i})();var eu=["editAgencyTemplate"],tu=["createAgencyTemplate"],nu=i=>[i],iu=i=>({"form-control":!0,"is-invalid":i});function ou(i,m){if(i&1){let e=L();r(0,"button",39),I("click",function(){u(e);let t=l();return f(t.addNewSubAgency())}),c(1),s()}if(i&2){let e=l();o(),P(" ",e.configuration.addNewSubAgencyLabel," ")}}function au(i,m){if(i&1){let e=L();r(0,"button",40),I("click",function(){u(e);let t=l();return f(t.resetSearch())}),c(1),s()}if(i&2){let e=l();o(),P(" ",e.configuration.clearAllFieldsLabel," ")}}function ru(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function su(i,m){if(i&1&&(r(0,"div",49),K(1,ru,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getFieldValidationErrors("agencyName","createAgencyFormGroup"))}}function lu(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function cu(i,m){if(i&1&&(r(0,"div",52),K(1,lu,2,1,"div",null,oe),s()),i&2){let e=l(2);o(),Y(e.getFieldValidationErrors("iataNumber","createAgencyFormGroup"))}}function du(i,m){if(i&1){let e=L();r(0,"app-agent-create-modal",41),v(1,"async"),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("created",function(){u(e);let t=l();return f(t.onCreateAgency())}),ae(2,42),r(3,"div",43)(4,"div",44)(5,"h5",45),c(6),s(),r(7,"label",46),c(8),s(),r(9,"div",47),A(10,"input",48),y(11,su,3,0,"div",49),s()()(),r(12,"div",43)(13,"div",44)(14,"label",50),c(15),s(),r(16,"div",47),A(17,"input",51),y(18,cu,3,0,"div",52),s()()(),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.agencyCreateFormConfiguration)("contactInformation",null)("isLoading",S(1,36,e.dataLoading$))("title",e.configuration.addNewSubAgencyLabel)("agencyName",e.agencyInfo.name)("address",null)("formSubmitAttempt",e.formSubmitAttempt)("contactInformationForm",e.contactInputFormGroup)("companyInputForm",e.companyInputFormGroup)("availableCurrencies",e.availableCurrencies())("creationState",e.creationAgencyStateSignal())("addressInputForm",e.addressFormArray.controls[0]),o(6),g(e.configuration.agencyInfoLabel),o(),Q("ibe-data-required",!0),o(),g(e.configuration.agencyName.label),o(2),Q("is-invalid",e.isFieldInValid("agencyName","createAgencyFormGroup")),_("formControl",e.agencyNameControl)("placeholder",e.configuration.agencyName.placeholder),me("aria-label",e.configuration.agencyName.label)("aria-invalid",e.isFieldInValid("agencyName","createAgencyFormGroup"))("aria-describedby",e.isFieldInValid("agencyName","createAgencyFormGroup")?"agency-name-error":null),o(),b(e.isFieldInValid("agencyName","createAgencyFormGroup")?11:-1),o(3),Q("ibe-data-required",e.configuration.iataNumber.validation.required),o(),g(e.configuration.iataNumber.label),o(2),Q("is-invalid",e.isFieldInValid("iataNumber","createAgencyFormGroup")),_("formControl",e.iataNumberControl)("placeholder",e.configuration.iataNumber.placeholder),me("aria-label",e.configuration.iataNumber.label)("aria-required",e.configuration.iataNumber.validation.required)("aria-invalid",e.isFieldInValid("iataNumber","createAgencyFormGroup"))("aria-describedby",e.isFieldInValid("iataNumber","createAgencyFormGroup")?"iata-number-error":null),o(),b(e.isFieldInValid("iataNumber","createAgencyFormGroup")?18:-1)}}function mu(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function pu(i,m){if(i&1&&(r(0,"div",57),K(1,mu,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getFieldValidationErrors("iataNumber","editAgencyFormGroup"))}}function gu(i,m){if(i&1&&(r(0,"div",43)(1,"div",44)(2,"label",55),c(3),s(),r(4,"div",47),A(5,"input",56),y(6,pu,3,0,"div",57),s()()()),i&2){let e=l(2);o(2),Q("ibe-data-required",e.configuration.iataNumber.validation.required),o(),g(e.configuration.iataNumber.label),o(2),Q("is-invalid",e.isFieldInValid("iataNumber","editAgencyFormGroup")),_("formControl",e.iataNumberEditAgencyControl)("placeholder",e.configuration.iataNumber.placeholder),me("aria-label",e.configuration.iataNumber.label)("aria-required",e.configuration.iataNumber.validation.required)("aria-invalid",e.isFieldInValid("iataNumber","editAgencyFormGroup"))("aria-describedby",e.isFieldInValid("iataNumber","editAgencyFormGroup")?"edit-iata-number-error":null),o(),b(e.isFieldInValid("iataNumber","editAgencyFormGroup")?6:-1)}}function uu(i,m){if(i&1&&(r(0,"div"),c(1),s()),i&2){let e=m.$implicit;o(),g(e)}}function fu(i,m){if(i&1&&(r(0,"div",61),K(1,uu,2,1,"div",null,oe),s()),i&2){let e=l(3);o(),Y(e.getFieldValidationErrorsByConfig("notes","editAgencyFormGroup",e.configuration.editAgencyFormConfiguration.profileInputConfiguration))}}function hu(i,m){if(i&1&&(r(0,"div",43)(1,"div",44)(2,"label",58),c(3),s(),r(4,"div",59),A(5,"textarea",60),y(6,fu,3,0,"div",61),r(7,"div",62),A(8,"i",63),r(9,"div",64),
1c(10),s()()()()()),i&2){let e=l(2);o(2),Q("ibe-data-required",e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes.validation.required),o(),g(e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes.label),o(2),at(J(14,iu,e.isFieldInValid("notes","editAgencyFormGroup"))),_("readonly",e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes==null?null:e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes.readonly)("value",e.agencyInfo==null?null:e.agencyInfo.notes)("formControl",e.notesAgencyControl),me("aria-label",e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes.label)("aria-required",e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes.validation.required)("aria-invalid",e.isFieldInValid("notes","editAgencyFormGroup"))("aria-describedby",e.isFieldInValid("notes","editAgencyFormGroup")?"notes-error":null),o(),b(e.isFieldInValid("notes","editAgencyFormGroup")?6:-1),o(4),P(" ",e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes.description," ")}}function _u(i,m){if(i&1){let e=L();r(0,"app-agent-update-modal",53),v(1,"async"),I("closedModal",function(){let t=u(e).$implicit;return f(t==null?null:t.close())})("updated",function(){let t=u(e).$implicit,a=l();return f(a.onUpdateAgencyInfo(t))}),ae(2,54),y(3,gu,7,12,"div",43),y(4,hu,11,16,"div",43),re(),s()}if(i&2){let e=l();_("configuration",e.configuration.editAgencyFormConfiguration)("formSubmitAttempt",e.formSubmitAttempt)("address",e.selectingAgency.address)("isLoading",S(1,9,e.dataLoading$))("contactInformation",e.selectingAgency.contactInformation)("contactInformationForm",e.editAgencyFormGroup)("addressInputForm",e.addressEditAgencyFormArray==null?null:e.addressEditAgencyFormArray.controls[0]),o(3),b(e.configuration.iataNumber.enabled?3:-1),o(),b(e.configuration.editAgencyFormConfiguration.profileInputConfiguration.notes.enabled?4:-1)}}var Ld=(()=>{class i{constructor(e,n,t,a,d,C,F,p){this.configuration=e,this.router=n,this.store=t,this.log=a,this.modalService=d,this.formElementHelper=C,this.fb=F,this.destroyRef=p,this.editAgencyTemplate=be.required("editAgencyTemplate"),this.createAgencyTemplate=be.required("createAgencyTemplate"),this.dataLoading$=N([this.store.select(we),this.store.select(Ee),this.store.select(un),this.store.select(hn),this.store.select(_n),this.store.select(ft),this.store.select(pl),this.store.select(wl),this.store.select(yl)]).pipe(B(E=>!E.every(R=>!R))),this.agencyTypesSignal=this.store.selectSignal(bl),this.subAgencies$=this.store.select(gl).pipe($(E=>(0,it.isArray)(E)),Zo(E=>{this.totalSubAgencies=E?.length}),B(E=>{let R=E;return(0,it.isString)(this.agencyNameField.value)&&this.agencyNameField.value!==""&&(R=E.filter(k=>k.agency.name.toLowerCase().includes(this.agencyNameField.value.toLowerCase()))),(0,it.isString)(this.iataNumberField.value)&&this.iataNumberField.value!==""&&(R=E.filter(k=>k.agency.iataNumber.toLowerCase().includes(this.iataNumberField.value.toLowerCase()))),R})),this.agencies$=this.subAgencies$.pipe($(E=>(0,it.isArray)(E)),B(E=>E.map(R=>R.agency))),this.creationAgencyStateSignal=this.store.selectSignal(El),this.availableCurrencies=this.store.selectSignal(kt),this.formSubmitAttempt=!1,this.totalSubAgencies=0,this.subAgencyModifyPermission="ReservationsWebAgencySubAgencyModify",this.store.dispatch(new li),this.store.dispatch(new fr(!1)),this.searchFormGroup=this.fb.group({agencyName:new w,iataNumber:new w,includeInactive:new w(!1)})}ngOnInit(){N([this.store.select(te),this.store.select(X),this.store.select(pt),this.store.select(_t),this.store.select(gt),this.store.select(kt)]).pipe(Fe(this.destroyRef),$(([e,n])=>(0,it.isObject)(e)&&(0,it.isObject)(n))).subscribe(([e,n,t,a,d,C])=>{this.configuration.loadConfigSettingsAndI18nMessages(e,n,t,a,"adult",d,C);let F=new Pt;F.location=new Tt,this.createAgencyFormGroup=this.fb.group({agencyName:new w("",this.formElementHelper.createValidators(this.configuration.agencyName)),iataNumber:new w("",this.formElementHelper.createValidators(this.configuration.iataNumber)),contactInputForm:this.createAgencyInfoInputForm(this.configuration.agencyCreateFormConfiguration),addressInputForm:new ze([tt.initAddressForm(this.formElementHelper,F,this.configuration.agencyCreateFormConfiguration.profileInputConfiguration.address)]),c
1ompanyInputForm:Gc.initCompanyForm(this.formElementHelper,this.configuration.agencyCreateFormConfiguration.companyInputConfiguration)})}),N([this.store.select(fn),this.store.select(gn)]).pipe(Fe(this.destroyRef)).subscribe(e=>{let[n,t]=e;this.agencyInfo=n;let a=t.find(d=>d.key===n.agencyAccount?.company?.key);a&&(this.agencyInfo=U(T({},this.agencyInfo),{agencyAccount:U(T({},this.agencyInfo.agencyAccount),{company:a})})),this.fetchSubAgencies()})}get agencyNameField(){return this.searchFormGroup.get("agencyName")}get iataNumberField(){return this.searchFormGroup.get("iataNumber")}get includeInactiveField(){return this.searchFormGroup.get("includeInactive")}resetAgencyNameField(){this.agencyNameField.setValue(null)}resetIataNumberField(){this.iataNumberField.setValue(null)}addNewSubAgency(){this.store.dispatch(new Cr),this.modalService.open(this.createAgencyTemplate(),{centered:!0}).result.then(()=>{this.creationAgencyStateSignal()===nn.CreateSuccess&&this.fetchSubAgencies()})}onCreateAgency(){if(this.formSubmitAttempt=!0,this.createAgencyFormGroup.valid){let e=this.addressFormArray.controls[0].value,n=new Pt;n.location=new Tt;let a={agencyType:{key:this.agencyTypesSignal().find(d=>d.name===this.configuration.agencyTypeDefault).key},iataNumber:this.iataNumberControl.value??"",name:this.agencyNameControl.value,status:{active:!0,inactive:!1},directParentAgency:{key:this.agencyInfo.key},address:U(T(T({},n),e),{location:U(T({},n.location),{province:{code:e.province},country:{code:e.country}})}),contactInformation:T({},this.contactInputFormGroup.value),agencyAccount:{agencyAccount:!0,company:{account:{accountNumber:this.companyInputFormGroup.value.accountNumber,creditLimit:this.companyInputFormGroup.value.creditLimit,currency:this.companyInputFormGroup.value.currency},purchaseOrderRequired:this.companyInputFormGroup.value.purchaseOrderRequired,taxLicense1:this.companyInputFormGroup.value.taxLicense1,taxLicense2:this.companyInputFormGroup.value.taxLicense2}}};this.store.dispatch(new yr(a))}}get hasSearchCriteria(){return this.agencyNameField.value||this.iataNumberField.value||this.includeInactiveField.value}resetSearch(){this.searchFormGroup.patchValue({agencyName:null,iataNumber:null,includeInactive:!1})}onSearch(){this.searchFormGroup.valid&&this.fetchSubAgencies()}fetchSubAgencies(){this.store.dispatch(new pr(this.agencyInfo.key,this.includeInactiveField.value))}createAgencyInfoInputForm(e){return new Ve({name:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.name)),mobileNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.mobileNumber)),faxNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.faxNumber)),email:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.email)),phoneNumber:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.phoneNumber)),extension:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.extension)),notes:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.notes)),language:new w(null,this.formElementHelper.createValidators(e.profileInputConfiguration.businessContactInformation.language))})}createEditAgencyInfoInputForm(e,n){return new Ve({name:new w(e.contactInformation.name,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.name)),iataNumber:new w(e.iataNumber,this.formElementHelper.createValidators(this.configuration.iataNumber)),mobileNumber:new w(e.contactInformation.mobileNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.mobileNumber)),faxNumber:new w(e.contactInformation.faxNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.faxNumber)),email:new w(e.contactInformation.email,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.email)),phoneNumber:new w(e.contactInformation.phoneNumber,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.phoneNumber)),extension:new w(e.contactInformation.extension,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.extension)),notes:new w(e.notes,this.formElementHelper.createValidators(n.profileInputConfiguration.notes)),language:new w(e.contactInformation?.language?.code,this.formElementHelper.createValidators(n.profileInputConfiguration.businessContactInformation.language)),addressForm:new ze([tt.initAddressForm(this.formElementHelper,e.address,n.profileInputConfiguration.address)])})}isFieldInValid(e,n){return this.formElementHelper.isFieldInValid(e,this[n],this.formSubmitAttempt)}getFieldValidationErrorsByConfig(e,n,t){return this.formElementHelper.getFieldValidationErrors(e,this[n],t[e].validation)}getFieldValidationErrors(e,n){return this.formElementHelper.getFieldValidationErrors(e,this[n],this.configuration[e].validation)}get agencyNameControl(){return this.createAgencyFormGroup.get("agencyName")}get iataNumberControl(){return this.createAgencyFormGroup.get("iataNumber")}get contactInputFormGroup(){return this.createAgencyFormGroup.get("contactInputForm")}get companyInputFormGroup(){return this.createAgencyFormGroup.get("companyInputForm")}get addressFormArray(){return this.createAgencyFormGroup.get("addressInputForm")}onRequestChangeAgencyStatus(e){let n;e.activated?n=U(T({},e.agency),{status:{active:!0,inactive:!1,pending:!1,denied:!1,historical:!1}}):n=U(T({},e.agency),{status:{active:!1,inactive:!0,pending:!1,denied:!1,historical:!1}}),this.store.dispatch(new mt(n,!1))}get addressEditAgencyFormArray(){return this.editAgencyFormGroup.get("addressForm")}get iataNumberEditAgencyControl(){return this.editAgencyFormGroup.get("iataNumber")}get notesAgencyControl(){return this.editAgencyFormGroup.get("notes")}onRequestEditAgencyDetail(e){this.selectingAgency=e,this.editAgencyFormGroup=this.createEditAgencyInfoInputForm(e,this.configuration.editAgencyFormConfiguration),this.formSubmitAttempt=!1,this.modalService.open(this.editAgencyTemplate(),{centered:!0}).result.then(()=>{})}onUpdateAgencyInfo(e){if(this.formSubmitAttempt=!0,this.editAgencyFormGroup.valid){let n=T({},this.editAgencyFormGroup.value);delete n?.addressForm,delete n?.notes;let t=this.addressEditAgencyFormArray.controls[0].value,a=U(T({},this.selectingAgency),{iataNumber:this.iataNumberEditAgencyControl.value??void 0,contactInformation:T(T({},this.selectingAgency.contactInformation),n),address:U(T(T({},this.selectingAgency.address),t),{location:U(T({},this.selectingAgency.address.location),{province:{code:t.province},country:{code:t.country}})}),notes:this.notesAgencyControl.value});this.store.dispatch(new mt(a,!1)),e?.close()}}onRequestViewAgencyDetail(e){this.store.dispatch(new gi(e)),this.router.navigate([`/${Ya}`])}static{this.\u0275fac=function(n){return new(n||i)(h(go),h(Z),h(q),h(H),h(Be),h($e),h(Ye),h(Bt))}}static{this.\u0275cmp=D({type:i,selectors:[["app-sub-agencies"]],viewQuery:function(n,t){n&1&&Dt(t.editAgencyTemplate,eu,5)(t.createAgencyTemplate,tu,5),n&2&&Ht(2)},standalone:!1,features:[W([go])],decls:62,vars:26,consts:[["createAgencyTemplate",""],["editAgencyTemplate",""],[3,"showSpinner"],[1,"page-body","container-fluid"],[1,"container-lg"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-between"],[1,"d-flex"],[1,"fw-bold","fs-20"],[1,"h2","text-primary"],["type","button","class","btn btn-primary text-nowrap",3,"click",4,"hasPermission"],[1,"row","mt-3"],["novalidate","novalidate",1,"ui","form",3,"formGroup"],[1,"row","border-bottom","border-medium"],[1,"col-12","col-md-6","col-xl","border-md-right","border-medium"],[1,"row","p-3","ps-0"],[1,"col-12","ps-0"],[1,"form-group"],["for","agencyName",1,"col-12","col-form-label","fw-bold"],[1,"col-12","position-relative"],["type","text","formControlName","agencyName","id","agencyName",1,"form-control"],["type","button",1,"clear-date-selection","me-3","pointer","text-medium","border-0","bg-transparent",3,"click"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true"],["fill-rule","evenodd","clip-rule","evenodd","d","M24 21H7L0 13.028L7 5H24V21ZM7.91 7L2.658 13.023L7.905 19H22V7H7.91ZM14 11.586L16.586 9L18 10.414L15.414 13L18 15.586L16.586 17L14 14.414L11.414 17L10 15.586L12.586 13L10 10.414L11.414 9L14 11.586Z","fill","currentColor"],[1,"col-12","col-md-6","col-xl","text-primary","pe-0"],[1,"form-group","p-3","pe-0"],["for","iataNumber",1,"col-12","col-form-label","fw-bold"],["type","text","formControlName","iataNumber","id","iataNumber",1,"form-control"],[1,"my-3","fs-14","col-4","ps-0"],[1,"col-12","col-sm-auto"],[1,"align-middle","m-0","pointer","d-flex","flex-nowrap","align-items-baseline"],["type","checkbox","name","public-fares","id","public-fares","formControlName","includeInactive",1,"flex-shrink-0","ctm-checkbox","small","mono","me-3",3,"checked"],[1,"fw-bold"],[1,"row","mt-3","mb-3"],[1,"col"],["type","submit",1,"btn","btn-secondary","rounded-pill","text-nowrap",3,"click"],["type","button",1,"text-secondary","ms-3","pointer","border-0","bg-transparent"],[3,"requestEditAgencyDetail","requestViewAgencyDetail","requestChangeAgencyStatus","agencies","parentAgency","configuration"],["type","button",1,"btn","btn-primary","text-nowrap",3,"click"],["type","button",1,"text-secondary","ms-3","pointer","border-0","bg-transparent",3,"click"],[3,"closedModal","created","configuration","contactInformation","isLoading","title","agencyName","address","formSubmitAttempt","contactInformationForm","companyInputForm","availableCurrencies","creationState","addressInputForm"],["agentCreateModalContent",""],[1,"col-md-12"],[1,"form-group","row"],["
1id","agency-info-title",1,"mb-3"],["for","create-agencyname",1,"col-md-3","col-form-label"],[1,"col-md-8"],["type","text","id","create-agencyname","name","agencyName",1,"form-control",3,"formControl","placeholder"],["id","agency-name-error","role","alert",1,"invalid-feedback"],["for","create-iataNumber",1,"col-md-3","col-form-label"],["type","text","id","create-iataNumber","name","iataNumber",1,"form-control",3,"formControl","placeholder"],["id","iata-number-error","role","alert",1,"invalid-feedback"],[3,"closedModal","updated","configuration","formSubmitAttempt","address","isLoading","contactInformation","contactInformationForm","addressInputForm"],["agentUpdateModalContent",""],["for","edit-iataNumber",1,"col-md-3","col-form-label"],["type","text","id","edit-iataNumber","name","iataNumber",1,"form-control",3,"formControl","placeholder"],["id","edit-iata-number-error","role","alert",1,"invalid-feedback"],["for","notes",1,"h5","col-md-12","col-form-label"],[1,"col-md-8","offset-3"],["autocomplete","new-password","id","notes","rows","4",3,"readonly","value","formControl"],["id","notes-error","role","alert",1,"invalid-feedback"],["role","alert",1,"col-md-12","text-warning-dark","text-warning","fs-14","d-flex","mt-2"],["aria-hidden","true",1,"iasi","ic-hide","ic-triangle-exclamation-af","me-2","fs-16"],[1,"fs-14","lh-12"]],template:function(n,t){if(n&1){let a=L();A(0,"app-loading-spinner",2),v(1,"async"),r(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",5)(7,"div",7)(8,"div")(9,"div",8)(10,"div",9),c(11),s()(),r(12,"div",10),c(13),s()(),ce(14,ou,2,1,"button",11),s()()(),r(15,"div",6)(16,"div",12)(17,"form",13)(18,"div",14)(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18)(23,"label",19),c(24),s(),r(25,"div",20),A(26,"input",21),r(27,"button",22),I("click",function(){return u(a),f(t.resetAgencyNameField())}),uo(),r(28,"svg",23),A(29,"path",24),s()()()()()()(),fo(),r(30,"div",25)(31,"div",26)(32,"label",27),c(33),s(),r(34,"div",20),A(35,"input",28),r(36,"button",22),I("click",function(){return u(a),f(t.resetIataNumberField())}),uo(),r(37,"svg",23),A(38,"path",24),s()()()()()(),fo(),r(39,"div",14)(40,"div",29)(41,"div",5)(42,"div",30)(43,"label",31),A(44,"input",32),r(45,"div")(46,"span",33),c(47),s(),r(48,"div"),c(49),s()()()()()()(),r(50,"div",34)(51,"div",35)(52,"button",36),I("click",function(){return u(a),f(t.onSearch())}),c(53),s(),y(54,au,2,1,"button",37),s()()()()(),r(55,"div",6)(56,"app-agencies-list",38),v(57,"async"),I("requestEditAgencyDetail",function(C){return u(a),f(t.onRequestEditAgencyDetail(C))})("requestViewAgencyDetail",function(C){return u(a),f(t.onRequestViewAgencyDetail(C))})("requestChangeAgencyStatus",function(C){return u(a),f(t.onRequestChangeAgencyStatus(C))}),s()()()()(),ce(58,du,19,38,"ng-template",null,0,de)(60,_u,5,11,"ng-template",null,1,de)}n&2&&(_("showSpinner",S(1,20,t.dataLoading$)),o(11),g(t.configuration.subAgenciesLabel),o(2),g(t.agencyInfo.name),o(),_("hasPermission",J(24,nu,t.subAgencyModifyPermission)),o(3),_("formGroup",t.searchFormGroup),o(7),g(t.configuration.agencyNameLabel),o(2),me("aria-label",t.configuration.agencyNameLabel),o(),me("aria-label","Clear "+t.configuration.agencyNameLabel),o(6),g(t.configuration.iataNumberLabel),o(2),me("aria-label",t.configuration.iataNumberLabel),o(),me("aria-label","Clear "+t.configuration.iataNumberLabel),o(8),_("checked",t.includeInactiveField.value),me("aria-label",t.configuration.includeInactiveLabel),o(3),g(t.configuration.includeInactiveLabel),o(2),g(t.configuration.includeInactiveDescription),o(4),P(" ",t.configuration.searchLabel," "),o(),b(t.hasSearchCriteria?54:-1),o(2),_("agencies",S(57,22,t.agencies$))("parentAgency",t.agencyInfo)("configuration",t.configuration.agenciesListConfiguration))},dependencies:[qt,je,ga,Qe,We,ge,jt,Ke,Qt,bt,$c,Sn,vn,z],styles:[".clear-date-selection[_ngcontent-%COMP%]{position:absolute;top:20%;right:0}"]})}}return i})();var Cu=[{path:"",component:ed,canActivate:[Mn],children:[{path:"",redirectTo:Xn,pathMatch:"full"},{path:nr,component:Fc,canActivate:[ac],data:{searchResultUrl:`${pe}/${Xe}`,searchUrl:`${pe}/${Xe}`}},{path:Xn,component:_d,data:{configPrefix:En,enableKey:null,nextPage:`${pe}/${zn}`,breadcrumb:"agent.leftSideBar.dashboard.label"}},{path:Rt,component:md,canActivate:[he],data:{breadcrumb:"agent.leftSideBar.bookFlight.label",enableKey:"agent.leftSideBar.bookFlight.enabled"},children:[{path:"",redirectTo:Xe,pathMatch:"full"},{path:Xe,component:dd,canActivate:[he],canDeactivate:[Cn],data:{configPrefix:En,enableKey:null,nextPage:`${pe}/${zn}`,breadcrumb:"reusedText.flightSearch"}},{path:zn,component:rd,canActivate:[he,ic],canDeactivate:[Cn],data:{configPrefix:Ze,enableKey:null,nextPage:`${pe}/${Io}`,breadcrumb:"reusedText.passengers.label"}},{path:Io,component:sd,canActivate:[he],canDeactivate:[Cn],data:{configPrefix:Ze,enableKey:`${Ze}.seatsSelection.enabled`,nextPage:`${pe}/${xo}`,breadcrumb:"seatsSelection.pageHeader.title"}},{path:xo,component:ad,canActivate:[he],canDeactivate:[Cn],data:{configPrefix:Ze,enableKey:`${Ze}.extrasSelection.enabled`,nextPage:`${pe}/${Mt}`,breadcrumb:"extras.pageHeader.title"}},{path:Mt,component:od,canActivate:[oc],canDeactivate:[Cn],data:{configPrefix:Ze,enableKey:null,nextPage:null,breadcrumb:"reusedText.confirmAndPay"}},{path:ii,component:Ac,data:{configPrefix:Ze,enableKey:null,nextPage:null}},{path:tr,component:Sc,data:{configPrefix:Ze,enableKey:null,nextPage:null}}]},{path:"res",data:{breadcrumb:"agent.leftSideBar.reservation.label"},loadChildren:()=>import("./chunk-XQ75UNLH.js").then(i=>i.AgentResModule)},{path:Zn,component:vd,canActivate:[he],data:{configPrefix:null,enableKey:"agent.changePassword.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"application.changePassword.label"}},{path:ei,component:td,canActivate:[he],data:{configPrefix:null,enableKey:"agent.leftSideBar.alerts.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"agent.leftSideBar.alerts.label"}},{path:ti,canActivate:[he],data:{configPrefix:null,enableKey:"agent.leftSideBar.flightStatus.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"agent.leftSideBar.flightStatus.label",searchResultUrl:Na},loadChildren:()=>import("./chunk-5IW5SNKS.js").then(i=>i.FlightStatusModule)},{path:Ua,canActivate:[he],data:{configPrefix:null,enableKey:"agent.leftSideBar.report.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"agent.leftSideBar.report.label"},loadChildren:()=>import("./chunk-MSSS4XTK.js").then(i=>i.AgencyReportsModule)},{path:za,canActivate:[he],data:{configPrefix:null,enableKey:"agent.leftSideBar.makeDeposit.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"funds.depositCompany.pageTitle"},loadChildren:()=>import("./chunk-QMBFVMEE.js").then(i=>i.AgentDepositFundModule)},{path:Xa,canActivate:[he],data:{configPrefix:null,enableKey:"agent.leftSideBar.transferFunds.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"funds.depositCompany.transferFunds.label"},loadChildren:()=>import("./chunk-DDIHTRCK.js").then(i=>i.AgentTransferFundsModule)},{path:Oa,component:yd,canActivate:[he],data:{configPrefix:null,enableKey:"agent.leftSideBar.agentSignUpManagementPermission.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"agent.leftSideBar.agentSignUpManagement.label"}},{path:ja,component:xd,canActivate:[Mn,he],data:{configPrefix:null,enableKey:"agent.leftSideBar.agentManageAgency.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"agent.leftSideBar.agentManageAgency.label"}},{path:Wa,component:Ld,canActivate:[Mn,he],data:{configPrefix:null,enableKey:"agent.leftSideBar.agentSubAgencies.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"agent.leftSideBar.agentSubAgencies.label"}},{path:Ka,component:Ed,canActivate:[Mn,he],data:{configPrefix:null,enableKey:"agent.leftSideBar.agentManageSubAgency.enabled",nextPage:null,fallBackUrl:Me,breadcrumb:"agent.leftSideBar.agentManageSubAgency.label"}},{path:"**",redirectTo:Xn}]}],Pd=(()=>
1{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Hn({type:i})}static{this.\u0275inj=Dn({imports:[bo.forChild(Cu),bo]})}}return i})();var e1=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Hn({type:i})}static{this.\u0275inj=Dn({providers:[Pa,qc,jc,ji,al],imports:[pa,Pd,Aa,Vi,Ta,qn,ha,qi,Uc,Vc,Bc,Nc,xc,Tc,Wc,Kc,Ma,_a,so,ki,Ui,Ni,_c,Bi,Wi]})}}return i})();export{e1 as AgencyModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.