PageSourceSearch

https://www.base.be/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VR5CCD7G.js

js base.be collected 2026-10-01 11:45:31 UTC 300,034 bytes, 3 lines download raw bytes

1import{a as qa}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-V6H552WA.js";import{a as Eo,b as Ki}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-AJDOMMIS.js";import{a as ri}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GFK37ZEL.js";import{f as uo}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-I7JKRBOI.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-XFFUT5HO.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ES2GOXLD.js";import{a as co}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-MEANCS2Z.js";import{a as Wa}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-6GXQCSPF.js";import{a as we,b as fe,c as Ge,d as Oe,e as Me,f as We,g as pe}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-BVF44KUV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-UN4I5ARV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-II6HY24G.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-7KS57OA2.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-SNQA2H4L.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-2CVC5BBX.js";import{a as kn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VM6WTIWS.js";import{a as dt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-SRR7BYAK.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-RA6BOML4.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-XKZAHTSE.js";import{a as mo}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-AGJCFL6D.js";import{j as po}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-X5RNINAL.js";import{d as lo}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GM7QTX3Q.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3VE4T5X3.js";import{a as K}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-WB5FSQCV.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-NA7KRUKM.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-W5YER7AF.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-IGZIRJQN.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-JH7E5ALJ.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VDTBCEHH.js";import{A as so,a as H,e as ke,f as Ee,h as Fn,m as kt,n as Ni,w as Ln,x as $,y as oi}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GUJRV77H.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-OAFWGKHG.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-R6ATEHOJ.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-TMQTKFW7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ME6OOKIW.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-TZWBTES7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LXVF7CF2.js";import{b as je}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-MXMRLGMX.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-55LBUOLS.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-2IMUUWJB.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VXK3FO45.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ASPNFSTE.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-OTH5IOCH.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-5FXY6EHC.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-UYV7J5M3.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-FJVWFSSK.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-WSQHVBSB.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-KHZYCMEO.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LUVC62E7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-ZOQH4BRJ.js";import{d as Dn,wa as Hi}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-GWKWBQ3P.js";import{b as qi,c as ao}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-3KHHOKR7.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-NJNVRHKN.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-DKZN7K64.js";import"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-BYG2IWSB.js";import{C as ro,j as Ve,p as D,s as Pt,u as Qt}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-DKUNSAXA.js";import{A as le,C as be,E as ce,a as G,c,e as Be,f as ei,h as Lt,i as Bi,j as ti,o as ii,p as Yi,r as ji,s as Wi,t as ni,w as Ye}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-LBCPBUBK.js";import{A as re,Aa as io,C as Kn,E as zn,F as Le,Ja as no,Ka as Vi,Oa as oo,P as Rn,S as $n,W as Xn,aa as Gi,ba as Zn,n as ki,o as Hn,oa as Pi,qa as Ui,va as Qn,y as St,ya as eo,za as to}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-VLHNUVO3.js";import{e as z}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-KFW34AI3.js";import{ca as Jn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-G3XYAJPK.js";import{i as qn,k as Mn}from"/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-WXUJ2XVZ.js";import"@angular/core";import{CommonModule as zm}from"@angular/common";import"@angular/core";import"@ngxs/store";var $e=(function(t){return t.ASC="asc",t.DESC="desc",t})($e||{});var Ai=(function(t){return t.TOGGLE_UP="icon-chevron-up",t.TOGGLE_DOWN="icon-chevron-down",t.NO_TOGGLE="",t})(Ai||{});var Nt=class{static getSortOrder(o,e,i){return o===e?i===$e.ASC?$e.DESC:$e.ASC:$e.ASC}static getSortChevron(o,e,i){return o===e?i===$e.ASC?Ai.TOGGLE_UP:Ai.TOGGLE_DOWN:Ai.NO_TOGGLE}};import{Action as xi,Selector as bi,State as Ha}from"@ngxs/store";import"@angular/core";var ai=(function(t){return t.SET_SELECTED_TIP_CONTRACT="[TIP CONTRACTS OVERVIEW] Set Selected TIP Contract",t.SET_MODIFIED_TIP_CONTRACT="[TIP CONTRACTS OVERVIEW] Set Modified TIP Contract",t.SET_SHOW_CHANGE_TIP_CONTRACT_LIMITS_OVERLAY="[TIP CONTRACTS OVERVIEW] Set Show Change TIP Contract Overlay",t.SET_WARNING_ACTION="[TIP CONTRACTS OVERVIEW] Set Warning Context",t.GET_ALL_TIP_CONTRACTS="[TIP CONTRACTS OVERVIEW] Get All TIP Contracts",t})(ai||{}),tt=class{static{this.type=ai.SET_SELECTED_TIP_CONTRACT}constructor(o){this.payload=o}},Xe=class{static{this.type=ai.SET_MODIFIED_TIP_CONTRACT}constructor(o){this.payload=o}},ut=class{static{this.type=ai.SET_SHOW_CHANGE_TIP_CONTRACT_LIMITS_OVERLAY}constructor(o){this.payload=o}},Et=class{static{this.type=ai.GET_ALL_TIP_CONTRACTS}constructor(o){this.payload=o}},Ze=class{static{this.type=ai.SET_WARNING_ACTION}constructor(o){this.payload=o}};import{catchError as Ka,tap as za}from"rxjs";import{throwError as $a}from"rxjs";import*as $i from"@angular/core";var B=class zi{constructor(o){this.promotionService=o}static selectedTIPContract(o){return o.selectedTIPContract}static modifiedTIPContract(o){return o.modifiedTIPContract}static showChangeTIPContractLimitsOverlay(o){return o.showChangeTIPContractLimitsOverlay}static allTIPContracts(o){return o.allTIPContracts}static warningContext(o){return o.warningContext}setShowChangeTIPContractLimitsOverlay({patchState:o},{payload:e}){o({showChangeTIPContractLimitsOverlay:e})}setSelectedTIPContract({patchState:o},{payload:e}){o({selectedTIPContract:e})}setModifiedTIPContract({patchState:o},{payload:e}){o({modifiedTIPContract:e})}getAllTIPContracts(o,{payload:e}){return this.promotionService.getTIPContracts(e).pipe(za(i=>{o.patchState({allTIPContracts:i})}),Ka(i=>$a(()=>i)))}setWarningContext({patchState:o},{payload:e}){o({warningContext:e})}static{this.\u0275fac=function(e){return new(e||zi)($i.\u0275\u0275inject(pe))}}static{this.\u0275prov=$i.\u0275\u0275defineInjectable({token:zi,factory:zi.\u0275fac})}};G([xi(ut),c("design:type",Function),c("design:paramtypes",[Object,ut]),c("design:returntype",void 0)],B.prototype,"setShowChangeTIPContractLimitsOverlay",null);G([xi(tt),c("design:type",Function),c("design:paramtypes",[Object,tt]),c("design:returntype",void 0)],B.prototype,"setSelectedTIPContract",null);G([xi(Xe),c("design:type",Function),c("design:paramtypes",[Object,Xe]),c("design:returntype",void 0)],B.prototype,"setModifiedTIPContract",null);G([xi(Et),c("design:type",Function),c("design:paramtypes",[Object,Et]),c("design:returntype",void 0)],B.prototype,"getAllTIPContracts",null);G([xi(Ze),c("design:type",Function),c("design:paramtypes",[Object,Ze]),c("design:returntype",void 0)],B.prototype,"setWarningContext",null);G([bi(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Object)],B,"selectedTIPContract",null);G([bi(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Object)],B,"modifiedTIPContract",null);G([bi(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Boolean)],B,"showChangeTIPContractLimitsOverlay",null);G([bi(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Array)],B,"allTIPContracts",null);G([bi(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Object)],B,"warningContext",null);B=G([Ha({name:"tipContracts",defaults:{selectedTIPContract:void 0,modifiedTIPContract:void 0,showChangeTIPContractLimitsOverlay:!1,allTIPContracts:[],warningContext:void 0}}),c("design:paramtypes",[pe])],B);var u=(function(t){return t.ACCEPT_TIP_INVITATION="accept-tip-invitation",t.EDIT_TIP_CONTRACT="edit-tip-contract",t.EDIT_TIP_EMPLOYEES="edit-tip-employees",t.MIGRATE_TIP_PLAN="migrate-tip-plan",t.DEACTIVATE_TIP_EMPLOYEES="deactivate-tip-employees",t.RESEND_TIP_INVITE="resend-tip-invite",t.REVOKE_TIP_MIGRATION="revoke-tip-migration",t.REVOKE_TIP_DEACTIVATION="revoke-tip-deactivation",t.ADD_
1SINGLE_TIP_EMPLOYEE="add-single-tip-employee",t.ADD_MULTIPLE_TIP_EMPLOYEES="add-multiple-tip-employees",t.EMPTY="",t.DELETE_TIP_EMPLOYEES="delete-tip-employees",t.LIST_CONTRACTS="list-contracts",t.WARNING_MISSING_FRIENDLY_NAME="warning-missing-friendly-name",t})(u||{});import{Action as Bt,Selector as Yt,State as Xa}from"@ngxs/store";import"@angular/core";var At=(function(t){return t.SET_SELECTED_TIP_ACTION="[TIP] Set Selected TIP Action",t.SET_CUSTOMER_ZONE_PAGE_URL="[TIP] Set Customer zone page url",t.SET_MARKETING_PAGE_URL="[TIP] Set Marketing page url",t.SET_PRODUCTS="[TIP] Set Products",t.SET_ALLOWED_TO_PROCEED="[TIP] Set allowed to proceed",t.SET_MESSAGE="[TIP] Set Message",t.SET_SELECTED_CUSTOMER_TYPE="[TIP] Set Selected Customer Type",t})(At||{}),he=class{static{this.type=At.SET_SELECTED_TIP_ACTION}constructor(o){this.payload=o}},Gt=class{static{this.type=At.SET_CUSTOMER_ZONE_PAGE_URL}constructor(o){this.payload=o}},Ut=class{static{this.type=At.SET_MARKETING_PAGE_URL}constructor(o){this.payload=o}},Vt=class{static{this.type=At.SET_PRODUCTS}constructor(o){this.payload=o}},Je=class{static{this.type=At.SET_ALLOWED_TO_PROCEED}constructor(o){this.payload=o}},me=class{static{this.type=At.SET_MESSAGE}constructor(o){this.payload=o}},Qe=class{static{this.type=At.SET_SELECTED_CUSTOMER_TYPE}constructor(o){this.payload=o}};var Re=(function(t){return t.NEW_CUSTOMER="newCustomer",t.EXISTING_CUSTOMER="existingCustomer",t.EXISTING_DARWIN_CUSTOMER="existingDarwinCustomer",t.EXISTING_DARWIN_CUSTOMER_WITH_WRONG_BILLING_ACCOUNT="existingDarwinCustomerWithWrongBillingAccount",t.MAYBE_LEGACY_CUSTOMER="mayBeLegacyCustomer",t})(Re||{});var ue=(()=>{class t{static{this.TIP="TIP"}static{this.MESSAGE_GROUP="tip"}static{this.DATE_RANGE_FORMAT="YYYY-MM-DD"}static{this.MAX_YEARS_ALLOWED_IN_FUTURE=10}static{this.DATE_PATTERN=/(19|20)\d{2}\-(0[1-9]|1[0-2])\-(0[1-9]|1\d|2\d|3[01])/}static{this.OCAPI_ERROR_500="ocapi.500"}}return t})();var si=class{constructor(o,e,i,n){this.action=o,this.outcome=e,this.image=i,this.layout=n}getTitle(){return"ng.tip-general.info.title."+this.action+"-"+this.outcome}getSubtitle(){return"ng.tip-general.info.subtitle."+this.action+"-"+this.outcome}getImage(){return Qt.getImagePath(ue.TIP,this.image)}getLayout(){return this.layout}};import*as fo from"@angular/core";var M=class Xi{static selectedTIPActionName(o){return o.selectedTIPActionName}static customerZonePageUrl(o){return o.customerZonePageUrl}static products(o){return o.products}static marketingPageUrl(o){return o.marketingPageUrl}static allowedToProceed(o){return o.allowedToProceed}static message(o){return o.message}static selectedCustomerType(o){return o.selectedCustomerType}setTIPActionName({patchState:o},{payload:e}){o({selectedTIPActionName:e})}setCustomerZonePageUrl({patchState:o},{payload:e}){o({customerZonePageUrl:e})}setMarketingPageUrl({patchState:o},{payload:e}){o({marketingPageUrl:e})}setProductsAction({patchState:o},{payload:e}){o({products:e})}setAllowedToProceed({patchState:o},{payload:e}){o({allowedToProceed:e})}setMessage({patchState:o},{payload:e}){o({message:e})}setSelectedCustomerType({patchState:o},{payload:e}){o({selectedCustomerType:e})}static{this.\u0275fac=function(e){return new(e||Xi)}}static{this.\u0275prov=fo.\u0275\u0275defineInjectable({token:Xi,factory:Xi.\u0275fac})}};G([Bt(he),c("design:type",Function),c("design:paramtypes",[Object,he]),c("design:returntype",void 0)],M.prototype,"setTIPActionName",null);G([Bt(Gt),c("design:type",Function),c("design:paramtypes",[Object,Gt]),c("design:returntype",void 0)],M.prototype,"setCustomerZonePageUrl",null);G([Bt(Ut),c("design:type",Function),c("design:paramtypes",[Object,Ut]),c("design:returntype",void 0)],M.prototype,"setMarketingPageUrl",null);G([Bt(Vt),c("design:type",Function),c("design:paramtypes",[Object,Vt]),c("design:returntype",void 0)],M.prototype,"setProductsAction",null);G([Bt(Je),c("design:type",Function),c("design:paramtypes",[Object,Je]),c("design:returntype",void 0)],M.prototype,"setAllowedToProceed",null);G([Bt(me),c("design:type",Function),c("design:paramtypes",[Object,me]),c("design:returntype",void 0)],M.prototype,"setMessage",null);G([Bt(Qe),c("design:type",Function),c("design:paramtypes",[Object,Qe]),c("design:returntype",void 0)],M.prototype,"setSelectedCustomerType",null);G([Yt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",String)],M,"selectedTIPActionName",null);G([Yt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",String)],M,"customerZonePageUrl",null);G([Yt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Array)],M,"products",null);G([Yt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",String)],M,"marketingPageUrl",null);G([Yt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Boolean)],M,"allowedToProceed",null);G([Yt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",si)],M,"message",null);G([Yt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",String)],M,"selectedCustomerType",null);M=G([Xa({name:"tip",defaults:{selectedTIPActionName:u.EMPTY,customerZonePageUrl:"",marketingPageUrl:"",products:[],allowedToProceed:!0,message:void 0,selectedCustomerType:void 0,SetSelectedCustomerTypeAction:void 0}})],M);var S=(function(t){return t.SUCCESS="success",t.PARTIAL_SUCCESS="partial-success",t.REVIEW="review",t.FAILURE="failure",t.DUPLICATE="duplicate",t.CHANGES_ACTIVE_NOW="changes-active-now",t.CHANGES_ACTIVE_IN_FUTURE="changes-active-in-future",t.SUCCESS_LEGACY="success-legacy",t.FAILURE_LEGACY="failure-legacy",t.WARNING="warning",t.MISSING_CONTRACT="missing-contract",t.CONTRACT_NOT_FOUND="contract-not-found",t.WARNING_MISSING_FRIENDLY_NAME="warning-missing-friendly-name",t})(S||{});import*as E from"@angular/core";import*as rr from"@ngxs/store";import*as wt from"@angular/common";import*as ar from"@telenet/ng-lib-ocapi";import"@angular/core";import"@ngxs/store";import{ConfigConstants as _s}from"@telenet/ng-lib-config";import"@angular/material/dialog";import"@angular/core";import"@angular/material/dialog";import"@ngxs/store";import"@angular/core";var J=(function(t){return t.SUCCESS_LOGO="central-success-illustration.svg",t.SUCCESS_LOGO_NEW="edit-tip-contract-success.svg",t.EDIT_TIP_CONTRACT_WARNING="edit-tip-contract-warning-new.svg",t.MISSING_CONTRACT="missing-contract.svg",t.DEACTIVATE_EMPLOYEE_REVIEW="delete-employee.svg",t.MIGRATE_EMPLOYEE_REVIEW="review-migrate-employee.svg",t.REVOKE_DEACTIVATION_EMPLOYEE_REVIEW="revoke-deactivation.svg",t.ACCEPT_INVITATION_FAILURE="accept-invitation-failure.svg",t.ACCEPT_INVITATION_SUCCESS_LEGACY="accept-invitation-success-legacy.svg",t.DUPLICATE_EMPLOYEE_WARNING="duplicate-employee-warning.svg",t})(J||{});var Ae=(function(t){return t.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT="IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT",t.ONLY_TEXT_LAYOUT="ONLY_TEXT_LAYOUT",t})(Ae||{});import*as To from"@angular/core";var Ce=(()=>{class t{constructor(){this.tipMessageRegistry={},this.buildMessageFor(u.ADD_SINGLE_TIP_EMPLOYEE,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.ADD_SINGLE_TIP_EMPLOYEE,S.DUPLICATE,J.DUPLICATE_EMPLOYEE_WARNING),this.buildMessageFor(u.ADD_MULTIPLE_TIP_EMPLOYEES,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.ADD_MULTIPLE_TIP_EMPLOYEES,S.DUPLICATE,J.DUPLICATE_EMPLOYEE_WARNING),this.buildMessageFor(u.ADD_MULTIPLE_TIP_EMPLOYEES,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.EDIT_TIP_EMPLOYEES,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.EDIT_TIP_EMPLOYEES,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.EDIT_TIP_EMPLOYEES,S.DUPLICATE,J.DUPLICATE_EMPLOYEE_WARNING),this.buildMessageFor(u.RESEND_TIP_INVITE,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.RESEND_TIP_INVITE,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.DEACTIVATE_TIP_EMPLOYEES,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.DEACTIVATE_TIP_EMPLOYEES,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.DEACTIVATE_TIP_EMPLOYEES,S.REVIEW,J.DEACTIVATE_EMPLOYEE_REVIEW),this.buildMessageFor(u.MIGRATE_TIP_PLAN,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.MIGRATE_TIP_PLAN,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.MIGRATE_TIP_PLAN,S.REVIEW,J.MIGRATE_EMPLOYEE_REVIEW),this.buildMessageFor(u.REVOKE_TIP_DEACTIVATION,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.REVOKE_TIP_DEACTIVATION,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.REVOKE_TIP_DEACTIVATION,S.REVIEW,J.REVOKE_DEACTIVATION_EMPLOYEE_REVIEW),this.buildMessageFor(u.ACCEPT_TIP_INVITATION,S.SUCCESS,J.SUCCESS_LOGO,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.ACCEPT_TIP_INVITATION,S.FAILURE,J.ACCEPT_INVITATION_FAILURE,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.ACCEPT_TIP_INVITATION,S.SUCCESS_LEGACY,J.ACCEPT_INVITATION_SUCCESS_LEGACY,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.ACCEPT_TIP_INVITATION,S.FAILURE_LEGACY,J.ACCEPT_INVITATION_FAILURE,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.ACCEPT_TIP_INVITATION,S.MISSING_CONTRACT,J.MISSING_CONTRACT,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.EDIT_TIP_CONTRACT,S.CHANGES_ACTIVE_NOW,J.SUCCESS_LOGO_NEW,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.EDIT_TIP_CONTRACT,S.CHANGES_ACTIVE_IN_FUTURE,J.SUCCESS_LOGO_NEW,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.EDIT_TIP_CONTRACT,S.WARNING,J.EDIT_TIP_CONTRACT_WARNING,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.EDIT_TIP_CONTRACT,S.WARNING_MISSING_FRIENDLY_NAME,J.EDIT_TIP_CONTRACT_WARNING,Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT),this.buildMessageFor(u.REVOKE_TIP_MIGRATION,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.REVOKE_TIP_MIGRATION,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.REVOKE_TIP_MIGRATION,S.REVIEW,J.REVOKE_DEACTIVATION_EMPLOYEE_REVIEW),this.buildMessageFor(u.DELETE_TIP_EMPLOYEES,S.SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.DELETE_TIP_EMPLOYEES,S.PARTIAL_SUCCESS,J.SUCCESS_LOGO),this.buildMessageFor(u.DELETE_TIP_EMPLOYEES,S.REVIEW,J.DEACTIVATE_EMPLOYEE_REVIEW),this.buildMessageFor(u.LIST_CONTRACTS,S.CONTRACT_NOT_FOUND,void 0,Ae.ONLY_TEXT_LAYOUT)}buildMessageFor(e,i,n,p){let N=new si(e,i,n,p);this.tipMessageRegistry[this.generateKey(e,i)]=N}getMessage(e,i){return this.tipMessageRegistry[this.generateKey(e,i)]}generateKey(e,i){return`${e}-${i}`.toLowerCase()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=To.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();import*as Q from"@angular/core";import*as Io from"@angular/material/dialog";
1import*as vo from"@ngxs/store";import"@angular/core";import"@ngx-translate/core";import"@ngxs/store";import{Action as xe,Selector as rt,State as Za}from"@ngxs/store";import"@angular/core";import{append as Ja,patch as Gn,removeItem as Qa,updateItem as es}from"@ngxs/store/operators";var li=class{};var Se=(function(t){return t.SET_SELECTED_TIP_EMPLOYEE="[TIP EMPLOYEES] Set Selected TIP Employee",t.UNSET_SELECTED_TIP_EMPLOYEE="[TIP EMPLOYEES] Unset Selected TIP Employee",t.SELECT_ALL_TIP_EMPLOYEES="[TIP EMPLOYEES] Select All TIP Employees",t.RESET_SELECTED_EMPLOYEES="[TIP EMPLOYEES] Unselect All TIP Employees",t.SET_TIP_EMPLOYEES_SEARCH_FILTERS="[TIP EMPLOYEES] Set TIP Employees Search Filters",t.SET_SHOW_TIP_EMPLOYEES_SEARCH_FILTERS="[TIP EMPLOYEES] Set Show TIP Employees Search Filters",t.SET_IS_TIP_EMPLOYEE_SAVED="[TIP EMPLOYEES] Set Is TIP Employee Saved",t.SET_UPLOADED_EMPLOYEES="[TIP EMPLOYEES] Set Uploaded TIP Employees",t.SET_SELECTED_TIP_CONTRACT="[TIP EMPLOYEES] Set Selected TIP Contract",t.SET_CHANGE_EFFECTIVE_FROM_DATE="[TIP EMPLOYEES] Set Change Effective From Date",t.UPDATE_UPLOADED_TIP_EMPLOYEE_DETAILS="[TIP EMPLOYEES] Update Uploaded TIP Employee Details",t.SET_INVITED_TIP_EMPLOYEE="[TIP EMPLOYEES] Set Invited TIP Employee ",t.SET_SELECTED_TIP_EMPLOYEES="[TIP EMPLOYEES] Set Selected TIP Employees",t.SET_SELECTED_TIP_EMPLOYEES_TO_ACT_ON="[TIP EMPLOYEES] Set Selected TIP Employees to act on",t.VERIFY_TIP_EMPLOYEE_DETAILS="[TIP EMPLOYEES] Verify TIP Employee details",t.GET_ALL_TIP_EMPLOYEES="[TIP EMPLOYEES] Get all TIP Employees",t})(Se||{}),jt=class{static{this.type=Se.SET_SELECTED_TIP_EMPLOYEE}constructor(o){this.payload=o}},Wt=class{static{this.type=Se.UNSET_SELECTED_TIP_EMPLOYEE}constructor(o){this.payload=o}},qt=class{static{this.type=Se.SELECT_ALL_TIP_EMPLOYEES}constructor(o){this.payload=o}},bt=class{static{this.type=Se.RESET_SELECTED_EMPLOYEES}constructor(o=[]){this.payload=o}},it=class{static{this.type=Se.SET_TIP_EMPLOYEES_SEARCH_FILTERS}constructor(o){this.payload=o}},Tt=class{static{this.type=Se.SET_IS_TIP_EMPLOYEE_SAVED}constructor(o){this.payload=o}},nt=class{static{this.type=Se.SET_SHOW_TIP_EMPLOYEES_SEARCH_FILTERS}constructor(o){this.payload=o}},ot=class{static{this.type=Se.SET_SELECTED_TIP_CONTRACT}constructor(o){this.payload=o}},gt=class{static{this.type=Se.SET_CHANGE_EFFECTIVE_FROM_DATE}constructor(o){this.payload=o}},_t=class{static{this.type=Se.UPDATE_UPLOADED_TIP_EMPLOYEE_DETAILS}constructor(o){this.payload=o}},It=class{static{this.type=Se.SET_INVITED_TIP_EMPLOYEE}constructor(o){this.payload=o}},Ht=class{static{this.type=Se.SET_SELECTED_TIP_EMPLOYEES}constructor(o){this.payload=o}},vt=class{static{this.type=Se.SET_SELECTED_TIP_EMPLOYEES_TO_ACT_ON}constructor(o){this.payload=o}},Kt=class{static{this.type=Se.VERIFY_TIP_EMPLOYEE_DETAILS}constructor(o){this.payload=o}},zt=class{static{this.type=Se.GET_ALL_TIP_EMPLOYEES}constructor(o){this.payload=o}};import{catchError as ts,tap as go}from"rxjs";import{throwError as is}from"rxjs";import*as Ji from"@angular/core";var h=class Zi{constructor(o){this.promotionService=o}static selectedTIPEmployees(o){return o.selectedTIPEmployees}static selectedTIPEmployeesToActOn(o){return o.selectedTIPEmployeesToActOn}static tipEmployeesSearchFilters(o){return o.tipEmployeesSearchFilters}static showTIPEmployeesSearchFilters(o){return o.showTIPEmployeesSearchFilters}static isTIPEmployeeSaved(o){return o.isTIPEmployeeSaved}static changeEffectiveFromDate(o){return o.changeEffectiveFromDate}static allTIPEmployees(o){return o.allTIPEmployees}static selectedTIPContract(o){return o.selectedTIPContract}static invitedTIPEmployee(o){return o.invitedTIPEmployee}static verifiedTIPEmployee(o){return o.verifiedTIPEmployee}SetIsTIPEmployeeSavedAction({patchState:o},{payload:e}){o({isTIPEmployeeSaved:e})}setSelectedTIPEmployee(o,{payload:e}){o.setState(Gn({selectedTIPEmployees:Ja([e])}))}setSelectedTIPEmployeesToActOn({patchState:o},{payload:e}){o({selectedTIPEmployeesToActOn:this.enrichPayLoadWithSequenceNo(e)})}setSelectedTIPEmployees(o,{payload:e}){this.updateSelectedTIPEmployees(o,e)}unsetSelectedTIPEmployee(o,{payload:e}){o.setState(Gn({selectedTIPEmployees:Qa(i=>i.employeeReferenceNumber===e.employeeReferenceNumber&&i.emailAddress===e.emailAddress)}))}selectAllTIPEmployeesAction(o,{payload:e}){this.updateSelectedTIPEmployees(o,e)}resetSelectedTIPEmployeesAction(o,{payload:e}){this.updateSelectedTIPEmployees(o,e)}setTIPEmployeesSearchFilters({patchState:o},{payload:e}){o({tipEmployeesSearchFilters:e})}setShowTIPEmployeesSearchFilters({patchState:o},{payload:e}){o({showTIPEmployeesSearchFilters:e})}setSelectedTIPContractAction({patchState:o},{payload:e}){o({selectedTIPContract:e})}setChangeEffectiveFromDate({patchState:o},{payload:e}){o({changeEffectiveFromDate:e})}setInvitedTIPEmployee({patchState:o},{payload:e}){o({invitedTIPEmployee:e})}updateUploadedTIPEmployeeDetails(o,{payload:e}){o.setState(Gn({selectedTIPEmployeesToActOn:es(i=>i.sequence===e.sequence,e)}))}verifyTIPEmployeeDetailsAction(o,{payload:e}){return this.promotionService.verifyTIPEmployeeDetails(e.messageGroupName,e.customerAccountNumber,e.billingAccountNumber).pipe(go(i=>{o.patchState({verifiedTIPEmployee:i})}),ts(i=>is(()=>i)))}GetTIPEmployees(o,{payload:e}){return this.promotionService.getTIPEmployees(e).pipe(go(i=>{o.patchState({allTIPEmployees:i})}))}updateSelectedTIPEmployees({patchState:o},e){o({selectedTIPEmployees:e})}enrichPayLoadWithSequenceNo(o){for(let e=0;e<o.length;e++)o[e].sequence=e;return o}static{this.\u0275fac=function(e){return new(e||Zi)(Ji.\u0275\u0275inject(pe))}}static{this.\u0275prov=Ji.\u0275\u0275defineInjectable({token:Zi,factory:Zi.\u0275fac})}};G([xe(Tt),c("design:type",Function),c("design:paramtypes",[Object,Tt]),c("design:returntype",void 0)],h.prototype,"SetIsTIPEmployeeSavedAction",null);G([xe(jt),c("design:type",Function),c("design:paramtypes",[Object,jt]),c("design:returntype",void 0)],h.prototype,"setSelectedTIPEmployee",null);G([xe(vt),c("design:type",Function),c("design:paramtypes",[Object,vt]),c("design:returntype",void 0)],h.prototype,"setSelectedTIPEmployeesToActOn",null);G([xe(Ht),c("design:type",Function),c("design:paramtypes",[Object,Ht]),c("design:returntype",void 0)],h.prototype,"setSelectedTIPEmployees",null);G([xe(Wt),c("design:type",Function),c("design:paramtypes",[Object,Wt]),c("design:returntype",void 0)],h.prototype,"unsetSelectedTIPEmployee",null);G([xe(qt),c("design:type",Function),c("design:paramtypes",[Object,qt]),c("design:returntype",void 0)],h.prototype,"selectAllTIPEmployeesAction",null);G([xe(bt),c("design:type",Function),c("design:paramtypes",[Object,bt]),c("design:returntype",void 0)],h.prototype,"resetSelectedTIPEmployeesAction",null);G([xe(it),c("design:type",Function),c("design:paramtypes",[Object,it]),c("design:returntype",void 0)],h.prototype,"setTIPEmployeesSearchFilters",null);G([xe(nt),c("design:type",Function),c("design:paramtypes",[Object,nt]),c("design:returntype",void 0)],h.prototype,"setShowTIPEmployeesSearchFilters",null);G([xe(ot),c("design:type",Function),c("design:paramtypes",[Object,ot]),c("design:returntype",void 0)],h.prototype,"setSelectedTIPContractAction",null);G([xe(gt),c("design:type",Function),c("design:paramtypes",[Object,gt]),c("design:returntype",void 0)],h.prototype,"setChangeEffectiveFromDate",null);G([xe(It),c("design:type",Function),c("design:paramtypes",[Object,It]),c("design:returntype",void 0)],h.prototype,"setInvitedTIPEmployee",null);G([xe(_t),c("design:type",Function),c("design:paramtypes",[Object,_t]),c("design:returntype",void 0)],h.prototype,"updateUploadedTIPEmployeeDetails",null);G([xe(Kt),c("design:type",Function),c("design:paramtypes",[Object,Kt]),c("design:returntype",void 0)],h.prototype,"verifyTIPEmployeeDetailsAction",null);G([xe(zt),c("design:type",Function),c("design:paramtypes",[Object,zt]),c("design:returntype",void 0)],h.prototype,"GetTIPEmployees",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Array)],h,"selectedTIPEmployees",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Array)],h,"selectedTIPEmployeesToActOn",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",li)],h,"tipEmployeesSearchFilters",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Boolean)],h,"showTIPEmployeesSearchFilters",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],h,"isTIPEmployeeSaved",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",String)],h,"changeEffectiveFromDate",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Array)],h,"allTIPEmployees",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Object)],h,"selectedTIPContract",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",We)],h,"invitedTIPEmployee",null);G([rt(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",We)],h,"verifiedTIPEmployee",null);h=G([Za({name:"tipEmployees",defaults:{selectedTIPEmployees:[],invitedTIPEmployee:new We,verifiedTIPEmployee:new We,tipEmployeesSearchFilters:void 0,showTIPEmployeesSearchFilters:!1,isTIPEmployeeSaved:!1,selectedTIPContract:void 0,changeEffectiveFromDate:"",selectedTIPEmployeesToActOn:[],allTIPEmployees:[]}}),c("design:paramtypes",[pe])],h);import*as _ from"@angular/core";
1import*as _o from"@ngxs/store";import*as Qi from"@ngx-translate/core";import*as en from"@angular/common";var os=["*"];function rs(t,o){if(t&1&&(_.\u0275\u0275elementContainerStart(0),_.\u0275\u0275elementStart(1,"h4",2),_.\u0275\u0275text(2),_.\u0275\u0275pipe(3,"translate"),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(4,"div",3),_.\u0275\u0275element(5,"span",4),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementContainer(6,5),_.\u0275\u0275elementContainerEnd()),t&2){let e=_.\u0275\u0275nextContext(2),i=_.\u0275\u0275reference(2);_.\u0275\u0275advance(2),_.\u0275\u0275textInterpolate(_.\u0275\u0275pipeBind1(3,3,e.getTitle())),_.\u0275\u0275advance(3),_.\u0275\u0275property("innerHTML",e.getSubTitle(),_.\u0275\u0275sanitizeHtml),_.\u0275\u0275advance(),_.\u0275\u0275property("ngTemplateOutlet",i)}}function as(t,o){if(t&1&&(_.\u0275\u0275elementContainerStart(0),_.\u0275\u0275elementStart(1,"div",6),_.\u0275\u0275element(2,"div",7),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(3,"div",8),_.\u0275\u0275text(4),_.\u0275\u0275pipe(5,"translate"),_.\u0275\u0275elementEnd(),_.\u0275\u0275element(6,"div",9),_.\u0275\u0275elementStart(7,"div",10),_.\u0275\u0275elementContainer(8,5),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementContainerEnd()),t&2){let e=_.\u0275\u0275nextContext(2),i=_.\u0275\u0275reference(2);_.\u0275\u0275advance(2),_.\u0275\u0275property("inlineSVG",e.getImagePath()),_.\u0275\u0275advance(2),_.\u0275\u0275textInterpolate1(" ",_.\u0275\u0275pipeBind1(5,4,e.getTitle())," "),_.\u0275\u0275advance(2),_.\u0275\u0275property("innerHTML",e.getSubTitle(),_.\u0275\u0275sanitizeHtml),_.\u0275\u0275advance(2),_.\u0275\u0275property("ngTemplateOutlet",i)}}function ss(t,o){if(t&1&&(_.\u0275\u0275elementContainerStart(0),_.\u0275\u0275elementStart(1,"div",11)(2,"div",12),_.\u0275\u0275element(3,"div",7),_.\u0275\u0275elementEnd(),_.\u0275\u0275elementStart(4,"div",13)(5,"div",14)(6,"h2",15),_.\u0275\u0275text(7),_.\u0275\u0275pipe(8,"translate"),_.\u0275\u0275elementEnd(),_.\u0275\u0275element(9,"div",16),_.\u0275\u0275elementStart(10,"div",17),_.\u0275\u0275elementContainer(11,5),_.\u0275\u0275elementEnd()()()(),_.\u0275\u0275elementContainerEnd()),t&2){let e=_.\u0275\u0275nextContext(2),i=_.\u0275\u0275reference(2);_.\u0275\u0275advance(3),_.\u0275\u0275property("inlineSVG",e.getImagePath()),_.\u0275\u0275advance(4),_.\u0275\u0275textInterpolate(_.\u0275\u0275pipeBind1(8,4,e.getTitle())),_.\u0275\u0275advance(2),_.\u0275\u0275property("innerHTML",e.getSubTitle(),_.\u0275\u0275sanitizeHtml),_.\u0275\u0275advance(2),_.\u0275\u0275property("ngTemplateOutlet",i)}}function ls(t,o){if(t&1&&(_.\u0275\u0275elementContainerStart(0),_.\u0275\u0275template(1,rs,7,5,"ng-container",1)(2,as,9,6,"ng-container",1)(3,ss,12,6,"ng-container",1),_.\u0275\u0275elementContainerEnd()),t&2){let e=_.\u0275\u0275nextContext();_.\u0275\u0275advance(),_.\u0275\u0275property("ngIf",e.getLayout()===e.onlyTextLayout),_.\u0275\u0275advance(),_.\u0275\u0275property("ngIf",e.getLayout()===void 0),_.\u0275\u0275advance(),_.\u0275\u0275property("ngIf",e.getLayout()===e.imageLeftTextRightAlignedLayout)}}function ps(t,o){t&1&&_.\u0275\u0275projection(0,0,["[select]","button"])}var qe=(()=>{class t extends D{constructor(e,i){super(),this.store=e,this.translateService=i,this.onlyTextLayout=Ae.ONLY_TEXT_LAYOUT,this.imageLeftTextRightAlignedLayout=Ae.IMAGE_LEFT_TEXT_RIGHT_ALIGNED_LAYOUT}ngOnInit(){this.tipMessage=this.store.selectSnapshot(M.message)}getImagePath(){return this.tipMessage.getImage()}getLayout(){return this.tipMessage.getLayout()}getTitle(){if(this.tipMessage.outcome===S.REVIEW)return this.getTitleForTIPEmployeeActionReview();let e=this.tipMessage.getTitle();return this.translateService.instant(e)}getSubTitle(){if([u.DEACTIVATE_TIP_EMPLOYEES,u.MIGRATE_TIP_PLAN].includes(this.tipMessage.action)&&this.tipMessage.outcome===S.REVIEW)return this.getSubtitleForDeactivateOrMigrateTIPEmployeeReview();if(this.tipMessage.action===u.MIGRATE_TIP_PLAN&&[S.PARTIAL_SUCCESS,S.SUCCESS].includes(this.tipMessage.outcome))return this.getSubtitleForMigrateTipPlanSuccess();let e=this.tipMessage.getSubtitle();if(this.tipMessage.action===u.ACCEPT_TIP_INVITATION&&this.tipMessage.outcome===S.SUCCESS){let i=this.store.selectSnapshot(h.invitedTIPEmployee);return this.translateService.instant(e,{companyName:i.company})}return this.translateService.instant(e)}getTitleForTIPEmployeeActionReview(){let e="",i=this.tipMessage.getTitle(),p=this.getTIPEmployeesWithActionRequired().length;return e=this.translateService.instant(i,{noOfEmployees:p}),e}getSubtitleForDeactivateOrMigrateTIPEmployeeReview(){let e="",i=this.tipMessage.getSubtitle(),n=this.store.selectSnapshot(h.changeEffectiveFromDate);n=n.slice(0,10);let p=n.split("-");return n=p[2]+"/"+p[1]+"/"+p[0],e=this.translateService.instant(i,{changeEffectiveFromDate:n}),e}getTIPEmployeesWithActionRequired(){let e=this.store.selectSnapshot(h.selectedTIPEmployeesToActOn);return re(e,i=>i.actionRequired)}getSubtitleForMigrateTipPlanSuccess(){let e="";e=this.tipMessage.getSubtitle();let i=this.store.selectSnapshot(h.changeEffectiveFromDate);i=i.slice(0,10);let n=je().format(ue.DATE_RANGE_FORMAT);return i===n?e=e.concat("-").concat("todays-date"):e=e.concat("-").concat("future-date"),this.translateService.instant(e)}static{this.\u0275fac=function(i){return new(i||t)(_.\u0275\u0275directiveInject(_o.Store),_.\u0275\u0275directiveInject(Qi.TranslateService))}}static{this.\u0275cmp=_.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-messaging"]],standalone:!1,features:[_.\u0275\u0275InheritDefinitionFeature],ngContentSelectors:os,decls:3,vars:1,consts:[["button",""],[4,"ngIf"],[1,"heading--notopmargin","overlay__section__content__title"],[1,"overlay__section__content__description","pt--m","mb--l"],[1,"line-height--24",3,"innerHTML"],[3,"ngTemplateOutlet"],[1,"mb--xl","mt--xxxl--md","text-align--center"],[3,"inlineSVG"],[1,"text-align--center","text--l--sm","text--xxm","font-weight--black","mb--l"],[1,"text-align--center","text--xm--sm","text--m","mb--xl","line-height--24",3,"innerHTML"],[1,"text-align--center"],[1,"row","px--n--md","px--s"],[1,"col-md-4","col-xs-12","justify-content--end--md","justify-content--center","align-items--center","display--flex"],[1,"col-sm-7","col-xs-12","justify-content--center--sm","align-items--center--sm","display--flex","mb--xxl--md"],[1,"pt--xxl--md","pr--xxxl--md","pt--s"],[1,"heading--nomargin","pb--m"],[1,"font--body-small",3,"innerHTML"],[1,"px--n--md","text-align--left","pt--l"]],template:function(i,n){i&1&&(_.\u0275\u0275projectionDef(),_.\u0275\u0275template(0,ls,4,3,"ng-container",1)(1,ps,1,0,"ng-template",null,0,_.\u0275\u0275templateRefExtractor)),i&2&&_.\u0275\u0275property("ngIf",n.tipMessage)},dependencies:[en.NgIf,en.NgTemplateOutlet,qi,Qi.TranslatePipe],encapsulation:2})}}return t})();import*as ho from"@ngx-translate/core";var yo=(()=>{class t extends D{constructor(e,i,n){super(),this.dialogRef=e,this.store=i,this.tipMessagingService=n}ngOnInit(){let e=this.tipMessagingService.getMessage(u.LIST_CONTRACTS,S.CONTRACT_NOT_FOUND);this.store.dispatch(new me(e))}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(i){return new(i||t)(Q.\u0275\u0275directiveInject(Io.MatDialogRef),Q.\u0275\u0275directiveInject(vo.Store),Q.\u0275\u0275directiveInject(Ce))}}static{this.\u0275cmp=Q.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-contract-not-found"]],standalone:!1,features:[Q.\u0275\u0275InheritDefinitionFeature],decls:16,vars:3,consts:[[1,"tip-overview__overlay"],[1,"overlay","missing-contract--overlay"],[1,"overlay__mask","opacity--no-transparency"],[1,"overlay__section"],[1,"background-white"],[1,"overlay__section__content","width--full"],[1,"overlay__section__content__close"],[1,"icon","icon-cross",3,"click"],[1,"px--xxxl"],["ngProjectAs","[button]",5,["","button",""]],[1,"overlay__section__content__action","justify-content--center"],[1,"end-journey__section__content__action","mt--l"],[1,"button","button--primary",3,"click"]],template:function(i,n){i&1&&(Q.\u0275\u0275elementStart(0,"div",0)(1,"div",1),Q.\u0275\u0275element(2,"div",2),Q.\u0275\u0275elementStart(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7),Q.\u0275\u0275listener("click",function(){return n.onClose()}),Q.\u0275\u0275elementEnd()(),Q.\u0275\u0275elementStart(8,"div",8)(9,"app-tip-messaging"),Q.\u0275\u0275elementContainerStart(10,9),Q.\u0275\u0275elementStart(11,"div",10)(12,"div",11)(13,"button",12),Q.\u0275\u0275listener("click",function(){return n.onClose()}),Q.\u0275\u0275text(14),Q.\u0275\u0275pipe(15,"translate"),Q.\u0275\u0275elementEnd()()(),Q.\u0275\u0275elementContainerEnd(),Q.\u0275\u0275elementEnd()()()()()()()),i&2&&(Q.\u0275\u0275advance(14),Q.\u0275\u0275textInterpolate1(" ",Q.\u0275\u0275pipeBind1(15,1,"ng.tip-contracts-overview.contract-not-found.btn.close")," "))},dependencies:[qe,ho.TranslatePipe],encapsulation:2})}}return t})();import"@ngx-translate/core";var de=(()=>{class t{static{this.ONLINE_ACCOUNT_LOGO="online-account.svg"}static{this.TOP_OF_YOUR_INVOICE_LOGO="top-of-your-invoice.svg"}static{this.MESSAGE_GROUP_NAME="accept-tip-invitation"}static{this.CUSTOM_MESSAGE_GROUP_NAME="custom-accept-tip-invitation"}static{this.STATUS_FAILURE="FAILURE"}static{this.MESSAGE_GROUP_NAME_NON_BLOCKING_ERROR="accept-tip-invitation-non-blocking-error"}static{this.ERROR_CODE_TIP_CONTRACT_PDF_NOT_FOUND="ocapi.404-OCAPI-ERR-ODTP404"}static{this.TELENET_LOGO="logo-telenet.svg"}static{this.ERROR_CODE_FOR_INVALID_ACCOUNT_DETAILS="ocapi.404-OCAPI-ERR-ODTP404"}static{this.ERROR_CODE_FOR_INVALID_CUSTOMER_NUMBER="ocapi.404-OCAPI-ERR-ODTP4010"}}return t})();import*as a from"@angular/core";import*as So from"@ngxs/store";import*as Po from"@telenet/ng-lib-config";import*as No from"@angular/material/dialog";
1import*as on from"@ngx-translate/core";import*as at from"@angular/common";import"@angular/core";var ie=(function(t){return t.TIP_EMPLOYEE_FORM="TIP-EMPLOYEE-FORM",t.TIP_CHANGE_CONFIRMATION="TIP-CHANGE-CONFIRMATION",t.UPLOAD_TIP_EMPLOYEES="UPLOAD-TIP-EMPLOYEES",t.EDIT_TIP_EMPLOYEES="EDIT-TIP-EMPLOYEES",t.TIP_EMPLOYEES_LIST="TIP-EMPLOYEES-LIST",t.TIP_EMPLOYEE_CHANGE_PLAN="TIP-EMPLOYEE-CHANGE-PLAN",t.TIP_EMPLOYEE_CHANGE_EFFECTIVE_FROM="TIP-EMPLOYEE-CHANGE-EFFECTIVE-FROM",t.TIP_EMPLOYEE_REVIEW_CHANGES="TIP-EMPLOYEE-REVIEW-CHANGES",t})(ie||{});import"@ngxs/store";var ee=(function(t){return t.TIP_INVITATION_INTRODUCTION="TIP-INVITATION-INTRODUCTION",t.TIP_INVITATION_VERIFICATION="TIP-INVITATION-VERIFICATION",t.TIP_CHOOSE_CUSTOMER_TYPE="TIP-CHOOSE-CUSTOMER-TYPE",t.TIP_NOT_A_CUSTOMER="TIP-NOT-A-CUSTOMER",t.TIP_IDENTIFY_CUSTOMER="TIP-IDENTIFY-CUSTOMER",t.TIP_CUSTOMER_DETAILS="TIP-CUSTOMER-DETAILS",t.TIP_CONTRACT_DETAIL="TIP-CONTRACT-DETAIL",t.TIP_ACCEPT_TERMS_AND_CONDITIONS="TIP-ACCEPT-TERMS-AND-CONDITIONS",t.TIP_INVITATION_CONFIRMATION="TIP-INVITATION-CONFIRMATION",t})(ee||{});import"@ngx-translate/core";import*as x from"@angular/core";import*as Co from"@ngxs/store";import*as tn from"@ngx-translate/core";import*as nn from"@angular/common";var cs=t=>({"mb--l mb--xxl--md":t});function ds(t,o){if(t&1&&x.\u0275\u0275element(0,"div",2)(1,"div",3),t&2){let e=x.\u0275\u0275nextContext(2);x.\u0275\u0275property("innerHTML",e.getHeadingByType("title"),x.\u0275\u0275sanitizeHtml),x.\u0275\u0275advance(),x.\u0275\u0275property("innerHTML",e.getHeadingByType("sub-title"),x.\u0275\u0275sanitizeHtml)}}function us(t,o){if(t&1&&(x.\u0275\u0275elementStart(0,"wink-title",1),x.\u0275\u0275text(1),x.\u0275\u0275elementEnd()),t&2){let e=x.\u0275\u0275nextContext(2);x.\u0275\u0275advance(),x.\u0275\u0275textInterpolate1(" ",e.getHeadingByType("title")," ")}}function Es(t,o){if(t&1&&x.\u0275\u0275element(0,"div",4)(1,"div",5),t&2){let e=x.\u0275\u0275nextContext(2);x.\u0275\u0275property("innerHTML",e.getHeadingByType("title"),x.\u0275\u0275sanitizeHtml),x.\u0275\u0275advance(),x.\u0275\u0275property("innerHTML",e.getHeadingByType("sub-title"),x.\u0275\u0275sanitizeHtml)}}function fs(t,o){if(t&1&&x.\u0275\u0275conditionalCreate(0,ds,2,2)(1,us,2,1,"wink-title",1)(2,Es,2,2),t&2){let e=x.\u0275\u0275nextContext();x.\u0275\u0275conditional(e.currentStep===e.acceptTIPInviteStepEnum.TIP_INVITATION_INTRODUCTION?0:e.currentStep===e.acceptTIPInviteStepEnum.TIP_NOT_A_CUSTOMER?1:2)}}function Ts(t,o){if(t&1){let e=x.\u0275\u0275getCurrentView();x.\u0275\u0275elementStart(0,"a",9),x.\u0275\u0275listener("click",function(){x.\u0275\u0275restoreView(e);let n=x.\u0275\u0275nextContext(2);return x.\u0275\u0275resetView(n.createEmployeeSteps())}),x.\u0275\u0275text(1),x.\u0275\u0275pipe(2,"translate"),x.\u0275\u0275elementEnd()}t&2&&(x.\u0275\u0275advance(),x.\u0275\u0275textInterpolate1(" ",x.\u0275\u0275pipeBind1(2,1,"ng.tip-general.lbl.click-here")," "))}function gs(t,o){if(t&1&&(x.\u0275\u0275elementStart(0,"div",0),x.\u0275\u0275element(1,"p",6),x.\u0275\u0275elementStart(2,"p",7)(3,"span"),x.\u0275\u0275text(4),x.\u0275\u0275template(5,Ts,3,3,"a",8),x.\u0275\u0275elementEnd()()()),t&2){let e=x.\u0275\u0275nextContext();x.\u0275\u0275advance(),x.\u0275\u0275property("ngClass",x.\u0275\u0275pureFunction1(4,cs,e.currentStep===e.manageTIPEmployeeStepEnum.EDIT_TIP_EMPLOYEES))("innerHTML",e.getHeadingByType("title"),x.\u0275\u0275sanitizeHtml),x.\u0275\u0275advance(3),x.\u0275\u0275textInterpolate1("",e.getHeadingByType("sub-title")," "),x.\u0275\u0275advance(),x.\u0275\u0275property("ngIf",e.currentStep===e.manageTIPEmployeeStepEnum.UPLOAD_TIP_EMPLOYEES||e.currentStep===e.manageTIPEmployeeStepEnum.TIP_EMPLOYEE_FORM)}}var Te=(()=>{class t extends D{constructor(e,i,n){super(),this.store=e,this.translate=i,this.tipMessagingService=n,this.currentStep="",this.manageTIPEmployeeStepEnum=ie,this.acceptTIPInviteStepEnum=ee}ngOnInit(){this.obs(this.store.select(M.selectedTIPActionName)).subscribe(e=>{this.selectedTIPActionName=e}),this.obs(this.store.select($.currentStep)).subscribe(e=>{this.currentStep=e?.key||""})}
1createEmployeeSteps(){this.selectedTIPActionName===u.ADD_SINGLE_TIP_EMPLOYEE?this.store.dispatch(new he(u.ADD_MULTIPLE_TIP_EMPLOYEES)):this.store.dispatch(new he(u.ADD_SINGLE_TIP_EMPLOYEE))}getHeadingByType(e){let i="",n=this.store.selectSnapshot(M.message),p="",N=this.store.selectSnapshot($.currentStep),Y=N&&N.key;switch(Y&&(p="ng.tip-general.lbl.".concat(e).concat(".").concat(Y.toLowerCase()),z(this.selectedTIPActionName)||(p=p.concat(".").concat(this.selectedTIPActionName.toLowerCase())),n&&n.outcome===S.MISSING_CONTRACT&&(p=p.concat(".").concat(S.MISSING_CONTRACT)),i=this.translate.instant(p)),Y){case ee.TIP_INVITATION_INTRODUCTION:let ne=this.store.selectSnapshot(h.invitedTIPEmployee);i=this.translate.instant(p,{companyName:ne.company});break;case ie.TIP_EMPLOYEES_LIST:let ja=this.getTIPEmployeesWithActionRequired().length;i=this.translate.instant(p,{noOfEmployees:ja})}return i}getTIPEmployeesWithActionRequired(){let e=this.store.selectSnapshot(h.selectedTIPEmployeesToActOn);return re(e,i=>i.actionRequired===!0)}static{this.\u0275fac=function(i){return new(i||t)(x.\u0275\u0275directiveInject(Co.Store),x.\u0275\u0275directiveInject(tn.TranslateService),x.\u0275\u0275directiveInject(Ce))}}static{this.\u0275cmp=x.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-title"]],standalone:!1,features:[x.\u0275\u0275InheritDefinitionFeature],decls:2,vars:1,consts:[[1,"text-align--center","mt--l","mt--n--md","px--xl","px--n--sm"],["html-tag","h1","visual-tag","display-3xl","spacing-y","default","alignment","center"],[1,"heading--2",3,"innerHTML"],[1,"text--l",3,"innerHTML"],[1,"heading--3",3,"innerHTML"],[1,"text--xm","text--l--md",3,"innerHTML"],[1,"text--l","text--xl--md","text-weight--g",3,"ngClass","innerHTML"],[1,"mt--m","mt--xs--md","mb--l","mb--xxl--md","px--m","px--xxxl--sm"],["href","#","class","link--unstyled","appClickPreventDefault","",3,"click",4,"ngIf"],["href","#","appClickPreventDefault","",1,"link--unstyled",3,"click"]],template:function(i,n){i&1&&x.\u0275\u0275conditionalCreate(0,fs,3,1)(1,gs,6,6,"div",0),i&2&&x.\u0275\u0275conditional(n.selectedTIPActionName==="accept-tip-invitation"?0:1)},dependencies:[nn.NgClass,nn.NgIf,Hi,Wi,tn.TranslatePipe],encapsulation:2})}}return t})();var mi=t=>({value:t});function Is(t,o){t&1&&a.\u0275\u0275elementContainer(0)}function vs(t,o){if(t&1&&(a.\u0275\u0275elementStart(0,"div",8)(1,"div",21)(2,"div",22)(3,"div",23),a.\u0275\u0275text(4),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(5,"div",24)(6,"div",25)(7,"div",26)(8,"div",27),a.\u0275\u0275text(9),a.\u0275\u0275elementEnd()()()()()()),t&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate1(" ",e.tipContract.displayPlanName),a.\u0275\u0275advance(5),a.\u0275\u0275textInterpolate(e.tipContract.displayPlanName)}}function hs(t,o){if(t&1&&(a.\u0275\u0275elementStart(0,"div",15)(1,"div",11),a.\u0275\u0275text(2),a.\u0275\u0275pipe(3,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"div",18),a.\u0275\u0275text(5),a.\u0275\u0275pipe(6,"date"),a.\u0275\u0275elementEnd()()),t&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(3,2,"ng.tip-contracts-overview.lbl.tip-activation-date")),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(6,4,e.tipContract.activationDate,"dd/MM/yyyy"))}}function ys(t,o){if(t&1&&(a.\u0275\u0275elementStart(0,"div",15)(1,"div",11),a.\u0275\u0275text(2),a.\u0275\u0275pipe(3,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"div",18),a.\u0275\u0275text(5),a.\u0275\u0275pipe(6,"date"),a.\u0275\u0275elementEnd()()),t&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(2),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(3,2,"ng.tip-contracts-overview.lbl.tip-cancellation-date")),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(6,4,e.tipContract.cancellationDate,"dd/MM/yyyy"))}}function Cs(t,o){if(t&1){let e=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",3),a.\u0275\u0275pipe(1,"async"),a.\u0275\u0275elementStart(2,"div",4)(3,"div",5)(4,"wink-radio-button",6),a.\u0275\u0275listener("change",function(){a.\u0275\u0275restoreView(e);let n=a.\u0275\u0275nextContext();
1return a.\u0275\u0275resetView(n.onSelect())}),a.\u0275\u0275elementEnd()(),a.\u0275\u0275template(5,vs,10,2,"div",7),a.\u0275\u0275elementStart(6,"div",8)(7,"div",9)(8,"div",10)(9,"div",11),a.\u0275\u0275text(10),a.\u0275\u0275pipe(11,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(12,"div",12)(13,"span",13),a.\u0275\u0275text(14),a.\u0275\u0275pipe(15,"translate"),a.\u0275\u0275elementEnd()()(),a.\u0275\u0275elementStart(16,"div",10)(17,"div",11),a.\u0275\u0275text(18),a.\u0275\u0275pipe(19,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(20,"div",12)(21,"span",13),a.\u0275\u0275text(22),a.\u0275\u0275pipe(23,"translate"),a.\u0275\u0275elementEnd()()(),a.\u0275\u0275elementStart(24,"div",10)(25,"div",11),a.\u0275\u0275text(26),a.\u0275\u0275pipe(27,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(28,"div",12)(29,"span",13),a.\u0275\u0275text(30),a.\u0275\u0275pipe(31,"translate"),a.\u0275\u0275elementEnd()()()()(),a.\u0275\u0275template(32,hs,7,7,"div",14)(33,ys,7,7,"div",14),a.\u0275\u0275elementStart(34,"div",15)(35,"span",16),a.\u0275\u0275text(36),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(37,"div",17)(38,"div",18),a.\u0275\u0275text(39),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(40,"div",19)(41,"p")(42,"i",20),a.\u0275\u0275pipe(43,"translate"),a.\u0275\u0275listener("click",function(){a.\u0275\u0275restoreView(e);let n=a.\u0275\u0275nextContext();return a.\u0275\u0275resetView(n.downloadTIPContract())}),a.\u0275\u0275elementEnd()()()()()}if(t&2){let e=a.\u0275\u0275nextContext();a.\u0275\u0275property("ngClass",e.isSelected()?"selected-row":e.isActive()?a.\u0275\u0275pipeBind1(1,19,e.selectedTIPContract$)?"opacity--mid-transparency":"":"opacity--mid-transparency"),a.\u0275\u0275advance(4),a.\u0275\u0275property("checked",e.isSelected())("disabled",!e.isActive())("id","radio-group-id-"+e.tipContract.customerProductId)("name","radio-group-id-"+e.tipContract.customerProductId),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.tipContract.displayPlanName),a.\u0275\u0275advance(5),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(11,21,"ng.tip-contracts-overview.lbl.tip-mrc")),a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(15,23,"ng.tip-general.contract-detail.lbl.mrc",a.\u0275\u0275pureFunction1(38,mi,e.tipContract.tipMRC.vatExcl))),a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(19,26,"ng.tip-contracts-overview.lbl.tip-nrc")),a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(23,28,"ng.tip-general.contract-detail.lbl.nrc",a.\u0275\u0275pureFunction1(40,mi,e.tipContract.tipNRC.vatExcl))),a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(27,31,"ng.tip-contracts-overview.lbl.tip-usage")),a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(31,33,"ng.tip-general.contract-detail.lbl.usage",a.\u0275\u0275pureFunction1(42,mi,e.tipContract.tipUsage.vatExcl))),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf",!e.isDeactivated()),a.\u0275\u0275advance(),a.\u0275\u0275property("ngIf",e.isDeactivated()),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngClass",e.isActive()?"status-indicator--positive":"status-indicator--negative"),a.\u0275\u0275advance(),a.\u0275\u0275textInterpolate1(" ",e.getI18NLabel(e.tipContract.normalizedStatus)," "),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(e.tipContract.noOfEmployees),a.\u0275\u0275advance(3),a.\u0275\u0275property("title",a.\u0275\u0275interpolate(a.\u0275\u0275pipeBind1(43,36,"ng.tip-contracts-overview.lbl.see-contract")))}}function Ss(t,o){if(t&1&&(a.\u0275\u0275elementStart(0,"div",34)(1,"div",35)(2,"div",36),a.\u0275\u0275element(3,"i",37),a.\u0275\u0275elementStart(4,"div",38),a.\u0275\u0275text(5),a.\u0275\u0275elementEnd()(),a.\u0275\u0275element(6,"div",39),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(7,"ul",40)(8,"li")(9,"div",41)(10,"span"),a.\u0275\u0275text(11),a.\u0275\u0275pipe(12,"translate"),a.\u0275\u0275elementEnd(),a.\u
10275\u0275elementStart(13,"span"),a.\u0275\u0275text(14),a.\u0275\u0275pipe(15,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(16,"div",42),a.\u0275\u0275text(17),a.\u0275\u0275pipe(18,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(19,"li")(20,"div",43)(21,"span"),a.\u0275\u0275text(22),a.\u0275\u0275pipe(23,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(24,"span"),a.\u0275\u0275text(25),a.\u0275\u0275pipe(26,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(27,"div",42),a.\u0275\u0275text(28),a.\u0275\u0275pipe(29,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(30,"li")(31,"div",43)(32,"span"),a.\u0275\u0275text(33),a.\u0275\u0275pipe(34,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(35,"span"),a.\u0275\u0275text(36),a.\u0275\u0275pipe(37,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(38,"div",42),a.\u0275\u0275text(39),a.\u0275\u0275pipe(40,"translate"),a.\u0275\u0275elementEnd()(),a.\u0275\u0275elementStart(41,"li")(42,"div",43),a.\u0275\u0275text(43),a.\u0275\u0275pipe(44,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(45,"div",42),a.\u0275\u0275text(46),a.\u0275\u0275pipe(47,"translate"),a.\u0275\u0275elementEnd()()()()),t&2){let e=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(5),a.\u0275\u0275textInterpolate(e.tipContract==null?null:e.tipContract.displayPlanName),a.\u0275\u0275advance(6),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(12,12,"ng.tip-general.contract-detail.lbl.mrc",a.\u0275\u0275pureFunction1(37,mi,e.getCostSpecificToChargeType(e.tipContract==null?null:e.tipContract.tipMRC)))),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(15,15,e.getChargeTypeLabel("ng.tip-general.tip-plan-detail.lbl"))),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(18,17,"ng.tip-general.tip-plan-detail.lbl.tip-mrc")),a.\u0275\u0275advance(5),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(23,19,"ng.tip-general.contract-detail.lbl.nrc",a.\u0275\u0275pureFunction1(39,mi,e.getCostSpecificToChargeType(e.tipContract==null?null:e.tipContract.tipNRC)))),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(26,22,e.getChargeTypeLabel("ng.tip-general.tip-plan-detail.lbl"))),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(29,24,"ng.tip-general.tip-plan-detail.lbl.tip-nrc")),a.\u0275\u0275advance(5),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind2(34,26,"ng.tip-general.contract-detail.lbl.usage",a.\u0275\u0275pureFunction1(41,mi,e.getCostSpecificToChargeType(e.tipContract==null?null:e.tipContract.tipUsage)))),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(37,29,e.getChargeTypeLabel("ng.tip-general.tip-plan-detail.lbl"))),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(40,31,"ng.tip-general.tip-plan-detail.lbl.tip-usage")),a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(44,33,e.getBillingPeriodicity())),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(47,35,"ng.tip-general.tip-plan-detail.lbl.tip-periodicity"))}}function Ps(t,o){if(t&1&&(a.\u0275\u0275elementStart(0,"div",28)(1,"app-message-flow",29)(2,"div",30)(3,"div",31)(4,"div",32),a.\u0275\u0275element(5,"app-tip-title"),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(6,Ss,48,43,"div",33),a.\u0275\u0275pipe(7,"keyvalue"),a.\u0275\u0275elementEnd()()()()),t&2){let e,i=a.\u0275\u0275nextContext();a.\u0275\u0275advance(),a.\u0275\u0275property("messageGroupName",i.acceptTIPInvitationMessageGroup),a.\u0275\u0275advance(5),a.\u0275\u0275property("ngIf",(e=a.\u0275\u0275pipeBind1(7,2,i.tipContract))==null?null:e.length)}}var rn=(()=>{class t extends D{constructor(e,i,n,p,N,Y,ne){super(),this.store=e,this.configService=i,this.promotionService=n,this.dialog=p,this.urlService=N,this.messageService=Y,this.translateService=ne,this.selectedTIPContract$=this.store.select(B.selectedTIPContract),this.selectedTIPAction=u.EMPTY,this.acceptTIPInvitationMessageGroup=de.CUSTOM_MESSAGE_GROUP_NAME}ngOnInit(){if(this.selectedTIPAction=this.store.selectSnapshot(M.selectedTIPActionName),this.selectedTIPAction===u.ACCEPT_TIP_INVITATION){let e=this.store.selectSnapshot(h.invitedTIPEmployee);this.getTIPPlanDetail(e)}}isActive(){return this.tipContract.normalizedStatus===we.ACTIVE}onSelect(){this.isActive()&&this.store.dispatch(new tt(this.tipContract))}isDeactivated(){return!z(this.tipContract.cancellationDate)}isSelected(){let e=this.store.selectSnapshot(B.selectedTIPContract);return!Gi(e)&&this.tipContract===e}downloadTIPContract(){this.promotionService.getTIPContractPDFAvailabilityStatus(fe.MESSAGE_GROUP_NON_BLOCKING_ERROR,this.tipContract.customerProductId).subscribe({next:e=>{this.downloadTIPContractPDF()},error:e=>{this.handleTIPContractNotFoundError()}})}handleTIPContractNotFoundError(){let e=this.messageService.getMessagesByGroupName(fe.MESSAGE_GROUP_NON_BLOCKING_ERROR);(e&&e[0].key)===fe.ERROR_CODE_TIP_CONTRACT_PDF_NOT_FOUND&&(this.messageService.clearErrorMessages(fe.MESSAGE_GROUP_NON_BLOCKING_ERROR),this.dialog.open(yo)
1)}downloadTIPContractPDF(){let e=this.configService.getConfig(_s.OCAPI_URl).concat(Ge.PROMOTION_SERVICE_PREFIX).concat(Ge.API_VERSION_V1).concat(Ge.CONTEXT_TIP);e=e.concat(this.tipContract.customerProductId),e=e.concat(Ge.CONTRACT_PDF),e=e.concat(`?${Ge.QUERY_PARAM_CLIENT_ID}=${Ge.TIP_PORTAL}`),this.urlService.openNewTab(e)}getI18NLabel(e){return this.translateService.instant("ng.tip-general.lbl.".concat(this.normalizeKey(e)))}normalizeKey(e){if(!z(e))return e.replace(/ /g,"-").toLowerCase()}renderStackedView(){return this.selectedTIPAction===u.ACCEPT_TIP_INVITATION}getBillingPeriodicity(){let e=this.store.selectSnapshot(h.verifiedTIPEmployee).billingPeriodicity;return this.getI18NLabel(e)}getChargeTypeLabel(e){return this.validateCustomerCategory(e)}getCostSpecificToChargeType(e){return this.validateCustomerCategory(e)}validateCustomerCategory(e){let i=e instanceof Object;switch(this.getCustomerCategory()){case kn.BUSINESS_LINE:return i?this.getVatExclValue(e):this.appendTaxTypeToLabel(e,Dn.EXCLUSIVE);case kn.RESIDENTIAL_LINE:return i?this.getVatInclValue(e):this.appendTaxTypeToLabel(e,Dn.INCLUSIVE);default:return i?this.getVatExclValue(e):e&&e}}getCustomerCategory(){return this.store.selectSnapshot(h.verifiedTIPEmployee).customerCategory}getVatInclValue(e){return e.vatIncl}getVatExclValue(e){return e.vatExcl}appendTaxTypeToLabel(e,i){return e&&e.concat(this.normalizeKey(`.${i}`))}getTIPPlanDetail(e){this.promotionService.getTIPPlanDetail(this.acceptTIPInvitationMessageGroup,e.employerCustomerNo,e.tipPlanName).subscribe(i=>{this.tipContract=i,this.store.dispatch(new tt(this.tipContract))})}static{this.\u0275fac=function(i){return new(i||t)(a.\u0275\u0275directiveInject(So.Store),a.\u0275\u0275directiveInject(Po.ConfigService),a.\u0275\u0275directiveInject(pe),a.\u0275\u0275directiveInject(No.MatDialog),a.\u0275\u0275directiveInject(Ve),a.\u0275\u0275directiveInject(le),a.\u0275\u0275directiveInject(on.TranslateService))}}static{this.\u0275cmp=a.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-contract-detail"]],inputs:{tipContract:"tipContract"},standalone:!1,features:[a.\u0275\u0275InheritDefinitionFeature],decls:5,vars:3,consts:[["column",""],["stacked",""],[4,"ngIf","ngIfThen","ngIfElse"],[1,"content-row","background-white","color-dark-brown","contract-row-item","display--flex","flex-direction--row","mb--xs","border-radius--all--xs",3,"ngClass"],[1,"contract-row-item__right","contract-row-item__items","width--full","p--m","p--l--md","display--flex","cursor--default"],[1,"label-column","contract-row-item__item","align-self--center","pr--m","label-column--extra-small"],[3,"change","checked","disabled","id","name"],["class","label-column contract-row-item__item align-self--center pr--m label-column--giant",4,"ngIf"],[1,"label-column","contract-row-item__item","align-self--center","pr--m","label-column--giant"],[1,"row","row--no-gutters"],[1,"col-4"],[1,"font--caption-small","color-shade_64"],[1,"price"],[1,"font--body-small","text-weight--m"],["class","label-column contract-row-item__item align-self--center pr--m label-column--medium",4,"ngIf"],[1,"label-column","contract-row-item__item","align-self--center","pr--m","label-column--medium"],[1,"status-indicator","pr--m",3,"ngClass"],[1,"label-column","contract-row-item__item","align-self--center","pr--m","label-column--small"],[1,"font--body-small"],[1,"label-column","contract-row-item__item","align-self--center","pr--m","label-column--extra-small","justify-content--center","text-align--center"],[1,"icon","icon-md","icon-file","cursor--pointer",3,"click","title"],[1,"tooltip","position--relative","width--full"],[1,"tooltip__icon-section","display--flex","flex-direction--row--sm","flex-direction--row-reverse","align-items--center","justify-content--end","justify-content--start--sm","cursor--pointer","mt--xxxs"],[1,"icon-label","align-items--center","no-scroll","space-nowrap","font--body-small"],[1,"tooltip__info-section","tooltip__info-section__arrow-right","tooltip__info-section__arrow-left","tooltip__info-section--left","mt--xs","tooltip__info-section--hidden-mobile"],[1,"horizontal-center-align"],[1,"info-section__description"],[1,"info-section__description__text"],[1,"tip-invitation--contract-details"],[3,"messageGroupName"],[1,"row","justify-content--center","px--m--sm","px--n--lg"],[1,"col-12","col-sm-8","col-md-6","mb--xxxg"],[1,"accept-tip-invitation__header","pb--m","mt--l","mt--xxxl--md"],["class","accept-tip-invitation__content background-white mb--l",4,"ngIf"],[1,"accept-tip-invitation__content","background-white","mb--l"],[1,"px--xs"],[1,"display--flex","align-items--center","p--s"],[1,"icon","icon-md","icon-promo-percent"],[1,"text--xs","text--s--sm","text-weight--g","pt--xxxs","pl--m"],[1,"divi
1der","divider--s__very-light-grey"],[1,"tip-invitation--contract-details__list","mx--xl","mx--xg--md","p--l"],[1,"text--xs","text--s--sm","text-weight--g"],[1,"text--xxs","text--xs--sm"],[1,"text--xs","text--s--sm","text-weight--g","mt--s"]],template:function(i,n){if(i&1&&a.\u0275\u0275template(0,Is,1,0,"ng-container",2)(1,Cs,44,44,"ng-template",null,0,a.\u0275\u0275templateRefExtractor)(3,Ps,8,4,"ng-template",null,1,a.\u0275\u0275templateRefExtractor),i&2){let p=a.\u0275\u0275reference(2),N=a.\u0275\u0275reference(4);a.\u0275\u0275property("ngIf",n.renderStackedView())("ngIfThen",N)("ngIfElse",p)}},dependencies:[at.NgClass,at.NgIf,be,ii,Te,at.AsyncPipe,at.DatePipe,at.KeyValuePipe,on.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import*as b from"@angular/core";import*as xo from"@ngxs/store";import*as bo from"@angular/common";import*as wo from"@ngx-translate/core";var Ao=t=>({open:t}),As=(t,o)=>({"icon-chevron-up":t,"icon-chevron-down":o}),Oo=(()=>{class t extends D{constructor(e){super(),this.store=e,this.showTipLimits=!1}showChangeTIPContractsLimitsOverlay(){this.store.dispatch(new ut(!0))}toggleLineActions(){this.showTipLimits=!this.showTipLimits}static{this.\u0275fac=function(i){return new(i||t)(b.\u0275\u0275directiveInject(xo.Store))}}static{this.\u0275cmp=b.\u0275\u0275defineComponent({type:t,selectors:[["app-edit-tip-contract-sticky-footer"]],standalone:!1,features:[b.\u0275\u0275InheritDefinitionFeature],decls:28,vars:28,consts:[[1,"sticky-container"],[1,"sticky-action-item"],[1,"header-mobile","align-items--center"],[1,"header-mobile__desc","pr--l"],[1,"icon","icon-sticky","icon-minus-shape","mr-15","text--l"],[1,"mr--xxs"],[1,"header-mobile__actions",3,"click","ngClass"],[1,"text"],[1,"icon-chevron-up",3,"ngClass"],[1,"message","align-items--center"],[1,"action-item-list",3,"ngClass"],[1,"save-action-item",3,"click"],[1,"icon","icon-sticky","icon-pencil"]],template:function(i,n){i&1&&(b.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),b.\u0275\u0275element(4,"i",4),b.\u0275\u0275elementStart(5,"span",5),b.\u0275\u0275text(6),b.\u0275\u0275pipe(7,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275text(8),b.\u0275\u0275pipe(9,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275elementStart(10,"div",6),b.\u0275\u0275listener("click",function(){return n.toggleLineActions()}),b.\u0275\u0275elementStart(11,"div",7),b.\u0275\u0275text(12),b.\u0275\u0275pipe(13,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275element(14,"div",8),b.\u0275\u0275elementEnd()(),b.\u0275\u0275elementStart(15,"div",9),b.\u0275\u0275element(16,"i",4),b.\u0275\u0275elementStart(17,"span",5),b.\u0275\u0275text(18),b.\u0275\u0275pipe(19,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275text(20),b.\u0275\u0275pipe(21,"translate"),b.\u0275\u0275elementEnd(),b.\u0275\u0275elementStart(22,"ul",10)(23,"li",11),b.\u0275\u0275listener("click",function(){return n.showChangeTIPContractsLimitsOverlay()}),b.\u0275\u0275element(24,"i",12),b.\u0275\u0275elementStart(25,"span"),b.\u0275\u0275text(26),b.\u0275\u0275pipe(27,"translate"),b.\u0275\u0275elementEnd()()()()()),i&2&&(b.\u0275\u0275advance(6),b.\u0275\u0275textInterpolate(b.\u0275\u0275pipeBind1(7,9,"ng.tip-contracts-overview.manage-tip-contract.lbl.lines-selected-part-1")),b.\u0275\u0275advance(2),b.\u0275\u0275textInterpolate1(" ",b.\u0275\u0275pipeBind1(9,11,"ng.tip-contracts-overview.manage-tip-contract.lbl.lines-selected-part-2")," "),b.\u0275\u0275advance(2),b.\u0275\u0275property("ngClass",b.\u0275\u0275pureFunction1(21,Ao,n.showTipLimits)),b.\u0275\u0275advance(2),b.\u0275\u0275textInterpolate(b.\u0275\u0275pipeBind1(13,13,"ng.tip-contracts-overview.manage-tip-contract.lbl.line-actions")),b.\u0275\u0275advance(2),b.\u0275\u0275property("ngClass",b.\u0275\u0275pureFunction2(23,As,n.showTipLimits,!n.showTipLimits)),b.\u0275\u0275advance(4),b.\u0275\u0275textInterpolate(b.\u0275\u0275pipeBind1(19,15,"ng.tip-contracts-overview.manage-tip-contract.lbl.lines-selected-part-1")),b.\u0275\u0275advance(2),b.\u0275\u0275textInterpolate1(" ",b.\u0275\u0275pipeBind1(21,17,"ng.tip-contracts-overview.manage-tip-contract.lbl.lines-selected-part-2")," "),b.\u0275\u0275advance(2),b.\u0275\u0275property("ngClass",b.\u0275\u0275pureFunction1(26,Ao,n.showTipLimits)),b.\u0275\u0275advance(4),b.\u0275\u0275textInterpolate(b.\u0275\u0275pipeBind1(27,19,"ng.tip-contracts-overview.manage-tip-contract.lbl.change-tip-limits")))},dependencies:[bo.NgClass,wo.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import"@angular/core";import"@ngxs/store";var Pe=(function(t){return t.EDIT_TIP_CONTRACT_LIMITS="EDIT-TIP-CONTRACT-LIMITS",t.TIP_CONTRACT_ACTIVATION_DATE="TIP-CONTRACT-ACTIVATION-DATE",t.TIP_CHANGE_CONFIRMATION="TIP-CHANGE-CONFIRMATION",t.EDIT_TIP_CONTRACT_WARNING="EDIT-TIP-CONTRACT-WARNING",t})(Pe||{});import"@angular/core";import"@ngxs/store";import{of as Uo}from"rxjs";import{FormControl as wi,FormGroup as bs,Validators as st}from"@angular/forms";var X=(function(t){return t.TIP_FRIENDLY_PLAN_NAME="tipFriendlyPlanName",t.TIP_MRC="tipMRC",t.TIP_NRC="tipNRC",t.TIP_USAGE="tipUsage",t})(X||{});var ci=class t extends bs{constructor(o){super(o)}static buildActivationDateForm(){let o=new t({});return o.minDateRange=je().format(fe.DATE_RANGE_FORMAT),o.maxDateRange=je().add(fe.MAX_YEARS_ALLOWED_IN_FUTURE,"years").format(fe.DATE_RANGE_FORMAT),o.addControl("activationDate",new wi(o.minDateRange,[])),o.controls.activationDate.setValidators([st.required,st.pattern(fe.DATE_PATTERN),o.fromDateValidator.bind(o)]),o}static buildEditLimitsForm(){let o=new t({});return o.addControl(X.TIP_FRIENDLY_PLAN_NAME,new wi("",[])),o.addControl(X.TIP_MRC,new wi("",[])),o.addControl(X.TIP_NRC,new wi("",[])),o.addControl(X.TIP_USAGE,new wi("",[])),o.controls[X.TIP_FRIENDLY_PLAN_NAME].setValidators([st.minLength(3),st.maxLength(30)]),o.controls[X.TIP_MRC].setValidators([st.required,st.pattern(dt.PRICE)]),o.controls[X.TIP_NRC].setValidators([st.required,st.pattern(dt.PRICE)]),o.controls[X.TIP_USAGE].setValidators([st.required,st.pattern(dt.PRICE)]),o}fromDateValidator(o){let e=je(o.value);return e.isBefore(this.minDateRange)||e.isAfter(this.maxDateRange)?{range:"ng.tip-contracts-overview.tip-contract-activation-date.lbl.error"}:null}isTIPLimitsModified(o){let e={};return e.tipMRC={},e.tipNRC={},e.tipUsage={}
1,e.tipMRC.vatExcl=this.get(X.TIP_MRC).value,e.tipNRC.vatExcl=this.get(X.TIP_NRC).value,e.tipUsage.vatExcl=this.get(X.TIP_USAGE).value,e.friendlyPlanName=this.get(X.TIP_FRIENDLY_PLAN_NAME).value,!Xn(e,o,this.checkTIPLimitsChanges)}checkTIPLimitsChanges(o,e){return o.tipMRC.vatExcl===e.tipMRC.vatExcl&&o.tipNRC.vatExcl===e.tipNRC.vatExcl&&o.tipUsage.vatExcl===e.tipUsage.vatExcl&&o.friendlyPlanName===e.friendlyPlanName}getMinDateRange(){return this.minDateRange}getMaxDateRange(){return this.maxDateRange}get activationDate(){return this.get("activationDate").value}get tipMRC(){return this.get(X.TIP_MRC).value}set tipMRC(o){this.get(X.TIP_MRC).setValue(o)}get tipNRC(){return this.get(X.TIP_NRC).value}set tipNRC(o){this.get(X.TIP_NRC).setValue(o)}get tipUsage(){return this.get(X.TIP_USAGE).value}set tipUsage(o){this.get(X.TIP_USAGE).setValue(o)}get tipFriendlyPlanName(){return this.get(X.TIP_FRIENDLY_PLAN_NAME).value}set tipFriendlyPlanName(o){this.get(X.TIP_FRIENDLY_PLAN_NAME).setValue(o)}get hasFriendlyPlanNameError(){let o=this.get(X.TIP_FRIENDLY_PLAN_NAME);return!!(o?.invalid&&(o?.dirty||o?.touched))}get friendlyPlanNameLengthError(){let o=this.get(X.TIP_FRIENDLY_PLAN_NAME);return!!((o?.dirty||o?.touched)&&(o?.errors?.minlength||o?.errors?.maxlength))}get hasTipMRCError(){let o=this.get(X.TIP_MRC);return!!(o?.invalid&&(o?.dirty||o?.touched))}get tipMRCRequiredError(){let o=this.get(X.TIP_MRC);return!!((o?.dirty||o?.touched)&&o?.errors?.required)}get tipMRCPatternError(){let o=this.get(X.TIP_MRC);return!!((o?.dirty||o?.touched)&&o?.errors?.pattern)}get hasTipNRCError(){let o=this.get(X.TIP_NRC);return!!(o?.invalid&&(o?.dirty||o?.touched))}get tipNRCRequiredError(){let o=this.get(X.TIP_NRC);return!!((o?.dirty||o?.touched)&&o?.errors?.required)}get tipNRCPatternError(){let o=this.get(X.TIP_NRC);return!!((o?.dirty||o?.touched)&&o?.errors?.pattern)}get hasTipUsageError(){let o=this.get(X.TIP_USAGE);return!!(o?.invalid&&(o?.dirty||o?.touched))}get tipUsageRequiredError(){let o=this.get(X.TIP_USAGE);return!!((o?.dirty||o?.touched)&&o?.errors?.required)}get tipUsagePatternError(){let o=this.get(X.TIP_USAGE);return!!((o?.dirty||o?.touched)&&o?.errors?.pattern)}};import"@angular/core";import"@ngxs/store";import{EventCategoryEnum as ws,EventNameEnum as Mo,EventTypeEnum as Ro}from"@telenet/ng-lib-datalayer";import{Category as Os}from"@telenet/ng-lib-udl";import*as Oi from"@angular/core";import*as Do from"@telenet/ng-lib-datalayer";import*as Fo from"@ngxs/store";var De=(()=>{class t{constructor(e,i){this.dataLayerService=e,this.store=i}getCategory(){let e=new Os;return e.setPrimaryCategory(ws.PRIMARY_CATEGORY_TIP),e}addEvent(e,i,n){let p=this.getCommonEventAttributes();Object.assign(p,n);let N=this.dataLayerService.createEventInfo(e,i,[ue.MESSAGE_GROUP]),Y=this.getCategory();return this.dataLayerService.addEvent(N,p,Y)}getCommonEventAttributes(){let e;switch(this.store.selectSnapshot(M.selectedTIPActionName)){case u.ADD_SINGLE_TIP_EMPLOYEE:case u.ADD_MULTIPLE_TIP_EMPLOYEES:e="add-tip-employee";break;default:e=this.store.selectSnapshot(M.selectedTIPActionName)}return{intent:e,flowType:"tip"}}fireAnalyticsFlowStartEvent(e){return this.addEvent(Mo.EVENT_NAME_MANAGE_TIP_STARTED,Ro.EVENT_TYPE_SELF_SERVICE_FLOW_STARTED,e)}fireAnalyticsFlowEndEvent(e){return this.addEvent(Mo.EVENT_NAME_MANAGE_TIP_COMPLETED,Ro.EVENT_TYPE_SELF_SERVICE_FLOW_END,e)}static{this.\u0275fac=function(i){return new(i||t)(Oi.\u0275\u0275inject(Do.DataLayerService),Oi.\u0275\u0275inject(Fo.Store))}}static{this.\u0275prov=Oi.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();import*as Z from"@angular/core";import*as Vo from"@ngxs/store";import*as He from"@angular/forms";import{forwardRef as Ms}from"@angular/core";import{DateAdapter as Rs,MAT_DATE_FORMATS as Ds,MAT_DATE_LOCALE as Fs}from"@angular/material/core";import{NG_VALUE_ACCESSOR as Ls,NgControl as ks,FormsModule as Gs}from"@angular/forms";import{CommonModule as Us}from"@angular/common";import{TranslateModule as Vs}from"@ngx-translate/core";import*as A from"@angular/core";import*as Lo from"@angular/common";import*as di from"@angular/forms";import*as ko from"@ngx-translate/core";function Bs(t,o){t&1&&(A.\u0275\u0275elementContainerStart(0),A.\u0275\u0275elementStart(1,"p"),A.\u0275\u0275text(2),A.\u0275\u0275pipe(3,"translate"),A.\u0275\u0275elementEnd(),A.\u0275\u0275elementContainerEnd()),t&2&&(A.\u0275\u0275advance(2),A.\u0275\u0275textInterpolate(A.\u0275\u0275pipeBind1(3,1,"ng.datepicker.lbl.incorrect-date-format")))}function Ys(t,o){t&1&&(A.\u0275\u0275elementContainerStart(0),A.\u0275\u0275elementStart(1,"p"),A.\u0275\u0275text(2),A.\u0275\u0275pipe(3,"translate"),A.\u0275\u0275elementEnd(),A.\u0275\u0275elementContainerEnd()),t&2&&(A.\u0275\u0275advance(2),A.\u0275\u0275textInterpolate(A.\u0275\u0275pipeBind1(3,1,"ng.datepicker.lbl.required")))}function js(t,o){t&1&&(A.\u0275\u0275elementContainerStart(0),A.\u0275\u0275elementStart(1,"p"),A.\u0275\u0275text(2),A.\u0275\u0275pipe(3,"translate"),A.\u0275\u0275elementEnd(),A.\u0275\u0275elementContainerEnd()),t&2&&(A.\u0275\u0275advance(2),A.\u0275\u0275textInterpolate(A.\u0275\u0275pipeBind1(3,1,"ng.datepicker.lbl.invali
1d-date-range")))}function Ws(t,o){if(t&1&&(A.\u0275\u0275elementStart(0,"wink-validation-message",7),A.\u0275\u0275template(1,Bs,4,3,"ng-container",8)(2,Ys,4,3,"ng-container",8)(3,js,4,3,"ng-container",8),A.\u0275\u0275elementEnd()),t&2){let e=A.\u0275\u0275nextContext();A.\u0275\u0275advance(),A.\u0275\u0275property("ngIf",(e.control==null||e.control.errors==null?null:e.control.errors.pattern)&&(e.control==null?null:e.control.dirty)),A.\u0275\u0275advance(),A.\u0275\u0275property("ngIf",(e.control==null||e.control.errors==null?null:e.control.errors.required)&&(e.control==null?null:e.control.dirty)),A.\u0275\u0275advance(),A.\u0275\u0275property("ngIf",!(!(e.control==null||e.control.errors==null)&&e.control.errors.pattern)&&(e.control==null||e.control.errors==null?null:e.control.errors.range)&&(e.control==null?null:e.control.dirty))}}var qs={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},ui=(()=>{class t{constructor(e){this.injector=e,this.value=void 0,this.onChange=i=>{},this.onTouch=i=>{},this.onTouched=i=>{}}ngOnInit(){this.controller=this.injector.get(ks)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouch=e}writeValue(e){this.value=e}updateValue(e){this.onTouched(!0),e=typeof e=="string"?e:e?.format("YYYY-MM-DD"),this.onChange(e),this.control&&this.control.markAsDirty()}get nativeDisplayDate(){return je(this.value).format("DD/MM/YYYY")}get control(){return this.controller.control}static{this.\u0275fac=function(i){return new(i||t)(A.\u0275\u0275directiveInject(A.Injector))}}static{this.\u0275cmp=A.\u0275\u0275defineComponent({type:t,selectors:[["tip-datepicker"]],inputs:{minDate:"minDate",maxDate:"maxDate"},features:[A.\u0275\u0275ProvidersFeature([{provide:Ls,useExisting:Ms(()=>t),multi:!0},{provide:Rs,useClass:co,deps:[Fs]},{provide:Ds,useValue:qs}])],decls:7,vars:11,consts:[[1,"form-builder"],[1,"color--text-default"],["type","date","name","date picker","input-id","date-picker-01",3,"ngModelChange","is-disabled","is-readonly","is-invalid","ngModel","min-value","max-value"],[1,"hide-from-sm","display--flex","align-content--center","justify-content--center"],["type","date",1,"form__input","native-date-picker","position--relative","pt-25","pb-25",3,"ngModelChange","min","max","ngModel"],[1,"formErrorInput"],["class","form__msg--error form__input__invalid-message",4,"ngIf"],[1,"form__msg--error","form__input__invalid-message"],[4,"ngIf"]],template:function(i,n){i&1&&(A.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"wink-input",2),A.\u0275\u0275listener("ngModelChange",function(N){return n.updateValue(N)}),A.\u0275\u0275elementEnd()(),A.\u0275\u0275elementStart(3,"div",3)(4,"input",4),A.\u0275\u0275listener("ngModelChange",function(N){return n.updateValue(N)}),A.\u0275\u0275twoWayListener("ngModelChange",function(N){return A.\u0275\u0275twoWayBindingSet(n.value,N)||(n.value=N),N}),A.\u0275\u0275elementEnd()(),A.\u0275\u0275elementStart(5,"div",5),A.\u0275\u0275template(6,Ws,4,3,"wink-validation-message",6),A.\u0275\u0275elementEnd()()),i&2&&(A.\u0275\u0275advance(2),A.\u0275\u0275property("is-disabled",!1)("is-readonly",!1)("is-invalid",!!(n.control!=null&&n.control.invalid&&(n.control!=null&&n.control.dirty||n.control!=null&&n.control.touched)))("ngModel",n.value)("min-value",n.minDate)("max-value",n.maxDate),A.\u0275\u0275advance(2),A.\u0275\u0275property("min",n.minDate?n.minDate:"")("max",n.maxDate?n.maxDate:""),A.\u0275\u0275twoWayProperty("ngModel",n.value),A.\u0275\u0275attribute("data-date",n.nativeDisplayDate),A.\u0275\u0275advance(2),A.\u0275\u0275property("ngIf",n.control==null?null:n.control.invalid))},dependencies:[Us,Lo.NgIf,Gs,di.DefaultValueAccessor,di.NgControlStatus,di.NgModel,Vs,ri,ko.TranslatePipe],styles:[`.formErrorInput .form__msg--error{display:flex;align-items:center;gap:.5rem;margin-top:.25rem}.formErrorInput .form__msg--error p{margin:0;line-height:1.2}
2`],encapsulation:2})}}return t})();import*as Bo from"@ngx-translate/core";var Yo=(()=>{class t extends D{constructor(e,i,n,p){super(),this.store=e,this.promotionService=i,this.tipDataLayerService=n,this.tipMessagingService=p,this.messageGroupName=fe.MESSAGE_GROUP,e.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){this.tipContractsDateForm=ci.buildActivationDateForm(),this.minDateRange=this.tipContractsDateForm.getMinDateRange(),this.maxDateRange=this.tipContractsDateForm.getMaxDateRange()}onNext(){return this.tipContractsDateForm.valid?this.modifyTIPContract():(this.tipContractsDateForm.markAllAsTouched(),Uo(!1))}modifyTIPContract(){let e=this.createModifyTIPContractRequest();return this.promotionService.modifyTIPContract(this.messageGroupName,e).subscribe(i=>{this.setMessage(),this.fireAnalyticsFlowEndEvent()}),Uo(!1)}setMessage(){let e=this.tipMessagingService.getMessage(u.EDIT_TIP_CONTRACT,S.CHANGES_ACTIVE_NOW);this.tipContractsDateForm.activationDate!==this.minDateRange&&(e=this.tipMessagingService.getMessage(u.EDIT_TIP_CONTRACT,S.CHANGES_ACTIVE_IN_FUTURE)),this.store.dispatch(new me(e))}createModifyTIPContractRequest(){let e=this.store.selectSnapshot(B.modifiedTIPContract);return{processingDate:this.tipContractsDateForm.activationDate+"T00:00:00+00:00",friendlyPlanName:e.friendlyPlanName,customerProductId:e.customerProductId,tipMRC:{vatExcl:e.tipMRC.vatExcl.replace(",",".")},tipNRC:{vatExcl:e.tipNRC.vatExcl.replace(",",".")},tipUsage:{vatExcl:e.tipUsage.vatExcl.replace(",",".")}}}fireAnalyticsFlowEndEvent(){let e={}
2,i=this.tipContractsDateForm.activationDate,n=new Date;e.itemData=new Date(i)>n?"future-date-change":"current-date-change";let p=this.store.selectSnapshot(B.selectedTIPContract),N=this.store.selectSnapshot(B.modifiedTIPContract),Y=[];p.tipMRC.vatExcl!==N.tipMRC.vatExcl&&Y.push("mrc-modified"),p.tipNRC.vatExcl!==N.tipNRC.vatExcl&&Y.push("nrc-modified"),p.tipUsage.vatExcl!==N.tipUsage.vatExcl&&Y.push("usage-limit-modified"),e.itemName=Y.join(","),this.tipDataLayerService.fireAnalyticsFlowEndEvent(e).then(()=>{this.store.dispatch(new Xe(void 0)),this.store.dispatch(new tt(void 0)),this.store.dispatch([new Ee])})}static{this.\u0275fac=function(i){return new(i||t)(Z.\u0275\u0275directiveInject(Vo.Store),Z.\u0275\u0275directiveInject(pe),Z.\u0275\u0275directiveInject(De),Z.\u0275\u0275directiveInject(Ce))}}static{this.\u0275cmp=Z.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-contract-activation-date"]],standalone:!1,features:[Z.\u0275\u0275InheritDefinitionFeature],decls:11,vars:9,consts:[[1,"form-group","ng-untouched","ng-pristine","ng-valid",3,"formGroup"],[1,"mt--xg"],[1,"col-12","col-md-8","col-sm-6","col-lg-5","m--auto","px--n","pb--m","text--xl","font-weight--bold","text-align--left","line-height--40"],[1,"row","mb--xxxl","pb--xxl--sm","mt--l--sm","mt-0"],[1,"col-12","col-md-8","col-sm-6","col-lg-5","p--xl","m--auto","box-shadow","background-white"],["for","mrc-limit"],["formControlName","activationDate","ngDefaultControl","",3,"maxDate","minDate"]],template:function(i,n){i&1&&(Z.\u0275\u0275elementStart(0,"form",0)(1,"div",1)(2,"div",2),Z.\u0275\u0275text(3),Z.\u0275\u0275pipe(4,"translate"),Z.\u0275\u0275elementEnd(),Z.\u0275\u0275elementStart(5,"div",3)(6,"div",4)(7,"label",5),Z.\u0275\u0275text(8),Z.\u0275\u0275pipe(9,"translate"),Z.\u0275\u0275elementEnd(),Z.\u0275\u0275element(10,"tip-datepicker",6),Z.\u0275\u0275elementEnd()()()()),i&2&&(Z.\u0275\u0275property("formGroup",n.tipContractsDateForm),Z.\u0275\u0275advance(3),Z.\u0275\u0275textInterpolate1(" ",Z.\u0275\u0275pipeBind1(4,5,"ng.tip-contracts-overview.manage-tip-contract.lbl.change-tip-limits-date-title")," "),Z.\u0275\u0275advance(5),Z.\u0275\u0275textInterpolate1(" ",Z.\u0275\u0275pipeBind1(9,7,"ng.tip-contracts-overview.manage-tip-contract.lbl.change-tip-limits-date-label")," "),Z.\u0275\u0275advance(2),Z.\u0275\u0275property("maxDate",n.maxDateRange)("minDate",n.minDateRange))},dependencies:[He.\u0275NgNoValidate,He.DefaultValueAccessor,He.NgControlStatus,He.NgControlStatusGroup,He.FormGroupDirective,He.FormControlName,ui,Bo.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import{of as Wo}from"rxjs";import"@angular/core";import"@ngxs/store";import*as Xt from"@angular/core";import*as jo from"@ngxs/store";var an=(()=>{class t{constructor(e,i){this.store=e,this.tipMessagingService=i}ngOnInit(){let e=this.store.selectSnapshot(B.warningContext),i=this.tipMessagingService.getMessage(e?.action,e?.outcome);this.store.dispatch(new me(i)),this.store.dispatch(new Ze(void 0))}ngOnDestroy(){this.store.dispatch(new Ni([Pe.EDIT_TIP_CONTRACT_WARNING]))}static{this.\u0275fac=function(i){return new(i||t)(Xt.\u0275\u0275directiveInject(jo.Store),Xt.\u0275\u0275directiveInject(Ce))}}static{this.\u0275cmp=Xt.\u0275\u0275defineComponent({type:t,selectors:[["app-edit-tip-contract-warning"]],standalone:!1,decls:1,vars:0,template:function(i,n){i&1&&Xt.\u0275\u0275element(0,"app-tip-messaging")},dependencies:[qe],encapsulation:2})}}return t})();import*as l from"@angular/core";import*as qo from"@ngxs/store";import*as ln from"@angular/common";import*as lt from"@angular/forms";import*as Ho from"@ngx-translate/core";var sn=t=>({"form__input--error":t});function Ks(t,o){t&1&&(l.\u0275\u0275elementContainerStart(0),l.\u0275\u0275elementStart(1,"div",19)(2,"span",20),l.\u0275\u0275text(3),l.\u0275\u0275pipe(4,"translate"),l.\u0275\u0275elementEnd()(),l.\u0275\u0275elementContainerEnd()),t&2&&(l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate1("",l.\u0275\u0275pipeBind1(4,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.exact-match-tip-contracts.error")," "))}function zs(t,o){t&1&&(l.\u0275\u0275elementStart(0,"span",22),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),t&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.friendly-plan-name-length.error")," "))}function $s(t,o){if(t&1&&(l.\u0275\u0275elementStart(0,"wink-validation-message"),l.\u0275\u0275template(1,zs,3,3,"span",21),l.\u0275\u0275elementEnd()),t&2){let e=l.\u0275\u0275nextContext();l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.tipContractEditLimitsForm.friendlyPlanNameLengthError)}}function Xs(t,o){t&1&&(l.\u0275\u0275elementStart(0,"span",22),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),t&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.tipmrc-required.error")," "))}function Zs(t,o){t&1&&(l.\u0275\u0275elementStart(0,"span",22),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),t&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.tipmrc-pattern.error")," "))}function Js(t,o){if(t&1&&(l.\u0275\u0275elementStart(0,"wink-validation-message"),l.\u0275\u0275template(1,Xs,3,3,"span",21)(2,Zs,3,3,"span",21),l.\u0275\u0275elementEnd()),t&2){let e=l.\u0275\u0275nextContext();l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.tipContractEditLimitsForm.tipMRCRequiredError),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.tipContractEditLimitsForm.tipMRCPatternError)}}function Qs(t,o){t&1&&(l.\u0275\u0275elementStart(0,"span",22),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),t&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.tipnrc-required.error")," "))}function el(t,o){t&1&&(l.\u0275\u0275elementStart(0,"span",22),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),t&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.tipnrc-pattern.error")," "))}function tl(t,o){if(t&1&&(l.\u0275\u0275elementStart(0,"wink-validation-message"),l.\u0275\u0275template(1,Qs,3,3,"span",21)(2,el,3,3,"span",21),l.\u0275\u0275elementEnd()),t&2){let e=l.\u0275\u0275nextContext();l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.tipContractEditLimitsForm.tipNRCRequiredError),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.tipContractEditLimitsForm.tipNRCPatternError)}}function il(t,o){t&1&&(l.\u0275\u0275elementStart(0,"span",22),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),t&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.tipus
2age-required.error")," "))}function nl(t,o){t&1&&(l.\u0275\u0275elementStart(0,"span",22),l.\u0275\u0275text(1),l.\u0275\u0275pipe(2,"translate"),l.\u0275\u0275elementEnd()),t&2&&(l.\u0275\u0275advance(),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(2,1,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.tipusage-pattern.error")," "))}function ol(t,o){if(t&1&&(l.\u0275\u0275elementStart(0,"wink-validation-message"),l.\u0275\u0275template(1,il,3,3,"span",21)(2,nl,3,3,"span",21),l.\u0275\u0275elementEnd()),t&2){let e=l.\u0275\u0275nextContext();l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.tipContractEditLimitsForm.tipUsageRequiredError),l.\u0275\u0275advance(),l.\u0275\u0275property("ngIf",e.tipContractEditLimitsForm.tipUsagePatternError)}}var Ko=(()=>{class t extends D{constructor(e,i){super(),this.store=e,this.domService=i,this.tipLimitModified=!0,e.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){document.body.style.overflow="hidden",this.originalContract=this.store.selectSnapshot(B.selectedTIPContract);let e=this.store.selectSnapshot(B.modifiedTIPContract);this.workingContract=Hn(e??this.originalContract),this.buildForm()}onDestroy(){document.body.style.overflow="",this.tipContractEditLimitsForm&&(this.tipContractEditLimitsForm.removeControl(X.TIP_MRC),this.tipContractEditLimitsForm.removeControl(X.TIP_NRC),this.tipContractEditLimitsForm.removeControl(X.TIP_USAGE),this.tipContractEditLimitsForm.removeControl(X.TIP_FRIENDLY_PLAN_NAME))}buildForm(){this.tipContractEditLimitsForm=ci.buildEditLimitsForm(),this.tipContractEditLimitsForm.tipFriendlyPlanName=this.workingContract.friendlyPlanName,this.tipContractEditLimitsForm.tipMRC=this.workingContract.tipMRC.vatExcl,this.tipContractEditLimitsForm.tipNRC=this.workingContract.tipNRC.vatExcl,this.tipContractEditLimitsForm.tipUsage=this.workingContract.tipUsage.vatExcl}onNext(){return this.tipContractEditLimitsForm.valid?(this.tipLimitModified=this.tipContractEditLimitsForm.isTIPLimitsModified(this.originalContract),this.tipLimitModified&&(this.handleMissingFriendlyNameWarning(),this.updateWorkingContractFromForm(),this.store.dispatch(new Xe(this.workingContract))),Wo(this.tipLimitModified)):(this.tipContractEditLimitsForm.markAllAsTouched(),this.domService.scrollToTop(),Wo(!1))}updateWorkingContractFromForm(){this.workingContract.friendlyPlanName=this.tipContractEditLimitsForm.tipFriendlyPlanName,this.workingContract.tipMRC.vatExcl=this.tipContractEditLimitsForm.tipMRC,this.workingContract.tipNRC.vatExcl=this.tipContractEditLimitsForm.tipNRC,this.workingContract.tipUsage.vatExcl=this.tipContractEditLimitsForm.tipUsage}handleMissingFriendlyNameWarning(){!this.tipContractEditLimitsForm.tipFriendlyPlanName&&!this.originalContract.friendlyPlanName&&this.addWarningStep()}addWarningStep(){this.store.dispatch(new Ze({action:u.EDIT_TIP_CONTRACT,outcome:S.WARNING_MISSING_FRIENDLY_NAME}));let e=H.builder(Pe.EDIT_TIP_CONTRACT_WARNING).withTemplate(K).withComponent(an).build();this.store.dispatch(new kt([e],Pe.EDIT_TIP_CONTRACT_LIMITS))}static{this.\u0275fac=function(i){return new(i||t)(l.\u0275\u0275directiveInject(qo.Store),l.\u0275\u0275directiveInject(Ye))}}static{this.\u0275cmp=l.\u0275\u0275defineComponent({type:t,selectors:[["app-edit-tip-contract-limits"]],standalone:!1,features:[l.\u0275\u0275InheritDefinitionFeature],decls:42,vars:33,consts:[[1,"edit-tip-contract-limits-header"],[1,"mt--xl"],[1,"editTIPContractLimitsForm__error"],[4,"ngIf"],[1,"form-group","ng-untouched","ng-pristine","ng-valid",3,"formGroup"],[1,"col-12","col-md-8","col-lg-5","m--auto","px--n","py--m","text--xl","font-weight--bold","text-align--left","line-height--40"],[1,"row","pb--xxxl","mb--xxxl"],[1,"col-12","col-md-8","col-lg-5","pb--xxl","m--auto","box-shadow","background-white"],[1,"form-builder","form-group","pl--xl","mt-40"],["for","friendlyPlanName"],[1,"form__input-container","form__input--placeholder","position--relative","display--flex","align-items--center",3,"ngClass"],["type","text","min-value","3","max-value","30","appearance","default","size","md","formControlName","tipFriendlyPlanName","id","friendlyPlanName",1,"sc-wink-input-h","sc-wink-input-s"],[1,"formErrorInput"],["for","mrc-limit"],["type","text","prefix-value","\u20AC","formControlName","tipMRC","id","mrc-limit",1,"sc-wink-input-h","sc-wink-input-s"],["for","nrc-limit"],["type","text","prefix-value","\u20AC","formControlName","tipNRC","id","nrc-limit",1,"sc-wink-input-h","sc-wink-input-s"],["for","usage-limit"],["type","text","prefix-value","\u20AC","formControlName","tipUsage","id","usage-limit",1,"sc-wink-input-h","sc-wink-input-s"],[1,"n
2otification","notification--errorfield","mt-20","mr-20","ml-20"],[1,"icon","icon-error-shape","error"],["class","form__msg--error form__input__invalid-message",4,"ngIf"],[1,"form__msg--error","form__input__invalid-message"]],template:function(i,n){i&1&&(l.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2),l.\u0275\u0275template(3,Ks,5,3,"ng-container",3),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(4,"form",4)(5,"div",5),l.\u0275\u0275text(6),l.\u0275\u0275pipe(7,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(8,"div",6)(9,"div",7)(10,"div",8)(11,"label",9),l.\u0275\u0275text(12),l.\u0275\u0275pipe(13,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(14,"div",10),l.\u0275\u0275element(15,"wink-input",11),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(16,"div",12),l.\u0275\u0275template(17,$s,2,1,"wink-validation-message",3),l.\u0275\u0275elementEnd()(),l.\u0275\u0275elementStart(18,"div",8)(19,"label",13),l.\u0275\u0275text(20),l.\u0275\u0275pipe(21,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(22,"div",10),l.\u0275\u0275element(23,"wink-input",14),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(24,"div",12),l.\u0275\u0275template(25,Js,3,2,"wink-validation-message",3),l.\u0275\u0275elementEnd()(),l.\u0275\u0275elementStart(26,"div",8)(27,"label",15),l.\u0275\u0275text(28),l.\u0275\u0275pipe(29,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(30,"div",10),l.\u0275\u0275element(31,"wink-input",16),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(32,"div",12),l.\u0275\u0275template(33,tl,3,2,"wink-validation-message",3),l.\u0275\u0275elementEnd()(),l.\u0275\u0275elementStart(34,"div",8)(35,"label",17),l.\u0275\u0275text(36),l.\u0275\u0275pipe(37,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(38,"div",10),l.\u0275\u0275element(39,"wink-input",18),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(40,"div",12),l.\u0275\u0275template(41,ol,3,2,"wink-validation-message",3),l.\u0275\u0275elementEnd()()()()()()()),i&2&&(l.\u0275\u0275advance(3),l.\u0275\u0275property("ngIf",!n.tipLimitModified),l.\u0275\u0275advance(),l.\u0275\u0275property("formGroup",n.tipContractEditLimitsForm),l.\u0275\u0275advance(2),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(7,15,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.lbl.subheading")," "),l.\u0275\u0275advance(6),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(13,17,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.lbl.friendly-plan-name")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction1(25,sn,n.tipContractEditLimitsForm.hasFriendlyPlanNameError)),l.\u0275\u0275advance(3),l.\u0275\u0275property("ngIf",n.tipContractEditLimitsForm.friendlyPlanNameLengthError),l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(21,19,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.lbl.tipmrc")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction1(27,sn,n.tipContractEditLimitsForm.hasTipMRCError)),l.\u0275\u0275advance(3),l.\u0275\u0275property("ngIf",n.tipContractEditLimitsForm.tipMRCRequiredError||n.tipContractEditLimitsForm.tipMRCPatternError),l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(29,21,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.lbl.tipnrc")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction1(29,sn,n.tipContractEditLimitsForm.hasTipNRCError)),l.\u0275\u0275advance(3),l.\u0275\u0275property("ngIf",n.tipContractEditLimitsForm.tipNRCRequiredError||n.tipContractEditLimitsForm.tipNRCPatternError),l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(37,23,"ng.tip-contracts-overview.manage-tip-contract-navigation.edit-tip-contract-limits.lbl.tipusage")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction1(31,sn,n.tipContractEditLimitsForm.hasTipUsageError)),l.\u0275\u0275advance(3),l.\u0275\u0275property("ngIf",n.tipContractEditLimitsForm.tipUsageRequiredError||n.tipContractEditLimitsForm.tipUsagePatternError))},dependencies:[ln.NgClass,ln.NgIf,lt.\u0275NgNoValidate,lt.NgControlStatus,lt.NgControlStatusGroup,lt.FormGroupDirective,lt.FormControlName,ti,ri,ni,Ho.TranslatePipe],styles:[`.edit-tip-contract-limits-header wink-input input{color:#000!important;background:#fff!important}.edit-tip-contract-limits-header wink-input input:hover{background:#fff!important;color:#000!important}.edit-tip-contract-limits-header wink-input .wink-input__field{color:#000!important}.edit-tip-contract-limits-header wink-input input::placeholder{color:#000!important;opacity:1!important}.formErrorInput{margin-top:-.9rem!important;margin-bottom:0!important;padding:0!important}
3`],encapsulation:2})}}return t})();import{DOCUMENT as rl}from"@angular/common";import"@angular/core";import"@ngxs/store";import*as te from"@angular/core";
3import*as zo from"@ngxs/store";import*as $o from"@ngx-translate/core";var pt=(()=>{class t extends D{constructor(e,i){super(),this.document=e,this.store=i}ngOnInit(){let e=[];this.store.dispatch(new Tt(!0)),this.store.dispatch(new Ht(e))}onBack(){this.document.dispatchEvent(new CustomEvent("overlay:close",{bubbles:!0}))}static{this.\u0275fac=function(i){return new(i||t)(te.\u0275\u0275directiveInject(rl),te.\u0275\u0275directiveInject(zo.Store))}}static{this.\u0275cmp=te.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-change-confirmation"]],standalone:!1,features:[te.\u0275\u0275InheritDefinitionFeature],decls:9,vars:3,consts:[[1,"contract-overview"],[1,"col-md-4","pt--xxg--md","m--auto"],["ngProjectAs","[button]",5,["","button",""]],[1,"mb--xxxl","mb--n--md"],[1,"button","button--primary",3,"click"]],template:function(i,n){i&1&&(te.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"app-tip-messaging"),te.\u0275\u0275elementContainerStart(3,2),te.\u0275\u0275elementStart(4,"div",3)(5,"button",4),te.\u0275\u0275listener("click",function(){return n.onBack()}),te.\u0275\u0275elementStart(6,"span"),te.\u0275\u0275text(7),te.\u0275\u0275pipe(8,"translate"),te.\u0275\u0275elementEnd()()(),te.\u0275\u0275elementContainerEnd(),te.\u0275\u0275elementEnd()()()),i&2&&(te.\u0275\u0275advance(7),te.\u0275\u0275textInterpolate(te.\u0275\u0275pipeBind1(8,1,"ng.tip-general.btn.back-to-list")))},dependencies:[qe,$o.TranslatePipe],encapsulation:2})}}return t})();import*as pn from"@angular/core";import*as Xo from"@ngxs/store";var Zo=(()=>{class t extends D{constructor(e){super(),this.store=e}handle(){this.initEditTIPContractSteps()}initEditTIPContractSteps(){let e=this.store.selectSnapshot(B.selectedTIPContract),i=[];e.futureProcessingDate&&(this.store.dispatch(new Ze({action:u.EDIT_TIP_CONTRACT,outcome:S.WARNING})),i=[H.builder(Pe.EDIT_TIP_CONTRACT_WARNING).withTemplate(K).withComponent(an).build()]);let n=[...i,H.builder(Pe.EDIT_TIP_CONTRACT_LIMITS).withTemplate(K).withComponent(Ko).build(),H.builder(Pe.TIP_CONTRACT_ACTIVATION_DATE).withTemplate(K).withComponent(Yo).build(),H.builder(Pe.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()];this.store.dispatch(new ke(n))}static{this.\u0275fac=function(i){return new(i||t)(pn.\u0275\u0275inject(Xo.Store))}}static{this.\u0275prov=pn.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();import{DOCUMENT as ul}from"@angular/common";import*as R from"@angular/core";import*as ir from"@ngxs/store";import*as cn from"@angular/common";import"@angular/core";import"@ngxs/store";import{forkJoin as sl,timer as ll}from"rxjs";import"@telenet/ng-lib-datalayer";import{DOCUMENT as pl}from"@angular/common";import*as w from"@angular/core";import*as Jo from"@ngxs/store";import*as Qo from"@telenet/ng-lib-datalayer";import*as mn from"@angular/common";import*as er from"@ngx-translate/core";function ml(t,o){if(t&1){let e=w.\u0275\u0275getCurrentView();w.\u0275\u0275elementStart(0,"wink-button",9),w.\u0275\u0275pipe(1,"translate"),w.\u0275\u0275listener("click",function(){w.\u0275\u0275restoreView(e);let n=w.\u0275\u0275nextContext(2);return w.\u0275\u0275resetView(n.goToPreviousStep())})("keydown.enter",function(){w.\u0275\u0275restoreView(e);let n=w.\u0275\u0275nextContext(2);return w.\u0275\u0275resetView(n.goToPreviousStep())})("keyup.enter",function(){w.\u0275\u0275restoreView(e);let n=w.\u0275\u0275nextContext(2);return w.\u0275\u0275resetView(n.goToPreviousStep())}),w.\u0275\u0275elementEnd()}if(t&2){let e=w.\u0275\u0275nextContext(2);w.\u0275\u0275property("text",w.\u0275\u0275pipeBind1(1,1,e.getPreviousButtonLabelKey()))}}function cl(t,o){if(t&1){let e=w.\u0275\u0275getCurrentView();w.\u0275\u0275elementStart(0,"wink-button",10),w.\u0275\u0275pipe(1,"translate"),w.\u0275\u0275listener("click",function(){w.\u0275\u0275restoreView(e);let n=w.\u0275\u0275nextContext(2);return w.\u0275\u0275resetView(n.goToNextStep())})("keydown.enter",function(){w.\u0275\u0275restoreView(e);let n=w.\u0275\u0275nextContext(2);
3return w.\u0275\u0275resetView(n.goToNextStep())})("keyup.enter",function(){w.\u0275\u0275restoreView(e);let n=w.\u0275\u0275nextContext(2);return w.\u0275\u0275resetView(n.goToNextStep())}),w.\u0275\u0275elementEnd()}if(t&2){let e=w.\u0275\u0275nextContext(2);w.\u0275\u0275property("text",w.\u0275\u0275pipeBind1(1,1,e.getNextButtonLabelKey()))}}function dl(t,o){if(t&1&&(w.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3),w.\u0275\u0275template(3,ml,2,3,"wink-button",4),w.\u0275\u0275elementEnd(),w.\u0275\u0275elementStart(4,"div",5),w.\u0275\u0275template(5,cl,2,3,"wink-button",6),w.\u0275\u0275elementEnd()(),w.\u0275\u0275elementStart(6,"div",7),w.\u0275\u0275element(7,"div",8),w.\u0275\u0275elementEnd()()),t&2){let e=w.\u0275\u0275nextContext();w.\u0275\u0275advance(3),w.\u0275\u0275property("ngIf",e.isPreviousButtonVisible()),w.\u0275\u0275advance(2),w.\u0275\u0275property("ngIf",e.isNextButtonVisible()),w.\u0275\u0275advance(2),w.\u0275\u0275property("ngClass",e.getProgressIndicatorClass())}}var Ei=(()=>{class t extends D{constructor(e,i,n,p,N){super(),this.store=e,this.domService=i,this.dataLayerService=n,this.messageService=p,this.document=N}ngOnInit(){this.obs(this.store.select($.currentStep)).subscribe(e=>{this.currentStep=e})}goToNextStep(){this.currentStep.nextButtonCallback?this.currentStep.nextButtonCallback().subscribe(e=>{e&&this.navigateToNextStep()}):this.navigateToNextStep()}goToPreviousStep(){this.store.dispatch(new Je(!0)),this.messageService.clearErrorMessages(de.CUSTOM_MESSAGE_GROUP_NAME),this.isFirstStep()?this.document.dispatchEvent(new CustomEvent("overlay:close",{bubbles:!0})):this.currentStep.prevButtonCallback?this.currentStep.prevButtonCallback().subscribe(e=>{e&&this.store.dispatch(new Fn)}):this.store.dispatch(new Fn)}isFirstStep(){let e=this.store.selectSnapshot($.steps);return this.currentStep.key===zn(e).key}getProgressIndicatorClass(){let e=this.store.selectSnapshot($.steps),i=Ln.getStepCount(e),n=Ln.getStepIndex(this.currentStep,e)+1;return"ready-"+this.getProgressCompletion(n,i)}getProgressCompletion(e,i){return Qn(e/i*100)}getNextButtonLabelKey(){let e=this.store.selectSnapshot($.currentStep);switch(e&&e.key){case ie.TIP_EMPLOYEES_LIST:return this.store.selectSnapshot(M.selectedTIPActionName)===u.RESEND_TIP_INVITE?"ng.tip-general.btn.send-invite":"ng.tip-general.btn.next";case ie.TIP_EMPLOYEE_REVIEW_CHANGES:return"ng.tip-general.btn.confirm";case Pe.EDIT_TIP_CONTRACT_WARNING:return"ng.tip-general.btn.continue";default:return"ng.tip-general.btn.next"}}isNextButtonVisible(){return this.store.selectSnapshot(M.allowedToProceed)?!this.messageService.hasErrorMessages(de.CUSTOM_MESSAGE_GROUP_NAME):!1}navigateToNextStep(){ll(200).subscribe(()=>{let e=this.dataLayerService.getAnalyticsPromises();sl(e).subscribe(()=>{this.store.dispatch(new Ee),this.domService.scrollToTop()})})}getPreviousButtonLabelKey(){let e=this.store.selectSnapshot($.currentStep);return(e&&e.key)===Pe.EDIT_TIP_CONTRACT_WARNING?"ng.tip-general.btn.cancel":"ng.tip-general.btn.back"}isPreviousButtonVisible(){let e=this.store.selectSnapshot($.currentStep);return(e&&e.key)!==ee.TIP_INVITATION_INTRODUCTION}static{this.\u0275fac=function(i){return new(i||t)(w.\u0275\u0275directiveInject(Jo.Store),w.\u0275\u0275directiveInject(Ye),w.\u0275\u0275directiveInject(Qo.DataLayerService),w.\u0275\u0275directiveInject(le),w.\u0275\u0275directiveInject(pl))}}static{this.\u0275cmp=w.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-navigation"]],standalone:!1,features:[w.\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[["class","sticky-footer-v2 position--fixed background-white width--full py--m px--xm p--xm--md display--flex justify-content--center align-items--center box-sizing--inherit shadow--xs-inverse position--bottom position--left",4,"ngIf"],[1,"sticky-footer-v2","position--fixed","background-white","width--full","py--m","px--xm","p--xm--md","display--flex","justify-content--center","align-items--center","box-sizing--inherit","shadow--xs-inverse","position--bottom","position--left"],[1,"sticky-footer-v2__c
3ontainer","width--full","default-max-site-width","display--flex","justify-content--between","align-items--center"],[1,"back-section"],["appearance","secondary","size","md","icon","chevron-left-button","icon-position","left","pointer-event","auto","exportparts","icon, icon-chevron-left-button",3,"text","click","keydown.enter","keyup.enter",4,"ngIf"],[1,"next-section"],["appearance","primary","size","md","pointer-event","auto","exportparts","icon, icon-chevron-left-button",3,"text","click","keydown.enter","keyup.enter",4,"ngIf"],[1,"progress-bar","manage-tip-contract__progress-bar"],[1,"indicator-progress",3,"ngClass"],["appearance","secondary","size","md","icon","chevron-left-button","icon-position","left","pointer-event","auto","exportparts","icon, icon-chevron-left-button",3,"click","keydown.enter","keyup.enter","text"],["appearance","primary","size","md","pointer-event","auto","exportparts","icon, icon-chevron-left-button",3,"click","keydown.enter","keyup.enter","text"]],template:function(i,n){i&1&&w.\u0275\u0275template(0,dl,8,3,"div",0),i&2&&w.\u0275\u0275property("ngIf",n.currentStep&&!n.currentStep.isFinal())},dependencies:[mn.NgClass,mn.NgIf,Be,er.TranslatePipe],encapsulation:2})}}return t})();import*as nr from"@ngx-translate/core";var El=t=>({"border--b--r border-width--b--r border-style--b--solid border-color--b--light-grey":t});function fl(t,o){if(t&1){let e=R.\u0275\u0275getCurrentView();R.\u0275\u0275elementStart(0,"div",8),R.\u0275\u0275element(1,"div",9),R.\u0275\u0275elementStart(2,"div",10)(3,"div",11)(4,"span",12),R.\u0275\u0275element(5,"i",13),R.\u0275\u0275elementEnd(),R.\u0275\u0275elementStart(6,"span",14)(7,"div",15)(8,"div",16),R.\u0275\u0275text(9),R.\u0275\u0275pipe(10,"translate"),R.\u0275\u0275elementEnd()()()()(),R.\u0275\u0275elementStart(11,"div",17)(12,"div",18),R.\u0275\u0275listener("click",function(){R.\u0275\u0275restoreView(e);let n=R.\u0275\u0275nextContext();return R.\u0275\u0275resetView(n.onClose())}),R.\u0275\u0275elementEnd()()()}t&2&&(R.\u0275\u0275advance(9),R.\u0275\u0275textInterpolate1(" ",R.\u0275\u0275pipeBind1(10,1,"ng.tip-contracts-overview.manage-tip-contract.lbl.change-tip-limits")," "))}function Tl(t,o){t&1&&R.\u0275\u0275element(0,"app-tip-navigation")}var or=(()=>{class t extends D{constructor(e,i,n,p){super(),this.editTIPContractStepHandler=e,this.store=i,this.tipDataLayerService=n,this.document=p}ngOnInit(){this.store.dispatch(new he(u.EDIT_TIP_CONTRACT)),this.editTIPContractStepHandler.handle(),this.fireAnalyticsFlowStartEvent()}onClose(){this.document.dispatchEvent(new CustomEvent("overlay:close",{bubbles:!0}))}onOverlayClose(){this.store.dispatch(new Xe(void 0)),this.store.dispatch(new ut(!1))}isFinalStep(){return this.store.selectSnapshot($.currentStep).isFinal()}getStepFlowAnalyticsConfig(){return{analyticsIntent:this.store.selectSnapshot(M.selectedTIPActionName),analyticsFlowType:"tip"}}fireAnalyticsFlowStartEvent(){this.tipDataLayerService.fireAnalyticsFlowStartEvent()}renderTitle(){return this.store.selectSnapshot($.currentStep).key===Pe.EDIT_TIP_CONTRACT_WARNING?!1:!this.isFinalStep()}static{this.\u0275fac=function(i){return new(i||t)(R.\u0275\u0275directiveInject(Zo),R.\u0275\u0275directiveInject(ir.Store),R.\u0275\u0275directiveInject(De),R.\u0275\u0275directiveInject(ul))}}static{this.\u0275cmp=R.\u0275\u0275defineComponent({type:t,selectors:[["app-edit-tip-contract"]],hostBindings:function(i,n){i&1&&R.\u0275\u0275listener("overlay:close",function(){return n.onOverlayClose()},R.\u0275\u0275resolveDocument)},standalone:!1,features:[R.\u0275\u0275InheritDefinitionFeature],decls:8,vars:6,consts:[[1,"overlay-page"],[1,"overlay","manage-tip-contract--overlay","background-white","overflow--auto"],[1,"manage-tip-contract--overlay__header","old-overlay__header","background-white","display--flex","flex-direction--column","border--b--r","border-width--b--r","border-style--b--solid","border-color--b--light-grey",3,"ngClass"],["class","row align-items--center display--flex my--xl--sm my--l",4,"ngIf"],[1,"old-overlay__content-container","background-white"],[1,"container--overlay","mb-0"],[3,"stepFlowAnalyticsConfig"],[4,"ngIf"],[1,"row","align-items--center","display--flex","my--xl--sm","my--l"],[1,"col-1"],[1,"col-7"],[1,"align-items--center","display--flex"],[1,"page-title__icon","mr--s"],[1,"icon","icon-md","icon-pencil","font--body-small"],[1,"page-title__header"],[1,""],[1,"text-weight--g"],[1,"col-3"],[1,"icon","icon-md","icon-cross","text-align--right","cursor--pointer",3,"click"]],template:function(i,n){i&1&&(R.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2),R.\u0275\u0275template(3,fl,13,3,"div",3),R.\u0275\u0275elementEnd(),R.\u0275\u0275elementStart(4,"div",4)(5,"div",5),R.\u0275\u0275element(6,"app-step-container",6),R.\u0275\u0275template(7,Tl,1,0,"app-tip-navigation",7),R.\u0275\u0275elementEnd()()()()),i&2&&(R.\u0275\u0275advance(2),R.\u0275\u0275property("ngClass",R.\u0275\u0275pureFunction1(4,El,n.renderTitle())),R.\u
30275\u0275advance(),R.\u0275\u0275property("ngIf",!n.isFinalStep()),R.\u0275\u0275advance(3),R.\u0275\u0275property("stepFlowAnalyticsConfig",n.getStepFlowAnalyticsConfig()),R.\u0275\u0275advance(),R.\u0275\u0275property("ngIf",!n.isFinalStep()))},dependencies:[cn.NgClass,cn.NgIf,oi,Ei,nr.TranslatePipe],encapsulation:2})}}return t})();import*as sr from"@ngx-translate/core";function _l(t,o){if(t&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-tip-contract-detail",21),E.\u0275\u0275elementContainerEnd()),t&2){let e=o.$implicit;E.\u0275\u0275advance(),E.\u0275\u0275property("tipContract",e)}}function Il(t,o){t&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275elementStart(1,"div",22)(2,"div",23),E.\u0275\u0275element(3,"app-edit-tip-contract-sticky-footer"),E.\u0275\u0275elementEnd()(),E.\u0275\u0275elementContainerEnd())}function vl(t,o){t&1&&(E.\u0275\u0275elementContainerStart(0),E.\u0275\u0275element(1,"app-edit-tip-contract"),E.\u0275\u0275elementContainerEnd())}var lr=(()=>{class t extends mo{constructor(e,i,n,p){super(p),this.promotionService=e,this.cdRef=i,this.store=n,this.requiredScopes=fe.SCOPES,this.loggedIn=!1,this.messageGroupName=fe.MESSAGE_GROUP,this.messageGroupNonBlockingError=fe.MESSAGE_GROUP_NON_BLOCKING_ERROR,this.sortOrder=$e.ASC,this.showSkeleton=!1,this.showChangeTIPContractLimitsOverlay$=this.store.select(B.showChangeTIPContractLimitsOverlay),this.selectedTIPContract$=this.store.select(B.selectedTIPContract)}initAfterLoggedIn(){this.loggedIn=!0,this.getTIPContracts(),this.reloadTIPContracts()}reloadTIPContracts(){this.store.select(M.message).subscribe(e=>{e&&e.action===u.EDIT_TIP_CONTRACT&&[S.CHANGES_ACTIVE_IN_FUTURE,S.CHANGES_ACTIVE_NOW].includes(e.outcome)&&this.getTIPContracts()})}getTIPContracts(){this.promotionService.getTIPContracts(this.messageGroupName).subscribe(e=>{this.tipContracts=e,this.tipContracts&&this.tipContracts.length>1&&this.sortTIPContracts("normalizedStatus")})}sortTIPContracts(e){this.sortOrder=Nt.getSortOrder(this.sortedBy,e,this.sortOrder),this.tipContracts=Pi(this.tipContracts,[e],[this.sortOrder]),this.sortedBy=e,this.cdRef.detectChanges()}getSortingIconClassName(e){return Nt.getSortChevron(this.sortedBy,e,this.sortOrder)}static{this.\u0275fac=function(i){return new(i||t)(E.\u0275\u0275directiveInject(pe),E.\u0275\u0275directiveInject(E.ChangeDetectorRef),E.\u0275\u0275directiveInject(rr.Store),E.\u0275\u0275directiveInject(E.ElementRef))}}static{this.\u0275cmp=E.\u0275\u0275defineComponent({type:t,selectors:[["tg-tip-contracts-overview"]],inputs:{pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask"},standalone:!1,features:[E.\u0275\u0275InheritDefinitionFeature],decls:43,vars:32,consts:[[3,"componentCanRender","messageGroupName","scopes"],[3,"messageGroupName"],[3,"enableLoader","pageType","enableMask"],[1,"tip-overview","contract-overview"],[1,"contract-overview__row"],[1,"label__price-all"],[1,"text-flow","text-flow--detail","text-align--right--md","mb--m"],[1,"label-row","display--flex","contract-row-item"],[1,"contract-row-item__right","contract-row-item__items","width--full","display--flex","p--m","p--l--md"],[1,"label-column","contract-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--extra-small"],[1,"text-uppercase","color-white_04","text--s","mb--n"],[1,"label-column","contract-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--giant",3,"click"],[1,"icon","icon-sm","position--relative","mx--xxs",3,"ngClass"],[1,"label-column","contract-row-item__item","display--flex","align-items--center","label-column--giant"],[1,"text-uppercase","cursor--default","color-white_04","text--s","mb--n"],[1,"label-column","contract-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--medium"],[1,"label-column","contract-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--medium",3,"click"],[1,"label-column","contract-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--small",3,"click"],[1,"label-column","contract-row-item__item","display--flex","align-items--center","cursor--default","label-column--extra-small","justify-content--center","text-align--center"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"tipContract"],[1,"sticky-container"],[1,"sticky-action-item"]],template:function(i,n){i&1&&(E.\u0275\u0275elementStart(0,"tg-login",0),E.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),E.\u0275\u0275elementContainerStart(1),E.\u0275\u0275element(2,"app-message-flow",1),E.\u0275\u0275elementStart(3,"app-message-flow",1),E.\u0275\u0275element(4,"app-loader",2),E.\u0275\u0275elementStart(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6),E.\u0275\u0275text(9),E.\u0275\u0275pipe(10,"translate"),E.\u0275\u0275elementEnd()(),E.\u0275\u0275elementStart(11,"div",7)(12,"div",8)(13,"div",9),E.\u0275\u0275element(14,"label",10),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementStart(15,"div",11),E.\u0275\u0275listener("click",function(){return n.sortTIPContracts("planName")}),E.\u0275\u0275elementStart(16,"label",10),E.\u0275\u0275text(17),E.\u0275\u0275pipe(18,"translate"),E.\u0275\u0275elementEnd(),E.\u0275\u0275element(19,"div",12),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementStart(20,"div",13)(21,"label",14),E.\u0275\u0275text(22),E.\u0275\u0275pipe(23,"translate"),E.\u0275\u0275elementEnd()(),E.\u0275\u0275elementStart(24,"div",15),E.\u0275\u0275element(25,"label",10),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementStart(26,"div",16),E.\u0275\u0275listener("click",function(){return n.sortTIPContracts("normalizedStatus")}),E.\u0275\u0275elementStart(27,"label",10),E.\u0275\u0275text(28),E.\u0275\u0275pipe(29,"translate"),E.\u0275\u0275elementEnd(),E.\u0275\u0275element(30,"div",12),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementStart(31,"div",17),E.\u0275\u0275listener("click",function(){return n.sortTIPContracts("noOfEmployees")}),E.\u0275\u0275elementStart(32,"label",10),E.\u0275\u0275text(33),E.\u0275\u0275pipe(34,"translate"),E.\u0275\u0275elementEnd(),E.\u0275\u0275element(35,"div",12),E.\u0275\u0275elementEnd(),E.\u0275\u0275elementStart(36,"div",18),E.\u0275\u0275element(37,"label",10),E.\u0275\u0275elementEnd()()(),E.\u0275\u0275template(38,_l,2,1,"ng-container",19)(39,Il,4,0,"ng-container",20),E.\u0275\u0275pipe(40,"async"),E.\u0275\u0275elementEnd(),E.\u0275\u0275template(41,vl,2,0,"ng-container",20),E.\u0275\u0275pipe(42,"async"),E.\u0275\u0275elementEnd()(),E.\u0275\u0275elementContainerEnd(),E.\u0275\u0275elementEnd()),i&2&&(E.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.requiredScopes),E.\u0275\u0275advance(2),E.\u0275\u0275property("messageGroupName",n.messageGroupNonBlockingError),E.\u0275\u0275advance(),E.\u0275\u0275property("messageGroupName",n.messageGroupName),E.\u0275\u0275advance(),E.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask),E.\u0275\u0275advance(5),E.\u0275\u0275textInterpolate1(" ",E.\u0275\u0275pipeBind1(10,18,"ng.tip-contracts-overview.lbl.all-prices-exclude-vat")," "),E.\u0275\u0275advance(8),E.\u0275\u0275textInterpolate(E.\u0275\u0275pipeBind1(18,20,"ng.tip-contracts-overview.lbl.tip-plan-name")),E.\u0275\u0275advance(2),E.\u0275\u0275property("ngClass",n.getSortingIconClassName("planName")),E.\u0275\u0275advance(3),E.\u0275\u0275textInterpolate(E.\u0275\u0275pipeBind1(23,22,"ng.tip-contracts-overview.lbl.tip-plan-cost")),E.\u0275\u0275advance(6),E.\u0275\u0275textInterpolate(E.\u0275\u0275pipeBind1(29,24,"ng.tip-contracts-overview.lbl.tip-status")),E.\u0275\u0275advance(2),E.\u0275\u0275property("ngClass",n.getSortingIconClassName("normalizedStatus")),E.\u0275\u0275advance(3),E.\u0275\u0275textInterpolate(E.\u0275\u0275pipeBind1(34,26,"ng.tip-contracts-overview.lbl.no-of-employees")),E.\u0275\u0275advance(2),E.\u0275\u0275property("ngClass",n.getSortingIconClassName("noOfEmployees")),E.\u0275\u0275advance(3),E.\u0275\u0275property("ngForOf",n.tipContracts),E.\u0275\u0275advance(),E.\u0275\u0275property("ngIf",E.\u0275\u0275pipeBind1(40,28,n.selectedTIPContract$)),E.\u0275\u0275advance(2),E.\u0275\u0275property("ngIf",E.\u0275\u0275pipeBind1(42,30,n.showChangeTIPContractLimitsOverlay$)))},dependencies:[wt.NgClass,wt.NgForOf,wt.NgIf,Pt,ar.LoginComponent,be,rn,Oo,or,wt.AsyncPipe,sr.TranslatePipe],encapsulation:2})}}return t})();import{TranslateModule as $m}from"@ngx-translate/core";import{provideStates as Xm}from"@ngxs/store";import{FormsModule as Zm,ReactiveFormsModule as Jm}from"@angular/forms";import"@angular/core";import"@ngxs/store";import"@ngx-translate/core";import"@angular/common";import{catchError as um,forkJoin as Em,of as fm}from"rxjs";import"@angular/core";var pr=qn(qa());import*as mr from"@angular/core";var cr=(()=>{class t{exportAsExcel(e){return Mn(this,null,function*(){let i=yield this.createWorkBook(),n=this.createWorkSheet(i,e);this.createHeaderRow(n,e),this.createRowsForDataObject(n,e),this.saveAsXLSX(i,e)})}createWorkBook(){return Mn(this,null,function*(){let e=yield import("/etc/designs/aff-telenetgroup/ng/dist/telenetgroup-app/chunk-KXNJVXXH.js"),i=e.Workbook??e.default?.Workbook;if(!i)throw new Error("ExcelJS Workbook constructor is unavailable");return new i})}createWorkSheet(e,i){let n=i.worksheetTitle||"Extract",p=e.addWorksheet(n);return p.properties.defaultColWidth=20,p}createHeaderRow(e,i){z(i.headers)||e.addRow(i.headers).eachCell((p,N)=>{p.fill={type:"pattern",pattern:"solid",fgColor:{argb:"f7d020"},bgColor:{argb:""}},p.font={bold:!0,color:{argb:"171717"},size:12}})}createRowsForDataObject(e,i){i.data&&!z(i.data)&&e.addRows(i.data)}saveAsXLSX(e,i){e&&e.xlsx.writeBuffer().then(n=>{let p=new Blob([n],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});pr.saveAs(p,i.title+".xlsx")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=mr.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();import*as s from"@angular/core";import*as ia from"@ngxs/store";
3import*as Cn from"@ngx-translate/core";import*as Dt from"@angular/common";import*as na from"@telenet/ng-lib-ocapi";import{computed as yl,inject as dr,input as ur}from"@angular/core";import{Store as Cl}from"@ngxs/store";import{TranslateService as Sl}from"@ngx-translate/core";var fi=(function(t){return t.NEUTRAL="neutral",t.POSITIVE="positive",t.NEGATIVE="negative",t.WARNING="warning",t.INFORMATIVE="informative",t})(fi||{});import*as I from"@angular/core";import*as Ti from"@angular/common";function Pl(t,o){if(t&1&&(I.\u0275\u0275elementStart(0,"div",13)(1,"div",14)(2,"div",15),I.\u0275\u0275text(3),I.\u0275\u0275elementEnd()(),I.\u0275\u0275elementStart(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",19),I.\u0275\u0275text(8),I.\u0275\u0275elementEnd()()()()()),t&2){let e=I.\u0275\u0275nextContext();I.\u0275\u0275advance(3),I.\u0275\u0275textInterpolate1(" ",e.tipEmployee().emailAddress," "),I.\u0275\u0275advance(5),I.\u0275\u0275textInterpolate1(" ",e.tipEmployee().emailAddress," ")}}function Nl(t,o){if(t&1&&(I.\u0275\u0275elementStart(0,"div",13)(1,"div",14)(2,"div",15),I.\u0275\u0275text(3),I.\u0275\u0275elementEnd()(),I.\u0275\u0275elementStart(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",19),I.\u0275\u0275text(8),I.\u0275\u0275elementEnd()()()()()),t&2){let e=I.\u0275\u0275nextContext();I.\u0275\u0275advance(3),I.\u0275\u0275textInterpolate1(" ",e.tipEmployee().employeeReferenceNumber," "),I.\u0275\u0275advance(5),I.\u0275\u0275textInterpolate1(" ",e.tipEmployee().employeeReferenceNumber," ")}}function Al(t,o){if(t&1&&(I.\u0275\u0275elementStart(0,"div",20),I.\u0275\u0275text(1),I.\u0275\u0275pipe(2,"date"),I.\u0275\u0275elementEnd()),t&2){let e=I.\u0275\u0275nextContext();I.\u0275\u0275advance(),I.\u0275\u0275textInterpolate1(" ",I.\u0275\u0275pipeBind2(2,1,e.tipEmployee().futureProcessingDate,"dd/MM/yyyy")," ")}}function xl(t,o){if(t&1&&(I.\u0275\u0275elementStart(0,"div",13)(1,"div",14)(2,"div",21),I.\u0275\u0275text(3),I.\u0275\u0275elementEnd()(),I.\u0275\u0275elementStart(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",19),I.\u0275\u0275text(8),I.\u0275\u0275elementEnd()()()()()),t&2){let e=I.\u0275\u0275nextContext();I.\u0275\u0275advance(3),I.\u0275\u0275textInterpolate1(" ",e.tipEmployee().displayPlanName," "),I.\u0275\u0275advance(5),I.\u0275\u0275textInterpolate1(" ",e.tipEmployee().displayPlanName," ")}}var Er=(()=>{class t extends D{constructor(){super(...arguments),this.store=dr(Cl),this.translateService=dr(Sl),this.tipEmployee=ur.required(),this.rowIndex=ur(),this.statusState=yl(()=>{let e=this.tipEmployee();if(!e?.normalizedStatus)return fi.NEUTRAL;switch(e.normalizedStatus.toUpperCase()){case Oe.ACTIVE:return fi.POSITIVE;case Oe.INVITED:return fi.WARNING;default:return fi.NEUTRAL}})}onSelect(){this.isSelected()?this.store.dispatch(new Wt(this.tipEmployee())):this.store.dispatch(new jt(this.tipEmployee()))}isSelected(){let e=this.store.selectSnapshot(h.selectedTIPEmployees);return!Gi(e)&&to(e,this.tipEmployee())}getI18NLabel(e){return this.translateService.instant("ng.tip-employees-overview.lbl.".concat(this.normalizeKey(e)))}normalizeKey(e){if(!z(e))return e.replace(/ /g,"-").toLowerCase()}showFutureProcessingDate(){return this.tipEmployee()?.futureProcessingDate&&this.tipEmployee()?.futureProcessingDate>this.tipEmployee()?.activationDate}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=I.\u0275\u0275getInheritedFactory(t)))(n||t)}})()}static{this.\u0275cmp=I.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employee-detail"]],inputs:{tipEmployee:[1,"tipEmployee"],rowIndex:[1,"rowIndex"]},standalone:!1,features:[I.\u0275\u0275InheritDefinitionFeature],decls:21,vars:17,consts:[[1,"content-row","employee-row-item","display--flex","flex-direction--row","mb--xs","border-radius--all--xs","background-white","color-shade_72",3,"ngClass"],[1,"row","row--no-gutters","align-items--center","employee-row-item__left","employee-row-item__selected-item","justify-content--around","border--r--r","border-width--r--r","border-style--r--solid","border-color--r--grey","p--n","select-row"],[3,"change","id","name","checked"],[1,"employee-row-item__right","employee-row-item__items","display--flex","cursor--default","p--m","p--l--md"],[1,"label-column","employee-row-item__item","align-self--center","pr--m","label-column--medium","word-break--break-word"],[1,"text--m","text--xm--md"],[1,"label-column","employee-row-item__item","align-self--center","pr--m","label-column--extra-large"],["class","tooltip position--relative width--full",4,"ngIf"],[1,"label-column","employee-row-item__item","align-self--center","pr--m","label-column--large"],["front-element","dot","has-background","true",3,"status"],["class","mt--xs text--s",4,"ngIf"],[1,"label-column","employee-row-item__item","align-self--center","pr--m","label-column--medium"],[1,"label-column","employee-row-item__item","align-self--center","pr--m"],[1,"tooltip","position--relative","width--full"],[1,"tooltip__icon-section","display--flex","flex-direction--row--sm","flex-direction--row-reverse","align-items--center","justify-content--start","cursor--pointer","my--xxxs"],[1,"icon-label","align-items--center","no-scroll"],[1,"tooltip__info-section","tooltip__info-section__arrow-right","tooltip__info-section__arrow-left","tooltip__info-section--left","mt--xs","tooltip__info-section--hidden-mobile"],[1,"horizontal-center-align"],[1,"info-section__description"],[1,"info-section__description__text"],[1,"mt--xs","text--s"],[1,"icon-label","align-items--center","no-scroll","space-nowrap"]],template:function(i,n){if(i&1&&(I.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"wink-checkbox",2),I.\u
30275\u0275listener("change",function(){return n.onSelect()}),I.\u0275\u0275elementEnd()(),I.\u0275\u0275elementStart(3,"div",3)(4,"div",4)(5,"div",5),I.\u0275\u0275text(6),I.\u0275\u0275elementEnd()(),I.\u0275\u0275elementStart(7,"div",6),I.\u0275\u0275template(8,Pl,9,2,"div",7),I.\u0275\u0275elementEnd(),I.\u0275\u0275elementStart(9,"div",6),I.\u0275\u0275template(10,Nl,9,2,"div",7),I.\u0275\u0275elementEnd(),I.\u0275\u0275elementStart(11,"div",8)(12,"wink-status-indicator",9),I.\u0275\u0275text(13),I.\u0275\u0275elementEnd(),I.\u0275\u0275template(14,Al,3,4,"div",10),I.\u0275\u0275elementEnd(),I.\u0275\u0275elementStart(15,"div",11),I.\u0275\u0275template(16,xl,9,2,"div",7),I.\u0275\u0275elementEnd(),I.\u0275\u0275elementStart(17,"div",12)(18,"div",5),I.\u0275\u0275text(19),I.\u0275\u0275pipe(20,"date"),I.\u0275\u0275elementEnd()()()()),i&2){let p,N;I.\u0275\u0275property("ngClass",n.isSelected()?"selected-row":""),I.\u0275\u0275advance(2),I.\u0275\u0275property("id",I.\u0275\u0275interpolate1("select-user-",((p=n.tipEmployee())==null?null:p.employeeCustomerNumber)??n.rowIndex()))("name",I.\u0275\u0275interpolate1("select-user-",((N=n.tipEmployee())==null?null:N.employeeCustomerNumber)??n.rowIndex()))("checked",n.isSelected()),I.\u0275\u0275advance(4),I.\u0275\u0275textInterpolate1(" ",n.tipEmployee().firstName+" "+n.tipEmployee().lastName," "),I.\u0275\u0275advance(2),I.\u0275\u0275property("ngIf",n.tipEmployee().emailAddress),I.\u0275\u0275advance(2),I.\u0275\u0275property("ngIf",n.tipEmployee().employeeReferenceNumber),I.\u0275\u0275advance(2),I.\u0275\u0275property("status",n.statusState()),I.\u0275\u0275advance(),I.\u0275\u0275textInterpolate1(" ",n.getI18NLabel(n.tipEmployee().normalizedStatus)," "),I.\u0275\u0275advance(),I.\u0275\u0275property("ngIf",n.showFutureProcessingDate()),I.\u0275\u0275advance(2),I.\u0275\u0275property("ngIf",n.tipEmployee().displayPlanName),I.\u0275\u0275advance(3),I.\u0275\u0275textInterpolate1(" ",I.\u0275\u0275pipeBind2(20,14,n.tipEmployee().activationDate,"dd/MM/yyyy")," ")}},dependencies:[Ti.NgClass,Ti.NgIf,ji,ei,Ti.DatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import*as U from"@angular/core";import*as _r from"@ngxs/store";import*as _i from"@angular/common";import"@angular/core";import{FormControl as Vn,FormGroup as fr,Validators as wl}from"@angular/forms";import"@ngxs/store";import"@ngx-translate/core";import{take as Ol}from"rxjs/operators";import*as f from"@angular/core";import*as Tr from"@ngxs/store";import*as dn from"@ngx-translate/core";import*as gi from"@angular/common";import*as ge from"@angular/forms";function Ml(t,o){t&1&&(f.\u0275\u0275elementStart(0,"div",20)(1,"div"),f.\u0275\u0275text(2),f.\u0275\u0275pipe(3,"translate"),f.\u0275\u0275elementEnd()()),t&2&&(f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate1(" ",f.\u0275\u0275pipeBind1(3,1,"ng.tip-employees-overview.lbl.invalid-search-term.warning")," "))}function Rl(t,o){if(t&1&&(f.\u0275\u0275elementStart(0,"option",21),f.\u0275\u0275text(1),f.\u0275\u0275elementEnd()),t&2){let e=o.$implicit;f.\u0275\u0275property("value",e),f.\u0275\u0275advance(),f.\u0275\u0275textInterpolate(e)}}function Dl(t,o){if(t&1&&(f.\u0275\u0275elementStart(0,"option",21),f.\u0275\u0275text(1),f.\u0275\u0275elementEnd()),t&2){let e=o.$implicit,i=f.\u0275\u0275nextContext();f.\u0275\u0275property("value",e),f.\u0275\u0275advance(),f.\u0275\u0275textInterpolate(i.getTranslatedStatus(e))}}var gr=(()=>{class t{constructor(e,i){this.store=e,this.translateService=i,this.tipEmployeesSearchFiltersForm=new fr({}),this.messageGroupName=Me.MESSAGE_GROUP,this.tipPlanNames=[],this.employeeNormalizedStatuses=[]}ngOnInit(){this.initTIPPlanNames(),this.initEmployeeStatuses(),this.initForm()}initEmployeeStatuses(){this.employeeNormalizedStatuses=Object.values(Oe),this.employeeNormalizedStatuses=oo(this.employeeNormalizedStatuses,Oe.DEACTIVATED)}initTIPPlanNames(){this.store.select(B.allTIPContracts).pipe(Ol(1)).subscribe(()=>{let e=this.store.selectSnapshot(B.allTIPContracts);z(e)||(this.tipPlanNames=[],St(e,i=>{i.normalizedStatus===we.ACTIVE&&this.tipPlanNames.push(i.displayPlanName)}))})}getTranslatedStatus(e){return this.translateService.instant("ng.tip-employees-overview.lbl.".concat(Zn(e)))}initForm(){let e=this.store.selectSnapshot(h.tipEmployeesSearchFilters);this.tipEmployeesSearchFiltersForm=new fr({searchTerm:new Vn("",[wl.minLength(3)]),tipPlanName:new Vn(""),employeeNormalizedStatus:new Vn("")}),z(e)||(e.searchTerm&&this.tipEmployeesSearchFiltersForm.get("searchTerm").setValue(e.searchTerm.toLowerCase()),e.displayPlanName&&this.tipEmployeesSearchFiltersForm.get("tipPlanName").setValue(e.dis
3playPlanName),e.normalizedStatus&&this.tipEmployeesSearchFiltersForm.get("employeeNormalizedStatus").setValue(e.normalizedStatus))}applyFilters(){let e=new li;this.tipEmployeesSearchFiltersForm.get("searchTerm").value&&this.tipEmployeesSearchFiltersForm.get("searchTerm").value.length>2&&(e.searchTerm=this.tipEmployeesSearchFiltersForm.get("searchTerm").value.toLowerCase()),this.tipEmployeesSearchFiltersForm.get("tipPlanName").value&&(e.displayPlanName=this.tipEmployeesSearchFiltersForm.get("tipPlanName").value),this.tipEmployeesSearchFiltersForm.get("employeeNormalizedStatus").value&&(e.normalizedStatus=this.tipEmployeesSearchFiltersForm.get("employeeNormalizedStatus").value),this.store.dispatch(new it(e)),this.closeForm()}resetFilters(){this.enableResetFiltersButton()&&(this.tipEmployeesSearchFiltersForm.get("searchTerm").setValue(""),this.tipEmployeesSearchFiltersForm.get("tipPlanName").setValue(""),this.tipEmployeesSearchFiltersForm.get("employeeNormalizedStatus").setValue(""),this.store.dispatch(new it(void 0)))}enableApplyFilterButton(){let e=this.tipEmployeesSearchFiltersForm.get("searchTerm").value,i=this.tipEmployeesSearchFiltersForm.get("tipPlanName").value,n=this.tipEmployeesSearchFiltersForm.get("employeeNormalizedStatus").value;return!z(e)&&e.length>2||!z(i)||!z(n)}enableResetFiltersButton(){let e=this.tipEmployeesSearchFiltersForm.get("searchTerm").value?.trim?.(),i=this.tipEmployeesSearchFiltersForm.get("tipPlanName").value,n=this.tipEmployeesSearchFiltersForm.get("employeeNormalizedStatus").value;return!z(e)||!z(i)||!z(n)}closeForm(){this.store.dispatch(new nt(!1))}static{this.\u0275fac=function(i){return new(i||t)(f.\u0275\u0275directiveInject(Tr.Store),f.\u0275\u0275directiveInject(dn.TranslateService))}}static{this.\u0275cmp=f.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employees-search-filters"]],standalone:!1,decls:45,vars:33,consts:[[1,"search-item__section"],[3,"formGroup"],[1,"row"],[1,"col-md-6","section-item"],[1,"form-builder","form-group"],[1,"color-shade_72"],[1,"form__input-container","position--relative"],["type","text","name","searchTerm","formControlName","searchTerm",1,"form__input",3,"placeholder"],[1,"form__input--icon","position--absolute","position--right"],[1,"icon","icon-search","text-weight--g","text--m","px--s"],["class","form__msg--warning form__input__invalid-message",4,"ngIf"],[1,"select-dropdown-section"],["name","tipPlanName","id","tipPlanName","formControlName","tipPlanName",1,"form-control","select-dropdown","mb-0",3,"ngClass"],["value","","selected","",1,"placeholder-option"],[3,"value",4,"ngFor","ngForOf"],[1,"icon","icon-chevron-down","position--absolute","text--m","text-weight--g"],["name","employeeNormalizedStatus","id","employeeNormalizedStatus","formControlName","employeeNormalizedStatus",1,"form-control","select-dropdown","mb-0",3,"ngClass"],[1,"search-item-actions","row","row--no-gutters","justify-content--end","gap--md"],["type","button",1,"button","button--secondary","mb--m","mb--n--sm",3,"click","disabled"],["type","button",1,"button","button--primary","ml--n","ml--m--sm",3,"click","disabled"],[1,"form__msg--warning","form__input__invalid-message"],[3,"value"]],template:function(i,n){i&1&&(f.\u0275\u0275elementStart(0,"div",0)(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label",5),f.\u0275\u0275text(6),f.\u0275\u0275pipe(7,"translate"),f.\u0275\u0275elementEnd(),f.\u0275\u0275elementStart(8,"div",6),f.\u0275\u0275element(9,"input",7),f.\u0275\u0275pipe(10,"translate"),f.\u0275\u0275elementStart(11,"span",8),f.\u0275\u0275element(12,"i",9),f.\u0275\u0275elementEnd()(),f.\u0275\u0275template(13,Ml,4,3,"div",10),f.\u0275\u0275elementEnd()(),f.\u0275\u0275elementStart(14,"div",3)(15,"div",4)(16,"label",5),f.\u0275\u0275text(17),f.\u0275\u0275pipe(18,"translate"),f.\u0275\u0275elementEnd(),f.\u0275\u0275elementStart(19,"div",11)(20,"select",12)(21,"option",13),f.\u0275\u0275text(22),f.\u0275\u0275pipe(23,"translate"),f.\u0275\u0275elementEnd(),f.\u0275\u0275template(24,Rl,2,2,"option",14),f.\u0275\u0275elementEnd(),f.\u0275\u0275element(25,"div",15),f.\u0275\u0275elementEnd()()(),f.\u0275\u0275elementStart(26,"div",3)(27,"div",4)(28,"label",5),f.\u0275\u0275text(29),f.\u0275\u0275pipe(30,"translate"),f.\u0275\u0275elementEnd(),f.\u0275\u0275elementStart(31,"div",11)(32,"select",16)(33,"option",13),f.\u0275\u0275text(34),f.\u0275\u0275pipe(35,"translate"),f.\u0275\u0275elementEnd(),f.\u0275\u0275template(36,Dl,2,2,"option",14),f.\u0275\u0275elementEnd(),f.\u0275\u0275element(37,"div",15),f.\u0275\u0275elementEnd()()()(),f.\u0275\u0275elementStart(38,"div",17)(39,"button",18),f.\u0275\u0275listener("click",function(){return n.resetFilters()}),f.\u0275\u0275text(40),f.\u0275\u0275pipe(41,"translate"),f.\u0275\u0275elementEnd(),f.\u0275\u0275elementStart(42,"button",19),f.\u0275\u0275listener("click",function(){return n.applyFilters()}),f.\u0275\u0275text(43),f.\u0275\u0275pipe(44,"translate"),f.\u0275\u0275elementEnd()()()()),i&2&&(f.\u0275\u0275advance(),f.\u0275\u0275property("formGroup",n.tipEmployeesSearchFiltersForm),f.\u0275\u0275advance(5),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(7,17,"ng.tip-employees-overview.lbl.search")),f.\u0275\u0275advance(3),f.\u0275\u0275property("placeholder",f.\u0275\u0275interpolate(f.\u0275\u0275pipeBind1(10,19,"ng.tip-employees-overview.phd.search"))),f.\u0275\u0275advance(4),f.\u0275\u0275property("ngIf",n.tipEmployeesSearchFiltersForm.controls.searchTerm.errors),f.\u0275\u0275advance(4),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(18,21,"ng.tip-employees-overview.lbl.plan-name")),f.\u0275\u0275advance(3),f.\u0275\u0275property("ngClass",n.tipEmployeesSearchFiltersForm.controls.tipPlanName.value==""?"select-placeholder":""),f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(23,23,"ng.tip-employees-overview.phd.select-plan")),f.\u0275\u0275advance(2),f.\u0275\u0275property("ngForOf",n.tipPlanNames),f.\u0275\u0275advance(5),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(30,25,"ng.tip-employees-overview.lbl.account-status")),f.\u0275\u0275advance(3),f.\u0275\u0275property("ngClass",n.tipEmployeesSearchFiltersForm.controls.employeeNormalizedStatus.value==""?"select-placeholder":""),f.\u0275\u0275advance(2),f.\u0275\u0275textInterpolate(f.\u0275\u0275pipeBind1(35,27,"ng.tip-employees-overview.phd.select-status")),f.\u0275\u0275advance(2),f.\u0275\u0275property("ngForOf",n.employeeNormalizedStatuses),f.\u0275\u0275advance(3),f.\u0275\u0275property("disabled",!n.enableResetFiltersButton()),f.\u0275\u0275advance(),f.\u0275\u0275textInterpolate1(" ",f.\u0275\u0275pipeBind1(41,29,"ng.tip-employees-overview.btn.clear-filters")," "),f.\u0275\u0275advance(2),f.\u0275\u0275property("disabled",!n.enableApplyFilterButton()),f.\u0275\u0275advance(),f.\u0275\u0275textInterpolate1(" ",f.\u0275\u0275pipeBind1(44,31,"ng.tip-employees-overview.btn.apply-filters")," "))},dependencies:[gi.NgClass,gi.NgForOf,gi.NgIf,ge.\u0275NgNoValidate,ge.NgSelectOption,ge.\u0275NgSelectMultipleOption,ge.DefaultValueAccessor,ge.SelectControlValueAccessor,ge.NgControlStatus,ge.NgControlStatusGroup,ge.FormGroupDirective,ge.FormControlName,dn.TranslatePipe],encapsulation:2})}}return t})();import*as Ir from"@ngx-translate/core";function Ll(t,o){t&1&&(U.\u0275\u0275elementContainerStart(0),U.\u0275\u0275element(1,"app-tip-employees-search-filters"),U.\u0275\u0275elementContainerEnd())}var vr=(()=>{class t extends D{constructor(e){super(),this.store=e,this.showTIPEmployeesSearchFilters$=this.store.select(h.showTIPEmployeesSearchFilters)}toggleSearchFiltersForm(){let e=this.store.selectSnapshot(h.showTIPEmployeesSearchFilters);this.store.dispatch(new nt(!e))}closeSearchFiltersForm(){this.store.dispatch(new nt(!1))}static{this.\u0275fac=function(i){return new(i||t)(U.\u0275\u0275directiveInject(_r.Store))}}static{this.\u0275cmp=U.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employees-search"]],standalone:!1,features:[U.\u0275\u0275InheritDefinitionFeature],decls:15,vars:12,consts:[[1,"employee-overview__search","mb--xxxl"],[1,"search-item-container","employee-overview__search-item","col-12","col-lg-9",3,"appClickOutside"],[1,"search-item",3,"ngClass"],[1,"search-item__button",3,"click"],[1,"center-align","center-align__row"],[1,"icon","icon-settings-lines","pb--xxs"],[1,"search-item__text"],[1,"icon",3,"ngClass"],[1,"icon","icon-cross"],[4,"ngIf"]],template:function(i,n){i&1&&(U.\u0275\u0275elementStart(0,"div",0)(1,"div",1),U.\u0275\u0275listener("appClickOutside",function(){return n.closeSearchFiltersForm()}),U.\u0275\u0275elementStart(2,"div",2),U.\u0275\u0275pipe(3,"async"),U.\u0275\u0275elementStart(4,"div",3),U.\u0275\u0275listener("click",function(){return n.toggleSearchFiltersForm()}),U.\u0275\u0275elementStart(5,"div",4),U.\u0275\u0275element(6,"i",5),U.\u0275\u0275elementStart(7,"div",6),U.\u0275\u0275text(8),U.\u0275\u0275pipe(9,"translate"),U.\u0275\u0275elementEnd()(),U.\u0275\u0275element(10,"i",7),U.\u0275\u0275pipe(11,"async"),U.\u0275\u0275element(12,"i",8),U.\u0275\u0275elementEnd(),U.\u0275\u0275template(13,Ll,2,0,"ng-container",9),U.\u0275\u0275pipe(14,"async"),U.\u0275\u0275elementEnd()()()),i&2&&(U.\u0275\u0275advance(2),U.\u0275\u0275property("ngClass",U.\u0275\u0275pipeBind1(3,4,n.showTIPEmployeesSearchFilters$)?"open":""),U.\u0275\u0275advance(6),U.\u0275\u0275textInterpolate(U.\u0275\u0275pipeBind1(9,6,"ng.tip-employees-overview.btn.refine-search")),U.\u0275\u0275advance(2),U.\u0275\u0275property("ngClass",U.\u0275\u0275pipeBind1(11,8,n.showTIPEmployeesSearchFilters$)?"icon-chevron-up":"icon-chevron-down"),U.\u0275\u0275advance(3),U.\u0275\u0275property("ngIf",U.\u0275\u0275pipeBind1(14,10,n.showTIPEmployeesSearchFilters$)))},dependencies:[_i.NgClass,_i.NgIf,ro,gr,_i.AsyncPipe,Ir.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";var mt=class t{static{this.EDIT_EMPLOYEE=new t("pencil",u.EDIT_TIP_EMPLOYEES,"ng.tip-employees-overview.lbl.edit-employee")}static{this.MIGRATE_TIP_EMPLOYEE=new t("mobile-arrow-mobile",u.MIGRATE_TIP_PLAN,"ng.tip-employees-overview.lbl.migrate-plan")}static{this.DEACTIVATE_TIP_EMPLOYEE=new t("user-discontinue",u.DEACTIVATE_TIP_EMPLOYEES,"ng.tip-employees-overview.lbl.deactivate-plan")}static{this.RESEND_INVITE=new t("paper-plane",u.RESEND_TIP_INVITE,"ng.tip-employees-overview.lbl.resend-invite")}static{this.REVOKE_MIGRATION=new t("cross",u.REVOKE_TIP_MIGRATION,"ng.tip-employees-overview.lbl.revoke-migration")}static{this.REVOKE_DEACTIVATION=new t("cross",u.REVOKE_TIP_DEACTIVATION,"ng.tip-employees-overview.lbl.revoke-deactivation")}static{this.DELETE_TIP_EMPLOYEES=new t("delete",u.DELETE_TIP_EMPLOYEES,"ng.tip-employees-overview.lbl.delete-employees")}constructor(o,e,i){this.icon=o,this.action_name=e,this.i18nLabel=i}static getAllEmployeeActions(){return Vi([...t.getActionsForInvitedEmployees(),...t.getActionsForActiveEmployees(),...t.getActionsForPendingForMigrationEmployees(),...t.getActionsForPendingForDeactivationEmployees(),...t.getActionsForSwappingEmployees()],"action_name")}static getActionsForInvitedEmployees(){return[t.RESEND_INVITE,t.DELETE_TIP_EMPLOYEES]}static getActionsForActiveEmployees(){return[t.EDIT_EMPLOYEE,t.MIGRATE_TIP_EMPLOYEE,t.DEACTIVATE_TIP_EMPLOYEE]}static getActionsForPendingForMigrationEmployees(){return[t.REVOKE_MIGRATION]}static getActionsForSwappingEmployees(){return[t.RESEND_INVITE,t.REVOKE_MIGRATION]}static getActionsForPendingForDeactivationEmployees(){return[t.REVOKE_DEACTIVATION]}};import*as T from"@angular/core";import*as hr from"@ngxs/store";import*as Ot from"@angular/common";import*as yr from"@ngx-translate/core";var Cr=t=>({open:t}),Gl=(t,o)=>({"icon-chevron-up":t,"icon-chevron-down":o});function Ul(t,o){if(t&1){let e=T.\u0275\u0275getCurrentView();T.\u0275\u0275elementStart(0,"div",10),T.\u0275\u0275listener("click",function(){T.\u0275\u0275restoreView(e);let n=T.\u0275\u0275nextContext();
3return T.\u0275\u0275resetView(n.toggleLineActions())}),T.\u0275\u0275elementStart(1,"div",11),T.\u0275\u0275text(2),T.\u0275\u0275pipe(3,"translate"),T.\u0275\u0275elementEnd(),T.\u0275\u0275element(4,"div",12),T.\u0275\u0275elementEnd()}if(t&2){let e=T.\u0275\u0275nextContext();T.\u0275\u0275property("ngClass",T.\u0275\u0275pureFunction1(5,Cr,e.showEmployeeActions)),T.\u0275\u0275advance(2),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(3,3,"ng.tip-employees-overview.lbl.line-actions")),T.\u0275\u0275advance(2),T.\u0275\u0275property("ngClass",T.\u0275\u0275pureFunction2(7,Gl,e.showEmployeeActions,!e.showEmployeeActions))}}function Vl(t,o){if(t&1){let e=T.\u0275\u0275getCurrentView();T.\u0275\u0275elementStart(0,"li",15),T.\u0275\u0275listener("click",function(){let n=T.\u0275\u0275restoreView(e).$implicit,p=T.\u0275\u0275nextContext(2);return T.\u0275\u0275resetView(p.handleActionClick(n.action_name))}),T.\u0275\u0275element(1,"wink-icon",16),T.\u0275\u0275elementStart(2,"span"),T.\u0275\u0275text(3),T.\u0275\u0275pipe(4,"translate"),T.\u0275\u0275elementEnd()()}if(t&2){let e=o.$implicit,i=T.\u0275\u0275nextContext(2);T.\u0275\u0275advance(),T.\u0275\u0275property("icon",i.getWinkIcon(e.icon)),T.\u0275\u0275advance(2),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(4,2,e.i18nLabel))}}function Bl(t,o){if(t&1&&(T.\u0275\u0275elementContainerStart(0),T.\u0275\u0275elementStart(1,"ul",13),T.\u0275\u0275template(2,Vl,5,4,"li",14),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementContainerEnd()),t&2){let e=T.\u0275\u0275nextContext();T.\u0275\u0275advance(),T.\u0275\u0275property("ngClass",T.\u0275\u0275pureFunction1(2,Cr,e.showEmployeeActions)),T.\u0275\u0275advance(),T.\u0275\u0275property("ngForOf",e.employeeActions)}}function Yl(t,o){t&1&&(T.\u0275\u0275elementStart(0,"span",17),T.\u0275\u0275text(1),T.\u0275\u0275pipe(2,"translate"),T.\u0275\u0275elementEnd()),t&2&&(T.\u0275\u0275advance(),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(2,1,"ng.tip-employees-overview.lbl.no-action-available")))}var Sr=(()=>{class t extends D{constructor(e){super(),this.store=e,this.selectedTIPEmployees=[],this.employeeActions=[],this.selectedTIPEmployees$=this.store.select(h.selectedTIPEmployees),this.showEmployeeActions=!1}ngOnInit(){this.findActionsToShowInStickyFooter()}getWinkIcon(e){return{pencil:"pencil","mobile-arrow-mobile":"mobile-arrow-mobile","user-discontinue":"user-discontinue","paper-plane":"paper-plane",cross:"cross",delete:"trash"}[e]}findActionsToShowInStickyFooter(){this.obs(this.selectedTIPEmployees$).subscribe(e=>{this.selectedTIPEmployees=e;let i=Le(Vi(this.selectedTIPEmployees,Me.NORMALIZEDSTATUS),Me.NORMALIZEDSTATUS),n=[];this.employeeActions=mt.getAllEmployeeActions(),St(i,p=>{switch(p){case Oe.INVITED:n=mt.getActionsForInvitedEmployees();break;case Oe.ACTIVE:n=mt.getActionsForActiveEmployees();break;case Oe.PENDING_FOR_MIGRATION:n=mt.getActionsForPendingForMigrationEmployees();break;case Oe.SWAPPING:n=mt.getActionsForSwappingEmployees();break;case Oe.PENDING_FOR_DEACTIVATION:n=mt.getActionsForPendingForDeactivationEmployees();break}this.employeeActions=this.findCommonActions(n)}),this.removeRedundantActions()})}removeRedundantActions(){let e=this.store.selectSnapshot(B.allTIPContracts),i=re(e,n=>n.normalizedStatus===we.ACTIVE);i&&i.length<2&&(this.employeeActions=this.employeeActions.filter(n=>n!==mt.MIGRATE_TIP_EMPLOYEE))}findCommonActions(e){return $n(this.employeeActions,e,Me.ACTION_NAME)}toggleLineActions(){this.showEmployeeActions=!this.showEmployeeActions}handleActionClick(e){e===u.EDIT_TIP_EMPLOYEES?this.updateSelectedTIPEmployeesWithActionRequired(!1):this.updateSelectedTIPEmployeesWithActionRequired(!0),this.store.dispatch(new he(e))}updateSelectedTIPEmployeesWithActionRequired(e){let i=Le(this.selectedTIPEmployees,n=>{let p=Object.assign({},n);return p.actionRequired=e,p});this.store.dispatch(new vt(i))}static{this.\u0275fac=function(i){return new(i||t)(T.\u0275\u0275directiveInject(hr.Store))}}static{this.\u0275cmp=T.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employees-sticky-footer"]],standalone:!1,features:[T.\u0275\u0275InheritDefinitionFeature],decls:21,vars:15,consts:[["noActions",""],[1,"sticky-container"],[1,"sticky-action-item"],[1,"header-mobile","hidden-desktop","align-items--center"],[1,"header-mobile__desc","pr--l"],[1,"icon","icon-sticky","icon-minus-shape","mr-15","text--l"],[1,"mr--xxs"],["class","header-mobile__actions",3,"ngClass","click",4,"ngIf"],[1,"message","align-items--center","hidden-mobile"],[4,"ngIf","ngIfElse"],[1,"header-mobile__actions",3,"click","ngClass"],[1,"text"],[1,"icon-chevron-up",3,"ngClass"],[1,"action-item-list",3,"ngClass"],["class","save-action-item",3,"click",4,"ngFor","ngForOf"],[1,"save-action-item",3,"click"],[1,"icon-sticky",3,"icon"],[1,"text--m"]],template:function(i,n){if(i&1&&(T.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),T.\u0275\u0275element(4,"i",5),T.\u0275\u0275elementStart(5,"span",6),T.\u0275\u0275text(6),T.\u0275\u0275pipe(7,"async"),T.\u0275\u0275elementEnd(),T.\u0275\u0275text(8),T.\u0275\u0275pipe(9,"translate"),T.\u0275\u0275elementEnd(),T.\u0275\u0275template(10,Ul,5,10,"div",7),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(11,"div",8),T.\u0275\u0275element(12,"i",5),T.\u0275\u0275elementStart(13,"span",6),T.\u0275\u0275text(14),T.\u0275\u0275pipe(15,"async"),T.\u0275\u0275elementEnd(),T.\u0275\u0275text(16),T.\u0275\u0275pipe(17,"translate"),T.\u0275\u0275elementEnd(),T.\u0275\u0275template(18,Bl,3,4,"ng-container",9)(19,Yl,3,3,"ng-template",null,0,T.\u0275\u0275templateRefExtractor),T.\u0275\u0275elementEnd()()),i&2){let p=T.\u0275\u0275reference(20);T.\u0275\u0275advance(6),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(7,7,n.selectedTIPEmployees$).length),T.\u0275\u0275advance(2),T.\u0275\u0275textInterpolate1("",T.\u0275\u0275pipeBind1(9,9,"ng.tip-employees-overview.lbl.line-selected")," "),T.\u0275\u0275advance(2),T.\u0275\u0275property("ngIf",n.employeeActions.length>0),T.\u0275\u0275advance(4),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(15,11,n.selectedTIPEmployees$).length),T.\u0275\u0275advance(2),T.\u0275\u0275textInterpolate1("",T.\u0275\u0275pipeBind1(17,13,"ng.tip-employees-overview.lbl.line-selected")," "),T.\u0275\u0275advance(2),T.\u0275\u0275property("ngIf",n.employeeActions.length>0)("ngIfElse",p)}},dependencies:[Ot.NgClass,Ot.NgForOf,Ot.NgIf,Bi,Ot.AsyncPipe,yr.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";var W=(()=>{class t{static{this.LANGUAGE_TYPES=[{name:"ng.manage-tip-employee.language-dutch",value:"NL"},{name:"ng.manage-tip-employee.language-french",value:"FR"},{name:"ng.manage-tip-employee.language-english",value:"EN"}]}static{this.MESSAGE_GROUP="manage-tip-employee"}static{this.MESSAGE_GROUP_CUSTOM="manage-tip-employee-custom"}static{this.STATUS_ACTIVE="active"}static{this.ACKNOWLEDGEMENT_STATUS_FAILURE="FAILURE"}static{this.SCOPES=["managetip"]}static{this.CREATION_MODE_SINGLE_EMPLOYEE="SINGLE"}static{this.CREATION_MODE_UPLOAD_EMPLOYEE="UPLOAD"}static{this.TIP_DUPLICATE_EMPLOYEE_ERROR_CODE="TIPERR_06"}static{this.TIP_EMPLOYEE_BULK_UPLOAD_TEMPLATE_PATH="/etc/designs/aff-telenetgroup/download/tip/TIP_Employees_Bulk_Upload_Template.xls"}}return t})();import"@angular/core";import"@ngxs/store";import{DOCUMENT as Tp}from"@angular/common";import"@angular/core";import"@ngxs/store";import{forkJoin as gp,of as _p,timer as Ip}from"rxjs";import{FormControl as Ii,FormGroup as Wl,Validators as Ct}from"@angular/forms";var Pr=t=>{let o=t.get("firstName").value,e=t.get("lastName").value,i=null;return o.length+e.length>119&&(i=t.get("lastName").errors||{},i.firstNameLastNameLengthsReachedMaxLimit=!0,t.get("lastName").setErrors(i)),null};var oe=(function(t){return t.EMAIL_ADDRESS="emailAddress",t.FIRST_NAME="firstName",t.LAST_NAME="lastName",t.LANGUAGE="language",t.DISPLAY_PLAN_NAME="displayPlanName",t.EMPLOYEE_REFERENCE_NUMBER="employeeReferenceNumber",t})(oe||{});var vi=class t extends Wl{constructor(o){super(o)}static build(){let o=new t({});return o.addControl(oe.EMAIL_ADDRESS,new Ii("",[Ct.required,Ct.pattern(new RegExp(dt.BASE_EMAIL)),Ct.maxLength(80)])),o.addControl(oe.FIRST_NAME,new Ii("",[Ct.required])),o.addControl(oe.LAST_NAME,new Ii("",[Ct.required])),o.addControl(oe.LANGUAGE,new Ii("",[Ct.required])),o.addControl(oe.DISPLAY_PLAN_NAME,new Ii("",[Ct.required])),o.addControl(oe.EMPLOYEE_REFERENCE_NUMBER,new Ii("",[Ct.required,Ct.maxLength(40)])),o.addValidators(Pr),o}disableField(o){this.get(o).disable({onlySelf:!0})}get emailAddress(){return this.get(oe.EMAIL_ADDRESS).value}set emailAddress(o){this.get(oe.EMAIL_ADDRESS).setValue(o)}get firstName(){return this.get(oe.FIRST_NAME).value}set firstName(o){this.get(oe.FIRST_NAME).setValue(o)}get lastName(){return this.get(oe.LAST_NAME).value}set lastName(o){this.get(oe.LAST_NAME).setValue(o)}get language(){return this.get(oe.LANGUAGE).value}set language(o){this.get(oe.LANGUAGE).setValue(o)}get displayPlanName(){return this.get(oe.DISPLAY_PLAN_NAME).value}set displayPlanName(o){this.get(oe.DISPLAY_PLAN_NAME).setValue(o)}get employeeReferenceNumber(){return this.get(oe.EMPLOYEE_REFERENCE_NUMBER).value}set employeeReferenceNumber(o){this.get(oe.EMPLOYEE_REFERENCE_NUMBER).setValue(o)}};import"@angular/core";import"@ngxs/store";import{map as Mt}from"rxjs";import*as hi from"@angular/core";import*as Nr from"@ngxs/store";var Rt=(()=>{class t{constructor(e,i,n){this.promotionService=e,this.store=i,this.tipMessagingService=n}createTIPEmployees(e){return this.promotionService.createTIPEmployees(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.employees.length)))}updateTIPEmployees(e){return this.promotionService.updateTIPEmployees(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.length)))}resendTIPInvite(e){return this.promotionService.resendTIPInvite(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.employees.length)))}deactivateTIPEmployee(e){return this.promotionService.deactivateTIPEmployees(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.employees.length)))}revokeTIPDeactivation(e){return this.promotionService.revokeTIPDeactivation(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.employees.length)))}revokeTIPMigration(e){return this.promotionService.revokeTIPMigration(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.employees.length)))}migrateTIPEmployees(e){return this.promotionService.migrateTIPEmployees(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.employees.length)))}deleteTIPEmployees(e){return this.promotionService.deleteTIPEmployees(W.MESSAGE_GROUP_CUSTOM,e).pipe(Mt(i=>this.handleResponse(i,e.employees.length)))}handleResponse(e,i){let p=Ui(ki(e),[{status:W.ACKNOWLEDGEMENT_STATUS_FAILURE}],"status").length;switch(!0){case p===i:return this.setMessage(S.SUCCESS),this.prepareManageTIPResponse(S.SUCCESS);case(p<i&&p>0):return this.setMessage(S.PARTIAL_SUCCESS),this.prepareManageTIPResponse(S.SUCCESS);case p===0:let N=this.getFailedAcksWithDuplicateEmpError(e);return this.isAddEditTIPEmployeeAction()&&N.length===i?(this.setMessage(S.DUPLICATE),this.prepareManageTIPResponse(S.SUCCESS)):this.prepareManageTIPResponse(S.FAILURE)}}getFailedAcksWithDuplicateEmpError(e){return re(e,i=>i.errorCode===W.TIP_DUPLICATE_EMPLOYEE_ERROR_CODE)}setMessage(e){let i=this.store.selectSnapshot(M.selectedTIPActionName),n=this.tipMessagingService.getMessage(i,e);this.store.dispatch(new me(n))}isAddEditTIPEmployeeAction(){let e=this.store.selectSnapshot(M.selectedTIPActionName);
3return e===u.ADD_SINGLE_TIP_EMPLOYEE||e===u.ADD_MULTIPLE_TIP_EMPLOYEES||e===u.EDIT_TIP_EMPLOYEES}prepareManageTIPResponse(e){return{serviceOutcome:e}}static{this.\u0275fac=function(i){return new(i||t)(hi.\u0275\u0275inject(pe),hi.\u0275\u0275inject(Nr.Store),hi.\u0275\u0275inject(Ce))}}static{this.\u0275prov=hi.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();import"@telenet/ng-lib-datalayer";import*as q from"@angular/core";import*as wr from"@ngxs/store";import*as Or from"@telenet/ng-lib-datalayer";import{EventEmitter as zl}from"@angular/core";import*as r from"@angular/core";import*as Ne from"@angular/forms";import{forwardRef as ql}from"@angular/core";import{NG_VALUE_ACCESSOR as Hl}from"@angular/forms";import*as ct from"@angular/core";var Ar=(()=>{class t{constructor(e){this.el=e,this.onChange=i=>{},this.onTouched=()=>{}}handleChange(e){let i=e?.detail?.value??e?.target?.value;this.onChange(i)}handleBlur(){this.onTouched()}writeValue(e){let i=this.el.nativeElement;i&&setTimeout(()=>{let n=i.querySelectorAll("option");for(let p of n)p.selected=p.value===e})}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}static{this.\u0275fac=function(i){return new(i||t)(ct.\u0275\u0275directiveInject(ct.ElementRef))}}static{this.\u0275dir=ct.\u0275\u0275defineDirective({type:t,selectors:[["wink-select","formControlName",""],["wink-select","formControl",""],["wink-select","ngModel",""]],hostBindings:function(i,n){i&1&&ct.\u0275\u0275listener("change",function(N){return n.handleChange(N)})("blur",function(){return n.handleBlur()})},features:[ct.\u0275\u0275ProvidersFeature([{provide:Hl,useExisting:ql(()=>t),multi:!0}])]})}}return t})();import*as xr from"@ngx-translate/core";var $l=(t,o)=>o.value;function Xl(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.lbl.email.requried")," "))}function Zl(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.lbl.email.error-maxlength")," "))}function Jl(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.lbl.email.error-pattern")," "))}function Ql(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"div",9)(1,"wink-validation-message"),r.\u0275\u0275conditionalCreate(2,Xl,3,3,"span",19),r.\u0275\u0275conditionalCreate(3,Zl,3,3,"span",19),r.\u0275\u0275conditionalCreate(4,Jl,3,3,"span",19),r.\u0275\u0275elementEnd()()),t&2){let e=r.\u0275\u0275nextContext();r.\u0275\u0275advance(2),r.\u0275\u0275conditional(e.form.controls.emailAddress.errors!=null&&e.form.controls.emailAddress.errors.required&&!e.form.controls.emailAddress.value?2:-1),r.\u0275\u0275advance(),r.\u0275\u0275conditional(e.form.controls.emailAddress.errors!=null&&e.form.controls.emailAddress.errors.maxlength?3:-1),r.\u0275\u0275advance(),r.\u0275\u0275conditional(e.form.controls.emailAddress.errors.pattern&&!e.form.controls.emailAddress.errors.required?4:-1)}}function ep(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.firstname-required.error")," "))}function tp(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.firstname-pattern.error")," "))}function ip(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"div",9)(1,"wink-validation-message"),r.\u0275\u0275conditionalCreate(2,ep,3,3,"span",19),r.\u0275\u0275conditionalCreate(3,tp,3,3,"span",19),r.\u0275\u0275elementEnd()()),t&2){let e=r.\u0275\u0275nextContext();r.\u0275\u0275advance(2),r.\u0275\u0275conditional(e.form.controls.firstName.errors!=null&&e.form.controls.firstName.errors.required?2:-1),r.\u0275\u0275advance(),r.\u0275\u0275conditional(e.form.controls.firstName.errors!=null&&e.form.controls.firstName.errors.pattern&&!e.form.controls.firstName.errors.required?3:-1)}}function np(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.lastname-required.error")," "))}function op(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.lastname-pattern.error")," "))}function rp(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span"),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.lastname-first-last-name-length.error")," "))}function ap(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"div",9)(1,"wink-validation-message"),r.\u0275\u0275conditionalCreate(2,np,3,3,"span",19),r.\u0275\u0275conditionalCreate(3,op,3,3,"span",19),r.\u0275\u0275conditionalCreate(4,rp,3,3,"span"),r.\u0275\u0275elementEnd()()),t&2){let e=r.\u0275\u0275nextContext();r.\u0275\u0275advance(2),r.\u0275\u0275conditional(e.form.controls.lastName.errors!=null&&e.form.controls.lastName.errors.required?2:-1),r.\u0275\u0275advance(),r.\u0275\u0275conditional(e.form.controls.lastName.errors!=null&&e.form.controls.lastName.errors.pattern&&!e.form.controls.lastName.errors.required?3:-1),r.\u0275\u0275advance(),r.\u0275\u0275conditional(e.form.controls.lastName.hasError("firstNameLastNameLengthsReachedMaxLimit")&&!e.form.controls.lastName.errors.required?4:-1)}}function sp(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"option",16),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2){let e=o.$implicit;r.\u0275\u0275property("value",e.value),r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,2,e.name)," ")}}function lp(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.language-required.error")," "))}function pp(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"div",9)(1,"wink-validation-message"),r.\u0275\u0275conditionalCreate(2,lp,3,3,"span",19),r.\u0275\u0275elementEnd()()),t&2){let e=r.\u0275\u0275nextContext();r.\u0275\u0275advance(2),r.\u0275\u0275conditional(e.form.controls.language.errors!=null&&e.form.controls.language.errors.required?2:-1)}}function mp(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"option",16),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2){let e=o.$implicit;r.\u0275\u0275property("value",e),r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,2,e)," ")}}function cp(t,o){t&1&&(r.\u0275\u0275elementStart(0,"span",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.tariff-plan-required.error")," "))}function dp(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"div",9)(1,"wink-validation-message"),r.\u0275\u0275conditionalCreate(2,cp,3,3,"span",19),r.\u0275\u0275elementEnd()()),t&2){let e=r.\u0275\u0275nextContext();r.\u0275\u0275advance(2),r.\u0275\u0275conditional(e.form.controls.displayPlanName.errors!=null&&e.form.controls.displayPlanName.errors.required?2:-1)}}function up(t,o){t&1&&(r.\u0275\u0275elementStart(0,"div",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.customer-reference-required.error")," "))}function Ep(t,o){t&1&&(r.\u0275\u0275elementStart(0,"div",19),r.\u0275\u0275text(1),r.\u0275\u0275pipe(2,"translate"),r.\u0275\u0275elementEnd()),t&2&&(r.\u0275\u0275advance(),r.\u0275\u0275textInterpolate1(" ",r.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.customer-reference-maxLength.error")," "))}function fp(t,o){if(t&1&&(r.\u0275\u0275elementStart(0,"div",9)(1,"wink-validation-message"),r.\u0275\u0275conditionalCreate(2,up,3,3,"div",19),r.\u0275\u0275conditionalCreate(3,Ep,3,3,"div",19),r.\u0275\u0275elementEnd()()),t&2){let e=r.\u0275\u0275nextContext();r.\u0275\u0275advance(2),r.\u0275\u0275conditional(e.form.controls.employeeReferenceNumber.errors.required?2:-1),r.\u0275\u0275advance(),r.\u0275\u0275conditional(e.form.controls.employeeReferenceNumber.errors.maxlength?3:-1)}}var En=(()=>{class t{constructor(){this.isEditMode=!1,this.tariffPlans=[],this.languageTypes=W.LANGUAGE_TYPES,this.messageGroupName=W.MESSAGE_GROUP,this.blurred=new zl}hasErrors(e){let i=this.form.get(e);return!!i&&(i.dirty||i.touched)&&(i.hasError("required")||i.hasError("maxlength")||i.hasError("pattern")||i.hasError("firstNameLastNameLengthsReachedMaxLimit"))}onblur(){this.blurred.emit()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=r.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employee-form"]],inputs:{form:"form",isEditMode:"isEditMode",tariffPlans:"tariffPlans",languageTypes:"languageTypes",messageGroupName:"messageGroupName"},outputs:{blurred:"blurred"}
3,standalone:!1,decls:58,vars:67,consts:[[1,"tip-employee-form"],[3,"formGroup"],[1,"display--flex","justify-content--center"],[1,"col-12"],[1,"form-builder","form-group","pl--xl","mt--xl--sm"],[1,"row","row--no-gutters","align-items--center"],[1,"form__input-container","col-12"],["formControlName","emailAddress","id","emailAddress","maxlength","80","type","text",1,"sc-wink-input-h","sc-wink-input-s",3,"blur","isInvalid","isRequired","isDisabled","placeholder"],["slot","label",3,"label"],[1,"formErrorInput","mb-5"],[1,"form-builder","form-group","pl--xl","mt--xl"],["formControlName","firstName","id","first-name","type","text",1,"sc-wink-input-h","sc-wink-input-s",3,"keyup","isInvalid","isRequired","placeholder"],["show-optional","false","slot","label",3,"label"],["formControlName","lastName","id","last-name","type","text",1,"sc-wink-input-h","sc-wink-input-s",3,"keyup","isInvalid","isRequired","placeholder"],[1,"form-group"],["formControlName","language",1,"sc-wink-input-h","sc-wink-input-s",3,"blur","change","isInvalid","isRequired","placeholder"],[3,"value"],["formControlName","displayPlanName",1,"sc-wink-input-h","sc-wink-input-s",3,"blur","isInvalid","isRequired","isDisabled","placeholder"],["formControlName","employeeReferenceNumber","id","customer-reference","max-length","40","type","text",1,"sc-wink-input-h","sc-wink-input-s",3,"blur","keyup","isInvalid","isRequired","placeholder"],[1,"form__msg--error","form__input__invalid-message"]],template:function(i,n){i&1&&(r.\u0275\u0275elementStart(0,"div",0)(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"wink-input",7),r.\u0275\u0275pipe(8,"translate"),r.\u0275\u0275listener("blur",function(){return n.onblur()}),r.\u0275\u0275element(9,"wink-form-label",8),r.\u0275\u0275pipe(10,"translate"),r.\u0275\u0275elementEnd()(),r.\u0275\u0275conditionalCreate(11,Ql,5,3,"div",9),r.\u0275\u0275elementEnd()(),r.\u0275\u0275elementStart(12,"div",10)(13,"div",5)(14,"div",6)(15,"wink-input",11),r.\u0275\u0275pipe(16,"translate"),r.\u0275\u0275listener("keyup",function(){return n.onblur()}),r.\u0275\u0275element(17,"wink-form-label",12),r.\u0275\u0275pipe(18,"translate"),r.\u0275\u0275elementEnd()(),r.\u0275\u0275conditionalCreate(19,ip,4,2,"div",9),r.\u0275\u0275elementEnd()(),r.\u0275\u0275elementStart(20,"div",10)(21,"div",5)(22,"div",6)(23,"wink-input",13),r.\u0275\u0275pipe(24,"translate"),r.\u0275\u0275listener("keyup",function(){return n.onblur()}),r.\u0275\u0275element(25,"wink-form-label",12),r.\u0275\u0275pipe(26,"translate"),r.\u0275\u0275elementEnd()(),r.\u0275\u0275conditionalCreate(27,ap,5,3,"div",9),r.\u0275\u0275elementEnd()(),r.\u0275\u0275elementStart(28,"div",10)(29,"div",14)(30,"div",5)(31,"div",6)(32,"wink-select",15),r.\u0275\u0275pipe(33,"translate"),r.\u0275\u0275listener("blur",function(){return n.onblur()})("change",function(){return n.onblur()}),r.\u0275\u0275repeaterCreate(34,sp,3,4,"option",16,$l),r.\u0275\u0275element(36,"wink-form-label",12),r.\u0275\u0275pipe(37,"translate"),r.\u0275\u0275elementEnd()(),r.\u0275\u0275conditionalCreate(38,pp,3,1,"div",9),r.\u0275\u0275elementEnd()()(),r.\u0275\u0275elementStart(39,"div",10)(40,"div",14)(41,"div",5)(42,"div",6)(43,"wink-select",17),r.\u0275\u0275pipe(44,"translate"),r.\u0275\u0275listener("blur",function(){return n.onblur()}),r.\u0275\u0275repeaterCreate(45,mp,3,4,"option",16,r.\u0275\u0275repeaterTrackByIdentity),r.\u0275\u0275element(47,"wink-form-label",12),r.\u0275\u0275pipe(48,"translate"),r.\u0275\u0275elementEnd()(),r.\u0275\u0275conditionalCreate(49,dp,3,1,"div",9),r.\u0275\u0275elementEnd()()(),r.\u0275\u0275elementStart(50,"div",10)(51,"div",5)(52,"div",6)(53,"wink-input",18),r.\u0275\u0275pipe(54,"translate"),r.\u0275\u0275listener("blur",function(){return n.onblur()})("keyup",function(){return n.onblur()}),r.\u0275\u0275element(55,"wink-form-label",8),r.\u0275\u0275pipe(56,"translate"),r.\u0275\u0275elementEnd()(),r.\u0275\u0275conditionalCreate(57,fp,4,2,"div",9),r.\u0275\u0275elementEnd()()()()()()),i&2&&(r.\u0275\u0275advance(),r.\u0275\u0275property("formGroup",n.form),r.\u0275\u0275advance(6),r.\u0275\u0275property("placeholder",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(8,43,"ng.manage-tip-employee.phd.email")))("isInvalid",n.hasErrors("emailAddress"))("isRequired",!0)("isDisabled",n.isEditMode),r.\u0275\u0275advance(2),r.\u0275\u0275property("label",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(10,45,"ng.manage-tip-employee.lbl.email"))),r.\u0275\u0275advance(2),r.\u0275\u0275conditional(n.hasErrors("emailAddress")?11:-1),r.\u0275\u0275advance(4),r.\u0275\u0275property("placeholder",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(16,47,"ng.manage-tip-employee.phd.first-name")))("isInvalid",n.hasErrors("firstName"))("isRequired",!0),r.\u0275\u0275advance(2),r.\u0275\u0275property("label",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(18,49,"ng.manage-tip-employee.first-name"))),r.\u0275\u0275advance(2),r.\u0275\u0275conditional(n.hasErrors("firstName")?19:-1),r.\u0275\u0275advance(4),r.\u0275\u0275property("placeholder",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(24,51,"ng.manage-tip-employee.phd.last-name")))("isInvalid",n.hasErrors("lastName"))("isRequired",!0),r.\u0275\u0275advance(2),r.\u0275\u0275property("label",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(26,53,"ng.manage-tip-employee.last-name"))),r.\u0275\u0275advance(2),r.\u0275\u0275conditional(n.hasErrors("lastName")?27:-1),r.\u0275\u0275advance(5),r.\u0275\u0275property("isInvalid",n.hasErrors("language"))("isRequired",!0)("placeholder",n.isEditMode?"":r.\u0275\u0275pipeBind1(33,55,"ng.manage-tip-employee.select-language-value")),r.\u0275\u0275advance(2),r.\u0275\u0275repeater(n.languageTypes),r.\u0275\u0275advance(2),r.\u0275\u0275property("label",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(37,5
37,"ng.manage-tip-employee.language"))),r.\u0275\u0275advance(2),r.\u0275\u0275conditional(n.hasErrors("language")?38:-1),r.\u0275\u0275advance(5),r.\u0275\u0275property("isInvalid",n.hasErrors("displayPlanName"))("isRequired",!0)("isDisabled",n.isEditMode)("placeholder",n.isEditMode?"":r.\u0275\u0275pipeBind1(44,59,"ng.manage-tip-employee.select-value")),r.\u0275\u0275advance(2),r.\u0275\u0275repeater(n.tariffPlans),r.\u0275\u0275advance(2),r.\u0275\u0275property("label",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(48,61,"ng.manage-tip-employee.tariff-plan"))),r.\u0275\u0275advance(2),r.\u0275\u0275conditional(n.hasErrors("displayPlanName")?49:-1),r.\u0275\u0275advance(4),r.\u0275\u0275property("placeholder",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(54,63,"ng.manage-tip-employee.phd.customer-reference")))("isInvalid",n.hasErrors("employeeReferenceNumber"))("isRequired",!0),r.\u0275\u0275advance(2),r.\u0275\u0275property("label",r.\u0275\u0275interpolate(r.\u0275\u0275pipeBind1(56,65,"ng.manage-tip-employee.customer-reference"))),r.\u0275\u0275advance(2),r.\u0275\u0275conditional(n.hasErrors("employeeReferenceNumber")?57:-1))},dependencies:[Ne.\u0275NgNoValidate,Ne.NgSelectOption,Ne.\u0275NgSelectMultipleOption,Ne.NgControlStatus,Ne.NgControlStatusGroup,Ne.MaxLengthValidator,Ne.FormGroupDirective,Ne.FormControlName,Lt,ti,ri,Ar,ni,Yi,xr.TranslatePipe],styles:[".formErrorInput[_ngcontent-%COMP%]{margin-top:-.9rem!important;margin-bottom:0!important;padding:0!important}.tip-employee-form[_ngcontent-%COMP%]   .form-builder.form-group[_ngcontent-%COMP%]{margin-bottom:2.5rem!important;padding-bottom:0!important}.tip-employee-form[_ngcontent-%COMP%]   .mt--xl[_ngcontent-%COMP%], .tip-employee-form[_ngcontent-%COMP%]   .mt--xl--sm[_ngcontent-%COMP%]{margin-top:0!important}"]})}}return t})();import*as Mr from"@ngx-translate/core";var Rr=(()=>{class t{constructor(e,i,n,p,N,Y,ne,Li){this.document=e,this.promotionService=i,this.messageService=n,this.store=p,this.domService=N,this.manageTIPEmployeesService=Y,this.tipDataLayerService=ne,this.dataLayerService=Li,this.tariffPlans=[],this.messageGroupName=W.MESSAGE_GROUP}ngOnInit(){this.addEmployeeForm=vi.build(),this.loadTIPContracts()}onCancelClick(){this.document.dispatchEvent(new CustomEvent("overlay:close",{bubbles:!0}))}onSubmit(){this.addEmployeeForm.valid?this.createTIPEmployee():this.addEmployeeForm.markAllAsTouched()}loadTIPContracts(){let e=this.store.selectSnapshot(B.allTIPContracts);z(e)?this.store.dispatch(new Et(this.messageGroupName)).subscribe(()=>{this.tipContracts=this.getActiveTIPContracts(),z(this.tipContracts)&&this.messageService.addMessage(new ce(this.messageGroupName,"manage-tip-employee.lbl.no-active-tip-plans")),this.tariffPlans=Le(this.tipContracts,"displayPlanName")}):(this.tipContracts=this.getActiveTIPContracts(),this.tariffPlans=Le(this.tipContracts,"displayPlanName"))}getActiveTIPContracts(){let e=this.store.selectSnapshot(B.allTIPContracts);return re(e,i=>i.normalizedStatus===we.ACTIVE)}createTIPEmployee(){this.messageService.clearMessages(W.MESSAGE_GROUP_CUSTOM),this.checkLoginEligibility().subscribe(()=>{let e=this.createAddEmployeePayload(),i=this.manageTIPEmployeesService.createTIPEmployees(e);this.handleServiceResponse(i)})}checkLoginEligibility(){let e=this.store.selectSnapshot(h.allTIPEmployees);return e&&e.length>0?_p({status:200}):this.promotionService.loginEligibility(W.MESSAGE_GROUP)}createAddEmployeePayload(){let e=this.tipContracts.find(N=>N.displayPlanName===this.addEmployeeForm.displayPlanName),i=e.customerProductId,n=e.planName,p=[{employeeReferenceNumber:this.addEmployeeForm.employeeReferenceNumber,emailAddress:this.addEmployeeForm.emailAddress,firstName:this.addEmployeeForm.firstName,lastName:this.addEmployeeForm.lastName,language:this.addEmployeeForm.language}];return{tipPlan:n,customerProductId:i,employees:p}}handleServiceResponse(e){e.subscribe({next:i=>{if(i.serviceOutcome===S.SUCCESS){let n={};n.itemName="1",this.tipDataLayerService.fireAnalyticsFlowEndEvent(n).then(()=>{this.goToNextStep()})}else this.messageService.addMessage(new ce(W.MESSAGE_GROUP_CUSTOM,ue.OCAPI_E
3RROR_500)),this.scrollToTop()},error:()=>{this.scrollToTop()}})}goToNextStep(){Ip(100).subscribe(()=>{let e=this.dataLayerService.getAnalyticsPromises();gp(e).subscribe(()=>{this.store.dispatch(new Ee)})})}scrollToTop(){this.domService.scrollToTop()}static{this.\u0275fac=function(i){return new(i||t)(q.\u0275\u0275directiveInject(Tp),q.\u0275\u0275directiveInject(pe),q.\u0275\u0275directiveInject(le),q.\u0275\u0275directiveInject(wr.Store),q.\u0275\u0275directiveInject(Ye),q.\u0275\u0275directiveInject(Rt),q.\u0275\u0275directiveInject(De),q.\u0275\u0275directiveInject(Or.DataLayerService))}}static{this.\u0275cmp=q.\u0275\u0275defineComponent({type:t,selectors:[["app-add-tip-employee"]],standalone:!1,decls:12,vars:10,consts:[[1,"col-lg-6","m--auto"],[3,"form","isEditMode","messageGroupName","tariffPlans"],[1,"col-12","col-md-9","col-lg-5","m--auto"],[1,"row","row--no-gutters"],[1,"col-12"],[1,"overlay__section__content__action","display--flex","justify-content--center","gap--sm"],["appearance","secondary","element","button","pointer-event","auto","size","sm","status","none","theme","light","type","button",1,"white-space--nowrap",3,"click"],["appearance","primary","element","button","pointer-event","auto","size","sm","status","none","theme","light","type","button",1,"white-space--nowrap",3,"click"]],template:function(i,n){i&1&&(q.\u0275\u0275elementStart(0,"div",0),q.\u0275\u0275element(1,"app-tip-employee-form",1),q.\u0275\u0275elementStart(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"wink-button",6),q.\u0275\u0275listener("click",function(){return n.onCancelClick()}),q.\u0275\u0275text(7),q.\u0275\u0275pipe(8,"translate"),q.\u0275\u0275elementEnd(),q.\u0275\u0275elementStart(9,"wink-button",7),q.\u0275\u0275listener("click",function(){return n.onSubmit()}),q.\u0275\u0275text(10),q.\u0275\u0275pipe(11,"translate"),q.\u0275\u0275elementEnd()()()()()()),i&2&&(q.\u0275\u0275advance(),q.\u0275\u0275property("form",n.addEmployeeForm)("isEditMode",!1)("messageGroupName",n.messageGroupName)("tariffPlans",n.tariffPlans),q.\u0275\u0275advance(6),q.\u0275\u0275textInterpolate1(" ",q.\u0275\u0275pipeBind1(8,6,"ng.manage-tip-employee.cancel-creation")," "),q.\u0275\u0275advance(3),q.\u0275\u0275textInterpolate1(" ",q.\u0275\u0275pipeBind1(11,8,"ng.manage-tip-employee.create-user")," "))},dependencies:[Be,En,Mr.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import{FormControl as yp,FormGroup as Cp,Validators as Sp}from"@angular/forms";import{DOCUMENT as Pp}from"@angular/common";import"@ngxs/store";import"@angular/core";import{Subject as vp}from"rxjs";import*as Dr from"@angular/core";var Fr=(()=>{class t extends D{constructor(){super()}handle(e){let i=new vp,n=new FileReader;return n.onload=()=>{let p=this.getTIPEmployeesDetailsFromCSVFile(n.result);z(p)?i.error("INVALID_FILE"):i.next(p),i.complete()},n.readAsText(e,"ISO-8859-1"),i}getTIPEmployeesDetailsFromCSVFile(e){let i=[],p=(String(e)||"").replace(/^\uFEFF/,"").split(/\r\n|\n/);for(let N of p){let Y=this.parseCSVLine(N);if(!Y||this.isTemplateHeaderRow(Y))continue;let ne=this.createEmployeeFromCols(Y);ne&&i.push(ne)}return i}parseCSVLine(e){let i=(e||"").trim();return i?i.replaceAll('"',"").split(";").map(n=>(n??"").trim()):null}createEmployeeFromCols(e){if(e.length>=5&&e[0]&&e[1]&&e[2]&&e[3]&&e[4]){let i=new We;return i.firstName=e[0],i.lastName=e[1],i.employeeReferenceNumber=e[2],i.emailAddress=e[3],i.language=e[4],i}return null}isTemplateHeaderRow(e){if(!e||e.length<5)return!1;let i=Li=>(Li||"").toLowerCase().replaceAll(/\s+/g," ").trim(),n=i(e[0]),p=i(e[1]),N=i(e[2]),Y=i(e[3]),ne=i(e[4]);return n==="first name"&&p==="last name"&&N.startsWith("employee reference")&&Y.startsWith("e-mail address")&&ne==="language"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Dr.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();import*as m from"@angular/core";import*as Lr from"@ngxs/store";import*as fn from"@angular/common";import*as _e from"@angular/forms";import*as kr from"@ngx-translate/core";function Np(t,o){if(t&1&&(m.\u0275\u0275elementStart(0,"option",34),m.\u0275\u0275text(1),m.\u0275\u0275pipe(2,"translate"),m.\u0275\u0275elementEnd()),t&2){let e=o.$implicit;m.\u0275\u0275property("value",m.\u0275\u0275interpolate(e)),m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(2,3,e)," ")}}function Ap(t,o){t&1&&(m.\u0275\u0275elementStart(0,"div",37),m.\u0275\u0275text(1),m.\u0275\u0275pipe(2,"translate"),m.\u0275\u0275elementEnd()),t&2&&(m.\u0275\u0275advance(),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.tariff-plan-required.error")," "))}function xp(t,o){if(t&1&&(m.\u0275\u0275elementStart(0,"div",35),m.\u0275\u0275template(1,Ap,3,3,"div",36),m.\u0275\u0275elementEnd()),t&2){let e=m.\u0275\u0275nextContext();m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",e.uploadTIPEmployeesForm.controls.tariffPlan.errors.required)}}function bp(t,o){t&1&&(m.\u0275\u0275elementStart(0,"div",35)(1,"div",37),m.\u0275\u0275text(2),m.\u0275\u0275pipe(3,"translate"),m.\u0275\u0275elementEnd()()),t&2&&(m.\u0275\u0275advance(2),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(3,1,"ng.manage-tip-employee.csv-file-required.error")," "))}function wp(t,o){t&1&&(m.\u0275\u0275elementStart(0,"div",35)(1,"div",37),m.\u0275\u0275text(2),m.\u0275\u0275pipe(3,"translate"),m.\u0275\u0275elementEnd()()),t&2&&(m.\u0275\u0275advance(2),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(3,1,"ng.manage-tip-employee.lbl.invali
3d-data")," "))}var Gr=(()=>{class t extends D{constructor(e,i,n,p,N){super(),this.document=e,this.csvFileHandler=i,this.urlService=n,this.store=p,this.messageService=N,this.uploadTIPEmployeesForm=new Cp({}),this.messageGroupName=W.MESSAGE_GROUP,this.tariffPlans=[],this.config={fileExtensions:["csv"],multiple:!1},this.showFileUploadError=!1,this.showInvalidDataError=!1}ngOnInit(){this.initTIPContracts(),this.initForm()}initTIPContracts(){let e=this.store.selectSnapshot(B.allTIPContracts),i=re(e,n=>n.normalizedStatus===we.ACTIVE);this.tariffPlans=Le(i,"displayPlanName"),z(i)&&this.messageService.addMessage(new ce(this.messageGroupName,"manage-tip-employee.lbl.no-active-tip-plans"))}initForm(){this.uploadTIPEmployeesForm.addControl("tariffPlan",new yp("",[Sp.required]))}onCancel(){this.document.dispatchEvent(new CustomEvent("overlay:close",{bubbles:!0}))}onDestroy(){this.uploadTIPEmployeesForm.removeControl("tariffPlan")}onDownloadTemplate(){this.urlService.openNewTab(W.TIP_EMPLOYEE_BULK_UPLOAD_TEMPLATE_PATH)}onFileUpload(e){this.clearErrors(),this.uploadedFile=e[0]}goToNextStep(){this.store.dispatch(new Ee)}setTariffPlanAndEnrichTIPEmployees(e){let i=this.uploadTIPEmployeesForm.get("tariffPlan").value,n=this.store.selectSnapshot(B.allTIPContracts),p=Kn(n,N=>N.displayPlanName===i);this.store.dispatch(new ot(p)),e.forEach(N=>{N.displayPlanName=i,N.actionRequired=!0})}setUploadedTIPEmployees(e){this.store.dispatch(new vt(e))}validateAndGoToNextStep(){this.clearErrors(),!this.uploadTIPEmployeesForm.invalid&&this.uploadedFile?this.csvFileHandler.handle(this.uploadedFile).subscribe({next:e=>{this.setTariffPlanAndEnrichTIPEmployees(e),this.setIsValidDataAndEnrichTIPEmployees(e),this.setUploadedTIPEmployees(e),this.goToNextStep()},error:e=>{this.showInvalidDataError=!0}}):(this.showFileUploadError=!this.uploadedFile,this.uploadTIPEmployeesForm.markAllAsTouched())}setIsValidDataAndEnrichTIPEmployees(e){St(e,i=>{i.isValidData=i.setIsValidData()})}clearErrors(){this.showFileUploadError=!1,this.showInvalidDataError=!1}static{this.\u0275fac=function(i){return new(i||t)(m.\u0275\u0275directiveInject(Pp),m.\u0275\u0275directiveInject(Fr),m.\u0275\u0275directiveInject(Ve),m.\u0275\u0275directiveInject(Lr.Store),m.\u0275\u0275directiveInject(le))}}static{this.\u0275cmp=m.\u0275\u0275defineComponent({type:t,selectors:[["app-upload-tip-employees"]],standalone:!1,features:[m.\u0275\u0275InheritDefinitionFeature],decls:68,vars:43,consts:[["tariffPlan",""],["appDropZone","",3,"ngSubmit","formGroup","isOuter"],[1,"row","pr--xl","pr--xxl--sm","pr--n--md"],[1,"col-12","col-md-8","col-lg-6","m--auto"],[1,"text--xm","text-weight--g","text-align--center","mt--xxl"],[1,"vertical-step-tracker"],[1,"tracker"],[1,"tracker--step","tracker--step--active","ready-0"],[1,"add-employee--step-options"],[1,"text--xm","text-weight--g","pt--xl","pb--m","tracker--step__content"],[1,"tracker--step__content"],[1,"display--flex","align-items--center","mt--xxs","tracker--step__content",3,"click"],[1,"icon","icon-md","icon-cloud-download","mr--xs"],["href","#","appClickPreventDefault","",1,"link","link--no-underline","secondary","text--xm","text-weight--g"],[1,"tracker--step","tracker--step--active","ready-1"],[1,"tracker--step","tracker--step--active","ready-2"],[1,"text--xm","text-weight--g","pt--xl","pb--xxxs","tracker--step__content"],[1,"form-builder","text-uppercase","mt--xxs","tracker--step__content"],["for","tariffPlan",1,"mt--s"],[1,"select-dropdown-section"],["id","tariffPlan","name","tariffPlan","required","required","formControlName","tariffPlan",1,"form-control","select-dropdown"],["value","","selected","",1,"placeholder-option"],["class","placeholder-option",3,"value",4,"ngFor","ngForOf"],[1,"icon","icon-chevron-down","position--absolute","text--m","text-weight--g"],["class","formErrorInput text-align--left tracker--step__content",4,"ngIf"],[1,"tracker--step","tracker--step--active","ready-3"],[1,"form-builder","mt--0","tracker--step__content"],[3,"fileUploaded","config"],[1,"col-12","col-md-7","col-lg-5","m--auto"],[1,"row","row--no-gutters"],[1,"col-12","ml--l--md"],[1,"overlay__section__content__action","justify-content--center"],[1,"button","button--secondary",3,"click"],["type","submit",1,"button","button--primary"],[1,"placeholder-option",3,"value"],[1,"formErrorInput","text-align--left","tracker--step__content"],["class","color-red",4,"ngIf"],[1,"color-red"]],template:function(i,n){if(i&1){let p=m.\u0275\u0275getCurrentView();m.\u0275\u0275elementStart(0,"form",1),m.\u0275\u0275listener("ngSubmit",function(){return m.\u0275\u0275restoreView(p),m.\u0275\u0275resetVie
3w(n.validateAndGoToNextStep())}),m.\u0275\u0275elementStart(1,"div",2)(2,"div",3)(3,"div",4),m.\u0275\u0275text(4),m.\u0275\u0275pipe(5,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(6,"div",5)(7,"ul",6)(8,"li",7)(9,"div",8)(10,"div",9),m.\u0275\u0275text(11),m.\u0275\u0275pipe(12,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(13,"p",10),m.\u0275\u0275text(14),m.\u0275\u0275pipe(15,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(16,"div",11),m.\u0275\u0275listener("click",function(){return m.\u0275\u0275restoreView(p),m.\u0275\u0275resetView(n.onDownloadTemplate())}),m.\u0275\u0275element(17,"i",12),m.\u0275\u0275elementStart(18,"a",13),m.\u0275\u0275text(19),m.\u0275\u0275pipe(20,"translate"),m.\u0275\u0275elementEnd()()()(),m.\u0275\u0275elementStart(21,"li",14)(22,"div",8)(23,"div",9),m.\u0275\u0275text(24),m.\u0275\u0275pipe(25,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(26,"p",10),m.\u0275\u0275text(27),m.\u0275\u0275pipe(28,"translate"),m.\u0275\u0275elementEnd()()(),m.\u0275\u0275elementStart(29,"li",15)(30,"div",8)(31,"div",16),m.\u0275\u0275text(32),m.\u0275\u0275pipe(33,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(34,"div",17)(35,"label",18),m.\u0275\u0275text(36),m.\u0275\u0275pipe(37,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(38,"div",19)(39,"select",20,0)(41,"option",21),m.\u0275\u0275text(42),m.\u0275\u0275pipe(43,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275template(44,Np,3,5,"option",22),m.\u0275\u0275elementEnd(),m.\u0275\u0275element(45,"div",23),m.\u0275\u0275elementEnd(),m.\u0275\u0275template(46,xp,2,1,"div",24),m.\u0275\u0275elementEnd()()(),m.\u0275\u0275elementStart(47,"li",25)(48,"div",8)(49,"div",9),m.\u0275\u0275text(50),m.\u0275\u0275pipe(51,"translate"),m.\u0275\u0275elementEnd(),m.\u0275\u0275elementStart(52,"div",26)(53,"app-file-upload",27),m.\u0275\u0275listener("fileUploaded",function(Y){return m.\u0275\u0275restoreView(p),m.\u0275\u0275resetView(n.onFileUpload(Y))}),m.\u0275\u0275elementEnd()(),m.\u0275\u0275template(54,bp,4,3,"div",24)(55,wp,4,3,"div",24),m.\u0275\u0275elementEnd()()()()()(),m.\u0275\u0275elementStart(56,"div",28)(57,"div",29)(58,"div",30)(59,"div",31)(60,"button",32),m.\u0275\u0275listener("click",function(){return m.\u0275\u0275restoreView(p),m.\u0275\u0275resetView(n.onCancel())}),m.\u0275\u0275elementStart(61,"span"),m.\u0275\u0275text(62),m.\u0275\u0275pipe(63,"translate"),m.\u0275\u0275elementEnd()(),m.\u0275\u0275elementStart(64,"button",33)(65,"span"),m.\u0275\u0275text(66),m.\u0275\u0275pipe(67,"translate"),m.\u0275\u0275elementEnd()()()()()()()}i&2&&(m.\u0275\u0275property("formGroup",n.uploadTIPEmployeesForm)("isOuter",!0),m.\u0275\u0275advance(4),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(5,19,"ng.manage-tip-employee.lbl.upload-tip-employees-heading")," "),m.\u0275\u0275advance(7),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(12,21,"ng.manage-tip-employee.lbl.download-spreadsheet-title")," "),m.\u0275\u0275advance(3),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(15,23,"ng.manage-tip-employee.lbl.download-spreadsheet-description")," "),m.\u0275\u0275advance(5),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(20,25,"ng.manage-tip-employee.lbl.download-spreadsheet")," "),m.\u0275\u0275advance(5),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(25,27,"ng.manage-tip-employee.lbl.add-employees-to-excel-title")," "),m.\u0275\u0275advance(3),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(28,29,"ng.manage-tip-employee.lbl.add-employees-to-excel-description")," "),m.\u0275\u0275advance(5),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(33,31,"ng.manage-tip-employee.lbl.select-tariff-plan")," "),m.\u0275\u0275advance(4),m.\u0275\u0275textInterpolate(m.\u0275\u0275pipeBind1(37,33,"ng.manage-tip-employee.tariff-plan")),m.\u0275\u0275advance(6),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(43,35,"ng.manage-tip-employee.select-value")," "),m.\u0275\u0275advance(2),m.\u0275\u0275property("ngForOf",n.tariffPlans),m.\u0275\u0275advance(2),m.\u0275\u0275property("ngIf",n.uploadTIPEmployeesForm.controls.tariffPlan.errors&&n.uploadTIPEmployeesForm.controls.tariffPlan.touched),m.\u0275\u0275advance(4),m.\u0275\u0275textInterpolate1(" ",m.\u0275\u0275pipeBind1(51,37,"ng.manage-tip-employee.lbl.upload-file")," "),m.\u0275\u0275advance(3),m.\u0275\u0275property("config",n.config),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.showFileUploadError),m.\u0275\u0275advance(),m.\u0275\u0275property("ngIf",n.showInvalidDataError),m.\u0275\u0275advance(7),m.\u0275\u0275textInterpolate(m.\u0275\u0275pipeBind1(63,39,"ng.manage-tip-employee.cancel-creation")),m.\u0275\u0275advance(4),m.\u0275\u0275textInterpolate(m.\u0275\u0275pipeBind1(67,41,"ng.manage-tip-employee.create-user")))},dependencies:[fn.NgForOf,fn.NgIf,_e.\u0275NgNoValidate,_e.NgSelectOption,_e.\u0275NgSelectMultipleOption,_e.SelectControlValueAccessor,_e.NgControlStatus,_e.NgControlStatusGroup,_e.RequiredValidator,_e.FormGroupDirective,_e.FormControlName,Eo,Ki,Hi,kr.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import{forkJoin as Op,of as Mp,timer as Rp}from"rxjs";import"@telenet/ng-lib-datalayer";import*as d from"@angular/core";import*as Ur from"@ngxs/store";import*as Vr from"@telenet/ng-lib-datalayer";import*as yi from"@angular/common";import*as Br from"@ngx-translate/core";var Dp=(t,o)=>({active:t,"in-active":o}),Fp=(t,o)=>o.sequence;function Lp(t,o){t&1&&(d.\u0275\u0275elementStart(0,"div",1)(1,"span",21),d.\u0275\u0275text(2),d.\u0275\u0275pipe(3,"translate"),d.\u0275\u0275elementEnd()()),t&2&&(d.\u0275\u0275advance(2),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(3,1,"ng.manage-tip-employee.lbl.missing_data_error")," "))}function kp(t,o){t&1&&d.\u0275\u0275element(0,"i",28)}function Gp(t,o){t&1&&(d.\u0275\u0275elementStart(0,"span",33),d.\u0275\u0275text(1),d.\u0275\u0275pipe(2,"translate"),d.\u0275\u0275elementEnd()),t&2&&(d.\u0275\u0275advance(),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(2,1,"ng.manage-tip-employee.lbl.edited")," "))}function Up(t,o){if(t&1){let e=d.\u0275\u0275getCurrentView();d.\u0275\u0275elementStart(0,"li",22),d.\u0275\u0275listener("click",function(){let n=d.\u0275\u0275restoreView(e).$implicit,p=d.\u0275\u0275nextContext();
3return d.\u0275\u0275resetView(p.onSelect(n))}),d.\u0275\u0275elementStart(1,"div",23),d.\u0275\u0275element(2,"div",24),d.\u0275\u0275elementStart(3,"div",25)(4,"div",26)(5,"div",27),d.\u0275\u0275conditionalCreate(6,kp,1,0,"i",28),d.\u0275\u0275elementStart(7,"div",29)(8,"div",30)(9,"span",31),d.\u0275\u0275text(10),d.\u0275\u0275elementEnd()(),d.\u0275\u0275elementStart(11,"div",32),d.\u0275\u0275text(12),d.\u0275\u0275elementEnd()()(),d.\u0275\u0275elementStart(13,"div"),d.\u0275\u0275conditionalCreate(14,Gp,3,3,"span",33),d.\u0275\u0275elementEnd()()()()()}if(t&2){let e=o.$implicit,i=d.\u0275\u0275nextContext();d.\u0275\u0275property("ngClass",d.\u0275\u0275pureFunction2(5,Dp,i.selectedTIPEmployee.sequence===e.sequence,i.selectedTIPEmployee.sequence!==e.sequence)),d.\u0275\u0275advance(6),d.\u0275\u0275conditional(e.isValidData?-1:6),d.\u0275\u0275advance(4),d.\u0275\u0275textInterpolate(e.firstName+" "+e.lastName),d.\u0275\u0275advance(2),d.\u0275\u0275textInterpolate1(" ",e.employeeReferenceNumber," "),d.\u0275\u0275advance(2),d.\u0275\u0275conditional(i.selectedTIPActionName===i.tipActionEnum.EDIT_TIP_EMPLOYEES&&e.actionRequired?14:-1)}}function Vp(t,o){if(t&1&&(d.\u0275\u0275elementStart(0,"span",15),d.\u0275\u0275text(1),d.\u0275\u0275elementEnd()),t&2){let e=d.\u0275\u0275nextContext();d.\u0275\u0275advance(),d.\u0275\u0275textInterpolate1(" ",e.selectedTIPEmployee.normalizedStatus," ")}}function Bp(t,o){if(t&1&&(d.\u0275\u0275elementStart(0,"div",16),d.\u0275\u0275text(1),d.\u0275\u0275pipe(2,"translate"),d.\u0275\u0275pipe(3,"date"),d.\u0275\u0275elementEnd()),t&2){let e=d.\u0275\u0275nextContext();d.\u0275\u0275advance(),d.\u0275\u0275textInterpolate2(" ",d.\u0275\u0275pipeBind1(2,2,"ng.manage-tip-employee.lbl.activation-date")," ",d.\u0275\u0275pipeBind2(3,4,e.selectedTIPEmployee.activationDate,"dd/MM/yyyy")," ")}}var Bn=(()=>{class t extends D{constructor(e,i,n,p,N,Y,ne){super(),this.store=e,this.promotionService=i,this.domService=n,this.messageService=p,this.manageTIPEmployeesService=N,this.tipDataLayerService=Y,this.dataLayerService=ne,this.selectedTIPEmployeesToActOn$=this.store.select(h.selectedTIPEmployeesToActOn),this.selectedTIPActionName=u.EDIT_TIP_EMPLOYEES,this.tipActionEnum=u,this.selectedTIPEmployee=new We,this.isMissingData=!1,this.tariffPlans=[],this.isEditMode=!1,this.invalidEmployeesCount=0}get isDisabled(){return this.getTIPEmployeesWithActionRequired().length===0}ngOnInit(){this.selectedTIPEmployee=this.store.selectSnapshot(h.selectedTIPEmployeesToActOn)[0],this.selectedTIPActionName=this.store.selectSnapshot(M.selectedTIPActionName),this.isEditMode=this.selectedTIPActionName===u.EDIT_TIP_EMPLOYEES,this.initEmployeeForm(this.selectedTIPEmployee),this.clearErrorMessages(),this.domService.scrollToStartElement("#formSection"),this.obs(this.selectedTIPEmployeesToActOn$).subscribe(e=>{this.invalidEmployeesCount=e.filter(n=>!n.isValidData).length;let i=this.isMissingData;this.isMissingData=this.invalidEmployeesCount>0,!i&&this.isMissingData&&this.scrollToElement()})}onSelect(e){this.selectedTIPEmployee=e,this.initEmployeeForm(e),this.domService.scrollToStartElement("#formSection")}onFormBlur(){let e=new We;Object.assign(e,this.selectedTIPEmployee),e.isValidData=this.employeeForm.valid,e.actionRequired=this.computeActionRequired(),Jn(e,this.employeeForm.value),this.store.dispatch(new _t(e))}initEmployeeForm(e){this.employeeForm=vi.build(),this.employeeForm.markAllAsTouched(),this.employeeForm.emailAddress=e.emailAddress||"",this.employeeForm.firstName=e.firstName||"",this.employeeForm.lastName=e.lastName||"",this.employeeForm.language=e.language||"",this.employeeForm.displayPlanName=e.displayPlanName||"",this.employeeForm.employeeReferenceNumber=e.employeeReferenceNumber||"",this.tariffPlans=[e.displayPlanName||""]}computeActionRequired(){return this.employeeForm.emailAddress!==this.selectedTIPEmployee.emailAddress||this.employeeForm.firstName!==this.selectedTIPEmployee.firstName||this.employeeForm.lastName!==this.selectedTIPEmployee.lastName||this.employeeForm.language!==this.selectedTIPEmployee.language||this.employeeForm.displayPlanName!==this.selectedTIPEmployee.displayPlanName||this.employeeForm.employeeReferenceNumber!==this.selectedTIPEmployee.employeeReferenceNumber}onSaveAll(){if(this.clearErrorMessages(),this.isDisabled)return;let e=this.getTIPEmployeesWithActionRequired();this.validateTIPEmployees(e)&&(this.selectedTIPActionName===u.EDIT_TIP_EMPLOYEES?this.updateTIPEmployees(e):this.createTIPEmployees(e))}getTIPEmployeesWithActionRequired(){let e=this.store.selectSnapshot(h.selectedTIPEmployeesToActOn);return re(e,i=>i.actionRequired===!0)}validateTIPEmployees(e){let i=!0,n=e.find(p=>p.isValidData===!1);if(n&&(i=!1,this.onSelect(n),this.scrollToElement()),i)return!0}createTIPEmployees(e){this.checkLoginEligibility().subscribe(()=>{let i=this.createAddEmployeeRequestPayload(e),n=this.manageTIPEmployeesService.createTIPEmployees(i);this.handleServiceResponse(n)})}checkLoginEligibility(){let e=this.store.selectSnapshot(h.allTIPEmployees);return e&&e.length>0?Mp({status:200}):this.promotionService.loginEligibility(W.MESSAGE_GROUP)}createAddEmployeeRequestPayload(e){let i=this.store.selectSnapshot(h.selectedTIPContract),n=[];e.forEach(Y=>{let ne={};ne.emailAddress=Y.emailAddress,ne.employeeReferenceNumber=Y.employeeReferenceNumber,ne.firstName=Y.firstName,ne.lastName=Y.lastName,ne.language=Y.language,n.push(ne)});let p=i.customerProductId;return{tipPlan:i.planName,customerProductId:p,employees:n}}updateTIPEmployees(e){let i=this.updateTIPEmployeesRequestPayload(e),n=this.manageTIPEmployeesService.updateTIPEmployees(i);this.handleServiceResponse(n)}updateTIPEmployeesRequestPayload(e){let i=[];return e.forEach(n=>{let p={};p.employeeCustomerNumber=n.employeeCustomerNumber,p.employeeReferenceNumber=this.getOldEmployeeReferenceNumber(n.employeeUniqueID),p.newEmployeeReferenceNumber=n.employeeReferenceNumber,p.firstName=n.firstName,p.lastName=n.lastName,p.language=n.language,p.emailAddress=n.emailAddress,i.push(p)}),i}getOldEmployeeReferenceNumber(e){return this.store.selectSnapshot(h.selectedTIPEmployees).find(p=>p.employeeUniqueID===e).employeeReferenceNumber}getI18nLabelKey(){let e="ng.manage-tip-employee.lbl.identification";return e=e.concat(".").concat(this.selectedTIPActionName.toLowerCase()),e}clearErrorMessages(){this.messageService.clearMessages(W.MESSAGE_GROUP_CUSTOM)}handleServiceResponse(e){e.subscribe({next:i=>{if(i.serviceOutcome===S.SUCCESS){let n={};n.itemName=this.getTIPEmployeesWithActionRequired().length.toString(),this.tipDataLayerService.fireAnalyticsFlowEndEvent(n).then(()=>{this.goToNextStep()})}else this.messageService.addMessage(new ce(W.MESSAGE_GROUP_CUSTOM,ue.OCAPI_E
3RROR_500)),this.scrollToElement()},error:i=>{this.scrollToElement()}})}goToNextStep(){Rp(100).subscribe(()=>{let e=this.dataLayerService.getAnalyticsPromises();Op(e).subscribe(()=>{this.store.dispatch(new Ee)})})}scrollToElement(){this.domService.scrollToElement(".editTIPEmployees__error")}static{this.\u0275fac=function(i){return new(i||t)(d.\u0275\u0275directiveInject(Ur.Store),d.\u0275\u0275directiveInject(pe),d.\u0275\u0275directiveInject(Ye),d.\u0275\u0275directiveInject(le),d.\u0275\u0275directiveInject(Rt),d.\u0275\u0275directiveInject(De),d.\u0275\u0275directiveInject(Vr.DataLayerService))}}static{this.\u0275cmp=d.\u0275\u0275defineComponent({type:t,selectors:[["app-edit-tip-employees"]],standalone:!1,features:[d.\u0275\u0275InheritDefinitionFeature],decls:30,vars:17,consts:[[1,"editTIPEmployees__error"],[1,"notification","notification--errorfield","mt-20"],[1,"mt--xxl--md"],[1,"row","mb--xxl"],[1,"col-12","col-md-4"],[1,"navigation-list--deprecated"],[1,"nav-list"],[1,"in-active",3,"ngClass"],["id","formSection",1,"col-12","col-md-8"],[1,"shadow--default","py--xl","border-radius--all--xs","mt--n--md","mt--xxl"],[1,"border--b--r","border-width--b--r","border-style--b--solid","border-color--b--light-grey","col-12","pb--xl"],[1,"display--flex","justify-content--between","align-items--center","pr--xl"],[1,"display--flex","align-items--center","text--xm","text--l--md","pr--xl","pl--xl"],[1,"icon","icon-md","icon-user","pr--m"],[1,"font-weight--black"],[1,"status-indicator","status-indicator--positive"],[1,"activation-date","text--s","text--xm--md","text-align--right","mt--xxs","pr--xl"],[1,"col-12","col-md-9"],[3,"blurred","form","isEditMode","tariffPlans"],[1,"col-12","col-md-9","display--flex","justify-content--center"],["appearance","primary","element","button","pointer-event","auto","size","md","status","none","theme","light","type","button",3,"click","keydown.enter","keyup.enter","disabled","status"],[1,"icon","icon-error-shape","error"],[1,"in-active",3,"click","ngClass"],[1,"link-section"],[1,"selection-bar"],[1,"display--block","align-items--center","justify-content--between","width--full","pt--m","pb--m","pr-0","pl-0"],[1,"display--flex","align-items--center","border--b--r","border-width--b--r","border-style--b--solid","border-color--b--light-grey","py--xxs","justify-content--between"],[1,"row","row--no-gutters"],[1,"icon","icon-md","icon-error-shape","color-red","mr--m"],[1,"section__content"],[1,"section__content__first-section"],[1,"ellipsis","space-break-spaces","word-break--break-word"],[1,"section__content__sublabel-section","text--s","font-weight--regular","word-break--break-word"],[1,"status-indicator","status-indicator--warning","word-break--ellipsis"]],template:function(i,n){i&1&&(d.\u0275\u0275elementStart(0,"div")(1,"div",0),d.\u0275\u0275conditionalCreate(2,Lp,4,3,"div",1),d.\u0275\u0275elementEnd(),d.\u0275\u0275elementStart(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"ul"),d.\u0275\u0275repeaterCreate(9,Up,15,8,"li",7,Fp),d.\u0275\u0275pipe(11,"async"),d.\u0275\u0275elementEnd()()()(),d.\u0275\u0275elementStart(12,"div",8)(13,"div",9)(14,"div",10)(15,"div",11)(16,"div",12),d.\u0275\u0275element(17,"i",13),d.\u0275\u0275elementStart(18,"span",14),d.\u0275\u0275text(19),d.\u0275\u0275pipe(20,"translate"),d.\u0275\u0275elementEnd()(),d.\u0275\u0275elementStart(21,"div"),d.\u0275\u0275conditionalCreate(22,Vp,2,1,"span",15),d.\u0275\u0275elementEnd()(),d.\u0275\u0275conditionalCreate(23,Bp,4,7,"div",16),d.\u0275\u0275elementEnd(),d.\u0275\u0275elementStart(24,"div",17)(25,"app-tip-employee-form",18),d.\u0275\u0275listener("blurred",function(){return n.onFormBlur()}),d.\u0275\u0275elementEnd()(),d.\u0275\u0275elementStart(26,"div",19)(27,"wink-button",20),d.\u0275\u0275listener("click",function(){return!n.isDisabled&&n.onSaveAll()})("keydown.enter",function(){return!n.isDisabled&&n.onSaveAll()})("keyup.enter",function(){return!n.isDisabled&&n.onSaveAll()}),d.\u0275\u0275text(28),d.\u0275\u0275pipe(29,"translate"),d.\u0275\u0275elementEnd()()()()()()()),i&2&&(d.\u0275\u0275advance(2),d.\u0275\u0275conditional(n.isMissingData?2:-1),d.\u0275\u0275advance(7),d.\u0275\u0275repeater(d.\u0275\u0275pipeBind1(11,11,n.selectedTIPEmployeesToActOn$)),d.\u0275\u0275advance(10),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(20,13,n.getI18nLabelKey())," "),d.\u0275\u0275advance(3),d.\u0275\u0275conditional(n.selectedTIPActionName===n.tipActionEnum.EDIT_TIP_EMPLOYEES?22:-1),d.\u0275\u0275advance(),d.\u0275\u0275conditional(n.selectedTIPActionName===n.tipActionEnum.EDIT_TIP_EMPLOYEES?23:-1),d.\u0275\u0275advance(2),d.\u0275\u0275property("form",n.employeeForm)("isEditMode",n.isEditMode)("tariffPlans",n.tariffPlans),d.\u0275\u0275advance(2),d.\u0275\u0275property("disabled",n.isDisabled)("status",n.isDisabled?"disable":""),d.\u0275\u0275attribute("pointer-event",n.isDisabled?"none":"auto"),d.\u0275\u0275advance(),d.\u0275\u0275textInterpolate1(" ",d.\u0275\u0275pipeBind1(29,15,"ng.manage-tip-employee.lbl.save-all")," "))},dependencies:[yi.NgClass,Be,En,yi.AsyncPipe,yi.DatePipe,Br.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import{catchError as Yp,map as jp,of as Yn}from"rxjs";import*as F from"@angular/core";import*as Yr from"@ngxs/store";import*as Tn from"@angular/common";function Wp(t,o){if(t&1){let e=F.\u0275\u0275getCurrentView();F.\u0275\u0275elementStart(0,"div",3),F.\u0275\u0275listener("click",function(){let n=F.\u0275\u0275restoreView(e).$implicit,p=F.\u0275\u0275nextContext();
3return F.\u0275\u0275resetView(p.onSelect(n))}),F.\u0275\u0275elementStart(1,"div",4),F.\u0275\u0275element(2,"input",5),F.\u0275\u0275elementStart(3,"div",6)(4,"div",7)(5,"div",8),F.\u0275\u0275element(6,"label",9)(7,"div",10),F.\u0275\u0275elementStart(8,"div",11),F.\u0275\u0275element(9,"i",12),F.\u0275\u0275elementEnd(),F.\u0275\u0275element(10,"div",13),F.\u0275\u0275elementStart(11,"div",14)(12,"div",15),F.\u0275\u0275text(13),F.\u0275\u0275elementEnd(),F.\u0275\u0275elementStart(14,"div",16),F.\u0275\u0275text(15),F.\u0275\u0275elementEnd()()()()()()()}if(t&2){let e=o.$implicit;F.\u0275\u0275advance(2),F.\u0275\u0275property("id",e.employeeUniqueID)("checked",e.actionRequired),F.\u0275\u0275advance(2),F.\u0275\u0275property("ngClass",e.actionRequired?"selected-row":""),F.\u0275\u0275advance(2),F.\u0275\u0275property("for",e.employeeUniqueID),F.\u0275\u0275advance(7),F.\u0275\u0275textInterpolate(e.firstName+" "+e.lastName),F.\u0275\u0275advance(2),F.\u0275\u0275textInterpolate(e.emailAddress)}}var Ri=(()=>{class t extends D{constructor(e,i,n,p,N){super(),this.store=e,this.messageService=i,this.domService=n,this.manageTIPEmployeesService=p,this.tipDataLayerService=N,this.selectedTIPEmployeesToActOn=[],this.selectedTIPEmployeesToActOn$=this.store.select(h.selectedTIPEmployeesToActOn),e.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){this.messageService.clearMessages(W.MESSAGE_GROUP_CUSTOM),this.obs(this.selectedTIPEmployeesToActOn$).subscribe(e=>{this.selectedTIPEmployeesToActOn=io(e,["firstName","lastName"])})}onSelect(e){this.messageService.clearMessages(W.MESSAGE_GROUP_CUSTOM);let i=ki(e);i.actionRequired=!i.actionRequired,this.store.dispatch(new _t(i))}onNext(){this.messageService.clearMessages(W.MESSAGE_GROUP_CUSTOM);let e=this.store.selectSnapshot(M.selectedTIPActionName),i=this.getTIPEmployeesWithActionRequired();return i.length===0?(this.messageService.addMessage(new ce(W.MESSAGE_GROUP_CUSTOM,"manage-tip-employee.lbl.employee-not-selected")),Yn(!1)):e===u.RESEND_TIP_INVITE?this.resendTIPInvite(i):Yn(!0)}getTIPEmployeesWithActionRequired(){let e=this.store.selectSnapshot(h.selectedTIPEmployeesToActOn);return re(e,i=>i.actionRequired===!0)}resendTIPInvite(e){let i=this.resendTIPInviteRequestPayload(e),n=this.manageTIPEmployeesService.resendTIPInvite(i);return this.handleServiceResponse(n)}resendTIPInviteRequestPayload(e){let i={},n=[];return e.forEach(p=>{let N={};N.emailAddress=p.emailAddress,N.employeeReferenceNumber=p.employeeReferenceNumber,n.push(N)}),i.employees=n,i}handleServiceResponse(e){return e.pipe(jp(i=>{if(i.serviceOutcome===S.SUCCESS){let n={};return n.itemName=this.getTIPEmployeesWithActionRequired().length.toString(),this.tipDataLayerService.fireAnalyticsFlowEndEvent(n),!0}else return this.messageService.addMessage(new ce(W.MESSAGE_GROUP_CUSTOM,ue.OCAPI_ERROR_500)),this.scrollToTop(),!1}),Yp(i=>(this.scrollToTop(),Yn(!1))))}scrollToTop(){this.domService.scrollToTop()}static{this.\u0275fac=function(i){return new(i||t)(F.\u0275\u0275directiveInject(Yr.Store),F.\u0275\u0275directiveInject(le),F.\u0275\u0275directiveInject(Ye),F.\u0275\u0275directiveInject(Rt),F.\u0275\u0275directiveInject(De))}}static{this.\u0275cmp=F.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employees-list"]],standalone:!1,features:[F.\u0275\u0275InheritDefinitionFeature],decls:3,vars:1,consts:[[1,"col-md-10","m--auto","pt--l","pb--xl"],[1,"label-modifier-box","card-mini","card-mini--with-icon","display--flex","justify-content--center","row","mb--xg","ml--m--md","ml--xs--sm"],["class","mb--xs mb--n--md mr--xs--sm mr--n--lg",3,"click",4,"ngFor","ngForOf"],[1,"mb--xs","mb--n--md","mr--xs--sm","mr--n--lg",3,"click"],[1,"label-modifier-slot","pl--xxxs","pl--n--sm"],["type","checkbox","name","radio-group-time",1,"label-modifier-radio",3,"id","checked"],[1,"label-modifier--append","label-modifier--container","cursor--pointer"],[1,"label-modifier--body",3,"ngClass"],[1,"label-modifier--body--inner-container"],[1,"label-modifier-radio__label",3,"for"],[1,"label-modifier-content__header-text"],[1,"label-modifier-content__header"],[1,"icon","icon-tick"],[1,"label-modifier-content__desc"],[1,"label-modifier-content__body"],[1,"text-flow","text-flow--button","label-modifier-content__body-label","word-break--ellipsis"],[1,"text-flow","text-flow--legal","label-modifier-content__body-range","mt--xxxs"]],template:function(i,n){i&1&&(F.\u0275\u0275elementStart(0,"div",0)(1,"div",1),F.\u0275\u0275template(2,Wp,16,6,"div",2),F.\u0275\u0275elementEnd()()),i&2&&(F.\u0275\u0275advance(2),F.\u0275\u0275property("ngForOf",n.selectedTIPEmployeesToActOn))},dependencies:[Tn.NgClass,Tn.NgForOf],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import{of as Wr}from"rxjs";import{FormControl as qp,FormGroup as Hp,Validators as jr}from"@angular/forms";var gn=class t extends Hp{constructor(o){super(o)}static build(){let o=new t({});return o.minDateRange=je().format(ue.DATE_RANGE_FORMAT),o.maxDateRange=je().add(ue.MAX_YEARS_ALLOWED_IN_FUTURE,"years").format(ue.DATE_RANGE_FORMAT),o.addControl("changeEffectiveFromDate",new qp(o.minDateRange,[])),o.controls.changeEffectiveFromDate.setValidators([jr.required,jr.pattern(ue.DATE_PATTERN),o.fromDateValidator.bind(o)]),o}fromDateValidator(o){let e=je(o.value);return e.isBefore(this.minDateRange)||e.isAfter(this.maxDateRange)?{range:"ng.tip-employees-overview.tip-employee-change-effective-from.lbl.error"}:null}getMinDateRange(){return this.minDateRange}getMaxDateRange(){return this.maxDateRange}get changeEffectiveFromDate(){return this.get("changeEffectiveFromDate").value}set changeEffectiveFromDate(o){this.get("changeEffectiveFromDate").setValue(o)}};import*as Ie from"@angular/core";import*as qr from"@ngxs/store";import*as Ke from"@angular/forms";var jn=(()=>{class t extends D{constructor(e,i){super(),this.store=e,this.messageService=i,e.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){this.messageService.clearMessages(W.MESSAGE_GROUP_CUSTOM),this.tipEmployeeChangeEffectiveForm=gn.build(),this.minDateRange=this.tipEmployeeChangeEffectiveForm.getMinDateRange(),this.maxDateRange=this.tipEmployeeChangeEffectiveForm.getMaxDateRange();let e=this.store.selectSnapshot(h.changeEffectiveFromDate);z(e)||(this.tipEmployeeChangeEffectiveForm.changeEffectiveFromDate=e.slice(0,10))}onNext(){if(this.tipEmployeeChangeEffectiveForm.valid){let e=this.tipEmployeeChangeEffectiveForm.changeEffectiveFromDate+"T00:00:00+00:00";return this.store.dispatch(new gt(e)),Wr(!0)}else return this.tipEmployeeChangeEffectiveForm.markAllAsTouched(),Wr(!1)}static{this.\u0275fac=function(i){return new(i||t)(Ie.\u0275\u0275directiveInject(qr.Store),Ie.\u0275\u0275directiveInject(le))}}static{this.\u0275cmp=Ie.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employee-change-effective-from"]],standalone:!1,features:[Ie.\u0275\u0275InheritDefinitionFeature],decls:4,vars:3,consts:[[3,"formGroup"],[1,"row","mb--xxl","mt--l--sm"],[1,"col-12","col-sm-7","col-lg-4","pb--xxl","m--auto"],["formControlName","changeEffectiveFromDate","ngDefaultControl","",3,"maxDate","minDate"]],template:function(i,n){i&1&&(Ie.\u0275\u0275elementStart(0,"form",0)(1,"div",1)(2,"div",2),Ie.\u0275\u0275element(3,"tip-datepicker",3),Ie.\u0275\u0275elementEnd()()()),i&2&&(Ie.\u0275\u0275property("formGroup",n.tipEmployeeChangeEffectiveForm),Ie.\u0275\u0275advance(3),Ie.\u0275\u0275property("maxDate",n.maxDateRange)("minDate",n.minDateRange))},dependencies:[Ke.\u0275NgNoValidate,Ke.DefaultValueAccessor,Ke.NgControlStatus,Ke.NgControlStatusGroup,Ke.FormGroupDirective,Ke.FormControlName,ui],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import{catchError as Kp,map as zp,of as $p}from"rxjs";import*as ye from"@angular/core";import*as Hr from"@ngxs/store";var _n=(()=>{class t extends D{constructor(e,i,n,p,N,Y){super(),this.store=e,this.manageTIPEmployeesService=i,this.messageService=n,this.domService=p,this.tipDataLayerService=N,this.tipMessagingService=Y,e.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){let e=this.store.selectSnapshot(M.selectedTIPActionName),i=this.tipMessagingService.getMessage(e,S.REVIEW);this.store.dispatch(new me(i))}onNext(){switch(this.messageService.clearMessages(W.MESSAGE_GROUP_CUSTOM),this.store.selectSnapshot(M.selectedTIPActionName)){case u.MIGRATE_TIP_PLAN:return this.migrateTIPEmployees();case u.DEACTIVATE_TIP_EMPLOYEES:return this.deactivateTIPEmployees();case u.REVOKE_TIP_DEACTIVATION:return this.revokeDeactivationTIPEmployees();case u.REVOKE_TIP_MIGRATION:return this.revokeMigrationTIPEmployees();case u.DELETE_TIP_EMPLOYEES:return this.deleteTIPEmployees()}}deactivateTIPEmployees(){let e=this.createDeactivateTIPEmployeeActionRequest(),i=this.manageTIPEmployeesService.deactivateTIPEmployee(e);return this.handleServiceResponse(i)}revokeDeactivationTIPEmployees(){let e=this.createRevokeDeactivationTIPEmployeeActionRequest(),i=this.manageTIPEmployeesService.revokeTIPDeactivation(e);return this.handleServiceResponse(i)}migrateTIPEmployees(){let e=this.createMigrateTIPEmployeeActionRequest(),i=this.manageTIPEmployeesService.migrateTIPEmployees(e);return this.handleServiceResponse(i)}createDeactivateTIPEmployeeActionRequest(){let e=this.createTIPRequestPayloadWithEmployees(),i=this.store.selectSnapshot(h.changeEffectiveFromDate);return e.deactivationDate=i,e}createRevokeDeactivationTIPEmployeeActionRequest(){return this.createTIPRequestPayloadWithEmployees()}createMigrateTIPEmployeeActionRequest(){let e=this.createTIPRequestPayloadWithEmployees(),i=this.store.selectSnapshot(h.changeEffectiveFromDate),n=this.store.selectSnapshot(h.selectedTIPContract);return e.toBeCustomerProductId=n.customerProductId,e.toBeTipPlan=n.planName,e.activationDate=i,e}createTIPRequestPayloadWithEmployees(){let e={},i=this.getTIPEmployeesWithActionRequired(),n=[];
3return i.forEach(p=>{let N={};N.emailAddress=p.emailAddress,N.employeeReferenceNumber=p.employeeReferenceNumber,n.push(N)}),e.employees=n,e}getTIPEmployeesWithActionRequired(){let e=this.store.selectSnapshot(h.selectedTIPEmployeesToActOn);return re(e,i=>i.actionRequired===!0)}handleServiceResponse(e){return e.pipe(zp(i=>i.serviceOutcome===S.SUCCESS?(this.fireAnalyticsFlowEndEvent(),!0):(this.messageService.addMessage(new ce(W.MESSAGE_GROUP_CUSTOM,ue.OCAPI_ERROR_500)),this.scrollToTop(),!1)),Kp(()=>(this.scrollToTop(),$p(!1))))}scrollToTop(){this.domService.scrollToTop()}revokeMigrationTIPEmployees(){let e=this.createRevokeMigrationTIPEmployeeActionRequest(),i=this.manageTIPEmployeesService.revokeTIPMigration(e);return this.handleServiceResponse(i)}deleteTIPEmployees(){let e=this.createDeleteTIPEmployeeActionRequest(),i=this.manageTIPEmployeesService.deleteTIPEmployees(e);return this.handleServiceResponse(i)}createDeleteTIPEmployeeActionRequest(){return this.createTIPRequestPayloadWithEmployees()}createRevokeMigrationTIPEmployeeActionRequest(){return this.createTIPRequestPayloadWithEmployees()}fireAnalyticsFlowEndEvent(){let e={};e.itemName=this.getTIPEmployeesWithActionRequired().length.toString();let i=this.store.selectSnapshot(h.changeEffectiveFromDate);if(e.itemData=void 0,i){let n=new Date;e.itemData=new Date(i)>n?"future-date-change":"current-date-change"}this.tipDataLayerService.fireAnalyticsFlowEndEvent(e)}static{this.\u0275fac=function(i){return new(i||t)(ye.\u0275\u0275directiveInject(Hr.Store),ye.\u0275\u0275directiveInject(Rt),ye.\u0275\u0275directiveInject(le),ye.\u0275\u0275directiveInject(Ye),ye.\u0275\u0275directiveInject(De),ye.\u0275\u0275directiveInject(Ce))}}static{this.\u0275cmp=ye.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employee-review-changes"]],standalone:!1,features:[ye.\u0275\u0275InheritDefinitionFeature],decls:3,vars:0,consts:[[1,"contract-overview"],[1,"col-md-4","text-align--center","m--auto","pt--xxxl--md","pb--xxxl","pb--m--sm"]],template:function(i,n){i&1&&(ye.\u0275\u0275elementStart(0,"div",0)(1,"div",1),ye.\u0275\u0275element(2,"app-tip-messaging"),ye.\u0275\u0275elementEnd()())},dependencies:[qe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import{of as Kr}from"rxjs";import{FormControl as Xp,FormGroup as Zp,Validators as Jp}from"@angular/forms";var In=class t extends Zp{constructor(o){super(o)}static build(){let o=new t({});return o.addControl(oe.DISPLAY_PLAN_NAME,new Xp("",[Jp.required])),o}get displayPlanName(){return this.get(oe.DISPLAY_PLAN_NAME).value}};import*as y from"@angular/core";import*as zr from"@ngxs/store";import*as vn from"@angular/common";import*as ve from"@angular/forms";import*as $r from"@ngx-translate/core";
3function Qp(t,o){t&1&&(y.\u0275\u0275elementStart(0,"div",15)(1,"div",16)(2,"span",17),y.\u0275\u0275text(3),y.\u0275\u0275pipe(4,"translate"),y.\u0275\u0275elementEnd()()()),t&2&&(y.\u0275\u0275advance(3),y.\u0275\u0275textInterpolate1(" ",y.\u0275\u0275pipeBind1(4,1,"ng.manage-tip-employee.tip-employee-change-plan.info.partial-change-plan")," "))}function em(t,o){if(t&1&&(y.\u0275\u0275elementStart(0,"option",18),y.\u0275\u0275text(1),y.\u0275\u0275elementEnd()),t&2){let e=o.$implicit;y.\u0275\u0275property("value",y.\u0275\u0275interpolate(e)),y.\u0275\u0275advance(),y.\u0275\u0275textInterpolate1(" ",e)}}function tm(t,o){t&1&&(y.\u0275\u0275elementStart(0,"div",19)(1,"p"),y.\u0275\u0275text(2),y.\u0275\u0275pipe(3,"translate"),y.\u0275\u0275elementEnd()()),t&2&&(y.\u0275\u0275advance(2),y.\u0275\u0275textInterpolate(y.\u0275\u0275pipeBind1(3,1,"ng.manage-tip-employee.tip-employee-change-plan.lbl.invalid-plan")))}function im(t,o){t&1&&(y.\u0275\u0275elementStart(0,"div",19)(1,"p"),y.\u0275\u0275text(2),y.\u0275\u0275pipe(3,"translate"),y.\u0275\u0275elementEnd()()),t&2&&(y.\u0275\u0275advance(2),y.\u0275\u0275textInterpolate(y.\u0275\u0275pipeBind1(3,1,"ng.manage-tip-employee.tip-employee-change-plan.lbl.required")))}var Xr=(()=>{class t extends D{constructor(e,i){super(),this.messageService=e,this.store=i,this.currentStep$=this.store.select($.currentStep),this.tariffPlans=[],this.messageGroupName=W.MESSAGE_GROUP_CUSTOM,this.currentTIPPlans=[],this.isChangingPlanForSomeEmployees=!1,i.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){this.getTIPContracts(),this.tipEmployeeChangePlanForm=In.build(),this.currentTIPPlans=this.getCurrentTIPPlans()}getCurrentTIPPlans(){let e=this.store.selectSnapshot(h.selectedTIPEmployeesToActOn),i=re(e,n=>n.actionRequired);return no(Le(i,"displayPlanName"))}getTIPContracts(){let e=this.store.selectSnapshot(B.allTIPContracts);this.activeTIPContracts=re(e,i=>i.normalizedStatus===we.ACTIVE),z(this.activeTIPContracts)&&this.messageService.addMessage(new ce(this.messageGroupName,"manage-tip-employee.lbl.no-active-tip-plans")),this.tariffPlans=Le(this.activeTIPContracts,"displayPlanName")}onSelectPlan(e){this.isChangingPlanForSomeEmployees=!1;let i=this.tipEmployeeChangePlanForm.displayPlanName;if(!z(i))if(this.currentTIPPlans.includes(i))if(this.currentTIPPlans.length===1)this.tipEmployeeChangePlanForm.get(oe.DISPLAY_PLAN_NAME).setErrors({invalid:!0});else{this.isChangingPlanForSomeEmployees=!0,this.tipEmployeeChangePlanForm.get(oe.DISPLAY_PLAN_NAME).setErrors(null);let n=this.findSelectedTIPContract(i);this.store.dispatch(new ot(n))}else{this.tipEmployeeChangePlanForm.get(oe.DISPLAY_PLAN_NAME).setErrors(null);let n=this.findSelectedTIPContract(i);this.store.dispatch(new ot(n))}this.tipEmployeeChangePlanForm.markAllAsTouched()}findSelectedTIPContract(e){return this.activeTIPContracts.find(i=>i.displayPlanName===e)}onNext(){return this.tipEmployeeChangePlanForm.valid?Kr(!0):(this.tipEmployeeChangePlanForm.markAllAsTouched(),Kr(!1))}static{this.\u0275fac=function(i){return new(i||t)(y.\u0275\u0275directiveInject(le),y.\u0275\u0275directiveInject(zr.Store))}}static{this.\u0275cmp=y.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-employee-change-plan"]],standalone:!1,features:[y.\u0275\u0275InheritDefinitionFeature],decls:20,vars:11,consts:[["displayPlanName",""],["class","mt--xl--md",4,"ngIf"],[3,"formGroup"],[1,"row","row--no-gutters","justify-content--center"],[1,"col-12","col-sm-7","col-md-5"],[1,"form-builder","mt--xl--md","mb--xxxl","mb--n--sm","pb--l"],["for","tariff-plan",1,"text-uppercase"],[1,"form-group"],[1,"row","row--no-gutters","align-items--center"],[1,"select-dropdown-section","col-12"],["id","displayPlanName","name","displayPlanName","required","required","formControlName","displayPlanName",1,"form-control","select-dropdown","word-break--ellipsis",3,"change"],["value","","selected","",1,"placeholder-option"],["class","placeholder-option",3,"value",4,"ngFor","ngForOf"],[1,"icon","icon-chevron-down","position--absolute","text--m","text-weight--g"],["class","form__msg--error form__input__invalid-message",4,"ngIf"],[1,"mt--xl--md"],[1,"n
3otification","notification--info"],[1,"icon","icon-information-shape","info"],[1,"placeholder-option",3,"value"],[1,"form__msg--error","form__input__invalid-message"]],template:function(i,n){if(i&1){let p=y.\u0275\u0275getCurrentView();y.\u0275\u0275template(0,Qp,5,3,"div",1),y.\u0275\u0275elementStart(1,"form",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"label",6),y.\u0275\u0275text(6),y.\u0275\u0275pipe(7,"translate"),y.\u0275\u0275elementEnd(),y.\u0275\u0275elementStart(8,"div",7)(9,"div",8)(10,"div",9)(11,"select",10,0),y.\u0275\u0275listener("change",function(Y){return y.\u0275\u0275restoreView(p),y.\u0275\u0275resetView(n.onSelectPlan(Y))}),y.\u0275\u0275elementStart(13,"option",11),y.\u0275\u0275text(14),y.\u0275\u0275pipe(15,"translate"),y.\u0275\u0275elementEnd(),y.\u0275\u0275template(16,em,2,3,"option",12),y.\u0275\u0275elementEnd(),y.\u0275\u0275element(17,"div",13),y.\u0275\u0275elementEnd(),y.\u0275\u0275template(18,tm,4,3,"div",14)(19,im,4,3,"div",14),y.\u0275\u0275elementEnd()()()()()()}i&2&&(y.\u0275\u0275property("ngIf",n.isChangingPlanForSomeEmployees),y.\u0275\u0275advance(),y.\u0275\u0275property("formGroup",n.tipEmployeeChangePlanForm),y.\u0275\u0275advance(5),y.\u0275\u0275textInterpolate(y.\u0275\u0275pipeBind1(7,7,"ng.manage-tip-employee.tip-employee-change-plan.tariff-plan")),y.\u0275\u0275advance(8),y.\u0275\u0275textInterpolate(y.\u0275\u0275pipeBind1(15,9,"ng.manage-tip-employee.tip-employee-change-plan.select-value")),y.\u0275\u0275advance(2),y.\u0275\u0275property("ngForOf",n.tariffPlans),y.\u0275\u0275advance(2),y.\u0275\u0275property("ngIf",n.tipEmployeeChangePlanForm.controls.displayPlanName.touched&&n.tipEmployeeChangePlanForm.controls.displayPlanName.hasError("invalid")),y.\u0275\u0275advance(),y.\u0275\u0275property("ngIf",n.tipEmployeeChangePlanForm.controls.displayPlanName.touched&&n.tipEmployeeChangePlanForm.controls.displayPlanName.hasError("required")))},dependencies:[vn.NgForOf,vn.NgIf,ve.\u0275NgNoValidate,ve.NgSelectOption,ve.\u0275NgSelectMultipleOption,ve.SelectControlValueAccessor,ve.NgControlStatus,ve.NgControlStatusGroup,ve.RequiredValidator,ve.FormGroupDirective,ve.FormControlName,$r.TranslatePipe],encapsulation:2})}}return t})();import*as hn from"@angular/core";import*as Zr from"@ngxs/store";var Jr=(()=>{class t extends D{constructor(e){super(),this.store=e}handle(){this.tipActionNameSubscription=this.obs(this.store.select(M.selectedTIPActionName)).subscribe(e=>{switch(e){case u.ADD_SINGLE_TIP_EMPLOYEE:this.createAddSingleEmployeeSteps();break;case u.ADD_MULTIPLE_TIP_EMPLOYEES:this.createUploadEmployeesSteps();break;case u.EDIT_TIP_EMPLOYEES:this.createEditEmployeesSteps();break;case u.RESEND_TIP_INVITE:this.createResendTIPInviteSteps();break;case u.DEACTIVATE_TIP_EMPLOYEES:this.createDeactivateTIPPlanSteps();break;case u.MIGRATE_TIP_PLAN:this.createMigrateTIPPlanSteps();break;case u.REVOKE_TIP_DEACTIVATION:this.createRevokeDeactivationSteps();break;case u.REVOKE_TIP_MIGRATION:this.createRevokeMigrationSteps();break;case u.DELETE_TIP_EMPLOYEES:this.createDeleteTIPEmployeesSteps();break;default:this.removeSteps();break}})}createAddSingleEmployeeSteps(){let e=[];e.push(H.builder(ie.TIP_EMPLOYEE_FORM).withTemplate(K).withComponent(Rr).build()),e.push(H.builder(ie.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()),this.store.dispatch(new ke(e))}createUploadEmployeesSteps(){let e=[];e.push(H.builder(ie.UPLOAD_TIP_EMPLOYEES).withTemplate(K).withComponent(Gr).build()),e.push(H.builder(ie.EDIT_TIP_EMPLOYEES).withTemplate(K).withComponent(Bn).build()),e.push(H.builder(ie.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()),this.store.dispatch(new ke(e))}createEditEmployeesSteps(){let e=[];e.push(H.builder(ie.EDIT_TIP_EMPLOYEES).withTemplate(K).withComponent(Bn).build()),e.push(H.builder(ie.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()),this.store.dispatch(new ke(e))}createResendTIPInviteSteps(){let e=[];e.push(H.builder(ie.TIP_EMPLOYEES_LIST).withTemplate(K).withComponent(Ri).build()),e.push(H.builder(ie.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()),this.store.dispatch(new ke(e))}createDeactivateTIPPlanSteps(){let e=[];e.push(H.builder(ie.TIP_EMPLOYEES_LIST).withTemplate(K).withComponent(Ri).build()),e.push(H.builder(ie.TIP_EMPLOYEE_CHANGE_EFFECTIVE_FROM).withTemplate(K).withComponent(jn).build()),e.push(H.builder(ie.TIP_EMPLOYEE_REVIEW_CHANGES).withTemplate(K).withComponent(_n).build()),e.push(H.builder(ie.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()),this.store.dispatch(new ke(e))}createMigrateTIPPlanSteps(){let e=[];e.push(H.builder(ie.TIP_EMPLOYEES_LIST).withTemplate(K).withComponent(Ri).build()),e.push(H.builder(ie.TIP_EMPLOYEE_CHANGE_PLAN).withTemplate(K).withComponent(Xr).build()),e.push(H.builder(ie.TIP_EMPLOYEE_CHANGE_EFFECTIVE_FROM).withTemplate(K).withComponent(jn).build()),e.push(H.builder(ie.TIP_EMPLOYEE_REVIEW_CHANGES).withTemplate(K).withComponent(_n).build()),e.push(H.builder(ie.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()),this.store.dispatch(new ke(e))}createRevokeDeactivationSteps(){let e=[];e.push(H.builder(ie.TIP_EMPLOYEES_LIST).withTemplate(K).withComponent(Ri).build()),e.push(H.builder(ie.TIP_EMPLOYEE_REVIEW_CHANGES).withTemplate(K).withComponent(_n).build()),e.push(H.builder(ie.TIP_CHANGE_CONFIRMATION).withTemplate(K).withComponent(pt).withFinalState().build()),this.store.dispatch(new ke(e))}createDeleteTIPEmployeesSteps(){this.createRevokeDeactivationSteps()}createRevokeMigrationSteps(){this.createRevokeDeactivationSteps()}unsubscribeTIPActionName(){this.tipActionNameSubscription?.unsubscribe()}removeSteps(){this.store.dispatch(new ke([]))}static{this.\u0275fac=function(i){return new(i||t)(hn.\u0275\u0275inject(Zr.Store))}}
3static{this.\u0275prov=hn.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();import{DOCUMENT as om}from"@angular/common";import{filter as rm,map as am}from"rxjs";var Zt=(function(t){return t.USER_ICON="icon-user",t.SEND_ICON="icon-paper-plane",t.MIGRATE_USER="icon-migrate-user",t.DELETE_USER_ICON="icon-user-delete",t.REVOKE_DELETE_USER_ICON="icon-arrow-counterclockwise-down",t})(Zt||{});import*as C from"@angular/core";import*as Qr from"@ngxs/store";import*as Ci from"@angular/common";import*as ea from"@telenet/ng-lib-ocapi";import*as ta from"@ngx-translate/core";function sm(t,o){if(t&1&&(C.\u0275\u0275elementStart(0,"div",14)(1,"span",15),C.\u0275\u0275element(2,"i",16),C.\u0275\u0275elementEnd(),C.\u0275\u0275elementStart(3,"span",17)(4,"div",18)(5,"h1"),C.\u0275\u0275text(6),C.\u0275\u0275pipe(7,"translate"),C.\u0275\u0275elementEnd()()()()),t&2){let e=C.\u0275\u0275nextContext();C.\u0275\u0275advance(2),C.\u0275\u0275property("ngClass",e.getIconClassName()),C.\u0275\u0275advance(4),C.\u0275\u0275textInterpolate(C.\u0275\u0275pipeBind1(7,2,e.getHeading()))}}function lm(t,o){t&1&&C.\u0275\u0275element(0,"app-tip-title")}function pm(t,o){t&1&&C.\u0275\u0275element(0,"div",19)}function mm(t,o){t&1&&(C.\u0275\u0275elementStart(0,"div"),C.\u0275\u0275element(1,"app-tip-navigation"),C.\u0275\u0275elementEnd())}function cm(t,o){if(t&1&&(C.\u0275\u0275elementContainerStart(0),C.\u0275\u0275element(1,"app-step-container",20),C.\u0275\u0275pipe(2,"async"),C.\u0275\u0275template(3,mm,2,0,"div",9),C.\u0275\u0275elementContainerEnd()),t&2){let e=C.\u0275\u0275nextContext();C.\u0275\u0275advance(),C.\u0275\u0275property("stepFlowAnalyticsConfig",C.\u0275\u0275pipeBind1(2,2,e.getStepFlowAnalyticsConfig())),C.\u0275\u0275advance(2),C.\u0275\u0275property("ngIf",e.renderNavigation())}}var yn=(()=>{class t{constructor(e,i,n,p){this.manageTIPEmployeeStepHandler=e,this.store=i,this.tipDataLayerService=n,this.document=p,this.messageGroupName=W.MESSAGE_GROUP,this.messageGroupNameCustom=W.MESSAGE_GROUP_CUSTOM,this.requiredScopes=W.SCOPES,this.currentStep$=this.store.select($.currentStep),this.selectedTipActionName$=this.store.select(M.selectedTIPActionName)}initAfterLoggedIn(){let e=this.store.selectSnapshot(M.selectedTIPActionName);z(e)&&this.store.dispatch(new he(u.ADD_SINGLE_TIP_EMPLOYEE)),this.store.dispatch(new Tt(!1)),this.manageTIPEmployeeStepHandler.handle(),this.fireAnalyticsFlowStartEvent(),this.document.dispatchEvent(new CustomEvent("overlay:hide-close-icon",{bubbles:!0}))}ngOnInit(){document.body.style.overflow="hidden"}onClose(){this.document.dispatchEvent(new CustomEvent("overlay:close",{bubbles:!0}))}onOverlayClose(){this.store.dispatch(new he(u.EMPTY)),this.store.dispatch(new gt("")),this.manageTIPEmployeeStepHandler.unsubscribeTIPActionName()}getHeading(){let e=this.store.selectSnapshot(M.selectedTIPActionName);switch(e){case u.EDIT_TIP_EMPLOYEES:case u.ADD_SINGLE_TIP_EMPLOYEE:case u.ADD_MULTIPLE_TIP_EMPLOYEES:return"ng.manage-tip-employee.employees";default:return"ng.manage-tip-employee.".concat(e.toLowerCase())}}getIconClassName(){switch(this.store.selectSnapshot(M.selectedTIPActionName)){case u.EDIT_TIP_EMPLOYEES:case u.ADD_SINGLE_TIP_EMPLOYEE:case u.ADD_MULTIPLE_TIP_EMPLOYEES:return Zt.USER_ICON;case u.DEACTIVATE_TIP_EMPLOYEES:return Zt.DELETE_USER_ICON;case u.RESEND_TIP_INVITE:return Zt.SEND_ICON;case u.MIGRATE_TIP_PLAN:return Zt.MIGRATE_USER;case u.REVOKE_TIP_DEACTIVATION:case u.REVOKE_TIP_MIGRATION:return Zt.REVOKE_DELETE_USER_ICON;default:return""}}renderNavigation(){switch(this.store.selectSnapshot(M.selectedTIPActionName)){case u.EDIT_TIP_EMPLOYEES:case u.ADD_SINGLE_TIP_EMPLOYEE:case u.ADD_MULTIPLE_TIP_EMPLOYEES:return!1;default:return this.isNotFinalStep()}}isNotFinalStep(){let e=this.store.selectSnapshot($.currentStep);return e&&!e.isFinal()}getStepFlowAnalyticsConfig(){return this.selectedTipActionName$.pipe(rm(e=>!z(e)),am(()=>this.tipDataLayerService.getCommonEventAttributes()))}ngOnDestroy(){document.body.style.overflow=""}fireAnalyticsFlowStartEvent(){this.tipDataLayerService.fireAnalyticsFlowStartEvent()}static{this.\u0275fac=function(i){return new(i||t)(C.\u0275\u0275directiveInject(Jr),C.\u0275\u0275directiveInject(Qr.Store),C.\u0275\u0275directiveInject(De),C.\u0275\u0275directiveInject(om))}}static{this.\u0275cmp=C.\u0275\u0275defineComponent({type:t,selectors:[["tg-manage-tip-employee"]],hostBindings:function(i,n){i&1&&C.\u0275\u0275listener("overlay:close",function(){return n.onOverlayClose()},C.\u0275\u0275resolveDocument)},inputs:{pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask"},standalone:!1,decls:17,vars:13,consts:[[3,"componentCanRender","messageGroupName","scopes"],[3,"messageGroupName"],[3,"enableLoader","pageType","enableMask"],[1,"tip-overview__overlay","employee-overview"],[1,"overlay-page"],[1,"overlay","tip-add-employee--overlay","background-white","overflow--auto"],[1,"manage-tip-contract--overlay__header","background-white","old-overlay__header","display--flex","flex-direction--column"],[1,"overlay-page-header","overlay-page-header__small","mt--l--sm"],["class","page-title visible align-items--center mt--l mt--n--sm",4,"ngIf"],[4,"ngIf"],["class","divider divider--xxs__very-light-grey",4,"ngIf"],[1,"old-overlay__content-container","background-white"],[1,"container--overlay","mb--n"],[1,"mt--m"],[1,"page-title","visible","align-items--center","mt--l","mt--n--sm"],[1,"mr--m"],[1,"icon","icon-md",3,"ngClass"],[1,"page-title__header"],[1,"cmp","cmp-title"],[1,"divi
3der","divider--xxs__very-light-grey"],[3,"stepFlowAnalyticsConfig"]],template:function(i,n){i&1&&(C.\u0275\u0275elementStart(0,"tg-login",0),C.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),C.\u0275\u0275elementStart(1,"app-message-flow",1),C.\u0275\u0275element(2,"app-loader",2),C.\u0275\u0275elementStart(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7),C.\u0275\u0275template(8,sm,8,4,"div",8),C.\u0275\u0275elementEnd(),C.\u0275\u0275template(9,lm,1,0,"app-tip-title",9),C.\u0275\u0275elementEnd(),C.\u0275\u0275template(10,pm,1,0,"div",10),C.\u0275\u0275elementStart(11,"div",11)(12,"div",12)(13,"div",13),C.\u0275\u0275element(14,"app-message-flow",1),C.\u0275\u0275elementEnd(),C.\u0275\u0275template(15,cm,4,4,"ng-container",9),C.\u0275\u0275pipe(16,"async"),C.\u0275\u0275elementEnd()()()()()()()),i&2&&(C.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.requiredScopes),C.\u0275\u0275advance(),C.\u0275\u0275property("messageGroupName",n.messageGroupName),C.\u0275\u0275advance(),C.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask),C.\u0275\u0275advance(6),C.\u0275\u0275property("ngIf",n.isNotFinalStep()),C.\u0275\u0275advance(),C.\u0275\u0275property("ngIf",n.isNotFinalStep()),C.\u0275\u0275advance(),C.\u0275\u0275property("ngIf",n.isNotFinalStep()),C.\u0275\u0275advance(4),C.\u0275\u0275property("messageGroupName",n.messageGroupNameCustom),C.\u0275\u0275advance(),C.\u0275\u0275property("ngIf",C.\u0275\u0275pipeBind1(16,11,n.selectedTipActionName$)))},dependencies:[Ci.NgClass,Ci.NgIf,Pt,ea.LoginComponent,be,oi,Te,Ei,Ci.AsyncPipe,ta.TranslatePipe],encapsulation:2})}}return t})();var Tm=(t,o)=>({noOfEmployeesViewed:t,totalNoOfEmployees:o}),gm=(t,o)=>o.employeeCustomerNumber+"-"+t;function _m(t,o){if(t&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"div",8)(1,"div",9)(2,"wink-checkbox",10),s.\u0275\u0275listener("change",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.onSelectAllEmployees())}),s.\u0275\u0275element(3,"wink-form-label",11),s.\u0275\u0275pipe(4,"translate"),s.\u0275\u0275elementEnd()(),s.\u0275\u0275elementStart(5,"div",12)(6,"wink-button",13),s.\u0275\u0275pipe(7,"translate"),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.exportAsExcel())})("keydown",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.exportAsExcel())})("keyup",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.exportAsExcel())}),s.\u0275\u0275elementEnd()()()}if(t&2){let e=s.\u0275\u0275nextContext();s.\u0275\u0275advance(2),s.\u0275\u0275property("checked",e.isAllEmployeesSelected),s.\u0275\u0275advance(),s.\u0275\u0275property("label",s.\u0275\u0275pipeBind1(4,3,"ng.tip-employees-overview.btn.select-all")),s.\u0275\u0275advance(3),s.\u0275\u0275property("text",s.\u0275\u0275pipeBind1(7,5,"ng.tip-employees-overview.btn.extract-option"))}}function Im(t,o){t&1&&(s.\u0275\u0275elementStart(0,"div",14)(1,"span",15),s.\u0275\u0275text(2),s.\u0275\u0275pipe(3,"translate"),s.\u0275\u0275elementEnd()()),t&2&&(s.\u0275\u0275advance(2),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(3,1,"ng.tip-employees-overview.lbl.no-search-results")))}function vm(t,o){if(t&1&&s.\u0275\u0275element(0,"app-tip-employee-detail",27),t&2){let e=o.$implicit,i=o.$index;s.\u0275\u0275property("tipEmployee",e)("rowIndex",i)}}function hm(t,o){t&1&&s.\u0275\u0275element(0,"app-tip-employees-sticky-footer")}function ym(t,o){if(t&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"div",16)(1,"div",17),s.\u0275\u0275element(2,"div",18),s.\u0275\u0275elementStart(3,"div",19)(4,"div",20),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.sortTIPEmployees("firstName"))}),s.\u0275\u0275elementStart(5,"p",21),s.\u0275\u0275text(6),s.\u0275\u0275pipe(7,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275element(8,"div",22),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(9,"div",23),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();
3return s.\u0275\u0275resetView(n.sortTIPEmployees("emailAddress"))}),s.\u0275\u0275elementStart(10,"p",21),s.\u0275\u0275text(11),s.\u0275\u0275pipe(12,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275element(13,"div",22),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(14,"div",23),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.sortTIPEmployees("employeeReferenceNumber"))}),s.\u0275\u0275elementStart(15,"p",21),s.\u0275\u0275text(16),s.\u0275\u0275pipe(17,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275element(18,"div",22),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(19,"div",24),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.sortTIPEmployees("status"))}),s.\u0275\u0275elementStart(20,"p",21),s.\u0275\u0275text(21),s.\u0275\u0275pipe(22,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275element(23,"div",22),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(24,"div",25),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.sortTIPEmployees("tipPlanName"))}),s.\u0275\u0275elementStart(25,"p",21),s.\u0275\u0275text(26),s.\u0275\u0275pipe(27,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275element(28,"div",22),s.\u0275\u0275elementEnd(),s.\u0275\u0275elementStart(29,"div",26),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext();return s.\u0275\u0275resetView(n.sortTIPEmployees("activationDate"))}),s.\u0275\u0275elementStart(30,"p",21),s.\u0275\u0275text(31),s.\u0275\u0275pipe(32,"translate"),s.\u0275\u0275elementEnd(),s.\u0275\u0275element(33,"div",22),s.\u0275\u0275elementEnd()()(),s.\u0275\u0275repeaterCreate(34,vm,1,2,"app-tip-employee-detail",27,gm),s.\u0275\u0275template(36,hm,1,0,"app-tip-employees-sticky-footer",28),s.\u0275\u0275pipe(37,"async"),s.\u0275\u0275elementEnd()}if(t&2){let e=s.\u0275\u0275nextContext();s.\u0275\u0275advance(6),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(7,13,"ng.tip-employees-overview.lbl.emp-name")),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngClass",e.getIconClassName("firstName")),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(12,15,"ng.tip-employees-overview.lbl.emp-email")),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngClass",e.getIconClassName("emailAddress")),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(17,17,"ng.tip-employees-overview.lbl.emp-customer-reference")),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngClass",e.getIconClassName("employeeReferenceNumber")),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(22,19,"ng.tip-employees-overview.lbl.emp-status")),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngClass",e.getIconClassName("status")),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(27,21,"ng.tip-employees-overview.lbl.emp-plan-name")),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngClass",e.getIconClassName("tipPlanName")),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate(s.\u0275\u0275pipeBind1(32,23,"ng.tip-employees-overview.lbl.emp-activation-date")),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngClass",e.getIconClassName("activationDate")),s.\u0275\u0275advance(),s.\u0275\u0275repeater(e.filteredTIPEmployees),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngIf",s.\u0275\u0275pipeBind1(37,25,e.selectedTIPEmployees$).length>0)}}function Cm(t,o){if(t&1){let e=s.\u0275\u0275getCurrentView();s.\u0275\u0275elementStart(0,"div",29),s.\u0275\u0275element(1,"div",30),s.\u0275\u0275pipe(2,"translate"),s.\u0275\u0275elementStart(3,"button",31),s.\u0275\u0275listener("click",function(){s.\u0275\u0275restoreView(e);let n=s.\u0275\u0275nextContext(2);return s.\u0275\u0275resetView(n.onClickLoadMore())}),s.\u0275\u0275text(4),s.\u0275\u0275pipe(5,"translate"),s.\u0275\u0275elementEnd()()}if(t&2){let e=s.\u0275\u0275nextContext(2);s.\u0275\u0275advance(),s.\u0275\u0275property("innerHTML",s.\u0275\u0275pipeBind2(2,2,"ng.tip-employees-overview.lbl.no-of-employees-viewed-info",s.\u0275\u0275pureFunction2(7,Tm,e.filteredTIPEmployees.length,e.tipEmployees.length)),s.\u0275\u0275sanitizeHtml),s.\u0275\u0275advance(3),s.\u0275\u0275textInterpolate1("",s.\u0275\u0275pipeBind1(5,5,"ng.tip-employees-overview.btn.load-more")," ")}}function Sm(t,o){if(t&1&&s.\u0275\u0275conditionalCreate(0,Cm,6,10,"div",29),t&2){let e=s.\u0275\u0275nextContext();s.\u0275\u0275conditional(!o&&e.filteredTIPEmployees.length!==e.tipEmployees.length?0:-1)}}function Pm(t,o){if(t&1&&s.\u0275\u0275element(0,"tg-manage-tip-employee",2),t&2){let e=s.\u0275\u0275nextContext();s.\u0275\u0275property("enableLoader",e.enableLoader)("pageType",e.pageType)("enableMask",e.enableMask)}}var oa=(()=>{class t extends D{constructor(e,i,n,p,N,Y){super(),this.store=e,this.cdRef=i,this.exportFileService=n,this.translateService=p,this.messageService=N,this.datePipe=Y,this.noOfEmployeesToShow=Me.DEFAULT_NO_OF_EMPLOYEES_TO_SHOW,this.requiredScopes=Me.SCOPES,this.tipEmployees=[],this.excelHeaderColumnNames=[],this.filteredTIPEmployees=[],this.messageGroupName=Me.MESSAGE_GROUP,this.sortOrder=$e.ASC,this.isAllEmployeesSelected=!1,this.selectedTIPEmployees$=this.store.select(h.selectedTIPEmployees),this.tipEmployeesSearchFilters$=this.store.select(h.tipEmployeesSearchFilters),this.COLUMNS_HEADER_LABELS_KEY=[{field:"fullName",translationKey:"ng.tip-employees-overview.lbl.emp-name"},{field:"emailAddress",translationKey:"ng.tip-employees-overview.lbl.emp-email"},{field:"employeeReferenceNumber",translationKey:"ng.tip-employees-overview.lbl.emp-customer-reference"},{field:"status",translationKey:"ng.tip-employees-overview.lbl.emp-status"},{field:"tipPlanName",translationKey:"ng.tip-employees-overview.lbl.emp-plan-name"},{field:"friendlyPlanName",translationKey:"ng.tip-employees-overview.lbl.emp-friendly-plan-name"},{field:"activationDate",translationKey:"ng.tip-employees-overview.lbl.emp-activation-date"}]}initAfterLoggedIn(){this.getTIPEmployees(),this.setExcelHeaderColumnNames(),this.initShowManageTIPEmployeeOverlay(),this.obs(this.store.select(h.isTIPEmployeeSaved)).subscribe(e=>{e&&this.reloadTIPEmployees()})}initShowManageTIPEmployeeOverlay(){this.obs(this.store.select(M.selectedTIPActionName)).subscribe(e=>
3{this.showManageTIPEmployeeOverlay=!z(e)&&!Rn([u.ADD_SINGLE_TIP_EMPLOYEE,u.ADD_MULTIPLE_TIP_EMPLOYEES],e)})}reloadTIPEmployees(){this.messageService.clearErrorMessages(Me.MESSAGE_GROUP),this.store.dispatch(new bt),this.isAllEmployeesSelected=!1,this.store.dispatch(new it(void 0)),this.sortedBy=void 0,this.getTIPEmployees()}exportAsExcel(){let e={title:"TIP - Employees List",data:this.getExcelFieldValues(),headers:this.excelHeaderColumnNames,worksheetTitle:"TIP Employees"};this.exportFileService.exportAsExcel(e)}initTipEmployeesSearchFilters(){this.obs(this.tipEmployeesSearchFilters$).subscribe(e=>{this.filterTIPEmployees(e)})}filterTIPEmployees(e){if(z(e))this.loadEmployees(parseInt(this.noOfEmployeesToShow,10));else{let i=Object.assign({},e);if(e.searchTerm){delete i.searchTerm;let n=this.getTIPEmployeesFilteredBySearchTerm(e.searchTerm);this.filteredTIPEmployees=re(n,i)}else this.filteredTIPEmployees=re(this.tipEmployees,i)}}onClickLoadMore(){let e=this.filteredTIPEmployees.length+parseInt(this.noOfEmployeesToShow,10);this.loadEmployees(e)}loadEmployees(e){this.filteredTIPEmployees=eo(this.tipEmployees,0,e)}getTIPEmployeesFilteredBySearchTerm(e){return re(this.tipEmployees,i=>i.emailAddress&&i.emailAddress.toLowerCase().includes(e)||i.employeeReferenceNumber&&i.employeeReferenceNumber.toLowerCase().startsWith(e)||i.firstName&&i.firstName.toLowerCase().includes(e)||i.lastName&&i.lastName.toLowerCase().includes(e))}getTIPEmployees(){Em([this.store.dispatch(new zt(this.messageGroupName)),this.store.dispatch(new Et(this.messageGroupName)).pipe(um(()=>fm(void 0)))]).subscribe({next:()=>{this.tipEmployees=this.getEmployeesNotLinkedToDiscontinuedPlan(),Ui(this.tipEmployees,[{normalizedStatus:Oe.DEACTIVATED}],Me.NORMALIZEDSTATUS),z(this.tipEmployees)?this.showTIPEmployeeNotPresentError():this.initTipEmployeesSearchFilters()},error:e=>{this.handleTIPEmployeeNotPresentError()}})}getEmployeesNotLinkedToDiscontinuedPlan(){let e=this.store.selectSnapshot(h.allTIPEmployees),i=this.store.selectSnapshot(B.allTIPContracts),n=[],p=re(i,Y=>Y.normalizedStatus===we.DISCONNECTED),N=Le(p,"planName");return St(e,Y=>{Rn(N,Y.tipPlanName)||n.push(Y)}),n}handleTIPEmployeeNotPresentError(){let e=this.messageService.getMessagesByGroupName(this.messageGroupName);(e&&e[0].key)===Me.ERROR_CODE_TIP_EMPLOYEE_NOT_PRESENT&&this.showTIPEmployeeNotPresentError()}showTIPEmployeeNotPresentError(){this.messageService.clearErrorMessages(Me.MESSAGE_GROUP);let e=new ce(this.messageGroupName,"tip-employees-overview.no-tip-employee-present");this.messageService.addMessage(e)}sortTIPEmployees(e){this.sortOrder=Nt.getSortOrder(this.sortedBy,e,this.sortOrder),this.filteredTIPEmployees=Pi(this.filteredTIPEmployees,[e],[this.sortOrder]),this.tipEmployees=Pi(this.tipEmployees,[e],[this.sortOrder]),this.sortedBy=e,this.cdRef.detectChanges()}getIconClassName(e){return Nt.getSortChevron(this.sortedBy,e,this.sortOrder)}onSelectAllEmployees(){this.isAllEmployeesSelected?this.store.dispatch(new bt):this.store.dispatch(new qt(this.filteredTIPEmployees)),this.isAllEmployeesSelected=!this.isAllEmployeesSelected}translateHeaderTitle(e){return this.translateService.instant(e)}setExcelHeaderColumnNames(){this.COLUMNS_HEADER_LABELS_KEY.forEach(e=>{this.excelHeaderColumnNames.push(this.translateHeaderTitle(e.translationKey))})}getExcelFieldValues(){let e=[];return this.tipEmployees.forEach(i=>{e.push(Object.values(this.mapTipEmployeeToExcelData(i)))}),e}mapTipEmployeeToExcelData(e){let i={};return i.fullName=`${e.firstName} ${e.lastName}`,i.emailAddress=e.emailAddress,i.employeeReferenceNumber=e.employeeReferenceNumber,i.status=e.status,i.tipPlanName=e.tipPlanName,i.friendlyPlanName=e.friendlyPlanName,i.activationDate=this.datePipe.transform(e.activationDate,"dd/MM/yyyy"),i}static{this.\u0275fac=function(i){return new(i||t)(s.\u0275\u0275directiveInject(ia.Store),s.\u0275\u0275directiveInject(s.ChangeDetectorRef),s.\u0275\u0275directiveInject(cr),s.\u0275\u0275directiveInject(Cn.TranslateService),s.\u0275\u0275directiveInject(le),s.\u0275\u0275directiveInject(Dt.DatePipe))}}static{this.\u0275cmp=s.\u0275\u0275defineComponent({type:t,selectors:[["tg-tip-employees-overview"]],inputs:{pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask",noOfEmployeesToShow:"noOfEmployeesToShow"},standalone:!1,features:[s.\u0275\u0275InheritDefinitionFeature],decls:14,vars:19,consts:[[3,"componentCanRender","messageGroupName","scopes"],[3,"messageGroupName"],[3,"enableLoader","pageType","enableMask"],[1,"tip-overview","employee-overview"],["class","employee-overview__select row row--no-gutters flex-direction--column flex-direction--row--sm justify-content--between",4,"ngIf"],["class","notification notification--info ng-scope",4,"ngIf"],["class","employee-overview__row",4,"ngIf"],[3,"enableLoader","pageType","enableMask",4,"ngIf"],[1,"employee-overview__select","row","row--no-gutters","flex-direction--column","flex-direction--row--sm","justify-content--between"],[1,"select-row","row","row--no-gutters","align-items--center","select-row__with-label","pb--s","pb--n--sm"],["name","select-all-employees","id","select-all-employees",3,"change","checked"],["slot","label","rendition","subComponent",3,"label"],[1,"extract-files"],["appearance","secondary","size","sm","icon","download","icon-position","right","element","button","type","file","pointer-event","auto",3,"click","keydown","keyup","text"],[1,"notification","notification--info","ng-scope"],[1,"icon","icon-information-shape","info","ng-scope"],[1,"employee-overview__row"],[1,"label-row","employee-row-item","display--flex","border-radius--md","background--surface-bold-default","margin-y--sm"],[1,"employee-row-item__left"],[1,"employee-row-item__right","employee-row-item__items","display--flex","padding-x--lg","padding-y--md"],[1,"label-column","employee-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--medium",3,"click"],[1,"font--body-small-bold--sm","font--body-regular-bold","margin-bottom--none"],[1,"icon","icon-md","position--relative","mx--xxs",3,"ngClass"],[1,"label-column","employee-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--extra-large",3,"click"],[1,"label-column","employee-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--large",3,"click"],[1,"label-column","employee-row-item__item","display--flex","align-items--center","cursor--pointer","label-column--medium","pr--m",3,"click"],[1,"label-column","employee-row-item__item","display--flex","align-items--center","cursor--pointer",3,"click"],[3,"tipEmployee","rowIndex"],[4,"ngIf"],[1,"employee-overview__load-more","center-align","center-align__column","mt--xxxl"],[1,"text-flow","text-flow--detail","mb--m",3,"innerHTML"],[1,"load-more__btn","button","button--secondary",3,"click"]],template:function(i,n){if(i&1&&(s.\u0275\u0275elementStart(0,"tg-login",0),s.\u0275\u0275listener("componentCanRender",function(){return n.initAfterLoggedIn()}),s.\u0275\u0275elementStart(1,"app-message-flow",1),s.\u0275\u0275element(2,"app-loader",2),s.\u0275\u0275elementStart(3,"div",3),s.\u0275\u0275element(4,"app-tip-employees-search"),s.\u0275\u0275template(5,_m,8,7,"div",4),s.\u0275\u0275pipe(6,"async"),s.\u0275\u0275template(7,Im,4,3,"div",5),s.\u0275\u0275pipe(8,"async"),s.\u0275\u0275template(9,ym,38,27,"div",6),s.\u0275\u0275pipe(10,"async"),s.\u0275\u0275conditionalCreate(11,Sm,1,1),s.\u0275\u0275pipe(12,"async"),s.\u0275\u0275elementEnd()(),s.\u0275\u0275template(13,Pm,1,3,"tg-manage-tip-employee",7),s.\u0275\u0275elementEnd()),i&2){let p;s.\u0275\u0275property("messageGroupName",n.messageGroupName)("scopes",n.requiredScopes),s.\u0275\u0275advance(),s.\u0275\u0275property("messageGroupName",n.messageGroupName),s.\u0275\u0275advance(),s.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask),s.\u0275\u0275advance(3),s.\u0275\u0275property("ngIf",!(s.\u0275\u0275pipeBind1(6,11,n.tipEmployeesSearchFilters$)&&n.filteredTIPEmployees.length===0)),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngIf",s.\u0275\u0275pipeBind1(8,13,n.tipEmployeesSearchFilters$)&&n.filteredTIPEmployees.length===0),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngIf",!(s.\u0275\u0275pipeBind1(10,15,n.tipEmployeesSearchFilters$)&&n.filteredTIPEmployees.length===0)),s.\u0275\u0275advance(2),s.\u0275\u0275conditional((p=s.\u0275\u0275pipeBind1(12,17,n.tipEmployeesSearchFilters$))?11:-1,p),s.\u0275\u0275advance(2),s.\u0275\u0275property("ngIf",n.showManageTIPEmployeeOverlay)}},dependencies:[Dt.NgClass,Dt.NgIf,Pt,na.LoginComponent,be,Be,ei,Lt,Er,vr,Sr,yn,Dt.AsyncPipe,Cn.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@angular/core";import"@ngxs/store";import"@angular/core";import"@ngxs/store";import*as L from"@angular/core";
3import*as ra from"@ngxs/store";import*as aa from"@ngx-translate/core";var sa=(()=>{class t{constructor(e){this.store=e}goToNextStep(){this.store.dispatch(new Ee)}static{this.\u0275fac=function(i){return new(i||t)(L.\u0275\u0275directiveInject(ra.Store))}}static{this.\u0275cmp=L.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-invitation-introduction"]],standalone:!1,decls:30,vars:18,consts:[[1,"px--m--sm","px--n--lg"],[1,"accept-tip-invitation__header"],[1,"accept-tip-invitation__content","mb--xxxg"],[1,"heading--4"],[1,"display--flex","flex-direction--column","flex-direction--row--sm","mt--m"],[1,"col-12","col-lg-11","background-white","p--l"],[1,"row","row--no-gutters","justify-content--between"],[1,"col-12","col-sm-5"],[1,"heading--6","heading--nomargin"],[1,"pt--xl"],[1,"tracker--step__content"],[1,"col-12","col-sm-auto","border--all--r","border-width--all--r","border-style--all--solid","border-color--all--shade_16","my--l","my--n--sm"],[1,"accept-tip-invitation__content__seperator","position--absolute","text--m","background-white","p--m"]],template:function(i,n){i&1&&(L.\u0275\u0275elementStart(0,"div",0)(1,"div",1),L.\u0275\u0275element(2,"app-tip-title"),L.\u0275\u0275elementEnd(),L.\u0275\u0275elementStart(3,"div",2)(4,"div",3),L.\u0275\u0275text(5),L.\u0275\u0275pipe(6,"translate"),L.\u0275\u0275elementEnd(),L.\u0275\u0275elementStart(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),L.\u0275\u0275text(12),L.\u0275\u0275pipe(13,"translate"),L.\u0275\u0275elementEnd(),L.\u0275\u0275elementStart(14,"div",9)(15,"div",10),L.\u0275\u0275text(16),L.\u0275\u0275pipe(17,"translate"),L.\u0275\u0275elementEnd()()(),L.\u0275\u0275elementStart(18,"div",11)(19,"div",12),L.\u0275\u0275text(20),L.\u0275\u0275pipe(21,"translate"),L.\u0275\u0275elementEnd()(),L.\u0275\u0275elementStart(22,"div",7)(23,"div",8),L.\u0275\u0275text(24),L.\u0275\u0275pipe(25,"translate"),L.\u0275\u0275elementEnd(),L.\u0275\u0275elementStart(26,"div",9)(27,"div",10),L.\u0275\u0275text(28),L.\u0275\u0275pipe(29,"translate"),L.\u0275\u0275elementEnd()()()()()()()()),i&2&&(L.\u0275\u0275advance(5),L.\u0275\u0275textInterpolate(L.\u0275\u0275pipeBind1(6,6,"ng.accept-tip-invitation.tip-invitation-introduction.lbl.description")),L.\u0275\u0275advance(7),L.\u0275\u0275textInterpolate(L.\u0275\u0275pipeBind1(13,8,"ng.accept-tip-invitation.tip-invitation-introduction.lbl.client-card.title")),L.\u0275\u0275advance(4),L.\u0275\u0275textInterpolate(L.\u0275\u0275pipeBind1(17,10,"ng.accept-tip-invitation.tip-invitation-introduction.lbl.client-card.step-1.details")),L.\u0275\u0275advance(4),L.\u0275\u0275textInterpolate1(" ",L.\u0275\u0275pipeBind1(21,12,"ng.accept-tip-invitation.tip-invitation-introduction.lbl.or")," "),L.\u0275\u0275advance(4),L.\u0275\u0275textInterpolate(L.\u0275\u0275pipeBind1(25,14,"ng.accept-tip-invitation.tip-invitation-introduction.lbl.non-client-card.title")),L.\u0275\u0275advance(4),L.\u0275\u0275textInterpolate(L.\u0275\u0275pipeBind1(29,16,"ng.accept-tip-invitation.tip-invitation-introduction.lbl.non-client-card.step-1.details")))},dependencies:[Te,aa.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import*as P from"@angular/core";import*as la from"@ngxs/store";import*as Sn from"@angular/common";import*as pa from"@ngx-translate/core";function Nm(t,o){if(t&1&&(P.\u0275\u0275elementStart(0,"div",7)(1,"div",8)(2,"div",9)(3,"span"),P.\u0275\u0275text(4),P.\u0275\u0275pipe(5,"translate"),P.\u0275\u0275elementEnd()(),P.\u0275\u0275elementStart(6,"div",10)(7,"span"),P.\u0275\u0275text(8),P.\u0275\u0275elementEnd()()()()),t&2){let e=P.\u0275\u0275nextContext().ngIf;P.\u0275\u0275advance(4),P.\u0275\u0275textInterpolate(P.\u0275\u0275pipeBind1(5,2,"ng.accept-tip-invitation.tip-invitation-verification.lbl.last-name")),P.\u0275\u0275advance(4),P.\u0275\u0275textInterpolate(e.lastName)}}function Am(t,o){if(t&1&&(P.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),P.\u0275\u0275element(4,"app-tip-title"),P.\u0275\u0275elementEnd(),P.\u0275\u0275elementStart(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8)(9,"div",9)(10,"span"),P.\u0275\u0275text(11),P.\u0275\u0275pipe(12,"translate"),P.\u0275\u0275elementEnd()(),P.\u0275\u0275elementStart(13,"div",10)(14,"span"),P.\u0275\u0275text(15),P.\u0275\u0275elementEnd()()()(),P.\u0275\u0275template(16,Nm,9,4,"div",11),P.\u0275\u0275elementStart(17,"div",7)(18,"div",8)(19,"div",9)(20,"span"),P.\u0275\u0275text(2
31),P.\u0275\u0275pipe(22,"translate"),P.\u0275\u0275elementEnd()(),P.\u0275\u0275elementStart(23,"div",10)(24,"span"),P.\u0275\u0275text(25),P.\u0275\u0275elementEnd()()()(),P.\u0275\u0275elementStart(26,"div",7)(27,"div",8)(28,"div",9)(29,"span"),P.\u0275\u0275text(30),P.\u0275\u0275pipe(31,"translate"),P.\u0275\u0275elementEnd()(),P.\u0275\u0275elementStart(32,"div",10)(33,"span"),P.\u0275\u0275text(34),P.\u0275\u0275elementEnd()()()()()(),P.\u0275\u0275elementStart(35,"div",12),P.\u0275\u0275element(36,"span",13),P.\u0275\u0275elementStart(37,"div")(38,"p"),P.\u0275\u0275text(39),P.\u0275\u0275pipe(40,"translate"),P.\u0275\u0275elementEnd()()()()()()),t&2){let e=o.ngIf;P.\u0275\u0275advance(11),P.\u0275\u0275textInterpolate(P.\u0275\u0275pipeBind1(12,8,"ng.accept-tip-invitation.tip-invitation-verification.lbl.first-name")),P.\u0275\u0275advance(4),P.\u0275\u0275textInterpolate(e.firstName),P.\u0275\u0275advance(),P.\u0275\u0275property("ngIf",e.lastName),P.\u0275\u0275advance(5),P.\u0275\u0275textInterpolate(P.\u0275\u0275pipeBind1(22,10,"ng.accept-tip-invitation.tip-invitation-verification.lbl.customer-reference")),P.\u0275\u0275advance(4),P.\u0275\u0275textInterpolate(e.employeeReferenceNumber),P.\u0275\u0275advance(5),P.\u0275\u0275textInterpolate(P.\u0275\u0275pipeBind1(31,12,"ng.accept-tip-invitation.tip-invitation-verification.lbl.plan-name")),P.\u0275\u0275advance(4),P.\u0275\u0275textInterpolate(e.tipPlanName),P.\u0275\u0275advance(5),P.\u0275\u0275textInterpolate(P.\u0275\u0275pipeBind1(40,14,"ng.accept-tip-invitation.tip-invitation-verification.lbl.customer-info-details-check"))}}var ma=(()=>{class t{constructor(e){this.store=e,this.invitedTIPEmployee$=this.store.select(h.invitedTIPEmployee)}static{this.\u0275fac=function(i){return new(i||t)(P.\u0275\u0275directiveInject(la.Store))}}static{this.\u0275cmp=P.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-invitation-verification"]],standalone:!1,decls:2,vars:3,consts:[["class","tip-invitation--verification mb--g--sm pb--xg",4,"ngIf"],[1,"tip-invitation--verification","mb--g--sm","pb--xg"],[1,"row","justify-content--center","px--m--sm","px--n--lg"],[1,"col-12","col-sm-8","col-md-6","mb--xxxg"],[1,"accept-tip-invitation__header","pb--m"],[1,"accept-tip-invitation__content","background-white","p--l","mb--l"],[1,"row"],[1,"col-12"],[1,"row","mb--m"],[1,"col-12","col-sm-5"],[1,"col-12","col-sm-7"],["class","col-12",4,"ngIf"],[1,"notification","notification--info"],[1,"icon","icon-information-shape","info"]],template:function(i,n){i&1&&(P.\u0275\u0275template(0,Am,41,16,"div",0),P.\u0275\u0275pipe(1,"async")),i&2&&P.\u0275\u0275property("ngIf",P.\u0275\u0275pipeBind1(1,1,n.invitedTIPEmployee$))},dependencies:[Sn.NgIf,Te,Sn.AsyncPipe,pa.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import{of as ca}from"rxjs";import{FormControl as xm,FormGroup as bm,Validators as wm}from"@angular/forms";import*as k from"@angular/core";import*as da from"@ngxs/store";import*as Fe from"@angular/forms";import*as ua from"@ngx-translate/core";function Om(t,o){if(t&1&&(k.\u0275\u0275elementStart(0,"div",8),k.\u0275\u0275element(1,"input",9),k.\u0275\u0275elementStart(2,"div",10)(3,"div",11)(4,"div",12),k.\u0275\u0275element(5,"label",13)(6,"wink-radio-button",14),k.\u0275\u0275pipe(7,"translate"),k.\u0275\u0275elementEnd()()()()),t&2){let e=o.$implicit,i=o.$index,n=k.\u0275\u0275nextContext();k.\u0275\u0275styleProp("--animation-delay",i),k.\u0275\u0275advance(),k.\u0275\u0275property("id",e.id)("value",e.value),k.\u0275\u0275advance(4),k.\u0275\u0275property("for",e.id),k.\u0275\u0275advance(),k.\u0275\u0275property("checked",n.chooseCustomerTypeForm.get("customerType").value===e.value)("label",k.\u0275\u0275pipeBind1(7,8,e.labelKey))("radioButtonId",e.id)}}function Mm(t,o){t&1&&(k.\u0275\u0275elementStart(0,"div",7),k.\u0275\u0275text(1),k.\u0275\u0275pipe(2,"translate"),k.\u0275\u0275elementEnd()),t&2&&(k.\u0275\u0275advance(),k.\u0275\u0275textInterpolate1(" ",k.\u0275\u0275pipeBind1(2,1,"ng.accept-tip-invitation.tip-choose-customer-type.error.customerType.required")," "))}var Ea=(()=>{class t extends D{constructor(e){super(),this.store=e,this.customerTypeOptions=[{id:"choice-existing-customer",labelKey:"ng.accept-tip-invitation.tip-choose-customer-type.lbl.telenet-customer",value:Re.EXISTING_CUSTOMER},{id:"choice-new-customer",labelKey:"ng.accept-tip-invitation.tip-choose-customer-type.lbl.non-telenet-customer",value:Re.NEW_CUSTOMER}],this.store.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){this.chooseCustomerTypeForm=new bm({customerType:new xm("",wm.required)});let e=this.store.selectSnapshot(M.selectedCustomerType);e&&this.customerType.setValue(e)}onDestroy(){this.chooseCustomerTypeForm.removeControl("customerType")}onNext(){return this.chooseCustomerTypeForm.valid?(this.store.dispatch(new Qe(this.customerType.value)),ca(!0)):(this.chooseCustomerTypeForm.markAllAsTouched(),ca(!1))}get customerType(){return this.chooseCustomerTypeForm.get("customerType")}static{this.\u0275fac=function(i){return new(i||t)(k.\u0275\u0275directiveInject(da.Store))}}static{this.\u0275cmp=k.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-choose-customer-type"]],standalone:!1,features:[
3k.\u0275\u0275InheritDefinitionFeature],decls:10,vars:2,consts:[[1,"row","justify-content--center","px--m--sm","px--n--lg"],[3,"formGroup"],[1,"col-12","mb--xxxg"],[1,"accept-tip-invitation__header","pb--m"],[1,"accept-tip-invitation__content","background-white","p--l","mb--l"],["role","radiogroup",1,"label-modifier-box","card-mini","card-mini--radio-circle-box"],[1,"label-modifier-slot","animation-show-slide-up",3,"--animation-delay"],[1,"formErrorInput","text-align--left"],[1,"label-modifier-slot","animation-show-slide-up"],["formControlName","customerType","name","customerType","type","radio",1,"label-modifier-radio",3,"id","value"],[1,"label-modifier--append","label-modifier--container","cursor--pointer"],[1,"label-modifier--body"],[1,"label-modifier--body--inner-container"],[1,"label-modifier-radio__label",3,"for"],[3,"checked","label","radioButtonId"]],template:function(i,n){i&1&&(k.\u0275\u0275elementStart(0,"div",0)(1,"form",1)(2,"div",2)(3,"div",3),k.\u0275\u0275element(4,"app-tip-title"),k.\u0275\u0275elementEnd(),k.\u0275\u0275elementStart(5,"div",4)(6,"div",5),k.\u0275\u0275repeaterCreate(7,Om,8,10,"div",6,k.\u0275\u0275repeaterTrackByIdentity),k.\u0275\u0275conditionalCreate(9,Mm,3,3,"div",7),k.\u0275\u0275elementEnd()()()()()),i&2&&(k.\u0275\u0275advance(),k.\u0275\u0275property("formGroup",n.chooseCustomerTypeForm),k.\u0275\u0275advance(6),k.\u0275\u0275repeater(n.customerTypeOptions),k.\u0275\u0275advance(2),k.\u0275\u0275conditional(n.chooseCustomerTypeForm.touched&&n.chooseCustomerTypeForm.valid===!1?9:-1))},dependencies:[Fe.\u0275NgNoValidate,Fe.DefaultValueAccessor,Fe.RadioControlValueAccessor,Fe.NgControlStatus,Fe.NgControlStatusGroup,Fe.FormGroupDirective,Fe.FormControlName,ii,Te,ua.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@angular/material/dialog";import"@angular/core";import"@angular/material/dialog";import*as O from"@angular/core";import*as fa from"@angular/material/dialog";import*as Ta from"@ngx-translate/core";var ga=(()=>{class t{constructor(e){this.dialogRef=e,this.acceptTIPInvitationConstants=de}closeDialog(){this.dialogRef.close()}getImagePath(e){return Qt.getImagePath(fe.TIP,e)}static{this.\u0275fac=function(i){return new(i||t)(O.\u0275\u0275directiveInject(fa.MatDialogRef))}}static{this.\u0275cmp=O.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-invitation-help-dialog"]],standalone:!1,decls:43,vars:20,consts:[[1,"tip-invitation--help-overlay"],[1,"overlay","overlay--page"],[1,"overlay__mask","opacity--mini-transparency"],[1,"overlay__section"],[1,"overlay__section__content","py--xl--md","overflow--visible"],[1,"overlay__section__content__close",3,"click"],[1,"icon","icon-cross"],[1,"overlay__section__content__description"],[1,"row","row--no-gutters","flex-direction--column","align-items--center","mt--xxxl"],[1,"col-12","col-sm-10","col-md-8","col-lg-7","shadow--xs","mb--xl"],[1,"row","row--no-gutters","align-items--scratch","justify-content--center","p--l","p--xxl--md"],[1,"col-12","col-sm-8","col-md-8"],[1,"text--l","text-weight--g","line-height--28","mb--xl","text-align--center"],[1,"col-12","col-sm-5","pb--m","pb--n--sm"],[1,"Container","Container--default","background-shade_04"],[1,"tip-invitation--help-overlay__image","text-align--center","border--b--r","border-width--b--r","border-style--b--solid","border-color--b--shade_24","py--l"],[3,"inlineSVG"],[1,"tip-invitation--help-overlay__body","text-align--left","pt--m","pr--l","pb--xl","pl--l"],[1,"text--xm","text-weight--g"],[1,"mt--xxs","pl--m"],[1,"text--m"],[1,"col-12","col-sm-auto","align-self--center"],[1,"text--xm","text-align--center","p--l"]],template:function(i,n){i&1&&(O.\u0275\u0275elementStart(0,"div",0)(1,"div",1),O.\u0275\u0275element(2,"div",2),O.\u0275\u0275elementStart(3,"div",3)(4,"div",4)(5,"div",5),O.\u0275\u0275listener("click",function(){return n.closeDialog()}),O.\u0275\u0275element(6,"div",6),O.\u0275\u0275elementEnd(),O.\u0275\u0275elementStart(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"div",11)(12,"div",12),O.\u0275\u0275text(13),O.\u0275\u0275pipe(14,"translate"),O.\u0275\u0275elementEnd()(),O.\u0275\u0275elementStart(15,"div",13)(16,"div",14)(17,"div",15),O.\u0275\u0275element(18,"div",16),O.\u0275\u0275elementEnd(),O.\u0275\u0275elementStart(19,"div",17)(20,"div",18),O.\u0275\u0275text(2
31),O.\u0275\u0275pipe(22,"translate"),O.\u0275\u0275elementEnd(),O.\u0275\u0275elementStart(23,"ul",19)(24,"li",20),O.\u0275\u0275text(25),O.\u0275\u0275pipe(26,"translate"),O.\u0275\u0275elementEnd()()()()(),O.\u0275\u0275elementStart(27,"div",21)(28,"div",22),O.\u0275\u0275text(29),O.\u0275\u0275pipe(30,"translate"),O.\u0275\u0275elementEnd()(),O.\u0275\u0275elementStart(31,"div",13)(32,"div",14)(33,"div",15),O.\u0275\u0275element(34,"div",16),O.\u0275\u0275elementEnd(),O.\u0275\u0275elementStart(35,"div",17)(36,"div",18),O.\u0275\u0275text(37),O.\u0275\u0275pipe(38,"translate"),O.\u0275\u0275elementEnd(),O.\u0275\u0275elementStart(39,"ul",19)(40,"li",20),O.\u0275\u0275text(41),O.\u0275\u0275pipe(42,"translate"),O.\u0275\u0275elementEnd()()()()()()()()()()()()()),i&2&&(O.\u0275\u0275advance(13),O.\u0275\u0275textInterpolate1(" ",O.\u0275\u0275pipeBind1(14,8,"ng.accept-tip-invitation.tip-invitation-help-dialog.lbl.title")," "),O.\u0275\u0275advance(5),O.\u0275\u0275property("inlineSVG",n.getImagePath(n.acceptTIPInvitationConstants.ONLINE_ACCOUNT_LOGO)),O.\u0275\u0275advance(3),O.\u0275\u0275textInterpolate1(" ",O.\u0275\u0275pipeBind1(22,10,"ng.accept-tip-invitation.tip-invitation-help-dialog.lbl.title.card-1")),O.\u0275\u0275advance(4),O.\u0275\u0275textInterpolate1(" ",O.\u0275\u0275pipeBind1(26,12,"ng.accept-tip-invitation.tip-invitation-help-dialog.lbl.description.card-1")," "),O.\u0275\u0275advance(4),O.\u0275\u0275textInterpolate1(" ",O.\u0275\u0275pipeBind1(30,14,"ng.accept-tip-invitation.tip-invitation-help-dialog.lbl.or")),O.\u0275\u0275advance(5),O.\u0275\u0275property("inlineSVG",n.getImagePath(n.acceptTIPInvitationConstants.TOP_OF_YOUR_INVOICE_LOGO)),O.\u0275\u0275advance(3),O.\u0275\u0275textInterpolate1(" ",O.\u0275\u0275pipeBind1(38,16,"ng.accept-tip-invitation.tip-invitation-help-dialog.lbl.title.card-2")),O.\u0275\u0275advance(4),O.\u0275\u0275textInterpolate1(" ",O.\u0275\u0275pipeBind1(42,18,"ng.accept-tip-invitation.tip-invitation-help-dialog.lbl.description.card-2")," "))},dependencies:[qi,Ta.TranslatePipe],encapsulation:2})}}return t})();import{of as Di}from"rxjs";import"@ngxs/store";import{FormControl as _a,FormGroup as Rm,Validators as Pn}from"@angular/forms";var Si=(function(t){return t.CLIENT_NUMBER="clientNumber",t.BILLING_ACCOUNT_NUMBER="billingAccountNumber",t})(Si||{});var Nn=class t extends Rm{constructor(o){super(o)}static build(){let o=new t({});return o.addControl(Si.CLIENT_NUMBER,new _a("",[Pn.required,Pn.pattern(dt.NUMBER_ONLY_REGEX)])),o.addControl(Si.BILLING_ACCOUNT_NUMBER,new _a("",[Pn.required,Pn.pattern(dt.NUMBER_ONLY_REGEX)])),o}get clientNumber(){return this.get(Si.CLIENT_NUMBER).value}get billingAccountNumber(){return this.get(Si.BILLING_ACCOUNT_NUMBER).value}};import*as g from"@angular/core";import*as Ia from"@angular/material/dialog";import*as va from"@ngxs/store";import*as ha from"@angular/common";import*as ze from"@angular/forms";import*as ya from"@ngx-translate/core";function Dm(t,o){t&1&&(g.\u0275\u0275elementStart(0,"div",19),g.\u0275\u0275text(1),g.\u0275\u0275pipe(2,"translate"),g.\u0275\u0275elementEnd()),t&2&&(g.\u0275\u0275advance(),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind1(2,1,"ng.accept-tip-invitation.tip-identify-customer.error.client-no.required")," "))}function Fm(t,o){t&1&&(g.\u0275\u0275elementStart(0,"div",19),g.\u0275\u0275text(1),g.\u0275\u0275pipe(2,"translate"),g.\u0275\u0275elementEnd()),t&2&&(g.\u0275\u0275advance(),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind1(2,1,"ng.accept-tip-invitation.tip-identify-customer.error.client-no.invalid")," "))}function Lm(t,o){if(t&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275template(1,Dm,3,3,"div",18)(2,Fm,3,3,"div",18),g.\u0275\u0275elementContainerEnd()),t&2){let e=g.\u0275\u0275nextContext();g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",e.identifyCustomerForm.controls.clientNumber.hasError("required")),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",!e.identifyCustomerForm.controls.clientNumber.hasError("required"))}}function km(t,o){t&1&&(g.\u0275\u0275elementStart(0,"div",19),g.\u0275\u0275text(1),g.\u0275\u0275pipe(2,"translate"),g.\u0275\u0275elementEnd()),t&2&&(g.\u0275\u0275advance(),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind1(2,1,"ng.accept-tip-invitation.tip-identify-customer.error.account-no.required")," "))}function Gm(t,o){t&1&&(g.\u0275\u0275elementStart(0,"div",19),g.\u0275\u0275text(1),g.\u0275\u0275pipe(2,"translate"),g.\u0275\u0275elementEnd()),t&2&&(g.\u0275\u0275advance(),g.\u0275\u0275textInterpolate1(" ",g.\u0275\u0275pipeBind1(2,1,"ng.accept-tip-invitation.tip-identify-customer.error.account-no.invalid")," "))}function Um(t,o){if(t&1&&(g.\u0275\u0275elementContainerStart(0),g.\u0275\u0275template(1,km,3,3,"div",18)(2,Gm,3,3,"div",18),g.\u0275\u0275elementContainerEnd()),t&2){let e=g.\u0275\u0275nextContext();g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",e.identifyCustomerForm.controls.billingAccountNumber.hasError("required")),g.\u0275\u0275advance(),g.\u0275\u0275property("ngIf",!e.identifyCustomerForm.controls.billingAccountNumber.hasError("required"))}}var Ca=(()=>{class t{constructor(e,i,n,p,N){this.dialog=e,this.store=i,this.messageService=n,this.promotionService=p,this.tipMessagingService=N,this.messageGroupNameNonBlockingError=de.MESSAGE_GROUP_NAME_NON_BLOCKING_ERROR,this.verificationAttemptCount=0,this.store.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this)}ngOnInit(){this.messageService.clearErrorMessages(this.messageGroupNameNonBlockingError),this.identifyCustomerForm=Nn.build()}openInvitationHelpDialog(){this.dialog.open(ga)}onNext(){return this.identifyCustomerForm.valid?this.verifyTIPCustomerDetails():(this.identifyCustomerForm.markAllAsTouched(),Di(!1))}verifyTIPCustomerDetails(){this.messageService.clearErrorMessages(de.MESSAGE_GROUP_NAME_NON_BLOCKING_ERROR),this.store.dispatch(new It(this.getTIPEmployeeDetails()));let e=this.createVerifyTIPEmployeeDetailsPayload();return this.store.dispatch(new Kt(e)).subscribe({next:()=>(this.store.dispatch(new Qe(Re.EXISTING_DARWIN_CUSTOMER)),this.store.dispatch(new Ee),Di(!0)),error:i=>{this.handleInvalidAccount()}}),Di(!1)}getTIPEmployeeDetails(){let e=this.store.selectSnapshot(h.invitedTIPEmployee);return e.employeeCustomerNumber=this.identifyCustomerForm.clientNumber,e.billingAccountNumber=this.identifyCustomerForm.billingAccountNumber,e}handleInvalidAccount(){let e=this.messageService.getMessagesByGroupName(this.messageGroupNameNonBlockingError),i=e&&e[0].key;if(i===de.ERROR_CODE_FOR_INVALID_ACCOUNT_DETAILS||i===de.ERROR_CODE_FOR_INVALID_CUSTOMER_NUMBER)if(++this.verificationAttemptCount,this.messageService.clearErrorMessages(de.MESSAGE_GROUP_NAME_NON_BLOCKING_ERROR),this.verificationAttemptCount<2){let n=new ce(this.messageGroupNameNonBlockingError,"accept-tip-invitation.invalid-account-details");this.messageService.addMessage(n)}else switch(i){case de.ERROR_CODE_FOR_INVALID_ACCOUNT_DETAILS:this.store.dispatch(new Qe(Re.EXISTING_DARWIN_CUSTOMER_WITH_WRONG_BILLING_ACCOUNT));let n=this.tipMessagingService.getMessage(u.ACCEPT_TIP_INVITATION,S.FAILURE);this.store.dispatch(new me(n)),this.store.dispatch(new Ee);break;case de.ERROR_CODE_FOR_INVALID_CUSTOMER_NUMBER:this.store.dispatch(new Qe(Re.MAYBE_LEGACY_CUSTOMER)),this.activateTIPPlan();break}}createVerifyTIPEmployeeDetailsPayload(){return{messageGroupName:de.MESSAGE_GROUP_NAME_NON_BLOCKING_ERROR,billingAccountNumber:this.identifyCustomerForm.billingAccountNumber,customerAccountNumber:this.identifyCustomerForm.clientNumber}}activateTIPPlan(){let e=this.store.selectSnapshot(h.invitedTIPEmployee),i=this.createActivateTIPPlanPayload(e),n=e.employerCustomerNo;return this.promotionService.activateTIPPlan(this.messageGroupNameNonBlockingError,n,i).subscribe({next:()=>{let p=this.tipMessagingService.getMessage(u.ACCEPT_TIP_INVITATION,S.SUCCESS_LEGACY);return this.store.dispatch(new me(p)),this.store.dispatch(new Ee),Di(!0)},error:p=>{let N=this.tipMessagingService.getMessage(u.ACCEPT_TIP_INVITATION,S.FAILURE_LEGACY);this.store.dispatch(new me(N)),this.store.dispatch(new Ee)}}),Di(!1)}createActivateTIPPlanPayload(e){return{employeeCustomerNumber:e.employeeCustomerNumber,employeeBillingNumber:e.billingAccountNumber,planName:e.tipPlanName,employeeUniqueId:e.employeeUniqueID,employeeReferenceNumber:e.employeeReferenceNumber}}static{this.\u0275fac=function(i){return new(i||t)(g.\u0275\u0275directiveInject(Ia.MatDialog),g.\u0275\u0275directiveInject(va.Store),g.\u0275\u0275directiveInject(le),g.\u0275\u0275directiveInject(pe),g.\u0275\u0275directiveInject(Ce))}}static{this.\u0275cmp=g.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-identify-customer"]],standalone:!1,decls:28,vars:10,consts:[["clientNumber",""],["billingAccountNumber",""],[1,"row","justify-content--center","px--m--sm","px--n--lg"],[3,"formGroup"],[1,"mb--xxxg"],[1,"accept-tip-invitation__header","pb--m"],[1,"mt--xxxl--md"],[3,"messageGroupName"],[1,"accept-tip-invitation__content","background-white","p--l"],[1,"form-group","mb--l"],["for","client-number"],[1,"icon","icon-sm","icon-information-shape","ml--xxxs",3,"click"],[1,"form__input-container"],["type","text","id","client-number","formControlName","clientNumber",1,"form__input","form-control"],[4,"ngIf"],[1,"form-group"],["for","account-number"],["type","text","id","account-number","formControlName","billingAccountNumber",1,"form__input","form-control"],["class","formErrorInput text-align--left",4,"ngIf"],[1,"formErrorInput","text-align--left"]],template:function(i,n){if(i&1){let p=g.\u0275\u0275getCurrentView();g.\u0275\u0275elementStart(0,"div",2)(1,"form",3)(2,"div",4)(3,"div",5),g.\u0275\u0275element(4,"app-tip-title"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(5,"div",6),g.\u0275\u0275element(6,"app-message-flow",7),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(7,"div",8)(8,"div",9)(9,"div")(10,"label",10),g.\u0275\u0275text(11),g.\u0275\u0275pipe(12,"translate"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(13,"i",11),g.\u0275\u0275listener("click",function(){return g.\u0275\u0275restoreView(p),g.\u0275\u0275resetVie
3w(n.openInvitationHelpDialog())}),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(14,"div",12),g.\u0275\u0275element(15,"input",13,0),g.\u0275\u0275elementEnd(),g.\u0275\u0275template(17,Lm,3,2,"ng-container",14),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(18,"div",15)(19,"div")(20,"label",16),g.\u0275\u0275text(21),g.\u0275\u0275pipe(22,"translate"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(23,"i",11),g.\u0275\u0275listener("click",function(){return g.\u0275\u0275restoreView(p),g.\u0275\u0275resetView(n.openInvitationHelpDialog())}),g.\u0275\u0275elementEnd()(),g.\u0275\u0275elementStart(24,"div",12),g.\u0275\u0275element(25,"input",17,1),g.\u0275\u0275elementEnd(),g.\u0275\u0275template(27,Um,3,2,"ng-container",14),g.\u0275\u0275elementEnd()()()()()}i&2&&(g.\u0275\u0275advance(),g.\u0275\u0275property("formGroup",n.identifyCustomerForm),g.\u0275\u0275advance(5),g.\u0275\u0275property("messageGroupName",n.messageGroupNameNonBlockingError),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(12,6,"ng.accept-tip-invitation.tip-identify-customer.lbl.client-no")),g.\u0275\u0275advance(6),g.\u0275\u0275property("ngIf",n.identifyCustomerForm.controls.clientNumber.touched&&n.identifyCustomerForm.controls.clientNumber.errors),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(g.\u0275\u0275pipeBind1(22,8,"ng.accept-tip-invitation.tip-identify-customer.lbl.account-no")),g.\u0275\u0275advance(6),g.\u0275\u0275property("ngIf",n.identifyCustomerForm.controls.billingAccountNumber.touched&&n.identifyCustomerForm.controls.billingAccountNumber.errors))},dependencies:[ha.NgIf,ze.\u0275NgNoValidate,ze.DefaultValueAccessor,ze.NgControlStatus,ze.NgControlStatusGroup,ze.FormGroupDirective,ze.FormControlName,be,Te,ya.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import*as j from"@angular/core";import*as Sa from"@ngxs/store";import*as An from"@angular/common";import*as Pa from"@ngx-translate/core";function Vm(t,o){if(t&1&&(j.\u0275\u0275elementStart(0,"div",1)(1,"div",2)(2,"div",3),j.\u0275\u0275element(3,"app-tip-title"),j.\u0275\u0275elementEnd(),j.\u0275\u0275elementStart(4,"div",4)(5,"div",5),j.\u0275\u0275element(6,"i",6),j.\u0275\u0275elementEnd(),j.\u0275\u0275elementStart(7,"div",7),j.\u0275\u0275text(8),j.\u0275\u0275elementEnd(),j.\u0275\u0275elementStart(9,"div",8),j.\u0275\u0275text(10),j.\u0275\u0275elementEnd(),j.\u0275\u0275elementStart(11,"div",9),j.\u0275\u0275text(12),j.\u0275\u0275pipe(13,"translate"),j.\u0275\u0275elementEnd()()()()),t&2){let e=o.ngIf;j.\u0275\u0275advance(8),j.\u0275\u0275textInterpolate2("",e.firstName," ",e.lastName),j.\u0275\u0275advance(2),j.\u0275\u0275textInterpolate(e.billingAccountNumber),j.\u0275\u0275advance(2),j.\u0275\u0275textInterpolate(j.\u0275\u0275pipeBind1(13,4,"ng.accept-tip-invitation.tip-customer-details.lbl.account-number"))}}var Na=(()=>{class t extends D{constructor(e){super(),this.store=e,this.verifiedTIPEmployee$=this.store.select(h.verifiedTIPEmployee)}static{this.\u0275fac=function(i){return new(i||t)(j.\u0275\u0275directiveInject(Sa.Store))}}static{this.\u0275cmp=j.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-customer-details"]],standalone:!1,features:[j.\u0275\u0275InheritDefinitionFeature],decls:2,vars:3,consts:[["class","row justify-content--center px--m--sm px--n--lg",4,"ngIf"],[1,"row","justify-content--center","px--m--sm","px--n--lg"],[1,"col-12","col-sm-8","col-md-6","mb--xxxg"],[1,"accept-tip-invitation__header","pb--m","mt--l","mt--xxxl--md"],[1,"accept-tip-invitation__content","background-white","p--l","mb--l",2,"align-items","center","display","flex","flex-direction","column"],[1,"tip-invitation--verification__icon"],[1,"icon","icon-md","icon-user","text-weight--g"],[1,"heading--5"],[1,"heading--6"],[1,"text--m"]],template:function(i,n){i&1&&(j.\u0275\u0275template(0,Vm,14,6,"div",0),j.\u0275\u0275pipe(1,"async")),i&2&&j.\u0275\u0275property("ngIf",j.\u0275\u0275pipeBind1(1,1,n.verifiedTIPEmployee$))},dependencies:[An.NgIf,Te,An.AsyncPipe,Pa.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import{ConfigConstants as Bm}from"@telenet/ng-lib-config";import"@ngxs/store";import{of as bn}from"rxjs";var Fi=(function(t){return t.TIP_INVITATION_CAN_NOT_BE_ACTIVATED_ERROR="ocapi.403-E4030",t.TIP_INVITATION_IS_USED_FOR_ANOTHER_BILLING_ACCOUNT_ERROR="ocapi.403-E4031",t.TIP_PLAN_ALREADY_ACTIVE_ON_THIS_CUSTOMER_NUMBER_ERROR="ocapi.403-E4032",t})(Fi||{});var xn=class{static showCorrespondingErrorMessage(o,e){let i=o.getMessagesByGroupName(e);switch(i&&i[0].key){case Fi.TIP_INVITATION_CAN_NOT_BE_ACTIVATED_ERROR:this.showErrorMessage(o,e,"accept-tip-invitation.tip-employee-deactivated-or-pending-deactivation");break;case Fi.TIP_INVITATION_IS_USED_FOR_ANOTHER_BILLING_ACCOUNT_ERROR:this.showErrorMessage(o,e,"accept-tip-invitation.tip-employee-used-for-another-billing-account");break;case Fi.TIP_PLAN_ALREADY_ACTIVE_ON_THIS_CUSTOMER_NUMBER_ERROR:this.showErrorMessage(o,e,"accept-tip-invitation.tip-plan-already-active-on-this-customer-number");break}}static showErrorMessage(o,e,i){o.clearErrorMessages(e);let n=new ce(e,i);o.addMessage(n)}};import*as v from"@angular/core";
3import*as Aa from"@ngxs/store";import*as xa from"@telenet/ng-lib-config";import*as ba from"@angular/common";import*as wa from"@ngx-translate/core";function Ym(t,o){t&1&&(v.\u0275\u0275elementStart(0,"div",16)(1,"div",17),v.\u0275\u0275text(2),v.\u0275\u0275pipe(3,"translate"),v.\u0275\u0275elementEnd()()),t&2&&(v.\u0275\u0275advance(2),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind1(3,1,"ng.accept-tip-invitation.lbl.tnc.required")," "))}function jm(t,o){if(t&1){let e=v.\u0275\u0275getCurrentView();v.\u0275\u0275elementContainerStart(0),v.\u0275\u0275elementStart(1,"div",3)(2,"div",4),v.\u0275\u0275element(3,"app-tip-title"),v.\u0275\u0275elementEnd(),v.\u0275\u0275elementStart(4,"div",5),v.\u0275\u0275element(5,"app-message-flow",1),v.\u0275\u0275elementEnd(),v.\u0275\u0275elementStart(6,"div",6)(7,"div",7),v.\u0275\u0275element(8,"span",8),v.\u0275\u0275elementStart(9,"div")(10,"p"),v.\u0275\u0275text(11),v.\u0275\u0275pipe(12,"translate"),v.\u0275\u0275elementEnd()()(),v.\u0275\u0275elementStart(13,"div",9)(14,"div")(15,"div",10)(16,"input",11),v.\u0275\u0275listener("change",function(n){v.\u0275\u0275restoreView(e);let p=v.\u0275\u0275nextContext();return v.\u0275\u0275resetView(p.onTnCChange(n))}),v.\u0275\u0275elementEnd(),v.\u0275\u0275elementStart(17,"label",12),v.\u0275\u0275text(18,"\xA0"),v.\u0275\u0275elementEnd()(),v.\u0275\u0275elementStart(19,"label",13),v.\u0275\u0275text(20),v.\u0275\u0275pipe(21,"translate"),v.\u0275\u0275elementStart(22,"a",14),v.\u0275\u0275listener("click",function(n){v.\u0275\u0275restoreView(e);let p=v.\u0275\u0275nextContext();return v.\u0275\u0275resetView(p.openTermsAndConditionLink(n))}),v.\u0275\u0275text(23),v.\u0275\u0275pipe(24,"translate"),v.\u0275\u0275elementEnd()(),v.\u0275\u0275template(25,Ym,4,3,"div",15),v.\u0275\u0275elementEnd()()()(),v.\u0275\u0275elementContainerEnd()}if(t&2){let e=v.\u0275\u0275nextContext();v.\u0275\u0275advance(5),v.\u0275\u0275property("messageGroupName",e.messageGroupNameNonBlockingError),v.\u0275\u0275advance(6),v.\u0275\u0275textInterpolate(v.\u0275\u0275pipeBind1(12,5,"ng.accept-tip-invitation.tip-accept-terms-and-conditions.lbl.description")),v.\u0275\u0275advance(9),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind1(21,7,"ng.accept-tip-invitation.tip-accept-terms-and-conditions.lbl.checkbox-label-part-1")," "),v.\u0275\u0275advance(3),v.\u0275\u0275textInterpolate1(" ",v.\u0275\u0275pipeBind1(24,9,"ng.accept-tip-invitation.tip-accept-terms-and-conditions.lbl.checkbox-label-part-2")," "),v.\u0275\u0275advance(2),v.\u0275\u0275property("ngIf",e.showTnCNotAcceptedError)}}function Wm(t,o){t&1&&(v.\u0275\u0275elementContainerStart(0),v.\u0275\u0275element(1,"app-tip-messaging"),v.\u0275\u0275elementContainerEnd())}var Oa=(()=>{class t extends D{constructor(e,i,n,p,N,Y){super(),this.store=e,this.configService=i,this.urlService=n,this.messageService=p,this.promotionService=N,this.tipMessagingService=Y,this.messageGroupName=de.MESSAGE_GROUP_NAME,this.messageGroupNameNonBlockingError=de.MESSAGE_GROUP_NAME_NON_BLOCKING_ERROR,this.isTIPContractMissing=!1,this.isTIPContractAvailabilityCheckDone=!1,this.isTermsAndConditionsAccepted=!1,this.showTnCNotAcceptedError=!1,this.store.selectSnapshot($.currentStep).nextButtonCallback=this.onNext.bind(this),this.store.selectSnapshot($.currentStep).prevButtonCallback=this.onPrevious.bind(this)}ngOnInit(){this.messageService.clearErrorMessages(this.messageGroupNameNonBlockingError),this.checkTIPContractAvailabilityStatus()}onNext(){return this.isTermsAndConditionsAccepted?(this.showTnCNotAcceptedError=!1,this.activateTIPPlan()):(this.showTnCNotAcceptedError=!0,bn(!1))}onPrevious(){return this.store.dispatch(new me(void 0)),bn(!0)}onTnCChange(e){this.isTermsAndConditionsAccepted=e.target.checked,this.showTnCNotAcceptedError=!this.isTermsAndConditionsAccepted}activateTIPPlan(){let e=this.store.selectSnapshot(h.invitedTIPEmployee),i=this.createActivateTIPPlanPayload(e),n=e.employerCustomerNo;return this.promotionService.activateTIPPlan(this.messageGroupNameNonBlockingError,n,i).subscribe({next:()=>{let p=this.tipMessagingService.getMessage(u.ACCEPT_TIP_INVITATION,S.SUCCESS);return this.store.dispatch(new me(p)),this.store.dispatch(new Ee),bn(!0)},error:()=>{xn.showCorrespondingErrorMessage(this.messageService,this.messageGroupNameNonBlockingError)}}),bn(!1)}createActivateTIPPlanPayload(e){return{employeeCustomerNumber:e.employeeCustomerNumber,employeeBillingNumber:e.billingAccountNumber,planName:e.tipPlanName,employeeUniqueId:e.employeeUniqueID,employeeReferenceNumber:e.employeeReferenceNumber}}openTermsAndConditionLink(e){e.preventDefault();let i=this.store.selectSnapshot(h.invitedTIPEmployee),n=this.store.selectSnapshot(B.selectedTIPContract),p=this.configService.getConfig(Bm.OCAPI_URl);
3p=p&&p.concat(Ge.PROMOTION_SERVICE_PREFIX).concat(Ge.API_VERSION_V1).concat(Ge.CONTEXT_TIP).concat(n.customerProductId).concat(Ge.TERMS_AND_CONDITIONS_PDF).concat(`?${Ge.QUERY_PARAM_CUSTOMER_ACCOUNT_NUMBER}=${i.employerCustomerNo}`),this.urlService.openNewTab(p)}checkTIPContractAvailabilityStatus(){let e=this.store.selectSnapshot(h.invitedTIPEmployee),i=this.store.selectSnapshot(B.selectedTIPContract);this.promotionService.getTIPContractPDFAvailabilityStatus(this.messageGroupName,i.customerProductId,e.employerCustomerNo).subscribe({next:()=>{this.isTIPContractMissing=!1,this.isTIPContractAvailabilityCheckDone=!0},error:()=>{this.isTIPContractAvailabilityCheckDone=!0,this.handleCheckTIPContractAvailabilityStatusError(),this.store.dispatch(new Je(!1))}})}handleCheckTIPContractAvailabilityStatusError(){let e=this.messageService.getMessagesByGroupName(this.messageGroupName),i=e&&e[0].key;if(this.messageService.clearErrorMessages(this.messageGroupName),i===de.ERROR_CODE_TIP_CONTRACT_PDF_NOT_FOUND){let n=this.tipMessagingService.getMessage(u.ACCEPT_TIP_INVITATION,S.MISSING_CONTRACT);this.store.dispatch(new me(n)),this.isTIPContractMissing=!0}else{let n=new ce(this.messageGroupName,"accept-tip-invitation.check-tip-contract-availability-failed");this.messageService.addMessage(n)}}static{this.\u0275fac=function(i){return new(i||t)(v.\u0275\u0275directiveInject(Aa.Store),v.\u0275\u0275directiveInject(xa.ConfigService),v.\u0275\u0275directiveInject(Ve),v.\u0275\u0275directiveInject(le),v.\u0275\u0275directiveInject(pe),v.\u0275\u0275directiveInject(Ce))}}static{this.\u0275cmp=v.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-accept-terms-and-condition"]],standalone:!1,features:[v.\u0275\u0275InheritDefinitionFeature],decls:4,vars:3,consts:[[1,"row","justify-content--center","px--m--sm","px--n--lg"],[3,"messageGroupName"],[4,"ngIf"],[1,"col-12","mb--xxxg"],[1,"accept-tip-invitation__header","pb--m","mt--l","mt--xxxl--md"],[1,"mb--l"],[1,"accept-tip-invitation__content","background-white","p--l","mb--l"],[1,"notification","notification--info"],[1,"icon","icon-information-shape","info"],[1,"text-align--left","mt--l"],[1,"form__checkbox"],["type","checkbox","id","acceptTnC","name","acceptTnC",1,"form__checkbox__input",3,"change"],["for","acceptTnC",1,"form__checkbox__label"],["for","acceptTnC",1,"label--large"],["href","",1,"link","underline",3,"click"],["class","formErrorInput mb-5",4,"ngIf"],[1,"formErrorInput","mb-5"],[1,"color-red"]],template:function(i,n){i&1&&(v.\u0275\u0275elementStart(0,"div",0)(1,"app-message-flow",1),v.\u0275\u0275template(2,jm,26,11,"ng-container",2)(3,Wm,2,0,"ng-container",2),v.\u0275\u0275elementEnd()()),i&2&&(v.\u0275\u0275advance(),v.\u0275\u0275property("messageGroupName",n.messageGroupName),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",!n.isTIPContractMissing&&n.isTIPContractAvailabilityCheckDone),v.\u0275\u0275advance(),v.\u0275\u0275property("ngIf",n.isTIPContractMissing&&n.isTIPContractAvailabilityCheckDone))},dependencies:[ba.NgIf,be,Te,qe,wa.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import*as V from"@angular/core";import*as Ma from"@ngxs/store";import*as Ra from"@angular/common";import*as Da from"@ngx-translate/core";function qm(t,o){if(t&1){let e=V.\u0275\u0275getCurrentView();V.\u0275\u0275elementStart(0,"div",8)(1,"button",9),V.\u0275\u0275listener("click",function(){V.\u0275\u0275restoreView(e);let n=V.\u0275\u0275nextContext();return V.\u0275\u0275resetView(n.onLogin())}),V.\u0275\u0275elementStart(2,"span"),V.\u0275\u0275text(3),V.\u0275\u0275pipe(4,"translate"),V.\u0275\u0275elementEnd()()()}t&2&&(V.\u0275\u0275advance(3),V.\u0275\u0275textInterpolate(V.\u0275\u0275pipeBind1(4,1,"ng.tip-general.btn.login")))}var Wn=(()=>{class t{constructor(e,i){this.store=e,this.urlService=i}getTelenetLogoPath(){return Qt.getImagePath(ue.TIP,de.TELENET_LOGO)}onLogin(){let e=this.store.selectSnapshot(M.customerZonePageUrl);this.urlService.redirectTo(e)}showLoginButton(){let e=this.store.selectSnapshot(M.message);return e&&e.outcome===S.SUCCESS}static{this.\u0275fac=function(i){return new(i||t)(V.\u0275\u0275directiveInject(Ma.Store),V.\u0275\u0275directiveInject(Ve))}}
3static{this.\u0275cmp=V.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-invitation-confirmation"]],standalone:!1,decls:10,vars:2,consts:[[1,"tip-overview__overlay"],[1,"overlay"],[1,"overlay__mask","opacity--no-transparency"],[1,"overlay__section","background-white"],["alt","",1,"manage-profile-details__image-section",3,"src"],[1,"background-white"],["ngProjectAs","[button]",5,["","button",""]],["class","mb--xxxl mb--n--md",4,"ngIf"],[1,"mb--xxxl","mb--n--md"],[1,"button","button--primary",3,"click"]],template:function(i,n){i&1&&(V.\u0275\u0275elementStart(0,"div",0)(1,"div",1),V.\u0275\u0275element(2,"div",2),V.\u0275\u0275elementStart(3,"div",3)(4,"div"),V.\u0275\u0275element(5,"img",4),V.\u0275\u0275elementEnd(),V.\u0275\u0275elementStart(6,"div",5)(7,"app-tip-messaging"),V.\u0275\u0275elementContainerStart(8,6),V.\u0275\u0275template(9,qm,5,3,"div",7),V.\u0275\u0275elementContainerEnd(),V.\u0275\u0275elementEnd()()()()()),i&2&&(V.\u0275\u0275advance(5),V.\u0275\u0275property("src",n.getTelenetLogoPath(),V.\u0275\u0275sanitizeUrl),V.\u0275\u0275advance(4),V.\u0275\u0275property("ngIf",n.showLoginButton()))},dependencies:[Ra.NgIf,qe,Da.TranslatePipe],encapsulation:2})}}return t})();import"@angular/core";import"@ngxs/store";import*as ae from"@angular/core";import*as Fa from"@ngxs/store";import*as La from"@ngx-translate/core";var ka=(()=>{class t extends D{constructor(e,i){super(),this.store=e,this.urlService=i}ngOnInit(){this.products=this.store.selectSnapshot(M.products),this.store.dispatch(new Je(!1))}goToMarketingPage(){let e=this.store.selectSnapshot(M.marketingPageUrl);this.urlService.redirectTo(e)}static{this.\u0275fac=function(i){return new(i||t)(ae.\u0275\u0275directiveInject(Fa.Store),ae.\u0275\u0275directiveInject(Ve))}}static{this.\u0275cmp=ae.\u0275\u0275defineComponent({type:t,selectors:[["app-tip-not-a-customer"]],standalone:!1,features:[ae.\u0275\u0275InheritDefinitionFeature],decls:7,vars:3,consts:[[1,"row","row--no-gutters","px--m--sm","px--n--lg","display--flex","align-items--center"],[1,"col-12"],[1,"accept-tip-invitation__header","pb--m","mt--xl","mt--xxxl--md"],[1,"display--flex","row","justify-content--center","px--m--sm","px--n--lg","align-items--center"],["appearance","primary","size","md","width","none","pointer-event","auto",3,"click","keydown.enter","keyup.enter","text"]],template:function(i,n){i&1&&(ae.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2),ae.\u0275\u0275element(3,"app-tip-title"),ae.\u0275\u0275elementEnd(),ae.\u0275\u0275elementStart(4,"div",3)(5,"wink-button",4),ae.\u0275\u0275pipe(6,"translate"),ae.\u0275\u0275listener("click",function(){return n.goToMarketingPage()})("keydown.enter",function(){return n.goToMarketingPage()})("keyup.enter",function(){return n.goToMarketingPage()}),ae.\u0275\u0275elementEnd()()()()),i&2&&(ae.\u0275\u0275advance(5),ae.\u0275\u0275property("text",ae.\u0275\u0275pipeBind1(6,1,"ng.accept-tip-invitation.tip-not-a-customer.btn.discover-all-the-products")))},dependencies:[Be,Te,La.TranslatePipe],encapsulation:2})}}return t})();import*as wn from"@angular/core";import*as Ga from"@ngxs/store";var Ua=(()=>{class t extends D{constructor(e){super(),this.store=e,this.selectedCustomerType$=this.store.select(M.selectedCustomerType)}handle(){this.createDefaultStep(),this.obs(this.selectedCustomerType$).subscribe(e=>{switch(e){case Re.EXISTING_CUSTOMER:return this.removeStepsforExistingAndNewCustomer(),this.createExistingCustomerSteps();case Re.NEW_CUSTOMER:return this.removeStepsforExistingAndNewCustomer(),this.createNewCustomerSteps();case Re.EXISTING_DARWIN_CUSTOMER:return this.removeStepsforDarwinCustomerWrongBillingAccountOrLegacyCustomer(),this.createExistingDarwinCustomerSteps();case Re.EXISTING_DARWIN_CUSTOMER_WITH_WRONG_BILLING_ACCOUNT:case Re.MAYBE_LEGACY_CUSTOMER:return this.removeStepsforDarwinCustomerWrongBillingAccountOrLegacyCustomer(),this.createExistingDarwinCustomerWithWrongBillingAccountOrMayBeLegacyCustomerSteps()}})}createDefaultStep(){let e=[];e.push(H.builder(ee.TIP_INVITATION_INTRODUCTION).withTemplate(K).withComponent(sa).build()),e.push(H.builder(ee.TIP_INVITATION_VERIFICATION).withTemplate(K).withComponent(ma).build()),e.push(H.builder(ee.TIP_CHOOSE_CUSTOMER_TYPE).withTemplate(K).withComponent(Ea).build()),this.store.dispatch(new ke(e))}removeStepsforExistingAndNewCustomer(){let e=[ee.TIP_NOT_A_CUSTOMER,ee.TIP_IDENTIFY_CUSTOMER,ee.TIP_CUSTOMER_DETAILS,ee.TIP_CONTRACT_DETAIL,ee.TIP_ACCEPT_TERMS_AND_CON
3DITIONS,ee.TIP_INVITATION_CONFIRMATION];this.store.dispatch(new Ni(e))}removeStepsforDarwinCustomerWrongBillingAccountOrLegacyCustomer(){let e=[ee.TIP_CUSTOMER_DETAILS,ee.TIP_CONTRACT_DETAIL,ee.TIP_ACCEPT_TERMS_AND_CONDITIONS,ee.TIP_INVITATION_CONFIRMATION];this.store.dispatch(new Ni(e))}createNewCustomerSteps(){let e=[];e.push(H.builder(ee.TIP_NOT_A_CUSTOMER).withTemplate(K).withComponent(ka).build()),this.store.dispatch(new kt(e,ee.TIP_CHOOSE_CUSTOMER_TYPE))}createExistingCustomerSteps(){let e=[];e.push(H.builder(ee.TIP_IDENTIFY_CUSTOMER).withTemplate(K).withComponent(Ca).build()),this.store.dispatch(new kt(e,ee.TIP_CHOOSE_CUSTOMER_TYPE))}createExistingDarwinCustomerSteps(){let e=[];e.push(H.builder(ee.TIP_CUSTOMER_DETAILS).withTemplate(K).withComponent(Na).build()),e.push(H.builder(ee.TIP_CONTRACT_DETAIL).withTemplate(K).withComponent(rn).build()),e.push(H.builder(ee.TIP_ACCEPT_TERMS_AND_CONDITIONS).withTemplate(K).withComponent(Oa).build()),e.push(H.builder(ee.TIP_INVITATION_CONFIRMATION).withTemplate(K).withComponent(Wn).build()),this.store.dispatch(new kt(e,ee.TIP_IDENTIFY_CUSTOMER))}createExistingDarwinCustomerWithWrongBillingAccountOrMayBeLegacyCustomerSteps(){let e=[];e.push(H.builder(ee.TIP_INVITATION_CONFIRMATION).withTemplate(K).withComponent(Wn).build()),this.store.dispatch(new kt(e,ee.TIP_IDENTIFY_CUSTOMER))}static{this.\u0275fac=function(i){return new(i||t)(wn.\u0275\u0275inject(Ga.Store))}}static{this.\u0275prov=wn.\u0275\u0275defineInjectable({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ft=(function(t){return t.PLAN_NAME="planName",t.EMPLOYER_CUSOMTOMER_NUMBER="employerCustomerNo",t.COMPANY="company",t.EMP_FIRST_NAME="empFName",t.EMP_REFERENCE="empReference",t.EMP_UNIQUE_ID="uqId",t})(Ft||{});import"@ngxs/store";var Jt=qn(Wa());import*as se from"@angular/core";import*as Va from"@ngxs/store";import*as Ba from"@angular/common";function Km(t,o){t&1&&(se.\u0275\u0275elementStart(0,"div"),se.\u0275\u0275element(1,"app-tip-navigation"),se.\u0275\u0275elementEnd())}var Ya=(()=>{class t extends D{constructor(e,i,n){super(),this.urlService=e,this.store=i,this.acceptTIPInvitationStepHandler=n}ngOnInit(){let e=this.products&&JSON.parse(this.products);this.store.dispatch(new Gt(this.customerZonePageUrl)),this.store.dispatch(new Ut(this.marketingPageUrl)),this.store.dispatch(new Vt(e)),this.store.dispatch([new It(this.readInvitedTIPEmployeeFromQueryParameter()),new he(u.ACCEPT_TIP_INVITATION)]),this.acceptTIPInvitationStepHandler.handle()}readInvitedTIPEmployeeFromQueryParameter(){let e=this.urlService.getRequestParameterOrDefault(Ft.PLAN_NAME,""),i=this.urlService.getRequestParameterOrDefault(Ft.EMPLOYER_CUSOMTOMER_NUMBER,""),n=this.urlService.getRequestParameterOrDefault(Ft.COMPANY,""),p=this.urlService.getRequestParameterOrDefault(Ft.EMP_FIRST_NAME,""),N=this.urlService.getRequestParameterOrDefault(Ft.EMP_REFERENCE,""),Y=this.urlService.getRequestParameterOrDefault(Ft.EMP_UNIQUE_ID,""),ne=new We;return ne.tipPlanName=Jt.Buffer.from(e,"base64").toString("utf8"),ne.employerCustomerNo=Jt.Buffer.from(i,"base64").toString("utf8"),ne.company=Jt.Buffer.from(n,"base64").toString("utf8"),ne.firstName=Jt.Buffer.from(p,"base64").toString("utf8"),ne.employeeReferenceNumber=Jt.Buffer.from(N,"base64").toString("utf8"),ne.employeeUniqueID=Jt.Buffer.from(Y,"base64").toString("utf8"),ne}isNavigationVisible(){let e=this.store.selectSnapshot($.currentStep);return(e&&e.key)!==ee.TIP_INVITATION_CONFIRMATION}static{this.\u0275fac=function(i){return new(i||t)(se.\u0275\u0275directiveInject(Ve),se.\u0275\u0275directiveInject(Va.Store),se.\u0275\u0275directiveInject(Ua))}}static{this.\u0275cmp=se.\u0275\u0275defineComponent({type:t,selectors:[["tg-accept-tip-invitation"]],inputs:{pageType:"pageType",enableLoader:"enableLoader",enableMask:"enableMask",customerZonePageUrl:"customerZonePageUrl",marketingPageUrl:"marketingPageUrl",products:"products"},standalone:!1,features:[se.\u0275\u0275InheritDefinitionFeature],decls:4,vars:5,consts:[[3,"enableLoader","pageType","enableMask","startByDefault"],[1,"accept-tip-invitation","container"],[4,"ngIf"]],template:function(i,n){i&1&&(se.\u0275\u0275element(0,"app-loader",0),se.\u0275\u0275elementStart(1,"div",1),se.\u0275\u0275element(2,"app-step-container"),se.\u0275\u0275template(3,Km,2,0,"div",2),se.\u0275\u0275elementEnd()),i&2&&(se.\u0275\u0275property("enableLoader",n.enableLoader)("pageType",n.pageType)("enableMask",n.enableMask)("startByDefault",!1),se.\u0275\u0275advance(3),se.\u0275\u0275property("ngIf",n.isNavigationVisible()))},dependencies:[Ba.NgIf,Pt,oi,Ei],encapsulation:2})}}return t})();import{provideHttpClient as Qm}from"@angular/common/http";import*as On from"@angular/core";var XP=(()=>{class t{static{this.components={"tg-tip-contracts-overview":lr,"tg-tip-employees-overview":oa,"tg-manage-tip-employee":yn,"tg-accept-tip-invitation":Ya}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=On.\u0275\u0275defineNgModule({type:t})}static{this.\u0275inj=On.\u0275\u0275defineInjector({providers:[Qm(),Xm([B,h,M]
3)],imports:[zm,po,$m,uo,Zm,Jm,be,lo,so,ao,Ki,ji,Be,ei,Lt,Wi,ti,ui,ni,Yi,ii,Lt,Bi]})}}return t})();export{XP as TipNCModule};

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.